diff --git a/.gitignore b/.gitignore index c54c8018ea8..658c4d0d8ea 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ tests/services/baselines/local/* tests/baselines/prototyping/local/* tests/baselines/rwc/* tests/baselines/test262/* +tests/baselines/local/projectOutput/* tests/services/baselines/prototyping/local/* tests/services/browser/typescriptServices.js scripts/processDiagnosticMessages.d.ts diff --git a/Jakefile b/Jakefile index dd09085800c..2efd973a021 100644 --- a/Jakefile +++ b/Jakefile @@ -111,6 +111,7 @@ var definitionsRoots = [ "compiler/parser.d.ts", "compiler/checker.d.ts", "compiler/program.d.ts", + "compiler/commandLineParser.d.ts", "services/services.d.ts", ]; @@ -143,7 +144,8 @@ var harnessSources = [ "services/colorization.ts", "services/documentRegistry.ts", "services/preProcessFile.ts", - "services/patternMatcher.ts" + "services/patternMatcher.ts", + "versionCache.ts" ].map(function (f) { return path.join(unittestsDirectory, f); })).concat([ @@ -222,15 +224,17 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOu var dir = useBuiltCompiler ? builtLocalDirectory : LKGDirectory; var options = "--module commonjs -noImplicitAny"; - if (!keepComments) { - options += " -removeComments"; + // Keep comments when specifically requested + // or when in debug mode. + if (!(keepComments || useDebugMode)) { + options += " --removeComments"; } if (generateDeclarations) { options += " --declaration"; } - if (useDebugMode || preserveConstEnums) { + if (preserveConstEnums || useDebugMode) { options += " --preserveConstEnums"; } @@ -254,8 +258,6 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOu options += " --stripInternal" } - options += " --cacheDownlevelForOfLength --preserveNewLines"; - var cmd = host + " " + dir + compilerFilename + " " + options + " "; cmd = cmd + sources.join(" "); console.log(cmd + "\n"); diff --git a/bin/lib.core.d.ts b/bin/lib.core.d.ts index 132f5ffaccf..bc4225b0d82 100644 --- a/bin/lib.core.d.ts +++ b/bin/lib.core.d.ts @@ -1170,3 +1170,17 @@ interface ArrayConstructor { } declare var Array: ArrayConstructor; + +interface TypedPropertyDescriptor { + enumerable?: boolean; + configurable?: boolean; + writable?: boolean; + value?: T; + get?: () => T; + set?: (value: T) => void; +} + +declare type ClassDecorator = (target: TFunction) => TFunction | void; +declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void; +declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; +declare type ParameterDecorator = (target: Function, propertyKey: string | symbol, parameterIndex: number) => void; diff --git a/bin/lib.core.es6.d.ts b/bin/lib.core.es6.d.ts index c6f3d1d1f97..97c1c7d1b40 100644 --- a/bin/lib.core.es6.d.ts +++ b/bin/lib.core.es6.d.ts @@ -1170,6 +1170,20 @@ interface ArrayConstructor { } declare var Array: ArrayConstructor; + +interface TypedPropertyDescriptor { + enumerable?: boolean; + configurable?: boolean; + writable?: boolean; + value?: T; + get?: () => T; + set?: (value: T) => void; +} + +declare type ClassDecorator = (target: TFunction) => TFunction | void; +declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void; +declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; +declare type ParameterDecorator = (target: Function, propertyKey: string | symbol, parameterIndex: number) => void; declare type PropertyKey = string | number | symbol; interface Symbol { diff --git a/bin/lib.d.ts b/bin/lib.d.ts index e22c7351931..e0fdf442967 100644 --- a/bin/lib.d.ts +++ b/bin/lib.d.ts @@ -1171,6 +1171,20 @@ interface ArrayConstructor { declare var Array: ArrayConstructor; +interface TypedPropertyDescriptor { + enumerable?: boolean; + configurable?: boolean; + writable?: boolean; + value?: T; + get?: () => T; + set?: (value: T) => void; +} + +declare type ClassDecorator = (target: TFunction) => TFunction | void; +declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void; +declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; +declare type ParameterDecorator = (target: Function, propertyKey: string | symbol, parameterIndex: number) => void; + ///////////////////////////// /// IE10 ECMAScript Extensions ///////////////////////////// @@ -14209,7 +14223,11 @@ declare function importScripts(...urls: string[]): void; /// Windows Script Host APIS ///////////////////////////// -declare var ActiveXObject: { new (s: string): any; }; + +interface ActiveXObject { + new (s: string): any; +} +declare var ActiveXObject: ActiveXObject; interface ITextWriter { Write(s: string): void; @@ -14217,11 +14235,157 @@ interface ITextWriter { Close(): void; } -declare var WScript: { - Echo(s: any): void; - StdErr: ITextWriter; - StdOut: ITextWriter; - Arguments: { length: number; Item(n: number): string; }; - ScriptFullName: string; - Quit(exitCode?: number): number; +interface TextStreamBase { + /** + * The column number of the current character position in an input stream. + */ + Column: number; + /** + * The current line number in an input stream. + */ + Line: number; + /** + * Closes a text stream. + * It is not necessary to close standard streams; they close automatically when the process ends. If you close a standard stream, be aware that any other pointers to that standard stream become invalid. + */ + Close(): void; } + +interface TextStreamWriter extends TextStreamBase { + /** + * Sends a string to an output stream. + */ + Write(s: string): void; + /** + * Sends a specified number of blank lines (newline characters) to an output stream. + */ + WriteBlankLines(intLines: number): void; + /** + * Sends a string followed by a newline character to an output stream. + */ + WriteLine(s: string): void; +} + +interface TextStreamReader extends TextStreamBase { + /** + * Returns a specified number of characters from an input stream, beginning at the current pointer position. + * Does not return until the ENTER key is pressed. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + Read(characters: number): string; + /** + * Returns all characters from an input stream. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + ReadAll(): string; + /** + * Returns an entire line from an input stream. + * Although this method extracts the newline character, it does not add it to the returned string. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + ReadLine(): string; + /** + * Skips a specified number of characters when reading from an input text stream. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.) + */ + Skip(characters: number): void; + /** + * Skips the next line when reading from an input text stream. + * Can only be used on a stream in reading mode, not writing or appending mode. + */ + SkipLine(): void; + /** + * Indicates whether the stream pointer position is at the end of a line. + */ + AtEndOfLine: boolean; + /** + * Indicates whether the stream pointer position is at the end of a stream. + */ + AtEndOfStream: boolean; +} + +declare var WScript: { + /** + * Outputs text to either a message box (under WScript.exe) or the command console window followed by a newline (under CScript.ext). + */ + Echo(s: any): void; + /** + * Exposes the write-only error output stream for the current script. + * Can be accessed only while using CScript.exe. + */ + StdErr: TextStreamWriter; + /** + * Exposes the write-only output stream for the current script. + * Can be accessed only while using CScript.exe. + */ + StdOut: TextStreamWriter; + Arguments: { length: number; Item(n: number): string; }; + /** + * The full path of the currently running script. + */ + ScriptFullName: string; + /** + * Forces the script to stop immediately, with an optional exit code. + */ + Quit(exitCode?: number): number; + /** + * The Windows Script Host build version number. + */ + BuildVersion: number; + /** + * Fully qualified path of the host executable. + */ + FullName: string; + /** + * Gets/sets the script mode - interactive(true) or batch(false). + */ + Interactive: boolean; + /** + * The name of the host executable (WScript.exe or CScript.exe). + */ + Name: string; + /** + * Path of the directory containing the host executable. + */ + Path: string; + /** + * The filename of the currently running script. + */ + ScriptName: string; + /** + * Exposes the read-only input stream for the current script. + * Can be accessed only while using CScript.exe. + */ + StdIn: TextStreamReader; + /** + * Windows Script Host version + */ + Version: string; + /** + * Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event. + */ + ConnectObject(objEventSource: any, strPrefix: string): void; + /** + * Creates a COM object. + * @param strProgiID + * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. + */ + CreateObject(strProgID: string, strPrefix?: string): any; + /** + * Disconnects a COM object from its event sources. + */ + DisconnectObject(obj: any): void; + /** + * Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file. + * @param strPathname Fully qualified path to the file containing the object persisted to disk. For objects in memory, pass a zero-length string. + * @param strProgID + * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. + */ + GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any; + /** + * Suspends script execution for a specified length of time, then continues execution. + * @param intTime Interval (in milliseconds) to suspend script execution. + */ + Sleep(intTime: number): void; +}; diff --git a/bin/lib.es6.d.ts b/bin/lib.es6.d.ts index cf849d5c72d..edc51cad7cc 100644 --- a/bin/lib.es6.d.ts +++ b/bin/lib.es6.d.ts @@ -1170,6 +1170,20 @@ interface ArrayConstructor { } declare var Array: ArrayConstructor; + +interface TypedPropertyDescriptor { + enumerable?: boolean; + configurable?: boolean; + writable?: boolean; + value?: T; + get?: () => T; + set?: (value: T) => void; +} + +declare type ClassDecorator = (target: TFunction) => TFunction | void; +declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void; +declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; +declare type ParameterDecorator = (target: Function, propertyKey: string | symbol, parameterIndex: number) => void; declare type PropertyKey = string | number | symbol; interface Symbol { @@ -17191,7 +17205,11 @@ declare function importScripts(...urls: string[]): void; /// Windows Script Host APIS ///////////////////////////// -declare var ActiveXObject: { new (s: string): any; }; + +interface ActiveXObject { + new (s: string): any; +} +declare var ActiveXObject: ActiveXObject; interface ITextWriter { Write(s: string): void; @@ -17199,11 +17217,157 @@ interface ITextWriter { Close(): void; } -declare var WScript: { - Echo(s: any): void; - StdErr: ITextWriter; - StdOut: ITextWriter; - Arguments: { length: number; Item(n: number): string; }; - ScriptFullName: string; - Quit(exitCode?: number): number; +interface TextStreamBase { + /** + * The column number of the current character position in an input stream. + */ + Column: number; + /** + * The current line number in an input stream. + */ + Line: number; + /** + * Closes a text stream. + * It is not necessary to close standard streams; they close automatically when the process ends. If you close a standard stream, be aware that any other pointers to that standard stream become invalid. + */ + Close(): void; } + +interface TextStreamWriter extends TextStreamBase { + /** + * Sends a string to an output stream. + */ + Write(s: string): void; + /** + * Sends a specified number of blank lines (newline characters) to an output stream. + */ + WriteBlankLines(intLines: number): void; + /** + * Sends a string followed by a newline character to an output stream. + */ + WriteLine(s: string): void; +} + +interface TextStreamReader extends TextStreamBase { + /** + * Returns a specified number of characters from an input stream, beginning at the current pointer position. + * Does not return until the ENTER key is pressed. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + Read(characters: number): string; + /** + * Returns all characters from an input stream. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + ReadAll(): string; + /** + * Returns an entire line from an input stream. + * Although this method extracts the newline character, it does not add it to the returned string. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + ReadLine(): string; + /** + * Skips a specified number of characters when reading from an input text stream. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.) + */ + Skip(characters: number): void; + /** + * Skips the next line when reading from an input text stream. + * Can only be used on a stream in reading mode, not writing or appending mode. + */ + SkipLine(): void; + /** + * Indicates whether the stream pointer position is at the end of a line. + */ + AtEndOfLine: boolean; + /** + * Indicates whether the stream pointer position is at the end of a stream. + */ + AtEndOfStream: boolean; +} + +declare var WScript: { + /** + * Outputs text to either a message box (under WScript.exe) or the command console window followed by a newline (under CScript.ext). + */ + Echo(s: any): void; + /** + * Exposes the write-only error output stream for the current script. + * Can be accessed only while using CScript.exe. + */ + StdErr: TextStreamWriter; + /** + * Exposes the write-only output stream for the current script. + * Can be accessed only while using CScript.exe. + */ + StdOut: TextStreamWriter; + Arguments: { length: number; Item(n: number): string; }; + /** + * The full path of the currently running script. + */ + ScriptFullName: string; + /** + * Forces the script to stop immediately, with an optional exit code. + */ + Quit(exitCode?: number): number; + /** + * The Windows Script Host build version number. + */ + BuildVersion: number; + /** + * Fully qualified path of the host executable. + */ + FullName: string; + /** + * Gets/sets the script mode - interactive(true) or batch(false). + */ + Interactive: boolean; + /** + * The name of the host executable (WScript.exe or CScript.exe). + */ + Name: string; + /** + * Path of the directory containing the host executable. + */ + Path: string; + /** + * The filename of the currently running script. + */ + ScriptName: string; + /** + * Exposes the read-only input stream for the current script. + * Can be accessed only while using CScript.exe. + */ + StdIn: TextStreamReader; + /** + * Windows Script Host version + */ + Version: string; + /** + * Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event. + */ + ConnectObject(objEventSource: any, strPrefix: string): void; + /** + * Creates a COM object. + * @param strProgiID + * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. + */ + CreateObject(strProgID: string, strPrefix?: string): any; + /** + * Disconnects a COM object from its event sources. + */ + DisconnectObject(obj: any): void; + /** + * Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file. + * @param strPathname Fully qualified path to the file containing the object persisted to disk. For objects in memory, pass a zero-length string. + * @param strProgID + * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. + */ + GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any; + /** + * Suspends script execution for a specified length of time, then continues execution. + * @param intTime Interval (in milliseconds) to suspend script execution. + */ + Sleep(intTime: number): void; +}; diff --git a/bin/lib.scriptHost.d.ts b/bin/lib.scriptHost.d.ts index 1498aeea63a..17b1fe956a2 100644 --- a/bin/lib.scriptHost.d.ts +++ b/bin/lib.scriptHost.d.ts @@ -20,7 +20,11 @@ and limitations under the License. /// Windows Script Host APIS ///////////////////////////// -declare var ActiveXObject: { new (s: string): any; }; + +interface ActiveXObject { + new (s: string): any; +} +declare var ActiveXObject: ActiveXObject; interface ITextWriter { Write(s: string): void; @@ -28,11 +32,157 @@ interface ITextWriter { Close(): void; } -declare var WScript: { - Echo(s: any): void; - StdErr: ITextWriter; - StdOut: ITextWriter; - Arguments: { length: number; Item(n: number): string; }; - ScriptFullName: string; - Quit(exitCode?: number): number; +interface TextStreamBase { + /** + * The column number of the current character position in an input stream. + */ + Column: number; + /** + * The current line number in an input stream. + */ + Line: number; + /** + * Closes a text stream. + * It is not necessary to close standard streams; they close automatically when the process ends. If you close a standard stream, be aware that any other pointers to that standard stream become invalid. + */ + Close(): void; } + +interface TextStreamWriter extends TextStreamBase { + /** + * Sends a string to an output stream. + */ + Write(s: string): void; + /** + * Sends a specified number of blank lines (newline characters) to an output stream. + */ + WriteBlankLines(intLines: number): void; + /** + * Sends a string followed by a newline character to an output stream. + */ + WriteLine(s: string): void; +} + +interface TextStreamReader extends TextStreamBase { + /** + * Returns a specified number of characters from an input stream, beginning at the current pointer position. + * Does not return until the ENTER key is pressed. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + Read(characters: number): string; + /** + * Returns all characters from an input stream. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + ReadAll(): string; + /** + * Returns an entire line from an input stream. + * Although this method extracts the newline character, it does not add it to the returned string. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + ReadLine(): string; + /** + * Skips a specified number of characters when reading from an input text stream. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.) + */ + Skip(characters: number): void; + /** + * Skips the next line when reading from an input text stream. + * Can only be used on a stream in reading mode, not writing or appending mode. + */ + SkipLine(): void; + /** + * Indicates whether the stream pointer position is at the end of a line. + */ + AtEndOfLine: boolean; + /** + * Indicates whether the stream pointer position is at the end of a stream. + */ + AtEndOfStream: boolean; +} + +declare var WScript: { + /** + * Outputs text to either a message box (under WScript.exe) or the command console window followed by a newline (under CScript.ext). + */ + Echo(s: any): void; + /** + * Exposes the write-only error output stream for the current script. + * Can be accessed only while using CScript.exe. + */ + StdErr: TextStreamWriter; + /** + * Exposes the write-only output stream for the current script. + * Can be accessed only while using CScript.exe. + */ + StdOut: TextStreamWriter; + Arguments: { length: number; Item(n: number): string; }; + /** + * The full path of the currently running script. + */ + ScriptFullName: string; + /** + * Forces the script to stop immediately, with an optional exit code. + */ + Quit(exitCode?: number): number; + /** + * The Windows Script Host build version number. + */ + BuildVersion: number; + /** + * Fully qualified path of the host executable. + */ + FullName: string; + /** + * Gets/sets the script mode - interactive(true) or batch(false). + */ + Interactive: boolean; + /** + * The name of the host executable (WScript.exe or CScript.exe). + */ + Name: string; + /** + * Path of the directory containing the host executable. + */ + Path: string; + /** + * The filename of the currently running script. + */ + ScriptName: string; + /** + * Exposes the read-only input stream for the current script. + * Can be accessed only while using CScript.exe. + */ + StdIn: TextStreamReader; + /** + * Windows Script Host version + */ + Version: string; + /** + * Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event. + */ + ConnectObject(objEventSource: any, strPrefix: string): void; + /** + * Creates a COM object. + * @param strProgiID + * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. + */ + CreateObject(strProgID: string, strPrefix?: string): any; + /** + * Disconnects a COM object from its event sources. + */ + DisconnectObject(obj: any): void; + /** + * Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file. + * @param strPathname Fully qualified path to the file containing the object persisted to disk. For objects in memory, pass a zero-length string. + * @param strProgID + * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. + */ + GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any; + /** + * Suspends script execution for a specified length of time, then continues execution. + * @param intTime Interval (in milliseconds) to suspend script execution. + */ + Sleep(intTime: number): void; +}; diff --git a/bin/tsc.js b/bin/tsc.js index 1d7c008595d..2acb2dd3a12 100644 --- a/bin/tsc.js +++ b/bin/tsc.js @@ -28,6 +28,7 @@ var ts; })(ts.DiagnosticCategory || (ts.DiagnosticCategory = {})); var DiagnosticCategory = ts.DiagnosticCategory; })(ts || (ts = {})); +/// var ts; (function (ts) { function forEach(array, callback) { @@ -44,7 +45,7 @@ var ts; ts.forEach = forEach; function contains(array, value) { if (array) { - for (var _i = 0, _n = array.length; _i < _n; _i++) { + for (var _i = 0; _i < array.length; _i++) { var v = array[_i]; if (v === value) { return true; @@ -68,7 +69,7 @@ var ts; function countWhere(array, predicate) { var count = 0; if (array) { - for (var _i = 0, _n = array.length; _i < _n; _i++) { + for (var _i = 0; _i < array.length; _i++) { var v = array[_i]; if (predicate(v)) { count++; @@ -82,10 +83,10 @@ var ts; var result; if (array) { result = []; - for (var _i = 0, _n = array.length; _i < _n; _i++) { - var _item = array[_i]; - if (f(_item)) { - result.push(_item); + for (var _i = 0; _i < array.length; _i++) { + var item_1 = array[_i]; + if (f(item_1)) { + result.push(item_1); } } } @@ -96,7 +97,7 @@ var ts; var result; if (array) { result = []; - for (var _i = 0, _n = array.length; _i < _n; _i++) { + for (var _i = 0; _i < array.length; _i++) { var v = array[_i]; result.push(f(v)); } @@ -116,10 +117,10 @@ var ts; var result; if (array) { result = []; - for (var _i = 0, _n = array.length; _i < _n; _i++) { - var _item = array[_i]; - if (!contains(result, _item)) { - result.push(_item); + for (var _i = 0; _i < array.length; _i++) { + var item_2 = array[_i]; + if (!contains(result, item_2)) { + result.push(item_2); } } } @@ -128,7 +129,7 @@ var ts; ts.deduplicate = deduplicate; function sum(array, prop) { var result = 0; - for (var _i = 0, _n = array.length; _i < _n; _i++) { + for (var _i = 0; _i < array.length; _i++) { var v = array[_i]; result += v[prop]; } @@ -136,9 +137,11 @@ var ts; } ts.sum = sum; function addRange(to, from) { - for (var _i = 0, _n = from.length; _i < _n; _i++) { - var v = from[_i]; - to.push(v); + if (to && from) { + for (var _i = 0; _i < from.length; _i++) { + var v = from[_i]; + to.push(v); + } } } ts.addRange = addRange; @@ -168,6 +171,35 @@ var ts; return ~low; } ts.binarySearch = binarySearch; + function reduceLeft(array, f, initial) { + if (array) { + var count = array.length; + if (count > 0) { + var pos = 0; + var result = arguments.length <= 2 ? array[pos++] : initial; + while (pos < count) { + result = f(result, array[pos++]); + } + return result; + } + } + return initial; + } + ts.reduceLeft = reduceLeft; + function reduceRight(array, f, initial) { + if (array) { + var pos = array.length - 1; + if (pos >= 0) { + var result = arguments.length <= 2 ? array[pos--] : initial; + while (pos >= 0) { + result = f(result, array[pos--]); + } + return result; + } + } + return initial; + } + ts.reduceRight = reduceRight; var hasOwnProperty = Object.prototype.hasOwnProperty; function hasProperty(map, key) { return hasOwnProperty.call(map, key); @@ -199,9 +231,9 @@ var ts; for (var id in first) { result[id] = first[id]; } - for (var _id in second) { - if (!hasProperty(result, _id)) { - result[_id] = second[_id]; + for (var id in second) { + if (!hasProperty(result, id)) { + result[id] = second[id]; } } return result; @@ -229,14 +261,6 @@ var ts; return hasProperty(map, key) ? map[key] : undefined; } ts.lookUp = lookUp; - function mapToArray(map) { - var result = []; - for (var id in map) { - result.push(map[id]); - } - return result; - } - ts.mapToArray = mapToArray; function copyMap(source, target) { for (var p in source) { target[p] = source[p]; @@ -253,13 +277,13 @@ var ts; ts.arrayToMap = arrayToMap; function formatStringFromArgs(text, args, baseIndex) { baseIndex = baseIndex || 0; - return text.replace(/{(\d+)}/g, function (match, index) { return args[+index + baseIndex]; }); + return text.replace(/{(\d+)}/g, function (match, index) { + return args[+index + baseIndex]; + }); } ts.localizedDiagnosticMessages = undefined; function getLocaleSpecificMessage(message) { - return ts.localizedDiagnosticMessages && ts.localizedDiagnosticMessages[message] - ? ts.localizedDiagnosticMessages[message] - : message; + return ts.localizedDiagnosticMessages && ts.localizedDiagnosticMessages[message] ? ts.localizedDiagnosticMessages[message] : message; } ts.getLocaleSpecificMessage = getLocaleSpecificMessage; function createFileDiagnostic(file, start, length, message) { @@ -330,12 +354,7 @@ var ts; return diagnostic.file ? diagnostic.file.fileName : undefined; } function compareDiagnostics(d1, d2) { - return compareValues(getDiagnosticFileName(d1), getDiagnosticFileName(d2)) || - compareValues(d1.start, d2.start) || - compareValues(d1.length, d2.length) || - compareValues(d1.code, d2.code) || - compareMessageText(d1.messageText, d2.messageText) || - 0; + return compareValues(getDiagnosticFileName(d1), getDiagnosticFileName(d2)) || compareValues(d1.start, d2.start) || compareValues(d1.length, d2.length) || compareValues(d1.code, d2.code) || compareMessageText(d1.messageText, d2.messageText) || 0; } ts.compareDiagnostics = compareDiagnostics; function compareMessageText(text1, text2) { @@ -362,7 +381,9 @@ var ts; if (diagnostics.length < 2) { return diagnostics; } - var newDiagnostics = [diagnostics[0]]; + var newDiagnostics = [ + diagnostics[0] + ]; var previousDiagnostic = diagnostics[0]; for (var i = 1; i < diagnostics.length; i++) { var currentDiagnostic = diagnostics[i]; @@ -403,7 +424,7 @@ var ts; function getNormalizedParts(normalizedSlashedPath, rootLength) { var parts = normalizedSlashedPath.substr(rootLength).split(ts.directorySeparator); var normalized = []; - for (var _i = 0, _n = parts.length; _i < _n; _i++) { + for (var _i = 0; _i < parts.length; _i++) { var part = parts[_i]; if (part !== ".") { if (part === ".." && normalized.length > 0 && normalized[normalized.length - 1] !== "..") { @@ -439,7 +460,9 @@ var ts; ts.isRootedDiskPath = isRootedDiskPath; function normalizedPathComponents(path, rootLength) { var normalizedParts = getNormalizedParts(path, rootLength); - return [path.substr(0, rootLength)].concat(normalizedParts); + return [ + path.substr(0, rootLength) + ].concat(normalizedParts); } function getNormalizedPathComponents(path, currentDirectory) { path = normalizeSlashes(path); @@ -462,6 +485,9 @@ var ts; } ts.getNormalizedPathFromPathComponents = getNormalizedPathFromPathComponents; function getNormalizedPathComponentsOfUrl(url) { + // Get root length of http://www.website.com/folder1/foler2/ + // In this example the root is: http://www.website.com/ + // normalized path components should be ["http://www.website.com/", "folder1", "folder2"] var urlLength = url.length; var rootLength = url.indexOf("://") + "://".length; while (rootLength < urlLength) { @@ -473,7 +499,9 @@ var ts; } } if (rootLength === urlLength) { - return [url]; + return [ + url + ]; } var indexOfNextSlash = url.indexOf(ts.directorySeparator, rootLength); if (indexOfNextSlash !== -1) { @@ -481,7 +509,9 @@ var ts; return normalizedPathComponents(url, rootLength); } else { - return [url + ts.directorySeparator]; + return [ + url + ts.directorySeparator + ]; } } function getNormalizedPathOrUrlComponents(pathOrUrl, currentDirectory) { @@ -543,9 +573,13 @@ var ts; return pathLen > extLen && path.substr(pathLen - extLen, extLen) === extension; } ts.fileExtensionIs = fileExtensionIs; - var supportedExtensions = [".d.ts", ".ts", ".js"]; + var supportedExtensions = [ + ".d.ts", + ".ts", + ".js" + ]; function removeFileExtension(path) { - for (var _i = 0, _n = supportedExtensions.length; _i < _n; _i++) { + for (var _i = 0; _i < supportedExtensions.length; _i++) { var ext = supportedExtensions[_i]; if (fileExtensionIs(path, ext)) { return path.substr(0, path.length - ext.length); @@ -597,9 +631,15 @@ var ts; }; return Node; }, - getSymbolConstructor: function () { return Symbol; }, - getTypeConstructor: function () { return Type; }, - getSignatureConstructor: function () { return Signature; } + getSymbolConstructor: function () { + return Symbol; + }, + getTypeConstructor: function () { + return Type; + }, + getSignatureConstructor: function () { + return Signature; + } }; var Debug; (function (Debug) { @@ -624,6 +664,7 @@ var ts; Debug.fail = fail; })(Debug = ts.Debug || (ts.Debug = {})); })(ts || (ts = {})); +/// var ts; (function (ts) { ts.sys = (function () { @@ -697,14 +738,14 @@ var ts; function visitDirectory(path) { var folder = fso.GetFolder(path || "."); var files = getNames(folder.files); - for (var _i = 0, _n = files.length; _i < _n; _i++) { - var _name = files[_i]; - if (!extension || ts.fileExtensionIs(_name, extension)) { - result.push(ts.combinePaths(path, _name)); + for (var _i = 0; _i < files.length; _i++) { + var name_1 = files[_i]; + if (!extension || ts.fileExtensionIs(name_1, extension)) { + result.push(ts.combinePaths(path, name_1)); } } var subfolders = getNames(folder.subfolders); - for (var _a = 0, _b = subfolders.length; _a < _b; _a++) { + for (var _a = 0; _a < subfolders.length; _a++) { var current = subfolders[_a]; visitDirectory(ts.combinePaths(path, current)); } @@ -791,7 +832,7 @@ var ts; function visitDirectory(path) { var files = _fs.readdirSync(path || ".").sort(); var directories = []; - for (var _i = 0, _n = files.length; _i < _n; _i++) { + for (var _i = 0; _i < files.length; _i++) { var current = files[_i]; var name = ts.combinePaths(path, current); var stat = _fs.lstatSync(name); @@ -804,9 +845,9 @@ var ts; directories.push(name); } } - for (var _a = 0, _b = directories.length; _a < _b; _a++) { - var _current = directories[_a]; - visitDirectory(_current); + for (var _a = 0; _a < directories.length; _a++) { + var current = directories[_a]; + visitDirectory(current); } } } @@ -820,9 +861,14 @@ var ts; readFile: readFile, writeFile: writeFile, watchFile: function (fileName, callback) { - _fs.watchFile(fileName, { persistent: true, interval: 250 }, fileChanged); + _fs.watchFile(fileName, { + persistent: true, + interval: 250 + }, fileChanged); return { - close: function () { _fs.unwatchFile(fileName, fileChanged); } + close: function () { + _fs.unwatchFile(fileName, fileChanged); + } }; function fileChanged(curr, prev) { if (+curr.mtime <= +prev.mtime) { @@ -875,559 +921,2617 @@ var ts; } })(); })(ts || (ts = {})); +/// var ts; (function (ts) { ts.Diagnostics = { - Unterminated_string_literal: { code: 1002, category: 1, key: "Unterminated string literal." }, - Identifier_expected: { code: 1003, category: 1, key: "Identifier expected." }, - _0_expected: { code: 1005, category: 1, key: "'{0}' expected." }, - A_file_cannot_have_a_reference_to_itself: { code: 1006, category: 1, key: "A file cannot have a reference to itself." }, - Trailing_comma_not_allowed: { code: 1009, category: 1, key: "Trailing comma not allowed." }, - Asterisk_Slash_expected: { code: 1010, category: 1, key: "'*/' expected." }, - Unexpected_token: { code: 1012, category: 1, key: "Unexpected token." }, - A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: 1, key: "A rest parameter must be last in a parameter list." }, - Parameter_cannot_have_question_mark_and_initializer: { code: 1015, category: 1, key: "Parameter cannot have question mark and initializer." }, - A_required_parameter_cannot_follow_an_optional_parameter: { code: 1016, category: 1, key: "A required parameter cannot follow an optional parameter." }, - An_index_signature_cannot_have_a_rest_parameter: { code: 1017, category: 1, key: "An index signature cannot have a rest parameter." }, - An_index_signature_parameter_cannot_have_an_accessibility_modifier: { code: 1018, category: 1, key: "An index signature parameter cannot have an accessibility modifier." }, - An_index_signature_parameter_cannot_have_a_question_mark: { code: 1019, category: 1, key: "An index signature parameter cannot have a question mark." }, - An_index_signature_parameter_cannot_have_an_initializer: { code: 1020, category: 1, key: "An index signature parameter cannot have an initializer." }, - An_index_signature_must_have_a_type_annotation: { code: 1021, category: 1, key: "An index signature must have a type annotation." }, - An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: 1, key: "An index signature parameter must have a type annotation." }, - An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: 1, key: "An index signature parameter type must be 'string' or 'number'." }, - A_class_or_interface_declaration_can_only_have_one_extends_clause: { code: 1024, category: 1, key: "A class or interface declaration can only have one 'extends' clause." }, - An_extends_clause_must_precede_an_implements_clause: { code: 1025, category: 1, key: "An 'extends' clause must precede an 'implements' clause." }, - A_class_can_only_extend_a_single_class: { code: 1026, category: 1, key: "A class can only extend a single class." }, - A_class_declaration_can_only_have_one_implements_clause: { code: 1027, category: 1, key: "A class declaration can only have one 'implements' clause." }, - Accessibility_modifier_already_seen: { code: 1028, category: 1, key: "Accessibility modifier already seen." }, - _0_modifier_must_precede_1_modifier: { code: 1029, category: 1, key: "'{0}' modifier must precede '{1}' modifier." }, - _0_modifier_already_seen: { code: 1030, category: 1, key: "'{0}' modifier already seen." }, - _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: 1, key: "'{0}' modifier cannot appear on a class element." }, - An_interface_declaration_cannot_have_an_implements_clause: { code: 1032, category: 1, key: "An interface declaration cannot have an 'implements' clause." }, - super_must_be_followed_by_an_argument_list_or_member_access: { code: 1034, category: 1, key: "'super' must be followed by an argument list or member access." }, - Only_ambient_modules_can_use_quoted_names: { code: 1035, category: 1, key: "Only ambient modules can use quoted names." }, - Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: 1, key: "Statements are not allowed in ambient contexts." }, - A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { code: 1038, category: 1, key: "A 'declare' modifier cannot be used in an already ambient context." }, - Initializers_are_not_allowed_in_ambient_contexts: { code: 1039, category: 1, key: "Initializers are not allowed in ambient contexts." }, - _0_modifier_cannot_appear_on_a_module_element: { code: 1044, category: 1, key: "'{0}' modifier cannot appear on a module element." }, - A_declare_modifier_cannot_be_used_with_an_interface_declaration: { code: 1045, category: 1, key: "A 'declare' modifier cannot be used with an interface declaration." }, - A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { code: 1046, category: 1, key: "A 'declare' modifier is required for a top level declaration in a .d.ts file." }, - A_rest_parameter_cannot_be_optional: { code: 1047, category: 1, key: "A rest parameter cannot be optional." }, - A_rest_parameter_cannot_have_an_initializer: { code: 1048, category: 1, key: "A rest parameter cannot have an initializer." }, - A_set_accessor_must_have_exactly_one_parameter: { code: 1049, category: 1, key: "A 'set' accessor must have exactly one parameter." }, - A_set_accessor_cannot_have_an_optional_parameter: { code: 1051, category: 1, key: "A 'set' accessor cannot have an optional parameter." }, - A_set_accessor_parameter_cannot_have_an_initializer: { code: 1052, category: 1, key: "A 'set' accessor parameter cannot have an initializer." }, - A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: 1, key: "A 'set' accessor cannot have rest parameter." }, - A_get_accessor_cannot_have_parameters: { code: 1054, category: 1, key: "A 'get' accessor cannot have parameters." }, - Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: 1, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, - Enum_member_must_have_initializer: { code: 1061, category: 1, key: "Enum member must have initializer." }, - An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: 1, key: "An export assignment cannot be used in an internal module." }, - Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: 1, key: "Ambient enum elements can only have integer literal initializers." }, - Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: 1, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, - A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: 1, key: "A 'declare' modifier cannot be used with an import declaration." }, - Invalid_reference_directive_syntax: { code: 1084, category: 1, key: "Invalid 'reference' directive syntax." }, - Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: 1, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, - An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: 1, key: "An accessor cannot be declared in an ambient context." }, - _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: 1, key: "'{0}' modifier cannot appear on a constructor declaration." }, - _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: 1, key: "'{0}' modifier cannot appear on a parameter." }, - Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { code: 1091, category: 1, key: "Only a single variable declaration is allowed in a 'for...in' statement." }, - Type_parameters_cannot_appear_on_a_constructor_declaration: { code: 1092, category: 1, key: "Type parameters cannot appear on a constructor declaration." }, - Type_annotation_cannot_appear_on_a_constructor_declaration: { code: 1093, category: 1, key: "Type annotation cannot appear on a constructor declaration." }, - An_accessor_cannot_have_type_parameters: { code: 1094, category: 1, key: "An accessor cannot have type parameters." }, - A_set_accessor_cannot_have_a_return_type_annotation: { code: 1095, category: 1, key: "A 'set' accessor cannot have a return type annotation." }, - An_index_signature_must_have_exactly_one_parameter: { code: 1096, category: 1, key: "An index signature must have exactly one parameter." }, - _0_list_cannot_be_empty: { code: 1097, category: 1, key: "'{0}' list cannot be empty." }, - Type_parameter_list_cannot_be_empty: { code: 1098, category: 1, key: "Type parameter list cannot be empty." }, - Type_argument_list_cannot_be_empty: { code: 1099, category: 1, key: "Type argument list cannot be empty." }, - Invalid_use_of_0_in_strict_mode: { code: 1100, category: 1, key: "Invalid use of '{0}' in strict mode." }, - with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: 1, key: "'with' statements are not allowed in strict mode." }, - delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: 1, key: "'delete' cannot be called on an identifier in strict mode." }, - A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: 1, key: "A 'continue' statement can only be used within an enclosing iteration statement." }, - A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: 1, key: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, - Jump_target_cannot_cross_function_boundary: { code: 1107, category: 1, key: "Jump target cannot cross function boundary." }, - A_return_statement_can_only_be_used_within_a_function_body: { code: 1108, category: 1, key: "A 'return' statement can only be used within a function body." }, - Expression_expected: { code: 1109, category: 1, key: "Expression expected." }, - Type_expected: { code: 1110, category: 1, key: "Type expected." }, - A_class_member_cannot_be_declared_optional: { code: 1112, category: 1, key: "A class member cannot be declared optional." }, - A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: 1, key: "A 'default' clause cannot appear more than once in a 'switch' statement." }, - Duplicate_label_0: { code: 1114, category: 1, key: "Duplicate label '{0}'" }, - A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: 1, key: "A 'continue' statement can only jump to a label of an enclosing iteration statement." }, - A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: 1, key: "A 'break' statement can only jump to a label of an enclosing statement." }, - An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: 1, key: "An object literal cannot have multiple properties with the same name in strict mode." }, - An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: { code: 1118, category: 1, key: "An object literal cannot have multiple get/set accessors with the same name." }, - An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { code: 1119, category: 1, key: "An object literal cannot have property and accessor with the same name." }, - An_export_assignment_cannot_have_modifiers: { code: 1120, category: 1, key: "An export assignment cannot have modifiers." }, - Octal_literals_are_not_allowed_in_strict_mode: { code: 1121, category: 1, key: "Octal literals are not allowed in strict mode." }, - A_tuple_type_element_list_cannot_be_empty: { code: 1122, category: 1, key: "A tuple type element list cannot be empty." }, - Variable_declaration_list_cannot_be_empty: { code: 1123, category: 1, key: "Variable declaration list cannot be empty." }, - Digit_expected: { code: 1124, category: 1, key: "Digit expected." }, - Hexadecimal_digit_expected: { code: 1125, category: 1, key: "Hexadecimal digit expected." }, - Unexpected_end_of_text: { code: 1126, category: 1, key: "Unexpected end of text." }, - Invalid_character: { code: 1127, category: 1, key: "Invalid character." }, - Declaration_or_statement_expected: { code: 1128, category: 1, key: "Declaration or statement expected." }, - Statement_expected: { code: 1129, category: 1, key: "Statement expected." }, - case_or_default_expected: { code: 1130, category: 1, key: "'case' or 'default' expected." }, - Property_or_signature_expected: { code: 1131, category: 1, key: "Property or signature expected." }, - Enum_member_expected: { code: 1132, category: 1, key: "Enum member expected." }, - Type_reference_expected: { code: 1133, category: 1, key: "Type reference expected." }, - Variable_declaration_expected: { code: 1134, category: 1, key: "Variable declaration expected." }, - Argument_expression_expected: { code: 1135, category: 1, key: "Argument expression expected." }, - Property_assignment_expected: { code: 1136, category: 1, key: "Property assignment expected." }, - Expression_or_comma_expected: { code: 1137, category: 1, key: "Expression or comma expected." }, - Parameter_declaration_expected: { code: 1138, category: 1, key: "Parameter declaration expected." }, - Type_parameter_declaration_expected: { code: 1139, category: 1, key: "Type parameter declaration expected." }, - Type_argument_expected: { code: 1140, category: 1, key: "Type argument expected." }, - String_literal_expected: { code: 1141, category: 1, key: "String literal expected." }, - Line_break_not_permitted_here: { code: 1142, category: 1, key: "Line break not permitted here." }, - or_expected: { code: 1144, category: 1, key: "'{' or ';' expected." }, - Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: 1, key: "Modifiers not permitted on index signature members." }, - Declaration_expected: { code: 1146, category: 1, key: "Declaration expected." }, - Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: 1, 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: 1, key: "Cannot compile external modules unless the '--module' flag is provided." }, - File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: 1, 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: 1, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, - var_let_or_const_expected: { code: 1152, category: 1, key: "'var', 'let' or 'const' expected." }, - let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1153, category: 1, key: "'let' declarations are only available when targeting ECMAScript 6 and higher." }, - const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1154, category: 1, key: "'const' declarations are only available when targeting ECMAScript 6 and higher." }, - const_declarations_must_be_initialized: { code: 1155, category: 1, key: "'const' declarations must be initialized" }, - const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: 1, key: "'const' declarations can only be declared inside a block." }, - let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: 1, key: "'let' declarations can only be declared inside a block." }, - Unterminated_template_literal: { code: 1160, category: 1, key: "Unterminated template literal." }, - Unterminated_regular_expression_literal: { code: 1161, category: 1, key: "Unterminated regular expression literal." }, - An_object_member_cannot_be_declared_optional: { code: 1162, category: 1, key: "An object member cannot be declared optional." }, - yield_expression_must_be_contained_within_a_generator_declaration: { code: 1163, category: 1, key: "'yield' expression must be contained_within a generator declaration." }, - Computed_property_names_are_not_allowed_in_enums: { code: 1164, category: 1, key: "Computed property names are not allowed in enums." }, - A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_symbol: { code: 1165, category: 1, key: "A computed property name in an ambient context must directly refer to a built-in symbol." }, - A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol: { code: 1166, category: 1, key: "A computed property name in a class property declaration must directly refer to a built-in symbol." }, - Computed_property_names_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1167, category: 1, key: "Computed property names are only available when targeting ECMAScript 6 and higher." }, - A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol: { code: 1168, category: 1, key: "A computed property name in a method overload must directly refer to a built-in symbol." }, - A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol: { code: 1169, category: 1, key: "A computed property name in an interface must directly refer to a built-in symbol." }, - A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol: { code: 1170, category: 1, key: "A computed property name in a type literal must directly refer to a built-in symbol." }, - A_comma_expression_is_not_allowed_in_a_computed_property_name: { code: 1171, category: 1, key: "A comma expression is not allowed in a computed property name." }, - extends_clause_already_seen: { code: 1172, category: 1, key: "'extends' clause already seen." }, - extends_clause_must_precede_implements_clause: { code: 1173, category: 1, key: "'extends' clause must precede 'implements' clause." }, - Classes_can_only_extend_a_single_class: { code: 1174, category: 1, key: "Classes can only extend a single class." }, - implements_clause_already_seen: { code: 1175, category: 1, key: "'implements' clause already seen." }, - Interface_declaration_cannot_have_implements_clause: { code: 1176, category: 1, key: "Interface declaration cannot have 'implements' clause." }, - Binary_digit_expected: { code: 1177, category: 1, key: "Binary digit expected." }, - Octal_digit_expected: { code: 1178, category: 1, key: "Octal digit expected." }, - Unexpected_token_expected: { code: 1179, category: 1, key: "Unexpected token. '{' expected." }, - Property_destructuring_pattern_expected: { code: 1180, category: 1, key: "Property destructuring pattern expected." }, - Array_element_destructuring_pattern_expected: { code: 1181, category: 1, key: "Array element destructuring pattern expected." }, - A_destructuring_declaration_must_have_an_initializer: { code: 1182, category: 1, key: "A destructuring declaration must have an initializer." }, - Destructuring_declarations_are_not_allowed_in_ambient_contexts: { code: 1183, category: 1, key: "Destructuring declarations are not allowed in ambient contexts." }, - An_implementation_cannot_be_declared_in_ambient_contexts: { code: 1184, category: 1, key: "An implementation cannot be declared in ambient contexts." }, - Modifiers_cannot_appear_here: { code: 1184, category: 1, key: "Modifiers cannot appear here." }, - Merge_conflict_marker_encountered: { code: 1185, category: 1, key: "Merge conflict marker encountered." }, - A_rest_element_cannot_have_an_initializer: { code: 1186, category: 1, key: "A rest element cannot have an initializer." }, - A_parameter_property_may_not_be_a_binding_pattern: { code: 1187, category: 1, key: "A parameter property may not be a binding pattern." }, - Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement: { code: 1188, category: 1, key: "Only a single variable declaration is allowed in a 'for...of' statement." }, - The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer: { code: 1189, category: 1, 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: 1, key: "The variable declaration of a 'for...of' statement cannot have an initializer." }, - An_import_declaration_cannot_have_modifiers: { code: 1191, category: 1, key: "An import declaration cannot have modifiers." }, - External_module_0_has_no_default_export_or_export_assignment: { code: 1192, category: 1, key: "External module '{0}' has no default export or export assignment." }, - An_export_declaration_cannot_have_modifiers: { code: 1193, category: 1, key: "An export declaration cannot have modifiers." }, - Export_declarations_are_not_permitted_in_an_internal_module: { code: 1194, category: 1, key: "Export declarations are not permitted in an internal module." }, - Catch_clause_variable_name_must_be_an_identifier: { code: 1195, category: 1, key: "Catch clause variable name must be an identifier." }, - Catch_clause_variable_cannot_have_a_type_annotation: { code: 1196, category: 1, key: "Catch clause variable cannot have a type annotation." }, - Catch_clause_variable_cannot_have_an_initializer: { code: 1197, category: 1, key: "Catch clause variable cannot have an initializer." }, - An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: { code: 1198, category: 1, key: "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive." }, - Unterminated_Unicode_escape_sequence: { code: 1199, category: 1, key: "Unterminated Unicode escape sequence." }, - Duplicate_identifier_0: { code: 2300, category: 1, key: "Duplicate identifier '{0}'." }, - Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: 1, 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: 1, key: "Static members cannot reference class type parameters." }, - Circular_definition_of_import_alias_0: { code: 2303, category: 1, key: "Circular definition of import alias '{0}'." }, - Cannot_find_name_0: { code: 2304, category: 1, key: "Cannot find name '{0}'." }, - Module_0_has_no_exported_member_1: { code: 2305, category: 1, key: "Module '{0}' has no exported member '{1}'." }, - File_0_is_not_an_external_module: { code: 2306, category: 1, key: "File '{0}' is not an external module." }, - Cannot_find_external_module_0: { code: 2307, category: 1, key: "Cannot find external module '{0}'." }, - A_module_cannot_have_more_than_one_export_assignment: { code: 2308, category: 1, 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: 1, 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: 1, key: "Type '{0}' recursively references itself as a base type." }, - A_class_may_only_extend_another_class: { code: 2311, category: 1, key: "A class may only extend another class." }, - An_interface_may_only_extend_a_class_or_another_interface: { code: 2312, category: 1, key: "An interface may only extend a class or another interface." }, - Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2313, category: 1, key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, - Generic_type_0_requires_1_type_argument_s: { code: 2314, category: 1, key: "Generic type '{0}' requires {1} type argument(s)." }, - Type_0_is_not_generic: { code: 2315, category: 1, key: "Type '{0}' is not generic." }, - Global_type_0_must_be_a_class_or_interface_type: { code: 2316, category: 1, key: "Global type '{0}' must be a class or interface type." }, - Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: 1, key: "Global type '{0}' must have {1} type parameter(s)." }, - Cannot_find_global_type_0: { code: 2318, category: 1, key: "Cannot find global type '{0}'." }, - Named_property_0_of_types_1_and_2_are_not_identical: { code: 2319, category: 1, key: "Named property '{0}' of types '{1}' and '{2}' are not identical." }, - Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: 1, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." }, - Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: 1, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, - Type_0_is_not_assignable_to_type_1: { code: 2322, category: 1, key: "Type '{0}' is not assignable to type '{1}'." }, - Property_0_is_missing_in_type_1: { code: 2324, category: 1, key: "Property '{0}' is missing in type '{1}'." }, - Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: 1, key: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, - Types_of_property_0_are_incompatible: { code: 2326, category: 1, key: "Types of property '{0}' are incompatible." }, - Property_0_is_optional_in_type_1_but_required_in_type_2: { code: 2327, category: 1, key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." }, - Types_of_parameters_0_and_1_are_incompatible: { code: 2328, category: 1, key: "Types of parameters '{0}' and '{1}' are incompatible." }, - Index_signature_is_missing_in_type_0: { code: 2329, category: 1, key: "Index signature is missing in type '{0}'." }, - Index_signatures_are_incompatible: { code: 2330, category: 1, key: "Index signatures are incompatible." }, - this_cannot_be_referenced_in_a_module_body: { code: 2331, category: 1, key: "'this' cannot be referenced in a module body." }, - this_cannot_be_referenced_in_current_location: { code: 2332, category: 1, key: "'this' cannot be referenced in current location." }, - this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: 1, key: "'this' cannot be referenced in constructor arguments." }, - this_cannot_be_referenced_in_a_static_property_initializer: { code: 2334, category: 1, key: "'this' cannot be referenced in a static property initializer." }, - super_can_only_be_referenced_in_a_derived_class: { code: 2335, category: 1, key: "'super' can only be referenced in a derived class." }, - super_cannot_be_referenced_in_constructor_arguments: { code: 2336, category: 1, key: "'super' cannot be referenced in constructor arguments." }, - Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: 2337, category: 1, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, - super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2338, category: 1, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, - Property_0_does_not_exist_on_type_1: { code: 2339, category: 1, key: "Property '{0}' does not exist on type '{1}'." }, - Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: 1, key: "Only public and protected methods of the base class are accessible via the 'super' keyword" }, - Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: 1, key: "Property '{0}' is private and only accessible within class '{1}'." }, - An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: { code: 2342, category: 1, key: "An index expression argument must be of type 'string', 'number', 'symbol, or 'any'." }, - Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: 1, key: "Type '{0}' does not satisfy the constraint '{1}'." }, - Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: 1, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, - Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: 1, key: "Supplied parameters do not match any signature of call target." }, - Untyped_function_calls_may_not_accept_type_arguments: { code: 2347, category: 1, key: "Untyped function calls may not accept type arguments." }, - Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { code: 2348, category: 1, key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" }, - Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { code: 2349, category: 1, key: "Cannot invoke an expression whose type lacks a call signature." }, - Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: 1, key: "Only a void function can be called with the 'new' keyword." }, - Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: 1, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, - Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: 1, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, - No_best_common_type_exists_among_return_expressions: { code: 2354, category: 1, key: "No best common type exists among return expressions." }, - A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: 1, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, - An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: 1, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, - The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2357, category: 1, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, - The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: 1, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, - The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: 1, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, - The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: { code: 2360, category: 1, key: "The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'." }, - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: 1, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, - The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: 1, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: 1, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - Invalid_left_hand_side_of_assignment_expression: { code: 2364, category: 1, key: "Invalid left-hand side of assignment expression." }, - Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: 1, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, - Type_parameter_name_cannot_be_0: { code: 2368, category: 1, key: "Type parameter name cannot be '{0}'" }, - A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: 1, key: "A parameter property is only allowed in a constructor implementation." }, - A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: 1, key: "A rest parameter must be of an array type." }, - A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: 1, key: "A parameter initializer is only allowed in a function or constructor implementation." }, - Parameter_0_cannot_be_referenced_in_its_initializer: { code: 2372, category: 1, key: "Parameter '{0}' cannot be referenced in its initializer." }, - Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { code: 2373, category: 1, key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." }, - Duplicate_string_index_signature: { code: 2374, category: 1, key: "Duplicate string index signature." }, - Duplicate_number_index_signature: { code: 2375, category: 1, key: "Duplicate number index signature." }, - A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: 2376, category: 1, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, - Constructors_for_derived_classes_must_contain_a_super_call: { code: 2377, category: 1, key: "Constructors for derived classes must contain a 'super' call." }, - A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2378, category: 1, key: "A 'get' accessor must return a value or consist of a single 'throw' statement." }, - Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2379, category: 1, key: "Getter and setter accessors do not agree in visibility." }, - get_and_set_accessor_must_have_the_same_type: { code: 2380, category: 1, key: "'get' and 'set' accessor must have the same type." }, - A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2381, category: 1, key: "A signature with an implementation cannot use a string literal type." }, - Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 2382, category: 1, key: "Specialized overload signature is not assignable to any non-specialized signature." }, - Overload_signatures_must_all_be_exported_or_not_exported: { code: 2383, category: 1, key: "Overload signatures must all be exported or not exported." }, - Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2384, category: 1, key: "Overload signatures must all be ambient or non-ambient." }, - Overload_signatures_must_all_be_public_private_or_protected: { code: 2385, category: 1, key: "Overload signatures must all be public, private or protected." }, - Overload_signatures_must_all_be_optional_or_required: { code: 2386, category: 1, key: "Overload signatures must all be optional or required." }, - Function_overload_must_be_static: { code: 2387, category: 1, key: "Function overload must be static." }, - Function_overload_must_not_be_static: { code: 2388, category: 1, key: "Function overload must not be static." }, - Function_implementation_name_must_be_0: { code: 2389, category: 1, key: "Function implementation name must be '{0}'." }, - Constructor_implementation_is_missing: { code: 2390, category: 1, key: "Constructor implementation is missing." }, - Function_implementation_is_missing_or_not_immediately_following_the_declaration: { code: 2391, category: 1, key: "Function implementation is missing or not immediately following the declaration." }, - Multiple_constructor_implementations_are_not_allowed: { code: 2392, category: 1, key: "Multiple constructor implementations are not allowed." }, - Duplicate_function_implementation: { code: 2393, category: 1, key: "Duplicate function implementation." }, - Overload_signature_is_not_compatible_with_function_implementation: { code: 2394, category: 1, key: "Overload signature is not compatible with function implementation." }, - Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2395, category: 1, key: "Individual declarations in merged declaration {0} must be all exported or all local." }, - Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2396, category: 1, key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, - Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2399, category: 1, key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, - Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2400, category: 1, key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, - Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2401, category: 1, key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, - Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { code: 2402, category: 1, key: "Expression resolves to '_super' that compiler uses to capture base class reference." }, - Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { code: 2403, category: 1, key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." }, - The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { code: 2404, category: 1, key: "The left-hand side of a 'for...in' statement cannot use a type annotation." }, - The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { code: 2405, category: 1, key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." }, - Invalid_left_hand_side_in_for_in_statement: { code: 2406, category: 1, key: "Invalid left-hand side in 'for...in' statement." }, - The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: 1, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, - Setters_cannot_return_a_value: { code: 2408, category: 1, key: "Setters cannot return a value." }, - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: 1, key: "Return type of constructor signature must be assignable to the instance type of the class" }, - All_symbols_within_a_with_block_will_be_resolved_to_any: { code: 2410, category: 1, key: "All symbols within a 'with' block will be resolved to 'any'." }, - Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: 1, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, - Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: 1, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, - Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: 1, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, - Class_name_cannot_be_0: { code: 2414, category: 1, key: "Class name cannot be '{0}'" }, - Class_0_incorrectly_extends_base_class_1: { code: 2415, category: 1, key: "Class '{0}' incorrectly extends base class '{1}'." }, - Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: 1, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, - Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: 1, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, - Class_0_incorrectly_implements_interface_1: { code: 2420, category: 1, key: "Class '{0}' incorrectly implements interface '{1}'." }, - A_class_may_only_implement_another_class_or_interface: { code: 2422, category: 1, key: "A class may only implement another class or interface." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: 1, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: 1, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, - Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: 1, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, - Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: 1, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, - Interface_name_cannot_be_0: { code: 2427, category: 1, key: "Interface name cannot be '{0}'" }, - All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: 1, key: "All declarations of an interface must have identical type parameters." }, - Interface_0_incorrectly_extends_interface_1: { code: 2430, category: 1, key: "Interface '{0}' incorrectly extends interface '{1}'." }, - Enum_name_cannot_be_0: { code: 2431, category: 1, 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: 1, 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: 1, 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: 1, 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: 1, key: "Ambient external modules cannot be nested in other modules." }, - Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: 1, key: "Ambient external module declaration cannot specify relative module name." }, - Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: 1, key: "Module '{0}' is hidden by a local declaration with the same name" }, - Import_name_cannot_be_0: { code: 2438, category: 1, 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: 1, key: "Import or export declaration in an ambient external module declaration cannot reference external module through relative external module name." }, - Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: 1, 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: 1, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module." }, - Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: 1, 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: 1, 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: 1, key: "Property '{0}' is protected in type '{1}' but public in type '{2}'." }, - Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { code: 2445, category: 1, key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." }, - Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: 1, key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, - The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: 1, key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, - Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: 1, key: "Block-scoped variable '{0}' used before its declaration." }, - The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant: { code: 2449, category: 1, key: "The operand of an increment or decrement operator cannot be a constant." }, - Left_hand_side_of_assignment_expression_cannot_be_a_constant: { code: 2450, category: 1, key: "Left-hand side of assignment expression cannot be a constant." }, - Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: 1, key: "Cannot redeclare block-scoped variable '{0}'." }, - An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: 1, key: "An enum member cannot have a numeric name." }, - The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: 1, key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, - Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: 1, key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, - Type_alias_0_circularly_references_itself: { code: 2456, category: 1, key: "Type alias '{0}' circularly references itself." }, - Type_alias_name_cannot_be_0: { code: 2457, category: 1, key: "Type alias name cannot be '{0}'" }, - An_AMD_module_cannot_have_multiple_name_assignments: { code: 2458, category: 1, key: "An AMD module cannot have multiple name assignments." }, - Type_0_has_no_property_1_and_no_string_index_signature: { code: 2459, category: 1, key: "Type '{0}' has no property '{1}' and no string index signature." }, - Type_0_has_no_property_1: { code: 2460, category: 1, key: "Type '{0}' has no property '{1}'." }, - Type_0_is_not_an_array_type: { code: 2461, category: 1, key: "Type '{0}' is not an array type." }, - A_rest_element_must_be_last_in_an_array_destructuring_pattern: { code: 2462, category: 1, key: "A rest element must be last in an array destructuring pattern" }, - A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: { code: 2463, category: 1, key: "A binding pattern parameter cannot be optional in an implementation signature." }, - A_computed_property_name_must_be_of_type_string_number_symbol_or_any: { code: 2464, category: 1, key: "A computed property name must be of type 'string', 'number', 'symbol', or 'any'." }, - this_cannot_be_referenced_in_a_computed_property_name: { code: 2465, category: 1, key: "'this' cannot be referenced in a computed property name." }, - super_cannot_be_referenced_in_a_computed_property_name: { code: 2466, category: 1, key: "'super' cannot be referenced in a computed property name." }, - A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: { code: 2467, category: 1, key: "A computed property name cannot reference a type parameter from its containing type." }, - Cannot_find_global_value_0: { code: 2468, category: 1, key: "Cannot find global value '{0}'." }, - The_0_operator_cannot_be_applied_to_type_symbol: { code: 2469, category: 1, key: "The '{0}' operator cannot be applied to type 'symbol'." }, - Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object: { code: 2470, category: 1, key: "'Symbol' reference does not refer to the global Symbol constructor object." }, - A_computed_property_name_of_the_form_0_must_be_of_type_symbol: { code: 2471, category: 1, key: "A computed property name of the form '{0}' must be of type 'symbol'." }, - Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_6_and_higher: { code: 2472, category: 1, key: "Spread operator in 'new' expressions is only available when targeting ECMAScript 6 and higher." }, - Enum_declarations_must_all_be_const_or_non_const: { code: 2473, category: 1, key: "Enum declarations must all be const or non-const." }, - In_const_enum_declarations_member_initializer_must_be_constant_expression: { code: 2474, category: 1, key: "In 'const' enum declarations member initializer must be constant expression." }, - const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: { code: 2475, category: 1, key: "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment." }, - A_const_enum_member_can_only_be_accessed_using_a_string_literal: { code: 2476, category: 1, key: "A const enum member can only be accessed using a string literal." }, - const_enum_member_initializer_was_evaluated_to_a_non_finite_value: { code: 2477, category: 1, key: "'const' enum member initializer was evaluated to a non-finite value." }, - const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: { code: 2478, category: 1, key: "'const' enum member initializer was evaluated to disallowed value 'NaN'." }, - Property_0_does_not_exist_on_const_enum_1: { code: 2479, category: 1, key: "Property '{0}' does not exist on 'const' enum '{1}'." }, - let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { code: 2480, category: 1, key: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." }, - Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { code: 2481, category: 1, key: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." }, - The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: { code: 2483, category: 1, key: "The left-hand side of a 'for...of' statement cannot use a type annotation." }, - Export_declaration_conflicts_with_exported_declaration_of_0: { code: 2484, category: 1, key: "Export declaration conflicts with exported declaration of '{0}'" }, - The_left_hand_side_of_a_for_of_statement_cannot_be_a_previously_defined_constant: { code: 2485, category: 1, key: "The left-hand side of a 'for...of' statement cannot be a previously defined constant." }, - The_left_hand_side_of_a_for_in_statement_cannot_be_a_previously_defined_constant: { code: 2486, category: 1, key: "The left-hand side of a 'for...in' statement cannot be a previously defined constant." }, - Invalid_left_hand_side_in_for_of_statement: { code: 2487, category: 1, key: "Invalid left-hand side in 'for...of' statement." }, - The_right_hand_side_of_a_for_of_statement_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2488, category: 1, key: "The right-hand side of a 'for...of' statement must have a '[Symbol.iterator]()' method that returns an iterator." }, - The_iterator_returned_by_the_right_hand_side_of_a_for_of_statement_must_have_a_next_method: { code: 2489, category: 1, key: "The iterator returned by the right-hand side of a 'for...of' statement must have a 'next()' method." }, - The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: { code: 2490, category: 1, key: "The type returned by the 'next()' method of an iterator must have a 'value' property." }, - The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: { code: 2491, category: 1, key: "The left-hand side of a 'for...in' statement cannot be a destructuring pattern." }, - Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: 1, key: "Cannot redeclare identifier '{0}' in catch clause" }, - Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: { code: 2493, category: 1, key: "Tuple type '{0}' with length '{1}' cannot be assigned to tuple with length '{2}'." }, - Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: { code: 2494, category: 1, 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: 2461, category: 1, key: "Type '{0}' is not an array type or a string type." }, - Import_declaration_0_is_using_private_name_1: { code: 4000, category: 1, 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: 1, 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: 1, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4006, category: 1, key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4008, category: 1, key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4010, category: 1, key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4012, category: 1, key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: 1, key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: 1, key: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, - Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: 1, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: 1, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: 1, key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, - Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: 1, key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, - Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: 1, key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, - Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: 1, key: "Exported variable '{0}' has or is using private name '{1}'." }, - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4026, category: 1, key: "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4027, category: 1, key: "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4028, category: 1, key: "Public static property '{0}' of exported class has or is using private name '{1}'." }, - Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4029, category: 1, key: "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4030, category: 1, key: "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Public_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4031, category: 1, key: "Public property '{0}' of exported class has or is using private name '{1}'." }, - Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4032, category: 1, key: "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, - Property_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4033, category: 1, key: "Property '{0}' of exported interface has or is using private name '{1}'." }, - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4034, category: 1, key: "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4035, category: 1, key: "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4036, category: 1, key: "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4037, category: 1, key: "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4038, category: 1, key: "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4039, category: 1, key: "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4040, category: 1, key: "Return type of public static property getter from exported class has or is using private name '{0}'." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4041, category: 1, key: "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4042, category: 1, key: "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4043, category: 1, key: "Return type of public property getter from exported class has or is using private name '{0}'." }, - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4044, category: 1, key: "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4045, category: 1, key: "Return type of constructor signature from exported interface has or is using private name '{0}'." }, - Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4046, category: 1, key: "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4047, category: 1, key: "Return type of call signature from exported interface has or is using private name '{0}'." }, - Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4048, category: 1, key: "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4049, category: 1, key: "Return type of index signature from exported interface has or is using private name '{0}'." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4050, category: 1, key: "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4051, category: 1, key: "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: { code: 4052, category: 1, key: "Return type of public static method from exported class has or is using private name '{0}'." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4053, category: 1, key: "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4054, category: 1, key: "Return type of public method from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: { code: 4055, category: 1, key: "Return type of public method from exported class has or is using private name '{0}'." }, - Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4056, category: 1, key: "Return type of method from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: { code: 4057, category: 1, key: "Return type of method from exported interface has or is using private name '{0}'." }, - Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4058, category: 1, key: "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: { code: 4059, category: 1, key: "Return type of exported function has or is using name '{0}' from private module '{1}'." }, - Return_type_of_exported_function_has_or_is_using_private_name_0: { code: 4060, category: 1, key: "Return type of exported function has or is using private name '{0}'." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4061, category: 1, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4062, category: 1, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: { code: 4063, category: 1, key: "Parameter '{0}' of constructor from exported class has or is using private name '{1}'." }, - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4064, category: 1, key: "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4065, category: 1, key: "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4066, category: 1, key: "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4067, category: 1, key: "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4068, category: 1, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4069, category: 1, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4070, category: 1, key: "Parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4071, category: 1, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4072, category: 1, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4073, category: 1, key: "Parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4074, category: 1, key: "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4075, category: 1, key: "Parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: 1, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: 1, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: 1, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, - Exported_type_alias_0_has_or_is_using_private_name_1: { code: 4081, category: 1, key: "Exported type alias '{0}' has or is using private name '{1}'." }, - Loop_contains_block_scoped_variable_0_referenced_by_a_function_in_the_loop_This_is_only_supported_in_ECMAScript_6_or_higher: { code: 4091, category: 1, key: "Loop contains block-scoped variable '{0}' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher." }, - The_current_host_does_not_support_the_0_option: { code: 5001, category: 1, key: "The current host does not support the '{0}' option." }, - Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: 1, key: "Cannot find the common subdirectory path for the input files." }, - Cannot_read_file_0_Colon_1: { code: 5012, category: 1, key: "Cannot read file '{0}': {1}" }, - Unsupported_file_encoding: { code: 5013, category: 1, key: "Unsupported file encoding." }, - Unknown_compiler_option_0: { code: 5023, category: 1, key: "Unknown compiler option '{0}'." }, - Compiler_option_0_requires_a_value_of_type_1: { code: 5024, category: 1, key: "Compiler option '{0}' requires a value of type {1}." }, - Could_not_write_file_0_Colon_1: { code: 5033, category: 1, key: "Could not write file '{0}': {1}" }, - Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5038, category: 1, key: "Option 'mapRoot' cannot be specified without specifying 'sourcemap' option." }, - Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5039, category: 1, key: "Option 'sourceRoot' cannot be specified without specifying 'sourcemap' option." }, - Option_noEmit_cannot_be_specified_with_option_out_or_outDir: { code: 5040, category: 1, key: "Option 'noEmit' cannot be specified with option 'out' or 'outDir'." }, - Option_noEmit_cannot_be_specified_with_option_declaration: { code: 5041, category: 1, key: "Option 'noEmit' cannot be specified with option 'declaration'." }, - Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { code: 5042, category: 1, key: "Option 'project' cannot be mixed with source files on a command line." }, - Concatenate_and_emit_output_to_single_file: { code: 6001, category: 2, key: "Concatenate and emit output to single file." }, - Generates_corresponding_d_ts_file: { code: 6002, category: 2, key: "Generates corresponding '.d.ts' file." }, - Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: 2, key: "Specifies the location where debugger should locate map files instead of generated locations." }, - Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { code: 6004, category: 2, key: "Specifies the location where debugger should locate TypeScript files instead of source locations." }, - Watch_input_files: { code: 6005, category: 2, key: "Watch input files." }, - Redirect_output_structure_to_the_directory: { code: 6006, category: 2, key: "Redirect output structure to the directory." }, - Do_not_erase_const_enum_declarations_in_generated_code: { code: 6007, category: 2, key: "Do not erase const enum declarations in generated code." }, - Do_not_emit_outputs_if_any_type_checking_errors_were_reported: { code: 6008, category: 2, key: "Do not emit outputs if any type checking errors were reported." }, - Do_not_emit_comments_to_output: { code: 6009, category: 2, key: "Do not emit comments to output." }, - Do_not_emit_outputs: { code: 6010, category: 2, key: "Do not emit outputs." }, - Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: 2, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" }, - Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: 2, key: "Specify module code generation: 'commonjs' or 'amd'" }, - Print_this_message: { code: 6017, category: 2, key: "Print this message." }, - Print_the_compiler_s_version: { code: 6019, category: 2, key: "Print the compiler's version." }, - Compile_the_project_in_the_given_directory: { code: 6020, category: 2, key: "Compile the project in the given directory." }, - Syntax_Colon_0: { code: 6023, category: 2, key: "Syntax: {0}" }, - options: { code: 6024, category: 2, key: "options" }, - file: { code: 6025, category: 2, key: "file" }, - Examples_Colon_0: { code: 6026, category: 2, key: "Examples: {0}" }, - Options_Colon: { code: 6027, category: 2, key: "Options:" }, - Version_0: { code: 6029, category: 2, key: "Version {0}" }, - Insert_command_line_options_and_files_from_a_file: { code: 6030, category: 2, key: "Insert command line options and files from a file." }, - File_change_detected_Starting_incremental_compilation: { code: 6032, category: 2, key: "File change detected. Starting incremental compilation..." }, - KIND: { code: 6034, category: 2, key: "KIND" }, - FILE: { code: 6035, category: 2, key: "FILE" }, - VERSION: { code: 6036, category: 2, key: "VERSION" }, - LOCATION: { code: 6037, category: 2, key: "LOCATION" }, - DIRECTORY: { code: 6038, category: 2, key: "DIRECTORY" }, - Compilation_complete_Watching_for_file_changes: { code: 6042, category: 2, key: "Compilation complete. Watching for file changes." }, - Generates_corresponding_map_file: { code: 6043, category: 2, key: "Generates corresponding '.map' file." }, - Compiler_option_0_expects_an_argument: { code: 6044, category: 1, key: "Compiler option '{0}' expects an argument." }, - Unterminated_quoted_string_in_response_file_0: { code: 6045, category: 1, key: "Unterminated quoted string in response file '{0}'." }, - Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: 1, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, - Argument_for_target_option_must_be_es3_es5_or_es6: { code: 6047, category: 1, 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: 1, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, - Unsupported_locale_0: { code: 6049, category: 1, key: "Unsupported locale '{0}'." }, - Unable_to_open_file_0: { code: 6050, category: 1, key: "Unable to open file '{0}'." }, - Corrupted_locale_file_0: { code: 6051, category: 1, key: "Corrupted locale file {0}." }, - Raise_error_on_expressions_and_declarations_with_an_implied_any_type: { code: 6052, category: 2, key: "Raise error on expressions and declarations with an implied 'any' type." }, - File_0_not_found: { code: 6053, category: 1, key: "File '{0}' not found." }, - File_0_must_have_extension_ts_or_d_ts: { code: 6054, category: 1, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, - Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: { code: 6055, category: 2, key: "Suppress noImplicitAny errors for indexing objects lacking index signatures." }, - Do_not_emit_declarations_for_code_that_has_an_internal_annotation: { code: 6056, category: 2, key: "Do not emit declarations for code that has an '@internal' annotation." }, - Preserve_new_lines_when_emitting_code: { code: 6057, category: 2, key: "Preserve new-lines when emitting code." }, - Variable_0_implicitly_has_an_1_type: { code: 7005, category: 1, key: "Variable '{0}' implicitly has an '{1}' type." }, - Parameter_0_implicitly_has_an_1_type: { code: 7006, category: 1, key: "Parameter '{0}' implicitly has an '{1}' type." }, - Member_0_implicitly_has_an_1_type: { code: 7008, category: 1, key: "Member '{0}' implicitly has an '{1}' type." }, - new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: { code: 7009, category: 1, key: "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type." }, - _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: 1, key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, - Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: 1, key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, - Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: 1, key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: 1, key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, - Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: 1, key: "Index signature of object type implicitly has an 'any' type." }, - Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: 1, key: "Object literal's property '{0}' implicitly has an '{1}' type." }, - Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: 1, 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: 1, 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: 1, 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: 1, 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: 1, 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: 1, 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." }, - You_cannot_rename_this_element: { code: 8000, category: 1, key: "You cannot rename this element." }, - You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: { code: 8001, category: 1, key: "You cannot rename elements that are defined in the standard TypeScript library." }, - yield_expressions_are_not_currently_supported: { code: 9000, category: 1, key: "'yield' expressions are not currently supported." }, - Generators_are_not_currently_supported: { code: 9001, category: 1, key: "Generators are not currently supported." }, - The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression: { code: 9002, category: 1, key: "The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression." } + Unterminated_string_literal: { + code: 1002, + category: ts.DiagnosticCategory.Error, + key: "Unterminated string literal." + }, + Identifier_expected: { + code: 1003, + category: ts.DiagnosticCategory.Error, + key: "Identifier expected." + }, + _0_expected: { + code: 1005, + category: ts.DiagnosticCategory.Error, + key: "'{0}' expected." + }, + A_file_cannot_have_a_reference_to_itself: { + code: 1006, + category: ts.DiagnosticCategory.Error, + key: "A file cannot have a reference to itself." + }, + Trailing_comma_not_allowed: { + code: 1009, + category: ts.DiagnosticCategory.Error, + key: "Trailing comma not allowed." + }, + Asterisk_Slash_expected: { + code: 1010, + category: ts.DiagnosticCategory.Error, + key: "'*/' expected." + }, + Unexpected_token: { + code: 1012, + category: ts.DiagnosticCategory.Error, + key: "Unexpected token." + }, + A_rest_parameter_must_be_last_in_a_parameter_list: { + code: 1014, + category: ts.DiagnosticCategory.Error, + key: "A rest parameter must be last in a parameter list." + }, + Parameter_cannot_have_question_mark_and_initializer: { + code: 1015, + category: ts.DiagnosticCategory.Error, + key: "Parameter cannot have question mark and initializer." + }, + A_required_parameter_cannot_follow_an_optional_parameter: { + code: 1016, + category: ts.DiagnosticCategory.Error, + key: "A required parameter cannot follow an optional parameter." + }, + An_index_signature_cannot_have_a_rest_parameter: { + code: 1017, + category: ts.DiagnosticCategory.Error, + key: "An index signature cannot have a rest parameter." + }, + An_index_signature_parameter_cannot_have_an_accessibility_modifier: { + code: 1018, + category: ts.DiagnosticCategory.Error, + key: "An index signature parameter cannot have an accessibility modifier." + }, + An_index_signature_parameter_cannot_have_a_question_mark: { + code: 1019, + category: ts.DiagnosticCategory.Error, + key: "An index signature parameter cannot have a question mark." + }, + An_index_signature_parameter_cannot_have_an_initializer: { + code: 1020, + category: ts.DiagnosticCategory.Error, + key: "An index signature parameter cannot have an initializer." + }, + An_index_signature_must_have_a_type_annotation: { + code: 1021, + category: ts.DiagnosticCategory.Error, + key: "An index signature must have a type annotation." + }, + An_index_signature_parameter_must_have_a_type_annotation: { + code: 1022, + category: ts.DiagnosticCategory.Error, + key: "An index signature parameter must have a type annotation." + }, + An_index_signature_parameter_type_must_be_string_or_number: { + code: 1023, + category: ts.DiagnosticCategory.Error, + key: "An index signature parameter type must be 'string' or 'number'." + }, + A_class_or_interface_declaration_can_only_have_one_extends_clause: { + code: 1024, + category: ts.DiagnosticCategory.Error, + key: "A class or interface declaration can only have one 'extends' clause." + }, + An_extends_clause_must_precede_an_implements_clause: { + code: 1025, + category: ts.DiagnosticCategory.Error, + key: "An 'extends' clause must precede an 'implements' clause." + }, + A_class_can_only_extend_a_single_class: { + code: 1026, + category: ts.DiagnosticCategory.Error, + key: "A class can only extend a single class." + }, + A_class_declaration_can_only_have_one_implements_clause: { + code: 1027, + category: ts.DiagnosticCategory.Error, + key: "A class declaration can only have one 'implements' clause." + }, + Accessibility_modifier_already_seen: { + code: 1028, + category: ts.DiagnosticCategory.Error, + key: "Accessibility modifier already seen." + }, + _0_modifier_must_precede_1_modifier: { + code: 1029, + category: ts.DiagnosticCategory.Error, + key: "'{0}' modifier must precede '{1}' modifier." + }, + _0_modifier_already_seen: { + code: 1030, + category: ts.DiagnosticCategory.Error, + key: "'{0}' modifier already seen." + }, + _0_modifier_cannot_appear_on_a_class_element: { + code: 1031, + category: ts.DiagnosticCategory.Error, + key: "'{0}' modifier cannot appear on a class element." + }, + An_interface_declaration_cannot_have_an_implements_clause: { + code: 1032, + category: ts.DiagnosticCategory.Error, + key: "An interface declaration cannot have an 'implements' clause." + }, + super_must_be_followed_by_an_argument_list_or_member_access: { + code: 1034, + category: ts.DiagnosticCategory.Error, + key: "'super' must be followed by an argument list or member access." + }, + Only_ambient_modules_can_use_quoted_names: { + code: 1035, + category: ts.DiagnosticCategory.Error, + key: "Only ambient modules can use quoted names." + }, + Statements_are_not_allowed_in_ambient_contexts: { + code: 1036, + category: ts.DiagnosticCategory.Error, + key: "Statements are not allowed in ambient contexts." + }, + A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { + code: 1038, + category: ts.DiagnosticCategory.Error, + key: "A 'declare' modifier cannot be used in an already ambient context." + }, + Initializers_are_not_allowed_in_ambient_contexts: { + code: 1039, + category: ts.DiagnosticCategory.Error, + key: "Initializers are not allowed in ambient contexts." + }, + _0_modifier_cannot_appear_on_a_module_element: { + code: 1044, + category: ts.DiagnosticCategory.Error, + key: "'{0}' modifier cannot appear on a module element." + }, + A_declare_modifier_cannot_be_used_with_an_interface_declaration: { + code: 1045, + category: ts.DiagnosticCategory.Error, + key: "A 'declare' modifier cannot be used with an interface declaration." + }, + A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { + code: 1046, + category: ts.DiagnosticCategory.Error, + key: "A 'declare' modifier is required for a top level declaration in a .d.ts file." + }, + A_rest_parameter_cannot_be_optional: { + code: 1047, + category: ts.DiagnosticCategory.Error, + key: "A rest parameter cannot be optional." + }, + A_rest_parameter_cannot_have_an_initializer: { + code: 1048, + category: ts.DiagnosticCategory.Error, + key: "A rest parameter cannot have an initializer." + }, + A_set_accessor_must_have_exactly_one_parameter: { + code: 1049, + category: ts.DiagnosticCategory.Error, + key: "A 'set' accessor must have exactly one parameter." + }, + A_set_accessor_cannot_have_an_optional_parameter: { + code: 1051, + category: ts.DiagnosticCategory.Error, + key: "A 'set' accessor cannot have an optional parameter." + }, + A_set_accessor_parameter_cannot_have_an_initializer: { + code: 1052, + category: ts.DiagnosticCategory.Error, + key: "A 'set' accessor parameter cannot have an initializer." + }, + A_set_accessor_cannot_have_rest_parameter: { + code: 1053, + category: ts.DiagnosticCategory.Error, + key: "A 'set' accessor cannot have rest parameter." + }, + 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." + }, + 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." + }, + Invalid_reference_directive_syntax: { + code: 1084, + category: ts.DiagnosticCategory.Error, + key: "Invalid 'reference' directive syntax." + }, + Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { + code: 1085, + category: ts.DiagnosticCategory.Error, + key: "Octal literals are not available when targeting ECMAScript 5 and higher." + }, + An_accessor_cannot_be_declared_in_an_ambient_context: { + code: 1086, + category: ts.DiagnosticCategory.Error, + key: "An accessor cannot be declared in an ambient context." + }, + _0_modifier_cannot_appear_on_a_constructor_declaration: { + code: 1089, + category: ts.DiagnosticCategory.Error, + key: "'{0}' modifier cannot appear on a constructor declaration." + }, + _0_modifier_cannot_appear_on_a_parameter: { + code: 1090, + category: ts.DiagnosticCategory.Error, + key: "'{0}' modifier cannot appear on a parameter." + }, + Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { + code: 1091, + category: ts.DiagnosticCategory.Error, + key: "Only a single variable declaration is allowed in a 'for...in' statement." + }, + Type_parameters_cannot_appear_on_a_constructor_declaration: { + code: 1092, + category: ts.DiagnosticCategory.Error, + key: "Type parameters cannot appear on a constructor declaration." + }, + Type_annotation_cannot_appear_on_a_constructor_declaration: { + code: 1093, + category: ts.DiagnosticCategory.Error, + key: "Type annotation cannot appear on a constructor declaration." + }, + An_accessor_cannot_have_type_parameters: { + code: 1094, + category: ts.DiagnosticCategory.Error, + key: "An accessor cannot have type parameters." + }, + A_set_accessor_cannot_have_a_return_type_annotation: { + code: 1095, + category: ts.DiagnosticCategory.Error, + key: "A 'set' accessor cannot have a return type annotation." + }, + An_index_signature_must_have_exactly_one_parameter: { + code: 1096, + category: ts.DiagnosticCategory.Error, + key: "An index signature must have exactly one parameter." + }, + _0_list_cannot_be_empty: { + code: 1097, + category: ts.DiagnosticCategory.Error, + key: "'{0}' list cannot be empty." + }, + Type_parameter_list_cannot_be_empty: { + code: 1098, + category: ts.DiagnosticCategory.Error, + key: "Type parameter list cannot be empty." + }, + Type_argument_list_cannot_be_empty: { + code: 1099, + category: ts.DiagnosticCategory.Error, + key: "Type argument list cannot be empty." + }, + Invalid_use_of_0_in_strict_mode: { + code: 1100, + category: ts.DiagnosticCategory.Error, + key: "Invalid use of '{0}' in strict mode." + }, + with_statements_are_not_allowed_in_strict_mode: { + code: 1101, + category: ts.DiagnosticCategory.Error, + key: "'with' statements are not allowed in strict mode." + }, + delete_cannot_be_called_on_an_identifier_in_strict_mode: { + code: 1102, + category: ts.DiagnosticCategory.Error, + key: "'delete' cannot be called on an identifier in strict mode." + }, + A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { + code: 1104, + category: ts.DiagnosticCategory.Error, + key: "A 'continue' statement can only be used within an enclosing iteration statement." + }, + A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { + code: 1105, + category: ts.DiagnosticCategory.Error, + key: "A 'break' statement can only be used within an enclosing iteration or switch statement." + }, + Jump_target_cannot_cross_function_boundary: { + code: 1107, + category: ts.DiagnosticCategory.Error, + key: "Jump target cannot cross function boundary." + }, + A_return_statement_can_only_be_used_within_a_function_body: { + code: 1108, + category: ts.DiagnosticCategory.Error, + key: "A 'return' statement can only be used within a function body." + }, + Expression_expected: { + code: 1109, + category: ts.DiagnosticCategory.Error, + key: "Expression expected." + }, + Type_expected: { + code: 1110, + category: ts.DiagnosticCategory.Error, + key: "Type expected." + }, + A_class_member_cannot_be_declared_optional: { + code: 1112, + category: ts.DiagnosticCategory.Error, + key: "A class member cannot be declared optional." + }, + A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { + code: 1113, + category: ts.DiagnosticCategory.Error, + key: "A 'default' clause cannot appear more than once in a 'switch' statement." + }, + Duplicate_label_0: { + code: 1114, + category: ts.DiagnosticCategory.Error, + key: "Duplicate label '{0}'" + }, + A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { + code: 1115, + category: ts.DiagnosticCategory.Error, + key: "A 'continue' statement can only jump to a label of an enclosing iteration statement." + }, + A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { + code: 1116, + category: ts.DiagnosticCategory.Error, + key: "A 'break' statement can only jump to a label of an enclosing statement." + }, + An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { + code: 1117, + category: ts.DiagnosticCategory.Error, + key: "An object literal cannot have multiple properties with the same name in strict mode." + }, + An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: { + code: 1118, + category: ts.DiagnosticCategory.Error, + key: "An object literal cannot have multiple get/set accessors with the same name." + }, + An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { + code: 1119, + category: ts.DiagnosticCategory.Error, + key: "An object literal cannot have property and accessor with the same name." + }, + An_export_assignment_cannot_have_modifiers: { + code: 1120, + category: ts.DiagnosticCategory.Error, + key: "An export assignment cannot have modifiers." + }, + Octal_literals_are_not_allowed_in_strict_mode: { + code: 1121, + category: ts.DiagnosticCategory.Error, + key: "Octal literals are not allowed in strict mode." + }, + A_tuple_type_element_list_cannot_be_empty: { + code: 1122, + category: ts.DiagnosticCategory.Error, + key: "A tuple type element list cannot be empty." + }, + Variable_declaration_list_cannot_be_empty: { + code: 1123, + category: ts.DiagnosticCategory.Error, + key: "Variable declaration list cannot be empty." + }, + Digit_expected: { + code: 1124, + category: ts.DiagnosticCategory.Error, + key: "Digit expected." + }, + Hexadecimal_digit_expected: { + code: 1125, + category: ts.DiagnosticCategory.Error, + key: "Hexadecimal digit expected." + }, + Unexpected_end_of_text: { + code: 1126, + category: ts.DiagnosticCategory.Error, + key: "Unexpected end of text." + }, + Invalid_character: { + code: 1127, + category: ts.DiagnosticCategory.Error, + key: "Invalid character." + }, + Declaration_or_statement_expected: { + code: 1128, + category: ts.DiagnosticCategory.Error, + key: "Declaration or statement expected." + }, + Statement_expected: { + code: 1129, + category: ts.DiagnosticCategory.Error, + key: "Statement expected." + }, + case_or_default_expected: { + code: 1130, + category: ts.DiagnosticCategory.Error, + key: "'case' or 'default' expected." + }, + Property_or_signature_expected: { + code: 1131, + category: ts.DiagnosticCategory.Error, + key: "Property or signature expected." + }, + Enum_member_expected: { + code: 1132, + category: ts.DiagnosticCategory.Error, + key: "Enum member expected." + }, + Type_reference_expected: { + code: 1133, + category: ts.DiagnosticCategory.Error, + key: "Type reference expected." + }, + Variable_declaration_expected: { + code: 1134, + category: ts.DiagnosticCategory.Error, + key: "Variable declaration expected." + }, + Argument_expression_expected: { + code: 1135, + category: ts.DiagnosticCategory.Error, + key: "Argument expression expected." + }, + Property_assignment_expected: { + code: 1136, + category: ts.DiagnosticCategory.Error, + key: "Property assignment expected." + }, + Expression_or_comma_expected: { + code: 1137, + category: ts.DiagnosticCategory.Error, + key: "Expression or comma expected." + }, + Parameter_declaration_expected: { + code: 1138, + category: ts.DiagnosticCategory.Error, + key: "Parameter declaration expected." + }, + Type_parameter_declaration_expected: { + code: 1139, + category: ts.DiagnosticCategory.Error, + key: "Type parameter declaration expected." + }, + Type_argument_expected: { + code: 1140, + category: ts.DiagnosticCategory.Error, + key: "Type argument expected." + }, + String_literal_expected: { + code: 1141, + category: ts.DiagnosticCategory.Error, + key: "String literal expected." + }, + Line_break_not_permitted_here: { + code: 1142, + category: ts.DiagnosticCategory.Error, + key: "Line break not permitted here." + }, + 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." + }, + 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." + }, + let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { + code: 1153, + category: ts.DiagnosticCategory.Error, + key: "'let' declarations are only available when targeting ECMAScript 6 and higher." + }, + const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { + code: 1154, + category: ts.DiagnosticCategory.Error, + key: "'const' declarations are only available when targeting ECMAScript 6 and higher." + }, + const_declarations_must_be_initialized: { + code: 1155, + category: ts.DiagnosticCategory.Error, + key: "'const' declarations must be initialized" + }, + const_declarations_can_only_be_declared_inside_a_block: { + code: 1156, + category: ts.DiagnosticCategory.Error, + key: "'const' declarations can only be declared inside a block." + }, + let_declarations_can_only_be_declared_inside_a_block: { + code: 1157, + category: ts.DiagnosticCategory.Error, + key: "'let' declarations can only be declared inside a block." + }, + Unterminated_template_literal: { + code: 1160, + category: ts.DiagnosticCategory.Error, + key: "Unterminated template literal." + }, + Unterminated_regular_expression_literal: { + code: 1161, + category: ts.DiagnosticCategory.Error, + key: "Unterminated regular expression literal." + }, + An_object_member_cannot_be_declared_optional: { + code: 1162, + category: ts.DiagnosticCategory.Error, + key: "An object member cannot be declared optional." + }, + yield_expression_must_be_contained_within_a_generator_declaration: { + code: 1163, + category: ts.DiagnosticCategory.Error, + key: "'yield' expression must be contained_within a generator declaration." + }, + Computed_property_names_are_not_allowed_in_enums: { + code: 1164, + category: ts.DiagnosticCategory.Error, + key: "Computed property names are not allowed in enums." + }, + A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_symbol: { + code: 1165, + category: ts.DiagnosticCategory.Error, + key: "A computed property name in an ambient context must directly refer to a built-in symbol." + }, + A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol: { + code: 1166, + category: ts.DiagnosticCategory.Error, + key: "A computed property name in a class property declaration must directly refer to a built-in symbol." + }, + Computed_property_names_are_only_available_when_targeting_ECMAScript_6_and_higher: { + code: 1167, + category: ts.DiagnosticCategory.Error, + key: "Computed property names are only available when targeting ECMAScript 6 and higher." + }, + A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol: { + code: 1168, + category: ts.DiagnosticCategory.Error, + key: "A computed property name in a method overload must directly refer to a built-in symbol." + }, + A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol: { + code: 1169, + category: ts.DiagnosticCategory.Error, + key: "A computed property name in an interface must directly refer to a built-in symbol." + }, + A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol: { + code: 1170, + category: ts.DiagnosticCategory.Error, + key: "A computed property name in a type literal must directly refer to a built-in symbol." + }, + A_comma_expression_is_not_allowed_in_a_computed_property_name: { + code: 1171, + category: ts.DiagnosticCategory.Error, + key: "A comma expression is not allowed in a computed property name." + }, + extends_clause_already_seen: { + code: 1172, + category: ts.DiagnosticCategory.Error, + key: "'extends' clause already seen." + }, + extends_clause_must_precede_implements_clause: { + code: 1173, + category: ts.DiagnosticCategory.Error, + key: "'extends' clause must precede 'implements' clause." + }, + Classes_can_only_extend_a_single_class: { + code: 1174, + category: ts.DiagnosticCategory.Error, + key: "Classes can only extend a single class." + }, + implements_clause_already_seen: { + code: 1175, + category: ts.DiagnosticCategory.Error, + key: "'implements' clause already seen." + }, + Interface_declaration_cannot_have_implements_clause: { + code: 1176, + category: ts.DiagnosticCategory.Error, + key: "Interface declaration cannot have 'implements' clause." + }, + Binary_digit_expected: { + code: 1177, + category: ts.DiagnosticCategory.Error, + key: "Binary digit expected." + }, + Octal_digit_expected: { + code: 1178, + category: ts.DiagnosticCategory.Error, + key: "Octal digit expected." + }, + Unexpected_token_expected: { + code: 1179, + category: ts.DiagnosticCategory.Error, + key: "Unexpected token. '{' expected." + }, + Property_destructuring_pattern_expected: { + code: 1180, + category: ts.DiagnosticCategory.Error, + key: "Property destructuring pattern expected." + }, + Array_element_destructuring_pattern_expected: { + code: 1181, + category: ts.DiagnosticCategory.Error, + key: "Array element destructuring pattern expected." + }, + A_destructuring_declaration_must_have_an_initializer: { + code: 1182, + category: ts.DiagnosticCategory.Error, + key: "A destructuring declaration must have an initializer." + }, + Destructuring_declarations_are_not_allowed_in_ambient_contexts: { + code: 1183, + category: ts.DiagnosticCategory.Error, + key: "Destructuring declarations are not allowed in ambient contexts." + }, + An_implementation_cannot_be_declared_in_ambient_contexts: { + code: 1184, + category: ts.DiagnosticCategory.Error, + key: "An implementation cannot be declared in ambient contexts." + }, + Modifiers_cannot_appear_here: { + code: 1184, + category: ts.DiagnosticCategory.Error, + key: "Modifiers cannot appear here." + }, + Merge_conflict_marker_encountered: { + code: 1185, + category: ts.DiagnosticCategory.Error, + key: "Merge conflict marker encountered." + }, + A_rest_element_cannot_have_an_initializer: { + code: 1186, + category: ts.DiagnosticCategory.Error, + key: "A rest element cannot have an initializer." + }, + A_parameter_property_may_not_be_a_binding_pattern: { + code: 1187, + category: ts.DiagnosticCategory.Error, + key: "A parameter property may not be a binding pattern." + }, + Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement: { + code: 1188, + category: ts.DiagnosticCategory.Error, + key: "Only a single variable declaration is allowed in a 'for...of' statement." + }, + 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." + }, + 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." + }, + 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." + }, + An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: { + code: 1198, + category: ts.DiagnosticCategory.Error, + key: "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive." + }, + Unterminated_Unicode_escape_sequence: { + code: 1199, + category: ts.DiagnosticCategory.Error, + key: "Unterminated Unicode escape sequence." + }, + Line_terminator_not_permitted_before_arrow: { + code: 1200, + category: ts.DiagnosticCategory.Error, + key: "Line terminator not permitted before arrow." + }, + A_type_annotation_on_an_export_statement_is_only_allowed_in_an_ambient_external_module_declaration: { + code: 1201, + category: ts.DiagnosticCategory.Error, + key: "A type annotation on an export statement is only allowed in an ambient external module declaration." + }, + 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." + }, + 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." + }, + 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." + }, + 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}'." + }, + 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." + }, + A_class_may_only_extend_another_class: { + code: 2311, + category: ts.DiagnosticCategory.Error, + key: "A class may only extend another class." + }, + An_interface_may_only_extend_a_class_or_another_interface: { + code: 2312, + category: ts.DiagnosticCategory.Error, + key: "An interface may only extend a class or another interface." + }, + Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { + code: 2313, + category: ts.DiagnosticCategory.Error, + key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." + }, + Generic_type_0_requires_1_type_argument_s: { + code: 2314, + category: ts.DiagnosticCategory.Error, + key: "Generic type '{0}' requires {1} type argument(s)." + }, + Type_0_is_not_generic: { + code: 2315, + category: ts.DiagnosticCategory.Error, + key: "Type '{0}' is not generic." + }, + Global_type_0_must_be_a_class_or_interface_type: { + code: 2316, + category: ts.DiagnosticCategory.Error, + key: "Global type '{0}' must be a class or interface type." + }, + Global_type_0_must_have_1_type_parameter_s: { + code: 2317, + category: ts.DiagnosticCategory.Error, + key: "Global type '{0}' must have {1} type parameter(s)." + }, + Cannot_find_global_type_0: { + code: 2318, + category: ts.DiagnosticCategory.Error, + key: "Cannot find global type '{0}'." + }, + Named_property_0_of_types_1_and_2_are_not_identical: { + code: 2319, + category: ts.DiagnosticCategory.Error, + key: "Named property '{0}' of types '{1}' and '{2}' are not identical." + }, + Interface_0_cannot_simultaneously_extend_types_1_and_2: { + code: 2320, + category: ts.DiagnosticCategory.Error, + key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." + }, + Excessive_stack_depth_comparing_types_0_and_1: { + code: 2321, + category: ts.DiagnosticCategory.Error, + key: "Excessive stack depth comparing types '{0}' and '{1}'." + }, + Type_0_is_not_assignable_to_type_1: { + code: 2322, + category: ts.DiagnosticCategory.Error, + key: "Type '{0}' is not assignable to type '{1}'." + }, + Property_0_is_missing_in_type_1: { + code: 2324, + category: ts.DiagnosticCategory.Error, + key: "Property '{0}' is missing in type '{1}'." + }, + Property_0_is_private_in_type_1_but_not_in_type_2: { + code: 2325, + category: ts.DiagnosticCategory.Error, + key: "Property '{0}' is private in type '{1}' but not in type '{2}'." + }, + Types_of_property_0_are_incompatible: { + code: 2326, + category: ts.DiagnosticCategory.Error, + key: "Types of property '{0}' are incompatible." + }, + Property_0_is_optional_in_type_1_but_required_in_type_2: { + code: 2327, + category: ts.DiagnosticCategory.Error, + key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." + }, + 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_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." + }, + super_can_only_be_referenced_in_a_derived_class: { + code: 2335, + category: ts.DiagnosticCategory.Error, + key: "'super' can only be referenced in a derived class." + }, + super_cannot_be_referenced_in_constructor_arguments: { + code: 2336, + category: ts.DiagnosticCategory.Error, + key: "'super' cannot be referenced in constructor arguments." + }, + Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { + code: 2337, + category: ts.DiagnosticCategory.Error, + key: "Super calls are not permitted outside constructors or in nested functions inside constructors" + }, + super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { + code: 2338, + category: ts.DiagnosticCategory.Error, + key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" + }, + Property_0_does_not_exist_on_type_1: { + code: 2339, + category: ts.DiagnosticCategory.Error, + key: "Property '{0}' does not exist on type '{1}'." + }, + Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { + code: 2340, + category: ts.DiagnosticCategory.Error, + key: "Only public and protected methods of the base class are accessible via the 'super' keyword" + }, + Property_0_is_private_and_only_accessible_within_class_1: { + code: 2341, + category: ts.DiagnosticCategory.Error, + key: "Property '{0}' is private and only accessible within class '{1}'." + }, + An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: { + code: 2342, + category: ts.DiagnosticCategory.Error, + key: "An index expression argument must be of type 'string', 'number', 'symbol, or 'any'." + }, + Type_0_does_not_satisfy_the_constraint_1: { + code: 2344, + category: ts.DiagnosticCategory.Error, + key: "Type '{0}' does not satisfy the constraint '{1}'." + }, + Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { + code: 2345, + category: ts.DiagnosticCategory.Error, + key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." + }, + Supplied_parameters_do_not_match_any_signature_of_call_target: { + code: 2346, + category: ts.DiagnosticCategory.Error, + key: "Supplied parameters do not match any signature of call target." + }, + Untyped_function_calls_may_not_accept_type_arguments: { + code: 2347, + category: ts.DiagnosticCategory.Error, + key: "Untyped function calls may not accept type arguments." + }, + Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { + code: 2348, + category: ts.DiagnosticCategory.Error, + key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" + }, + Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { + code: 2349, + category: ts.DiagnosticCategory.Error, + key: "Cannot invoke an expression whose type lacks a call signature." + }, + Only_a_void_function_can_be_called_with_the_new_keyword: { + code: 2350, + category: ts.DiagnosticCategory.Error, + key: "Only a void function can be called with the 'new' keyword." + }, + Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { + code: 2351, + category: ts.DiagnosticCategory.Error, + key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." + }, + Neither_type_0_nor_type_1_is_assignable_to_the_other: { + code: 2352, + category: ts.DiagnosticCategory.Error, + key: "Neither type '{0}' nor type '{1}' is assignable to the other." + }, + No_best_common_type_exists_among_return_expressions: { + code: 2354, + category: ts.DiagnosticCategory.Error, + key: "No best common type exists among return expressions." + }, + A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { + code: 2355, + category: ts.DiagnosticCategory.Error, + key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." + }, + An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { + code: 2356, + category: ts.DiagnosticCategory.Error, + key: "An arithmetic operand must be of type 'any', 'number' or an enum type." + }, + The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { + code: 2357, + category: ts.DiagnosticCategory.Error, + key: "The operand of an increment or decrement operator must be a variable, property or indexer." + }, + The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { + code: 2358, + category: ts.DiagnosticCategory.Error, + key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." + }, + The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { + code: 2359, + category: ts.DiagnosticCategory.Error, + key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." + }, + The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: { + code: 2360, + category: ts.DiagnosticCategory.Error, + key: "The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'." + }, + The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { + code: 2361, + category: ts.DiagnosticCategory.Error, + key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" + }, + The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { + code: 2362, + category: ts.DiagnosticCategory.Error, + key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." + }, + The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { + code: 2363, + category: ts.DiagnosticCategory.Error, + key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." + }, + Invalid_left_hand_side_of_assignment_expression: { + code: 2364, + category: ts.DiagnosticCategory.Error, + key: "Invalid left-hand side of assignment expression." + }, + Operator_0_cannot_be_applied_to_types_1_and_2: { + code: 2365, + category: ts.DiagnosticCategory.Error, + key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." + }, + Type_parameter_name_cannot_be_0: { + code: 2368, + category: ts.DiagnosticCategory.Error, + key: "Type parameter name cannot be '{0}'" + }, + A_parameter_property_is_only_allowed_in_a_constructor_implementation: { + code: 2369, + category: ts.DiagnosticCategory.Error, + key: "A parameter property is only allowed in a constructor implementation." + }, + A_rest_parameter_must_be_of_an_array_type: { + code: 2370, + category: ts.DiagnosticCategory.Error, + key: "A rest parameter must be of an array type." + }, + A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { + code: 2371, + category: ts.DiagnosticCategory.Error, + key: "A parameter initializer is only allowed in a function or constructor implementation." + }, + Parameter_0_cannot_be_referenced_in_its_initializer: { + code: 2372, + category: ts.DiagnosticCategory.Error, + key: "Parameter '{0}' cannot be referenced in its initializer." + }, + Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { + code: 2373, + category: ts.DiagnosticCategory.Error, + key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." + }, + Duplicate_string_index_signature: { + code: 2374, + category: ts.DiagnosticCategory.Error, + key: "Duplicate string index signature." + }, + Duplicate_number_index_signature: { + code: 2375, + category: ts.DiagnosticCategory.Error, + key: "Duplicate number index signature." + }, + A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { + code: 2376, + category: ts.DiagnosticCategory.Error, + key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." + }, + Constructors_for_derived_classes_must_contain_a_super_call: { + code: 2377, + category: ts.DiagnosticCategory.Error, + key: "Constructors for derived classes must contain a 'super' call." + }, + A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { + code: 2378, + category: ts.DiagnosticCategory.Error, + key: "A 'get' accessor must return a value or consist of a single 'throw' statement." + }, + Getter_and_setter_accessors_do_not_agree_in_visibility: { + code: 2379, + category: ts.DiagnosticCategory.Error, + key: "Getter and setter accessors do not agree in visibility." + }, + get_and_set_accessor_must_have_the_same_type: { + code: 2380, + category: ts.DiagnosticCategory.Error, + key: "'get' and 'set' accessor must have the same type." + }, + A_signature_with_an_implementation_cannot_use_a_string_literal_type: { + code: 2381, + category: ts.DiagnosticCategory.Error, + key: "A signature with an implementation cannot use a string literal type." + }, + Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { + code: 2382, + category: ts.DiagnosticCategory.Error, + key: "Specialized overload signature is not assignable to any non-specialized signature." + }, + Overload_signatures_must_all_be_exported_or_not_exported: { + code: 2383, + category: ts.DiagnosticCategory.Error, + key: "Overload signatures must all be exported or not exported." + }, + Overload_signatures_must_all_be_ambient_or_non_ambient: { + code: 2384, + category: ts.DiagnosticCategory.Error, + key: "Overload signatures must all be ambient or non-ambient." + }, + Overload_signatures_must_all_be_public_private_or_protected: { + code: 2385, + category: ts.DiagnosticCategory.Error, + key: "Overload signatures must all be public, private or protected." + }, + Overload_signatures_must_all_be_optional_or_required: { + code: 2386, + category: ts.DiagnosticCategory.Error, + key: "Overload signatures must all be optional or required." + }, + Function_overload_must_be_static: { + code: 2387, + category: ts.DiagnosticCategory.Error, + key: "Function overload must be static." + }, + Function_overload_must_not_be_static: { + code: 2388, + category: ts.DiagnosticCategory.Error, + key: "Function overload must not be static." + }, + Function_implementation_name_must_be_0: { + code: 2389, + category: ts.DiagnosticCategory.Error, + key: "Function implementation name must be '{0}'." + }, + Constructor_implementation_is_missing: { + code: 2390, + category: ts.DiagnosticCategory.Error, + key: "Constructor implementation is missing." + }, + Function_implementation_is_missing_or_not_immediately_following_the_declaration: { + code: 2391, + category: ts.DiagnosticCategory.Error, + key: "Function implementation is missing or not immediately following the declaration." + }, + Multiple_constructor_implementations_are_not_allowed: { + code: 2392, + category: ts.DiagnosticCategory.Error, + key: "Multiple constructor implementations are not allowed." + }, + Duplicate_function_implementation: { + code: 2393, + category: ts.DiagnosticCategory.Error, + key: "Duplicate function implementation." + }, + Overload_signature_is_not_compatible_with_function_implementation: { + code: 2394, + category: ts.DiagnosticCategory.Error, + key: "Overload signature is not compatible with function implementation." + }, + Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { + code: 2395, + category: ts.DiagnosticCategory.Error, + key: "Individual declarations in merged declaration {0} must be all exported or all local." + }, + Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { + code: 2396, + category: ts.DiagnosticCategory.Error, + key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." + }, + Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { + code: 2399, + category: ts.DiagnosticCategory.Error, + key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." + }, + Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { + code: 2400, + category: ts.DiagnosticCategory.Error, + key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." + }, + Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { + code: 2401, + category: ts.DiagnosticCategory.Error, + key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." + }, + Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { + code: 2402, + category: ts.DiagnosticCategory.Error, + key: "Expression resolves to '_super' that compiler uses to capture base class reference." + }, + Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { + code: 2403, + category: ts.DiagnosticCategory.Error, + key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." + }, + The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { + code: 2404, + category: ts.DiagnosticCategory.Error, + key: "The left-hand side of a 'for...in' statement cannot use a type annotation." + }, + The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { + code: 2405, + category: ts.DiagnosticCategory.Error, + key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." + }, + Invalid_left_hand_side_in_for_in_statement: { + code: 2406, + category: ts.DiagnosticCategory.Error, + key: "Invalid left-hand side in 'for...in' statement." + }, + The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { + code: 2407, + category: ts.DiagnosticCategory.Error, + key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." + }, + Setters_cannot_return_a_value: { + code: 2408, + category: ts.DiagnosticCategory.Error, + key: "Setters cannot return a value." + }, + Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { + code: 2409, + category: ts.DiagnosticCategory.Error, + key: "Return type of constructor signature must be assignable to the instance type of the class" + }, + All_symbols_within_a_with_block_will_be_resolved_to_any: { + code: 2410, + category: ts.DiagnosticCategory.Error, + key: "All symbols within a 'with' block will be resolved to 'any'." + }, + Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { + code: 2411, + category: ts.DiagnosticCategory.Error, + key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." + }, + Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { + code: 2412, + category: ts.DiagnosticCategory.Error, + key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." + }, + Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { + code: 2413, + category: ts.DiagnosticCategory.Error, + key: "Numeric index type '{0}' is not assignable to string index type '{1}'." + }, + Class_name_cannot_be_0: { + code: 2414, + category: ts.DiagnosticCategory.Error, + key: "Class name cannot be '{0}'" + }, + Class_0_incorrectly_extends_base_class_1: { + code: 2415, + category: ts.DiagnosticCategory.Error, + key: "Class '{0}' incorrectly extends base class '{1}'." + }, + Class_static_side_0_incorrectly_extends_base_class_static_side_1: { + code: 2417, + category: ts.DiagnosticCategory.Error, + key: "Class static side '{0}' incorrectly extends base class static side '{1}'." + }, + Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { + code: 2419, + category: ts.DiagnosticCategory.Error, + key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." + }, + Class_0_incorrectly_implements_interface_1: { + code: 2420, + category: ts.DiagnosticCategory.Error, + key: "Class '{0}' incorrectly implements interface '{1}'." + }, + A_class_may_only_implement_another_class_or_interface: { + code: 2422, + category: ts.DiagnosticCategory.Error, + key: "A class may only implement another class or interface." + }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { + code: 2423, + category: ts.DiagnosticCategory.Error, + key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." + }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { + code: 2424, + category: ts.DiagnosticCategory.Error, + key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." + }, + Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { + code: 2425, + category: ts.DiagnosticCategory.Error, + key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." + }, + Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { + code: 2426, + category: ts.DiagnosticCategory.Error, + key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." + }, + Interface_name_cannot_be_0: { + code: 2427, + category: ts.DiagnosticCategory.Error, + key: "Interface name cannot be '{0}'" + }, + All_declarations_of_an_interface_must_have_identical_type_parameters: { + code: 2428, + category: ts.DiagnosticCategory.Error, + key: "All declarations of an interface must have identical type parameters." + }, + 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." + }, + 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_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." + }, + 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}'." + }, + Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { + code: 2445, + category: ts.DiagnosticCategory.Error, + key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." + }, + Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { + code: 2446, + category: ts.DiagnosticCategory.Error, + key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." + }, + The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { + code: 2447, + category: ts.DiagnosticCategory.Error, + key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." + }, + Block_scoped_variable_0_used_before_its_declaration: { + code: 2448, + category: ts.DiagnosticCategory.Error, + key: "Block-scoped variable '{0}' used before its declaration." + }, + The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant: { + code: 2449, + category: ts.DiagnosticCategory.Error, + key: "The operand of an increment or decrement operator cannot be a constant." + }, + Left_hand_side_of_assignment_expression_cannot_be_a_constant: { + code: 2450, + category: ts.DiagnosticCategory.Error, + key: "Left-hand side of assignment expression cannot be a constant." + }, + Cannot_redeclare_block_scoped_variable_0: { + code: 2451, + category: ts.DiagnosticCategory.Error, + key: "Cannot redeclare block-scoped variable '{0}'." + }, + An_enum_member_cannot_have_a_numeric_name: { + code: 2452, + category: ts.DiagnosticCategory.Error, + key: "An enum member cannot have a numeric name." + }, + The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { + code: 2453, + category: ts.DiagnosticCategory.Error, + key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." + }, + Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { + code: 2455, + category: ts.DiagnosticCategory.Error, + key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." + }, + Type_alias_0_circularly_references_itself: { + code: 2456, + category: ts.DiagnosticCategory.Error, + key: "Type alias '{0}' circularly references itself." + }, + Type_alias_name_cannot_be_0: { + code: 2457, + category: ts.DiagnosticCategory.Error, + key: "Type alias name cannot be '{0}'" + }, + An_AMD_module_cannot_have_multiple_name_assignments: { + code: 2458, + category: ts.DiagnosticCategory.Error, + key: "An AMD module cannot have multiple name assignments." + }, + Type_0_has_no_property_1_and_no_string_index_signature: { + code: 2459, + category: ts.DiagnosticCategory.Error, + key: "Type '{0}' has no property '{1}' and no string index signature." + }, + Type_0_has_no_property_1: { + code: 2460, + category: ts.DiagnosticCategory.Error, + key: "Type '{0}' has no property '{1}'." + }, + Type_0_is_not_an_array_type: { + code: 2461, + category: ts.DiagnosticCategory.Error, + key: "Type '{0}' is not an array type." + }, + A_rest_element_must_be_last_in_an_array_destructuring_pattern: { + code: 2462, + category: ts.DiagnosticCategory.Error, + key: "A rest element must be last in an array destructuring pattern" + }, + A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: { + code: 2463, + category: ts.DiagnosticCategory.Error, + key: "A binding pattern parameter cannot be optional in an implementation signature." + }, + A_computed_property_name_must_be_of_type_string_number_symbol_or_any: { + code: 2464, + category: ts.DiagnosticCategory.Error, + key: "A computed property name must be of type 'string', 'number', 'symbol', or 'any'." + }, + this_cannot_be_referenced_in_a_computed_property_name: { + code: 2465, + category: ts.DiagnosticCategory.Error, + key: "'this' cannot be referenced in a computed property name." + }, + super_cannot_be_referenced_in_a_computed_property_name: { + code: 2466, + category: ts.DiagnosticCategory.Error, + key: "'super' cannot be referenced in a computed property name." + }, + A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: { + code: 2467, + category: ts.DiagnosticCategory.Error, + key: "A computed property name cannot reference a type parameter from its containing type." + }, + Cannot_find_global_value_0: { + code: 2468, + category: ts.DiagnosticCategory.Error, + key: "Cannot find global value '{0}'." + }, + The_0_operator_cannot_be_applied_to_type_symbol: { + code: 2469, + category: ts.DiagnosticCategory.Error, + key: "The '{0}' operator cannot be applied to type 'symbol'." + }, + Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object: { + code: 2470, + category: ts.DiagnosticCategory.Error, + key: "'Symbol' reference does not refer to the global Symbol constructor object." + }, + A_computed_property_name_of_the_form_0_must_be_of_type_symbol: { + code: 2471, + category: ts.DiagnosticCategory.Error, + key: "A computed property name of the form '{0}' must be of type 'symbol'." + }, + Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_6_and_higher: { + code: 2472, + category: ts.DiagnosticCategory.Error, + key: "Spread operator in 'new' expressions is only available when targeting ECMAScript 6 and higher." + }, + Enum_declarations_must_all_be_const_or_non_const: { + code: 2473, + category: ts.DiagnosticCategory.Error, + key: "Enum declarations must all be const or non-const." + }, + In_const_enum_declarations_member_initializer_must_be_constant_expression: { + code: 2474, + category: ts.DiagnosticCategory.Error, + key: "In 'const' enum declarations member initializer must be constant expression." + }, + const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: { + code: 2475, + category: ts.DiagnosticCategory.Error, + key: "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment." + }, + A_const_enum_member_can_only_be_accessed_using_a_string_literal: { + code: 2476, + category: ts.DiagnosticCategory.Error, + key: "A const enum member can only be accessed using a string literal." + }, + const_enum_member_initializer_was_evaluated_to_a_non_finite_value: { + code: 2477, + category: ts.DiagnosticCategory.Error, + key: "'const' enum member initializer was evaluated to a non-finite value." + }, + const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: { + code: 2478, + category: ts.DiagnosticCategory.Error, + key: "'const' enum member initializer was evaluated to disallowed value 'NaN'." + }, + Property_0_does_not_exist_on_const_enum_1: { + code: 2479, + category: ts.DiagnosticCategory.Error, + key: "Property '{0}' does not exist on 'const' enum '{1}'." + }, + let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { + code: 2480, + category: ts.DiagnosticCategory.Error, + key: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." + }, + Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { + code: 2481, + category: ts.DiagnosticCategory.Error, + key: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." + }, + The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: { + code: 2483, + category: ts.DiagnosticCategory.Error, + key: "The left-hand side of a 'for...of' statement cannot use a type annotation." + }, + Export_declaration_conflicts_with_exported_declaration_of_0: { + code: 2484, + category: ts.DiagnosticCategory.Error, + key: "Export declaration conflicts with exported declaration of '{0}'" + }, + The_left_hand_side_of_a_for_of_statement_cannot_be_a_previously_defined_constant: { + code: 2485, + category: ts.DiagnosticCategory.Error, + key: "The left-hand side of a 'for...of' statement cannot be a previously defined constant." + }, + The_left_hand_side_of_a_for_in_statement_cannot_be_a_previously_defined_constant: { + code: 2486, + category: ts.DiagnosticCategory.Error, + key: "The left-hand side of a 'for...in' statement cannot be a previously defined constant." + }, + Invalid_left_hand_side_in_for_of_statement: { + code: 2487, + category: ts.DiagnosticCategory.Error, + key: "Invalid left-hand side in 'for...of' statement." + }, + The_right_hand_side_of_a_for_of_statement_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { + code: 2488, + category: ts.DiagnosticCategory.Error, + key: "The right-hand side of a 'for...of' statement must have a '[Symbol.iterator]()' method that returns an iterator." + }, + The_iterator_returned_by_the_right_hand_side_of_a_for_of_statement_must_have_a_next_method: { + code: 2489, + category: ts.DiagnosticCategory.Error, + key: "The iterator returned by the right-hand side of a 'for...of' statement must have a 'next()' method." + }, + The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: { + code: 2490, + category: ts.DiagnosticCategory.Error, + key: "The type returned by the 'next()' method of an iterator must have a 'value' property." + }, + The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: { + code: 2491, + category: ts.DiagnosticCategory.Error, + key: "The left-hand side of a 'for...in' statement cannot be a destructuring pattern." + }, + Cannot_redeclare_identifier_0_in_catch_clause: { + code: 2492, + category: ts.DiagnosticCategory.Error, + key: "Cannot redeclare identifier '{0}' in catch clause" + }, + Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: { + code: 2493, + category: ts.DiagnosticCategory.Error, + key: "Tuple type '{0}' with length '{1}' cannot be assigned to tuple with length '{2}'." + }, + 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_Consider_using_a_standard_function_expression: { + code: 2496, + category: ts.DiagnosticCategory.Error, + key: "The 'arguments' object cannot be referenced in an arrow function. 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 *'." + }, + 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." + }, + 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}'." + }, + Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { + code: 4006, + category: ts.DiagnosticCategory.Error, + key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." + }, + Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { + code: 4008, + category: ts.DiagnosticCategory.Error, + key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." + }, + Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { + code: 4010, + category: ts.DiagnosticCategory.Error, + key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." + }, + Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { + code: 4012, + category: ts.DiagnosticCategory.Error, + key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." + }, + Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { + code: 4014, + category: ts.DiagnosticCategory.Error, + key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." + }, + Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { + code: 4016, + category: ts.DiagnosticCategory.Error, + key: "Type parameter '{0}' of exported function has or is using private name '{1}'." + }, + Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { + code: 4019, + category: ts.DiagnosticCategory.Error, + key: "Implements clause of exported class '{0}' has or is using private name '{1}'." + }, + Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { + code: 4020, + category: ts.DiagnosticCategory.Error, + key: "Extends clause of exported class '{0}' has or is using private name '{1}'." + }, + Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { + code: 4022, + category: ts.DiagnosticCategory.Error, + key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." + }, + Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { + code: 4023, + category: ts.DiagnosticCategory.Error, + key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." + }, + Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { + code: 4024, + category: ts.DiagnosticCategory.Error, + key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." + }, + Exported_variable_0_has_or_is_using_private_name_1: { + code: 4025, + category: ts.DiagnosticCategory.Error, + key: "Exported variable '{0}' has or is using private name '{1}'." + }, + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { + code: 4026, + category: ts.DiagnosticCategory.Error, + key: "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." + }, + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { + code: 4027, + category: ts.DiagnosticCategory.Error, + key: "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'." + }, + Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: { + code: 4028, + category: ts.DiagnosticCategory.Error, + key: "Public static property '{0}' of exported class has or is using private name '{1}'." + }, + Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { + code: 4029, + category: ts.DiagnosticCategory.Error, + key: "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." + }, + Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { + code: 4030, + category: ts.DiagnosticCategory.Error, + key: "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'." + }, + Public_property_0_of_exported_class_has_or_is_using_private_name_1: { + code: 4031, + category: ts.DiagnosticCategory.Error, + key: "Public property '{0}' of exported class has or is using private name '{1}'." + }, + Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { + code: 4032, + category: ts.DiagnosticCategory.Error, + key: "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'." + }, + Property_0_of_exported_interface_has_or_is_using_private_name_1: { + code: 4033, + category: ts.DiagnosticCategory.Error, + key: "Property '{0}' of exported interface has or is using private name '{1}'." + }, + Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { + code: 4034, + category: ts.DiagnosticCategory.Error, + key: "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: { + code: 4035, + category: ts.DiagnosticCategory.Error, + key: "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'." + }, + Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { + code: 4036, + category: ts.DiagnosticCategory.Error, + key: "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: { + code: 4037, + category: ts.DiagnosticCategory.Error, + key: "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'." + }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { + code: 4038, + category: ts.DiagnosticCategory.Error, + key: "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." + }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { + code: 4039, + category: ts.DiagnosticCategory.Error, + key: "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: { + code: 4040, + category: ts.DiagnosticCategory.Error, + key: "Return type of public static property getter from exported class has or is using private name '{0}'." + }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { + code: 4041, + category: ts.DiagnosticCategory.Error, + key: "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." + }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { + code: 4042, + category: ts.DiagnosticCategory.Error, + key: "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: { + code: 4043, + category: ts.DiagnosticCategory.Error, + key: "Return type of public property getter from exported class has or is using private name '{0}'." + }, + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { + code: 4044, + category: ts.DiagnosticCategory.Error, + key: "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: { + code: 4045, + category: ts.DiagnosticCategory.Error, + key: "Return type of constructor signature from exported interface has or is using private name '{0}'." + }, + Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { + code: 4046, + category: ts.DiagnosticCategory.Error, + key: "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: { + code: 4047, + category: ts.DiagnosticCategory.Error, + key: "Return type of call signature from exported interface has or is using private name '{0}'." + }, + Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { + code: 4048, + category: ts.DiagnosticCategory.Error, + key: "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: { + code: 4049, + category: ts.DiagnosticCategory.Error, + key: "Return type of index signature from exported interface has or is using private name '{0}'." + }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { + code: 4050, + category: ts.DiagnosticCategory.Error, + key: "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named." + }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { + code: 4051, + category: ts.DiagnosticCategory.Error, + key: "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: { + code: 4052, + category: ts.DiagnosticCategory.Error, + key: "Return type of public static method from exported class has or is using private name '{0}'." + }, + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { + code: 4053, + category: ts.DiagnosticCategory.Error, + key: "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named." + }, + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { + code: 4054, + category: ts.DiagnosticCategory.Error, + key: "Return type of public method from exported class has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: { + code: 4055, + category: ts.DiagnosticCategory.Error, + key: "Return type of public method from exported class has or is using private name '{0}'." + }, + Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { + code: 4056, + category: ts.DiagnosticCategory.Error, + key: "Return type of method from exported interface has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: { + code: 4057, + category: ts.DiagnosticCategory.Error, + key: "Return type of method from exported interface has or is using private name '{0}'." + }, + Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { + code: 4058, + category: ts.DiagnosticCategory.Error, + key: "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named." + }, + Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: { + code: 4059, + category: ts.DiagnosticCategory.Error, + key: "Return type of exported function has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_exported_function_has_or_is_using_private_name_0: { + code: 4060, + category: ts.DiagnosticCategory.Error, + key: "Return type of exported function has or is using private name '{0}'." + }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { + code: 4061, + category: ts.DiagnosticCategory.Error, + key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named." + }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: { + code: 4062, + category: ts.DiagnosticCategory.Error, + key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: { + code: 4063, + category: ts.DiagnosticCategory.Error, + key: "Parameter '{0}' of constructor from exported class has or is using private name '{1}'." + }, + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { + code: 4064, + category: ts.DiagnosticCategory.Error, + key: "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { + code: 4065, + category: ts.DiagnosticCategory.Error, + key: "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." + }, + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { + code: 4066, + category: ts.DiagnosticCategory.Error, + key: "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { + code: 4067, + category: ts.DiagnosticCategory.Error, + key: "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'." + }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { + code: 4068, + category: ts.DiagnosticCategory.Error, + key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named." + }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { + code: 4069, + category: ts.DiagnosticCategory.Error, + key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { + code: 4070, + category: ts.DiagnosticCategory.Error, + key: "Parameter '{0}' of public static method from exported class has or is using private name '{1}'." + }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { + code: 4071, + category: ts.DiagnosticCategory.Error, + key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named." + }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { + code: 4072, + category: ts.DiagnosticCategory.Error, + key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { + code: 4073, + category: ts.DiagnosticCategory.Error, + key: "Parameter '{0}' of public method from exported class has or is using private name '{1}'." + }, + Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { + code: 4074, + category: ts.DiagnosticCategory.Error, + key: "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { + code: 4075, + category: ts.DiagnosticCategory.Error, + key: "Parameter '{0}' of method from exported interface has or is using private name '{1}'." + }, + Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { + code: 4076, + category: ts.DiagnosticCategory.Error, + key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." + }, + Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { + code: 4077, + category: ts.DiagnosticCategory.Error, + key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_exported_function_has_or_is_using_private_name_1: { + code: 4078, + category: ts.DiagnosticCategory.Error, + key: "Parameter '{0}' of exported function has or is using private name '{1}'." + }, + Exported_type_alias_0_has_or_is_using_private_name_1: { + code: 4081, + category: ts.DiagnosticCategory.Error, + key: "Exported type alias '{0}' has or is using private name '{1}'." + }, + Default_export_of_the_module_has_or_is_using_private_name_0: { + code: 4082, + category: ts.DiagnosticCategory.Error, + key: "Default export of the module has or is using private name '{0}'." + }, + Loop_contains_block_scoped_variable_0_referenced_by_a_function_in_the_loop_This_is_only_supported_in_ECMAScript_6_or_higher: { + code: 4091, + category: ts.DiagnosticCategory.Error, + key: "Loop contains block-scoped variable '{0}' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher." + }, + The_current_host_does_not_support_the_0_option: { + code: 5001, + category: ts.DiagnosticCategory.Error, + key: "The current host does not support the '{0}' option." + }, + 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." + }, + 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}" + }, + Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { + code: 5038, + category: ts.DiagnosticCategory.Error, + key: "Option 'mapRoot' cannot be specified without specifying 'sourcemap' option." + }, + Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { + code: 5039, + category: ts.DiagnosticCategory.Error, + key: "Option 'sourceRoot' cannot be specified without specifying 'sourcemap' option." + }, + Option_noEmit_cannot_be_specified_with_option_out_or_outDir: { + code: 5040, + category: ts.DiagnosticCategory.Error, + key: "Option 'noEmit' cannot be specified with option 'out' or 'outDir'." + }, + Option_noEmit_cannot_be_specified_with_option_declaration: { + code: 5041, + category: ts.DiagnosticCategory.Error, + key: "Option 'noEmit' cannot be specified with option 'declaration'." + }, + Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { + code: 5042, + category: ts.DiagnosticCategory.Error, + key: "Option 'project' cannot be mixed with source files on a command line." + }, + Option_sourceMap_cannot_be_specified_with_option_separateCompilation: { + code: 5043, + category: ts.DiagnosticCategory.Error, + key: "Option 'sourceMap' cannot be specified with option 'separateCompilation'." + }, + Option_declaration_cannot_be_specified_with_option_separateCompilation: { + code: 5044, + category: ts.DiagnosticCategory.Error, + key: "Option 'declaration' cannot be specified with option 'separateCompilation'." + }, + 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." + }, + 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." + }, + Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { + code: 6004, + category: ts.DiagnosticCategory.Message, + key: "Specifies the location where debugger should locate TypeScript files instead of source locations." + }, + Watch_input_files: { + code: 6005, + category: ts.DiagnosticCategory.Message, + key: "Watch input files." + }, + Redirect_output_structure_to_the_directory: { + code: 6006, + category: ts.DiagnosticCategory.Message, + key: "Redirect output structure to the directory." + }, + Do_not_erase_const_enum_declarations_in_generated_code: { + code: 6007, + category: ts.DiagnosticCategory.Message, + key: "Do not erase const enum declarations in generated code." + }, + Do_not_emit_outputs_if_any_type_checking_errors_were_reported: { + code: 6008, + category: ts.DiagnosticCategory.Message, + key: "Do not emit outputs if any type checking errors were reported." + }, + 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'" + }, + 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." + }, + Syntax_Colon_0: { + code: 6023, + category: ts.DiagnosticCategory.Message, + key: "Syntax: {0}" + }, + options: { + code: 6024, + category: ts.DiagnosticCategory.Message, + key: "options" + }, + file: { + code: 6025, + category: ts.DiagnosticCategory.Message, + key: "file" + }, + Examples_Colon_0: { + code: 6026, + category: ts.DiagnosticCategory.Message, + key: "Examples: {0}" + }, + Options_Colon: { + code: 6027, + category: ts.DiagnosticCategory.Message, + key: "Options:" + }, + Version_0: { + code: 6029, + category: ts.DiagnosticCategory.Message, + key: "Version {0}" + }, + Insert_command_line_options_and_files_from_a_file: { + code: 6030, + category: ts.DiagnosticCategory.Message, + key: "Insert command line options and files from a file." + }, + File_change_detected_Starting_incremental_compilation: { + code: 6032, + category: ts.DiagnosticCategory.Message, + key: "File change detected. Starting incremental compilation..." + }, + KIND: { + code: 6034, + category: ts.DiagnosticCategory.Message, + key: "KIND" + }, + FILE: { + code: 6035, + category: ts.DiagnosticCategory.Message, + key: "FILE" + }, + VERSION: { + code: 6036, + category: ts.DiagnosticCategory.Message, + key: "VERSION" + }, + LOCATION: { + code: 6037, + category: ts.DiagnosticCategory.Message, + key: "LOCATION" + }, + DIRECTORY: { + code: 6038, + category: ts.DiagnosticCategory.Message, + key: "DIRECTORY" + }, + Compilation_complete_Watching_for_file_changes: { + code: 6042, + category: ts.DiagnosticCategory.Message, + key: "Compilation complete. Watching for file changes." + }, + 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'." + }, + 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}'." + }, + Corrupted_locale_file_0: { + code: 6051, + category: ts.DiagnosticCategory.Error, + key: "Corrupted locale file {0}." + }, + Raise_error_on_expressions_and_declarations_with_an_implied_any_type: { + code: 6052, + category: ts.DiagnosticCategory.Message, + key: "Raise error on expressions and declarations with an implied 'any' type." + }, + File_0_not_found: { + code: 6053, + category: ts.DiagnosticCategory.Error, + key: "File '{0}' not found." + }, + File_0_must_have_extension_ts_or_d_ts: { + code: 6054, + category: ts.DiagnosticCategory.Error, + key: "File '{0}' must have extension '.ts' or '.d.ts'." + }, + Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: { + code: 6055, + category: ts.DiagnosticCategory.Message, + key: "Suppress noImplicitAny errors for indexing objects lacking index signatures." + }, + Do_not_emit_declarations_for_code_that_has_an_internal_annotation: { + code: 6056, + category: ts.DiagnosticCategory.Message, + key: "Do not emit declarations for code that has an '@internal' annotation." + }, + Preserve_new_lines_when_emitting_code: { + code: 6057, + category: ts.DiagnosticCategory.Message, + key: "Preserve new-lines when emitting code." + }, + 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." + }, + new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: { + code: 7009, + category: ts.DiagnosticCategory.Error, + key: "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type." + }, + _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { + code: 7010, + category: ts.DiagnosticCategory.Error, + key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." + }, + Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { + code: 7011, + category: ts.DiagnosticCategory.Error, + key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." + }, + Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { + code: 7013, + category: ts.DiagnosticCategory.Error, + key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." + }, + Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { + code: 7016, + category: ts.DiagnosticCategory.Error, + key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." + }, + Index_signature_of_object_type_implicitly_has_an_any_type: { + code: 7017, + category: ts.DiagnosticCategory.Error, + key: "Index signature of object type implicitly has an 'any' type." + }, + 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." + }, + You_cannot_rename_this_element: { + code: 8000, + category: ts.DiagnosticCategory.Error, + key: "You cannot rename this element." + }, + You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: { + code: 8001, + category: ts.DiagnosticCategory.Error, + key: "You cannot rename elements that are defined in the standard TypeScript library." + }, + yield_expressions_are_not_currently_supported: { + code: 9000, + category: ts.DiagnosticCategory.Error, + key: "'yield' expressions are not currently supported." + }, + Generators_are_not_currently_supported: { + code: 9001, + category: ts.DiagnosticCategory.Error, + key: "Generators are not currently supported." + }, + Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clauses: { + code: 9002, + category: ts.DiagnosticCategory.Error, + key: "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses." + }, + class_expressions_are_not_currently_supported: { + code: 9003, + category: ts.DiagnosticCategory.Error, + key: "'class' expressions are not currently supported." + }, + class_declarations_are_only_supported_directly_inside_a_module_or_as_a_top_level_declaration: { + code: 9004, + category: ts.DiagnosticCategory.Error, + key: "'class' declarations are only supported directly inside a module or as a top level declaration." + } }; })(ts || (ts = {})); +/// +/// var ts; (function (ts) { var textToToken = { - "any": 111, - "as": 101, - "boolean": 112, - "break": 65, - "case": 66, - "catch": 67, - "class": 68, - "continue": 70, - "const": 69, - "constructor": 113, - "debugger": 71, - "declare": 114, - "default": 72, - "delete": 73, - "do": 74, - "else": 75, - "enum": 76, - "export": 77, - "extends": 78, - "false": 79, - "finally": 80, - "for": 81, - "from": 123, - "function": 82, - "get": 115, - "if": 83, - "implements": 102, - "import": 84, - "in": 85, - "instanceof": 86, - "interface": 103, - "let": 104, - "module": 116, - "new": 87, - "null": 88, - "number": 118, - "package": 105, - "private": 106, - "protected": 107, - "public": 108, - "require": 117, - "return": 89, - "set": 119, - "static": 109, - "string": 120, - "super": 90, - "switch": 91, - "symbol": 121, - "this": 92, - "throw": 93, - "true": 94, - "try": 95, - "type": 122, - "typeof": 96, - "var": 97, - "void": 98, - "while": 99, - "with": 100, - "yield": 110, - "of": 124, + "any": 112, + "as": 102, + "boolean": 113, + "break": 66, + "case": 67, + "catch": 68, + "class": 69, + "continue": 71, + "const": 70, + "constructor": 114, + "debugger": 72, + "declare": 115, + "default": 73, + "delete": 74, + "do": 75, + "else": 76, + "enum": 77, + "export": 78, + "extends": 79, + "false": 80, + "finally": 81, + "for": 82, + "from": 124, + "function": 83, + "get": 116, + "if": 84, + "implements": 103, + "import": 85, + "in": 86, + "instanceof": 87, + "interface": 104, + "let": 105, + "module": 117, + "new": 88, + "null": 89, + "number": 119, + "package": 106, + "private": 107, + "protected": 108, + "public": 109, + "require": 118, + "return": 90, + "set": 120, + "static": 110, + "string": 121, + "super": 91, + "switch": 92, + "symbol": 122, + "this": 93, + "throw": 94, + "true": 95, + "try": 96, + "type": 123, + "typeof": 97, + "var": 98, + "void": 99, + "while": 100, + "with": 101, + "yield": 111, + "of": 125, "{": 14, "}": 15, "(": 16, @@ -1466,23 +3570,2820 @@ var ts; "||": 49, "?": 50, ":": 51, - "=": 52, - "+=": 53, - "-=": 54, - "*=": 55, - "/=": 56, - "%=": 57, - "<<=": 58, - ">>=": 59, - ">>>=": 60, - "&=": 61, - "|=": 62, - "^=": 63 + "=": 53, + "+=": 54, + "-=": 55, + "*=": 56, + "/=": 57, + "%=": 58, + "<<=": 59, + ">>=": 60, + ">>>=": 61, + "&=": 62, + "|=": 63, + "^=": 64, + "@": 52 }; - var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; + var unicodeES3IdentifierStart = [ + 170, + 170, + 181, + 181, + 186, + 186, + 192, + 214, + 216, + 246, + 248, + 543, + 546, + 563, + 592, + 685, + 688, + 696, + 699, + 705, + 720, + 721, + 736, + 740, + 750, + 750, + 890, + 890, + 902, + 902, + 904, + 906, + 908, + 908, + 910, + 929, + 931, + 974, + 976, + 983, + 986, + 1011, + 1024, + 1153, + 1164, + 1220, + 1223, + 1224, + 1227, + 1228, + 1232, + 1269, + 1272, + 1273, + 1329, + 1366, + 1369, + 1369, + 1377, + 1415, + 1488, + 1514, + 1520, + 1522, + 1569, + 1594, + 1600, + 1610, + 1649, + 1747, + 1749, + 1749, + 1765, + 1766, + 1786, + 1788, + 1808, + 1808, + 1810, + 1836, + 1920, + 1957, + 2309, + 2361, + 2365, + 2365, + 2384, + 2384, + 2392, + 2401, + 2437, + 2444, + 2447, + 2448, + 2451, + 2472, + 2474, + 2480, + 2482, + 2482, + 2486, + 2489, + 2524, + 2525, + 2527, + 2529, + 2544, + 2545, + 2565, + 2570, + 2575, + 2576, + 2579, + 2600, + 2602, + 2608, + 2610, + 2611, + 2613, + 2614, + 2616, + 2617, + 2649, + 2652, + 2654, + 2654, + 2674, + 2676, + 2693, + 2699, + 2701, + 2701, + 2703, + 2705, + 2707, + 2728, + 2730, + 2736, + 2738, + 2739, + 2741, + 2745, + 2749, + 2749, + 2768, + 2768, + 2784, + 2784, + 2821, + 2828, + 2831, + 2832, + 2835, + 2856, + 2858, + 2864, + 2866, + 2867, + 2870, + 2873, + 2877, + 2877, + 2908, + 2909, + 2911, + 2913, + 2949, + 2954, + 2958, + 2960, + 2962, + 2965, + 2969, + 2970, + 2972, + 2972, + 2974, + 2975, + 2979, + 2980, + 2984, + 2986, + 2990, + 2997, + 2999, + 3001, + 3077, + 3084, + 3086, + 3088, + 3090, + 3112, + 3114, + 3123, + 3125, + 3129, + 3168, + 3169, + 3205, + 3212, + 3214, + 3216, + 3218, + 3240, + 3242, + 3251, + 3253, + 3257, + 3294, + 3294, + 3296, + 3297, + 3333, + 3340, + 3342, + 3344, + 3346, + 3368, + 3370, + 3385, + 3424, + 3425, + 3461, + 3478, + 3482, + 3505, + 3507, + 3515, + 3517, + 3517, + 3520, + 3526, + 3585, + 3632, + 3634, + 3635, + 3648, + 3654, + 3713, + 3714, + 3716, + 3716, + 3719, + 3720, + 3722, + 3722, + 3725, + 3725, + 3732, + 3735, + 3737, + 3743, + 3745, + 3747, + 3749, + 3749, + 3751, + 3751, + 3754, + 3755, + 3757, + 3760, + 3762, + 3763, + 3773, + 3773, + 3776, + 3780, + 3782, + 3782, + 3804, + 3805, + 3840, + 3840, + 3904, + 3911, + 3913, + 3946, + 3976, + 3979, + 4096, + 4129, + 4131, + 4135, + 4137, + 4138, + 4176, + 4181, + 4256, + 4293, + 4304, + 4342, + 4352, + 4441, + 4447, + 4514, + 4520, + 4601, + 4608, + 4614, + 4616, + 4678, + 4680, + 4680, + 4682, + 4685, + 4688, + 4694, + 4696, + 4696, + 4698, + 4701, + 4704, + 4742, + 4744, + 4744, + 4746, + 4749, + 4752, + 4782, + 4784, + 4784, + 4786, + 4789, + 4792, + 4798, + 4800, + 4800, + 4802, + 4805, + 4808, + 4814, + 4816, + 4822, + 4824, + 4846, + 4848, + 4878, + 4880, + 4880, + 4882, + 4885, + 4888, + 4894, + 4896, + 4934, + 4936, + 4954, + 5024, + 5108, + 5121, + 5740, + 5743, + 5750, + 5761, + 5786, + 5792, + 5866, + 6016, + 6067, + 6176, + 6263, + 6272, + 6312, + 7680, + 7835, + 7840, + 7929, + 7936, + 7957, + 7960, + 7965, + 7968, + 8005, + 8008, + 8013, + 8016, + 8023, + 8025, + 8025, + 8027, + 8027, + 8029, + 8029, + 8031, + 8061, + 8064, + 8116, + 8118, + 8124, + 8126, + 8126, + 8130, + 8132, + 8134, + 8140, + 8144, + 8147, + 8150, + 8155, + 8160, + 8172, + 8178, + 8180, + 8182, + 8188, + 8319, + 8319, + 8450, + 8450, + 8455, + 8455, + 8458, + 8467, + 8469, + 8469, + 8473, + 8477, + 8484, + 8484, + 8486, + 8486, + 8488, + 8488, + 8490, + 8493, + 8495, + 8497, + 8499, + 8505, + 8544, + 8579, + 12293, + 12295, + 12321, + 12329, + 12337, + 12341, + 12344, + 12346, + 12353, + 12436, + 12445, + 12446, + 12449, + 12538, + 12540, + 12542, + 12549, + 12588, + 12593, + 12686, + 12704, + 12727, + 13312, + 19893, + 19968, + 40869, + 40960, + 42124, + 44032, + 55203, + 63744, + 64045, + 64256, + 64262, + 64275, + 64279, + 64285, + 64285, + 64287, + 64296, + 64298, + 64310, + 64312, + 64316, + 64318, + 64318, + 64320, + 64321, + 64323, + 64324, + 64326, + 64433, + 64467, + 64829, + 64848, + 64911, + 64914, + 64967, + 65008, + 65019, + 65136, + 65138, + 65140, + 65140, + 65142, + 65276, + 65313, + 65338, + 65345, + 65370, + 65382, + 65470, + 65474, + 65479, + 65482, + 65487, + 65490, + 65495, + 65498, + 65500, + ]; + var unicodeES3IdentifierPart = [ + 170, + 170, + 181, + 181, + 186, + 186, + 192, + 214, + 216, + 246, + 248, + 543, + 546, + 563, + 592, + 685, + 688, + 696, + 699, + 705, + 720, + 721, + 736, + 740, + 750, + 750, + 768, + 846, + 864, + 866, + 890, + 890, + 902, + 902, + 904, + 906, + 908, + 908, + 910, + 929, + 931, + 974, + 976, + 983, + 986, + 1011, + 1024, + 1153, + 1155, + 1158, + 1164, + 1220, + 1223, + 1224, + 1227, + 1228, + 1232, + 1269, + 1272, + 1273, + 1329, + 1366, + 1369, + 1369, + 1377, + 1415, + 1425, + 1441, + 1443, + 1465, + 1467, + 1469, + 1471, + 1471, + 1473, + 1474, + 1476, + 1476, + 1488, + 1514, + 1520, + 1522, + 1569, + 1594, + 1600, + 1621, + 1632, + 1641, + 1648, + 1747, + 1749, + 1756, + 1759, + 1768, + 1770, + 1773, + 1776, + 1788, + 1808, + 1836, + 1840, + 1866, + 1920, + 1968, + 2305, + 2307, + 2309, + 2361, + 2364, + 2381, + 2384, + 2388, + 2392, + 2403, + 2406, + 2415, + 2433, + 2435, + 2437, + 2444, + 2447, + 2448, + 2451, + 2472, + 2474, + 2480, + 2482, + 2482, + 2486, + 2489, + 2492, + 2492, + 2494, + 2500, + 2503, + 2504, + 2507, + 2509, + 2519, + 2519, + 2524, + 2525, + 2527, + 2531, + 2534, + 2545, + 2562, + 2562, + 2565, + 2570, + 2575, + 2576, + 2579, + 2600, + 2602, + 2608, + 2610, + 2611, + 2613, + 2614, + 2616, + 2617, + 2620, + 2620, + 2622, + 2626, + 2631, + 2632, + 2635, + 2637, + 2649, + 2652, + 2654, + 2654, + 2662, + 2676, + 2689, + 2691, + 2693, + 2699, + 2701, + 2701, + 2703, + 2705, + 2707, + 2728, + 2730, + 2736, + 2738, + 2739, + 2741, + 2745, + 2748, + 2757, + 2759, + 2761, + 2763, + 2765, + 2768, + 2768, + 2784, + 2784, + 2790, + 2799, + 2817, + 2819, + 2821, + 2828, + 2831, + 2832, + 2835, + 2856, + 2858, + 2864, + 2866, + 2867, + 2870, + 2873, + 2876, + 2883, + 2887, + 2888, + 2891, + 2893, + 2902, + 2903, + 2908, + 2909, + 2911, + 2913, + 2918, + 2927, + 2946, + 2947, + 2949, + 2954, + 2958, + 2960, + 2962, + 2965, + 2969, + 2970, + 2972, + 2972, + 2974, + 2975, + 2979, + 2980, + 2984, + 2986, + 2990, + 2997, + 2999, + 3001, + 3006, + 3010, + 3014, + 3016, + 3018, + 3021, + 3031, + 3031, + 3047, + 3055, + 3073, + 3075, + 3077, + 3084, + 3086, + 3088, + 3090, + 3112, + 3114, + 3123, + 3125, + 3129, + 3134, + 3140, + 3142, + 3144, + 3146, + 3149, + 3157, + 3158, + 3168, + 3169, + 3174, + 3183, + 3202, + 3203, + 3205, + 3212, + 3214, + 3216, + 3218, + 3240, + 3242, + 3251, + 3253, + 3257, + 3262, + 3268, + 3270, + 3272, + 3274, + 3277, + 3285, + 3286, + 3294, + 3294, + 3296, + 3297, + 3302, + 3311, + 3330, + 3331, + 3333, + 3340, + 3342, + 3344, + 3346, + 3368, + 3370, + 3385, + 3390, + 3395, + 3398, + 3400, + 3402, + 3405, + 3415, + 3415, + 3424, + 3425, + 3430, + 3439, + 3458, + 3459, + 3461, + 3478, + 3482, + 3505, + 3507, + 3515, + 3517, + 3517, + 3520, + 3526, + 3530, + 3530, + 3535, + 3540, + 3542, + 3542, + 3544, + 3551, + 3570, + 3571, + 3585, + 3642, + 3648, + 3662, + 3664, + 3673, + 3713, + 3714, + 3716, + 3716, + 3719, + 3720, + 3722, + 3722, + 3725, + 3725, + 3732, + 3735, + 3737, + 3743, + 3745, + 3747, + 3749, + 3749, + 3751, + 3751, + 3754, + 3755, + 3757, + 3769, + 3771, + 3773, + 3776, + 3780, + 3782, + 3782, + 3784, + 3789, + 3792, + 3801, + 3804, + 3805, + 3840, + 3840, + 3864, + 3865, + 3872, + 3881, + 3893, + 3893, + 3895, + 3895, + 3897, + 3897, + 3902, + 3911, + 3913, + 3946, + 3953, + 3972, + 3974, + 3979, + 3984, + 3991, + 3993, + 4028, + 4038, + 4038, + 4096, + 4129, + 4131, + 4135, + 4137, + 4138, + 4140, + 4146, + 4150, + 4153, + 4160, + 4169, + 4176, + 4185, + 4256, + 4293, + 4304, + 4342, + 4352, + 4441, + 4447, + 4514, + 4520, + 4601, + 4608, + 4614, + 4616, + 4678, + 4680, + 4680, + 4682, + 4685, + 4688, + 4694, + 4696, + 4696, + 4698, + 4701, + 4704, + 4742, + 4744, + 4744, + 4746, + 4749, + 4752, + 4782, + 4784, + 4784, + 4786, + 4789, + 4792, + 4798, + 4800, + 4800, + 4802, + 4805, + 4808, + 4814, + 4816, + 4822, + 4824, + 4846, + 4848, + 4878, + 4880, + 4880, + 4882, + 4885, + 4888, + 4894, + 4896, + 4934, + 4936, + 4954, + 4969, + 4977, + 5024, + 5108, + 5121, + 5740, + 5743, + 5750, + 5761, + 5786, + 5792, + 5866, + 6016, + 6099, + 6112, + 6121, + 6160, + 6169, + 6176, + 6263, + 6272, + 6313, + 7680, + 7835, + 7840, + 7929, + 7936, + 7957, + 7960, + 7965, + 7968, + 8005, + 8008, + 8013, + 8016, + 8023, + 8025, + 8025, + 8027, + 8027, + 8029, + 8029, + 8031, + 8061, + 8064, + 8116, + 8118, + 8124, + 8126, + 8126, + 8130, + 8132, + 8134, + 8140, + 8144, + 8147, + 8150, + 8155, + 8160, + 8172, + 8178, + 8180, + 8182, + 8188, + 8255, + 8256, + 8319, + 8319, + 8400, + 8412, + 8417, + 8417, + 8450, + 8450, + 8455, + 8455, + 8458, + 8467, + 8469, + 8469, + 8473, + 8477, + 8484, + 8484, + 8486, + 8486, + 8488, + 8488, + 8490, + 8493, + 8495, + 8497, + 8499, + 8505, + 8544, + 8579, + 12293, + 12295, + 12321, + 12335, + 12337, + 12341, + 12344, + 12346, + 12353, + 12436, + 12441, + 12442, + 12445, + 12446, + 12449, + 12542, + 12549, + 12588, + 12593, + 12686, + 12704, + 12727, + 13312, + 19893, + 19968, + 40869, + 40960, + 42124, + 44032, + 55203, + 63744, + 64045, + 64256, + 64262, + 64275, + 64279, + 64285, + 64296, + 64298, + 64310, + 64312, + 64316, + 64318, + 64318, + 64320, + 64321, + 64323, + 64324, + 64326, + 64433, + 64467, + 64829, + 64848, + 64911, + 64914, + 64967, + 65008, + 65019, + 65056, + 65059, + 65075, + 65076, + 65101, + 65103, + 65136, + 65138, + 65140, + 65140, + 65142, + 65276, + 65296, + 65305, + 65313, + 65338, + 65343, + 65343, + 65345, + 65370, + 65381, + 65470, + 65474, + 65479, + 65482, + 65487, + 65490, + 65495, + 65498, + 65500, + ]; + var unicodeES5IdentifierStart = [ + 170, + 170, + 181, + 181, + 186, + 186, + 192, + 214, + 216, + 246, + 248, + 705, + 710, + 721, + 736, + 740, + 748, + 748, + 750, + 750, + 880, + 884, + 886, + 887, + 890, + 893, + 902, + 902, + 904, + 906, + 908, + 908, + 910, + 929, + 931, + 1013, + 1015, + 1153, + 1162, + 1319, + 1329, + 1366, + 1369, + 1369, + 1377, + 1415, + 1488, + 1514, + 1520, + 1522, + 1568, + 1610, + 1646, + 1647, + 1649, + 1747, + 1749, + 1749, + 1765, + 1766, + 1774, + 1775, + 1786, + 1788, + 1791, + 1791, + 1808, + 1808, + 1810, + 1839, + 1869, + 1957, + 1969, + 1969, + 1994, + 2026, + 2036, + 2037, + 2042, + 2042, + 2048, + 2069, + 2074, + 2074, + 2084, + 2084, + 2088, + 2088, + 2112, + 2136, + 2208, + 2208, + 2210, + 2220, + 2308, + 2361, + 2365, + 2365, + 2384, + 2384, + 2392, + 2401, + 2417, + 2423, + 2425, + 2431, + 2437, + 2444, + 2447, + 2448, + 2451, + 2472, + 2474, + 2480, + 2482, + 2482, + 2486, + 2489, + 2493, + 2493, + 2510, + 2510, + 2524, + 2525, + 2527, + 2529, + 2544, + 2545, + 2565, + 2570, + 2575, + 2576, + 2579, + 2600, + 2602, + 2608, + 2610, + 2611, + 2613, + 2614, + 2616, + 2617, + 2649, + 2652, + 2654, + 2654, + 2674, + 2676, + 2693, + 2701, + 2703, + 2705, + 2707, + 2728, + 2730, + 2736, + 2738, + 2739, + 2741, + 2745, + 2749, + 2749, + 2768, + 2768, + 2784, + 2785, + 2821, + 2828, + 2831, + 2832, + 2835, + 2856, + 2858, + 2864, + 2866, + 2867, + 2869, + 2873, + 2877, + 2877, + 2908, + 2909, + 2911, + 2913, + 2929, + 2929, + 2947, + 2947, + 2949, + 2954, + 2958, + 2960, + 2962, + 2965, + 2969, + 2970, + 2972, + 2972, + 2974, + 2975, + 2979, + 2980, + 2984, + 2986, + 2990, + 3001, + 3024, + 3024, + 3077, + 3084, + 3086, + 3088, + 3090, + 3112, + 3114, + 3123, + 3125, + 3129, + 3133, + 3133, + 3160, + 3161, + 3168, + 3169, + 3205, + 3212, + 3214, + 3216, + 3218, + 3240, + 3242, + 3251, + 3253, + 3257, + 3261, + 3261, + 3294, + 3294, + 3296, + 3297, + 3313, + 3314, + 3333, + 3340, + 3342, + 3344, + 3346, + 3386, + 3389, + 3389, + 3406, + 3406, + 3424, + 3425, + 3450, + 3455, + 3461, + 3478, + 3482, + 3505, + 3507, + 3515, + 3517, + 3517, + 3520, + 3526, + 3585, + 3632, + 3634, + 3635, + 3648, + 3654, + 3713, + 3714, + 3716, + 3716, + 3719, + 3720, + 3722, + 3722, + 3725, + 3725, + 3732, + 3735, + 3737, + 3743, + 3745, + 3747, + 3749, + 3749, + 3751, + 3751, + 3754, + 3755, + 3757, + 3760, + 3762, + 3763, + 3773, + 3773, + 3776, + 3780, + 3782, + 3782, + 3804, + 3807, + 3840, + 3840, + 3904, + 3911, + 3913, + 3948, + 3976, + 3980, + 4096, + 4138, + 4159, + 4159, + 4176, + 4181, + 4186, + 4189, + 4193, + 4193, + 4197, + 4198, + 4206, + 4208, + 4213, + 4225, + 4238, + 4238, + 4256, + 4293, + 4295, + 4295, + 4301, + 4301, + 4304, + 4346, + 4348, + 4680, + 4682, + 4685, + 4688, + 4694, + 4696, + 4696, + 4698, + 4701, + 4704, + 4744, + 4746, + 4749, + 4752, + 4784, + 4786, + 4789, + 4792, + 4798, + 4800, + 4800, + 4802, + 4805, + 4808, + 4822, + 4824, + 4880, + 4882, + 4885, + 4888, + 4954, + 4992, + 5007, + 5024, + 5108, + 5121, + 5740, + 5743, + 5759, + 5761, + 5786, + 5792, + 5866, + 5870, + 5872, + 5888, + 5900, + 5902, + 5905, + 5920, + 5937, + 5952, + 5969, + 5984, + 5996, + 5998, + 6000, + 6016, + 6067, + 6103, + 6103, + 6108, + 6108, + 6176, + 6263, + 6272, + 6312, + 6314, + 6314, + 6320, + 6389, + 6400, + 6428, + 6480, + 6509, + 6512, + 6516, + 6528, + 6571, + 6593, + 6599, + 6656, + 6678, + 6688, + 6740, + 6823, + 6823, + 6917, + 6963, + 6981, + 6987, + 7043, + 7072, + 7086, + 7087, + 7098, + 7141, + 7168, + 7203, + 7245, + 7247, + 7258, + 7293, + 7401, + 7404, + 7406, + 7409, + 7413, + 7414, + 7424, + 7615, + 7680, + 7957, + 7960, + 7965, + 7968, + 8005, + 8008, + 8013, + 8016, + 8023, + 8025, + 8025, + 8027, + 8027, + 8029, + 8029, + 8031, + 8061, + 8064, + 8116, + 8118, + 8124, + 8126, + 8126, + 8130, + 8132, + 8134, + 8140, + 8144, + 8147, + 8150, + 8155, + 8160, + 8172, + 8178, + 8180, + 8182, + 8188, + 8305, + 8305, + 8319, + 8319, + 8336, + 8348, + 8450, + 8450, + 8455, + 8455, + 8458, + 8467, + 8469, + 8469, + 8473, + 8477, + 8484, + 8484, + 8486, + 8486, + 8488, + 8488, + 8490, + 8493, + 8495, + 8505, + 8508, + 8511, + 8517, + 8521, + 8526, + 8526, + 8544, + 8584, + 11264, + 11310, + 11312, + 11358, + 11360, + 11492, + 11499, + 11502, + 11506, + 11507, + 11520, + 11557, + 11559, + 11559, + 11565, + 11565, + 11568, + 11623, + 11631, + 11631, + 11648, + 11670, + 11680, + 11686, + 11688, + 11694, + 11696, + 11702, + 11704, + 11710, + 11712, + 11718, + 11720, + 11726, + 11728, + 11734, + 11736, + 11742, + 11823, + 11823, + 12293, + 12295, + 12321, + 12329, + 12337, + 12341, + 12344, + 12348, + 12353, + 12438, + 12445, + 12447, + 12449, + 12538, + 12540, + 12543, + 12549, + 12589, + 12593, + 12686, + 12704, + 12730, + 12784, + 12799, + 13312, + 19893, + 19968, + 40908, + 40960, + 42124, + 42192, + 42237, + 42240, + 42508, + 42512, + 42527, + 42538, + 42539, + 42560, + 42606, + 42623, + 42647, + 42656, + 42735, + 42775, + 42783, + 42786, + 42888, + 42891, + 42894, + 42896, + 42899, + 42912, + 42922, + 43000, + 43009, + 43011, + 43013, + 43015, + 43018, + 43020, + 43042, + 43072, + 43123, + 43138, + 43187, + 43250, + 43255, + 43259, + 43259, + 43274, + 43301, + 43312, + 43334, + 43360, + 43388, + 43396, + 43442, + 43471, + 43471, + 43520, + 43560, + 43584, + 43586, + 43588, + 43595, + 43616, + 43638, + 43642, + 43642, + 43648, + 43695, + 43697, + 43697, + 43701, + 43702, + 43705, + 43709, + 43712, + 43712, + 43714, + 43714, + 43739, + 43741, + 43744, + 43754, + 43762, + 43764, + 43777, + 43782, + 43785, + 43790, + 43793, + 43798, + 43808, + 43814, + 43816, + 43822, + 43968, + 44002, + 44032, + 55203, + 55216, + 55238, + 55243, + 55291, + 63744, + 64109, + 64112, + 64217, + 64256, + 64262, + 64275, + 64279, + 64285, + 64285, + 64287, + 64296, + 64298, + 64310, + 64312, + 64316, + 64318, + 64318, + 64320, + 64321, + 64323, + 64324, + 64326, + 64433, + 64467, + 64829, + 64848, + 64911, + 64914, + 64967, + 65008, + 65019, + 65136, + 65140, + 65142, + 65276, + 65313, + 65338, + 65345, + 65370, + 65382, + 65470, + 65474, + 65479, + 65482, + 65487, + 65490, + 65495, + 65498, + 65500, + ]; + var unicodeES5IdentifierPart = [ + 170, + 170, + 181, + 181, + 186, + 186, + 192, + 214, + 216, + 246, + 248, + 705, + 710, + 721, + 736, + 740, + 748, + 748, + 750, + 750, + 768, + 884, + 886, + 887, + 890, + 893, + 902, + 902, + 904, + 906, + 908, + 908, + 910, + 929, + 931, + 1013, + 1015, + 1153, + 1155, + 1159, + 1162, + 1319, + 1329, + 1366, + 1369, + 1369, + 1377, + 1415, + 1425, + 1469, + 1471, + 1471, + 1473, + 1474, + 1476, + 1477, + 1479, + 1479, + 1488, + 1514, + 1520, + 1522, + 1552, + 1562, + 1568, + 1641, + 1646, + 1747, + 1749, + 1756, + 1759, + 1768, + 1770, + 1788, + 1791, + 1791, + 1808, + 1866, + 1869, + 1969, + 1984, + 2037, + 2042, + 2042, + 2048, + 2093, + 2112, + 2139, + 2208, + 2208, + 2210, + 2220, + 2276, + 2302, + 2304, + 2403, + 2406, + 2415, + 2417, + 2423, + 2425, + 2431, + 2433, + 2435, + 2437, + 2444, + 2447, + 2448, + 2451, + 2472, + 2474, + 2480, + 2482, + 2482, + 2486, + 2489, + 2492, + 2500, + 2503, + 2504, + 2507, + 2510, + 2519, + 2519, + 2524, + 2525, + 2527, + 2531, + 2534, + 2545, + 2561, + 2563, + 2565, + 2570, + 2575, + 2576, + 2579, + 2600, + 2602, + 2608, + 2610, + 2611, + 2613, + 2614, + 2616, + 2617, + 2620, + 2620, + 2622, + 2626, + 2631, + 2632, + 2635, + 2637, + 2641, + 2641, + 2649, + 2652, + 2654, + 2654, + 2662, + 2677, + 2689, + 2691, + 2693, + 2701, + 2703, + 2705, + 2707, + 2728, + 2730, + 2736, + 2738, + 2739, + 2741, + 2745, + 2748, + 2757, + 2759, + 2761, + 2763, + 2765, + 2768, + 2768, + 2784, + 2787, + 2790, + 2799, + 2817, + 2819, + 2821, + 2828, + 2831, + 2832, + 2835, + 2856, + 2858, + 2864, + 2866, + 2867, + 2869, + 2873, + 2876, + 2884, + 2887, + 2888, + 2891, + 2893, + 2902, + 2903, + 2908, + 2909, + 2911, + 2915, + 2918, + 2927, + 2929, + 2929, + 2946, + 2947, + 2949, + 2954, + 2958, + 2960, + 2962, + 2965, + 2969, + 2970, + 2972, + 2972, + 2974, + 2975, + 2979, + 2980, + 2984, + 2986, + 2990, + 3001, + 3006, + 3010, + 3014, + 3016, + 3018, + 3021, + 3024, + 3024, + 3031, + 3031, + 3046, + 3055, + 3073, + 3075, + 3077, + 3084, + 3086, + 3088, + 3090, + 3112, + 3114, + 3123, + 3125, + 3129, + 3133, + 3140, + 3142, + 3144, + 3146, + 3149, + 3157, + 3158, + 3160, + 3161, + 3168, + 3171, + 3174, + 3183, + 3202, + 3203, + 3205, + 3212, + 3214, + 3216, + 3218, + 3240, + 3242, + 3251, + 3253, + 3257, + 3260, + 3268, + 3270, + 3272, + 3274, + 3277, + 3285, + 3286, + 3294, + 3294, + 3296, + 3299, + 3302, + 3311, + 3313, + 3314, + 3330, + 3331, + 3333, + 3340, + 3342, + 3344, + 3346, + 3386, + 3389, + 3396, + 3398, + 3400, + 3402, + 3406, + 3415, + 3415, + 3424, + 3427, + 3430, + 3439, + 3450, + 3455, + 3458, + 3459, + 3461, + 3478, + 3482, + 3505, + 3507, + 3515, + 3517, + 3517, + 3520, + 3526, + 3530, + 3530, + 3535, + 3540, + 3542, + 3542, + 3544, + 3551, + 3570, + 3571, + 3585, + 3642, + 3648, + 3662, + 3664, + 3673, + 3713, + 3714, + 3716, + 3716, + 3719, + 3720, + 3722, + 3722, + 3725, + 3725, + 3732, + 3735, + 3737, + 3743, + 3745, + 3747, + 3749, + 3749, + 3751, + 3751, + 3754, + 3755, + 3757, + 3769, + 3771, + 3773, + 3776, + 3780, + 3782, + 3782, + 3784, + 3789, + 3792, + 3801, + 3804, + 3807, + 3840, + 3840, + 3864, + 3865, + 3872, + 3881, + 3893, + 3893, + 3895, + 3895, + 3897, + 3897, + 3902, + 3911, + 3913, + 3948, + 3953, + 3972, + 3974, + 3991, + 3993, + 4028, + 4038, + 4038, + 4096, + 4169, + 4176, + 4253, + 4256, + 4293, + 4295, + 4295, + 4301, + 4301, + 4304, + 4346, + 4348, + 4680, + 4682, + 4685, + 4688, + 4694, + 4696, + 4696, + 4698, + 4701, + 4704, + 4744, + 4746, + 4749, + 4752, + 4784, + 4786, + 4789, + 4792, + 4798, + 4800, + 4800, + 4802, + 4805, + 4808, + 4822, + 4824, + 4880, + 4882, + 4885, + 4888, + 4954, + 4957, + 4959, + 4992, + 5007, + 5024, + 5108, + 5121, + 5740, + 5743, + 5759, + 5761, + 5786, + 5792, + 5866, + 5870, + 5872, + 5888, + 5900, + 5902, + 5908, + 5920, + 5940, + 5952, + 5971, + 5984, + 5996, + 5998, + 6000, + 6002, + 6003, + 6016, + 6099, + 6103, + 6103, + 6108, + 6109, + 6112, + 6121, + 6155, + 6157, + 6160, + 6169, + 6176, + 6263, + 6272, + 6314, + 6320, + 6389, + 6400, + 6428, + 6432, + 6443, + 6448, + 6459, + 6470, + 6509, + 6512, + 6516, + 6528, + 6571, + 6576, + 6601, + 6608, + 6617, + 6656, + 6683, + 6688, + 6750, + 6752, + 6780, + 6783, + 6793, + 6800, + 6809, + 6823, + 6823, + 6912, + 6987, + 6992, + 7001, + 7019, + 7027, + 7040, + 7155, + 7168, + 7223, + 7232, + 7241, + 7245, + 7293, + 7376, + 7378, + 7380, + 7414, + 7424, + 7654, + 7676, + 7957, + 7960, + 7965, + 7968, + 8005, + 8008, + 8013, + 8016, + 8023, + 8025, + 8025, + 8027, + 8027, + 8029, + 8029, + 8031, + 8061, + 8064, + 8116, + 8118, + 8124, + 8126, + 8126, + 8130, + 8132, + 8134, + 8140, + 8144, + 8147, + 8150, + 8155, + 8160, + 8172, + 8178, + 8180, + 8182, + 8188, + 8204, + 8205, + 8255, + 8256, + 8276, + 8276, + 8305, + 8305, + 8319, + 8319, + 8336, + 8348, + 8400, + 8412, + 8417, + 8417, + 8421, + 8432, + 8450, + 8450, + 8455, + 8455, + 8458, + 8467, + 8469, + 8469, + 8473, + 8477, + 8484, + 8484, + 8486, + 8486, + 8488, + 8488, + 8490, + 8493, + 8495, + 8505, + 8508, + 8511, + 8517, + 8521, + 8526, + 8526, + 8544, + 8584, + 11264, + 11310, + 11312, + 11358, + 11360, + 11492, + 11499, + 11507, + 11520, + 11557, + 11559, + 11559, + 11565, + 11565, + 11568, + 11623, + 11631, + 11631, + 11647, + 11670, + 11680, + 11686, + 11688, + 11694, + 11696, + 11702, + 11704, + 11710, + 11712, + 11718, + 11720, + 11726, + 11728, + 11734, + 11736, + 11742, + 11744, + 11775, + 11823, + 11823, + 12293, + 12295, + 12321, + 12335, + 12337, + 12341, + 12344, + 12348, + 12353, + 12438, + 12441, + 12442, + 12445, + 12447, + 12449, + 12538, + 12540, + 12543, + 12549, + 12589, + 12593, + 12686, + 12704, + 12730, + 12784, + 12799, + 13312, + 19893, + 19968, + 40908, + 40960, + 42124, + 42192, + 42237, + 42240, + 42508, + 42512, + 42539, + 42560, + 42607, + 42612, + 42621, + 42623, + 42647, + 42655, + 42737, + 42775, + 42783, + 42786, + 42888, + 42891, + 42894, + 42896, + 42899, + 42912, + 42922, + 43000, + 43047, + 43072, + 43123, + 43136, + 43204, + 43216, + 43225, + 43232, + 43255, + 43259, + 43259, + 43264, + 43309, + 43312, + 43347, + 43360, + 43388, + 43392, + 43456, + 43471, + 43481, + 43520, + 43574, + 43584, + 43597, + 43600, + 43609, + 43616, + 43638, + 43642, + 43643, + 43648, + 43714, + 43739, + 43741, + 43744, + 43759, + 43762, + 43766, + 43777, + 43782, + 43785, + 43790, + 43793, + 43798, + 43808, + 43814, + 43816, + 43822, + 43968, + 44010, + 44012, + 44013, + 44016, + 44025, + 44032, + 55203, + 55216, + 55238, + 55243, + 55291, + 63744, + 64109, + 64112, + 64217, + 64256, + 64262, + 64275, + 64279, + 64285, + 64296, + 64298, + 64310, + 64312, + 64316, + 64318, + 64318, + 64320, + 64321, + 64323, + 64324, + 64326, + 64433, + 64467, + 64829, + 64848, + 64911, + 64914, + 64967, + 65008, + 65019, + 65024, + 65039, + 65056, + 65062, + 65075, + 65076, + 65101, + 65103, + 65136, + 65140, + 65142, + 65276, + 65296, + 65305, + 65313, + 65338, + 65343, + 65343, + 65345, + 65370, + 65382, + 65470, + 65474, + 65479, + 65482, + 65487, + 65490, + 65495, + 65498, + 65500, + ]; function lookupInUnicodeMap(code, map) { if (code < map[0]) { return false; @@ -1506,21 +6407,17 @@ var ts; return false; } function isUnicodeIdentifierStart(code, languageVersion) { - return languageVersion >= 1 ? - lookupInUnicodeMap(code, unicodeES5IdentifierStart) : - lookupInUnicodeMap(code, unicodeES3IdentifierStart); + return languageVersion >= 1 ? lookupInUnicodeMap(code, unicodeES5IdentifierStart) : lookupInUnicodeMap(code, unicodeES3IdentifierStart); } ts.isUnicodeIdentifierStart = isUnicodeIdentifierStart; function isUnicodeIdentifierPart(code, languageVersion) { - return languageVersion >= 1 ? - lookupInUnicodeMap(code, unicodeES5IdentifierPart) : - lookupInUnicodeMap(code, unicodeES3IdentifierPart); + return languageVersion >= 1 ? lookupInUnicodeMap(code, unicodeES5IdentifierPart) : lookupInUnicodeMap(code, unicodeES3IdentifierPart); } function makeReverseMap(source) { var result = []; - for (var _name in source) { - if (source.hasOwnProperty(_name)) { - result[source[_name]] = _name; + for (var name_2 in source) { + if (source.hasOwnProperty(name_2)) { + result[source[name_2]] = name_2; } } return result; @@ -1530,6 +6427,10 @@ var ts; return tokenStrings[t]; } ts.tokenToString = tokenToString; + function stringToToken(s) { + return textToToken[s]; + } + ts.stringToToken = stringToToken; function computeLineStarts(text) { var result = new Array(); var pos = 0; @@ -1587,13 +6488,21 @@ var ts; ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition; var hasOwnProperty = Object.prototype.hasOwnProperty; function isWhiteSpace(ch) { - return ch === 32 || ch === 9 || ch === 11 || ch === 12 || - ch === 160 || ch === 5760 || ch >= 8192 && ch <= 8203 || - ch === 8239 || ch === 8287 || ch === 12288 || ch === 65279; + return ch === 32 || ch === 9 || ch === 11 || ch === 12 || ch === 160 || ch === 133 || ch === 5760 || ch >= 8192 && ch <= 8203 || ch === 8239 || ch === 8287 || ch === 12288 || ch === 65279; } ts.isWhiteSpace = isWhiteSpace; function isLineBreak(ch) { - return ch === 10 || ch === 13 || ch === 8232 || ch === 8233 || ch === 133; + // ES5 7.3: + // The ECMAScript line terminator characters are listed in Table 3. + // Table 3 � Line Terminator Characters + // Code Unit Value Name Formal Name + // \u000A Line Feed + // \u000D Carriage Return + // \u2028 Line separator + // \u2029 Paragraph separator + // Only the characters in Table 3 are treated as line terminators. Other new line or line + // breaking characters are treated as white space but not as line terminators. + return ch === 10 || ch === 13 || ch === 8232 || ch === 8233; } ts.isLineBreak = isLineBreak; function isDigit(ch) { @@ -1676,8 +6585,7 @@ var ts; return false; } } - return ch === 61 || - text.charCodeAt(pos + mergeConflictMarkerLength) === 32; + return ch === 61 || text.charCodeAt(pos + mergeConflictMarkerLength) === 32; } } return false; @@ -1696,8 +6604,8 @@ var ts; else { ts.Debug.assert(ch === 61); while (pos < len) { - var _ch = text.charCodeAt(pos); - if (_ch === 62 && isConflictMarkerTrivia(text, pos)) { + var ch_1 = text.charCodeAt(pos); + if (ch_1 === 62 && isConflictMarkerTrivia(text, pos)) { break; } pos++; @@ -1712,8 +6620,9 @@ var ts; var ch = text.charCodeAt(pos); switch (ch) { case 13: - if (text.charCodeAt(pos + 1) === 10) + if (text.charCodeAt(pos + 1) === 10) { pos++; + } case 10: pos++; if (trailing) { @@ -1755,9 +6664,14 @@ var ts; } } if (collecting) { - if (!result) + if (!result) { result = []; - result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine }); + } + result.push({ + pos: startPos, + end: pos, + hasTrailingNewLine: hasTrailingNewLine + }); } continue; } @@ -1784,15 +6698,11 @@ var ts; } ts.getTrailingCommentRanges = getTrailingCommentRanges; function isIdentifierStart(ch, languageVersion) { - return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || - ch === 36 || ch === 95 || - ch > 127 && isUnicodeIdentifierStart(ch, languageVersion); + return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch === 36 || ch === 95 || ch > 127 && isUnicodeIdentifierStart(ch, languageVersion); } ts.isIdentifierStart = isIdentifierStart; function isIdentifierPart(ch, languageVersion) { - return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || - ch >= 48 && ch <= 57 || ch === 36 || ch === 95 || - ch > 127 && isUnicodeIdentifierPart(ch, languageVersion); + return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch >= 48 && ch <= 57 || ch === 36 || ch === 95 || ch > 127 && isUnicodeIdentifierPart(ch, languageVersion); } ts.isIdentifierPart = isIdentifierPart; function createScanner(languageVersion, skipTrivia, text, onError) { @@ -1811,14 +6721,10 @@ var ts; } } function isIdentifierStart(ch) { - return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || - ch === 36 || ch === 95 || - ch > 127 && isUnicodeIdentifierStart(ch, languageVersion); + return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch === 36 || ch === 95 || ch > 127 && isUnicodeIdentifierStart(ch, languageVersion); } function isIdentifierPart(ch) { - return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || - ch >= 48 && ch <= 57 || ch === 36 || ch === 95 || - ch > 127 && isUnicodeIdentifierPart(ch, languageVersion); + return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch >= 48 && ch <= 57 || ch === 36 || ch === 95 || ch > 127 && isUnicodeIdentifierPart(ch, languageVersion); } function scanNumber() { var start = pos; @@ -2095,14 +7001,14 @@ var ts; return result; } function getIdentifierToken() { - var _len = tokenValue.length; - if (_len >= 2 && _len <= 11) { + var len = tokenValue.length; + if (len >= 2 && len <= 11) { var ch = tokenValue.charCodeAt(0); if (ch >= 97 && ch <= 122 && hasOwnProperty.call(textToToken, tokenValue)) { return token = textToToken[tokenValue]; } } - return token = 64; + return token = 65; } function scanBinaryOrOctalDigits(base) { ts.Debug.assert(base !== 2 || base !== 8, "Expected either base 2 or base 8"); @@ -2181,7 +7087,7 @@ var ts; return token = scanTemplateAndSetTokenValue(); case 37: if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 57; + return pos += 2, token = 58; } return pos++, token = 37; case 38: @@ -2189,7 +7095,7 @@ var ts; return pos += 2, token = 48; } if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 61; + return pos += 2, token = 62; } return pos++, token = 43; case 40: @@ -2198,7 +7104,7 @@ var ts; return pos++, token = 17; case 42: if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 55; + return pos += 2, token = 56; } return pos++, token = 35; case 43: @@ -2206,7 +7112,7 @@ var ts; return pos += 2, token = 38; } if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 53; + return pos += 2, token = 54; } return pos++, token = 33; case 44: @@ -2216,7 +7122,7 @@ var ts; return pos += 2, token = 39; } if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 54; + return pos += 2, token = 55; } return pos++, token = 34; case 46: @@ -2248,13 +7154,13 @@ var ts; pos += 2; var commentClosed = false; while (pos < len) { - var _ch = text.charCodeAt(pos); - if (_ch === 42 && text.charCodeAt(pos + 1) === 47) { + var ch_2 = text.charCodeAt(pos); + if (ch_2 === 42 && text.charCodeAt(pos + 1) === 47) { pos += 2; commentClosed = true; break; } - if (isLineBreak(_ch)) { + if (isLineBreak(ch_2)) { precedingLineBreak = true; } pos++; @@ -2271,7 +7177,7 @@ var ts; } } if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 56; + return pos += 2, token = 57; } return pos++, token = 36; case 48: @@ -2287,22 +7193,22 @@ var ts; } else if (pos + 2 < len && (text.charCodeAt(pos + 1) === 66 || text.charCodeAt(pos + 1) === 98)) { pos += 2; - var _value = scanBinaryOrOctalDigits(2); - if (_value < 0) { + var value = scanBinaryOrOctalDigits(2); + if (value < 0) { error(ts.Diagnostics.Binary_digit_expected); - _value = 0; + value = 0; } - tokenValue = "" + _value; + tokenValue = "" + value; return token = 7; } else if (pos + 2 < len && (text.charCodeAt(pos + 1) === 79 || text.charCodeAt(pos + 1) === 111)) { pos += 2; - var _value_1 = scanBinaryOrOctalDigits(8); - if (_value_1 < 0) { + var value = scanBinaryOrOctalDigits(8); + if (value < 0) { error(ts.Diagnostics.Octal_digit_expected); - _value_1 = 0; + value = 0; } - tokenValue = "" + _value_1; + tokenValue = "" + value; return token = 7; } if (pos + 1 < len && isOctalDigit(text.charCodeAt(pos + 1))) { @@ -2336,7 +7242,7 @@ var ts; } if (text.charCodeAt(pos + 1) === 60) { if (text.charCodeAt(pos + 2) === 61) { - return pos += 3, token = 58; + return pos += 3, token = 59; } return pos += 2, token = 40; } @@ -2363,7 +7269,7 @@ var ts; if (text.charCodeAt(pos + 1) === 62) { return pos += 2, token = 32; } - return pos++, token = 52; + return pos++, token = 53; case 62: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); @@ -2383,7 +7289,7 @@ var ts; return pos++, token = 19; case 94: if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 63; + return pos += 2, token = 64; } return pos++, token = 45; case 123: @@ -2393,13 +7299,15 @@ var ts; return pos += 2, token = 49; } if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 62; + return pos += 2, token = 63; } return pos++, token = 44; case 125: return pos++, token = 15; case 126: return pos++, token = 47; + case 64: + return pos++, token = 52; case 92: var cookedChar = peekUnicodeEscape(); if (cookedChar >= 0 && isIdentifierStart(cookedChar)) { @@ -2439,12 +7347,12 @@ var ts; if (text.charCodeAt(pos) === 62) { if (text.charCodeAt(pos + 1) === 62) { if (text.charCodeAt(pos + 2) === 61) { - return pos += 3, token = 60; + return pos += 3, token = 61; } return pos += 2, token = 42; } if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 59; + return pos += 2, token = 60; } return pos++, token = 41; } @@ -2455,7 +7363,7 @@ var ts; return token; } function reScanSlashToken() { - if (token === 36 || token === 56) { + if (token === 36 || token === 57) { var p = tokenPos + 1; var inEscape = false; var inCharacterClass = false; @@ -2541,17 +7449,39 @@ var ts; } setText(text); return { - getStartPos: function () { return startPos; }, - getTextPos: function () { return pos; }, - getToken: function () { return token; }, - getTokenPos: function () { return tokenPos; }, - getTokenText: function () { return text.substring(tokenPos, pos); }, - getTokenValue: function () { return tokenValue; }, - hasExtendedUnicodeEscape: function () { return hasExtendedUnicodeEscape; }, - hasPrecedingLineBreak: function () { return precedingLineBreak; }, - isIdentifier: function () { return token === 64 || token > 100; }, - isReservedWord: function () { return token >= 65 && token <= 100; }, - isUnterminated: function () { return tokenIsUnterminated; }, + getStartPos: function () { + return startPos; + }, + getTextPos: function () { + return pos; + }, + getToken: function () { + return token; + }, + getTokenPos: function () { + return tokenPos; + }, + getTokenText: function () { + return text.substring(tokenPos, pos); + }, + getTokenValue: function () { + return tokenValue; + }, + hasExtendedUnicodeEscape: function () { + return hasExtendedUnicodeEscape; + }, + hasPrecedingLineBreak: function () { + return precedingLineBreak; + }, + isIdentifier: function () { + return token === 65 || token > 101; + }, + isReservedWord: function () { + return token >= 66 && token <= 101; + }, + isUnterminated: function () { + return tokenIsUnterminated; + }, reScanGreaterToken: reScanGreaterToken, reScanSlashToken: reScanSlashToken, reScanTemplateToken: reScanTemplateToken, @@ -2564,11 +7494,512 @@ var ts; } ts.createScanner = createScanner; })(ts || (ts = {})); +/// +var ts; +(function (ts) { + ts.bindTime = 0; + function getModuleInstanceState(node) { + if (node.kind === 202 || node.kind === 203) { + return 0; + } + else if (ts.isConstEnumDeclaration(node)) { + return 2; + } + else if ((node.kind === 209 || node.kind === 208) && !(node.flags & 1)) { + return 0; + } + else if (node.kind === 206) { + var state = 0; + ts.forEachChild(node, function (n) { + switch (getModuleInstanceState(n)) { + case 0: + return false; + case 2: + state = 2; + return false; + case 1: + state = 1; + return true; + } + }); + return state; + } + else if (node.kind === 205) { + return getModuleInstanceState(node.body); + } + else { + return 1; + } + } + ts.getModuleInstanceState = getModuleInstanceState; + function bindSourceFile(file) { + var start = new Date().getTime(); + bindSourceFileWorker(file); + ts.bindTime += new Date().getTime() - start; + } + ts.bindSourceFile = bindSourceFile; + function bindSourceFileWorker(file) { + var parent; + var container; + var blockScopeContainer; + var lastContainer; + var symbolCount = 0; + var Symbol = ts.objectAllocator.getSymbolConstructor(); + if (!file.locals) { + file.locals = {}; + container = file; + setBlockScopeContainer(file, false); + bind(file); + file.symbolCount = symbolCount; + } + function createSymbol(flags, name) { + symbolCount++; + return new Symbol(flags, name); + } + function setBlockScopeContainer(node, cleanLocals) { + blockScopeContainer = node; + if (cleanLocals) { + blockScopeContainer.locals = undefined; + } + } + function addDeclarationToSymbol(symbol, node, symbolKind) { + symbol.flags |= symbolKind; + if (!symbol.declarations) + symbol.declarations = []; + symbol.declarations.push(node); + if (symbolKind & 1952 && !symbol.exports) + symbol.exports = {}; + if (symbolKind & 6240 && !symbol.members) + symbol.members = {}; + node.symbol = symbol; + if (symbolKind & 107455 && !symbol.valueDeclaration) + symbol.valueDeclaration = node; + } + function getDeclarationName(node) { + if (node.name) { + if (node.kind === 205 && node.name.kind === 8) { + return '"' + node.name.text + '"'; + } + if (node.name.kind === 127) { + var nameExpression = node.name.expression; + ts.Debug.assert(ts.isWellKnownSymbolSyntactically(nameExpression)); + return ts.getPropertyNameForKnownSymbolName(nameExpression.name.text); + } + return node.name.text; + } + switch (node.kind) { + case 143: + case 135: + return "__constructor"; + case 142: + case 138: + return "__call"; + case 139: + return "__new"; + case 140: + return "__index"; + case 215: + return "__export"; + case 214: + return node.isExportEquals ? "export=" : "default"; + case 200: + case 201: + return node.flags & 256 ? "default" : undefined; + } + } + function getDisplayName(node) { + return node.name ? ts.declarationNameToString(node.name) : getDeclarationName(node); + } + function declareSymbol(symbols, parent, node, includes, excludes) { + ts.Debug.assert(!ts.hasDynamicName(node)); + var name = node.flags & 256 && parent ? "default" : getDeclarationName(node); + var symbol; + if (name !== undefined) { + symbol = ts.hasProperty(symbols, name) ? symbols[name] : (symbols[name] = createSymbol(0, name)); + if (symbol.flags & excludes) { + if (node.name) { + node.name.parent = node; + } + var message = symbol.flags & 2 ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; + ts.forEach(symbol.declarations, function (declaration) { + file.bindDiagnostics.push(ts.createDiagnosticForNode(declaration.name || declaration, message, getDisplayName(declaration))); + }); + file.bindDiagnostics.push(ts.createDiagnosticForNode(node.name || node, message, getDisplayName(node))); + symbol = createSymbol(0, name); + } + } + else { + symbol = createSymbol(0, "__missing"); + } + addDeclarationToSymbol(symbol, node, includes); + symbol.parent = parent; + if ((node.kind === 201 || node.kind === 174) && symbol.exports) { + var prototypeSymbol = createSymbol(4 | 134217728, "prototype"); + if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { + if (node.name) { + node.name.parent = node; + } + file.bindDiagnostics.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); + } + symbol.exports[prototypeSymbol.name] = prototypeSymbol; + prototypeSymbol.parent = symbol; + } + return symbol; + } + function declareModuleMember(node, symbolKind, symbolExcludes) { + var hasExportModifier = ts.getCombinedNodeFlags(node) & 1; + if (symbolKind & 8388608) { + if (node.kind === 217 || (node.kind === 208 && hasExportModifier)) { + declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); + } + else { + declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); + } + } + else { + if (hasExportModifier || container.flags & 32768) { + var exportKind = (symbolKind & 107455 ? 1048576 : 0) | (symbolKind & 793056 ? 2097152 : 0) | (symbolKind & 1536 ? 4194304 : 0); + var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); + local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); + node.localSymbol = local; + } + else { + declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); + } + } + } + function bindChildren(node, symbolKind, isBlockScopeContainer) { + if (symbolKind & 255504) { + node.locals = {}; + } + var saveParent = parent; + var saveContainer = container; + var savedBlockScopeContainer = blockScopeContainer; + parent = node; + if (symbolKind & 262128) { + container = node; + if (lastContainer) { + lastContainer.nextContainer = container; + } + lastContainer = container; + } + if (isBlockScopeContainer) { + setBlockScopeContainer(node, (symbolKind & 255504) === 0 && node.kind !== 227); + } + ts.forEachChild(node, bind); + container = saveContainer; + parent = saveParent; + blockScopeContainer = savedBlockScopeContainer; + } + function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) { + switch (container.kind) { + case 205: + declareModuleMember(node, symbolKind, symbolExcludes); + break; + case 227: + if (ts.isExternalModule(container)) { + declareModuleMember(node, symbolKind, symbolExcludes); + break; + } + case 142: + case 143: + case 138: + case 139: + case 140: + case 134: + case 133: + case 135: + case 136: + case 137: + case 200: + case 162: + case 163: + declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); + break; + case 174: + case 201: + if (node.flags & 128) { + declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); + break; + } + case 145: + case 154: + case 202: + declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes); + break; + case 204: + declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); + break; + } + bindChildren(node, symbolKind, isBlockScopeContainer); + } + function isAmbientContext(node) { + while (node) { + if (node.flags & 2) + return true; + node = node.parent; + } + return false; + } + function hasExportDeclarations(node) { + var body = node.kind === 227 ? node : node.body; + if (body.kind === 227 || body.kind === 206) { + for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { + var stat = _a[_i]; + if (stat.kind === 215 || stat.kind === 214) { + return true; + } + } + } + return false; + } + function setExportContextFlag(node) { + if (isAmbientContext(node) && !hasExportDeclarations(node)) { + node.flags |= 32768; + } + else { + node.flags &= ~32768; + } + } + function bindModuleDeclaration(node) { + setExportContextFlag(node); + if (node.name.kind === 8) { + bindDeclaration(node, 512, 106639, true); + } + else { + var state = getModuleInstanceState(node); + if (state === 0) { + bindDeclaration(node, 1024, 0, true); + } + else { + bindDeclaration(node, 512, 106639, true); + var currentModuleIsConstEnumOnly = state === 2; + if (node.symbol.constEnumOnlyModule === undefined) { + node.symbol.constEnumOnlyModule = currentModuleIsConstEnumOnly; + } + else { + node.symbol.constEnumOnlyModule = node.symbol.constEnumOnlyModule && currentModuleIsConstEnumOnly; + } + } + } + } + function bindFunctionOrConstructorType(node) { + // For a given function symbol "<...>(...) => T" we want to generate a symbol identical + // to the one we would get for: { <...>(...): T } + // + // We do that by making an anonymous type literal symbol, and then setting the function + // symbol as its sole member. To the rest of the system, this symbol will be indistinguishable + // from an actual type literal symbol you would have gotten had you used the long form. + var symbol = createSymbol(131072, getDeclarationName(node)); + addDeclarationToSymbol(symbol, node, 131072); + bindChildren(node, 131072, false); + var typeLiteralSymbol = createSymbol(2048, "__type"); + addDeclarationToSymbol(typeLiteralSymbol, node, 2048); + typeLiteralSymbol.members = {}; + typeLiteralSymbol.members[node.kind === 142 ? "__call" : "__new"] = symbol; + } + function bindAnonymousDeclaration(node, symbolKind, name, isBlockScopeContainer) { + var symbol = createSymbol(symbolKind, name); + addDeclarationToSymbol(symbol, node, symbolKind); + bindChildren(node, symbolKind, isBlockScopeContainer); + } + function bindCatchVariableDeclaration(node) { + bindChildren(node, 0, true); + } + function bindBlockScopedVariableDeclaration(node) { + switch (blockScopeContainer.kind) { + case 205: + declareModuleMember(node, 2, 107455); + break; + case 227: + if (ts.isExternalModule(container)) { + declareModuleMember(node, 2, 107455); + break; + } + default: + if (!blockScopeContainer.locals) { + blockScopeContainer.locals = {}; + } + declareSymbol(blockScopeContainer.locals, undefined, node, 2, 107455); + } + bindChildren(node, 2, false); + } + function getDestructuringParameterName(node) { + return "__" + ts.indexOf(node.parent.parameters, node); + } + function bind(node) { + node.parent = parent; + switch (node.kind) { + case 128: + bindDeclaration(node, 262144, 530912, false); + break; + case 129: + bindParameter(node); + break; + case 198: + case 152: + if (ts.isBindingPattern(node.name)) { + bindChildren(node, 0, false); + } + else if (ts.isBlockOrCatchScoped(node)) { + bindBlockScopedVariableDeclaration(node); + } + else { + bindDeclaration(node, 1, 107454, false); + } + break; + case 132: + case 131: + bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 107455, false); + break; + case 224: + case 225: + bindPropertyOrMethodOrAccessor(node, 4, 107455, false); + break; + case 226: + bindPropertyOrMethodOrAccessor(node, 8, 107455, false); + break; + case 138: + case 139: + case 140: + bindDeclaration(node, 131072, 0, false); + break; + case 134: + case 133: + bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 107455 : 99263, true); + break; + case 200: + bindDeclaration(node, 16, 106927, true); + break; + case 135: + bindDeclaration(node, 16384, 0, true); + break; + case 136: + bindPropertyOrMethodOrAccessor(node, 32768, 41919, true); + break; + case 137: + bindPropertyOrMethodOrAccessor(node, 65536, 74687, true); + break; + case 142: + case 143: + bindFunctionOrConstructorType(node); + break; + case 145: + bindAnonymousDeclaration(node, 2048, "__type", false); + break; + case 154: + bindAnonymousDeclaration(node, 4096, "__object", false); + break; + case 162: + case 163: + bindAnonymousDeclaration(node, 16, "__function", true); + break; + case 174: + bindAnonymousDeclaration(node, 32, "__class", false); + break; + case 223: + bindCatchVariableDeclaration(node); + break; + case 201: + bindDeclaration(node, 32, 899583, false); + break; + case 202: + bindDeclaration(node, 64, 792992, false); + break; + case 203: + bindDeclaration(node, 524288, 793056, false); + break; + case 204: + if (ts.isConst(node)) { + bindDeclaration(node, 128, 899967, false); + } + else { + bindDeclaration(node, 256, 899327, false); + } + break; + case 205: + bindModuleDeclaration(node); + break; + case 208: + case 211: + case 213: + case 217: + bindDeclaration(node, 8388608, 8388608, false); + break; + case 210: + if (node.name) { + bindDeclaration(node, 8388608, 8388608, false); + } + else { + bindChildren(node, 0, false); + } + break; + case 215: + if (!node.exportClause) { + declareSymbol(container.symbol.exports, container.symbol, node, 1073741824, 0); + } + bindChildren(node, 0, false); + break; + case 214: + if (node.expression && node.expression.kind === 65) { + declareSymbol(container.symbol.exports, container.symbol, node, 8388608, 107455 | 8388608); + } + else { + declareSymbol(container.symbol.exports, container.symbol, node, 4, 107455 | 8388608); + } + bindChildren(node, 0, false); + break; + case 227: + setExportContextFlag(node); + if (ts.isExternalModule(node)) { + bindAnonymousDeclaration(node, 512, '"' + ts.removeFileExtension(node.fileName) + '"', true); + break; + } + case 179: + bindChildren(node, 0, !ts.isFunctionLike(node.parent)); + break; + case 223: + case 186: + case 187: + case 188: + case 207: + bindChildren(node, 0, true); + break; + default: + var saveParent = parent; + parent = node; + ts.forEachChild(node, bind); + parent = saveParent; + } + } + function bindParameter(node) { + if (ts.isBindingPattern(node.name)) { + bindAnonymousDeclaration(node, 1, getDestructuringParameterName(node), false); + } + else { + bindDeclaration(node, 1, 107455, false); + } + if (node.flags & 112 && node.parent.kind === 135 && (node.parent.parent.kind === 201 || node.parent.parent.kind === 174)) { + var classDeclaration = node.parent.parent; + declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4, 107455); + } + } + function bindPropertyOrMethodOrAccessor(node, symbolKind, symbolExcludes, isBlockScopeContainer) { + if (ts.hasDynamicName(node)) { + bindAnonymousDeclaration(node, symbolKind, "__computed", isBlockScopeContainer); + } + else { + bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer); + } + } + } +})(ts || (ts = {})); +/// var ts; (function (ts) { function getDeclarationOfKind(symbol, kind) { var declarations = symbol.declarations; - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; if (declaration.kind === kind) { return declaration; @@ -2581,9 +8012,13 @@ var ts; function getSingleLineStringWriter() { if (stringWriters.length == 0) { var str = ""; - var writeText = function (text) { return str += text; }; + var writeText = function (text) { + return str += text; + }; return { - string: function () { return str; }, + string: function () { + return str; + }, writeKeyword: writeText, writeOperator: writeText, writePunctuation: writeText, @@ -2591,11 +8026,18 @@ var ts; writeStringLiteral: writeText, writeParameter: writeText, writeSymbol: writeText, - writeLine: function () { return str += " "; }, - increaseIndent: function () { }, - decreaseIndent: function () { }, - clear: function () { return str = ""; }, - trackSymbol: function () { } + writeLine: function () { + return str += " "; + }, + increaseIndent: function () { + }, + decreaseIndent: function () { + }, + clear: function () { + return str = ""; + }, + trackSymbol: function () { + } }; } return stringWriters.pop(); @@ -2612,21 +8054,20 @@ var ts; ts.getFullWidth = getFullWidth; function containsParseError(node) { aggregateChildData(node); - return (node.parserContextFlags & 32) !== 0; + return (node.parserContextFlags & 64) !== 0; } ts.containsParseError = containsParseError; function aggregateChildData(node) { - if (!(node.parserContextFlags & 64)) { - var thisNodeOrAnySubNodesHasError = ((node.parserContextFlags & 16) !== 0) || - ts.forEachChild(node, containsParseError); + if (!(node.parserContextFlags & 128)) { + var thisNodeOrAnySubNodesHasError = ((node.parserContextFlags & 32) !== 0) || ts.forEachChild(node, containsParseError); if (thisNodeOrAnySubNodesHasError) { - node.parserContextFlags |= 32; + node.parserContextFlags |= 64; } - node.parserContextFlags |= 64; + node.parserContextFlags |= 128; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 221) { + while (node && node.kind !== 227) { node = node.parent; } return node; @@ -2697,8 +8138,7 @@ var ts; } ts.makeIdentifierFromModuleName = makeIdentifierFromModuleName; function isBlockOrCatchScoped(declaration) { - return (getCombinedNodeFlags(declaration) & 12288) !== 0 || - isCatchClauseVariableDeclaration(declaration); + return (getCombinedNodeFlags(declaration) & 12288) !== 0 || isCatchClauseVariableDeclaration(declaration); } ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function getEnclosingBlockScopeContainer(node) { @@ -2708,15 +8148,15 @@ var ts; return current; } switch (current.kind) { - case 221: - case 202: - case 217: - case 200: - case 181: - case 182: - case 183: + case 227: + case 207: + case 223: + case 205: + case 186: + case 187: + case 188: return current; - case 174: + case 179: if (!isFunctionLike(current.parent)) { return current; } @@ -2726,10 +8166,7 @@ var ts; } ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; function isCatchClauseVariableDeclaration(declaration) { - return declaration && - declaration.kind === 193 && - declaration.parent && - declaration.parent.kind === 217; + return declaration && declaration.kind === 198 && declaration.parent && declaration.parent.kind === 223; } ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration; function declarationNameToString(name) { @@ -2766,24 +8203,29 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 193: - case 150: - case 196: - case 197: + case 227: + var pos_1 = ts.skipTrivia(sourceFile.text, 0, false); + if (pos_1 === sourceFile.text.length) { + return createTextSpan(0, 0); + } + return getSpanOfTokenAtPosition(sourceFile, pos_1); + case 198: + case 152: + case 201: + case 174: + case 202: + case 205: + case 204: + case 226: case 200: - case 199: - case 220: - case 195: - case 160: + case 162: errorNode = node.name; break; } if (errorNode === undefined) { return getSpanOfTokenAtPosition(sourceFile, node.pos); } - var pos = nodeIsMissing(errorNode) - ? errorNode.pos - : ts.skipTrivia(sourceFile.text, errorNode.pos); + var pos = nodeIsMissing(errorNode) ? errorNode.pos : ts.skipTrivia(sourceFile.text, errorNode.pos); return createTextSpanFromBounds(pos, errorNode.end); } ts.getErrorSpanForNode = getErrorSpanForNode; @@ -2796,11 +8238,11 @@ var ts; } ts.isDeclarationFile = isDeclarationFile; function isConstEnumDeclaration(node) { - return node.kind === 199 && isConst(node); + return node.kind === 204 && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 150 || isBindingPattern(node))) { + while (node && (node.kind === 152 || isBindingPattern(node))) { node = node.parent; } return node; @@ -2808,14 +8250,14 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 193) { + if (node.kind === 198) { node = node.parent; } - if (node && node.kind === 194) { + if (node && node.kind === 199) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 175) { + if (node && node.kind === 180) { flags |= node.flags; } return flags; @@ -2830,12 +8272,11 @@ var ts; } ts.isLet = isLet; function isPrologueDirective(node) { - return node.kind === 177 && node.expression.kind === 8; + return node.kind === 182 && node.expression.kind === 8; } ts.isPrologueDirective = isPrologueDirective; function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { - sourceFileOfNode = sourceFileOfNode || getSourceFileOfNode(node); - if (node.kind === 128 || node.kind === 127) { + if (node.kind === 129 || node.kind === 128) { return ts.concatenate(ts.getTrailingCommentRanges(sourceFileOfNode.text, node.pos), ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos)); } else { @@ -2846,9 +8287,7 @@ var ts; function getJsDocComments(node, sourceFileOfNode) { return ts.filter(getLeadingCommentRangesOfNode(node, sourceFileOfNode), isJsDocComment); function isJsDocComment(comment) { - return sourceFileOfNode.text.charCodeAt(comment.pos + 1) === 42 && - sourceFileOfNode.text.charCodeAt(comment.pos + 2) === 42 && - sourceFileOfNode.text.charCodeAt(comment.pos + 3) !== 47; + return sourceFileOfNode.text.charCodeAt(comment.pos + 1) === 42 && sourceFileOfNode.text.charCodeAt(comment.pos + 2) === 42 && sourceFileOfNode.text.charCodeAt(comment.pos + 3) !== 47; } } ts.getJsDocComments = getJsDocComments; @@ -2857,23 +8296,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 186: + case 191: return visitor(node); - case 202: - case 174: - case 178: + case 207: case 179: - case 180: - case 181: - case 182: case 183: + case 184: + case 185: + case 186: case 187: case 188: - case 214: - case 215: - case 189: - case 191: - case 217: + case 192: + case 193: + case 220: + case 221: + case 194: + case 196: + case 223: return ts.forEachChild(node, traverse); } } @@ -2882,14 +8321,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 150: - case 220: - case 128: - case 218: - case 130: + case 152: + case 226: case 129: - case 219: - case 193: + case 224: + case 132: + case 131: + case 225: + case 198: return true; } } @@ -2899,22 +8338,22 @@ var ts; function isFunctionLike(node) { if (node) { switch (node.kind) { - case 133: - case 160: - case 195: - case 161: - case 132: - case 131: - case 134: case 135: + case 162: + case 200: + case 163: + case 134: + case 133: case 136: case 137: case 138: + case 139: case 140: - case 141: - case 160: - case 161: - case 195: + case 142: + case 143: + case 162: + case 163: + case 200: return true; } } @@ -2922,11 +8361,11 @@ var ts; } ts.isFunctionLike = isFunctionLike; function isFunctionBlock(node) { - return node && node.kind === 174 && isFunctionLike(node.parent); + return node && node.kind === 179 && isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 132 && node.parent.kind === 152; + return node && node.kind === 134 && node.parent.kind === 154; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function getContainingFunction(node) { @@ -2945,28 +8384,28 @@ var ts; return undefined; } switch (node.kind) { - case 126: - if (node.parent.parent.kind === 196) { + case 127: + if (node.parent.parent.kind === 201) { return node; } node = node.parent; break; - case 161: + case 163: if (!includeArrowFunctions) { continue; } - case 195: - case 160: case 200: - case 130: - case 129: + case 162: + case 205: case 132: case 131: - case 133: case 134: + case 133: case 135: - case 199: - case 221: + case 136: + case 137: + case 204: + case 227: return node; } } @@ -2978,47 +8417,104 @@ var ts; if (!node) return node; switch (node.kind) { - case 126: - if (node.parent.parent.kind === 196) { + case 127: + if (node.parent.parent.kind === 201) { return node; } node = node.parent; break; - case 195: - case 160: - case 161: + case 200: + case 162: + case 163: if (!includeFunctions) { continue; } - case 130: - case 129: case 132: case 131: - case 133: case 134: + case 133: case 135: + case 136: + case 137: return node; } } } ts.getSuperContainer = getSuperContainer; function getInvokedExpression(node) { - if (node.kind === 157) { + if (node.kind === 159) { return node.tag; } return node.expression; } ts.getInvokedExpression = getInvokedExpression; + function nodeCanBeDecorated(node) { + switch (node.kind) { + case 201: + return true; + case 132: + return node.parent.kind === 201; + case 129: + return node.parent.body && node.parent.parent.kind === 201; + case 136: + case 137: + case 134: + return node.body && node.parent.kind === 201; + } + return false; + } + ts.nodeCanBeDecorated = nodeCanBeDecorated; + function nodeIsDecorated(node) { + switch (node.kind) { + case 201: + if (node.decorators) { + return true; + } + return false; + case 132: + case 129: + if (node.decorators) { + return true; + } + return false; + case 136: + if (node.body && node.decorators) { + return true; + } + return false; + case 134: + case 137: + if (node.body && node.decorators) { + return true; + } + return false; + } + return false; + } + ts.nodeIsDecorated = nodeIsDecorated; + function childIsDecorated(node) { + switch (node.kind) { + case 201: + return ts.forEach(node.members, nodeOrChildIsDecorated); + case 134: + case 137: + return ts.forEach(node.parameters, nodeIsDecorated); + } + return false; + } + ts.childIsDecorated = childIsDecorated; + function nodeOrChildIsDecorated(node) { + return nodeIsDecorated(node) || childIsDecorated(node); + } + ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function isExpression(node) { switch (node.kind) { - case 92: - case 90: - case 88: - case 94: - case 79: + case 93: + case 91: + case 89: + case 95: + case 80: case 9: - case 151: - case 152: case 153: case 154: case 155: @@ -3028,68 +8524,68 @@ var ts; case 159: case 160: case 161: - case 164: case 162: + case 174: case 163: - case 165: case 166: + case 164: + case 165: case 167: case 168: - case 171: case 169: + case 170: + case 173: + case 171: case 10: - case 172: + case 175: return true; - case 125: - while (node.parent.kind === 125) { + case 126: + while (node.parent.kind === 126) { node = node.parent; } - return node.parent.kind === 142; - case 64: - if (node.parent.kind === 142) { + return node.parent.kind === 144; + case 65: + if (node.parent.kind === 144) { return true; } case 7: case 8: - var _parent = node.parent; - switch (_parent.kind) { - case 193: - case 128: - case 130: + var parent_1 = node.parent; + switch (parent_1.kind) { + case 198: case 129: - case 220: - case 218: - case 150: - return _parent.initializer === node; - case 177: - case 178: - case 179: - case 180: - case 186: - case 187: - case 188: - case 214: - case 190: - case 188: - return _parent.expression === node; - case 181: - var forStatement = _parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 194) || - forStatement.condition === node || - forStatement.iterator === node; + case 132: + case 131: + case 226: + case 224: + case 152: + return parent_1.initializer === node; case 182: case 183: - var forInStatement = _parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 194) || - forInStatement.expression === node; - case 158: - return node === _parent.expression; - case 173: - return node === _parent.expression; - case 126: - return node === _parent.expression; + case 184: + case 185: + case 191: + case 192: + case 193: + case 220: + case 195: + case 193: + 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: + case 188: + var forInStatement = parent_1; + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 199) || forInStatement.expression === node; + case 160: + return node === parent_1.expression; + case 176: + return node === parent_1.expression; + case 127: + return node === parent_1.expression; default: - if (isExpression(_parent)) { + if (isExpression(parent_1)) { return true; } } @@ -3099,12 +8595,11 @@ var ts; ts.isExpression = isExpression; function isInstantiatedModule(node, preserveConstEnums) { var moduleState = ts.getModuleInstanceState(node); - return moduleState === 1 || - (preserveConstEnums && moduleState === 2); + return moduleState === 1 || (preserveConstEnums && moduleState === 2); } ts.isInstantiatedModule = isInstantiatedModule; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 203 && node.moduleReference.kind === 213; + return node.kind === 208 && node.moduleReference.kind === 219; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -3113,41 +8608,41 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 203 && node.moduleReference.kind !== 213; + return node.kind === 208 && node.moduleReference.kind !== 219; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function getExternalModuleName(node) { - if (node.kind === 204) { + if (node.kind === 209) { return node.moduleSpecifier; } - if (node.kind === 203) { + if (node.kind === 208) { var reference = node.moduleReference; - if (reference.kind === 213) { + if (reference.kind === 219) { return reference.expression; } } - if (node.kind === 210) { + if (node.kind === 215) { return node.moduleSpecifier; } } ts.getExternalModuleName = getExternalModuleName; function hasDotDotDotToken(node) { - return node && node.kind === 128 && node.dotDotDotToken !== undefined; + return node && node.kind === 129 && node.dotDotDotToken !== undefined; } ts.hasDotDotDotToken = hasDotDotDotToken; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 128: + case 129: return node.questionToken !== undefined; + case 134: + case 133: + return node.questionToken !== undefined; + case 225: + case 224: case 132: case 131: return node.questionToken !== undefined; - case 219: - case 218: - case 130: - case 129: - return node.questionToken !== undefined; } } return false; @@ -3170,7 +8665,7 @@ var ts; } ts.isTemplateLiteralKind = isTemplateLiteralKind; function isBindingPattern(node) { - return !!node && (node.kind === 149 || node.kind === 148); + return !!node && (node.kind === 151 || node.kind === 150); } ts.isBindingPattern = isBindingPattern; function isInAmbientContext(node) { @@ -3185,33 +8680,33 @@ var ts; ts.isInAmbientContext = isInAmbientContext; function isDeclaration(node) { switch (node.kind) { - case 161: - case 150: - case 196: - case 133: - case 199: - case 220: - case 212: - case 195: - case 160: - case 134: - case 205: - case 203: + 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 197: + case 213: + case 202: + case 134: + case 133: + case 205: + case 211: + case 129: + case 224: case 132: case 131: - case 200: - case 206: + case 137: + case 225: + case 203: case 128: - case 218: - case 130: - case 129: - case 135: - case 219: case 198: - case 127: - case 193: return true; } return false; @@ -3219,65 +8714,83 @@ var ts; ts.isDeclaration = isDeclaration; function isStatement(n) { switch (n.kind) { - case 185: - case 184: - case 192: - case 179: - case 177: - case 176: - case 182: - case 183: - case 181: - case 178: + case 190: case 189: - case 186: - case 188: - case 93: - case 191: - case 175: - case 180: + case 197: + case 184: + case 182: + case 181: case 187: - case 209: + case 188: + case 186: + case 183: + case 194: + case 191: + case 193: + case 94: + case 196: + case 180: + case 185: + case 192: + case 214: return true; default: return false; } } ts.isStatement = isStatement; + function isClassElement(n) { + switch (n.kind) { + case 135: + case 132: + case 134: + case 136: + case 137: + case 140: + return true; + default: + return false; + } + } + ts.isClassElement = isClassElement; function isDeclarationName(name) { - if (name.kind !== 64 && name.kind !== 8 && name.kind !== 7) { + if (name.kind !== 65 && name.kind !== 8 && name.kind !== 7) { return false; } - var _parent = name.parent; - if (_parent.kind === 208 || _parent.kind === 212) { - if (_parent.propertyName) { + var parent = name.parent; + if (parent.kind === 213 || parent.kind === 217) { + if (parent.propertyName) { return true; } } - if (isDeclaration(_parent)) { - return _parent.name === name; + if (isDeclaration(parent)) { + return parent.name === name; } return false; } ts.isDeclarationName = isDeclarationName; - function getClassBaseTypeNode(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 78); + 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; + } + ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; + function getClassExtendsHeritageClauseElement(node) { + var heritageClause = getHeritageClause(node.heritageClauses, 79); return heritageClause && heritageClause.types.length > 0 ? heritageClause.types[0] : undefined; } - ts.getClassBaseTypeNode = getClassBaseTypeNode; - function getClassImplementedTypeNodes(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 102); + ts.getClassExtendsHeritageClauseElement = getClassExtendsHeritageClauseElement; + function getClassImplementsHeritageClauseElements(node) { + var heritageClause = getHeritageClause(node.heritageClauses, 103); return heritageClause ? heritageClause.types : undefined; } - ts.getClassImplementedTypeNodes = getClassImplementedTypeNodes; + ts.getClassImplementsHeritageClauseElements = getClassImplementsHeritageClauseElements; function getInterfaceBaseTypeNodes(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 78); + var heritageClause = getHeritageClause(node.heritageClauses, 79); return heritageClause ? heritageClause.types : undefined; } ts.getInterfaceBaseTypeNodes = getInterfaceBaseTypeNodes; function getHeritageClause(clauses, kind) { if (clauses) { - for (var _i = 0, _n = clauses.length; _i < _n; _i++) { + for (var _i = 0; _i < clauses.length; _i++) { var clause = clauses[_i]; if (clause.token === kind) { return clause; @@ -3340,7 +8853,7 @@ var ts; } ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; function isKeyword(token) { - return 65 <= token && token <= 124; + return 66 <= token && token <= 125; } ts.isKeyword = isKeyword; function isTrivia(token) { @@ -3348,20 +8861,18 @@ var ts; } ts.isTrivia = isTrivia; function hasDynamicName(declaration) { - return declaration.name && - declaration.name.kind === 126 && - !isWellKnownSymbolSyntactically(declaration.name.expression); + return declaration.name && declaration.name.kind === 127 && !isWellKnownSymbolSyntactically(declaration.name.expression); } ts.hasDynamicName = hasDynamicName; function isWellKnownSymbolSyntactically(node) { - return node.kind === 153 && isESSymbolIdentifier(node.expression); + return node.kind === 155 && isESSymbolIdentifier(node.expression); } ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically; function getPropertyNameForPropertyNameNode(name) { - if (name.kind === 64 || name.kind === 8 || name.kind === 7) { + if (name.kind === 65 || name.kind === 8 || name.kind === 7) { return name.text; } - if (name.kind === 126) { + if (name.kind === 127) { var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { var rightHandSideName = nameExpression.name.text; @@ -3376,19 +8887,19 @@ var ts; } ts.getPropertyNameForKnownSymbolName = getPropertyNameForKnownSymbolName; function isESSymbolIdentifier(node) { - return node.kind === 64 && node.text === "Symbol"; + return node.kind === 65 && node.text === "Symbol"; } ts.isESSymbolIdentifier = isESSymbolIdentifier; function isModifier(token) { switch (token) { - case 108: - case 106: - case 107: case 109: - case 77: - case 114: - case 69: - case 72: + case 107: + case 108: + case 110: + case 78: + case 115: + case 70: + case 73: return true; } return false; @@ -3454,7 +8965,10 @@ var ts; if (length < 0) { throw new Error("length < 0"); } - return { start: start, length: length }; + return { + start: start, + length: length + }; } ts.createTextSpan = createTextSpan; function createTextSpanFromBounds(start, end) { @@ -3473,7 +8987,10 @@ var ts; if (newLength < 0) { throw new Error("newLength < 0"); } - return { span: span, newLength: newLength }; + return { + span: span, + newLength: newLength + }; } ts.createTextChangeRange = createTextChangeRange; ts.unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0); @@ -3504,7 +9021,7 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function nodeStartsNewLexicalEnvironment(n) { - return isFunctionLike(n) || n.kind === 200 || n.kind === 221; + return isFunctionLike(n) || n.kind === 205 || n.kind === 227; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(node) { @@ -3519,26 +9036,6 @@ var ts; return node; } ts.createSynthesizedNode = createSynthesizedNode; - function generateUniqueName(baseName, isExistingName) { - if (baseName.charCodeAt(0) !== 95) { - baseName = "_" + baseName; - if (!isExistingName(baseName)) { - return baseName; - } - } - if (baseName.charCodeAt(baseName.length - 1) !== 95) { - baseName += "_"; - } - var i = 1; - while (true) { - var _name = baseName + i; - if (!isExistingName(_name)) { - return _name; - } - i++; - } - } - ts.generateUniqueName = generateUniqueName; function createDiagnosticCollection() { var nonFileDiagnostics = []; var fileDiagnostics = {}; @@ -3634,15 +9131,308 @@ var ts; } var nonAsciiCharacters = /[^\u0000-\u007F]/g; function escapeNonAsciiCharacters(s) { - return nonAsciiCharacters.test(s) ? - s.replace(nonAsciiCharacters, function (c) { return get16BitUnicodeEscapeSequence(c.charCodeAt(0)); }) : - s; + return nonAsciiCharacters.test(s) ? s.replace(nonAsciiCharacters, function (c) { + return get16BitUnicodeEscapeSequence(c.charCodeAt(0)); + }) : s; } ts.escapeNonAsciiCharacters = escapeNonAsciiCharacters; + var indentStrings = [ + "", + " " + ]; + function getIndentString(level) { + if (indentStrings[level] === undefined) { + indentStrings[level] = getIndentString(level - 1) + indentStrings[1]; + } + return indentStrings[level]; + } + ts.getIndentString = getIndentString; + function getIndentSize() { + return indentStrings[1].length; + } + ts.getIndentSize = getIndentSize; + function createTextWriter(newLine) { + var output = ""; + var indent = 0; + var lineStart = true; + var lineCount = 0; + var linePos = 0; + function write(s) { + if (s && s.length) { + if (lineStart) { + output += getIndentString(indent); + lineStart = false; + } + output += s; + } + } + function rawWrite(s) { + if (s !== undefined) { + if (lineStart) { + lineStart = false; + } + output += s; + } + } + function writeLiteral(s) { + if (s && s.length) { + write(s); + var lineStartsOfS = ts.computeLineStarts(s); + if (lineStartsOfS.length > 1) { + lineCount = lineCount + lineStartsOfS.length - 1; + linePos = output.length - s.length + lineStartsOfS[lineStartsOfS.length - 1]; + } + } + } + function writeLine() { + if (!lineStart) { + output += newLine; + lineCount++; + linePos = output.length; + lineStart = true; + } + } + function writeTextOfNode(sourceFile, node) { + write(getSourceTextOfNodeFromSourceFile(sourceFile, node)); + } + return { + write: write, + rawWrite: rawWrite, + writeTextOfNode: writeTextOfNode, + writeLiteral: writeLiteral, + writeLine: writeLine, + increaseIndent: function () { + return indent++; + }, + decreaseIndent: function () { + return indent--; + }, + getIndent: function () { + return indent; + }, + getTextPos: function () { + return output.length; + }, + getLine: function () { + return lineCount + 1; + }, + getColumn: function () { + return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; + }, + getText: function () { + return output; + } + }; + } + ts.createTextWriter = createTextWriter; + function getOwnEmitOutputFilePath(sourceFile, host, extension) { + var compilerOptions = host.getCompilerOptions(); + var emitOutputFilePathWithoutExtension; + if (compilerOptions.outDir) { + emitOutputFilePathWithoutExtension = ts.removeFileExtension(getSourceFilePathInNewDir(sourceFile, host, compilerOptions.outDir)); + } + else { + emitOutputFilePathWithoutExtension = ts.removeFileExtension(sourceFile.fileName); + } + return emitOutputFilePathWithoutExtension + extension; + } + ts.getOwnEmitOutputFilePath = getOwnEmitOutputFilePath; + function getSourceFilePathInNewDir(sourceFile, host, newDirPath) { + var sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.fileName, host.getCurrentDirectory()); + sourceFilePath = sourceFilePath.replace(host.getCommonSourceDirectory(), ""); + return ts.combinePaths(newDirPath, sourceFilePath); + } + ts.getSourceFilePathInNewDir = getSourceFilePathInNewDir; + function writeFile(host, diagnostics, fileName, data, writeByteOrderMark) { + host.writeFile(fileName, data, writeByteOrderMark, function (hostErrorMessage) { + diagnostics.push(ts.createCompilerDiagnostic(ts.Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage)); + }); + } + ts.writeFile = writeFile; + function getLineOfLocalPosition(currentSourceFile, pos) { + return ts.getLineAndCharacterOfPosition(currentSourceFile, pos).line; + } + ts.getLineOfLocalPosition = getLineOfLocalPosition; + function getFirstConstructorWithBody(node) { + return ts.forEach(node.members, function (member) { + if (member.kind === 135 && nodeIsPresent(member.body)) { + return member; + } + }); + } + ts.getFirstConstructorWithBody = getFirstConstructorWithBody; + function shouldEmitToOwnFile(sourceFile, compilerOptions) { + if (!isDeclarationFile(sourceFile)) { + if ((isExternalModule(sourceFile) || !compilerOptions.out) && !ts.fileExtensionIs(sourceFile.fileName, ".js")) { + return true; + } + return false; + } + return false; + } + ts.shouldEmitToOwnFile = shouldEmitToOwnFile; + function getAllAccessorDeclarations(declarations, accessor) { + var firstAccessor; + var secondAccessor; + var getAccessor; + var setAccessor; + if (hasDynamicName(accessor)) { + firstAccessor = accessor; + if (accessor.kind === 136) { + getAccessor = accessor; + } + else if (accessor.kind === 137) { + setAccessor = accessor; + } + else { + ts.Debug.fail("Accessor has wrong kind"); + } + } + else { + ts.forEach(declarations, function (member) { + if ((member.kind === 136 || member.kind === 137) && (member.flags & 128) === (accessor.flags & 128)) { + var memberName = getPropertyNameForPropertyNameNode(member.name); + var accessorName = getPropertyNameForPropertyNameNode(accessor.name); + if (memberName === accessorName) { + if (!firstAccessor) { + firstAccessor = member; + } + else if (!secondAccessor) { + secondAccessor = member; + } + if (member.kind === 136 && !getAccessor) { + getAccessor = member; + } + if (member.kind === 137 && !setAccessor) { + setAccessor = member; + } + } + } + }); + } + return { + firstAccessor: firstAccessor, + secondAccessor: secondAccessor, + getAccessor: getAccessor, + setAccessor: setAccessor + }; + } + ts.getAllAccessorDeclarations = getAllAccessorDeclarations; + function emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments) { + if (leadingComments && leadingComments.length && node.pos !== leadingComments[0].pos && getLineOfLocalPosition(currentSourceFile, node.pos) !== getLineOfLocalPosition(currentSourceFile, leadingComments[0].pos)) { + writer.writeLine(); + } + } + ts.emitNewLineBeforeLeadingComments = emitNewLineBeforeLeadingComments; + function emitComments(currentSourceFile, writer, comments, trailingSeparator, newLine, writeComment) { + var emitLeadingSpace = !trailingSeparator; + ts.forEach(comments, function (comment) { + if (emitLeadingSpace) { + writer.write(" "); + emitLeadingSpace = false; + } + writeComment(currentSourceFile, writer, comment, newLine); + if (comment.hasTrailingNewLine) { + writer.writeLine(); + } + else if (trailingSeparator) { + writer.write(" "); + } + else { + emitLeadingSpace = true; + } + }); + } + ts.emitComments = emitComments; + function writeCommentRange(currentSourceFile, writer, comment, newLine) { + if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42) { + var firstCommentLineAndCharacter = ts.getLineAndCharacterOfPosition(currentSourceFile, comment.pos); + var lineCount = ts.getLineStarts(currentSourceFile).length; + var firstCommentLineIndent; + for (var pos = comment.pos, currentLine = firstCommentLineAndCharacter.line; pos < comment.end; currentLine++) { + var nextLineStart = (currentLine + 1) === lineCount ? currentSourceFile.text.length + 1 : getStartPositionOfLine(currentLine + 1, currentSourceFile); + if (pos !== comment.pos) { + if (firstCommentLineIndent === undefined) { + firstCommentLineIndent = calculateIndent(getStartPositionOfLine(firstCommentLineAndCharacter.line, currentSourceFile), comment.pos); + } + var currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); + var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(pos, nextLineStart); + if (spacesToEmit > 0) { + var numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); + var indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); + writer.rawWrite(indentSizeSpaceString); + while (numberOfSingleSpacesToEmit) { + writer.rawWrite(" "); + numberOfSingleSpacesToEmit--; + } + } + else { + writer.rawWrite(""); + } + } + writeTrimmedCurrentLine(pos, nextLineStart); + pos = nextLineStart; + } + } + else { + writer.write(currentSourceFile.text.substring(comment.pos, comment.end)); + } + function writeTrimmedCurrentLine(pos, nextLineStart) { + var end = Math.min(comment.end, nextLineStart - 1); + var currentLineText = currentSourceFile.text.substring(pos, end).replace(/^\s+|\s+$/g, ''); + if (currentLineText) { + writer.write(currentLineText); + if (end !== comment.end) { + writer.writeLine(); + } + } + else { + writer.writeLiteral(newLine); + } + } + function calculateIndent(pos, end) { + var currentLineIndent = 0; + for (; pos < end && ts.isWhiteSpace(currentSourceFile.text.charCodeAt(pos)); pos++) { + if (currentSourceFile.text.charCodeAt(pos) === 9) { + currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); + } + else { + currentLineIndent++; + } + } + return currentLineIndent; + } + } + ts.writeCommentRange = writeCommentRange; + function isSupportedHeritageClauseElement(node) { + return isSupportedHeritageClauseElementExpression(node.expression); + } + ts.isSupportedHeritageClauseElement = isSupportedHeritageClauseElement; + function isSupportedHeritageClauseElementExpression(node) { + if (node.kind === 65) { + return true; + } + else if (node.kind === 155) { + return isSupportedHeritageClauseElementExpression(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); + } + ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; + function getLocalSymbolForExportDefault(symbol) { + return symbol && symbol.valueDeclaration && (symbol.valueDeclaration.flags & 256) ? symbol.valueDeclaration.localSymbol : undefined; + } + ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; })(ts || (ts = {})); +/// +/// var ts; (function (ts) { - var nodeConstructors = new Array(223); + var nodeConstructors = new Array(229); ts.parseTime = 0; function getNodeConstructor(kind) { return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); @@ -3664,7 +9454,7 @@ var ts; } function visitEachNode(cbNode, nodes) { if (nodes) { - for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + for (var _i = 0; _i < nodes.length; _i++) { var node = nodes[_i]; var result = cbNode(node); if (result) { @@ -3680,303 +9470,265 @@ var ts; var visitNodes = cbNodeArray ? visitNodeArray : visitEachNode; var cbNodes = cbNodeArray || cbNode; switch (node.kind) { - case 125: - return visitNode(cbNode, node.left) || - visitNode(cbNode, node.right); - case 127: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.constraint) || - visitNode(cbNode, node.expression); + case 126: + return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); case 128: - case 130: + return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.expression); case 129: - case 218: - case 219: - case 193: - case 150: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.propertyName) || - visitNode(cbNode, node.dotDotDotToken) || - visitNode(cbNode, node.name) || - visitNode(cbNode, node.questionToken) || - visitNode(cbNode, node.type) || - visitNode(cbNode, node.initializer); - case 140: - case 141: - case 136: - case 137: - case 138: - return visitNodes(cbNodes, node.modifiers) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.parameters) || - visitNode(cbNode, node.type); case 132: case 131: - case 133: - case 134: - case 135: - case 160: - case 195: - case 161: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.asteriskToken) || - visitNode(cbNode, node.name) || - visitNode(cbNode, node.questionToken) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.parameters) || - visitNode(cbNode, node.type) || - visitNode(cbNode, node.body); - case 139: - return visitNode(cbNode, node.typeName) || - visitNodes(cbNodes, node.typeArguments); + case 224: + case 225: + case 198: + case 152: + return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); case 142: - return visitNode(cbNode, node.exprName); case 143: - return visitNodes(cbNodes, node.members); + case 138: + case 139: + case 140: + 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 136: + case 137: + case 162: + case 200: + case 163: + return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); + case 141: + return visitNode(cbNode, node.typeName) || visitNodes(cbNodes, node.typeArguments); case 144: - return visitNode(cbNode, node.elementType); + return visitNode(cbNode, node.exprName); case 145: - return visitNodes(cbNodes, node.elementTypes); + return visitNodes(cbNodes, node.members); case 146: - return visitNodes(cbNodes, node.types); + return visitNode(cbNode, node.elementType); case 147: - return visitNode(cbNode, node.type); + return visitNodes(cbNodes, node.elementTypes); case 148: + return visitNodes(cbNodes, node.types); case 149: - return visitNodes(cbNodes, node.elements); + return visitNode(cbNode, node.type); + case 150: case 151: return visitNodes(cbNodes, node.elements); - case 152: - return visitNodes(cbNodes, node.properties); case 153: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.dotToken) || - visitNode(cbNode, node.name); + return visitNodes(cbNodes, node.elements); case 154: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.argumentExpression); + return visitNodes(cbNodes, node.properties); case 155: + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.dotToken) || visitNode(cbNode, node.name); case 156: - return visitNode(cbNode, node.expression) || - visitNodes(cbNodes, node.typeArguments) || - visitNodes(cbNodes, node.arguments); + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); case 157: - return visitNode(cbNode, node.tag) || - visitNode(cbNode, node.template); case 158: - return visitNode(cbNode, node.type) || - visitNode(cbNode, node.expression); + return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments) || visitNodes(cbNodes, node.arguments); case 159: - return visitNode(cbNode, node.expression); - case 162: - return visitNode(cbNode, node.expression); - case 163: + return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); + case 160: + return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); + case 161: return visitNode(cbNode, node.expression); case 164: return visitNode(cbNode, node.expression); case 165: - return visitNode(cbNode, node.operand); - case 170: - return visitNode(cbNode, node.asteriskToken) || - visitNode(cbNode, node.expression); + return visitNode(cbNode, node.expression); case 166: - return visitNode(cbNode, node.operand); + return visitNode(cbNode, node.expression); case 167: - return visitNode(cbNode, node.left) || - visitNode(cbNode, node.operatorToken) || - visitNode(cbNode, node.right); + return visitNode(cbNode, node.operand); + case 172: + return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); case 168: - return visitNode(cbNode, node.condition) || - visitNode(cbNode, node.questionToken) || - visitNode(cbNode, node.whenTrue) || - visitNode(cbNode, node.colonToken) || - visitNode(cbNode, node.whenFalse); - case 171: - return visitNode(cbNode, node.expression); - case 174: - case 201: - return visitNodes(cbNodes, node.statements); - case 221: - return visitNodes(cbNodes, node.statements) || - visitNode(cbNode, node.endOfFileToken); - case 175: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.declarationList); - case 194: - return visitNodes(cbNodes, node.declarations); - case 177: - return visitNode(cbNode, node.expression); - case 178: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.thenStatement) || - visitNode(cbNode, node.elseStatement); - case 179: - return visitNode(cbNode, node.statement) || - visitNode(cbNode, node.expression); - case 180: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); - case 181: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.condition) || - visitNode(cbNode, node.iterator) || - visitNode(cbNode, node.statement); - case 182: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); - case 183: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); - case 184: - case 185: - return visitNode(cbNode, node.label); - case 186: - return visitNode(cbNode, node.expression); - case 187: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); - case 188: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.caseBlock); - case 202: - return visitNodes(cbNodes, node.clauses); - case 214: - return visitNode(cbNode, node.expression) || - visitNodes(cbNodes, node.statements); - case 215: - return visitNodes(cbNodes, node.statements); - case 189: - return visitNode(cbNode, node.label) || - visitNode(cbNode, node.statement); - case 190: - return visitNode(cbNode, node.expression); - case 191: - return visitNode(cbNode, node.tryBlock) || - visitNode(cbNode, node.catchClause) || - visitNode(cbNode, node.finallyBlock); - case 217: - return visitNode(cbNode, node.variableDeclaration) || - visitNode(cbNode, node.block); - case 196: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.heritageClauses) || - visitNodes(cbNodes, node.members); - case 197: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.heritageClauses) || - visitNodes(cbNodes, node.members); - case 198: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNode(cbNode, node.type); - case 199: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.members); - case 220: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.initializer); - case 200: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNode(cbNode, node.body); - case 203: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNode(cbNode, node.moduleReference); - case 204: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.importClause) || - visitNode(cbNode, node.moduleSpecifier); - case 205: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.namedBindings); - case 206: - return visitNode(cbNode, node.name); - case 207: - case 211: - return visitNodes(cbNodes, node.elements); - case 210: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.exportClause) || - visitNode(cbNode, node.moduleSpecifier); - case 208: - case 212: - return visitNode(cbNode, node.propertyName) || - visitNode(cbNode, node.name); - case 209: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.expression); + return visitNode(cbNode, node.operand); case 169: - return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); + return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); + case 170: + return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); case 173: - return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 126: return visitNode(cbNode, node.expression); + case 179: + case 206: + return visitNodes(cbNodes, node.statements); + case 227: + return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); + case 180: + return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); + case 199: + return visitNodes(cbNodes, node.declarations); + case 182: + return visitNode(cbNode, node.expression); + case 183: + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); + case 184: + 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) || visitNode(cbNode, node.statement); + case 187: + return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || 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) || visitNode(cbNode, node.statement); + case 193: + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); + case 207: + return visitNodes(cbNodes, node.clauses); + case 220: + return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.statements); + case 221: + return visitNodes(cbNodes, node.statements); + case 194: + return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); + case 195: + return visitNode(cbNode, node.expression); + case 196: + return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); + case 223: + return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); + case 130: + 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: + 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: + return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.type); + 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); + case 205: + return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); + case 208: + return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); + case 209: + return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); + case 210: + return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); + case 211: + return visitNode(cbNode, node.name); + case 212: case 216: - return visitNodes(cbNodes, node.types); + return visitNodes(cbNodes, node.elements); + case 215: + return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); case 213: + case 217: + return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); + case 214: + return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); + case 171: + return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); + case 176: + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); + case 127: return visitNode(cbNode, node.expression); + case 222: + return visitNodes(cbNodes, node.types); + case 177: + return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments); + case 219: + return visitNode(cbNode, node.expression); + case 218: + return visitNodes(cbNodes, node.decorators); } } ts.forEachChild = forEachChild; function parsingContextErrors(context) { switch (context) { - case 0: return ts.Diagnostics.Declaration_or_statement_expected; - case 1: return ts.Diagnostics.Declaration_or_statement_expected; - case 2: return ts.Diagnostics.Statement_expected; - case 3: return ts.Diagnostics.case_or_default_expected; - case 4: return ts.Diagnostics.Statement_expected; - case 5: return ts.Diagnostics.Property_or_signature_expected; - case 6: return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; - case 7: return ts.Diagnostics.Enum_member_expected; - case 8: return ts.Diagnostics.Type_reference_expected; - case 9: return ts.Diagnostics.Variable_declaration_expected; - case 10: return ts.Diagnostics.Property_destructuring_pattern_expected; - case 11: return ts.Diagnostics.Array_element_destructuring_pattern_expected; - case 12: return ts.Diagnostics.Argument_expression_expected; - case 13: return ts.Diagnostics.Property_assignment_expected; - case 14: return ts.Diagnostics.Expression_or_comma_expected; - case 15: return ts.Diagnostics.Parameter_declaration_expected; - case 16: return ts.Diagnostics.Type_parameter_declaration_expected; - case 17: return ts.Diagnostics.Type_argument_expected; - case 18: return ts.Diagnostics.Type_expected; - case 19: return ts.Diagnostics.Unexpected_token_expected; - case 20: return ts.Diagnostics.Identifier_expected; + case 0: + return ts.Diagnostics.Declaration_or_statement_expected; + case 1: + return ts.Diagnostics.Declaration_or_statement_expected; + case 2: + return ts.Diagnostics.Statement_expected; + case 3: + return ts.Diagnostics.case_or_default_expected; + case 4: + return ts.Diagnostics.Statement_expected; + case 5: + return ts.Diagnostics.Property_or_signature_expected; + case 6: + return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; + case 7: + return ts.Diagnostics.Enum_member_expected; + case 8: + return ts.Diagnostics.Expression_expected; + case 9: + return ts.Diagnostics.Variable_declaration_expected; + case 10: + return ts.Diagnostics.Property_destructuring_pattern_expected; + case 11: + return ts.Diagnostics.Array_element_destructuring_pattern_expected; + case 12: + return ts.Diagnostics.Argument_expression_expected; + case 13: + return ts.Diagnostics.Property_assignment_expected; + case 14: + return ts.Diagnostics.Expression_or_comma_expected; + case 15: + return ts.Diagnostics.Parameter_declaration_expected; + case 16: + return ts.Diagnostics.Type_parameter_declaration_expected; + case 17: + return ts.Diagnostics.Type_argument_expected; + case 18: + return ts.Diagnostics.Type_expected; + case 19: + return ts.Diagnostics.Unexpected_token_expected; + case 20: + return ts.Diagnostics.Identifier_expected; } } ; function modifierToFlag(token) { switch (token) { - case 109: return 128; - case 108: return 16; - case 107: return 64; - case 106: return 32; - case 77: return 1; - case 114: return 2; - case 69: return 8192; - case 72: return 256; + case 110: + return 128; + case 109: + return 16; + case 108: + return 64; + case 107: + return 32; + case 78: + return 1; + case 115: + return 2; + case 70: + return 8192; + case 73: + return 256; } return 0; } ts.modifierToFlag = modifierToFlag; function fixupParentReferences(sourceFile) { - var _parent = sourceFile; + // normally parent references are set during binding. However, for clients that only need + // a syntax tree, and no semantic features, then the binding process is an unnecessary + // overhead. This functions allows us to set all the parents, without all the expense of + // binding. + var parent = sourceFile; forEachChild(sourceFile, visitNode); return; function visitNode(n) { - if (n.parent !== _parent) { - n.parent = _parent; - var saveParent = _parent; - _parent = n; + if (n.parent !== parent) { + n.parent = parent; + var saveParent = parent; + parent = n; forEachChild(n, visitNode); - _parent = saveParent; + parent = saveParent; } } } @@ -3984,7 +9736,7 @@ var ts; switch (node.kind) { case 8: case 7: - case 64: + case 65: return true; } return false; @@ -4014,7 +9766,7 @@ var ts; array._children = undefined; array.pos += delta; array.end += delta; - for (var _i = 0, _n = array.length; _i < _n; _i++) { + for (var _i = 0; _i < array.length; _i++) { var node = array[_i]; visitNode(node); } @@ -4078,7 +9830,7 @@ var ts; array.intersectsChange = true; array._children = undefined; adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); - for (var _i = 0, _n = array.length; _i < _n; _i++) { + for (var _i = 0; _i < array.length; _i++) { var node = array[_i]; visitNode(node); } @@ -4194,8 +9946,7 @@ var ts; } ts.updateSourceFile = updateSourceFile; function isEvalOrArgumentsIdentifier(node) { - return node.kind === 64 && - (node.text === "eval" || node.text === "arguments"); + return node.kind === 65 && (node.text === "eval" || node.text === "arguments"); } ts.isEvalOrArgumentsIdentifier = isEvalOrArgumentsIdentifier; function isUseStrictPrologueDirective(sourceFile, node) { @@ -4272,12 +10023,13 @@ var ts; ts.createSourceFile = createSourceFile; function parseSourceFile(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes) { if (setParentNodes === void 0) { setParentNodes = false; } + var disallowInAndDecoratorContext = 2 | 16; var parsingContext = 0; var identifiers = {}; var identifierCount = 0; var nodeCount = 0; var token; - var sourceFile = createNode(221, 0); + var sourceFile = createNode(227, 0); sourceFile.pos = 0; sourceFile.end = sourceText.length; sourceFile.text = sourceText; @@ -4323,6 +10075,19 @@ var ts; function setGeneratorParameterContext(val) { setContextFlag(val, 8); } + function setDecoratorContext(val) { + setContextFlag(val, 16); + } + function doOutsideOfContext(flags, func) { + var currentContextFlags = contextFlags & flags; + if (currentContextFlags) { + setContextFlag(false, currentContextFlags); + var result = func(); + setContextFlag(true, currentContextFlags); + return result; + } + return func(); + } function allowInAnd(func) { if (contextFlags & 2) { setDisallowInContext(false); @@ -4359,6 +10124,15 @@ var ts; } return func(); } + function doInDecoratorContext(func) { + if (contextFlags & 16) { + return func(); + } + setDecoratorContext(true); + var result = func(); + setDecoratorContext(false); + return result; + } function inYieldContext() { return (contextFlags & 4) !== 0; } @@ -4371,10 +10145,13 @@ var ts; function inDisallowInContext() { return (contextFlags & 2) !== 0; } + function inDecoratorContext() { + return (contextFlags & 16) !== 0; + } function parseErrorAtCurrentToken(message, arg0) { var start = scanner.getTokenPos(); - var _length = scanner.getTextPos() - start; - parseErrorAtPosition(start, _length, message, arg0); + var length = scanner.getTextPos() - start; + parseErrorAtPosition(start, length, message, arg0); } function parseErrorAtPosition(start, length, message, arg0) { var lastError = ts.lastOrUndefined(sourceFile.parseDiagnostics); @@ -4413,9 +10190,7 @@ var ts; var saveParseDiagnosticsLength = sourceFile.parseDiagnostics.length; var saveParseErrorBeforeNextFinishedNode = parseErrorBeforeNextFinishedNode; var saveContextFlags = contextFlags; - var result = isLookAhead - ? scanner.lookAhead(callback) - : scanner.tryScan(callback); + var result = isLookAhead ? scanner.lookAhead(callback) : scanner.tryScan(callback); ts.Debug.assert(saveContextFlags === contextFlags); if (!result || isLookAhead) { token = saveToken; @@ -4431,13 +10206,13 @@ var ts; return speculationHelper(callback, false); } function isIdentifier() { - if (token === 64) { + if (token === 65) { return true; } - if (token === 110 && inYieldContext()) { + if (token === 111 && inYieldContext()) { return false; } - return inStrictModeContext() ? token > 110 : token > 100; + return inStrictModeContext() ? token > 111 : token > 101; } function parseExpected(kind, diagnosticMessage) { if (token === kind) { @@ -4466,8 +10241,7 @@ var ts; return undefined; } function parseExpectedToken(t, reportAtCurrentPosition, diagnosticMessage, arg0) { - return parseOptionalToken(t) || - createMissingNode(t, reportAtCurrentPosition, diagnosticMessage, arg0); + return parseOptionalToken(t) || createMissingNode(t, reportAtCurrentPosition, diagnosticMessage, arg0); } function parseTokenNode() { var node = createNode(token); @@ -4508,7 +10282,7 @@ var ts; } if (parseErrorBeforeNextFinishedNode) { parseErrorBeforeNextFinishedNode = false; - node.parserContextFlags |= 16; + node.parserContextFlags |= 32; } return node; } @@ -4530,12 +10304,12 @@ var ts; function createIdentifier(isIdentifier, diagnosticMessage) { identifierCount++; if (isIdentifier) { - var node = createNode(64); + var node = createNode(65); node.text = internIdentifier(scanner.getTokenValue()); nextToken(); return finishNode(node); } - return createMissingNode(64, false, diagnosticMessage || ts.Diagnostics.Identifier_expected); + return createMissingNode(65, false, diagnosticMessage || ts.Diagnostics.Identifier_expected); } function parseIdentifier(diagnosticMessage) { return createIdentifier(isIdentifier(), diagnosticMessage); @@ -4544,9 +10318,7 @@ var ts; return createIdentifier(isIdentifierOrKeyword()); } function isLiteralPropertyName() { - return isIdentifierOrKeyword() || - token === 8 || - token === 7; + return isIdentifierOrKeyword() || token === 8 || token === 7; } function parsePropertyName() { if (token === 8 || token === 7) { @@ -4558,7 +10330,7 @@ var ts; return parseIdentifierName(); } function parseComputedPropertyName() { - var node = createNode(126); + var node = createNode(127); parseExpected(18); var yieldContext = inYieldContext(); if (inGeneratorParameterContext()) { @@ -4582,31 +10354,28 @@ var ts; return ts.isModifier(token) && tryParse(nextTokenCanFollowContextualModifier); } function nextTokenCanFollowContextualModifier() { - if (token === 69) { - return nextToken() === 76; + if (token === 70) { + return nextToken() === 77; } - if (token === 77) { + if (token === 78) { nextToken(); - if (token === 72) { + if (token === 73) { return lookAhead(nextTokenIsClassOrFunction); } return token !== 35 && token !== 14 && canFollowModifier(); } - if (token === 72) { + if (token === 73) { return nextTokenIsClassOrFunction(); } nextToken(); return canFollowModifier(); } function canFollowModifier() { - return token === 18 - || token === 14 - || token === 35 - || isLiteralPropertyName(); + return token === 18 || token === 14 || token === 35 || isLiteralPropertyName(); } function nextTokenIsClassOrFunction() { nextToken(); - return token === 68 || token === 82; + return token === 69 || token === 83; } function isListElement(parsingContext, inErrorRecovery) { var node = currentNode(parsingContext); @@ -4621,11 +10390,11 @@ var ts; case 4: return isStartOfStatement(inErrorRecovery); case 3: - return token === 66 || token === 72; + return token === 67 || token === 73; case 5: return isStartOfTypeMember(); case 6: - return lookAhead(isClassMemberStart); + return lookAhead(isClassMemberStart) || (token === 22 && !inErrorRecovery); case 7: return token === 18 || isLiteralPropertyName(); case 13: @@ -4633,7 +10402,15 @@ var ts; case 10: return isLiteralPropertyName(); case 8: - return isIdentifier() && !isNotHeritageClauseTypeName(); + if (token === 14) { + return lookAhead(isValidHeritageClauseObjectLiteral); + } + if (!inErrorRecovery) { + return isStartOfLeftHandSideExpression() && !isHeritageClauseExtendsOrImplementsKeyword(); + } + else { + return isIdentifier() && !isHeritageClauseExtendsOrImplementsKeyword(); + } case 9: return isIdentifierOrPattern(); case 11: @@ -4655,17 +10432,28 @@ var ts; } ts.Debug.fail("Non-exhaustive case in 'isListElement'."); } + function isValidHeritageClauseObjectLiteral() { + ts.Debug.assert(token === 14); + if (nextToken() === 15) { + var next = nextToken(); + return next === 23 || next === 14 || next === 79 || next === 103; + } + return true; + } function nextTokenIsIdentifier() { nextToken(); return isIdentifier(); } - function isNotHeritageClauseTypeName() { - if (token === 102 || - token === 78) { - return lookAhead(nextTokenIsIdentifier); + function isHeritageClauseExtendsOrImplementsKeyword() { + if (token === 103 || token === 79) { + return lookAhead(nextTokenIsStartOfExpression); } return false; } + function nextTokenIsStartOfExpression() { + nextToken(); + return isStartOfExpression(); + } function isListTerminator(kind) { if (token === 1) { return true; @@ -4682,13 +10470,13 @@ var ts; case 20: return token === 15; case 4: - return token === 15 || token === 66 || token === 72; + return token === 15 || token === 67 || token === 73; case 8: - return token === 14 || token === 78 || token === 102; + return token === 14 || token === 79 || token === 103; case 9: return isVariableDeclaratorListTerminator(); case 16: - return token === 25 || token === 16 || token === 14 || token === 78 || token === 102; + return token === 25 || token === 16 || token === 14 || token === 79 || token === 103; case 12: return token === 17 || token === 22; case 14: @@ -4781,7 +10569,7 @@ var ts; if (ts.containsParseError(node)) { return undefined; } - var nodeContextFlags = node.parserContextFlags & 31; + var nodeContextFlags = node.parserContextFlags & 63; if (nodeContextFlags !== contextFlags) { return undefined; } @@ -4815,26 +10603,26 @@ var ts; case 15: return isReusableParameter(node); case 19: - case 8: case 16: case 18: case 17: case 12: case 13: + case 8: } return false; } function isReusableModuleElement(node) { if (node) { switch (node.kind) { - case 204: - case 203: - case 210: case 209: - case 196: - case 197: - case 200: - case 199: + case 208: + case 215: + case 214: + case 201: + case 202: + case 205: + case 204: return true; } return isReusableStatement(node); @@ -4844,12 +10632,13 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 133: - case 138: - case 132: - case 134: case 135: - case 130: + case 140: + case 134: + case 136: + case 137: + case 132: + case 178: return true; } } @@ -4858,8 +10647,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 214: - case 215: + case 220: + case 221: return true; } } @@ -4868,56 +10657,56 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 195: - case 175: - case 174: - case 178: - case 177: - case 190: - case 186: - case 188: - case 185: - case 184: - case 182: - case 183: - case 181: + case 200: case 180: - case 187: - case 176: - case 191: - case 189: case 179: + case 183: + case 182: + case 195: + case 191: + case 193: + case 190: + case 189: + case 187: + case 188: + case 186: + case 185: case 192: + case 181: + case 196: + case 194: + case 184: + case 197: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 220; + return node.kind === 226; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 137: + case 139: + case 133: + case 140: case 131: case 138: - case 129: - case 136: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 193) { + if (node.kind !== 198) { return false; } var variableDeclarator = node; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 128) { + if (node.kind !== 129) { return false; } var parameter = node; @@ -4986,7 +10775,7 @@ var ts; function parseEntityName(allowReservedWords, diagnosticMessage) { var entity = parseIdentifier(diagnosticMessage); while (parseOptional(20)) { - var node = createNode(125, entity.pos); + var node = createNode(126, entity.pos); node.left = entity; node.right = parseRightSideOfDot(allowReservedWords); entity = finishNode(node); @@ -4997,13 +10786,13 @@ var ts; if (scanner.hasPrecedingLineBreak() && scanner.isReservedWord()) { var matchesPattern = lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); if (matchesPattern) { - return createMissingNode(64, true, ts.Diagnostics.Identifier_expected); + return createMissingNode(65, true, ts.Diagnostics.Identifier_expected); } } return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(169); + var template = createNode(171); template.head = parseLiteralNode(); ts.Debug.assert(template.head.kind === 11, "Template head has wrong token kind"); var templateSpans = []; @@ -5016,7 +10805,7 @@ var ts; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(173); + var span = createNode(176); span.expression = allowInAnd(parseExpression); var literal; if (token === 15) { @@ -5042,15 +10831,13 @@ var ts; var tokenPos = scanner.getTokenPos(); nextToken(); finishNode(node); - if (node.kind === 7 - && sourceText.charCodeAt(tokenPos) === 48 - && ts.isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { + if (node.kind === 7 && sourceText.charCodeAt(tokenPos) === 48 && ts.isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { node.flags |= 16384; } return node; } function parseTypeReference() { - var node = createNode(139); + var node = createNode(141); node.typeName = parseEntityName(false, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && token === 24) { node.typeArguments = parseBracketedList(17, parseType, 24, 25); @@ -5058,15 +10845,15 @@ var ts; return finishNode(node); } function parseTypeQuery() { - var node = createNode(142); - parseExpected(96); + var node = createNode(144); + parseExpected(97); node.exprName = parseEntityName(true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(127); + var node = createNode(128); node.name = parseIdentifier(); - if (parseOptional(78)) { + if (parseOptional(79)) { if (isStartOfType() || !isStartOfExpression()) { node.constraint = parseType(); } @@ -5083,14 +10870,12 @@ var ts; } function parseParameterType() { if (parseOptional(51)) { - return token === 8 - ? parseLiteralNode(true) - : parseType(); + return token === 8 ? parseLiteralNode(true) : parseType(); } return undefined; } function isStartOfParameter() { - return token === 21 || isIdentifierOrPattern() || ts.isModifier(token); + return token === 21 || isIdentifierOrPattern() || ts.isModifier(token) || token === 52; } function setModifiers(node, modifiers) { if (modifiers) { @@ -5099,7 +10884,8 @@ var ts; } } function parseParameter() { - var node = createNode(128); + var node = createNode(129); + node.decorators = parseDecorators(); setModifiers(node, parseModifiers()); node.dotDotDotToken = parseOptionalToken(21); node.name = inGeneratorParameterContext() ? doInYieldContext(parseIdentifierOrPattern) : parseIdentifierOrPattern(); @@ -5150,8 +10936,8 @@ var ts; } function parseSignatureMember(kind) { var node = createNode(kind); - if (kind === 137) { - parseExpected(87); + if (kind === 139) { + parseExpected(88); } fillSignature(51, false, false, node); parseTypeMemberSemicolon(); @@ -5189,9 +10975,9 @@ var ts; nextToken(); return token === 51 || token === 23 || token === 19; } - function parseIndexSignatureDeclaration(modifiers) { - var fullStart = modifiers ? modifiers.pos : scanner.getStartPos(); - var node = createNode(138, fullStart); + function parseIndexSignatureDeclaration(fullStart, decorators, modifiers) { + var node = createNode(140, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); node.parameters = parseBracketedList(15, parseParameter, 18, 19); node.type = parseTypeAnnotation(); @@ -5200,19 +10986,19 @@ var ts; } function parsePropertyOrMethodSignature() { var fullStart = scanner.getStartPos(); - var _name = parsePropertyName(); + var name = parsePropertyName(); var questionToken = parseOptionalToken(50); if (token === 16 || token === 24) { - var method = createNode(131, fullStart); - method.name = _name; + var method = createNode(133, fullStart); + method.name = name; method.questionToken = questionToken; fillSignature(51, false, false, method); parseTypeMemberSemicolon(); return finishNode(method); } else { - var property = createNode(129, fullStart); - property.name = _name; + var property = createNode(131, fullStart); + property.name = name; property.questionToken = questionToken; property.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -5243,24 +11029,18 @@ var ts; } function isTypeMemberWithLiteralPropertyName() { nextToken(); - return token === 16 || - token === 24 || - token === 50 || - token === 51 || - canParseSemicolon(); + return token === 16 || token === 24 || token === 50 || token === 51 || canParseSemicolon(); } function parseTypeMember() { switch (token) { case 16: case 24: - return parseSignatureMember(136); + return parseSignatureMember(138); case 18: - return isIndexSignature() - ? parseIndexSignatureDeclaration(undefined) - : parsePropertyOrMethodSignature(); - case 87: + return isIndexSignature() ? parseIndexSignatureDeclaration(scanner.getStartPos(), undefined, undefined) : parsePropertyOrMethodSignature(); + case 88: if (lookAhead(isStartOfConstructSignature)) { - return parseSignatureMember(137); + return parseSignatureMember(139); } case 8: case 7: @@ -5278,17 +11058,17 @@ var ts; } } function parseIndexSignatureWithModifiers() { + var fullStart = scanner.getStartPos(); + var decorators = parseDecorators(); var modifiers = parseModifiers(); - return isIndexSignature() - ? parseIndexSignatureDeclaration(modifiers) - : undefined; + return isIndexSignature() ? parseIndexSignatureDeclaration(fullStart, decorators, modifiers) : undefined; } function isStartOfConstructSignature() { nextToken(); return token === 16 || token === 24; } function parseTypeLiteral() { - var node = createNode(143); + var node = createNode(145); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -5304,12 +11084,12 @@ var ts; return members; } function parseTupleType() { - var node = createNode(145); + var node = createNode(147); node.elementTypes = parseBracketedList(18, parseType, 18, 19); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(147); + var node = createNode(149); parseExpected(16); node.type = parseType(); parseExpected(17); @@ -5317,8 +11097,8 @@ var ts; } function parseFunctionOrConstructorType(kind) { var node = createNode(kind); - if (kind === 141) { - parseExpected(87); + if (kind === 143) { + parseExpected(88); } fillSignature(32, false, false, node); return finishNode(node); @@ -5329,16 +11109,16 @@ var ts; } function parseNonArrayType() { switch (token) { - case 111: - case 120: - case 118: case 112: case 121: + case 119: + case 113: + case 122: var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReference(); - case 98: + case 99: return parseTokenNode(); - case 96: + case 97: return parseTypeQuery(); case 14: return parseTypeLiteral(); @@ -5352,17 +11132,17 @@ var ts; } function isStartOfType() { switch (token) { - case 111: - case 120: - case 118: case 112: case 121: - case 98: - case 96: + case 119: + case 113: + case 122: + case 99: + case 97: case 14: case 18: case 24: - case 87: + case 88: return true; case 16: return lookAhead(isStartOfParenthesizedOrFunctionType); @@ -5378,7 +11158,7 @@ var ts; var type = parseNonArrayType(); while (!scanner.hasPrecedingLineBreak() && parseOptional(18)) { parseExpected(19); - var node = createNode(144, type.pos); + var node = createNode(146, type.pos); node.elementType = type; type = finishNode(node); } @@ -5387,13 +11167,15 @@ var ts; function parseUnionTypeOrHigher() { var type = parseArrayTypeOrHigher(); if (token === 44) { - var types = [type]; + var types = [ + type + ]; types.pos = type.pos; while (parseOptional(44)) { types.push(parseArrayTypeOrHigher()); } types.end = getNodeEnd(); - var node = createNode(146, type.pos); + var node = createNode(148, type.pos); node.types = types; type = finishNode(node); } @@ -5412,9 +11194,7 @@ var ts; } if (isIdentifier() || ts.isModifier(token)) { nextToken(); - if (token === 51 || token === 23 || - token === 50 || token === 52 || - isIdentifier() || ts.isModifier(token)) { + if (token === 51 || token === 23 || token === 50 || token === 53 || isIdentifier() || ts.isModifier(token)) { return true; } if (token === 17) { @@ -5438,23 +11218,23 @@ var ts; } function parseTypeWorker() { if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(140); + return parseFunctionOrConstructorType(142); } - if (token === 87) { - return parseFunctionOrConstructorType(141); + if (token === 88) { + return parseFunctionOrConstructorType(143); } return parseUnionTypeOrHigher(); } function parseTypeAnnotation() { return parseOptional(51) ? parseType() : undefined; } - function isStartOfExpression() { + function isStartOfLeftHandSideExpression() { switch (token) { - case 92: - case 90: - case 88: - case 94: - case 79: + case 93: + case 91: + case 89: + case 95: + case 80: case 7: case 8: case 10: @@ -5462,22 +11242,33 @@ var ts; case 16: case 18: case 14: - case 82: - case 87: + case 83: + case 69: + case 88: case 36: - case 56: + case 57: + case 65: + return true; + default: + return isIdentifier(); + } + } + function isStartOfExpression() { + if (isStartOfLeftHandSideExpression()) { + return true; + } + switch (token) { case 33: case 34: case 47: case 46: - case 73: - case 96: - case 98: + case 74: + case 97: + case 99: case 38: case 39: case 24: - case 64: - case 110: + case 111: return true; default: if (isBinaryOperator()) { @@ -5487,26 +11278,45 @@ var ts; } } function isStartOfExpressionStatement() { - return token !== 14 && token !== 82 && isStartOfExpression(); + return token !== 14 && token !== 83 && token !== 69 && token !== 52 && isStartOfExpression(); } function parseExpression() { + // Expression[in]: + // AssignmentExpression[in] + // Expression[in] , AssignmentExpression[in] + var saveDecoratorContext = inDecoratorContext(); + if (saveDecoratorContext) { + setDecoratorContext(false); + } var expr = parseAssignmentExpressionOrHigher(); var operatorToken; while ((operatorToken = parseOptionalToken(23))) { expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher()); } + if (saveDecoratorContext) { + setDecoratorContext(true); + } return expr; } function parseInitializer(inParameter) { - if (token !== 52) { + if (token !== 53) { if (scanner.hasPrecedingLineBreak() || (inParameter && token === 14) || !isStartOfExpression()) { return undefined; } } - parseExpected(52); + parseExpected(53); return parseAssignmentExpressionOrHigher(); } function parseAssignmentExpressionOrHigher() { + // AssignmentExpression[in,yield]: + // 1) ConditionalExpression[?in,?yield] + // 2) LeftHandSideExpression = AssignmentExpression[?in,?yield] + // 3) LeftHandSideExpression AssignmentOperator AssignmentExpression[?in,?yield] + // 4) ArrowFunctionExpression[?in,?yield] + // 5) [+Yield] YieldExpression[?In] + // + // Note: for ease of implementation we treat productions '2' and '3' as the same thing. + // (i.e. they're both BinaryExpressions with an assignment operator in it). if (isYieldExpression()) { return parseYieldExpression(); } @@ -5515,7 +11325,7 @@ var ts; return arrowExpression; } var expr = parseBinaryExpressionOrHigher(0); - if (expr.kind === 64 && token === 32) { + if (expr.kind === 65 && token === 32) { return parseSimpleArrowFunctionExpression(expr); } if (isLeftHandSideExpression(expr) && isAssignmentOperator(reScanGreaterToken())) { @@ -5524,7 +11334,7 @@ var ts; return parseConditionalExpressionRest(expr); } function isYieldExpression() { - if (token === 110) { + if (token === 111) { if (inYieldContext()) { return true; } @@ -5541,14 +11351,12 @@ var ts; } function nextTokenIsIdentifierOrStartOfDestructuringOnTheSameLine() { nextToken(); - return !scanner.hasPrecedingLineBreak() && - (isIdentifier() || token === 14 || token === 18); + return !scanner.hasPrecedingLineBreak() && (isIdentifier() || token === 14 || token === 18); } function parseYieldExpression() { - var node = createNode(170); + var node = createNode(172); nextToken(); - if (!scanner.hasPrecedingLineBreak() && - (token === 35 || isStartOfExpression())) { + if (!scanner.hasPrecedingLineBreak() && (token === 35 || isStartOfExpression())) { node.asteriskToken = parseOptionalToken(35); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); @@ -5559,14 +11367,16 @@ var ts; } function parseSimpleArrowFunctionExpression(identifier) { ts.Debug.assert(token === 32, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); - var node = createNode(161, identifier.pos); - var parameter = createNode(128, identifier.pos); + var node = createNode(163, identifier.pos); + var parameter = createNode(129, identifier.pos); parameter.name = identifier; finishNode(parameter); - node.parameters = [parameter]; + node.parameters = [ + parameter + ]; node.parameters.pos = parameter.pos; node.parameters.end = parameter.end; - parseExpected(32); + node.equalsGreaterThanToken = parseExpectedToken(32, false, ts.Diagnostics._0_expected, "=>"); node.body = parseArrowFunctionExpressionBody(); return finishNode(node); } @@ -5575,18 +11385,13 @@ var ts; if (triState === 0) { return undefined; } - var arrowFunction = triState === 1 - ? parseParenthesizedArrowFunctionExpressionHead(true) - : tryParse(parsePossibleParenthesizedArrowFunctionExpressionHead); + var arrowFunction = triState === 1 ? parseParenthesizedArrowFunctionExpressionHead(true) : tryParse(parsePossibleParenthesizedArrowFunctionExpressionHead); if (!arrowFunction) { return undefined; } - if (parseExpected(32) || token === 14) { - arrowFunction.body = parseArrowFunctionExpressionBody(); - } - else { - arrowFunction.body = parseIdentifier(); - } + var lastToken = token; + arrowFunction.equalsGreaterThanToken = parseExpectedToken(32, false, ts.Diagnostics._0_expected, "=>"); + arrowFunction.body = (lastToken === 32 || lastToken === 14) ? parseArrowFunctionExpressionBody() : parseIdentifier(); return finishNode(arrowFunction); } function isParenthesizedArrowFunctionExpression() { @@ -5636,7 +11441,7 @@ var ts; return parseParenthesizedArrowFunctionExpressionHead(false); } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNode(161); + var node = createNode(163); fillSignature(51, false, !allowAmbiguity, node); if (!node.parameters) { return undefined; @@ -5650,7 +11455,7 @@ var ts; if (token === 14) { return parseFunctionBlock(false, false); } - if (isStartOfStatement(true) && !isStartOfExpressionStatement() && token !== 82) { + if (isStartOfStatement(true) && !isStartOfExpressionStatement() && token !== 83 && token !== 69) { return parseFunctionBlock(false, true); } return parseAssignmentExpressionOrHigher(); @@ -5660,10 +11465,10 @@ var ts; if (!questionToken) { return leftOperand; } - var node = createNode(168, leftOperand.pos); + var node = createNode(170, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; - node.whenTrue = allowInAnd(parseAssignmentExpressionOrHigher); + node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); node.colonToken = parseExpectedToken(51, false, ts.Diagnostics._0_expected, ts.tokenToString(51)); node.whenFalse = parseAssignmentExpressionOrHigher(); return finishNode(node); @@ -5673,7 +11478,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 85 || t === 124; + return t === 86 || t === 125; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -5682,7 +11487,7 @@ var ts; if (newPrecedence <= precedence) { break; } - if (token === 85 && inDisallowInContext()) { + if (token === 86 && inDisallowInContext()) { break; } leftOperand = makeBinaryExpression(leftOperand, parseTokenNode(), parseBinaryExpressionOrHigher(newPrecedence)); @@ -5690,7 +11495,7 @@ var ts; return leftOperand; } function isBinaryOperator() { - if (inDisallowInContext() && token === 85) { + if (inDisallowInContext() && token === 86) { return false; } return getBinaryOperatorPrecedence() > 0; @@ -5716,8 +11521,8 @@ var ts; case 25: case 26: case 27: + case 87: case 86: - case 85: return 7; case 40: case 41: @@ -5734,33 +11539,33 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(167, left.pos); + var node = createNode(169, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(165); + var node = createNode(167); node.operator = token; nextToken(); node.operand = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(162); + var node = createNode(164); nextToken(); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(163); + var node = createNode(165); nextToken(); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(164); + var node = createNode(166); nextToken(); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); @@ -5774,11 +11579,11 @@ var ts; case 38: case 39: return parsePrefixUnaryExpression(); - case 73: + case 74: return parseDeleteExpression(); - case 96: + case 97: return parseTypeOfExpression(); - case 98: + case 99: return parseVoidExpression(); case 24: return parseTypeAssertion(); @@ -5790,7 +11595,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(isLeftHandSideExpression(expression)); if ((token === 38 || token === 39) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(166, expression.pos); + var node = createNode(168, expression.pos); node.operand = expression; node.operator = token; nextToken(); @@ -5799,9 +11604,7 @@ var ts; return expression; } function parseLeftHandSideExpressionOrHigher() { - var expression = token === 90 - ? parseSuperExpression() - : parseMemberExpressionOrHigher(); + var expression = token === 91 ? parseSuperExpression() : parseMemberExpressionOrHigher(); return parseCallExpressionRest(expression); } function parseMemberExpressionOrHigher() { @@ -5813,14 +11616,14 @@ var ts; if (token === 16 || token === 20) { return expression; } - var node = createNode(153, expression.pos); + var node = createNode(155, 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(158); + var node = createNode(160); parseExpected(24); node.type = parseType(); parseExpected(25); @@ -5831,15 +11634,15 @@ var ts; while (true) { var dotToken = parseOptionalToken(20); if (dotToken) { - var propertyAccess = createNode(153, expression.pos); + var propertyAccess = createNode(155, expression.pos); propertyAccess.expression = expression; propertyAccess.dotToken = dotToken; propertyAccess.name = parseRightSideOfDot(true); expression = finishNode(propertyAccess); continue; } - if (parseOptional(18)) { - var indexedAccess = createNode(154, expression.pos); + if (!inDecoratorContext() && parseOptional(18)) { + var indexedAccess = createNode(156, expression.pos); indexedAccess.expression = expression; if (token !== 19) { indexedAccess.argumentExpression = allowInAnd(parseExpression); @@ -5853,11 +11656,9 @@ var ts; continue; } if (token === 10 || token === 11) { - var tagExpression = createNode(157, expression.pos); + var tagExpression = createNode(159, expression.pos); tagExpression.tag = expression; - tagExpression.template = token === 10 - ? parseLiteralNode() - : parseTemplateExpression(); + tagExpression.template = token === 10 ? parseLiteralNode() : parseTemplateExpression(); expression = finishNode(tagExpression); continue; } @@ -5872,7 +11673,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(155, expression.pos); + var callExpr = createNode(157, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -5880,10 +11681,10 @@ var ts; continue; } else if (token === 16) { - var _callExpr = createNode(155, expression.pos); - _callExpr.expression = expression; - _callExpr.arguments = parseArgumentList(); - expression = finishNode(_callExpr); + var callExpr = createNode(157, expression.pos); + callExpr.expression = expression; + callExpr.arguments = parseArgumentList(); + expression = finishNode(callExpr); continue; } return expression; @@ -5903,9 +11704,7 @@ var ts; if (!parseExpected(25)) { return undefined; } - return typeArguments && canFollowTypeArgumentsInExpression() - ? typeArguments - : undefined; + return typeArguments && canFollowTypeArgumentsInExpression() ? typeArguments : undefined; } function canFollowTypeArgumentsInExpression() { switch (token) { @@ -5915,7 +11714,6 @@ var ts; case 19: case 51: case 22: - case 23: case 50: case 28: case 30: @@ -5929,6 +11727,8 @@ var ts; case 15: case 1: return true; + case 23: + case 14: default: return false; } @@ -5939,11 +11739,11 @@ var ts; case 8: case 10: return parseLiteralNode(); - case 92: - case 90: - case 88: - case 94: - case 79: + case 93: + case 91: + case 89: + case 95: + case 80: return parseTokenNode(); case 16: return parseParenthesizedExpression(); @@ -5951,12 +11751,14 @@ var ts; return parseArrayLiteralExpression(); case 14: return parseObjectLiteralExpression(); - case 82: + case 69: + return parseClassExpression(); + case 83: return parseFunctionExpression(); - case 87: + case 88: return parseNewExpression(); case 36: - case 56: + case 57: if (reScanSlashToken() === 9) { return parseLiteralNode(); } @@ -5967,28 +11769,26 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNode(159); + var node = createNode(161); parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); return finishNode(node); } function parseSpreadElement() { - var node = createNode(171); + var node = createNode(173); parseExpected(21); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { - return token === 21 ? parseSpreadElement() : - token === 23 ? createNode(172) : - parseAssignmentExpressionOrHigher(); + return token === 21 ? parseSpreadElement() : token === 23 ? createNode(175) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { - return allowInAnd(parseArgumentOrArrayLiteralElement); + return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(151); + var node = createNode(153); parseExpected(18); if (scanner.hasPrecedingLineBreak()) node.flags |= 512; @@ -5996,19 +11796,20 @@ var ts; parseExpected(19); return finishNode(node); } - function tryParseAccessorDeclaration(fullStart, modifiers) { - if (parseContextualModifier(115)) { - return parseAccessorDeclaration(134, fullStart, modifiers); + function tryParseAccessorDeclaration(fullStart, decorators, modifiers) { + if (parseContextualModifier(116)) { + return parseAccessorDeclaration(136, fullStart, decorators, modifiers); } - else if (parseContextualModifier(119)) { - return parseAccessorDeclaration(135, fullStart, modifiers); + else if (parseContextualModifier(120)) { + return parseAccessorDeclaration(137, fullStart, decorators, modifiers); } return undefined; } function parseObjectLiteralElement() { var fullStart = scanner.getStartPos(); + var decorators = parseDecorators(); var modifiers = parseModifiers(); - var accessor = tryParseAccessorDeclaration(fullStart, modifiers); + var accessor = tryParseAccessorDeclaration(fullStart, decorators, modifiers); if (accessor) { return accessor; } @@ -6018,16 +11819,16 @@ var ts; var propertyName = parsePropertyName(); var questionToken = parseOptionalToken(50); if (asteriskToken || token === 16 || token === 24) { - return parseMethodDeclaration(fullStart, modifiers, asteriskToken, propertyName, questionToken); + return parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, propertyName, questionToken); } if ((token === 23 || token === 15) && tokenIsIdentifier) { - var shorthandDeclaration = createNode(219, fullStart); + var shorthandDeclaration = createNode(225, fullStart); shorthandDeclaration.name = propertyName; shorthandDeclaration.questionToken = questionToken; return finishNode(shorthandDeclaration); } else { - var propertyAssignment = createNode(218, fullStart); + var propertyAssignment = createNode(224, fullStart); propertyAssignment.name = propertyName; propertyAssignment.questionToken = questionToken; parseExpected(51); @@ -6036,7 +11837,7 @@ var ts; } } function parseObjectLiteralExpression() { - var node = createNode(152); + var node = createNode(154); parseExpected(14); if (scanner.hasPrecedingLineBreak()) { node.flags |= 512; @@ -6046,20 +11847,27 @@ var ts; return finishNode(node); } function parseFunctionExpression() { - var node = createNode(160); - parseExpected(82); + var saveDecoratorContext = inDecoratorContext(); + if (saveDecoratorContext) { + setDecoratorContext(false); + } + var node = createNode(162); + parseExpected(83); node.asteriskToken = parseOptionalToken(35); node.name = node.asteriskToken ? doInYieldContext(parseOptionalIdentifier) : parseOptionalIdentifier(); fillSignature(51, !!node.asteriskToken, false, node); node.body = parseFunctionBlock(!!node.asteriskToken, false); + if (saveDecoratorContext) { + setDecoratorContext(true); + } return finishNode(node); } function parseOptionalIdentifier() { return isIdentifier() ? parseIdentifier() : undefined; } function parseNewExpression() { - var node = createNode(156); - parseExpected(87); + var node = createNode(158); + parseExpected(88); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); if (node.typeArguments || token === 16) { @@ -6068,7 +11876,7 @@ var ts; return finishNode(node); } function parseBlock(ignoreMissingOpenBrace, checkForStrictMode, diagnosticMessage) { - var node = createNode(174); + var node = createNode(179); if (parseExpected(14, diagnosticMessage) || ignoreMissingOpenBrace) { node.statements = parseList(2, checkForStrictMode, parseStatement); parseExpected(15); @@ -6081,30 +11889,37 @@ var ts; function parseFunctionBlock(allowYield, ignoreMissingOpenBrace, diagnosticMessage) { var savedYieldContext = inYieldContext(); setYieldContext(allowYield); + var saveDecoratorContext = inDecoratorContext(); + if (saveDecoratorContext) { + setDecoratorContext(false); + } var block = parseBlock(ignoreMissingOpenBrace, true, diagnosticMessage); + if (saveDecoratorContext) { + setDecoratorContext(true); + } setYieldContext(savedYieldContext); return block; } function parseEmptyStatement() { - var node = createNode(176); + var node = createNode(181); parseExpected(22); return finishNode(node); } function parseIfStatement() { - var node = createNode(178); - parseExpected(83); + var node = createNode(183); + parseExpected(84); parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); node.thenStatement = parseStatement(); - node.elseStatement = parseOptional(75) ? parseStatement() : undefined; + node.elseStatement = parseOptional(76) ? parseStatement() : undefined; return finishNode(node); } function parseDoStatement() { - var node = createNode(179); - parseExpected(74); + var node = createNode(184); + parseExpected(75); node.statement = parseStatement(); - parseExpected(99); + parseExpected(100); parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); @@ -6112,8 +11927,8 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(180); - parseExpected(99); + var node = createNode(185); + parseExpected(100); parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); @@ -6122,11 +11937,11 @@ var ts; } function parseForOrForInOrForOfStatement() { var pos = getNodePos(); - parseExpected(81); + parseExpected(82); parseExpected(16); var initializer = undefined; if (token !== 22) { - if (token === 97 || token === 104 || token === 69) { + if (token === 98 || token === 105 || token === 70) { initializer = parseVariableDeclarationList(true); } else { @@ -6134,22 +11949,22 @@ var ts; } } var forOrForInOrForOfStatement; - if (parseOptional(85)) { - var forInStatement = createNode(182, pos); + if (parseOptional(86)) { + var forInStatement = createNode(187, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(17); forOrForInOrForOfStatement = forInStatement; } - else if (parseOptional(124)) { - var forOfStatement = createNode(183, pos); + else if (parseOptional(125)) { + var forOfStatement = createNode(188, pos); forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(17); forOrForInOrForOfStatement = forOfStatement; } else { - var forStatement = createNode(181, pos); + var forStatement = createNode(186, pos); forStatement.initializer = initializer; parseExpected(22); if (token !== 22 && token !== 17) { @@ -6167,7 +11982,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 185 ? 65 : 70); + parseExpected(kind === 190 ? 66 : 71); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -6175,8 +11990,8 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(186); - parseExpected(89); + var node = createNode(191); + parseExpected(90); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); } @@ -6184,8 +11999,8 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(187); - parseExpected(100); + var node = createNode(192); + parseExpected(101); parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); @@ -6193,30 +12008,30 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(214); - parseExpected(66); + var node = createNode(220); + parseExpected(67); node.expression = allowInAnd(parseExpression); parseExpected(51); node.statements = parseList(4, false, parseStatement); return finishNode(node); } function parseDefaultClause() { - var node = createNode(215); - parseExpected(72); + var node = createNode(221); + parseExpected(73); parseExpected(51); node.statements = parseList(4, false, parseStatement); return finishNode(node); } function parseCaseOrDefaultClause() { - return token === 66 ? parseCaseClause() : parseDefaultClause(); + return token === 67 ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(188); - parseExpected(91); + var node = createNode(193); + parseExpected(92); parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); - var caseBlock = createNode(202, scanner.getStartPos()); + var caseBlock = createNode(207, scanner.getStartPos()); parseExpected(14); caseBlock.clauses = parseList(3, false, parseCaseOrDefaultClause); parseExpected(15); @@ -6224,26 +12039,28 @@ var ts; return finishNode(node); } function parseThrowStatement() { - var node = createNode(190); - parseExpected(93); + // ThrowStatement[Yield] : + // throw [no LineTerminator here]Expression[In, ?Yield]; + var node = createNode(195); + parseExpected(94); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); return finishNode(node); } function parseTryStatement() { - var node = createNode(191); - parseExpected(95); + var node = createNode(196); + parseExpected(96); node.tryBlock = parseBlock(false, false); - node.catchClause = token === 67 ? parseCatchClause() : undefined; - if (!node.catchClause || token === 80) { - parseExpected(80); + node.catchClause = token === 68 ? parseCatchClause() : undefined; + if (!node.catchClause || token === 81) { + parseExpected(81); node.finallyBlock = parseBlock(false, false); } return finishNode(node); } function parseCatchClause() { - var result = createNode(217); - parseExpected(67); + var result = createNode(223); + parseExpected(68); if (parseExpected(16)) { result.variableDeclaration = parseVariableDeclaration(); } @@ -6252,22 +12069,22 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(192); - parseExpected(71); + var node = createNode(197); + parseExpected(72); parseSemicolon(); return finishNode(node); } function parseExpressionOrLabeledStatement() { var fullStart = scanner.getStartPos(); var expression = allowInAnd(parseExpression); - if (expression.kind === 64 && parseOptional(51)) { - var labeledStatement = createNode(189, fullStart); + if (expression.kind === 65 && parseOptional(51)) { + var labeledStatement = createNode(194, fullStart); labeledStatement.label = expression; labeledStatement.statement = parseStatement(); return finishNode(labeledStatement); } else { - var expressionStatement = createNode(177, fullStart); + var expressionStatement = createNode(182, fullStart); expressionStatement.expression = expression; parseSemicolon(); return finishNode(expressionStatement); @@ -6275,7 +12092,7 @@ var ts; } function isStartOfStatement(inErrorRecovery) { if (ts.isModifier(token)) { - var result = lookAhead(parseVariableStatementOrFunctionDeclarationWithModifiers); + var result = lookAhead(parseVariableStatementOrFunctionDeclarationOrClassDeclarationWithDecoratorsOrModifiers); if (result) { return true; } @@ -6284,39 +12101,39 @@ var ts; case 22: return !inErrorRecovery; case 14: - case 97: - case 104: - case 82: + case 98: + case 105: case 83: - case 74: - case 99: - case 81: - case 70: - case 65: - case 89: - case 100: - case 91: - case 93: - case 95: - case 71: - case 67: - case 80: - return true; case 69: + case 84: + case 75: + case 100: + case 82: + case 71: + case 66: + case 90: + case 101: + case 92: + case 94: + case 96: + case 72: + case 68: + case 81: + return true; + case 70: var isConstEnum = lookAhead(nextTokenIsEnumKeyword); return !isConstEnum; - case 103: - case 68: - case 116: - case 76: - case 122: + case 104: + case 117: + case 77: + case 123: if (isDeclarationStart()) { return false; } - case 108: - case 106: - case 107: case 109: + case 107: + case 108: + case 110: if (lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine)) { return false; } @@ -6326,7 +12143,7 @@ var ts; } function nextTokenIsEnumKeyword() { nextToken(); - return token === 76; + return token === 77; } function nextTokenIsIdentifierOrKeywordOnSameLine() { nextToken(); @@ -6336,46 +12153,48 @@ var ts; switch (token) { case 14: return parseBlock(false, false); - case 97: + case 98: + case 70: + return parseVariableStatement(scanner.getStartPos(), undefined, undefined); + case 83: + return parseFunctionDeclaration(scanner.getStartPos(), undefined, undefined); case 69: - return parseVariableStatement(scanner.getStartPos(), undefined); - case 82: - return parseFunctionDeclaration(scanner.getStartPos(), undefined); + return parseClassDeclaration(scanner.getStartPos(), undefined, undefined); case 22: return parseEmptyStatement(); - case 83: + case 84: return parseIfStatement(); - case 74: + case 75: return parseDoStatement(); - case 99: - return parseWhileStatement(); - case 81: - return parseForOrForInOrForOfStatement(); - case 70: - return parseBreakOrContinueStatement(184); - case 65: - return parseBreakOrContinueStatement(185); - case 89: - return parseReturnStatement(); case 100: - return parseWithStatement(); - case 91: - return parseSwitchStatement(); - case 93: - return parseThrowStatement(); - case 95: - case 67: - case 80: - return parseTryStatement(); + return parseWhileStatement(); + case 82: + return parseForOrForInOrForOfStatement(); case 71: + return parseBreakOrContinueStatement(189); + case 66: + return parseBreakOrContinueStatement(190); + case 90: + return parseReturnStatement(); + case 101: + return parseWithStatement(); + case 92: + return parseSwitchStatement(); + case 94: + return parseThrowStatement(); + case 96: + case 68: + case 81: + return parseTryStatement(); + case 72: return parseDebuggerStatement(); - case 104: + case 105: if (isLetDeclaration()) { - return parseVariableStatement(scanner.getStartPos(), undefined); + return parseVariableStatement(scanner.getStartPos(), undefined, undefined); } default: - if (ts.isModifier(token)) { - var result = tryParse(parseVariableStatementOrFunctionDeclarationWithModifiers); + if (ts.isModifier(token) || token === 52) { + var result = tryParse(parseVariableStatementOrFunctionDeclarationOrClassDeclarationWithDecoratorsOrModifiers); if (result) { return result; } @@ -6383,25 +12202,28 @@ var ts; return parseExpressionOrLabeledStatement(); } } - function parseVariableStatementOrFunctionDeclarationWithModifiers() { + function parseVariableStatementOrFunctionDeclarationOrClassDeclarationWithDecoratorsOrModifiers() { var start = scanner.getStartPos(); + var decorators = parseDecorators(); var modifiers = parseModifiers(); switch (token) { - case 69: + case 70: var nextTokenIsEnum = lookAhead(nextTokenIsEnumKeyword); if (nextTokenIsEnum) { return undefined; } - return parseVariableStatement(start, modifiers); - case 104: + return parseVariableStatement(start, decorators, modifiers); + case 105: if (!isLetDeclaration()) { return undefined; } - return parseVariableStatement(start, modifiers); - case 97: - return parseVariableStatement(start, modifiers); - case 82: - return parseFunctionDeclaration(start, modifiers); + return parseVariableStatement(start, decorators, modifiers); + case 98: + return parseVariableStatement(start, decorators, modifiers); + case 83: + return parseFunctionDeclaration(start, decorators, modifiers); + case 69: + return parseClassDeclaration(start, decorators, modifiers); } return undefined; } @@ -6414,18 +12236,18 @@ var ts; } function parseArrayBindingElement() { if (token === 23) { - return createNode(172); + return createNode(175); } - var node = createNode(150); + var node = createNode(152); node.dotDotDotToken = parseOptionalToken(21); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(false); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(150); + var node = createNode(152); var id = parsePropertyName(); - if (id.kind === 64 && token !== 51) { + if (id.kind === 65 && token !== 51) { node.name = id; } else { @@ -6437,14 +12259,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(148); + var node = createNode(150); parseExpected(14); node.elements = parseDelimitedList(10, parseObjectBindingElement); parseExpected(15); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(149); + var node = createNode(151); parseExpected(18); node.elements = parseDelimitedList(11, parseArrayBindingElement); parseExpected(19); @@ -6463,7 +12285,7 @@ var ts; return parseIdentifier(); } function parseVariableDeclaration() { - var node = createNode(193); + var node = createNode(198); node.name = parseIdentifierOrPattern(); node.type = parseTypeAnnotation(); if (!isInOrOfKeyword(token)) { @@ -6472,21 +12294,21 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(194); + var node = createNode(199); switch (token) { - case 97: + case 98: break; - case 104: + case 105: node.flags |= 4096; break; - case 69: + case 70: node.flags |= 8192; break; default: ts.Debug.fail(); } nextToken(); - if (token === 124 && lookAhead(canFollowContextualOfKeyword)) { + if (token === 125 && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -6500,33 +12322,37 @@ var ts; function canFollowContextualOfKeyword() { return nextTokenIsIdentifier() && nextToken() === 17; } - function parseVariableStatement(fullStart, modifiers) { - var node = createNode(175, fullStart); + function parseVariableStatement(fullStart, decorators, modifiers) { + var node = createNode(180, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); node.declarationList = parseVariableDeclarationList(false); parseSemicolon(); return finishNode(node); } - function parseFunctionDeclaration(fullStart, modifiers) { - var node = createNode(195, fullStart); + function parseFunctionDeclaration(fullStart, decorators, modifiers) { + var node = createNode(200, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(82); + parseExpected(83); node.asteriskToken = parseOptionalToken(35); node.name = node.flags & 256 ? parseOptionalIdentifier() : parseIdentifier(); fillSignature(51, !!node.asteriskToken, false, node); node.body = parseFunctionBlockOrSemicolon(!!node.asteriskToken, ts.Diagnostics.or_expected); return finishNode(node); } - function parseConstructorDeclaration(pos, modifiers) { - var node = createNode(133, pos); + function parseConstructorDeclaration(pos, decorators, modifiers) { + var node = createNode(135, pos); + node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(113); + parseExpected(114); fillSignature(51, false, false, node); node.body = parseFunctionBlockOrSemicolon(false, ts.Diagnostics.or_expected); return finishNode(node); } - function parseMethodDeclaration(fullStart, modifiers, asteriskToken, name, questionToken, diagnosticMessage) { - var method = createNode(132, fullStart); + function parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, diagnosticMessage) { + var method = createNode(134, fullStart); + method.decorators = decorators; setModifiers(method, modifiers); method.asteriskToken = asteriskToken; method.name = name; @@ -6535,29 +12361,34 @@ var ts; method.body = parseFunctionBlockOrSemicolon(!!asteriskToken, diagnosticMessage); return finishNode(method); } - function parsePropertyOrMethodDeclaration(fullStart, modifiers) { + function parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken) { + var property = createNode(132, fullStart); + property.decorators = decorators; + setModifiers(property, modifiers); + property.name = name; + property.questionToken = questionToken; + property.type = parseTypeAnnotation(); + property.initializer = allowInAnd(parseNonParameterInitializer); + parseSemicolon(); + return finishNode(property); + } + function parsePropertyOrMethodDeclaration(fullStart, decorators, modifiers) { var asteriskToken = parseOptionalToken(35); - var _name = parsePropertyName(); + var name = parsePropertyName(); var questionToken = parseOptionalToken(50); if (asteriskToken || token === 16 || token === 24) { - return parseMethodDeclaration(fullStart, modifiers, asteriskToken, _name, questionToken, ts.Diagnostics.or_expected); + return parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, ts.Diagnostics.or_expected); } else { - var property = createNode(130, fullStart); - setModifiers(property, modifiers); - property.name = _name; - property.questionToken = questionToken; - property.type = parseTypeAnnotation(); - property.initializer = allowInAnd(parseNonParameterInitializer); - parseSemicolon(); - return finishNode(property); + return parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken); } } function parseNonParameterInitializer() { return parseInitializer(false); } - function parseAccessorDeclaration(kind, fullStart, modifiers) { + function parseAccessorDeclaration(kind, fullStart, decorators, modifiers) { var node = createNode(kind, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); node.name = parsePropertyName(); fillSignature(51, false, false, node); @@ -6566,6 +12397,9 @@ var ts; } function isClassMemberStart() { var idToken; + if (token === 52) { + return true; + } while (ts.isModifier(token)) { idToken = token; nextToken(); @@ -6581,14 +12415,14 @@ var ts; return true; } if (idToken !== undefined) { - if (!ts.isKeyword(idToken) || idToken === 119 || idToken === 115) { + if (!ts.isKeyword(idToken) || idToken === 120 || idToken === 116) { return true; } switch (token) { case 16: case 24: case 51: - case 52: + case 53: case 50: return true; default: @@ -6597,6 +12431,26 @@ var ts; } return false; } + function parseDecorators() { + var decorators; + while (true) { + var decoratorStart = getNodePos(); + if (!parseOptional(52)) { + break; + } + if (!decorators) { + decorators = []; + decorators.pos = scanner.getStartPos(); + } + var decorator = createNode(130, decoratorStart); + decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); + decorators.push(finishNode(decorator)); + } + if (decorators) { + decorators.end = getNodeEnd(); + } + return decorators; + } function parseModifiers() { var flags = 0; var modifiers; @@ -6620,50 +12474,68 @@ var ts; return modifiers; } function parseClassElement() { + if (token === 22) { + var result = createNode(178); + nextToken(); + return finishNode(result); + } var fullStart = getNodePos(); + var decorators = parseDecorators(); var modifiers = parseModifiers(); - var accessor = tryParseAccessorDeclaration(fullStart, modifiers); + var accessor = tryParseAccessorDeclaration(fullStart, decorators, modifiers); if (accessor) { return accessor; } - if (token === 113) { - return parseConstructorDeclaration(fullStart, modifiers); + if (token === 114) { + return parseConstructorDeclaration(fullStart, decorators, modifiers); } if (isIndexSignature()) { - return parseIndexSignatureDeclaration(modifiers); + return parseIndexSignatureDeclaration(fullStart, decorators, modifiers); } - if (isIdentifierOrKeyword() || - token === 8 || - token === 7 || - token === 35 || - token === 18) { - return parsePropertyOrMethodDeclaration(fullStart, modifiers); + if (isIdentifierOrKeyword() || token === 8 || token === 7 || token === 35 || token === 18) { + return parsePropertyOrMethodDeclaration(fullStart, decorators, modifiers); + } + if (decorators) { + var name_3 = createMissingNode(65, true, ts.Diagnostics.Declaration_expected); + return parsePropertyDeclaration(fullStart, decorators, modifiers, name_3, undefined); } ts.Debug.fail("Should not have attempted to parse class member declaration."); } - function parseClassDeclaration(fullStart, modifiers) { - var node = createNode(196, fullStart); + function parseClassExpression() { + return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 174); + } + function parseClassDeclaration(fullStart, decorators, modifiers) { + return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 201); + } + function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) { + var savedStrictModeContext = inStrictModeContext(); + if (languageVersion >= 2) { + setStrictModeContext(true); + } + var node = createNode(kind, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(68); + parseExpected(69); node.name = node.flags & 256 ? parseOptionalIdentifier() : parseIdentifier(); node.typeParameters = parseTypeParameters(); node.heritageClauses = parseHeritageClauses(true); if (parseExpected(14)) { - node.members = inGeneratorParameterContext() - ? doOutsideOfYieldContext(parseClassMembers) - : parseClassMembers(); + node.members = inGeneratorParameterContext() ? doOutsideOfYieldContext(parseClassMembers) : parseClassMembers(); parseExpected(15); } else { node.members = createMissingList(); } - return finishNode(node); + var finishedNode = finishNode(node); + setStrictModeContext(savedStrictModeContext); + return finishedNode; } function parseHeritageClauses(isClassHeritageClause) { + // ClassTail[Yield,GeneratorParameter] : See 14.5 + // [~GeneratorParameter]ClassHeritage[?Yield]opt { ClassBody[?Yield]opt } + // [+GeneratorParameter] ClassHeritageopt { ClassBodyopt } if (isHeritageClause()) { - return isClassHeritageClause && inGeneratorParameterContext() - ? doOutsideOfYieldContext(parseHeritageClausesWorker) - : parseHeritageClausesWorker(); + return isClassHeritageClause && inGeneratorParameterContext() ? doOutsideOfYieldContext(parseHeritageClausesWorker) : parseHeritageClausesWorker(); } return undefined; } @@ -6671,51 +12543,62 @@ var ts; return parseList(19, false, parseHeritageClause); } function parseHeritageClause() { - if (token === 78 || token === 102) { - var node = createNode(216); + if (token === 79 || token === 103) { + var node = createNode(222); node.token = token; nextToken(); - node.types = parseDelimitedList(8, parseTypeReference); + node.types = parseDelimitedList(8, parseHeritageClauseElement); return finishNode(node); } return undefined; } + function parseHeritageClauseElement() { + var node = createNode(177); + node.expression = parseLeftHandSideExpressionOrHigher(); + if (token === 24) { + node.typeArguments = parseBracketedList(17, parseType, 24, 25); + } + return finishNode(node); + } function isHeritageClause() { - return token === 78 || token === 102; + return token === 79 || token === 103; } function parseClassMembers() { return parseList(6, false, parseClassElement); } - function parseInterfaceDeclaration(fullStart, modifiers) { - var node = createNode(197, fullStart); + function parseInterfaceDeclaration(fullStart, decorators, modifiers) { + var node = createNode(202, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(103); + parseExpected(104); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); node.heritageClauses = parseHeritageClauses(false); node.members = parseObjectTypeMembers(); return finishNode(node); } - function parseTypeAliasDeclaration(fullStart, modifiers) { - var node = createNode(198, fullStart); + function parseTypeAliasDeclaration(fullStart, decorators, modifiers) { + var node = createNode(203, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(122); + parseExpected(123); node.name = parseIdentifier(); - parseExpected(52); + parseExpected(53); node.type = parseType(); parseSemicolon(); return finishNode(node); } function parseEnumMember() { - var node = createNode(220, scanner.getStartPos()); + var node = createNode(226, scanner.getStartPos()); node.name = parsePropertyName(); node.initializer = allowInAnd(parseNonParameterInitializer); return finishNode(node); } - function parseEnumDeclaration(fullStart, modifiers) { - var node = createNode(199, fullStart); + function parseEnumDeclaration(fullStart, decorators, modifiers) { + var node = createNode(204, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(76); + parseExpected(77); node.name = parseIdentifier(); if (parseExpected(14)) { node.members = parseDelimitedList(7, parseEnumMember); @@ -6727,7 +12610,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(201, scanner.getStartPos()); + var node = createNode(206, scanner.getStartPos()); if (parseExpected(14)) { node.statements = parseList(1, false, parseModuleElement); parseExpected(15); @@ -6737,88 +12620,87 @@ var ts; } return finishNode(node); } - function parseInternalModuleTail(fullStart, modifiers, flags) { - var node = createNode(200, fullStart); + function parseInternalModuleTail(fullStart, decorators, modifiers, flags) { + var node = createNode(205, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); node.flags |= flags; node.name = parseIdentifier(); - node.body = parseOptional(20) - ? parseInternalModuleTail(getNodePos(), undefined, 1) - : parseModuleBlock(); + node.body = parseOptional(20) ? parseInternalModuleTail(getNodePos(), undefined, undefined, 1) : parseModuleBlock(); return finishNode(node); } - function parseAmbientExternalModuleDeclaration(fullStart, modifiers) { - var node = createNode(200, fullStart); + function parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) { + var node = createNode(205, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); node.name = parseLiteralNode(true); node.body = parseModuleBlock(); return finishNode(node); } - function parseModuleDeclaration(fullStart, modifiers) { - parseExpected(116); - return token === 8 - ? parseAmbientExternalModuleDeclaration(fullStart, modifiers) - : parseInternalModuleTail(fullStart, modifiers, modifiers ? modifiers.flags : 0); + function parseModuleDeclaration(fullStart, decorators, modifiers) { + parseExpected(117); + return token === 8 ? parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) : parseInternalModuleTail(fullStart, decorators, modifiers, modifiers ? modifiers.flags : 0); } function isExternalModuleReference() { - return token === 117 && - lookAhead(nextTokenIsOpenParen); + return token === 118 && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { return nextToken() === 16; } function nextTokenIsCommaOrFromKeyword() { nextToken(); - return token === 23 || - token === 123; + return token === 23 || token === 124; } - function parseImportDeclarationOrImportEqualsDeclaration(fullStart, modifiers) { - parseExpected(84); + function parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers) { + parseExpected(85); var afterImportPos = scanner.getStartPos(); var identifier; if (isIdentifier()) { identifier = parseIdentifier(); - if (token !== 23 && token !== 123) { - var importEqualsDeclaration = createNode(203, fullStart); + if (token !== 23 && token !== 124) { + var importEqualsDeclaration = createNode(208, fullStart); + importEqualsDeclaration.decorators = decorators; setModifiers(importEqualsDeclaration, modifiers); importEqualsDeclaration.name = identifier; - parseExpected(52); + parseExpected(53); importEqualsDeclaration.moduleReference = parseModuleReference(); parseSemicolon(); return finishNode(importEqualsDeclaration); } } - var importDeclaration = createNode(204, fullStart); + var importDeclaration = createNode(209, fullStart); + importDeclaration.decorators = decorators; setModifiers(importDeclaration, modifiers); - if (identifier || - token === 35 || - token === 14) { + if (identifier || token === 35 || token === 14) { importDeclaration.importClause = parseImportClause(identifier, afterImportPos); - parseExpected(123); + parseExpected(124); } importDeclaration.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); return finishNode(importDeclaration); } function parseImportClause(identifier, fullStart) { - var importClause = createNode(205, fullStart); + //ImportClause: + // ImportedDefaultBinding + // NameSpaceImport + // NamedImports + // ImportedDefaultBinding, NameSpaceImport + // ImportedDefaultBinding, NamedImports + var importClause = createNode(210, fullStart); if (identifier) { importClause.name = identifier; } - if (!importClause.name || - parseOptional(23)) { - importClause.namedBindings = token === 35 ? parseNamespaceImport() : parseNamedImportsOrExports(207); + if (!importClause.name || parseOptional(23)) { + importClause.namedBindings = token === 35 ? parseNamespaceImport() : parseNamedImportsOrExports(212); } return finishNode(importClause); } function parseModuleReference() { - return isExternalModuleReference() - ? parseExternalModuleReference() - : parseEntityName(false); + return isExternalModuleReference() ? parseExternalModuleReference() : parseEntityName(false); } function parseExternalModuleReference() { - var node = createNode(213); - parseExpected(117); + var node = createNode(219); + parseExpected(118); parseExpected(16); node.expression = parseModuleSpecifier(); parseExpected(17); @@ -6832,107 +12714,116 @@ var ts; return result; } function parseNamespaceImport() { - var namespaceImport = createNode(206); + var namespaceImport = createNode(211); parseExpected(35); - parseExpected(101); + parseExpected(102); namespaceImport.name = parseIdentifier(); return finishNode(namespaceImport); } function parseNamedImportsOrExports(kind) { var node = createNode(kind); - node.elements = parseBracketedList(20, kind === 207 ? parseImportSpecifier : parseExportSpecifier, 14, 15); + node.elements = parseBracketedList(20, kind === 212 ? parseImportSpecifier : parseExportSpecifier, 14, 15); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(212); + return parseImportOrExportSpecifier(217); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(208); + return parseImportOrExportSpecifier(213); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); - var isFirstIdentifierNameNotAnIdentifier = ts.isKeyword(token) && !isIdentifier(); - var start = scanner.getTokenPos(); + var checkIdentifierIsKeyword = ts.isKeyword(token) && !isIdentifier(); + var checkIdentifierStart = scanner.getTokenPos(); + var checkIdentifierEnd = scanner.getTextPos(); var identifierName = parseIdentifierName(); - if (token === 101) { + if (token === 102) { node.propertyName = identifierName; - parseExpected(101); - if (isIdentifier()) { - node.name = parseIdentifierName(); - } - else { - parseErrorAtCurrentToken(ts.Diagnostics.Identifier_expected); - } + parseExpected(102); + checkIdentifierIsKeyword = ts.isKeyword(token) && !isIdentifier(); + checkIdentifierStart = scanner.getTokenPos(); + checkIdentifierEnd = scanner.getTextPos(); + node.name = parseIdentifierName(); } else { node.name = identifierName; - if (isFirstIdentifierNameNotAnIdentifier) { - parseErrorAtPosition(start, identifierName.end - start, ts.Diagnostics.Identifier_expected); - } + } + if (kind === 213 && checkIdentifierIsKeyword) { + parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } - function parseExportDeclaration(fullStart, modifiers) { - var node = createNode(210, fullStart); + function parseExportDeclaration(fullStart, decorators, modifiers) { + var node = createNode(215, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); if (parseOptional(35)) { - parseExpected(123); + parseExpected(124); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(211); - if (parseOptional(123)) { + node.exportClause = parseNamedImportsOrExports(216); + if (parseOptional(124)) { node.moduleSpecifier = parseModuleSpecifier(); } } parseSemicolon(); return finishNode(node); } - function parseExportAssignment(fullStart, modifiers) { - var node = createNode(209, fullStart); + function parseExportAssignment(fullStart, decorators, modifiers) { + var node = createNode(214, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); - if (parseOptional(52)) { + if (parseOptional(53)) { node.isExportEquals = true; + node.expression = parseAssignmentExpressionOrHigher(); } else { - parseExpected(72); + parseExpected(73); + if (parseOptional(51)) { + node.type = parseType(); + } + else { + node.expression = parseAssignmentExpressionOrHigher(); + } } - node.expression = parseAssignmentExpressionOrHigher(); parseSemicolon(); return finishNode(node); } function isLetDeclaration() { return inStrictModeContext() || lookAhead(nextTokenIsIdentifierOrStartOfDestructuringOnTheSameLine); } - function isDeclarationStart() { + function isDeclarationStart(followsModifier) { switch (token) { - case 97: - case 69: - case 82: + case 98: + case 70: + case 83: return true; - case 104: + case 105: return isLetDeclaration(); - case 68: - case 103: - case 76: - case 122: - return lookAhead(nextTokenIsIdentifierOrKeyword); - case 84: - return lookAhead(nextTokenCanFollowImportKeyword); - case 116: - return lookAhead(nextTokenIsIdentifierOrKeywordOrStringLiteral); + case 69: + case 104: case 77: + case 123: + return lookAhead(nextTokenIsIdentifierOrKeyword); + case 85: + return lookAhead(nextTokenCanFollowImportKeyword); + case 117: + return lookAhead(nextTokenIsIdentifierOrKeywordOrStringLiteral); + case 78: return lookAhead(nextTokenCanFollowExportKeyword); - case 114: - case 108: - case 106: - case 107: + case 115: case 109: + case 107: + case 108: + case 110: return lookAhead(nextTokenIsDeclarationStart); + case 52: + return !followsModifier; } } function isIdentifierOrKeyword() { - return token >= 64; + return token >= 65; } function nextTokenIsIdentifierOrKeyword() { nextToken(); @@ -6944,53 +12835,59 @@ var ts; } function nextTokenCanFollowImportKeyword() { nextToken(); - return isIdentifierOrKeyword() || token === 8 || - token === 35 || token === 14; + return isIdentifierOrKeyword() || token === 8 || token === 35 || token === 14; } function nextTokenCanFollowExportKeyword() { nextToken(); - return token === 52 || token === 35 || - token === 14 || token === 72 || isDeclarationStart(); + return token === 53 || token === 35 || token === 14 || token === 73 || isDeclarationStart(true); } function nextTokenIsDeclarationStart() { nextToken(); - return isDeclarationStart(); + return isDeclarationStart(true); } function nextTokenIsAsKeyword() { - return nextToken() === 101; + return nextToken() === 102; } function parseDeclaration() { var fullStart = getNodePos(); + var decorators = parseDecorators(); var modifiers = parseModifiers(); - if (token === 77) { + if (token === 78) { nextToken(); - if (token === 72 || token === 52) { - return parseExportAssignment(fullStart, modifiers); + if (token === 73 || token === 53) { + return parseExportAssignment(fullStart, decorators, modifiers); } if (token === 35 || token === 14) { - return parseExportDeclaration(fullStart, modifiers); + return parseExportDeclaration(fullStart, decorators, modifiers); } } switch (token) { - case 97: - case 104: + case 98: + case 105: + case 70: + return parseVariableStatement(fullStart, decorators, modifiers); + case 83: + return parseFunctionDeclaration(fullStart, decorators, modifiers); case 69: - return parseVariableStatement(fullStart, modifiers); - case 82: - return parseFunctionDeclaration(fullStart, modifiers); - case 68: - return parseClassDeclaration(fullStart, modifiers); - case 103: - return parseInterfaceDeclaration(fullStart, modifiers); - case 122: - return parseTypeAliasDeclaration(fullStart, modifiers); - case 76: - return parseEnumDeclaration(fullStart, modifiers); - case 116: - return parseModuleDeclaration(fullStart, modifiers); - case 84: - return parseImportDeclarationOrImportEqualsDeclaration(fullStart, modifiers); + return parseClassDeclaration(fullStart, decorators, modifiers); + case 104: + return parseInterfaceDeclaration(fullStart, decorators, modifiers); + case 123: + return parseTypeAliasDeclaration(fullStart, decorators, modifiers); + case 77: + return parseEnumDeclaration(fullStart, decorators, modifiers); + case 117: + return parseModuleDeclaration(fullStart, decorators, modifiers); + case 85: + return parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers); default: + if (decorators) { + var node = createMissingNode(218, true, ts.Diagnostics.Declaration_expected); + node.pos = fullStart; + node.decorators = decorators; + setModifiers(node, modifiers); + return finishNode(node); + } ts.Debug.fail("Mismatch between isDeclarationStart and parseDeclaration"); } } @@ -7004,9 +12901,7 @@ var ts; return parseSourceElementOrModuleElement(); } function parseSourceElementOrModuleElement() { - return isDeclarationStart() - ? parseDeclaration() - : parseStatement(); + return isDeclarationStart() ? parseDeclaration() : parseStatement(); } function processReferenceComments(sourceFile) { var triviaScanner = ts.createScanner(sourceFile.languageVersion, false, sourceText); @@ -7021,7 +12916,10 @@ var ts; if (kind !== 2) { break; } - var range = { pos: triviaScanner.getTokenPos(), end: triviaScanner.getTextPos() }; + var range = { + pos: triviaScanner.getTokenPos(), + end: triviaScanner.getTextPos() + }; var comment = sourceText.substring(range.pos, range.end); var referencePathMatchResult = ts.getFileReferenceFromReferencePath(comment, range); if (referencePathMatchResult) { @@ -7052,7 +12950,10 @@ var ts; var pathMatchResult = pathRegex.exec(comment); var nameMatchResult = nameRegex.exec(comment); if (pathMatchResult) { - var amdDependency = { path: pathMatchResult[2], name: nameMatchResult ? nameMatchResult[2] : undefined }; + var amdDependency = { + path: pathMatchResult[2], + name: nameMatchResult ? nameMatchResult[2] : undefined + }; amdDependencies.push(amdDependency); } } @@ -7064,39 +12965,34 @@ var ts; } function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { - return node.flags & 1 - || node.kind === 203 && node.moduleReference.kind === 213 - || node.kind === 204 - || node.kind === 209 - || node.kind === 210 - ? node - : undefined; + return node.flags & 1 || node.kind === 208 && node.moduleReference.kind === 219 || node.kind === 209 || node.kind === 214 || node.kind === 215 ? node : undefined; }); } } function isLeftHandSideExpression(expr) { if (expr) { switch (expr.kind) { - case 153: - case 154: - case 156: case 155: + case 156: + case 158: case 157: - case 151: case 159: - case 152: - case 160: - case 64: + case 153: + case 161: + case 154: + case 174: + case 162: + case 65: case 9: case 7: case 8: case 10: - case 169: - case 79: - case 88: - case 92: - case 94: - case 90: + case 171: + case 80: + case 89: + case 93: + case 95: + case 91: return true; } } @@ -7104,488 +13000,30 @@ var ts; } ts.isLeftHandSideExpression = isLeftHandSideExpression; function isAssignmentOperator(token) { - return token >= 52 && token <= 63; + return token >= 53 && token <= 64; } ts.isAssignmentOperator = isAssignmentOperator; })(ts || (ts = {})); -var ts; -(function (ts) { - ts.bindTime = 0; - function getModuleInstanceState(node) { - if (node.kind === 197 || node.kind === 198) { - return 0; - } - else if (ts.isConstEnumDeclaration(node)) { - return 2; - } - else if ((node.kind === 204 || node.kind === 203) && !(node.flags & 1)) { - return 0; - } - else if (node.kind === 201) { - var state = 0; - ts.forEachChild(node, function (n) { - switch (getModuleInstanceState(n)) { - case 0: - return false; - case 2: - state = 2; - return false; - case 1: - state = 1; - return true; - } - }); - return state; - } - else if (node.kind === 200) { - return getModuleInstanceState(node.body); - } - else { - return 1; - } - } - ts.getModuleInstanceState = getModuleInstanceState; - function bindSourceFile(file) { - var start = new Date().getTime(); - bindSourceFileWorker(file); - ts.bindTime += new Date().getTime() - start; - } - ts.bindSourceFile = bindSourceFile; - function bindSourceFileWorker(file) { - var _parent; - var container; - var blockScopeContainer; - var lastContainer; - var symbolCount = 0; - var Symbol = ts.objectAllocator.getSymbolConstructor(); - if (!file.locals) { - file.locals = {}; - container = file; - setBlockScopeContainer(file, false); - bind(file); - file.symbolCount = symbolCount; - } - function createSymbol(flags, name) { - symbolCount++; - return new Symbol(flags, name); - } - function setBlockScopeContainer(node, cleanLocals) { - blockScopeContainer = node; - if (cleanLocals) { - blockScopeContainer.locals = undefined; - } - } - function addDeclarationToSymbol(symbol, node, symbolKind) { - symbol.flags |= symbolKind; - if (!symbol.declarations) - symbol.declarations = []; - symbol.declarations.push(node); - if (symbolKind & 1952 && !symbol.exports) - symbol.exports = {}; - if (symbolKind & 6240 && !symbol.members) - symbol.members = {}; - node.symbol = symbol; - if (symbolKind & 107455 && !symbol.valueDeclaration) - symbol.valueDeclaration = node; - } - function getDeclarationName(node) { - if (node.name) { - if (node.kind === 200 && node.name.kind === 8) { - return '"' + node.name.text + '"'; - } - if (node.name.kind === 126) { - var nameExpression = node.name.expression; - ts.Debug.assert(ts.isWellKnownSymbolSyntactically(nameExpression)); - return ts.getPropertyNameForKnownSymbolName(nameExpression.name.text); - } - return node.name.text; - } - switch (node.kind) { - case 141: - case 133: - return "__constructor"; - case 140: - case 136: - return "__call"; - case 137: - return "__new"; - case 138: - return "__index"; - case 210: - return "__export"; - case 209: - return "default"; - case 195: - case 196: - return node.flags & 256 ? "default" : undefined; - } - } - function getDisplayName(node) { - return node.name ? ts.declarationNameToString(node.name) : getDeclarationName(node); - } - function declareSymbol(symbols, parent, node, includes, excludes) { - ts.Debug.assert(!ts.hasDynamicName(node)); - var _name = node.flags & 256 && parent ? "default" : getDeclarationName(node); - var symbol; - if (_name !== undefined) { - symbol = ts.hasProperty(symbols, _name) ? symbols[_name] : (symbols[_name] = createSymbol(0, _name)); - if (symbol.flags & excludes) { - if (node.name) { - node.name.parent = node; - } - var message = symbol.flags & 2 - ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 - : ts.Diagnostics.Duplicate_identifier_0; - ts.forEach(symbol.declarations, function (declaration) { - file.bindDiagnostics.push(ts.createDiagnosticForNode(declaration.name || declaration, message, getDisplayName(declaration))); - }); - file.bindDiagnostics.push(ts.createDiagnosticForNode(node.name || node, message, getDisplayName(node))); - symbol = createSymbol(0, _name); - } - } - else { - symbol = createSymbol(0, "__missing"); - } - addDeclarationToSymbol(symbol, node, includes); - symbol.parent = parent; - if (node.kind === 196 && symbol.exports) { - var prototypeSymbol = createSymbol(4 | 134217728, "prototype"); - if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { - if (node.name) { - node.name.parent = node; - } - file.bindDiagnostics.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); - } - symbol.exports[prototypeSymbol.name] = prototypeSymbol; - prototypeSymbol.parent = symbol; - } - return symbol; - } - function isAmbientContext(node) { - while (node) { - if (node.flags & 2) - return true; - node = node.parent; - } - return false; - } - function declareModuleMember(node, symbolKind, symbolExcludes) { - var hasExportModifier = ts.getCombinedNodeFlags(node) & 1; - if (symbolKind & 8388608) { - if (node.kind === 212 || (node.kind === 203 && hasExportModifier)) { - declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); - } - else { - declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); - } - } - else { - if (hasExportModifier || isAmbientContext(container)) { - var exportKind = (symbolKind & 107455 ? 1048576 : 0) | - (symbolKind & 793056 ? 2097152 : 0) | - (symbolKind & 1536 ? 4194304 : 0); - var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); - local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); - node.localSymbol = local; - } - else { - declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); - } - } - } - function bindChildren(node, symbolKind, isBlockScopeContainer) { - if (symbolKind & 255504) { - node.locals = {}; - } - var saveParent = _parent; - var saveContainer = container; - var savedBlockScopeContainer = blockScopeContainer; - _parent = node; - if (symbolKind & 262128) { - container = node; - if (lastContainer) { - lastContainer.nextContainer = container; - } - lastContainer = container; - } - if (isBlockScopeContainer) { - setBlockScopeContainer(node, (symbolKind & 255504) === 0 && node.kind !== 221); - } - ts.forEachChild(node, bind); - container = saveContainer; - _parent = saveParent; - blockScopeContainer = savedBlockScopeContainer; - } - function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) { - switch (container.kind) { - case 200: - declareModuleMember(node, symbolKind, symbolExcludes); - break; - case 221: - if (ts.isExternalModule(container)) { - declareModuleMember(node, symbolKind, symbolExcludes); - break; - } - case 140: - case 141: - case 136: - case 137: - case 138: - case 132: - case 131: - case 133: - case 134: - case 135: - case 195: - case 160: - case 161: - declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); - break; - case 196: - if (node.flags & 128) { - declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); - break; - } - case 143: - case 152: - case 197: - declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes); - break; - case 199: - declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); - break; - } - bindChildren(node, symbolKind, isBlockScopeContainer); - } - function bindModuleDeclaration(node) { - if (node.name.kind === 8) { - bindDeclaration(node, 512, 106639, true); - } - else { - var state = getModuleInstanceState(node); - if (state === 0) { - bindDeclaration(node, 1024, 0, true); - } - else { - bindDeclaration(node, 512, 106639, true); - if (state === 2) { - node.symbol.constEnumOnlyModule = true; - } - else if (node.symbol.constEnumOnlyModule) { - node.symbol.constEnumOnlyModule = false; - } - } - } - } - function bindFunctionOrConstructorType(node) { - var symbol = createSymbol(131072, getDeclarationName(node)); - addDeclarationToSymbol(symbol, node, 131072); - bindChildren(node, 131072, false); - var typeLiteralSymbol = createSymbol(2048, "__type"); - addDeclarationToSymbol(typeLiteralSymbol, node, 2048); - typeLiteralSymbol.members = {}; - typeLiteralSymbol.members[node.kind === 140 ? "__call" : "__new"] = symbol; - } - function bindAnonymousDeclaration(node, symbolKind, name, isBlockScopeContainer) { - var symbol = createSymbol(symbolKind, name); - addDeclarationToSymbol(symbol, node, symbolKind); - bindChildren(node, symbolKind, isBlockScopeContainer); - } - function bindCatchVariableDeclaration(node) { - bindChildren(node, 0, true); - } - function bindBlockScopedVariableDeclaration(node) { - switch (blockScopeContainer.kind) { - case 200: - declareModuleMember(node, 2, 107455); - break; - case 221: - if (ts.isExternalModule(container)) { - declareModuleMember(node, 2, 107455); - break; - } - default: - if (!blockScopeContainer.locals) { - blockScopeContainer.locals = {}; - } - declareSymbol(blockScopeContainer.locals, undefined, node, 2, 107455); - } - bindChildren(node, 2, false); - } - function getDestructuringParameterName(node) { - return "__" + ts.indexOf(node.parent.parameters, node); - } - function bind(node) { - node.parent = _parent; - switch (node.kind) { - case 127: - bindDeclaration(node, 262144, 530912, false); - break; - case 128: - bindParameter(node); - break; - case 193: - case 150: - if (ts.isBindingPattern(node.name)) { - bindChildren(node, 0, false); - } - else if (ts.isBlockOrCatchScoped(node)) { - bindBlockScopedVariableDeclaration(node); - } - else { - bindDeclaration(node, 1, 107454, false); - } - break; - case 130: - case 129: - bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 107455, false); - break; - case 218: - case 219: - bindPropertyOrMethodOrAccessor(node, 4, 107455, false); - break; - case 220: - bindPropertyOrMethodOrAccessor(node, 8, 107455, false); - break; - case 136: - case 137: - case 138: - bindDeclaration(node, 131072, 0, false); - break; - case 132: - case 131: - bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 107455 : 99263, true); - break; - case 195: - bindDeclaration(node, 16, 106927, true); - break; - case 133: - bindDeclaration(node, 16384, 0, true); - break; - case 134: - bindPropertyOrMethodOrAccessor(node, 32768, 41919, true); - break; - case 135: - bindPropertyOrMethodOrAccessor(node, 65536, 74687, true); - break; - case 140: - case 141: - bindFunctionOrConstructorType(node); - break; - case 143: - bindAnonymousDeclaration(node, 2048, "__type", false); - break; - case 152: - bindAnonymousDeclaration(node, 4096, "__object", false); - break; - case 160: - case 161: - bindAnonymousDeclaration(node, 16, "__function", true); - break; - case 217: - bindCatchVariableDeclaration(node); - break; - case 196: - bindDeclaration(node, 32, 899583, false); - break; - case 197: - bindDeclaration(node, 64, 792992, false); - break; - case 198: - bindDeclaration(node, 524288, 793056, false); - break; - case 199: - if (ts.isConst(node)) { - bindDeclaration(node, 128, 899967, false); - } - else { - bindDeclaration(node, 256, 899327, false); - } - break; - case 200: - bindModuleDeclaration(node); - break; - case 203: - case 206: - case 208: - case 212: - bindDeclaration(node, 8388608, 8388608, false); - break; - case 205: - if (node.name) { - bindDeclaration(node, 8388608, 8388608, false); - } - else { - bindChildren(node, 0, false); - } - break; - case 210: - if (!node.exportClause) { - declareSymbol(container.symbol.exports, container.symbol, node, 1073741824, 0); - } - bindChildren(node, 0, false); - break; - case 209: - if (node.expression.kind === 64) { - declareSymbol(container.symbol.exports, container.symbol, node, 8388608, 8388608); - } - else { - declareSymbol(container.symbol.exports, container.symbol, node, 4, 107455); - } - bindChildren(node, 0, false); - break; - case 221: - if (ts.isExternalModule(node)) { - bindAnonymousDeclaration(node, 512, '"' + ts.removeFileExtension(node.fileName) + '"', true); - break; - } - case 174: - bindChildren(node, 0, !ts.isFunctionLike(node.parent)); - break; - case 217: - case 181: - case 182: - case 183: - case 202: - bindChildren(node, 0, true); - break; - default: - var saveParent = _parent; - _parent = node; - ts.forEachChild(node, bind); - _parent = saveParent; - } - } - function bindParameter(node) { - if (ts.isBindingPattern(node.name)) { - bindAnonymousDeclaration(node, 1, getDestructuringParameterName(node), false); - } - else { - bindDeclaration(node, 1, 107455, false); - } - if (node.flags & 112 && - node.parent.kind === 133 && - node.parent.parent.kind === 196) { - var classDeclaration = node.parent.parent; - declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4, 107455); - } - } - function bindPropertyOrMethodOrAccessor(node, symbolKind, symbolExcludes, isBlockScopeContainer) { - if (ts.hasDynamicName(node)) { - bindAnonymousDeclaration(node, symbolKind, "__computed", isBlockScopeContainer); - } - else { - bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer); - } - } - } -})(ts || (ts = {})); +/// var ts; (function (ts) { var nextSymbolId = 1; var nextNodeId = 1; var nextMergeId = 1; + function getNodeId(node) { + if (!node.id) + node.id = nextNodeId++; + return node.id; + } + ts.getNodeId = getNodeId; ts.checkTime = 0; + function getSymbolId(symbol) { + if (!symbol.id) { + symbol.id = nextSymbolId++; + } + return symbol.id; + } + ts.getSymbolId = getSymbolId; function createTypeChecker(host, produceDiagnostics) { var Symbol = ts.objectAllocator.getSymbolConstructor(); var Type = ts.objectAllocator.getTypeConstructor(); @@ -7599,12 +13037,24 @@ var ts; var undefinedSymbol = createSymbol(4 | 67108864, "undefined"); var argumentsSymbol = createSymbol(4 | 67108864, "arguments"); var checker = { - getNodeCount: function () { return ts.sum(host.getSourceFiles(), "nodeCount"); }, - getIdentifierCount: function () { return ts.sum(host.getSourceFiles(), "identifierCount"); }, - getSymbolCount: function () { return ts.sum(host.getSourceFiles(), "symbolCount"); }, - getTypeCount: function () { return typeCount; }, - isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, - isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, + getNodeCount: function () { + return ts.sum(host.getSourceFiles(), "nodeCount"); + }, + getIdentifierCount: function () { + return ts.sum(host.getSourceFiles(), "identifierCount"); + }, + getSymbolCount: function () { + return ts.sum(host.getSourceFiles(), "symbolCount"); + }, + getTypeCount: function () { + return typeCount; + }, + isUndefinedSymbol: function (symbol) { + return symbol === undefinedSymbol; + }, + isArgumentsSymbol: function (symbol) { + return symbol === argumentsSymbol; + }, getDiagnostics: getDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, getTypeOfSymbolAtLocation: getTypeOfSymbolAtLocation, @@ -7649,7 +13099,6 @@ var ts; 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); - var inferenceFailureType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anySignature = createSignature(undefined, undefined, emptyArray, anyType, 0, false, false); var unknownSignature = createSignature(undefined, undefined, emptyArray, unknownType, 0, false, false); var globals = {}; @@ -7666,10 +13115,16 @@ var ts; var globalESSymbolType; var globalIterableType; var anyArrayType; + var globalTypedPropertyDescriptorType; + var globalClassDecoratorType; + var globalParameterDecoratorType; + var globalPropertyDecoratorType; + var globalMethodDecoratorType; var tupleTypes = {}; var unionTypes = {}; var stringLiteralTypes = {}; var emitExtends = false; + var emitDecorate = false; var mergedSymbols = []; var symbolLinks = []; var nodeLinks = []; @@ -7698,9 +13153,7 @@ var ts; return emitResolver; } function error(location, message, arg0, arg1, arg2) { - var diagnostic = location - ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2) - : ts.createCompilerDiagnostic(message, arg0, arg1, arg2); + var diagnostic = location ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2) : ts.createCompilerDiagnostic(message, arg0, arg1, arg2); diagnostics.add(diagnostic); } function createSymbol(flags, name) { @@ -7786,8 +13239,7 @@ var ts; recordMergedSymbol(target, source); } else { - var message = target.flags & 2 || source.flags & 2 - ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; + var message = target.flags & 2 || source.flags & 2 ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(source.declarations, function (node) { error(node.name ? node.name : node, message, symbolToString(source)); }); @@ -7824,20 +13276,18 @@ var ts; function getSymbolLinks(symbol) { if (symbol.flags & 67108864) return symbol; - if (!symbol.id) - symbol.id = nextSymbolId++; - return symbolLinks[symbol.id] || (symbolLinks[symbol.id] = {}); + var id = getSymbolId(symbol); + return symbolLinks[id] || (symbolLinks[id] = {}); } function getNodeLinks(node) { - if (!node.id) - node.id = nextNodeId++; - return nodeLinks[node.id] || (nodeLinks[node.id] = {}); + var nodeId = getNodeId(node); + return nodeLinks[nodeId] || (nodeLinks[nodeId] = {}); } function getSourceFile(node) { - return ts.getAncestor(node, 221); + return ts.getAncestor(node, 227); } function isGlobalSourceFile(node) { - return node.kind === 221 && !ts.isExternalModule(node); + return node.kind === 227 && !ts.isExternalModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { @@ -7871,6 +13321,7 @@ var ts; var lastLocation; var propertyWithInvalidInitializer; var errorLocation = location; + var grandparent; loop: while (location) { if (location.locals && !isGlobalSourceFile(location)) { if (result = getSymbol(location.locals, name, meaning)) { @@ -7878,25 +13329,33 @@ var ts; } } switch (location.kind) { - case 221: + case 227: if (!ts.isExternalModule(location)) break; - case 200: + case 205: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8914931)) { - if (!(result.flags & 8388608 && getDeclarationOfAliasSymbol(result).kind === 212)) { + if (result.flags & meaning || !(result.flags & 8388608 && getDeclarationOfAliasSymbol(result).kind === 217)) { + break loop; + } + result = undefined; + } + else if (location.kind === 227) { + result = getSymbol(getSymbolOfNode(location).exports, "default", meaning & 8914931); + var localSymbol = ts.getLocalSymbolForExportDefault(result); + if (result && (result.flags & meaning) && localSymbol && localSymbol.name === name) { break loop; } result = undefined; } break; - case 199: + case 204: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8)) { break loop; } break; - case 130: - case 129: - if (location.parent.kind === 196 && !(location.flags & 128)) { + case 132: + case 131: + if (location.parent.kind === 201 && !(location.flags & 128)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { if (getSymbol(ctor.locals, name, meaning & 107455)) { @@ -7905,8 +13364,8 @@ var ts; } } break; - case 196: - case 197: + case 201: + case 202: 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); @@ -7915,38 +13374,53 @@ var ts; break loop; } break; - case 126: - var grandparent = location.parent.parent; - if (grandparent.kind === 196 || grandparent.kind === 197) { + case 127: + grandparent = location.parent.parent; + if (grandparent.kind === 201 || grandparent.kind === 202) { 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 132: - case 131: - case 133: case 134: + case 133: case 135: - case 195: - case 161: + case 136: + case 137: + case 200: + case 163: if (name === "arguments") { result = argumentsSymbol; break loop; } break; - case 160: + case 162: if (name === "arguments") { result = argumentsSymbol; break loop; } - var id = location.name; - if (id && name === id.text) { + var functionName = location.name; + if (functionName && name === functionName.text) { result = location.symbol; break loop; } break; + case 174: + var className = location.name; + if (className && name === className.text) { + result = location.symbol; + break loop; + } + break; + case 130: + if (location.parent && location.parent.kind === 129) { + location = location.parent; + } + if (location.parent && ts.isClassElement(location.parent)) { + location = location.parent; + } + break; } lastLocation = location; location = location.parent; @@ -7974,18 +13448,18 @@ var ts; } function checkResolvedBlockScopedVariable(result, errorLocation) { ts.Debug.assert((result.flags & 2) !== 0); - var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) ? d : undefined; }); + var declaration = ts.forEach(result.declarations, function (d) { + return ts.isBlockOrCatchScoped(d) ? d : undefined; + }); ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); var isUsedBeforeDeclaration = !isDefinedBefore(declaration, errorLocation); if (!isUsedBeforeDeclaration) { - var variableDeclaration = ts.getAncestor(declaration, 193); + var variableDeclaration = ts.getAncestor(declaration, 198); var container = ts.getEnclosingBlockScopeContainer(variableDeclaration); - if (variableDeclaration.parent.parent.kind === 175 || - variableDeclaration.parent.parent.kind === 181) { + if (variableDeclaration.parent.parent.kind === 180 || variableDeclaration.parent.parent.kind === 186) { isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, variableDeclaration, container); } - else if (variableDeclaration.parent.parent.kind === 183 || - variableDeclaration.parent.parent.kind === 182) { + else if (variableDeclaration.parent.parent.kind === 188 || variableDeclaration.parent.parent.kind === 187) { var expression = variableDeclaration.parent.parent.expression; isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, expression, container); } @@ -8005,49 +13479,94 @@ var ts; } return false; } - function isAliasSymbolDeclaration(node) { - return node.kind === 203 || - node.kind === 205 && !!node.name || - node.kind === 206 || - node.kind === 208 || - node.kind === 212 || - node.kind === 209; + function getAnyImportSyntax(node) { + if (ts.isAliasSymbolDeclaration(node)) { + if (node.kind === 208) { + return node; + } + while (node && node.kind !== 209) { + node = node.parent; + } + return node; + } } function getDeclarationOfAliasSymbol(symbol) { - return ts.forEach(symbol.declarations, function (d) { return isAliasSymbolDeclaration(d) ? d : undefined; }); + return ts.forEach(symbol.declarations, function (d) { + return ts.isAliasSymbolDeclaration(d) ? d : undefined; + }); } function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 213) { - var moduleSymbol = resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)); - var exportAssignmentSymbol = moduleSymbol && getResolvedExportAssignmentSymbol(moduleSymbol); - return exportAssignmentSymbol || moduleSymbol; + if (node.moduleReference.kind === 219) { + return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, node); } function getTargetOfImportClause(node) { var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); if (moduleSymbol) { - var exportAssignmentSymbol = getResolvedExportAssignmentSymbol(moduleSymbol); - if (!exportAssignmentSymbol) { - error(node.name, ts.Diagnostics.External_module_0_has_no_default_export_or_export_assignment, symbolToString(moduleSymbol)); + var exportDefaultSymbol = resolveSymbol(moduleSymbol.exports["default"]); + if (!exportDefaultSymbol) { + error(node.name, ts.Diagnostics.External_module_0_has_no_default_export, symbolToString(moduleSymbol)); } - return exportAssignmentSymbol; + return exportDefaultSymbol; } } function getTargetOfNamespaceImport(node) { - return resolveExternalModuleName(node, node.parent.parent.moduleSpecifier); + var moduleSpecifier = node.parent.parent.moduleSpecifier; + return resolveESModuleSymbol(resolveExternalModuleName(node, moduleSpecifier), moduleSpecifier); + } + function getMemberOfModuleVariable(moduleSymbol, name) { + if (moduleSymbol.flags & 3) { + var typeAnnotation = moduleSymbol.valueDeclaration.type; + if (typeAnnotation) { + return getPropertyOfType(getTypeFromTypeNodeOrHeritageClauseElement(typeAnnotation), name); + } + } + } + function combineValueAndTypeSymbols(valueSymbol, typeSymbol) { + if (valueSymbol.flags & (793056 | 1536)) { + return valueSymbol; + } + var result = createSymbol(valueSymbol.flags | typeSymbol.flags, valueSymbol.name); + result.declarations = ts.concatenate(valueSymbol.declarations, typeSymbol.declarations); + result.parent = valueSymbol.parent || typeSymbol.parent; + if (valueSymbol.valueDeclaration) + result.valueDeclaration = valueSymbol.valueDeclaration; + if (typeSymbol.members) + result.members = typeSymbol.members; + if (valueSymbol.exports) + result.exports = valueSymbol.exports; + return result; + } + function getExportOfModule(symbol, name) { + if (symbol.flags & 1536) { + var exports = getExportsOfSymbol(symbol); + if (ts.hasProperty(exports, name)) { + return resolveSymbol(exports[name]); + } + } + } + function getPropertyOfVariable(symbol, name) { + if (symbol.flags & 3) { + var typeAnnotation = symbol.valueDeclaration.type; + if (typeAnnotation) { + return resolveSymbol(getPropertyOfType(getTypeFromTypeNodeOrHeritageClauseElement(typeAnnotation), name)); + } + } } function getExternalModuleMember(node, specifier) { var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); - if (moduleSymbol) { - var _name = specifier.propertyName || specifier.name; - if (_name.text) { - var symbol = getSymbol(getExportsOfSymbol(moduleSymbol), _name.text, 107455 | 793056 | 1536); + var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier); + if (targetSymbol) { + var name_4 = specifier.propertyName || specifier.name; + if (name_4.text) { + var symbolFromModule = getExportOfModule(targetSymbol, name_4.text); + var symbolFromVariable = getPropertyOfVariable(targetSymbol, name_4.text); + var symbol = symbolFromModule && symbolFromVariable ? combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) : symbolFromModule || symbolFromVariable; if (!symbol) { - error(_name, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(_name)); - return; + error(name_4, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name_4)); } - return symbol.flags & (107455 | 793056 | 1536) ? symbol : resolveAlias(symbol); + return symbol; } } } @@ -8055,36 +13574,37 @@ var ts; return getExternalModuleMember(node.parent.parent.parent, node); } function getTargetOfExportSpecifier(node) { - return node.parent.parent.moduleSpecifier ? - getExternalModuleMember(node.parent.parent, node) : - resolveEntityName(node.propertyName || node.name, 107455 | 793056 | 1536); + return node.parent.parent.moduleSpecifier ? getExternalModuleMember(node.parent.parent, node) : resolveEntityName(node.propertyName || node.name, 107455 | 793056 | 1536); } function getTargetOfExportAssignment(node) { - return resolveEntityName(node.expression, 107455 | 793056 | 1536); + return node.expression && resolveEntityName(node.expression, 107455 | 793056 | 1536); } - function getTargetOfImportDeclaration(node) { + function getTargetOfAliasDeclaration(node) { switch (node.kind) { - case 203: - return getTargetOfImportEqualsDeclaration(node); - case 205: - return getTargetOfImportClause(node); - case 206: - return getTargetOfNamespaceImport(node); case 208: + return getTargetOfImportEqualsDeclaration(node); + case 210: + return getTargetOfImportClause(node); + case 211: + return getTargetOfNamespaceImport(node); + case 213: return getTargetOfImportSpecifier(node); - case 212: + case 217: return getTargetOfExportSpecifier(node); - case 209: + case 214: return getTargetOfExportAssignment(node); } } + function resolveSymbol(symbol) { + return symbol && symbol.flags & 8388608 && !(symbol.flags & (107455 | 793056 | 1536)) ? resolveAlias(symbol) : symbol; + } function resolveAlias(symbol) { ts.Debug.assert((symbol.flags & 8388608) !== 0, "Should only get Alias here."); var links = getSymbolLinks(symbol); if (!links.target) { links.target = resolvingSymbol; var node = getDeclarationOfAliasSymbol(symbol); - var target = getTargetOfImportDeclaration(node); + var target = getTargetOfAliasDeclaration(node); if (links.target === resolvingSymbol) { links.target = target || unknownSymbol; } @@ -8100,8 +13620,11 @@ var ts; function markExportAsReferenced(node) { var symbol = getSymbolOfNode(node); var target = resolveAlias(symbol); - if (target && target !== unknownSymbol && target.flags & 107455 && !isConstEnumOrConstEnumOnlyModule(target)) { - markAliasSymbolAsReferenced(symbol); + if (target) { + var markAlias = (target === unknownSymbol && compilerOptions.separateCompilation) || (target !== unknownSymbol && (target.flags & 107455) && !isConstEnumOrConstEnumOnlyModule(target)); + if (markAlias) { + markAliasSymbolAsReferenced(symbol); + } } } function markAliasSymbolAsReferenced(symbol) { @@ -8109,10 +13632,10 @@ var ts; if (!links.referenced) { links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); - if (node.kind === 209) { + if (node.kind === 214 && node.expression) { checkExpressionCached(node.expression); } - else if (node.kind === 212) { + else if (node.kind === 217) { checkExpressionCached(node.propertyName || node.name); } else if (ts.isInternalModuleImportEqualsDeclaration(node)) { @@ -8122,17 +13645,17 @@ var ts; } function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 203); + importDeclaration = ts.getAncestor(entityName, 208); ts.Debug.assert(importDeclaration !== undefined); } - if (entityName.kind === 64 && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { + if (entityName.kind === 65 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 64 || entityName.parent.kind === 125) { + if (entityName.kind === 65 || entityName.parent.kind === 126) { return resolveEntityName(entityName, 1536); } else { - ts.Debug.assert(entityName.parent.kind === 203); + ts.Debug.assert(entityName.parent.kind === 208); return resolveEntityName(entityName, 107455 | 793056 | 1536); } } @@ -8140,28 +13663,32 @@ var ts; return symbol.parent ? getFullyQualifiedName(symbol.parent) + "." + symbolToString(symbol) : symbolToString(symbol); } function resolveEntityName(name, meaning) { - if (ts.getFullWidth(name) === 0) { + if (ts.nodeIsMissing(name)) { return undefined; } var symbol; - if (name.kind === 64) { + if (name.kind === 65) { symbol = resolveName(name, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, name); if (!symbol) { return undefined; } } - else if (name.kind === 125) { - var namespace = resolveEntityName(name.left, 1536); - if (!namespace || namespace === unknownSymbol || ts.getFullWidth(name.right) === 0) { + 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; + var namespace = resolveEntityName(left, 1536); + if (!namespace || namespace === unknownSymbol || ts.nodeIsMissing(right)) { return undefined; } - var right = name.right; symbol = getSymbol(getExportsOfSymbol(namespace), right.text, meaning); if (!symbol) { error(right, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), ts.declarationNameToString(right)); return undefined; } } + else { + ts.Debug.fail("Unknown entity name kind."); + } ts.Debug.assert((symbol.flags & 16777216) === 0, "Should never get an instantiated symbol here."); return symbol.flags & meaning ? symbol : resolveAlias(symbol); } @@ -8206,22 +13733,22 @@ var ts; } error(moduleReferenceLiteral, ts.Diagnostics.Cannot_find_external_module_0, moduleName); } - function getExportAssignmentSymbol(moduleSymbol) { - return moduleSymbol.exports["default"]; + function resolveExternalModuleSymbol(moduleSymbol) { + return moduleSymbol && resolveSymbol(moduleSymbol.exports["export="]) || moduleSymbol; } - function getResolvedExportAssignmentSymbol(moduleSymbol) { - var symbol = getExportAssignmentSymbol(moduleSymbol); - if (symbol) { - if (symbol.flags & (107455 | 793056 | 1536)) { - return symbol; - } - if (symbol.flags & 8388608) { - return resolveAlias(symbol); - } + 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)); + symbol = undefined; } + return symbol; + } + function getExportAssignmentSymbol(moduleSymbol) { + return moduleSymbol.exports["export="]; } function getExportsOfSymbol(symbol) { - return symbol.flags & 1536 ? getExportsOfModule(symbol) : symbol.exports; + return symbol.flags & 1536 ? getExportsOfModule(symbol) : symbol.exports || emptySymbols; } function getExportsOfModule(moduleSymbol) { var links = getSymbolLinks(moduleSymbol); @@ -8235,20 +13762,12 @@ var ts; } } function getExportsForModule(moduleSymbol) { - if (compilerOptions.target < 2) { - var defaultSymbol = getExportAssignmentSymbol(moduleSymbol); - if (defaultSymbol) { - return { - "default": defaultSymbol - }; - } - } var result; var visitedSymbols = []; visit(moduleSymbol); return result || moduleSymbol.exports; function visit(symbol) { - if (!ts.contains(visitedSymbols, symbol)) { + if (symbol.flags & 1952 && !ts.contains(visitedSymbols, symbol)) { visitedSymbols.push(symbol); if (symbol !== moduleSymbol) { if (!result) { @@ -8258,9 +13777,10 @@ var ts; } var exportStars = symbol.exports["__export"]; if (exportStars) { - ts.forEach(exportStars.declarations, function (node) { + for (var _i = 0, _a = exportStars.declarations; _i < _a.length; _i++) { + var node = _a[_i]; visit(resolveExternalModuleName(node, node.moduleSpecifier)); - }); + } } } } @@ -8276,9 +13796,7 @@ var ts; return getMergedSymbol(symbol.parent); } function getExportSymbolOfValueSymbolIfExported(symbol) { - return symbol && (symbol.flags & 1048576) !== 0 - ? getMergedSymbol(symbol.exportSymbol) - : symbol; + return symbol && (symbol.flags & 1048576) !== 0 ? getMergedSymbol(symbol.exportSymbol) : symbol; } function symbolIsValue(symbol) { if (symbol.flags & 16777216) { @@ -8294,9 +13812,9 @@ var ts; } function findConstructorDeclaration(node) { var members = node.members; - for (var _i = 0, _n = members.length; _i < _n; _i++) { + for (var _i = 0; _i < members.length; _i++) { var member = members[_i]; - if (member.kind === 133 && ts.nodeIsPresent(member.body)) { + if (member.kind === 135 && ts.nodeIsPresent(member.body)) { return member; } } @@ -8317,10 +13835,7 @@ var ts; return type; } function isReservedMemberName(name) { - return name.charCodeAt(0) === 95 && - name.charCodeAt(1) === 95 && - name.charCodeAt(2) !== 95 && - name.charCodeAt(2) !== 64; + return name.charCodeAt(0) === 95 && name.charCodeAt(1) === 95 && name.charCodeAt(2) !== 95 && name.charCodeAt(2) !== 64; } function getNamedMembers(members) { var result; @@ -8354,25 +13869,25 @@ var ts; } function forEachSymbolTableInScope(enclosingDeclaration, callback) { var result; - for (var _location = enclosingDeclaration; _location; _location = _location.parent) { - if (_location.locals && !isGlobalSourceFile(_location)) { - if (result = callback(_location.locals)) { + for (var location_1 = enclosingDeclaration; location_1; location_1 = location_1.parent) { + if (location_1.locals && !isGlobalSourceFile(location_1)) { + if (result = callback(location_1.locals)) { return result; } } - switch (_location.kind) { - case 221: - if (!ts.isExternalModule(_location)) { + switch (location_1.kind) { + case 227: + if (!ts.isExternalModule(location_1)) { break; } - case 200: - if (result = callback(getSymbolOfNode(_location).exports)) { + case 205: + if (result = callback(getSymbolOfNode(location_1).exports)) { return result; } break; - case 196: - case 197: - if (result = callback(getSymbolOfNode(_location).members)) { + case 201: + case 202: + if (result = callback(getSymbolOfNode(location_1).members)) { return result; } break; @@ -8394,24 +13909,28 @@ var ts; } function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol) { if (symbol === (resolvedAliasSymbol || symbolFromSymbolTable)) { - return !ts.forEach(symbolFromSymbolTable.declarations, hasExternalModuleSymbol) && - canQualifySymbol(symbolFromSymbolTable, meaning); + return !ts.forEach(symbolFromSymbolTable.declarations, hasExternalModuleSymbol) && canQualifySymbol(symbolFromSymbolTable, meaning); } } if (isAccessible(ts.lookUp(symbols, symbol.name))) { - return [symbol]; + return [ + symbol + ]; } return ts.forEachValue(symbols, function (symbolFromSymbolTable) { - if (symbolFromSymbolTable.flags & 8388608) { - if (!useOnlyExternalAliasing || - ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { + if (symbolFromSymbolTable.flags & 8388608 && symbolFromSymbolTable.name !== "export=") { + if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); if (isAccessible(symbolFromSymbolTable, resolveAlias(symbolFromSymbolTable))) { - return [symbolFromSymbolTable]; + return [ + symbolFromSymbolTable + ]; } var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined; if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { - return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); + return [ + symbolFromSymbolTable + ].concat(accessibleSymbolsFromExports); } } } @@ -8476,7 +13995,9 @@ var ts; errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning) }; } - return { accessibility: 0 }; + return { + accessibility: 0 + }; function getExternalModuleContainer(declaration) { for (; declaration; declaration = declaration.parent) { if (hasExternalModuleSymbol(declaration)) { @@ -8486,28 +14007,33 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 200 && declaration.name.kind === 8) || - (declaration.kind === 221 && ts.isExternalModule(declaration)); + return (declaration.kind === 205 && declaration.name.kind === 8) || (declaration.kind === 227 && ts.isExternalModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; - if (ts.forEach(symbol.declarations, function (declaration) { return !getIsDeclarationVisible(declaration); })) { + if (ts.forEach(symbol.declarations, function (declaration) { + return !getIsDeclarationVisible(declaration); + })) { return undefined; } - return { accessibility: 0, aliasesToMakeVisible: aliasesToMakeVisible }; + return { + accessibility: 0, + aliasesToMakeVisible: aliasesToMakeVisible + }; function getIsDeclarationVisible(declaration) { if (!isDeclarationVisible(declaration)) { - if (declaration.kind === 203 && - !(declaration.flags & 1) && - isDeclarationVisible(declaration.parent)) { + var anyImportSyntax = getAnyImportSyntax(declaration); + if (anyImportSyntax && !(anyImportSyntax.flags & 1) && isDeclarationVisible(anyImportSyntax.parent)) { getNodeLinks(declaration).isVisible = true; if (aliasesToMakeVisible) { - if (!ts.contains(aliasesToMakeVisible, declaration)) { - aliasesToMakeVisible.push(declaration); + if (!ts.contains(aliasesToMakeVisible, anyImportSyntax)) { + aliasesToMakeVisible.push(anyImportSyntax); } } else { - aliasesToMakeVisible = [declaration]; + aliasesToMakeVisible = [ + anyImportSyntax + ]; } return true; } @@ -8518,11 +14044,10 @@ var ts; } function isEntityNameVisible(entityName, enclosingDeclaration) { var meaning; - if (entityName.parent.kind === 142) { + if (entityName.parent.kind === 144) { meaning = 107455 | 1048576; } - else if (entityName.kind === 125 || - entityName.parent.kind === 203) { + else if (entityName.kind === 126 || entityName.kind === 155 || entityName.parent.kind === 208) { meaning = 1536; } else { @@ -8566,10 +14091,10 @@ var ts; function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048) { var node = type.symbol.declarations[0].parent; - while (node.kind === 147) { + while (node.kind === 149) { node = node.parent; } - if (node.kind === 198) { + if (node.kind === 203) { return getSymbolOfNode(node); } } @@ -8608,12 +14133,11 @@ var ts; function walkSymbol(symbol, meaning) { if (symbol) { var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, !!(flags & 2)); - if (!accessibleSymbolChain || - needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { + if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { walkSymbol(getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol), getQualifiedLeftMeaning(meaning)); } if (accessibleSymbolChain) { - for (var _i = 0, _n = accessibleSymbolChain.length; _i < _n; _i++) { + for (var _i = 0; _i < accessibleSymbolChain.length; _i++) { var accessibleSymbol = accessibleSymbolChain[_i]; appendParentTypeArgumentsAndSymbolName(accessibleSymbol); } @@ -8642,8 +14166,7 @@ var ts; return writeType(type, globalFlags); function writeType(type, flags) { if (type.flags & 1048703) { - writer.writeKeyword(!(globalFlags & 16) && - (type.flags & 1) ? "any" : type.intrinsicName); + writer.writeKeyword(!(globalFlags & 16) && (type.flags & 1) ? "any" : type.intrinsicName); } else if (type.flags & 4096) { writeTypeReference(type, flags); @@ -8723,7 +14246,7 @@ var ts; buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, 793056, 0, flags); } else { - writeKeyword(writer, 111); + writeKeyword(writer, 112); } } else { @@ -8736,22 +14259,20 @@ var ts; } function shouldWriteTypeOfFunctionSymbol() { if (type.symbol) { - var isStaticMethodSymbol = !!(type.symbol.flags & 8192 && - ts.forEach(type.symbol.declarations, function (declaration) { return declaration.flags & 128; })); - var isNonLocalFunctionSymbol = !!(type.symbol.flags & 16) && - (type.symbol.parent || - ts.forEach(type.symbol.declarations, function (declaration) { - return declaration.parent.kind === 221 || declaration.parent.kind === 201; - })); + var isStaticMethodSymbol = !!(type.symbol.flags & 8192 && ts.forEach(type.symbol.declarations, function (declaration) { + return declaration.flags & 128; + })); + 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; + })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { - return !!(flags & 2) || - (typeStack && ts.contains(typeStack, type)); + return !!(flags & 2) || (typeStack && ts.contains(typeStack, type)); } } } } function writeTypeofSymbol(type, typeFormatFlags) { - writeKeyword(writer, 96); + writeKeyword(writer, 97); writeSpace(writer); buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 107455, 0, typeFormatFlags); } @@ -8785,7 +14306,7 @@ var ts; if (flags & 64) { writePunctuation(writer, 16); } - writeKeyword(writer, 87); + writeKeyword(writer, 88); writeSpace(writer); buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8, typeStack); if (flags & 64) { @@ -8797,17 +14318,17 @@ var ts; writePunctuation(writer, 14); writer.writeLine(); writer.increaseIndent(); - for (var _i = 0, _a = resolved.callSignatures, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = resolved.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); writePunctuation(writer, 22); writer.writeLine(); } - for (var _b = 0, _c = resolved.constructSignatures, _d = _c.length; _b < _d; _b++) { - var _signature = _c[_b]; - writeKeyword(writer, 87); + for (var _b = 0, _c = resolved.constructSignatures; _b < _c.length; _b++) { + var signature = _c[_b]; + writeKeyword(writer, 88); writeSpace(writer); - buildSignatureDisplay(_signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); + buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); writePunctuation(writer, 22); writer.writeLine(); } @@ -8816,7 +14337,7 @@ var ts; writer.writeParameter(getIndexerParameterName(resolved, 0, "x")); writePunctuation(writer, 51); writeSpace(writer); - writeKeyword(writer, 120); + writeKeyword(writer, 121); writePunctuation(writer, 19); writePunctuation(writer, 51); writeSpace(writer); @@ -8829,7 +14350,7 @@ var ts; writer.writeParameter(getIndexerParameterName(resolved, 1, "x")); writePunctuation(writer, 51); writeSpace(writer); - writeKeyword(writer, 118); + writeKeyword(writer, 119); writePunctuation(writer, 19); writePunctuation(writer, 51); writeSpace(writer); @@ -8837,18 +14358,18 @@ var ts; writePunctuation(writer, 22); writer.writeLine(); } - for (var _e = 0, _f = resolved.properties, _g = _f.length; _e < _g; _e++) { - var p = _f[_e]; + for (var _d = 0, _e = resolved.properties; _d < _e.length; _d++) { + var p = _e[_d]; var t = getTypeOfSymbol(p); if (p.flags & (16 | 8192) && !getPropertiesOfObjectType(t).length) { var signatures = getSignaturesOfType(t, 0); - for (var _h = 0, _j = signatures.length; _h < _j; _h++) { - var _signature_1 = signatures[_h]; + for (var _f = 0; _f < signatures.length; _f++) { + var signature = signatures[_f]; buildSymbolDisplay(p, writer); if (p.flags & 536870912) { writePunctuation(writer, 50); } - buildSignatureDisplay(_signature_1, writer, enclosingDeclaration, globalFlagsToPass, typeStack); + buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); writePunctuation(writer, 22); writer.writeLine(); } @@ -8880,7 +14401,7 @@ var ts; var constraint = getConstraintOfTypeParameter(tp); if (constraint) { writeSpace(writer); - writeKeyword(writer, 78); + writeKeyword(writer, 79); writeSpace(writer); buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, typeStack); } @@ -8973,12 +14494,12 @@ var ts; function isDeclarationVisible(node) { function getContainingExternalModule(node) { for (; node; node = node.parent) { - if (node.kind === 200) { + if (node.kind === 205) { if (node.name.kind === 8) { return node; } } - else if (node.kind === 221) { + else if (node.kind === 227) { return ts.isExternalModule(node) ? node : undefined; } } @@ -9021,48 +14542,57 @@ var ts; } function determineIfDeclarationIsVisible() { switch (node.kind) { - case 193: - case 150: - case 200: - case 196: - case 197: + case 152: + return isDeclarationVisible(node.parent.parent); case 198: - case 195: - case 199: - case 203: - var _parent = getDeclarationContainer(node); - if (!(ts.getCombinedNodeFlags(node) & 1) && - !(node.kind !== 203 && _parent.kind !== 221 && ts.isInAmbientContext(_parent))) { - return isGlobalSourceFile(_parent) || isUsedInExportAssignment(node); + if (ts.isBindingPattern(node.name) && !node.name.elements.length) { + return false; } - return isDeclarationVisible(_parent); - case 130: - case 129: - case 134: - case 135: + case 205: + case 201: + case 202: + case 203: + case 200: + case 204: + case 208: + var parent_2 = getDeclarationContainer(node); + if (!(ts.getCombinedNodeFlags(node) & 1) && !(node.kind !== 208 && parent_2.kind !== 227 && ts.isInAmbientContext(parent_2))) { + return isGlobalSourceFile(parent_2); + } + return isDeclarationVisible(parent_2); case 132: case 131: + case 136: + case 137: + case 134: + case 133: if (node.flags & (32 | 64)) { return false; } - case 133: - case 137: - case 136: - case 138: - case 128: - case 201: - case 140: - case 141: - case 143: + case 135: case 139: - case 144: + case 138: + case 140: + case 129: + case 206: + case 142: + case 143: case 145: + case 141: case 146: case 147: + case 148: + case 149: return isDeclarationVisible(node.parent); - case 127: - case 221: + case 210: + case 211: + case 213: + return false; + case 128: + case 227: return true; + case 214: + return false; default: ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); } @@ -9075,19 +14605,50 @@ var ts; return links.isVisible; } } + function collectLinkedAliases(node) { + var exportSymbol; + if (node.parent && node.parent.kind === 214) { + exportSymbol = resolveName(node.parent, node.text, 107455 | 793056 | 1536, ts.Diagnostics.Cannot_find_name_0, node); + } + else if (node.parent.kind === 217) { + exportSymbol = getTargetOfExportSpecifier(node.parent); + } + var result = []; + if (exportSymbol) { + buildVisibleNodeList(exportSymbol.declarations); + } + return result; + function buildVisibleNodeList(declarations) { + ts.forEach(declarations, function (declaration) { + getNodeLinks(declaration).isVisible = true; + var resultNode = getAnyImportSyntax(declaration) || declaration; + if (!ts.contains(result, resultNode)) { + result.push(resultNode); + } + if (ts.isInternalModuleImportEqualsDeclaration(declaration)) { + var internalModuleReference = declaration.moduleReference; + var firstIdentifier = getFirstIdentifier(internalModuleReference); + var importSymbol = resolveName(declaration, firstIdentifier.text, 107455 | 793056 | 1536, ts.Diagnostics.Cannot_find_name_0, firstIdentifier); + buildVisibleNodeList(importSymbol.declarations); + } + }); + } + } function getRootDeclaration(node) { - while (node.kind === 150) { + while (node.kind === 152) { node = node.parent.parent; } return node; } function getDeclarationContainer(node) { node = getRootDeclaration(node); - return node.kind === 193 ? node.parent.parent.parent : node.parent; + return node.kind === 198 ? node.parent.parent.parent : node.parent; } function getTypeOfPrototypeProperty(prototype) { var classType = getDeclaredTypeOfSymbol(prototype.parent); - return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { return anyType; })) : classType; + return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { + return anyType; + })) : classType; } function getTypeOfPropertyOfType(type, name) { var prop = getPropertyOfType(type, name); @@ -9106,13 +14667,11 @@ var ts; return parentType; } var type; - if (pattern.kind === 148) { - var _name = declaration.propertyName || declaration.name; - type = getTypeOfPropertyOfType(parentType, _name.text) || - isNumericLiteralName(_name.text) && getIndexTypeOfType(parentType, 1) || - getIndexTypeOfType(parentType, 0); + if (pattern.kind === 150) { + var name_5 = declaration.propertyName || declaration.name; + type = getTypeOfPropertyOfType(parentType, name_5.text) || isNumericLiteralName(name_5.text) && getIndexTypeOfType(parentType, 1) || getIndexTypeOfType(parentType, 0); if (!type) { - error(_name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(_name)); + error(name_5, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name_5)); return unknownType; } } @@ -9141,22 +14700,22 @@ var ts; return type; } function getTypeForVariableLikeDeclaration(declaration) { - if (declaration.parent.parent.kind === 182) { + if (declaration.parent.parent.kind === 187) { return anyType; } - if (declaration.parent.parent.kind === 183) { + if (declaration.parent.parent.kind === 188) { return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType; } if (ts.isBindingPattern(declaration.parent)) { return getTypeForBindingElement(declaration); } if (declaration.type) { - return getTypeFromTypeNode(declaration.type); + return getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); } - if (declaration.kind === 128) { + if (declaration.kind === 129) { var func = declaration.parent; - if (func.kind === 135 && !ts.hasDynamicName(func)) { - var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 134); + if (func.kind === 137 && !ts.hasDynamicName(func)) { + var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 136); if (getter) { return getReturnTypeOfSignature(getSignatureFromDeclaration(getter)); } @@ -9169,7 +14728,7 @@ var ts; if (declaration.initializer) { return checkExpressionCached(declaration.initializer); } - if (declaration.kind === 219) { + if (declaration.kind === 225) { return checkIdentifier(declaration.name); } return undefined; @@ -9187,8 +14746,8 @@ var ts; var members = {}; ts.forEach(pattern.elements, function (e) { var flags = 4 | 67108864 | (e.initializer ? 536870912 : 0); - var _name = e.propertyName || e.name; - var symbol = createSymbol(flags, _name.text); + var name = e.propertyName || e.name; + var symbol = createSymbol(flags, name.text); symbol.type = getTypeFromBindingElement(e); members[symbol.name] = symbol; }); @@ -9198,7 +14757,7 @@ var ts; var hasSpreadElement = false; var elementTypes = []; ts.forEach(pattern.elements, function (e) { - elementTypes.push(e.kind === 172 || e.dotDotDotToken ? anyType : getTypeFromBindingElement(e)); + elementTypes.push(e.kind === 175 || e.dotDotDotToken ? anyType : getTypeFromBindingElement(e)); if (e.dotDotDotToken) { hasSpreadElement = true; } @@ -9206,9 +14765,7 @@ var ts; return !elementTypes.length ? anyArrayType : hasSpreadElement ? createArrayType(getUnionType(elementTypes)) : createTupleType(elementTypes); } function getTypeFromBindingPattern(pattern) { - return pattern.kind === 148 - ? getTypeFromObjectBindingPattern(pattern) - : getTypeFromArrayBindingPattern(pattern); + return pattern.kind === 150 ? getTypeFromObjectBindingPattern(pattern) : getTypeFromArrayBindingPattern(pattern); } function getWidenedTypeForVariableLikeDeclaration(declaration, reportErrors) { var type = getTypeForVariableLikeDeclaration(declaration); @@ -9216,7 +14773,7 @@ var ts; if (reportErrors) { reportErrorsFromWidening(declaration, type); } - return declaration.kind !== 218 ? getWidenedType(type) : type; + return declaration.kind !== 224 ? getWidenedType(type) : type; } if (ts.isBindingPattern(declaration.name)) { return getTypeFromBindingPattern(declaration.name); @@ -9224,7 +14781,7 @@ var ts; type = declaration.dotDotDotToken ? anyArrayType : anyType; if (reportErrors && compilerOptions.noImplicitAny) { var root = getRootDeclaration(declaration); - if (!isPrivateWithinAmbient(root) && !(root.kind === 128 && isPrivateWithinAmbient(root.parent))) { + if (!isPrivateWithinAmbient(root) && !(root.kind === 129 && isPrivateWithinAmbient(root.parent))) { reportImplicitAnyError(declaration, type); } } @@ -9237,11 +14794,20 @@ var ts; return links.type = getTypeOfPrototypeProperty(symbol); } var declaration = symbol.valueDeclaration; - if (declaration.parent.kind === 217) { + if (declaration.parent.kind === 223) { return links.type = anyType; } - if (declaration.kind === 209) { - return links.type = checkExpression(declaration.expression); + if (declaration.kind === 214) { + var exportAssignment = declaration; + if (exportAssignment.expression) { + return links.type = checkExpression(exportAssignment.expression); + } + else if (exportAssignment.type) { + return links.type = getTypeFromTypeNodeOrHeritageClauseElement(exportAssignment.type); + } + else { + return links.type = anyType; + } } links.type = resolvingType; var type = getWidenedTypeForVariableLikeDeclaration(declaration, true); @@ -9252,9 +14818,7 @@ var ts; 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; + 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)); } } @@ -9265,12 +14829,12 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 134) { - return accessor.type && getTypeFromTypeNode(accessor.type); + if (accessor.kind === 136) { + return accessor.type && getTypeFromTypeNodeOrHeritageClauseElement(accessor.type); } else { var setterTypeAnnotation = getSetAccessorTypeAnnotationNode(accessor); - return setterTypeAnnotation && getTypeFromTypeNode(setterTypeAnnotation); + return setterTypeAnnotation && getTypeFromTypeNodeOrHeritageClauseElement(setterTypeAnnotation); } } return undefined; @@ -9284,8 +14848,8 @@ var ts; links = links || getSymbolLinks(symbol); if (!links.type) { links.type = resolvingType; - var getter = ts.getDeclarationOfKind(symbol, 134); - var setter = ts.getDeclarationOfKind(symbol, 135); + var getter = ts.getDeclarationOfKind(symbol, 136); + var setter = ts.getDeclarationOfKind(symbol, 137); var type; var getterReturnType = getAnnotatedAccessorType(getter); if (getterReturnType) { @@ -9315,8 +14879,8 @@ var ts; else if (links.type === resolvingType) { links.type = anyType; if (compilerOptions.noImplicitAny) { - var _getter = ts.getDeclarationOfKind(symbol, 134); - 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)); + 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)); } } } @@ -9382,13 +14946,15 @@ var ts; function getTypeParametersOfClassOrInterface(symbol) { var result; ts.forEach(symbol.declarations, function (node) { - if (node.kind === 197 || node.kind === 196) { + if (node.kind === 202 || node.kind === 201) { var declaration = node; if (declaration.typeParameters && declaration.typeParameters.length) { ts.forEach(declaration.typeParameters, function (node) { var tp = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node)); if (!result) { - result = [tp]; + result = [ + tp + ]; } else if (!ts.contains(result, tp)) { result.push(tp); @@ -9413,10 +14979,10 @@ var ts; type.typeArguments = type.typeParameters; } type.baseTypes = []; - var declaration = ts.getDeclarationOfKind(symbol, 196); - var baseTypeNode = ts.getClassBaseTypeNode(declaration); + var declaration = ts.getDeclarationOfKind(symbol, 201); + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(declaration); if (baseTypeNode) { - var baseType = getTypeFromTypeReferenceNode(baseTypeNode); + var baseType = getTypeFromHeritageClauseElement(baseTypeNode); if (baseType !== unknownType) { if (getTargetType(baseType).flags & 1024) { if (type !== baseType && !hasBaseType(baseType, type)) { @@ -9454,9 +15020,9 @@ var ts; } type.baseTypes = []; ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 197 && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 202 && ts.getInterfaceBaseTypeNodes(declaration)) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), function (node) { - var baseType = getTypeFromTypeReferenceNode(node); + var baseType = getTypeFromHeritageClauseElement(node); if (baseType !== unknownType) { if (getTargetType(baseType).flags & (1024 | 2048)) { if (type !== baseType && !hasBaseType(baseType, type)) { @@ -9485,16 +15051,16 @@ var ts; var links = getSymbolLinks(symbol); if (!links.declaredType) { links.declaredType = resolvingType; - var declaration = ts.getDeclarationOfKind(symbol, 198); - var type = getTypeFromTypeNode(declaration.type); + var declaration = ts.getDeclarationOfKind(symbol, 203); + var type = getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); if (links.declaredType === resolvingType) { links.declaredType = type; } } else if (links.declaredType === resolvingType) { links.declaredType = unknownType; - var _declaration = ts.getDeclarationOfKind(symbol, 198); - error(_declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); + var declaration = ts.getDeclarationOfKind(symbol, 203); + error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); } return links.declaredType; } @@ -9512,7 +15078,7 @@ var ts; if (!links.declaredType) { var type = createType(512); type.symbol = symbol; - if (!ts.getDeclarationOfKind(symbol, 127).constraint) { + if (!ts.getDeclarationOfKind(symbol, 128).constraint) { type.constraint = noConstraintType; } links.declaredType = type; @@ -9550,7 +15116,7 @@ var ts; } function createSymbolTable(symbols) { var result = {}; - for (var _i = 0, _n = symbols.length; _i < _n; _i++) { + for (var _i = 0; _i < symbols.length; _i++) { var symbol = symbols[_i]; result[symbol.name] = symbol; } @@ -9558,14 +15124,14 @@ var ts; } function createInstantiatedSymbolTable(symbols, mapper) { var result = {}; - for (var _i = 0, _n = symbols.length; _i < _n; _i++) { + for (var _i = 0; _i < symbols.length; _i++) { var symbol = symbols[_i]; result[symbol.name] = instantiateSymbol(symbol, mapper); } return result; } function addInheritedMembers(symbols, baseSymbols) { - for (var _i = 0, _n = baseSymbols.length; _i < _n; _i++) { + for (var _i = 0; _i < baseSymbols.length; _i++) { var s = baseSymbols[_i]; if (!ts.hasProperty(symbols, s.name)) { symbols[s.name] = s; @@ -9574,7 +15140,7 @@ var ts; } function addInheritedSignatures(signatures, baseSignatures) { if (baseSignatures) { - for (var _i = 0, _n = baseSignatures.length; _i < _n; _i++) { + for (var _i = 0; _i < baseSignatures.length; _i++) { var signature = baseSignatures[_i]; signatures.push(signature); } @@ -9635,14 +15201,15 @@ var ts; var baseType = classType.baseTypes[0]; var baseSignatures = getSignaturesOfType(getTypeOfSymbol(baseType.symbol), 1); return ts.map(baseSignatures, function (baseSignature) { - var signature = baseType.flags & 4096 ? - getSignatureInstantiation(baseSignature, baseType.typeArguments) : cloneSignature(baseSignature); + var signature = baseType.flags & 4096 ? getSignatureInstantiation(baseSignature, baseType.typeArguments) : cloneSignature(baseSignature); signature.typeParameters = classType.typeParameters; signature.resolvedReturnType = classType; return signature; }); } - return [createSignature(undefined, classType.typeParameters, emptyArray, classType, 0, false, false)]; + return [ + createSignature(undefined, classType.typeParameters, emptyArray, classType, 0, false, false) + ]; } function createTupleTypeMemberSymbols(memberTypes) { var members = {}; @@ -9671,16 +15238,18 @@ var ts; return true; } function getUnionSignatures(types, kind) { - var signatureLists = ts.map(types, function (t) { return getSignaturesOfType(t, kind); }); + var signatureLists = ts.map(types, function (t) { + return getSignaturesOfType(t, kind); + }); var signatures = signatureLists[0]; - for (var _i = 0, _n = signatures.length; _i < _n; _i++) { + for (var _i = 0; _i < signatures.length; _i++) { var signature = signatures[_i]; if (signature.typeParameters) { return emptyArray; } } - for (var _i_1 = 1; _i_1 < signatureLists.length; _i_1++) { - if (!signatureListsIdentical(signatures, signatureLists[_i_1])) { + for (var i_1 = 1; i_1 < signatureLists.length; i_1++) { + if (!signatureListsIdentical(signatures, signatureLists[i_1])) { return emptyArray; } } @@ -9688,13 +15257,15 @@ var ts; for (var i = 0; i < result.length; i++) { var s = result[i]; s.resolvedReturnType = undefined; - s.unionSignatures = ts.map(signatureLists, function (signatures) { return signatures[i]; }); + s.unionSignatures = ts.map(signatureLists, function (signatures) { + return signatures[i]; + }); } return result; } function getUnionIndexType(types, kind) { var indexTypes = []; - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var type = types[_i]; var indexType = getIndexTypeOfType(type, kind); if (!indexType) { @@ -9830,7 +15401,7 @@ var ts; function createUnionProperty(unionType, name) { var types = unionType.types; var props; - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var current = types[_i]; var type = getApparentType(current); if (type !== unknownType) { @@ -9839,7 +15410,9 @@ var ts; return undefined; } if (!props) { - props = [prop]; + props = [ + prop + ]; } else { props.push(prop); @@ -9848,12 +15421,12 @@ var ts; } var propTypes = []; var declarations = []; - for (var _a = 0, _b = props.length; _a < _b; _a++) { - var _prop = props[_a]; - if (_prop.declarations) { - declarations.push.apply(declarations, _prop.declarations); + for (var _a = 0; _a < props.length; _a++) { + var prop = props[_a]; + if (prop.declarations) { + declarations.push.apply(declarations, prop.declarations); } - propTypes.push(getTypeOfSymbol(_prop)); + propTypes.push(getTypeOfSymbol(prop)); } var result = createSymbol(4 | 67108864 | 268435456, name); result.unionType = unionType; @@ -9890,9 +15463,9 @@ var ts; } } if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { - var _symbol = getPropertyOfObjectType(globalFunctionType, name); - if (_symbol) - return _symbol; + var symbol = getPropertyOfObjectType(globalFunctionType, name); + if (symbol) + return symbol; } return getPropertyOfObjectType(globalObjectType, name); } @@ -9925,22 +15498,30 @@ var ts; }); return result; } + function symbolsToArray(symbols) { + var result = []; + for (var id in symbols) { + if (!isReservedMemberName(id)) { + result.push(symbols[id]); + } + } + return result; + } function getExportsOfExternalModule(node) { if (!node.moduleSpecifier) { return emptyArray; } var module = resolveExternalModuleName(node, node.moduleSpecifier); - if (!module || !module.exports) { + if (!module) { return emptyArray; } - return ts.mapToArray(getExportsOfModule(module)); + return symbolsToArray(getExportsOfModule(module)); } function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { - var classType = declaration.kind === 133 ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; - var typeParameters = classType ? classType.typeParameters : - declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; + var classType = declaration.kind === 135 ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; + var typeParameters = classType ? classType.typeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; var parameters = []; var hasStringLiterals = false; var minArgumentCount = -1; @@ -9964,11 +15545,11 @@ var ts; returnType = classType; } else if (declaration.type) { - returnType = getTypeFromTypeNode(declaration.type); + returnType = getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); } else { - if (declaration.kind === 134 && !ts.hasDynamicName(declaration)) { - var setter = ts.getDeclarationOfKind(declaration.symbol, 135); + if (declaration.kind === 136 && !ts.hasDynamicName(declaration)) { + var setter = ts.getDeclarationOfKind(declaration.symbol, 137); returnType = getAnnotatedAccessorType(setter); } if (!returnType && ts.nodeIsMissing(declaration.body)) { @@ -9986,19 +15567,19 @@ var ts; for (var i = 0, len = symbol.declarations.length; i < len; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 140: - case 141: - case 195: - case 132: - case 131: + case 142: + case 143: + case 200: + case 134: case 133: + case 135: + case 138: + case 139: + case 140: case 136: case 137: - case 138: - case 134: - case 135: - case 160: - case 161: + case 162: + case 163: if (i > 0 && node.body) { var previous = symbol.declarations[i - 1]; if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { @@ -10068,12 +15649,16 @@ var ts; } function getOrCreateTypeFromSignature(signature) { if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 133 || signature.declaration.kind === 137; + var isConstructor = signature.declaration.kind === 135 || signature.declaration.kind === 139; var type = createObjectType(32768 | 65536); type.members = emptySymbols; type.properties = emptyArray; - type.callSignatures = !isConstructor ? [signature] : emptyArray; - type.constructSignatures = isConstructor ? [signature] : emptyArray; + type.callSignatures = !isConstructor ? [ + signature + ] : emptyArray; + type.constructSignatures = isConstructor ? [ + signature + ] : emptyArray; signature.isolatedSignatureType = type; } return signature.isolatedSignatureType; @@ -10082,11 +15667,11 @@ var ts; return symbol.members["__index"]; } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 ? 118 : 120; + var syntaxKind = kind === 1 ? 119 : 121; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { var len = indexSymbol.declarations.length; - for (var _i = 0, _a = indexSymbol.declarations, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; var node = decl; if (node.parameters.length === 1) { @@ -10101,9 +15686,7 @@ var ts; } function getIndexTypeOfSymbol(symbol, kind) { var declaration = getIndexDeclarationOfSymbol(symbol, kind); - return declaration - ? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType - : undefined; + return declaration ? declaration.type ? getTypeFromTypeNodeOrHeritageClauseElement(declaration.type) : anyType : undefined; } function getConstraintOfTypeParameter(type) { if (!type.constraint) { @@ -10112,7 +15695,7 @@ var ts; type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNode(ts.getDeclarationOfKind(type.symbol, 127).constraint); + type.constraint = getTypeFromTypeNodeOrHeritageClauseElement(ts.getDeclarationOfKind(type.symbol, 128).constraint); } } return type.constraint === noConstraintType ? undefined : type.constraint; @@ -10136,7 +15719,7 @@ var ts; } function getWideningFlagsOfTypes(types) { var result = 0; - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var type = types[_i]; result |= type.flags; } @@ -10159,21 +15742,25 @@ var ts; return links.isIllegalTypeReferenceInConstraint; } var currentNode = typeReferenceNode; - while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) { + while (!ts.forEach(typeParameterSymbol.declarations, function (d) { + return d.parent === currentNode.parent; + })) { currentNode = currentNode.parent; } - links.isIllegalTypeReferenceInConstraint = currentNode.kind === 127; + links.isIllegalTypeReferenceInConstraint = currentNode.kind === 128; return links.isIllegalTypeReferenceInConstraint; } function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter) { var typeParameterSymbol; function check(n) { - if (n.kind === 139 && n.typeName.kind === 64) { + if (n.kind === 141 && n.typeName.kind === 65) { var links = getNodeLinks(n); if (links.isIllegalTypeReferenceInConstraint === undefined) { var symbol = resolveName(typeParameter, n.typeName.text, 793056, undefined, undefined); if (symbol && (symbol.flags & 262144)) { - links.isIllegalTypeReferenceInConstraint = ts.forEach(symbol.declarations, function (d) { return d.parent == typeParameter.parent; }); + links.isIllegalTypeReferenceInConstraint = ts.forEach(symbol.declarations, function (d) { + return d.parent == typeParameter.parent; + }); } } if (links.isIllegalTypeReferenceInConstraint) { @@ -10187,31 +15774,40 @@ var ts; check(typeParameter.constraint); } } - function getTypeFromTypeReferenceNode(node) { + function getTypeFromTypeReference(node) { + return getTypeFromTypeReferenceOrHeritageClauseElement(node); + } + function getTypeFromHeritageClauseElement(node) { + return getTypeFromTypeReferenceOrHeritageClauseElement(node); + } + function getTypeFromTypeReferenceOrHeritageClauseElement(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - var symbol = resolveEntityName(node.typeName, 793056); var type; - if (symbol) { - if ((symbol.flags & 262144) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { - type = unknownType; - } - else { - type = getDeclaredTypeOfSymbol(symbol); - if (type.flags & (1024 | 2048) && type.flags & 4096) { - var typeParameters = type.typeParameters; - if (node.typeArguments && node.typeArguments.length === typeParameters.length) { - type = createTypeReference(type, ts.map(node.typeArguments, getTypeFromTypeNode)); - } - else { - error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, undefined, 1), typeParameters.length); - type = undefined; - } + if (node.kind !== 177 || ts.isSupportedHeritageClauseElement(node)) { + var typeNameOrExpression = node.kind === 141 ? node.typeName : node.expression; + var symbol = resolveEntityName(typeNameOrExpression, 793056); + if (symbol) { + if ((symbol.flags & 262144) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { + type = unknownType; } else { - if (node.typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); - type = undefined; + type = getDeclaredTypeOfSymbol(symbol); + if (type.flags & (1024 | 2048) && type.flags & 4096) { + var typeParameters = type.typeParameters; + if (node.typeArguments && node.typeArguments.length === typeParameters.length) { + type = createTypeReference(type, ts.map(node.typeArguments, getTypeFromTypeNodeOrHeritageClauseElement)); + } + else { + error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, undefined, 1), typeParameters.length); + type = undefined; + } + } + else { + if (node.typeArguments) { + error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); + type = undefined; + } } } } @@ -10230,12 +15826,12 @@ var ts; function getTypeOfGlobalSymbol(symbol, arity) { function getTypeDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; switch (declaration.kind) { - case 196: - case 197: - case 199: + case 201: + case 202: + case 204: return declaration; } } @@ -10272,12 +15868,14 @@ var ts; } function createArrayType(elementType) { var arrayType = globalArrayType || getDeclaredTypeOfSymbol(globalArraySymbol); - return arrayType !== emptyObjectType ? createTypeReference(arrayType, [elementType]) : emptyObjectType; + return arrayType !== emptyObjectType ? createTypeReference(arrayType, [ + elementType + ]) : emptyObjectType; } function getTypeFromArrayTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = createArrayType(getTypeFromTypeNode(node.elementType)); + links.resolvedType = createArrayType(getTypeFromTypeNodeOrHeritageClauseElement(node.elementType)); } return links.resolvedType; } @@ -10293,7 +15891,7 @@ var ts; function getTypeFromTupleTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = createTupleType(ts.map(node.elementTypes, getTypeFromTypeNode)); + links.resolvedType = createTupleType(ts.map(node.elementTypes, getTypeFromTypeNodeOrHeritageClauseElement)); } return links.resolvedType; } @@ -10313,13 +15911,13 @@ var ts; } } function addTypesToSortedSet(sortedTypes, types) { - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var type = types[_i]; addTypeToSortedSet(sortedTypes, type); } } function isSubtypeOfAny(candidate, types) { - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var type = types[_i]; if (candidate !== type && isTypeSubtypeOf(candidate, type)) { return true; @@ -10337,7 +15935,7 @@ var ts; } } function containsAnyType(types) { - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var type = types[_i]; if (type.flags & 1) { return true; @@ -10384,7 +15982,7 @@ var ts; function getTypeFromUnionTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNode), true); + links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNodeOrHeritageClauseElement), true); } return links.resolvedType; } @@ -10410,40 +16008,42 @@ var ts; } return links.resolvedType; } - function getTypeFromTypeNode(node) { + function getTypeFromTypeNodeOrHeritageClauseElement(node) { switch (node.kind) { - case 111: - return anyType; - case 120: - return stringType; - case 118: - return numberType; case 112: - return booleanType; + return anyType; case 121: + return stringType; + case 119: + return numberType; + case 113: + return booleanType; + case 122: return esSymbolType; - case 98: + case 99: return voidType; case 8: return getTypeFromStringLiteral(node); - case 139: - return getTypeFromTypeReferenceNode(node); - case 142: - return getTypeFromTypeQueryNode(node); - case 144: - return getTypeFromArrayTypeNode(node); - case 145: - return getTypeFromTupleTypeNode(node); - case 146: - return getTypeFromUnionTypeNode(node); - case 147: - return getTypeFromTypeNode(node.type); - case 140: 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 getTypeFromTypeNodeOrHeritageClauseElement(node.type); + case 142: case 143: + case 145: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 64: - case 125: + case 65: + case 126: var symbol = getSymbolInfo(node); return symbol && getDeclaredTypeOfSymbol(symbol); default: @@ -10453,7 +16053,7 @@ var ts; function instantiateList(items, mapper, instantiator) { if (items && items.length) { var result = []; - for (var _i = 0, _n = items.length; _i < _n; _i++) { + for (var _i = 0; _i < items.length; _i++) { var v = items[_i]; result.push(instantiator(v, mapper)); } @@ -10462,15 +16062,21 @@ var ts; return items; } function createUnaryTypeMapper(source, target) { - return function (t) { return t === source ? target : t; }; + return function (t) { + return t === source ? target : t; + }; } function createBinaryTypeMapper(source1, target1, source2, target2) { - return function (t) { return t === source1 ? target1 : t === source2 ? target2 : t; }; + return function (t) { + return t === source1 ? target1 : t === source2 ? target2 : t; + }; } function createTypeMapper(sources, targets) { switch (sources.length) { - case 1: return createUnaryTypeMapper(sources[0], targets[0]); - case 2: return createBinaryTypeMapper(sources[0], targets[0], sources[1], targets[1]); + case 1: + return createUnaryTypeMapper(sources[0], targets[0]); + case 2: + return createBinaryTypeMapper(sources[0], targets[0], sources[1], targets[1]); } return function (t) { for (var i = 0; i < sources.length; i++) { @@ -10482,18 +16088,24 @@ var ts; }; } function createUnaryTypeEraser(source) { - return function (t) { return t === source ? anyType : t; }; + return function (t) { + return t === source ? anyType : t; + }; } function createBinaryTypeEraser(source1, source2) { - return function (t) { return t === source1 || t === source2 ? anyType : t; }; + return function (t) { + return t === source1 || t === source2 ? anyType : t; + }; } function createTypeEraser(sources) { switch (sources.length) { - case 1: return createUnaryTypeEraser(sources[0]); - case 2: return createBinaryTypeEraser(sources[0], sources[1]); + case 1: + return createUnaryTypeEraser(sources[0]); + case 2: + return createBinaryTypeEraser(sources[0], sources[1]); } return function (t) { - for (var _i = 0, _n = sources.length; _i < _n; _i++) { + for (var _i = 0; _i < sources.length; _i++) { var source = sources[_i]; if (t === source) { return anyType; @@ -10506,6 +16118,7 @@ var ts; return function (t) { for (var i = 0; i < context.typeParameters.length; i++) { if (t === context.typeParameters[i]) { + context.inferences[i].isFixed = true; return getInferredType(context, i); } } @@ -10516,7 +16129,9 @@ var ts; return type; } function combineTypeMappers(mapper1, mapper2) { - return function (t) { return mapper2(mapper1(t)); }; + return function (t) { + return mapper2(mapper1(t)); + }; } function instantiateTypeParameter(typeParameter, mapper) { var result = createType(512); @@ -10577,8 +16192,7 @@ var ts; return mapper(type); } if (type.flags & 32768) { - return type.symbol && type.symbol.flags & (16 | 8192 | 2048 | 4096) ? - instantiateAnonymousType(type, mapper) : type; + return type.symbol && type.symbol.flags & (16 | 8192 | 2048 | 4096) ? instantiateAnonymousType(type, mapper) : type; } if (type.flags & 4096) { return createTypeReference(type.target, instantiateList(type.typeArguments, mapper, instantiateType)); @@ -10593,33 +16207,33 @@ var ts; return type; } function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 132 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 160: - case 161: + case 162: + case 163: return isContextSensitiveFunctionLikeDeclaration(node); - case 152: + case 154: return ts.forEach(node.properties, isContextSensitive); - case 151: + case 153: return ts.forEach(node.elements, isContextSensitive); - case 168: - return isContextSensitive(node.whenTrue) || - isContextSensitive(node.whenFalse); - case 167: - return node.operatorToken.kind === 49 && - (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 218: + case 170: + return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); + case 169: + return node.operatorToken.kind === 49 && (isContextSensitive(node.left) || isContextSensitive(node.right)); + case 224: return isContextSensitive(node.initializer); - case 132: - case 131: + case 134: + case 133: return isContextSensitiveFunctionLikeDeclaration(node); - case 159: + case 161: return isContextSensitive(node.expression); } return false; } function isContextSensitiveFunctionLikeDeclaration(node) { - return !node.typeParameters && node.parameters.length && !ts.forEach(node.parameters, function (p) { return p.type; }); + return !node.typeParameters && node.parameters.length && !ts.forEach(node.parameters, function (p) { + return p.type; + }); } function getTypeWithoutConstructors(type) { if (type.flags & 48128) { @@ -10669,6 +16283,7 @@ var ts; var expandingFlags; var depth = 0; var overflow = false; + var elaborateErrors = false; ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); var result = isRelatedTo(source, target, errorNode !== undefined, headMessage); if (overflow) { @@ -10677,7 +16292,8 @@ var ts; else if (errorInfo) { if (errorInfo.next === undefined) { errorInfo = undefined; - isRelatedTo(source, target, errorNode !== undefined, headMessage, true); + elaborateErrors = true; + isRelatedTo(source, target, errorNode !== undefined, headMessage); } if (containingMessageChain) { errorInfo = ts.concatenateDiagnosticMessageChains(containingMessageChain, errorInfo); @@ -10688,9 +16304,8 @@ var ts; function reportError(message, arg0, arg1, arg2) { errorInfo = ts.chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2); } - function isRelatedTo(source, target, reportErrors, headMessage, elaborateErrors) { - if (elaborateErrors === void 0) { elaborateErrors = false; } - var _result; + function isRelatedTo(source, target, reportErrors, headMessage) { + var result; if (source === target) return -1; if (relation !== identityRelation) { @@ -10714,54 +16329,53 @@ var ts; if (source.flags & 16384 || target.flags & 16384) { if (relation === identityRelation) { if (source.flags & 16384 && target.flags & 16384) { - if (_result = unionTypeRelatedToUnionType(source, target)) { - if (_result &= unionTypeRelatedToUnionType(target, source)) { - return _result; + if (result = unionTypeRelatedToUnionType(source, target)) { + if (result &= unionTypeRelatedToUnionType(target, source)) { + return result; } } } else if (source.flags & 16384) { - if (_result = unionTypeRelatedToType(source, target, reportErrors)) { - return _result; + if (result = unionTypeRelatedToType(source, target, reportErrors)) { + return result; } } else { - if (_result = unionTypeRelatedToType(target, source, reportErrors)) { - return _result; + if (result = unionTypeRelatedToType(target, source, reportErrors)) { + return result; } } } else { if (source.flags & 16384) { - if (_result = unionTypeRelatedToType(source, target, reportErrors)) { - return _result; + if (result = unionTypeRelatedToType(source, target, reportErrors)) { + return result; } } else { - if (_result = typeRelatedToUnionType(source, target, reportErrors)) { - return _result; + if (result = typeRelatedToUnionType(source, target, reportErrors)) { + return result; } } } } else if (source.flags & 512 && target.flags & 512) { - if (_result = typeParameterRelatedTo(source, target, reportErrors)) { - return _result; + if (result = typeParameterRelatedTo(source, target, reportErrors)) { + return result; } } else { var saveErrorInfo = errorInfo; if (source.flags & 4096 && target.flags & 4096 && source.target === target.target) { - if (_result = typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { - return _result; + if (result = typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { + return result; } } var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; var sourceOrApparentType = relation === identityRelation ? source : getApparentType(source); - if (sourceOrApparentType.flags & 48128 && target.flags & 48128 && - (_result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors, elaborateErrors))) { + if (sourceOrApparentType.flags & 48128 && target.flags & 48128 && (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors))) { errorInfo = saveErrorInfo; - return _result; + return result; } } if (reportErrors) { @@ -10777,17 +16391,17 @@ var ts; return 0; } function unionTypeRelatedToUnionType(source, target) { - var _result = -1; + var result = -1; var sourceTypes = source.types; - for (var _i = 0, _n = sourceTypes.length; _i < _n; _i++) { + for (var _i = 0; _i < sourceTypes.length; _i++) { var sourceType = sourceTypes[_i]; var related = typeRelatedToUnionType(sourceType, target, false); if (!related) { return 0; } - _result &= related; + result &= related; } - return _result; + return result; } function typeRelatedToUnionType(source, target, reportErrors) { var targetTypes = target.types; @@ -10800,28 +16414,28 @@ var ts; return 0; } function unionTypeRelatedToType(source, target, reportErrors) { - var _result = -1; + var result = -1; var sourceTypes = source.types; - for (var _i = 0, _n = sourceTypes.length; _i < _n; _i++) { + for (var _i = 0; _i < sourceTypes.length; _i++) { var sourceType = sourceTypes[_i]; var related = isRelatedTo(sourceType, target, reportErrors); if (!related) { return 0; } - _result &= related; + result &= related; } - return _result; + return result; } function typesRelatedTo(sources, targets, reportErrors) { - var _result = -1; + var result = -1; for (var i = 0, len = sources.length; i < len; i++) { var related = isRelatedTo(sources[i], targets[i], reportErrors); if (!related) { return 0; } - _result &= related; + result &= related; } - return _result; + return result; } function typeParameterRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { @@ -10848,8 +16462,7 @@ var ts; return 0; } } - function objectTypeRelatedTo(source, target, reportErrors, elaborateErrors) { - if (elaborateErrors === void 0) { elaborateErrors = false; } + function objectTypeRelatedTo(source, target, reportErrors) { if (overflow) { return 0; } @@ -10887,20 +16500,20 @@ var ts; expandingFlags |= 1; if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack)) expandingFlags |= 2; - var _result; + var result; if (expandingFlags === 3) { - _result = 1; + result = 1; } else { - _result = propertiesRelatedTo(source, target, reportErrors); - if (_result) { - _result &= signaturesRelatedTo(source, target, 0, reportErrors); - if (_result) { - _result &= signaturesRelatedTo(source, target, 1, reportErrors); - if (_result) { - _result &= stringIndexTypesRelatedTo(source, target, reportErrors); - if (_result) { - _result &= numberIndexTypesRelatedTo(source, target, reportErrors); + result = propertiesRelatedTo(source, target, reportErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 0, reportErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 1, reportErrors); + if (result) { + result &= stringIndexTypesRelatedTo(source, target, reportErrors); + if (result) { + result &= numberIndexTypesRelatedTo(source, target, reportErrors); } } } @@ -10908,23 +16521,23 @@ var ts; } expandingFlags = saveExpandingFlags; depth--; - if (_result) { + if (result) { var maybeCache = maybeStack[depth]; - var destinationCache = (_result === -1 || depth === 0) ? relation : maybeStack[depth - 1]; + var destinationCache = (result === -1 || depth === 0) ? relation : maybeStack[depth - 1]; ts.copyMap(maybeCache, destinationCache); } else { relation[id] = reportErrors ? 3 : 2; } - return _result; + return result; } function isDeeplyNestedGeneric(type, stack) { if (type.flags & 4096 && depth >= 10) { - var _target = type.target; + var target_1 = type.target; var count = 0; for (var i = 0; i < depth; i++) { var t = stack[i]; - if (t.flags & 4096 && t.target === _target) { + if (t.flags & 4096 && t.target === target_1) { count++; if (count >= 10) return true; @@ -10937,10 +16550,10 @@ var ts; if (relation === identityRelation) { return propertiesIdenticalTo(source, target); } - var _result = -1; + var result = -1; var properties = getPropertiesOfObjectType(target); var requireOptionalProperties = relation === subtypeRelation && !(source.flags & 131072); - for (var _i = 0, _n = properties.length; _i < _n; _i++) { + for (var _i = 0; _i < properties.length; _i++) { var targetProp = properties[_i]; var sourceProp = getPropertyOfType(source, targetProp.name); if (sourceProp !== targetProp) { @@ -10992,7 +16605,7 @@ var ts; } return 0; } - _result &= related; + result &= related; if (sourceProp.flags & 536870912 && !(targetProp.flags & 536870912)) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); @@ -11002,7 +16615,7 @@ var ts; } } } - return _result; + return result; } function propertiesIdenticalTo(source, target) { var sourceProperties = getPropertiesOfObjectType(source); @@ -11010,8 +16623,8 @@ var ts; if (sourceProperties.length !== targetProperties.length) { return 0; } - var _result = -1; - for (var _i = 0, _n = sourceProperties.length; _i < _n; _i++) { + var result = -1; + for (var _i = 0; _i < sourceProperties.length; _i++) { var sourceProp = sourceProperties[_i]; var targetProp = getPropertyOfObjectType(target, sourceProp.name); if (!targetProp) { @@ -11021,9 +16634,9 @@ var ts; if (!related) { return 0; } - _result &= related; + result &= related; } - return _result; + return result; } function signaturesRelatedTo(source, target, kind, reportErrors) { if (relation === identityRelation) { @@ -11034,18 +16647,18 @@ var ts; } var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); - var _result = -1; + var result = -1; var saveErrorInfo = errorInfo; - outer: for (var _i = 0, _n = targetSignatures.length; _i < _n; _i++) { + outer: for (var _i = 0; _i < targetSignatures.length; _i++) { var t = targetSignatures[_i]; if (!t.hasStringLiterals || target.flags & 65536) { var localErrors = reportErrors; - for (var _a = 0, _b = sourceSignatures.length; _a < _b; _a++) { + for (var _a = 0; _a < sourceSignatures.length; _a++) { var s = sourceSignatures[_a]; if (!s.hasStringLiterals || source.flags & 65536) { var related = signatureRelatedTo(s, t, localErrors); if (related) { - _result &= related; + result &= related; errorInfo = saveErrorInfo; continue outer; } @@ -11055,7 +16668,7 @@ var ts; return 0; } } - return _result; + return result; } function signatureRelatedTo(source, target, reportErrors) { if (source === target) { @@ -11085,14 +16698,14 @@ var ts; } source = getErasedSignature(source); target = getErasedSignature(target); - var _result = -1; + var result = -1; for (var i = 0; i < checkCount; i++) { - var _s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); - var _t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); + var s_1 = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); + var t_1 = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); var saveErrorInfo = errorInfo; - var related = isRelatedTo(_s, _t, reportErrors); + var related = isRelatedTo(s_1, t_1, reportErrors); if (!related) { - related = isRelatedTo(_t, _s, false); + related = isRelatedTo(t_1, s_1, false); if (!related) { if (reportErrors) { reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); @@ -11101,13 +16714,13 @@ var ts; } errorInfo = saveErrorInfo; } - _result &= related; + result &= related; } var t = getReturnTypeOfSignature(target); if (t === voidType) - return _result; + return result; var s = getReturnTypeOfSignature(source); - return _result & isRelatedTo(s, t, reportErrors); + return result & isRelatedTo(s, t, reportErrors); } function signaturesIdenticalTo(source, target, kind) { var sourceSignatures = getSignaturesOfType(source, kind); @@ -11115,15 +16728,15 @@ var ts; if (sourceSignatures.length !== targetSignatures.length) { return 0; } - var _result = -1; + var result = -1; for (var i = 0, len = sourceSignatures.length; i < len; ++i) { var related = compareSignatures(sourceSignatures[i], targetSignatures[i], true, isRelatedTo); if (!related) { return 0; } - _result &= related; + result &= related; } - return _result; + return result; } function stringIndexTypesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { @@ -11220,9 +16833,7 @@ var ts; if (source === target) { return -1; } - if (source.parameters.length !== target.parameters.length || - source.minArgumentCount !== target.minArgumentCount || - source.hasRestParameter !== target.hasRestParameter) { + if (source.parameters.length !== target.parameters.length || source.minArgumentCount !== target.minArgumentCount || source.hasRestParameter !== target.hasRestParameter) { return 0; } var result = -1; @@ -11243,14 +16854,14 @@ var ts; } source = getErasedSignature(source); target = getErasedSignature(target); - for (var _i = 0, _len = source.parameters.length; _i < _len; _i++) { - var s = source.hasRestParameter && _i === _len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[_i]); - var t = target.hasRestParameter && _i === _len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[_i]); - var _related = compareTypes(s, t); - if (!_related) { + for (var i = 0, len = source.parameters.length; i < len; i++) { + var s = source.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); + var t = target.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]); + var related = compareTypes(s, t); + if (!related) { return 0; } - result &= _related; + result &= related; } if (compareReturnTypes) { result &= compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); @@ -11258,7 +16869,7 @@ var ts; return result; } function isSupertypeOfEach(candidate, types) { - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var type = types[_i]; if (candidate !== type && !isTypeSubtypeOf(type, candidate)) return false; @@ -11266,7 +16877,9 @@ var ts; return true; } function getCommonSupertype(types) { - return ts.forEach(types, function (t) { return isSupertypeOfEach(t, types) ? t : undefined; }); + return ts.forEach(types, function (t) { + return isSupertypeOfEach(t, types) ? t : undefined; + }); } function reportNoCommonSupertypeError(types, errorLocation, errorMessageChainHead) { var bestSupertype; @@ -11283,6 +16896,7 @@ var ts; downfallType = types[j]; } } + ts.Debug.assert(!!downfallType, "If there is no common supertype, each type should have a downfallType"); if (score > bestSupertypeScore) { bestSupertype = types[i]; bestSupertypeDownfallType = downfallType; @@ -11363,17 +16977,17 @@ var ts; return reportWideningErrorsInType(type.typeArguments[0]); } if (type.flags & 131072) { - var _errorReported = false; + var errorReported = false; ts.forEach(getPropertiesOfObjectType(type), function (p) { var t = getTypeOfSymbol(p); if (t.flags & 262144) { if (!reportWideningErrorsInType(t)) { error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, p.name, typeToString(getWidenedType(t))); } - _errorReported = true; + errorReported = true; } }); - return _errorReported; + return errorReported; } return false; } @@ -11381,22 +16995,20 @@ var ts; var typeAsString = typeToString(getWidenedType(type)); var diagnostic; switch (declaration.kind) { - case 130: - case 129: - diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; - break; - case 128: - diagnostic = declaration.dotDotDotToken ? - ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : - ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; - break; - case 195: case 132: case 131: + diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; + break; + case 129: + 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 134: - case 135: - case 160: - case 161: + case 133: + case 136: + case 137: + case 162: + case 163: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; @@ -11443,14 +17055,17 @@ var ts; } function createInferenceContext(typeParameters, inferUnionTypes) { var inferences = []; - for (var _i = 0, _n = typeParameters.length; _i < _n; _i++) { + for (var _i = 0; _i < typeParameters.length; _i++) { var unused = typeParameters[_i]; - inferences.push({ primary: undefined, secondary: undefined }); + inferences.push({ + primary: undefined, + secondary: undefined, + isFixed: false + }); } return { typeParameters: typeParameters, inferUnionTypes: inferUnionTypes, - inferenceCount: 0, inferences: inferences, inferredTypes: new Array(typeParameters.length) }; @@ -11471,11 +17086,11 @@ var ts; } function isWithinDepthLimit(type, stack) { if (depth >= 5) { - var _target = type.target; + var target_2 = type.target; var count = 0; for (var i = 0; i < depth; i++) { var t = stack[i]; - if (t.flags & 4096 && t.target === _target) { + if (t.flags & 4096 && t.target === target_2) { count++; } } @@ -11492,28 +17107,29 @@ var ts; for (var i = 0; i < typeParameters.length; i++) { if (target === typeParameters[i]) { var inferences = context.inferences[i]; - var candidates = inferiority ? - inferences.secondary || (inferences.secondary = []) : - inferences.primary || (inferences.primary = []); - if (!ts.contains(candidates, source)) - candidates.push(source); - break; + if (!inferences.isFixed) { + var candidates = inferiority ? inferences.secondary || (inferences.secondary = []) : inferences.primary || (inferences.primary = []); + if (!ts.contains(candidates, source)) { + candidates.push(source); + } + } + return; } } } else if (source.flags & 4096 && target.flags & 4096 && source.target === target.target) { var sourceTypes = source.typeArguments; var targetTypes = target.typeArguments; - for (var _i = 0; _i < sourceTypes.length; _i++) { - inferFromTypes(sourceTypes[_i], targetTypes[_i]); + for (var i = 0; i < sourceTypes.length; i++) { + inferFromTypes(sourceTypes[i], targetTypes[i]); } } else if (target.flags & 16384) { - var _targetTypes = target.types; + var targetTypes = target.types; var typeParameterCount = 0; var typeParameter; - for (var _a = 0, _n = _targetTypes.length; _a < _n; _a++) { - var t = _targetTypes[_a]; + for (var _i = 0; _i < targetTypes.length; _i++) { + var t = targetTypes[_i]; if (t.flags & 512 && ts.contains(context.typeParameters, t)) { typeParameter = t; typeParameterCount++; @@ -11529,14 +17145,13 @@ var ts; } } else if (source.flags & 16384) { - var _sourceTypes = source.types; - for (var _b = 0, _c = _sourceTypes.length; _b < _c; _b++) { - var sourceType = _sourceTypes[_b]; + var sourceTypes = source.types; + for (var _a = 0; _a < sourceTypes.length; _a++) { + var sourceType = sourceTypes[_a]; inferFromTypes(sourceType, target); } } - else if (source.flags & 48128 && (target.flags & (4096 | 8192) || - (target.flags & 32768) && target.symbol && target.symbol.flags & (8192 | 2048))) { + else if (source.flags & 48128 && (target.flags & (4096 | 8192) || (target.flags & 32768) && target.symbol && target.symbol.flags & (8192 | 2048))) { if (!isInProcess(source, target) && isWithinDepthLimit(source, sourceStack) && isWithinDepthLimit(target, targetStack)) { if (depth === 0) { sourceStack = []; @@ -11557,7 +17172,7 @@ var ts; } function inferFromProperties(source, target) { var properties = getPropertiesOfObjectType(target); - for (var _i = 0, _n = properties.length; _i < _n; _i++) { + for (var _i = 0; _i < properties.length; _i++) { var targetProp = properties[_i]; var sourceProp = getPropertyOfObjectType(source, targetProp.name); if (sourceProp) { @@ -11595,19 +17210,25 @@ var ts; } function getInferredType(context, index) { var inferredType = context.inferredTypes[index]; + var inferenceSucceeded; if (!inferredType) { var inferences = getInferenceCandidates(context, index); if (inferences.length) { var unionOrSuperType = context.inferUnionTypes ? getUnionType(inferences) : getCommonSupertype(inferences); - inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : inferenceFailureType; + inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : unknownType; + inferenceSucceeded = !!unionOrSuperType; } else { inferredType = emptyObjectType; + inferenceSucceeded = true; } - if (inferredType !== inferenceFailureType) { + if (inferenceSucceeded) { var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); inferredType = constraint && !isTypeAssignableTo(inferredType, constraint) ? constraint : inferredType; } + else if (context.failedTypeParameterIndex === undefined || context.failedTypeParameterIndex > index) { + context.failedTypeParameterIndex = index; + } context.inferredTypes[index] = inferredType; } return inferredType; @@ -11624,17 +17245,17 @@ var ts; function getResolvedSymbol(node) { var links = getNodeLinks(node); if (!links.resolvedSymbol) { - links.resolvedSymbol = (ts.getFullWidth(node) > 0 && resolveName(node, node.text, 107455 | 1048576, ts.Diagnostics.Cannot_find_name_0, node)) || unknownSymbol; + links.resolvedSymbol = (!ts.nodeIsMissing(node) && resolveName(node, node.text, 107455 | 1048576, ts.Diagnostics.Cannot_find_name_0, node)) || unknownSymbol; } return links.resolvedSymbol; } function isInTypeQuery(node) { while (node) { switch (node.kind) { - case 142: + case 144: return true; - case 64: - case 125: + case 65: + case 126: node = node.parent; continue; default: @@ -11646,8 +17267,12 @@ var ts; function removeTypesFromUnionType(type, typeKind, isOfTypeKind, allowEmptyUnionResult) { if (type.flags & 16384) { var types = type.types; - if (ts.forEach(types, function (t) { return !!(t.flags & typeKind) === isOfTypeKind; })) { - var narrowedType = getUnionType(ts.filter(types, function (t) { return !(t.flags & typeKind) === isOfTypeKind; })); + if (ts.forEach(types, function (t) { + return !!(t.flags & typeKind) === isOfTypeKind; + })) { + var narrowedType = getUnionType(ts.filter(types, function (t) { + return !(t.flags & typeKind) === isOfTypeKind; + })); if (allowEmptyUnionResult || narrowedType !== emptyObjectType) { return narrowedType; } @@ -11674,12 +17299,12 @@ var ts; } return links.assignmentChecks[symbol.id] = isAssignedIn(node); function isAssignedInBinaryExpression(node) { - if (node.operatorToken.kind >= 52 && node.operatorToken.kind <= 63) { + if (node.operatorToken.kind >= 53 && node.operatorToken.kind <= 64) { var n = node.left; - while (n.kind === 159) { + while (n.kind === 161) { n = n.expression; } - if (n.kind === 64 && getResolvedSymbol(n) === symbol) { + if (n.kind === 65 && getResolvedSymbol(n) === symbol) { return true; } } @@ -11693,46 +17318,46 @@ var ts; } function isAssignedIn(node) { switch (node.kind) { - case 167: + case 169: return isAssignedInBinaryExpression(node); - case 193: - case 150: - return isAssignedInVariableDeclaration(node); - case 148: - case 149: - case 151: + case 198: case 152: + return isAssignedInVariableDeclaration(node); + case 150: + case 151: case 153: case 154: case 155: case 156: + case 157: case 158: - case 159: - case 165: - case 162: - case 163: + case 160: + case 161: + case 167: case 164: + case 165: case 166: case 168: - case 171: - case 174: - case 175: - case 177: - case 178: + case 170: + case 173: case 179: case 180: - case 181: case 182: case 183: + case 184: + case 185: case 186: case 187: case 188: - case 214: - case 215: - case 189: - case 190: case 191: - case 217: + case 192: + case 193: + case 220: + case 221: + case 194: + case 195: + case 196: + case 223: return ts.forEachChild(node, isAssignedIn); } return false; @@ -11740,13 +17365,14 @@ var ts; } function resolveLocation(node) { var containerNodes = []; - for (var _parent = node.parent; _parent; _parent = _parent.parent) { - if ((ts.isExpression(_parent) || ts.isObjectLiteralMethod(node)) && - isContextSensitive(_parent)) { - containerNodes.unshift(_parent); + for (var parent_3 = node.parent; parent_3; parent_3 = parent_3.parent) { + if ((ts.isExpression(parent_3) || ts.isObjectLiteralMethod(node)) && isContextSensitive(parent_3)) { + containerNodes.unshift(parent_3); } } - ts.forEach(containerNodes, function (node) { getTypeOfNode(node); }); + ts.forEach(containerNodes, function (node) { + getTypeOfNode(node); + }); } function getSymbolAtLocation(node) { resolveLocation(node); @@ -11768,17 +17394,17 @@ var ts; node = node.parent; var narrowedType = type; switch (node.kind) { - case 178: + case 183: if (child !== node.expression) { narrowedType = narrowType(type, node.expression, child === node.thenStatement); } break; - case 168: + case 170: if (child !== node.condition) { narrowedType = narrowType(type, node.condition, child === node.whenTrue); } break; - case 167: + case 169: if (child === node.right) { if (node.operatorToken.kind === 48) { narrowedType = narrowType(type, node.left, true); @@ -11788,14 +17414,14 @@ var ts; } } break; - case 221: + case 227: + case 205: case 200: - case 195: - case 132: - case 131: case 134: - case 135: case 133: + case 136: + case 137: + case 135: break loop; } if (narrowedType !== type) { @@ -11808,12 +17434,12 @@ var ts; } return type; function narrowTypeByEquality(type, expr, assumeTrue) { - if (expr.left.kind !== 163 || expr.right.kind !== 8) { + if (expr.left.kind !== 165 || expr.right.kind !== 8) { return type; } var left = expr.left; var right = expr.right; - if (left.expression.kind !== 64 || getResolvedSymbol(left.expression) !== symbol) { + if (left.expression.kind !== 65 || getResolvedSymbol(left.expression) !== symbol) { return type; } var typeInfo = primitiveTypeInfo[right.text]; @@ -11859,7 +17485,7 @@ var ts; } } function narrowTypeByInstanceof(type, expr, assumeTrue) { - if (type.flags & 1 || !assumeTrue || expr.left.kind !== 64 || getResolvedSymbol(expr.left) !== symbol) { + if (type.flags & 1 || !assumeTrue || expr.left.kind !== 65 || getResolvedSymbol(expr.left) !== symbol) { return type; } var rightType = checkExpression(expr.right); @@ -11875,15 +17501,17 @@ var ts; return targetType; } if (type.flags & 16384) { - return getUnionType(ts.filter(type.types, function (t) { return isTypeSubtypeOf(t, targetType); })); + return getUnionType(ts.filter(type.types, function (t) { + return isTypeSubtypeOf(t, targetType); + })); } return type; } function narrowType(type, expr, assumeTrue) { switch (expr.kind) { - case 159: + case 161: return narrowType(type, expr.expression, assumeTrue); - case 167: + case 169: var operator = expr.operatorToken.kind; if (operator === 30 || operator === 31) { return narrowTypeByEquality(type, expr, assumeTrue); @@ -11894,11 +17522,11 @@ var ts; else if (operator === 49) { return narrowTypeByOr(type, expr, assumeTrue); } - else if (operator === 86) { + else if (operator === 87) { return narrowTypeByInstanceof(type, expr, assumeTrue); } break; - case 165: + case 167: if (expr.operator === 46) { return narrowType(type, expr.operand, !assumeTrue); } @@ -11909,7 +17537,7 @@ var ts; } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); - if (symbol === argumentsSymbol && ts.getContainingFunction(node).kind === 161) { + if (symbol === argumentsSymbol && ts.getContainingFunction(node).kind === 163) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression); } if (symbol.flags & 8388608 && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { @@ -11931,17 +17559,15 @@ var ts; return false; } function checkBlockScopedBindingCapturedInLoop(node, symbol) { - if (languageVersion >= 2 || - (symbol.flags & 2) === 0 || - symbol.valueDeclaration.parent.kind === 217) { + if (languageVersion >= 2 || (symbol.flags & 2) === 0 || symbol.valueDeclaration.parent.kind === 223) { return; } var container = symbol.valueDeclaration; - while (container.kind !== 194) { + while (container.kind !== 199) { container = container.parent; } container = container.parent; - if (container.kind === 175) { + if (container.kind === 180) { container = container.parent; } var inFunction = isInsideFunction(node.parent, container); @@ -11958,9 +17584,9 @@ var ts; } } function captureLexicalThis(node, container) { - var classNode = container.parent && container.parent.kind === 196 ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 201 ? container.parent : undefined; getNodeLinks(node).flags |= 2; - if (container.kind === 130 || container.kind === 133) { + if (container.kind === 132 || container.kind === 135) { getNodeLinks(classNode).flags |= 4; } else { @@ -11970,36 +17596,36 @@ var ts; function checkThisExpression(node) { var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; - if (container.kind === 161) { + if (container.kind === 163) { container = ts.getThisContainer(container, false); needToCaptureLexicalThis = (languageVersion < 2); } switch (container.kind) { - case 200: + case 205: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_body); break; - case 199: + case 204: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); break; - case 133: + case 135: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; - case 130: - case 129: + case 132: + case 131: if (container.flags & 128) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } break; - case 126: + case 127: 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 === 196 ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 201 ? container.parent : undefined; if (classNode) { var symbol = getSymbolOfNode(classNode); return container.flags & 128 ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); @@ -12008,17 +17634,17 @@ var ts; } function isInConstructorArgumentInitializer(node, constructorDecl) { for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 128) { + if (n.kind === 129) { return true; } } return false; } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 155 && node.parent.expression === node; - var enclosingClass = ts.getAncestor(node, 196); + var isCallExpression = node.parent.kind === 157 && node.parent.expression === node; + var enclosingClass = ts.getAncestor(node, 201); var baseClass; - if (enclosingClass && ts.getClassBaseTypeNode(enclosingClass)) { + if (enclosingClass && ts.getClassExtendsHeritageClauseElement(enclosingClass)) { var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); baseClass = classType.baseTypes.length && classType.baseTypes[0]; } @@ -12031,31 +17657,20 @@ var ts; var canUseSuperExpression = false; var needToCaptureLexicalThis; if (isCallExpression) { - canUseSuperExpression = container.kind === 133; + canUseSuperExpression = container.kind === 135; } else { needToCaptureLexicalThis = false; - while (container && container.kind === 161) { + while (container && container.kind === 163) { container = ts.getSuperContainer(container, true); needToCaptureLexicalThis = true; } - if (container && container.parent && container.parent.kind === 196) { + if (container && container.parent && container.parent.kind === 201) { if (container.flags & 128) { - canUseSuperExpression = - container.kind === 132 || - container.kind === 131 || - container.kind === 134 || - container.kind === 135; + canUseSuperExpression = container.kind === 134 || container.kind === 133 || container.kind === 136 || container.kind === 137; } else { - canUseSuperExpression = - container.kind === 132 || - container.kind === 131 || - container.kind === 134 || - container.kind === 135 || - container.kind === 130 || - container.kind === 129 || - container.kind === 133; + canUseSuperExpression = container.kind === 134 || container.kind === 133 || container.kind === 136 || container.kind === 137 || container.kind === 132 || container.kind === 131 || container.kind === 135; } } } @@ -12069,7 +17684,7 @@ var ts; getNodeLinks(node).flags |= 16; returnType = baseClass; } - if (container.kind === 133 && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 135 && isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); returnType = unknownType; } @@ -12079,7 +17694,7 @@ var ts; return returnType; } } - if (container.kind === 126) { + if (container.kind === 127) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { @@ -12102,8 +17717,7 @@ var ts; if (indexOfParameter < len) { return getTypeAtPosition(contextualSignature, indexOfParameter); } - if (indexOfParameter === (func.parameters.length - 1) && - funcHasRestParameters && contextualSignature.hasRestParameter && func.parameters.length >= contextualSignature.parameters.length) { + if (indexOfParameter === (func.parameters.length - 1) && funcHasRestParameters && contextualSignature.hasRestParameter && func.parameters.length >= contextualSignature.parameters.length) { return getTypeOfSymbol(contextualSignature.parameters[contextualSignature.parameters.length - 1]); } } @@ -12115,9 +17729,9 @@ var ts; var declaration = node.parent; if (node === declaration.initializer) { if (declaration.type) { - return getTypeFromTypeNode(declaration.type); + return getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); } - if (declaration.kind === 128) { + if (declaration.kind === 129) { var type = getContextuallyTypedParameterType(declaration); if (type) { return type; @@ -12132,7 +17746,7 @@ var ts; function getContextualTypeForReturnExpression(node) { var func = ts.getContainingFunction(node); if (func) { - if (func.type || func.kind === 133 || func.kind === 134 && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(func.symbol, 135))) { + if (func.type || func.kind === 135 || func.kind === 136 && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(func.symbol, 137))) { return getReturnTypeOfSignature(getSignatureFromDeclaration(func)); } var signature = getContextualSignatureForFunctionLikeDeclaration(func); @@ -12152,7 +17766,7 @@ var ts; return undefined; } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 157) { + if (template.parent.kind === 159) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -12160,7 +17774,7 @@ var ts; function getContextualTypeForBinaryOperand(node) { var binaryExpression = node.parent; var operator = binaryExpression.operatorToken.kind; - if (operator >= 52 && operator <= 63) { + if (operator >= 53 && operator <= 64) { if (node === binaryExpression.right) { return checkExpression(binaryExpression.left); } @@ -12181,7 +17795,7 @@ var ts; var types = type.types; var mappedType; var mappedTypes; - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var current = types[_i]; var t = mapper(current); if (t) { @@ -12189,7 +17803,10 @@ var ts; mappedType = t; } else if (!mappedTypes) { - mappedTypes = [mappedType, t]; + mappedTypes = [ + mappedType, + t + ]; } else { mappedTypes.push(t); @@ -12205,13 +17822,17 @@ var ts; }); } function getIndexTypeOfContextualType(type, kind) { - return applyToContextualType(type, function (t) { return getIndexTypeOfObjectOrUnionType(t, kind); }); + return applyToContextualType(type, function (t) { + return getIndexTypeOfObjectOrUnionType(t, kind); + }); } function contextualTypeIsTupleLikeType(type) { return !!(type.flags & 16384 ? ts.forEach(type.types, isTupleLikeType) : isTupleLikeType(type)); } function contextualTypeHasIndexSignature(type, kind) { - return !!(type.flags & 16384 ? ts.forEach(type.types, function (t) { return getIndexTypeOfObjectOrUnionType(t, kind); }) : getIndexTypeOfObjectOrUnionType(type, kind)); + return !!(type.flags & 16384 ? ts.forEach(type.types, function (t) { + return getIndexTypeOfObjectOrUnionType(t, kind); + }) : getIndexTypeOfObjectOrUnionType(type, kind)); } function getContextualTypeForObjectLiteralMethod(node) { ts.Debug.assert(ts.isObjectLiteralMethod(node)); @@ -12231,8 +17852,7 @@ var ts; return propertyType; } } - return isNumericName(element.name) && getIndexTypeOfContextualType(type, 1) || - getIndexTypeOfContextualType(type, 0); + return isNumericName(element.name) && getIndexTypeOfContextualType(type, 1) || getIndexTypeOfContextualType(type, 0); } return undefined; } @@ -12241,9 +17861,7 @@ var ts; var type = getContextualType(arrayLiteral); if (type) { var index = ts.indexOf(arrayLiteral.elements, node); - return getTypeOfPropertyOfContextualType(type, "" + index) - || getIndexTypeOfContextualType(type, 1) - || (languageVersion >= 2 ? checkIteratedType(type, undefined) : undefined); + return getTypeOfPropertyOfContextualType(type, "" + index) || getIndexTypeOfContextualType(type, 1) || (languageVersion >= 2 ? checkIteratedType(type, undefined) : undefined); } return undefined; } @@ -12258,35 +17876,35 @@ var ts; if (node.contextualType) { return node.contextualType; } - var _parent = node.parent; - switch (_parent.kind) { - case 193: - case 128: - case 130: + var parent = node.parent; + switch (parent.kind) { + case 198: case 129: - case 150: + case 132: + case 131: + case 152: return getContextualTypeForInitializerExpression(node); - case 161: - case 186: + case 163: + case 191: return getContextualTypeForReturnExpression(node); - case 155: - case 156: - return getContextualTypeForArgument(_parent, node); + case 157: case 158: - return getTypeFromTypeNode(_parent.type); - case 167: + return getContextualTypeForArgument(parent, node); + case 160: + return getTypeFromTypeNodeOrHeritageClauseElement(parent.type); + case 169: return getContextualTypeForBinaryOperand(node); - case 218: - return getContextualTypeForObjectLiteralElement(_parent); - case 151: + case 224: + return getContextualTypeForObjectLiteralElement(parent); + case 153: return getContextualTypeForElementExpression(node); - case 168: + case 170: return getContextualTypeForConditionalOperand(node); - case 173: - ts.Debug.assert(_parent.parent.kind === 169); - return getContextualTypeForSubstitutionExpression(_parent.parent, node); - case 159: - return getContextualType(_parent); + case 176: + ts.Debug.assert(parent.parent.kind === 171); + return getContextualTypeForSubstitutionExpression(parent.parent, node); + case 161: + return getContextualType(parent); } return undefined; } @@ -12300,16 +17918,14 @@ var ts; } } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 160 || node.kind === 161; + return node.kind === 162 || node.kind === 163; } function getContextualSignatureForFunctionLikeDeclaration(node) { return isFunctionExpressionOrArrowFunction(node) ? getContextualSignature(node) : undefined; } function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 132 || ts.isObjectLiteralMethod(node)); - var type = ts.isObjectLiteralMethod(node) - ? getContextualTypeForObjectLiteralMethod(node) - : getContextualType(node); + ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); + var type = ts.isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node) : getContextualType(node); if (!type) { return undefined; } @@ -12318,16 +17934,17 @@ var ts; } var signatureList; var types = type.types; - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var current = types[_i]; - if (signatureList && - getSignaturesOfObjectOrUnionType(current, 0).length > 1) { + if (signatureList && getSignaturesOfObjectOrUnionType(current, 0).length > 1) { return undefined; } var signature = getNonGenericSignature(current); if (signature) { if (!signatureList) { - signatureList = [signature]; + signatureList = [ + signature + ]; } else if (!compareSignatures(signatureList[0], signature, false, compareTypes)) { return undefined; @@ -12349,15 +17966,15 @@ var ts; return mapper && mapper !== identityMapper; } function isAssignmentTarget(node) { - var _parent = node.parent; - if (_parent.kind === 167 && _parent.operatorToken.kind === 52 && _parent.left === node) { + var parent = node.parent; + if (parent.kind === 169 && parent.operatorToken.kind === 53 && parent.left === node) { return true; } - if (_parent.kind === 218) { - return isAssignmentTarget(_parent.parent); + if (parent.kind === 224) { + return isAssignmentTarget(parent.parent); } - if (_parent.kind === 151) { - return isAssignmentTarget(_parent); + if (parent.kind === 153) { + return isAssignmentTarget(parent); } return false; } @@ -12378,7 +17995,7 @@ var ts; var elementTypes = []; ts.forEach(elements, function (e) { var type = checkExpression(e, contextualMapper); - if (e.kind === 171) { + if (e.kind === 173) { elementTypes.push(getIndexTypeOfType(type, 1) || anyType); hasSpreadElement = true; } @@ -12395,7 +18012,7 @@ var ts; return createArrayType(getUnionType(elementTypes)); } function isNumericName(name) { - return name.kind === 126 ? isNumericComputedName(name) : isNumericLiteralName(name.text); + return name.kind === 127 ? isNumericComputedName(name) : isNumericLiteralName(name.text); } function isNumericComputedName(name) { return allConstituentTypesHaveKind(checkComputedPropertyName(name), 1 | 132); @@ -12422,24 +18039,20 @@ var ts; var propertiesArray = []; var contextualType = getContextualType(node); var typeFlags; - for (var _i = 0, _a = node.properties, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var memberDecl = _a[_i]; var member = memberDecl.symbol; - if (memberDecl.kind === 218 || - memberDecl.kind === 219 || - ts.isObjectLiteralMethod(memberDecl)) { + if (memberDecl.kind === 224 || memberDecl.kind === 225 || ts.isObjectLiteralMethod(memberDecl)) { var type = void 0; - if (memberDecl.kind === 218) { + if (memberDecl.kind === 224) { type = checkPropertyAssignment(memberDecl, contextualMapper); } - else if (memberDecl.kind === 132) { + else if (memberDecl.kind === 134) { type = checkObjectLiteralMethod(memberDecl, contextualMapper); } else { - ts.Debug.assert(memberDecl.kind === 219); - type = memberDecl.name.kind === 126 - ? unknownType - : checkExpression(memberDecl.name, contextualMapper); + ts.Debug.assert(memberDecl.kind === 225); + type = memberDecl.name.kind === 127 ? unknownType : checkExpression(memberDecl.name, contextualMapper); } typeFlags |= type.flags; var prop = createSymbol(4 | 67108864 | member.flags, member.name); @@ -12453,7 +18066,7 @@ var ts; member = prop; } else { - ts.Debug.assert(memberDecl.kind === 134 || memberDecl.kind === 135); + ts.Debug.assert(memberDecl.kind === 136 || memberDecl.kind === 137); checkAccessorDeclaration(memberDecl); } if (!ts.hasDynamicName(memberDecl)) { @@ -12472,21 +18085,21 @@ var ts; for (var i = 0; i < propertiesArray.length; i++) { var propertyDecl = node.properties[i]; if (kind === 0 || isNumericName(propertyDecl.name)) { - var _type = getTypeOfSymbol(propertiesArray[i]); - if (!ts.contains(propTypes, _type)) { - propTypes.push(_type); + var type = getTypeOfSymbol(propertiesArray[i]); + if (!ts.contains(propTypes, type)) { + propTypes.push(type); } } } - var _result = propTypes.length ? getUnionType(propTypes) : undefinedType; - typeFlags |= _result.flags; - return _result; + var result_1 = propTypes.length ? getUnionType(propTypes) : undefinedType; + typeFlags |= result_1.flags; + return result_1; } return undefined; } } function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 130; + return s.valueDeclaration ? s.valueDeclaration.kind : 132; } function getDeclarationFlagsFromSymbol(s) { return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : s.flags & 134217728 ? 16 | 128 : 0; @@ -12496,7 +18109,7 @@ var ts; if (!(flags & (32 | 64))) { return; } - var enclosingClassDeclaration = ts.getAncestor(node, 196); + var enclosingClassDeclaration = ts.getAncestor(node, 201); var enclosingClass = enclosingClassDeclaration ? getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClassDeclaration)) : undefined; var declaringClass = getDeclaredTypeOfSymbol(prop.parent); if (flags & 32) { @@ -12505,7 +18118,7 @@ var ts; } return; } - if (left.kind === 90) { + if (left.kind === 91) { return; } if (!enclosingClass || !hasBaseType(enclosingClass, declaringClass)) { @@ -12543,7 +18156,7 @@ var ts; } getNodeLinks(node).resolvedSymbol = prop; if (prop.parent && prop.parent.flags & 32) { - if (left.kind === 90 && getDeclarationKindFromSymbol(prop) !== 132) { + if (left.kind === 91 && getDeclarationKindFromSymbol(prop) !== 134) { error(right, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); } else { @@ -12555,14 +18168,12 @@ var ts; return anyType; } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 153 - ? node.expression - : node.left; + var left = node.kind === 155 ? 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 === 90 && getDeclarationKindFromSymbol(prop) !== 132) { + if (left.kind === 91 && getDeclarationKindFromSymbol(prop) !== 134) { return false; } else { @@ -12577,15 +18188,15 @@ var ts; function checkIndexedAccess(node) { if (!node.argumentExpression) { var sourceFile = getSourceFile(node); - if (node.parent.kind === 156 && node.parent.expression === node) { + if (node.parent.kind === 158 && 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); } else { - var _start = node.end - "]".length; - var _end = node.end; - grammarErrorAtPos(sourceFile, _start, _end - _start, ts.Diagnostics.Expression_expected); + var start = node.end - "]".length; + var end = node.end; + grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Expression_expected); } } var objectType = getApparentType(checkExpression(node.expression)); @@ -12594,21 +18205,20 @@ var ts; return unknownType; } var isConstEnum = isConstEnumObjectType(objectType); - if (isConstEnum && - (!node.argumentExpression || node.argumentExpression.kind !== 8)) { + if (isConstEnum && (!node.argumentExpression || node.argumentExpression.kind !== 8)) { error(node.argumentExpression, ts.Diagnostics.A_const_enum_member_can_only_be_accessed_using_a_string_literal); return unknownType; } if (node.argumentExpression) { - var _name = getPropertyNameForIndexedAccess(node.argumentExpression, indexType); - if (_name !== undefined) { - var prop = getPropertyOfType(objectType, _name); + var name_6 = getPropertyNameForIndexedAccess(node.argumentExpression, indexType); + if (name_6 !== undefined) { + var prop = getPropertyOfType(objectType, name_6); if (prop) { getNodeLinks(node).resolvedSymbol = prop; return getTypeOfSymbol(prop); } else if (isConstEnum) { - error(node.argumentExpression, ts.Diagnostics.Property_0_does_not_exist_on_const_enum_1, _name, symbolToString(objectType.symbol)); + error(node.argumentExpression, ts.Diagnostics.Property_0_does_not_exist_on_const_enum_1, name_6, symbolToString(objectType.symbol)); return unknownType; } } @@ -12673,7 +18283,7 @@ var ts; return true; } function resolveUntypedCall(node) { - if (node.kind === 157) { + if (node.kind === 159) { checkExpression(node.template); } else { @@ -12695,22 +18305,22 @@ var ts; var specializedIndex = -1; var spliceIndex; ts.Debug.assert(!result.length); - for (var _i = 0, _n = signatures.length; _i < _n; _i++) { + for (var _i = 0; _i < signatures.length; _i++) { var signature = signatures[_i]; var symbol = signature.declaration && getSymbolOfNode(signature.declaration); - var _parent = signature.declaration && signature.declaration.parent; + var parent_4 = signature.declaration && signature.declaration.parent; if (!lastSymbol || symbol === lastSymbol) { - if (lastParent && _parent === lastParent) { + if (lastParent && parent_4 === lastParent) { index++; } else { - lastParent = _parent; + lastParent = parent_4; index = cutoffIndex; } } else { index = cutoffIndex = result.length; - lastParent = _parent; + lastParent = parent_4; } lastSymbol = symbol; if (signature.hasStringLiterals) { @@ -12726,7 +18336,7 @@ var ts; } function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { - if (args[i].kind === 171) { + if (args[i].kind === 173) { return i; } } @@ -12736,15 +18346,15 @@ var ts; var adjustedArgCount; var typeArguments; var callIsIncomplete; - if (node.kind === 157) { + if (node.kind === 159) { var tagExpression = node; adjustedArgCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === 169) { + if (tagExpression.template.kind === 171) { var templateExpression = tagExpression.template; var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans); ts.Debug.assert(lastSpan !== undefined); - callIsIncomplete = ts.getFullWidth(lastSpan.literal) === 0 || !!lastSpan.literal.isUnterminated; + callIsIncomplete = ts.nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated; } else { var templateLiteral = tagExpression.template; @@ -12755,15 +18365,14 @@ var ts; else { var callExpression = node; if (!callExpression.arguments) { - ts.Debug.assert(callExpression.kind === 156); + ts.Debug.assert(callExpression.kind === 158); return signature.minArgumentCount === 0; } adjustedArgCount = callExpression.arguments.hasTrailingComma ? args.length + 1 : args.length; callIsIncomplete = callExpression.arguments.end === callExpression.end; typeArguments = callExpression.typeArguments; } - var hasRightNumberOfTypeArgs = !typeArguments || - (signature.typeParameters && typeArguments.length === signature.typeParameters.length); + var hasRightNumberOfTypeArgs = !typeArguments || (signature.typeParameters && typeArguments.length === signature.typeParameters.length); if (!hasRightNumberOfTypeArgs) { return false; } @@ -12780,8 +18389,7 @@ var ts; function getSingleCallSignature(type) { if (type.flags & 48128) { var resolved = resolveObjectOrUnionTypeMembers(type); - if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 && - resolved.properties.length === 0 && !resolved.stringIndexType && !resolved.numberIndexType) { + if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 && resolved.properties.length === 0 && !resolved.stringIndexType && !resolved.numberIndexType) { return resolved.callSignatures[0]; } } @@ -12794,16 +18402,23 @@ var ts; }); return getSignatureInstantiation(signature, getInferredTypes(context)); } - function inferTypeArguments(signature, args, excludeArgument) { + function inferTypeArguments(signature, args, excludeArgument, context) { var typeParameters = signature.typeParameters; - var context = createInferenceContext(typeParameters, false); var inferenceMapper = createInferenceMapper(context); + for (var i = 0; i < typeParameters.length; i++) { + if (!context.inferences[i].isFixed) { + context.inferredTypes[i] = undefined; + } + } + if (context.failedTypeParameterIndex !== undefined && !context.inferences[context.failedTypeParameterIndex].isFixed) { + context.failedTypeParameterIndex = undefined; + } for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg.kind !== 172) { - var paramType = getTypeAtPosition(signature, arg.kind === 171 ? -1 : i); + if (arg.kind !== 175) { + var paramType = getTypeAtPosition(signature, arg.kind === 173 ? -1 : i); var argType = void 0; - if (i === 0 && args[i].parent.kind === 157) { + if (i === 0 && args[i].parent.kind === 159) { argType = globalTemplateStringsArrayType; } else { @@ -12814,29 +18429,22 @@ var ts; } } if (excludeArgument) { - for (var _i = 0; _i < args.length; _i++) { - if (excludeArgument[_i] === false) { - var _arg = args[_i]; - var _paramType = getTypeAtPosition(signature, _arg.kind === 171 ? -1 : _i); - inferTypes(context, checkExpressionWithContextualType(_arg, _paramType, inferenceMapper), _paramType); + for (var i = 0; i < args.length; i++) { + if (excludeArgument[i] === false) { + var arg = args[i]; + var paramType = getTypeAtPosition(signature, arg.kind === 173 ? -1 : i); + inferTypes(context, checkExpressionWithContextualType(arg, paramType, inferenceMapper), paramType); } } } - var inferredTypes = getInferredTypes(context); - context.failedTypeParameterIndex = ts.indexOf(inferredTypes, inferenceFailureType); - for (var _i_1 = 0; _i_1 < inferredTypes.length; _i_1++) { - if (inferredTypes[_i_1] === inferenceFailureType) { - inferredTypes[_i_1] = unknownType; - } - } - return context; + getInferredTypes(context); } function checkTypeArguments(signature, typeArguments, typeArgumentResultTypes, reportErrors) { var typeParameters = signature.typeParameters; var typeArgumentsAreAssignable = true; for (var i = 0; i < typeParameters.length; i++) { var typeArgNode = typeArguments[i]; - var typeArgument = getTypeFromTypeNode(typeArgNode); + var typeArgument = getTypeFromTypeNodeOrHeritageClauseElement(typeArgNode); typeArgumentResultTypes[i] = typeArgument; if (typeArgumentsAreAssignable) { var constraint = getConstraintOfTypeParameter(typeParameters[i]); @@ -12850,11 +18458,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 !== 172) { - var paramType = getTypeAtPosition(signature, arg.kind === 171 ? -1 : i); - var argType = i === 0 && node.kind === 157 ? globalTemplateStringsArrayType : - arg.kind === 8 && !reportErrors ? getStringLiteralType(arg) : - checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); + if (arg.kind !== 175) { + var paramType = getTypeAtPosition(signature, arg.kind === 173 ? -1 : i); + var argType = i === 0 && node.kind === 159 ? globalTemplateStringsArrayType : arg.kind === 8 && !reportErrors ? getStringLiteralType(arg) : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); if (!checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1)) { return false; } @@ -12864,10 +18470,12 @@ var ts; } function getEffectiveCallArguments(node) { var args; - if (node.kind === 157) { + if (node.kind === 159) { var template = node.template; - args = [template]; - if (template.kind === 169) { + args = [ + template + ]; + if (template.kind === 171) { ts.forEach(template.templateSpans, function (span) { args.push(span.expression); }); @@ -12879,9 +18487,9 @@ var ts; return args; } function getEffectiveTypeArguments(callExpression) { - if (callExpression.expression.kind === 90) { - var containingClass = ts.getAncestor(callExpression, 196); - var baseClassTypeNode = containingClass && ts.getClassBaseTypeNode(containingClass); + if (callExpression.expression.kind === 91) { + var containingClass = ts.getAncestor(callExpression, 201); + var baseClassTypeNode = containingClass && ts.getClassExtendsHeritageClauseElement(containingClass); return baseClassTypeNode && baseClassTypeNode.typeArguments; } else { @@ -12889,11 +18497,11 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray) { - var isTaggedTemplate = node.kind === 157; + var isTaggedTemplate = node.kind === 159; var typeArguments; if (!isTaggedTemplate) { typeArguments = getEffectiveTypeArguments(node); - if (node.expression.kind !== 90) { + if (node.expression.kind !== 91) { ts.forEach(typeArguments, checkSourceElement); } } @@ -12948,7 +18556,7 @@ var ts; error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); } if (!produceDiagnostics) { - for (var _i = 0, _n = candidates.length; _i < _n; _i++) { + for (var _i = 0; _i < candidates.length; _i++) { var candidate = candidates[_i]; if (hasCorrectArity(node, args, candidate)) { return candidate; @@ -12957,56 +18565,55 @@ var ts; } return resolveErrorCall(node); function chooseOverload(candidates, relation) { - for (var _a = 0, _b = candidates.length; _a < _b; _a++) { - var current = candidates[_a]; - if (!hasCorrectArity(node, args, current)) { + for (var _i = 0; _i < candidates.length; _i++) { + var originalCandidate = candidates[_i]; + if (!hasCorrectArity(node, args, originalCandidate)) { continue; } - var originalCandidate = current; - var inferenceResult = void 0; - var _candidate = void 0; + var candidate = void 0; var typeArgumentsAreValid = void 0; + var inferenceContext = originalCandidate.typeParameters ? createInferenceContext(originalCandidate.typeParameters, false) : undefined; while (true) { - _candidate = originalCandidate; - if (_candidate.typeParameters) { + candidate = originalCandidate; + if (candidate.typeParameters) { var typeArgumentTypes = void 0; if (typeArguments) { - typeArgumentTypes = new Array(_candidate.typeParameters.length); - typeArgumentsAreValid = checkTypeArguments(_candidate, typeArguments, typeArgumentTypes, false); + typeArgumentTypes = new Array(candidate.typeParameters.length); + typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, false); } else { - inferenceResult = inferTypeArguments(_candidate, args, excludeArgument); - typeArgumentsAreValid = inferenceResult.failedTypeParameterIndex < 0; - typeArgumentTypes = inferenceResult.inferredTypes; + inferTypeArguments(candidate, args, excludeArgument, inferenceContext); + typeArgumentsAreValid = inferenceContext.failedTypeParameterIndex === undefined; + typeArgumentTypes = inferenceContext.inferredTypes; } if (!typeArgumentsAreValid) { break; } - _candidate = getSignatureInstantiation(_candidate, typeArgumentTypes); + candidate = getSignatureInstantiation(candidate, typeArgumentTypes); } - if (!checkApplicableSignature(node, args, _candidate, relation, excludeArgument, false)) { + if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, false)) { break; } var index = excludeArgument ? ts.indexOf(excludeArgument, true) : -1; if (index < 0) { - return _candidate; + return candidate; } excludeArgument[index] = false; } if (originalCandidate.typeParameters) { - var instantiatedCandidate = _candidate; + var instantiatedCandidate = candidate; if (typeArgumentsAreValid) { candidateForArgumentError = instantiatedCandidate; } else { candidateForTypeArgumentError = originalCandidate; if (!typeArguments) { - resultOfFailedInference = inferenceResult; + resultOfFailedInference = inferenceContext; } } } else { - ts.Debug.assert(originalCandidate === _candidate); + ts.Debug.assert(originalCandidate === candidate); candidateForArgumentError = originalCandidate; } } @@ -13014,7 +18621,7 @@ var ts; } } function resolveCallExpression(node, candidatesOutArray) { - if (node.expression.kind === 90) { + if (node.expression.kind === 91) { var superType = checkSuperExpression(node.expression); if (superType !== unknownType) { return resolveCall(node, getSignaturesOfType(superType, 1), candidatesOutArray); @@ -13098,13 +18705,13 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - if (node.kind === 155) { + if (node.kind === 157) { links.resolvedSignature = resolveCallExpression(node, candidatesOutArray); } - else if (node.kind === 156) { + else if (node.kind === 158) { links.resolvedSignature = resolveNewExpression(node, candidatesOutArray); } - else if (node.kind === 157) { + else if (node.kind === 159) { links.resolvedSignature = resolveTaggedTemplateExpression(node, candidatesOutArray); } else { @@ -13116,15 +18723,12 @@ var ts; function checkCallExpression(node) { checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node, node.arguments); var signature = getResolvedSignature(node); - if (node.expression.kind === 90) { + if (node.expression.kind === 91) { return voidType; } - if (node.kind === 156) { + if (node.kind === 158) { var declaration = signature.declaration; - if (declaration && - declaration.kind !== 133 && - declaration.kind !== 137 && - declaration.kind !== 141) { + if (declaration && declaration.kind !== 135 && declaration.kind !== 139 && declaration.kind !== 143) { if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } @@ -13138,7 +18742,7 @@ var ts; } function checkTypeAssertion(node) { var exprType = checkExpression(node.expression); - var targetType = getTypeFromTypeNode(node.type); + var targetType = getTypeFromTypeNodeOrHeritageClauseElement(node.type); if (produceDiagnostics && targetType !== unknownType) { var widenedType = getWidenedType(exprType); if (!(isTypeAssignableTo(targetType, widenedType))) { @@ -13149,13 +18753,9 @@ var ts; } function getTypeAtPosition(signature, pos) { if (pos >= 0) { - return signature.hasRestParameter ? - pos < signature.parameters.length - 1 ? getTypeOfSymbol(signature.parameters[pos]) : getRestTypeOfSignature(signature) : - pos < signature.parameters.length ? getTypeOfSymbol(signature.parameters[pos]) : anyType; + return signature.hasRestParameter ? pos < signature.parameters.length - 1 ? getTypeOfSymbol(signature.parameters[pos]) : getRestTypeOfSignature(signature) : pos < signature.parameters.length ? getTypeOfSymbol(signature.parameters[pos]) : anyType; } - return signature.hasRestParameter ? - getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]) : - anyArrayType; + return signature.hasRestParameter ? getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]) : anyArrayType; } function assignContextualParameterTypes(signature, context, mapper) { var len = signature.parameters.length - (signature.hasRestParameter ? 1 : 0); @@ -13165,9 +18765,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 _links = getSymbolLinks(_parameter); - _links.type = instantiateType(getTypeOfSymbol(context.parameters[context.parameters.length - 1]), mapper); + var parameter = signature.parameters[signature.parameters.length - 1]; + var links = getSymbolLinks(parameter); + links.type = instantiateType(getTypeOfSymbol(context.parameters[context.parameters.length - 1]), mapper); } } function getReturnTypeFromBody(func, contextualMapper) { @@ -13176,7 +18776,7 @@ var ts; return unknownType; } var type; - if (func.body.kind !== 174) { + if (func.body.kind !== 179) { type = checkExpressionCached(func.body, contextualMapper); } else { @@ -13214,7 +18814,7 @@ var ts; }); } function bodyContainsSingleThrowStatement(body) { - return (body.statements.length === 1) && (body.statements[0].kind === 190); + return (body.statements.length === 1) && (body.statements[0].kind === 195); } function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func, returnType) { if (!produceDiagnostics) { @@ -13223,7 +18823,7 @@ var ts; if (returnType === voidType || returnType === anyType) { return; } - if (ts.nodeIsMissing(func.body) || func.body.kind !== 174) { + if (ts.nodeIsMissing(func.body) || func.body.kind !== 179) { return; } var bodyBlock = func.body; @@ -13236,9 +18836,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 !== 132 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 160) { + if (!hasGrammarError && node.kind === 162) { checkGrammarFunctionName(node.name) || checkGrammarForGenerator(node); } if (contextualMapper === identityMapper && isContextSensitive(node)) { @@ -13266,25 +18866,25 @@ var ts; checkSignatureDeclaration(node); } } - if (produceDiagnostics && node.kind !== 132 && node.kind !== 131) { + if (produceDiagnostics && node.kind !== 134 && node.kind !== 133) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); } return type; } function checkFunctionExpressionOrObjectLiteralMethodBody(node) { - ts.Debug.assert(node.kind !== 132 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); if (node.type) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); + checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type)); } if (node.body) { - if (node.body.kind === 174) { + if (node.body.kind === 179) { checkSourceElement(node.body); } else { var exprType = checkExpression(node.body); if (node.type) { - checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, undefined); + checkTypeAssignableTo(exprType, getTypeFromTypeNodeOrHeritageClauseElement(node.type), node.body, undefined); } checkFunctionExpressionBodies(node.body); } @@ -13304,17 +18904,19 @@ var ts; } function isReferenceOrErrorExpression(n) { switch (n.kind) { - case 64: { - var symbol = findSymbol(n); - return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3) !== 0; - } - case 153: { - var _symbol = findSymbol(n); - return !_symbol || _symbol === unknownSymbol || (_symbol.flags & ~8) !== 0; - } - case 154: + case 65: + { + var symbol = findSymbol(n); + return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3) !== 0; + } + case 155: + { + var symbol = findSymbol(n); + return !symbol || symbol === unknownSymbol || (symbol.flags & ~8) !== 0; + } + case 156: return true; - case 159: + case 161: return isReferenceOrErrorExpression(n.expression); default: return false; @@ -13322,22 +18924,24 @@ var ts; } function isConstVariableReference(n) { switch (n.kind) { - case 64: - case 153: { - var symbol = findSymbol(n); - return symbol && (symbol.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 8192) !== 0; - } - case 154: { - var index = n.argumentExpression; - var _symbol = findSymbol(n.expression); - if (_symbol && index && index.kind === 8) { - var _name = index.text; - var prop = getPropertyOfType(getTypeOfSymbol(_symbol), _name); - return prop && (prop.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(prop) & 8192) !== 0; + case 65: + case 155: + { + var symbol = findSymbol(n); + return symbol && (symbol.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 8192) !== 0; } - return false; - } - case 159: + case 156: + { + var index = n.argumentExpression; + var symbol = findSymbol(n.expression); + if (symbol && index && index.kind === 8) { + var name_7 = index.text; + var prop = getPropertyOfType(getTypeOfSymbol(symbol), name_7); + return prop && (prop.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(prop) & 8192) !== 0; + } + return false; + } + case 161: return isConstVariableReference(n.expression); default: return false; @@ -13354,7 +18958,7 @@ var ts; return true; } function checkDeleteExpression(node) { - if (node.parserContextFlags & 1 && node.expression.kind === 64) { + if (node.parserContextFlags & 1 && node.expression.kind === 65) { grammarErrorOnNode(node.expression, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode); } var operandType = checkExpression(node.expression); @@ -13408,7 +19012,7 @@ var ts; } if (type.flags & 16384) { var types = type.types; - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var current = types[_i]; if (current.flags & kind) { return true; @@ -13424,7 +19028,7 @@ var ts; } if (type.flags & 16384) { var types = type.types; - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var current = types[_i]; if (!(current.flags & kind)) { return false; @@ -13460,19 +19064,16 @@ var ts; } function checkObjectLiteralAssignment(node, sourceType, contextualMapper) { var properties = node.properties; - for (var _i = 0, _n = properties.length; _i < _n; _i++) { + for (var _i = 0; _i < properties.length; _i++) { var p = properties[_i]; - if (p.kind === 218 || p.kind === 219) { - var _name = p.name; - var type = sourceType.flags & 1 ? sourceType : - getTypeOfPropertyOfType(sourceType, _name.text) || - isNumericLiteralName(_name.text) && getIndexTypeOfType(sourceType, 1) || - getIndexTypeOfType(sourceType, 0); + if (p.kind === 224 || p.kind === 225) { + var name_8 = p.name; + var type = sourceType.flags & 1 ? sourceType : getTypeOfPropertyOfType(sourceType, name_8.text) || isNumericLiteralName(name_8.text) && getIndexTypeOfType(sourceType, 1) || getIndexTypeOfType(sourceType, 0); if (type) { - checkDestructuringAssignment(p.initializer || _name, type); + checkDestructuringAssignment(p.initializer || name_8, type); } else { - error(_name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(sourceType), ts.declarationNameToString(_name)); + error(name_8, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(sourceType), ts.declarationNameToString(name_8)); } } else { @@ -13489,12 +19090,10 @@ var ts; var elements = node.elements; for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 172) { - if (e.kind !== 171) { + if (e.kind !== 175) { + if (e.kind !== 173) { var propName = "" + i; - var type = sourceType.flags & 1 ? sourceType : - isTupleLikeType(sourceType) ? getTypeOfPropertyOfType(sourceType, propName) : - getIndexTypeOfType(sourceType, 1); + var type = sourceType.flags & 1 ? sourceType : isTupleLikeType(sourceType) ? getTypeOfPropertyOfType(sourceType, propName) : getIndexTypeOfType(sourceType, 1); if (type) { checkDestructuringAssignment(e, type, contextualMapper); } @@ -13520,14 +19119,14 @@ var ts; return sourceType; } function checkDestructuringAssignment(target, sourceType, contextualMapper) { - if (target.kind === 167 && target.operatorToken.kind === 52) { + if (target.kind === 169 && target.operatorToken.kind === 53) { checkBinaryExpression(target, contextualMapper); target = target.left; } - if (target.kind === 152) { + if (target.kind === 154) { return checkObjectLiteralAssignment(target, sourceType, contextualMapper); } - if (target.kind === 151) { + if (target.kind === 153) { return checkArrayLiteralAssignment(target, sourceType, contextualMapper); } return checkReferenceAssignment(target, sourceType, contextualMapper); @@ -13544,40 +19143,38 @@ var ts; checkGrammarEvalOrArgumentsInStrictMode(node, node.left); } var operator = node.operatorToken.kind; - if (operator === 52 && (node.left.kind === 152 || node.left.kind === 151)) { + if (operator === 53 && (node.left.kind === 154 || node.left.kind === 153)) { return checkDestructuringAssignment(node.left, checkExpression(node.right, contextualMapper), contextualMapper); } var leftType = checkExpression(node.left, contextualMapper); var rightType = checkExpression(node.right, contextualMapper); switch (operator) { case 35: - case 55: - case 36: case 56: - case 37: + case 36: case 57: - case 34: - case 54: - case 40: + case 37: case 58: - case 41: + case 34: + case 55: + case 40: case 59: - case 42: + case 41: case 60: - case 44: - case 62: - case 45: - case 63: - case 43: + case 42: case 61: + case 44: + case 63: + case 45: + case 64: + case 43: + case 62: if (leftType.flags & (32 | 64)) leftType = rightType; if (rightType.flags & (32 | 64)) rightType = leftType; var suggestedOperator; - if ((leftType.flags & 8) && - (rightType.flags & 8) && - (suggestedOperator = getSuggestedBooleanOperator(node.operatorToken.kind)) !== undefined) { + if ((leftType.flags & 8) && (rightType.flags & 8) && (suggestedOperator = getSuggestedBooleanOperator(node.operatorToken.kind)) !== undefined) { error(node, ts.Diagnostics.The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead, ts.tokenToString(node.operatorToken.kind), ts.tokenToString(suggestedOperator)); } else { @@ -13589,7 +19186,7 @@ var ts; } return numberType; case 33: - case 53: + case 54: if (leftType.flags & (32 | 64)) leftType = rightType; if (rightType.flags & (32 | 64)) @@ -13613,7 +19210,7 @@ var ts; reportOperatorError(); return anyType; } - if (operator === 53) { + if (operator === 54) { checkAssignmentOperator(resultType); } return resultType; @@ -13632,24 +19229,25 @@ var ts; reportOperatorError(); } return booleanType; - case 86: + case 87: return checkInstanceOfExpression(node, leftType, rightType); - case 85: + case 86: return checkInExpression(node, leftType, rightType); case 48: return rightType; case 49: - return getUnionType([leftType, rightType]); - case 52: + return getUnionType([ + leftType, + rightType + ]); + case 53: checkAssignmentOperator(rightType); return rightType; case 23: return rightType; } function checkForDisallowedESSymbolOperand(operator) { - var offendingSymbolOperand = someConstituentTypeHasKind(leftType, 1048576) ? node.left : - someConstituentTypeHasKind(rightType, 1048576) ? node.right : - undefined; + var offendingSymbolOperand = someConstituentTypeHasKind(leftType, 1048576) ? node.left : someConstituentTypeHasKind(rightType, 1048576) ? node.right : undefined; if (offendingSymbolOperand) { error(offendingSymbolOperand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(operator)); return false; @@ -13659,20 +19257,20 @@ var ts; function getSuggestedBooleanOperator(operator) { switch (operator) { case 44: - case 62: + case 63: return 49; case 45: - case 63: + case 64: return 31; case 43: - case 61: + case 62: return 48; default: return undefined; } } function checkAssignmentOperator(valueType) { - if (produceDiagnostics && operator >= 52 && operator <= 63) { + if (produceDiagnostics && operator >= 53 && operator <= 64) { var ok = checkReferenceExpression(node.left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression, ts.Diagnostics.Left_hand_side_of_assignment_expression_cannot_be_a_constant); if (ok) { checkTypeAssignableTo(valueType, leftType, node.left, undefined); @@ -13695,7 +19293,10 @@ var ts; checkExpression(node.condition); var type1 = checkExpression(node.whenTrue, contextualMapper); var type2 = checkExpression(node.whenFalse, contextualMapper); - return getUnionType([type1, type2]); + return getUnionType([ + type1, + type2 + ]); } function checkTemplateExpression(node) { ts.forEach(node.templateSpans, function (templateSpan) { @@ -13718,14 +19319,14 @@ var ts; return links.resolvedType; } function checkPropertyAssignment(node, contextualMapper) { - if (node.name.kind === 126) { + if (node.name.kind === 127) { checkComputedPropertyName(node.name); } return checkExpression(node.initializer, contextualMapper); } function checkObjectLiteralMethod(node, contextualMapper) { checkGrammarMethod(node); - if (node.name.kind === 126) { + if (node.name.kind === 127) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); @@ -13751,7 +19352,7 @@ var ts; } function checkExpressionOrQualifiedName(node, contextualMapper) { var type; - if (node.kind == 125) { + if (node.kind == 126) { type = checkQualifiedName(node); } else { @@ -13759,9 +19360,7 @@ var ts; type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); } if (isConstEnumObjectType(type)) { - var ok = (node.parent.kind === 153 && node.parent.expression === node) || - (node.parent.kind === 154 && node.parent.expression === node) || - ((node.kind === 64 || node.kind === 125) && isInRightSideOfImportOrExportAssignment(node)); + 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)); 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); } @@ -13774,65 +19373,67 @@ var ts; } function checkExpressionWorker(node, contextualMapper) { switch (node.kind) { - case 64: + case 65: return checkIdentifier(node); - case 92: + case 93: return checkThisExpression(node); - case 90: + case 91: return checkSuperExpression(node); - case 88: + case 89: return nullType; - case 94: - case 79: + case 95: + case 80: return booleanType; case 7: return checkNumericLiteral(node); - case 169: + case 171: return checkTemplateExpression(node); case 8: case 10: return stringType; case 9: return globalRegExpType; - case 151: - return checkArrayLiteral(node, contextualMapper); - case 152: - return checkObjectLiteral(node, contextualMapper); case 153: - return checkPropertyAccessExpression(node); + return checkArrayLiteral(node, contextualMapper); case 154: - return checkIndexedAccess(node); + return checkObjectLiteral(node, contextualMapper); case 155: + return checkPropertyAccessExpression(node); case 156: - return checkCallExpression(node); + return checkIndexedAccess(node); case 157: - return checkTaggedTemplateExpression(node); case 158: - return checkTypeAssertion(node); + return checkCallExpression(node); case 159: - return checkExpression(node.expression, contextualMapper); + return checkTaggedTemplateExpression(node); case 160: + return checkTypeAssertion(node); case 161: - return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - case 163: - return checkTypeOfExpression(node); + return checkExpression(node.expression, contextualMapper); + case 174: + return checkClassExpression(node); case 162: - return checkDeleteExpression(node); - case 164: - return checkVoidExpression(node); + case 163: + return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); case 165: - return checkPrefixUnaryExpression(node); + return checkTypeOfExpression(node); + case 164: + return checkDeleteExpression(node); case 166: - return checkPostfixUnaryExpression(node); + return checkVoidExpression(node); case 167: - return checkBinaryExpression(node, contextualMapper); + return checkPrefixUnaryExpression(node); case 168: - return checkConditionalExpression(node, contextualMapper); - case 171: - return checkSpreadElementExpression(node, contextualMapper); - case 172: - return undefinedType; + return checkPostfixUnaryExpression(node); + case 169: + return checkBinaryExpression(node, contextualMapper); case 170: + return checkConditionalExpression(node, contextualMapper); + case 173: + return checkSpreadElementExpression(node, contextualMapper); + case 175: + return undefinedType; + case 172: checkYieldExpression(node); return unknownType; } @@ -13849,12 +19450,18 @@ var ts; } } function checkParameter(node) { - checkGrammarModifiers(node) || checkGrammarEvalOrArgumentsInStrictMode(node, node.name); + // Grammar checking + // It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs as the + // Identifier in a PropertySetParameterList of a PropertyAssignment that is contained in strict code + // or if its FunctionBody is strict code(11.1.5). + // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a + // strict mode FunctionLikeDeclaration or FunctionExpression(13.1) + checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarEvalOrArgumentsInStrictMode(node, node.name); checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (node.flags & 112) { func = ts.getContainingFunction(node); - if (!(func.kind === 133 && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 135 && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -13868,12 +19475,10 @@ var ts; } } function checkSignatureDeclaration(node) { - if (node.kind === 138) { + if (node.kind === 140) { checkGrammarIndexSignature(node); } - else if (node.kind === 140 || node.kind === 195 || node.kind === 141 || - node.kind === 136 || node.kind === 133 || - node.kind === 137) { + else if (node.kind === 142 || node.kind === 200 || node.kind === 143 || node.kind === 138 || node.kind === 135 || node.kind === 139) { checkGrammarFunctionLikeDeclaration(node); } checkTypeParameters(node.typeParameters); @@ -13885,10 +19490,10 @@ var ts; checkCollisionWithArgumentsInGeneratedCode(node); if (compilerOptions.noImplicitAny && !node.type) { switch (node.kind) { - case 137: + case 139: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 136: + case 138: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -13897,7 +19502,7 @@ var ts; checkSpecializedSignatureDeclaration(node); } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 197) { + if (node.kind === 202) { var nodeSymbol = getSymbolOfNode(node); if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -13907,12 +19512,12 @@ var ts; if (indexSymbol) { var seenNumericIndexer = false; var seenStringIndexer = false; - for (var _i = 0, _a = indexSymbol.declarations, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 120: + case 121: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -13920,7 +19525,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 118: + case 119: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -13934,7 +19539,7 @@ var ts; } } function checkPropertyDeclaration(node) { - checkGrammarModifiers(node) || checkGrammarProperty(node) || checkGrammarComputedPropertyName(node.name); + checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarProperty(node) || checkGrammarComputedPropertyName(node.name); checkVariableLikeDeclaration(node); } function checkMethodDeclaration(node) { @@ -13957,40 +19562,41 @@ var ts; return; } function isSuperCallExpression(n) { - return n.kind === 155 && n.expression.kind === 90; + return n.kind === 157 && n.expression.kind === 91; } function containsSuperCall(n) { if (isSuperCallExpression(n)) { return true; } switch (n.kind) { - case 160: - case 195: - case 161: - case 152: return false; - default: return ts.forEachChild(n, containsSuperCall); + case 162: + case 200: + case 163: + case 154: + return false; + default: + return ts.forEachChild(n, containsSuperCall); } } function markThisReferencesAsErrors(n) { - if (n.kind === 92) { + if (n.kind === 93) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 160 && n.kind !== 195) { + else if (n.kind !== 162 && n.kind !== 200) { ts.forEachChild(n, markThisReferencesAsErrors); } } function isInstancePropertyWithInitializer(n) { - return n.kind === 130 && - !(n.flags & 128) && - !!n.initializer; + return n.kind === 132 && !(n.flags & 128) && !!n.initializer; } - if (ts.getClassBaseTypeNode(node.parent)) { + if (ts.getClassExtendsHeritageClauseElement(node.parent)) { if (containsSuperCall(node.body)) { - var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || - ts.forEach(node.parameters, function (p) { return p.flags & (16 | 32 | 64); }); + var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || 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 !== 177 || !isSuperCallExpression(statements[0].expression)) { + if (!statements.length || statements[0].kind !== 182 || !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 { @@ -14006,13 +19612,13 @@ var ts; function checkAccessorDeclaration(node) { if (produceDiagnostics) { checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name); - if (node.kind === 134) { + if (node.kind === 136) { 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 === 134 ? 135 : 134; + var otherKind = node.kind === 136 ? 137 : 136; var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { if (((node.flags & 112) !== (otherAccessor.flags & 112))) { @@ -14031,9 +19637,18 @@ var ts; } checkFunctionLikeDeclaration(node); } - function checkTypeReference(node) { + function checkMissingDeclaration(node) { + checkDecorators(node); + } + function checkTypeReferenceNode(node) { + return checkTypeReferenceOrHeritageClauseElement(node); + } + function checkHeritageClauseElement(node) { + return checkTypeReferenceOrHeritageClauseElement(node); + } + function checkTypeReferenceOrHeritageClauseElement(node) { checkGrammarTypeArguments(node, node.typeArguments); - var type = getTypeFromTypeReferenceNode(node); + var type = getTypeFromTypeReferenceOrHeritageClauseElement(node); if (type !== unknownType && node.typeArguments) { var len = node.typeArguments.length; for (var i = 0; i < len; i++) { @@ -14086,9 +19701,9 @@ var ts; return; } var signaturesToCheck; - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 197) { - ts.Debug.assert(signatureDeclarationNode.kind === 136 || signatureDeclarationNode.kind === 137); - var signatureKind = signatureDeclarationNode.kind === 136 ? 0 : 1; + 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; var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); var containingType = getDeclaredTypeOfSymbol(containingSymbol); signaturesToCheck = getSignaturesOfType(containingType, signatureKind); @@ -14096,7 +19711,7 @@ var ts; else { signaturesToCheck = getSignaturesOfSymbol(getSymbolOfNode(signatureDeclarationNode)); } - for (var _i = 0, _n = signaturesToCheck.length; _i < _n; _i++) { + for (var _i = 0; _i < signaturesToCheck.length; _i++) { var otherSignature = signaturesToCheck[_i]; if (!otherSignature.hasStringLiterals && isSignatureAssignableTo(signature, otherSignature)) { return; @@ -14106,7 +19721,7 @@ var ts; } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = ts.getCombinedNodeFlags(n); - if (n.parent.kind !== 197 && ts.isInAmbientContext(n)) { + if (n.parent.kind !== 202 && ts.isInAmbientContext(n)) { if (!(flags & 2)) { flags |= 1; } @@ -14163,7 +19778,7 @@ var ts; var declarations = symbol.declarations; var isConstructor = (symbol.flags & 16384) !== 0; function reportImplementationExpectedError(node) { - if (node.name && ts.getFullWidth(node.name) === 0) { + if (node.name && ts.nodeIsMissing(node.name)) { return; } var seen = false; @@ -14177,16 +19792,16 @@ var ts; }); if (subsequentNode) { if (subsequentNode.kind === node.kind) { - var _errorNode = subsequentNode.name || subsequentNode; + var errorNode_1 = subsequentNode.name || subsequentNode; if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - ts.Debug.assert(node.kind === 132 || node.kind === 131); + ts.Debug.assert(node.kind === 134 || node.kind === 133); 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, diagnostic); + error(errorNode_1, diagnostic); return; } else if (ts.nodeIsPresent(subsequentNode.body)) { - error(_errorNode, ts.Diagnostics.Function_implementation_name_must_be_0, ts.declarationNameToString(node.name)); + error(errorNode_1, ts.Diagnostics.Function_implementation_name_must_be_0, ts.declarationNameToString(node.name)); return; } } @@ -14202,15 +19817,15 @@ var ts; var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & 1536; var duplicateFunctionDeclaration = false; var multipleConstructorImplementation = false; - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + for (var _i = 0; _i < declarations.length; _i++) { var current = declarations[_i]; var node = current; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 197 || node.parent.kind === 143 || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 202 || node.parent.kind === 145 || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = undefined; } - if (node.kind === 195 || node.kind === 132 || node.kind === 131 || node.kind === 133) { + if (node.kind === 200 || node.kind === 134 || node.kind === 133 || node.kind === 135) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -14261,7 +19876,7 @@ var ts; var signatures = getSignaturesOfSymbol(symbol); var bodySignature = getSignatureFromDeclaration(bodyDeclaration); if (!bodySignature.hasStringLiterals) { - for (var _a = 0, _b = signatures.length; _a < _b; _a++) { + for (var _a = 0; _a < signatures.length; _a++) { var signature = signatures[_a]; if (!signature.hasStringLiterals && !isSignatureAssignableTo(bodySignature, signature)) { error(signature.declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation); @@ -14307,39 +19922,84 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 197: + case 202: return 2097152; - case 200: - return d.name.kind === 8 || ts.getModuleInstanceState(d) !== 0 - ? 4194304 | 1048576 - : 4194304; - case 196: - case 199: + case 205: + return d.name.kind === 8 || ts.getModuleInstanceState(d) !== 0 ? 4194304 | 1048576 : 4194304; + case 201: + case 204: return 2097152 | 1048576; - case 203: + case 208: var result = 0; var target = resolveAlias(getSymbolOfNode(d)); - ts.forEach(target.declarations, function (d) { result |= getDeclarationSpaces(d); }); + ts.forEach(target.declarations, function (d) { + result |= getDeclarationSpaces(d); + }); return result; default: return 1048576; } } } + function checkDecorator(node) { + var expression = node.expression; + var exprType = checkExpression(expression); + switch (node.parent.kind) { + case 201: + var classSymbol = getSymbolOfNode(node.parent); + var classConstructorType = getTypeOfSymbol(classSymbol); + var classDecoratorType = instantiateSingleCallFunctionType(globalClassDecoratorType, [ + classConstructorType + ]); + checkTypeAssignableTo(exprType, classDecoratorType, node); + break; + case 132: + checkTypeAssignableTo(exprType, globalPropertyDecoratorType, node); + break; + case 134: + case 136: + case 137: + var methodType = getTypeOfNode(node.parent); + var methodDecoratorType = instantiateSingleCallFunctionType(globalMethodDecoratorType, [ + methodType + ]); + checkTypeAssignableTo(exprType, methodDecoratorType, node); + break; + case 129: + checkTypeAssignableTo(exprType, globalParameterDecoratorType, node); + break; + } + } + function checkDecorators(node) { + if (!node.decorators) { + return; + } + switch (node.kind) { + case 201: + case 134: + case 136: + case 137: + case 132: + case 129: + emitDecorate = true; + break; + default: + return; + } + ts.forEach(node.decorators, checkDecorator); + } function checkFunctionDeclaration(node) { if (produceDiagnostics) { - checkFunctionLikeDeclaration(node) || - checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || - checkGrammarFunctionName(node.name) || - checkGrammarForGenerator(node); + checkFunctionLikeDeclaration(node) || checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || checkGrammarFunctionName(node.name) || checkGrammarForGenerator(node); checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); } } function checkFunctionLikeDeclaration(node) { + checkDecorators(node); checkSignatureDeclaration(node); - if (node.name && node.name.kind === 126) { + if (node.name && node.name.kind === 127) { checkComputedPropertyName(node.name); } if (!ts.hasDynamicName(node)) { @@ -14357,18 +20017,18 @@ var ts; } checkSourceElement(node.body); if (node.type && !isAccessor(node.kind)) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); + checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type)); } if (compilerOptions.noImplicitAny && ts.nodeIsMissing(node.body) && !node.type && !isPrivateWithinAmbient(node)) { reportImplicitAnyError(node, anyType); } } function checkBlock(node) { - if (node.kind === 174) { + if (node.kind === 179) { checkGrammarStatementInAmbientContext(node); } ts.forEach(node.statements, checkSourceElement); - if (ts.isFunctionBlock(node) || node.kind === 201) { + if (ts.isFunctionBlock(node) || node.kind === 206) { checkFunctionExpressionBodies(node); } } @@ -14386,19 +20046,14 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 130 || - node.kind === 129 || - node.kind === 132 || - node.kind === 131 || - node.kind === 134 || - node.kind === 135) { + if (node.kind === 132 || node.kind === 131 || node.kind === 134 || node.kind === 133 || node.kind === 136 || node.kind === 137) { return false; } if (ts.isInAmbientContext(node)) { return false; } var root = getRootDeclaration(node); - if (root.kind === 128 && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 129 && ts.nodeIsMissing(root.parent.body)) { return false; } return true; @@ -14412,8 +20067,8 @@ var ts; var current = node; while (current) { if (getNodeCheckFlags(current) & 4) { - var _isDeclaration = node.kind !== 64; - if (_isDeclaration) { + var isDeclaration_1 = node.kind !== 65; + if (isDeclaration_1) { error(node.name, ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference); } else { @@ -14428,13 +20083,13 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "_super")) { return; } - var enclosingClass = ts.getAncestor(node, 196); + var enclosingClass = ts.getAncestor(node, 201); if (!enclosingClass || ts.isInAmbientContext(enclosingClass)) { return; } - if (ts.getClassBaseTypeNode(enclosingClass)) { - var _isDeclaration = node.kind !== 64; - if (_isDeclaration) { + if (ts.getClassExtendsHeritageClauseElement(enclosingClass)) { + var isDeclaration_2 = node.kind !== 65; + if (isDeclaration_2) { error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); } else { @@ -14446,56 +20101,57 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { return; } - if (node.kind === 200 && ts.getModuleInstanceState(node) !== 1) { + if (node.kind === 205 && ts.getModuleInstanceState(node) !== 1) { return; } - var _parent = getDeclarationContainer(node); - if (_parent.kind === 221 && ts.isExternalModule(_parent)) { + 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)); } } function checkVarDeclaredNamesNotShadowed(node) { - if (node.initializer && (ts.getCombinedNodeFlags(node) & 12288) === 0) { - var symbol = getSymbolOfNode(node); - if (symbol.flags & 1) { - var localDeclarationSymbol = resolveName(node, node.name.text, 3, undefined, undefined); - if (localDeclarationSymbol && - localDeclarationSymbol !== symbol && - localDeclarationSymbol.flags & 2) { - if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 12288) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 194); - var container = varDeclList.parent.kind === 175 && - varDeclList.parent.parent; - var namesShareScope = container && - (container.kind === 174 && ts.isFunctionLike(container.parent) || - (container.kind === 201 && container.kind === 200) || - container.kind === 221); - if (!namesShareScope) { - var _name = symbolToString(localDeclarationSymbol); - error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, _name, _name); - } + // - ScriptBody : StatementList + // It is a Syntax Error if any element of the LexicallyDeclaredNames of StatementList + // also occurs in the VarDeclaredNames of StatementList. + if ((ts.getCombinedNodeFlags(node) & 12288) !== 0 || isParameterDeclaration(node)) { + return; + } + if (node.kind === 198 && !node.initializer) { + return; + } + var symbol = getSymbolOfNode(node); + if (symbol.flags & 1) { + var localDeclarationSymbol = resolveName(node, node.name.text, 3, undefined, undefined); + if (localDeclarationSymbol && 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 ? varDeclList.parent.parent : undefined; + var namesShareScope = container && (container.kind === 179 && ts.isFunctionLike(container.parent) || container.kind === 206 || container.kind === 205 || container.kind === 227); + 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); } } } } } function isParameterDeclaration(node) { - while (node.kind === 150) { + while (node.kind === 152) { node = node.parent.parent; } - return node.kind === 128; + return node.kind === 129; } function checkParameterInitializer(node) { - if (getRootDeclaration(node).kind !== 128) { + if (getRootDeclaration(node).kind !== 129) { return; } var func = ts.getContainingFunction(node); visit(node.initializer); function visit(n) { - if (n.kind === 64) { + if (n.kind === 65) { var referencedSymbol = getNodeLinks(n).resolvedSymbol; if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(func.locals, referencedSymbol.name, 107455) === referencedSymbol) { - if (referencedSymbol.valueDeclaration.kind === 128) { + if (referencedSymbol.valueDeclaration.kind === 129) { if (referencedSymbol.valueDeclaration === node) { error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.declarationNameToString(node.name)); return; @@ -14513,8 +20169,9 @@ var ts; } } function checkVariableLikeDeclaration(node) { + checkDecorators(node); checkSourceElement(node.type); - if (node.name.kind === 126) { + if (node.name.kind === 127) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); @@ -14523,7 +20180,7 @@ var ts; if (ts.isBindingPattern(node.name)) { ts.forEach(node.name.elements, checkSourceElement); } - if (node.initializer && getRootDeclaration(node).kind === 128 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && getRootDeclaration(node).kind === 129 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } @@ -14551,9 +20208,9 @@ var ts; checkTypeAssignableTo(checkExpressionCached(node.initializer), declarationType, node, undefined); } } - if (node.kind !== 130 && node.kind !== 129) { + if (node.kind !== 132 && node.kind !== 131) { checkExportsOnMergedDeclarations(node); - if (node.kind === 193 || node.kind === 150) { + if (node.kind === 198 || node.kind === 152) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); @@ -14570,7 +20227,7 @@ var ts; return checkVariableLikeDeclaration(node); } function checkVariableStatement(node) { - checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || checkGrammarModifiers(node) || checkGrammarVariableDeclarationList(node.declarationList) || checkGrammarForDisallowedLetOrConstStatement(node); + checkGrammarDecorators(node) || checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || checkGrammarModifiers(node) || checkGrammarVariableDeclarationList(node.declarationList) || checkGrammarForDisallowedLetOrConstStatement(node); ts.forEach(node.declarationList.declarations, checkSourceElement); } function checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) { @@ -14582,7 +20239,7 @@ var ts; } function inBlockOrObjectLiteralExpression(node) { while (node) { - if (node.kind === 174 || node.kind === 152) { + if (node.kind === 179 || node.kind === 154) { return true; } node = node.parent; @@ -14610,12 +20267,12 @@ var ts; } function checkForStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind == 194) { + if (node.initializer && node.initializer.kind == 199) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 194) { + if (node.initializer.kind === 199) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -14630,13 +20287,13 @@ var ts; } function checkForOfStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.initializer.kind === 194) { + if (node.initializer.kind === 199) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression); - if (varExpr.kind === 151 || varExpr.kind === 152) { + if (varExpr.kind === 153 || varExpr.kind === 154) { checkDestructuringAssignment(varExpr, iteratedType || unknownType); } else { @@ -14651,7 +20308,7 @@ var ts; } function checkForInStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.initializer.kind === 194) { + if (node.initializer.kind === 199) { 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); @@ -14661,7 +20318,7 @@ var ts; else { var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 151 || varExpr.kind === 152) { + if (varExpr.kind === 153 || varExpr.kind === 154) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!allConstituentTypesHaveKind(leftType, 1 | 258)) { @@ -14686,21 +20343,44 @@ var ts; } function checkRightHandSideOfForOf(rhsExpression) { var expressionType = getTypeOfExpression(rhsExpression); - return languageVersion >= 2 - ? checkIteratedType(expressionType, rhsExpression) - : checkElementTypeOfArrayOrString(expressionType, rhsExpression); + return languageVersion >= 2 ? checkIteratedType(expressionType, rhsExpression) : checkElementTypeOfArrayOrString(expressionType, rhsExpression); } function checkIteratedType(iterable, expressionForError) { ts.Debug.assert(languageVersion >= 2); var iteratedType = getIteratedType(iterable, expressionForError); if (expressionForError && iteratedType) { - var completeIterableType = globalIterableType !== emptyObjectType - ? createTypeReference(globalIterableType, [iteratedType]) - : emptyObjectType; + var completeIterableType = globalIterableType !== emptyObjectType ? createTypeReference(globalIterableType, [ + iteratedType + ]) : emptyObjectType; checkTypeAssignableTo(iterable, completeIterableType, expressionForError); } return iteratedType; function getIteratedType(iterable, expressionForError) { + // We want to treat type as an iterable, and get the type it is an iterable of. The iterable + // must have the following structure (annotated with the names of the variables below): + // + // { // iterable + // [Symbol.iterator]: { // iteratorFunction + // (): { // iterator + // next: { // iteratorNextFunction + // (): { // iteratorNextResult + // value: T // iteratorNextValue + // } + // } + // } + // } + // } + // + // T is the type we are after. At every level that involves analyzing return types + // of signatures, we union the return types of all the signatures. + // + // Another thing to note is that at any step of this process, we could run into a dead end, + // meaning either the property is missing, or we run into the anyType. If either of these things + // happens, we return undefined to signal that we could not find the iterated type. If a property + // is missing, and the previous step did not result in 'any', then we also give an error if the + // caller requested it. Then the caller can decide what to do in the case where there is no iterated + // type. This is different from returning anyType, because that would signify that we have matched the + // whole pattern and that T (above) is 'any'. if (allConstituentTypesHaveKind(iterable, 1)) { return undefined; } @@ -14760,9 +20440,7 @@ var ts; } if (!isArrayLikeType(arrayType)) { if (!reportedError) { - var diagnostic = hasStringConstituent - ? ts.Diagnostics.Type_0_is_not_an_array_type - : ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type; + var diagnostic = hasStringConstituent ? ts.Diagnostics.Type_0_is_not_an_array_type : ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type; error(expressionForError, diagnostic, typeToString(arrayType)); } return hasStringConstituent ? stringType : unknownType; @@ -14772,7 +20450,10 @@ var ts; if (arrayElementType.flags & 258) { return stringType; } - return getUnionType([arrayElementType, stringType]); + return getUnionType([ + arrayElementType, + stringType + ]); } return arrayElementType; } @@ -14780,7 +20461,7 @@ var ts; checkGrammarStatementInAmbientContext(node) || checkGrammarBreakOrContinueStatement(node); } function isGetAccessorWithAnnotatatedSetAccessor(node) { - return !!(node.kind === 134 && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 135))); + return !!(node.kind === 136 && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 137))); } function checkReturnStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { @@ -14794,11 +20475,11 @@ var ts; if (func) { var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func)); var exprType = checkExpressionCached(node.expression); - if (func.kind === 135) { + if (func.kind === 137) { error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); } else { - if (func.kind === 133) { + if (func.kind === 135) { if (!isTypeAssignableTo(exprType, returnType)) { error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -14825,7 +20506,7 @@ var ts; var hasDuplicateDefaultClause = false; var expressionType = checkExpression(node.expression); ts.forEach(node.caseBlock.clauses, function (clause) { - if (clause.kind === 215 && !hasDuplicateDefaultClause) { + if (clause.kind === 221 && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -14837,7 +20518,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 214) { + if (produceDiagnostics && clause.kind === 220) { var caseClause = clause; var caseType = checkExpression(caseClause.expression); if (!isTypeAssignableTo(expressionType, caseType)) { @@ -14854,7 +20535,7 @@ var ts; if (ts.isFunctionLike(current)) { break; } - if (current.kind === 189 && current.label.text === node.label.text) { + if (current.kind === 194 && 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; @@ -14880,7 +20561,7 @@ var ts; var catchClause = node.catchClause; if (catchClause) { if (catchClause.variableDeclaration) { - if (catchClause.variableDeclaration.name.kind !== 64) { + if (catchClause.variableDeclaration.name.kind !== 65) { grammarErrorOnFirstToken(catchClause.variableDeclaration.name, ts.Diagnostics.Catch_clause_variable_name_must_be_an_identifier); } else if (catchClause.variableDeclaration.type) { @@ -14918,9 +20599,9 @@ var ts; checkIndexConstraintForProperty(prop, propType, type, declaredStringIndexer, stringIndexType, 0); checkIndexConstraintForProperty(prop, propType, type, declaredNumberIndexer, numberIndexType, 1); }); - if (type.flags & 1024 && type.symbol.valueDeclaration.kind === 196) { + if (type.flags & 1024 && type.symbol.valueDeclaration.kind === 201) { var classDeclaration = type.symbol.valueDeclaration; - for (var _i = 0, _a = classDeclaration.members, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = classDeclaration.members; _i < _a.length; _i++) { var member = _a[_i]; if (!(member.flags & 128) && ts.hasDynamicName(member)) { var propType = getTypeOfSymbol(member.symbol); @@ -14934,7 +20615,9 @@ var ts; if (stringIndexType && numberIndexType) { errorNode = declaredNumberIndexer || declaredStringIndexer; if (!errorNode && (type.flags & 2048)) { - var someBaseTypeHasBothIndexers = ts.forEach(type.baseTypes, function (base) { return getIndexTypeOfType(base, 0) && getIndexTypeOfType(base, 1); }); + var someBaseTypeHasBothIndexers = ts.forEach(type.baseTypes, function (base) { + return getIndexTypeOfType(base, 0) && getIndexTypeOfType(base, 1); + }); errorNode = someBaseTypeHasBothIndexers ? undefined : type.symbol.declarations[0]; } } @@ -14948,22 +20631,22 @@ var ts; if (indexKind === 1 && !isNumericName(prop.valueDeclaration.name)) { return; } - var _errorNode; - if (prop.valueDeclaration.name.kind === 126 || prop.parent === containingType.symbol) { - _errorNode = prop.valueDeclaration; + var errorNode; + if (prop.valueDeclaration.name.kind === 127 || prop.parent === containingType.symbol) { + errorNode = prop.valueDeclaration; } else if (indexDeclaration) { - _errorNode = indexDeclaration; + errorNode = indexDeclaration; } else if (containingType.flags & 2048) { - var someBaseClassHasBothPropertyAndIndexer = ts.forEach(containingType.baseTypes, function (base) { return getPropertyOfObjectType(base, prop.name) && getIndexTypeOfType(base, indexKind); }); - _errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : containingType.symbol.declarations[0]; + var someBaseClassHasBothPropertyAndIndexer = ts.forEach(containingType.baseTypes, function (base) { + return getPropertyOfObjectType(base, prop.name) && getIndexTypeOfType(base, indexKind); + }); + errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : containingType.symbol.declarations[0]; } - if (_errorNode && !isTypeAssignableTo(propertyType, indexType)) { - var errorMessage = indexKind === 0 - ? ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_string_index_type_2 - : ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2; - error(_errorNode, errorMessage, symbolToString(prop), typeToString(propertyType), typeToString(indexType)); + if (errorNode && !isTypeAssignableTo(propertyType, indexType)) { + var errorMessage = indexKind === 0 ? ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_string_index_type_2 : ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2; + error(errorNode, errorMessage, symbolToString(prop), typeToString(propertyType), typeToString(indexType)); } } } @@ -14993,8 +20676,17 @@ var ts; } } } + function checkClassExpression(node) { + grammarErrorOnNode(node, ts.Diagnostics.class_expressions_are_not_currently_supported); + ts.forEach(node.members, checkSourceElement); + return unknownType; + } function checkClassDeclaration(node) { + if (node.parent.kind !== 206 && node.parent.kind !== 227) { + grammarErrorOnNode(node, ts.Diagnostics.class_declarations_are_only_supported_directly_inside_a_module_or_as_a_top_level_declaration); + } checkGrammarClassDeclarationHeritageClauses(node); + checkDecorators(node); if (node.name) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Class_name_cannot_be_0); checkCollisionWithCapturedThisVariable(node, node.name); @@ -15005,10 +20697,13 @@ var ts; var symbol = getSymbolOfNode(node); var type = getDeclaredTypeOfSymbol(symbol); var staticType = getTypeOfSymbol(symbol); - var baseTypeNode = ts.getClassBaseTypeNode(node); + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { + if (!ts.isSupportedHeritageClauseElement(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); - checkTypeReference(baseTypeNode); + checkHeritageClauseElement(baseTypeNode); } if (type.baseTypes.length) { if (produceDiagnostics) { @@ -15016,19 +20711,24 @@ var ts; checkTypeAssignableTo(type, baseType, node.name || node, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); var staticBaseType = getTypeOfSymbol(baseType.symbol); checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name || node, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); - if (baseType.symbol !== resolveEntityName(baseTypeNode.typeName, 107455)) { + if (baseType.symbol !== resolveEntityName(baseTypeNode.expression, 107455)) { error(baseTypeNode, ts.Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType)); } checkKindsOfPropertyMemberOverrides(type, baseType); } - checkExpressionOrQualifiedName(baseTypeNode.typeName); } - var implementedTypeNodes = ts.getClassImplementedTypeNodes(node); + if (type.baseTypes.length || (baseTypeNode && compilerOptions.separateCompilation)) { + checkExpressionOrQualifiedName(baseTypeNode.expression); + } + var implementedTypeNodes = ts.getClassImplementsHeritageClauseElements(node); if (implementedTypeNodes) { ts.forEach(implementedTypeNodes, function (typeRefNode) { - checkTypeReference(typeRefNode); + if (!ts.isSupportedHeritageClauseElement(typeRefNode)) { + error(typeRefNode.expression, ts.Diagnostics.A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments); + } + checkHeritageClauseElement(typeRefNode); if (produceDiagnostics) { - var t = getTypeFromTypeReferenceNode(typeRefNode); + var t = getTypeFromHeritageClauseElement(typeRefNode); if (t !== unknownType) { var declaredType = (t.flags & 4096) ? t.target : t; if (declaredType.flags & (1024 | 2048)) { @@ -15051,8 +20751,21 @@ var ts; return s.flags & 16777216 ? getSymbolLinks(s).target : s; } function checkKindsOfPropertyMemberOverrides(type, baseType) { + // TypeScript 1.0 spec (April 2014): 8.2.3 + // A derived class inherits all members from its base class it doesn't override. + // Inheritance means that a derived class implicitly contains all non - overridden members of the base class. + // Both public and private property members are inherited, but only public property members can be overridden. + // A property member in a derived class is said to override a property member in a base class + // when the derived class property member has the same name and kind(instance or static) + // as the base class property member. + // The type of an overriding property member must be assignable(section 3.8.4) + // to the type of the overridden property member, or otherwise a compile - time error occurs. + // Base class instance member functions can be overridden by derived class instance member functions, + // but not by other kinds of members. + // Base class instance member variables and accessors can be overridden by + // derived class instance member variables and accessors, but not by other kinds of members. var baseProperties = getPropertiesOfObjectType(baseType); - for (var _i = 0, _n = baseProperties.length; _i < _n; _i++) { + for (var _i = 0; _i < baseProperties.length; _i++) { var baseProperty = baseProperties[_i]; var base = getTargetSymbol(baseProperty); if (base.flags & 134217728) { @@ -15095,7 +20808,7 @@ var ts; } } function isAccessor(kind) { - return kind === 134 || kind === 135; + return kind === 136 || kind === 137; } function areTypeParametersIdentical(list1, list2) { if (!list1 && !list2) { @@ -15116,7 +20829,7 @@ var ts; if (!tp1.constraint || !tp2.constraint) { return false; } - if (!isTypeIdenticalTo(getTypeFromTypeNode(tp1.constraint), getTypeFromTypeNode(tp2.constraint))) { + if (!isTypeIdenticalTo(getTypeFromTypeNodeOrHeritageClauseElement(tp1.constraint), getTypeFromTypeNodeOrHeritageClauseElement(tp2.constraint))) { return false; } } @@ -15127,15 +20840,23 @@ var ts; return true; } var seen = {}; - ts.forEach(type.declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; }); + ts.forEach(type.declaredProperties, function (p) { + seen[p.name] = { + prop: p, + containingType: type + }; + }); var ok = true; - for (var _i = 0, _a = type.baseTypes, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = type.baseTypes; _i < _a.length; _i++) { var base = _a[_i]; var properties = getPropertiesOfObjectType(base); - for (var _b = 0, _c = properties.length; _b < _c; _b++) { + for (var _b = 0; _b < properties.length; _b++) { var prop = properties[_b]; if (!ts.hasProperty(seen, prop.name)) { - seen[prop.name] = { prop: prop, containingType: base }; + seen[prop.name] = { + prop: prop, + containingType: base + }; } else { var existing = seen[prop.name]; @@ -15154,13 +20875,13 @@ var ts; return ok; } function checkInterfaceDeclaration(node) { - checkGrammarModifiers(node) || checkGrammarInterfaceDeclaration(node); + checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarInterfaceDeclaration(node); checkTypeParameters(node.typeParameters); if (produceDiagnostics) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 197); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 202); 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); @@ -15176,32 +20897,37 @@ var ts; } } } - ts.forEach(ts.getInterfaceBaseTypeNodes(node), checkTypeReference); + ts.forEach(ts.getInterfaceBaseTypeNodes(node), function (heritageElement) { + if (!ts.isSupportedHeritageClauseElement(heritageElement)) { + error(heritageElement.expression, ts.Diagnostics.An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments); + } + checkHeritageClauseElement(heritageElement); + }); ts.forEach(node.members, checkSourceElement); if (produceDiagnostics) { checkTypeForDuplicateIndexSignatures(node); } } function checkTypeAliasDeclaration(node) { - checkGrammarModifiers(node); + checkGrammarDecorators(node) || checkGrammarModifiers(node); checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_alias_name_cannot_be_0); checkSourceElement(node.type); } function computeEnumMemberValues(node) { - var _nodeLinks = getNodeLinks(node); - if (!(_nodeLinks.flags & 128)) { + var nodeLinks = getNodeLinks(node); + if (!(nodeLinks.flags & 128)) { var enumSymbol = getSymbolOfNode(node); var enumType = getDeclaredTypeOfSymbol(enumSymbol); var autoValue = 0; var ambient = ts.isInAmbientContext(node); var enumIsConst = ts.isConst(node); ts.forEach(node.members, function (member) { - if (member.name.kind !== 126 && isNumericLiteralName(member.name.text)) { + if (member.name.kind !== 127 && isNumericLiteralName(member.name.text)) { error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name); } var initializer = member.initializer; if (initializer) { - autoValue = getConstantValueForEnumMemberInitializer(initializer, enumIsConst); + autoValue = getConstantValueForEnumMemberInitializer(initializer); if (autoValue === undefined) { if (enumIsConst) { error(initializer, ts.Diagnostics.In_const_enum_declarations_member_initializer_must_be_constant_expression); @@ -15226,27 +20952,27 @@ var ts; getNodeLinks(member).enumMemberValue = autoValue++; } }); - _nodeLinks.flags |= 128; + nodeLinks.flags |= 128; } - function getConstantValueForEnumMemberInitializer(initializer, enumIsConst) { + function getConstantValueForEnumMemberInitializer(initializer) { return evalConstant(initializer); function evalConstant(e) { switch (e.kind) { - case 165: + case 167: var value = evalConstant(e.operand); if (value === undefined) { return undefined; } switch (e.operator) { - case 33: return value; - case 34: return -value; - case 47: return enumIsConst ? ~value : undefined; + case 33: + return value; + case 34: + return -value; + case 47: + return ~value; } return undefined; - case 167: - if (!enumIsConst) { - return undefined; - } + case 169: var left = evalConstant(e.left); if (left === undefined) { return undefined; @@ -15256,58 +20982,79 @@ var ts; return undefined; } switch (e.operatorToken.kind) { - case 44: return left | right; - case 43: return left & right; - case 41: return left >> right; - case 42: return left >>> right; - case 40: return left << right; - case 45: return left ^ right; - case 35: return left * right; - case 36: return left / right; - case 33: return left + right; - case 34: return left - right; - case 37: return left % right; + case 44: + return left | right; + case 43: + return left & right; + case 41: + return left >> right; + case 42: + return left >>> right; + case 40: + return left << right; + case 45: + return left ^ right; + case 35: + return left * right; + case 36: + return left / right; + case 33: + return left + right; + case 34: + return left - right; + case 37: + return left % right; } return undefined; case 7: return +e.text; - case 159: - return enumIsConst ? evalConstant(e.expression) : undefined; - case 64: - case 154: - case 153: - if (!enumIsConst) { - return undefined; - } + case 161: + return evalConstant(e.expression); + case 65: + case 156: + case 155: var member = initializer.parent; var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); - var _enumType; + var enumType; var propertyName; - if (e.kind === 64) { - _enumType = currentType; + if (e.kind === 65) { + enumType = currentType; propertyName = e.text; } else { - if (e.kind === 154) { - if (e.argumentExpression === undefined || - e.argumentExpression.kind !== 8) { + var expression; + if (e.kind === 156) { + if (e.argumentExpression === undefined || e.argumentExpression.kind !== 8) { return undefined; } - _enumType = getTypeOfNode(e.expression); + expression = e.expression; propertyName = e.argumentExpression.text; } else { - _enumType = getTypeOfNode(e.expression); + expression = e.expression; propertyName = e.name.text; } - if (_enumType !== currentType) { + var current = expression; + while (current) { + if (current.kind === 65) { + break; + } + else if (current.kind === 155) { + current = current.expression; + } + else { + return undefined; + } + } + enumType = checkExpression(expression); + if (!(enumType.symbol && (enumType.symbol.flags & 384))) { return undefined; } } if (propertyName === undefined) { return undefined; } - var property = getPropertyOfObjectType(_enumType, propertyName); + var property = getPropertyOfObjectType(enumType, propertyName); if (!property || !(property.flags & 8)) { return undefined; } @@ -15327,17 +21074,20 @@ var ts; if (!produceDiagnostics) { return; } - checkGrammarModifiers(node) || checkGrammarEnumDeclaration(node); + checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarEnumDeclaration(node); checkTypeNameIsReserved(node.name, ts.Diagnostics.Enum_name_cannot_be_0); checkCollisionWithCapturedThisVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); computeEnumMemberValues(node); + var enumIsConst = ts.isConst(node); + if (compilerOptions.separateCompilation && enumIsConst && ts.isInAmbientContext(node)) { + error(node.name, ts.Diagnostics.Ambient_const_enums_are_not_allowed_when_the_separateCompilation_flag_is_provided); + } var enumSymbol = getSymbolOfNode(node); var firstDeclaration = ts.getDeclarationOfKind(enumSymbol, node.kind); if (node === firstDeclaration) { if (enumSymbol.declarations.length > 1) { - var enumIsConst = ts.isConst(node); ts.forEach(enumSymbol.declarations, function (decl) { if (ts.isConstEnumDeclaration(decl) !== enumIsConst) { error(decl.name, ts.Diagnostics.Enum_declarations_must_all_be_const_or_non_const); @@ -15346,7 +21096,7 @@ var ts; } var seenEnumMissingInitialInitializer = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 199) { + if (declaration.kind !== 204) { return false; } var enumDeclaration = declaration; @@ -15367,9 +21117,9 @@ var ts; } function getFirstNonAmbientClassOrFunctionDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; - if ((declaration.kind === 196 || (declaration.kind === 195 && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { + if ((declaration.kind === 201 || (declaration.kind === 200 && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { return declaration; } } @@ -15377,7 +21127,7 @@ var ts; } function checkModuleDeclaration(node) { if (produceDiagnostics) { - if (!checkGrammarModifiers(node)) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node)) { if (!ts.isInAmbientContext(node) && node.name.kind === 8) { grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names); } @@ -15386,10 +21136,7 @@ var ts; checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - if (symbol.flags & 512 - && symbol.declarations.length > 1 - && !ts.isInAmbientContext(node) - && ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums)) { + if (symbol.flags & 512 && symbol.declarations.length > 1 && !ts.isInAmbientContext(node) && ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation)) { var classOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (classOrFunc) { if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(classOrFunc)) { @@ -15412,22 +21159,29 @@ var ts; checkSourceElement(node.body); } function getFirstIdentifier(node) { - while (node.kind === 125) { - node = node.left; + while (true) { + if (node.kind === 126) { + node = node.left; + } + else if (node.kind === 155) { + node = node.expression; + } + else { + break; + } } + ts.Debug.assert(node.kind === 65); return node; } function checkExternalImportOrExportDeclaration(node) { var moduleName = ts.getExternalModuleName(node); - if (ts.getFullWidth(moduleName) !== 0 && moduleName.kind !== 8) { + if (!ts.nodeIsMissing(moduleName) && moduleName.kind !== 8) { error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 201 && node.parent.parent.name.kind === 8; - if (node.parent.kind !== 221 && !inAmbientExternalModule) { - error(moduleName, node.kind === 210 ? - 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 === 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); return false; } if (inAmbientExternalModule && isExternalModuleNameRelative(moduleName.text)) { @@ -15440,13 +21194,9 @@ var ts; var symbol = getSymbolOfNode(node); var target = resolveAlias(symbol); if (target !== unknownSymbol) { - var excludedMeanings = (symbol.flags & 107455 ? 107455 : 0) | - (symbol.flags & 793056 ? 793056 : 0) | - (symbol.flags & 1536 ? 1536 : 0); + var excludedMeanings = (symbol.flags & 107455 ? 107455 : 0) | (symbol.flags & 793056 ? 793056 : 0) | (symbol.flags & 1536 ? 1536 : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 212 ? - ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : - ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; + var message = node.kind === 217 ? 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)); } } @@ -15457,7 +21207,7 @@ var ts; checkAliasSymbol(node); } function checkImportDeclaration(node) { - if (!checkGrammarModifiers(node) && (node.flags & 499)) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_import_declaration_cannot_have_modifiers); } if (checkExternalImportOrExportDeclaration(node)) { @@ -15467,7 +21217,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 206) { + if (importClause.namedBindings.kind === 211) { checkImportBinding(importClause.namedBindings); } else { @@ -15478,7 +21228,7 @@ var ts; } } function checkImportEqualsDeclaration(node) { - checkGrammarModifiers(node); + checkGrammarDecorators(node) || checkGrammarModifiers(node); if (ts.isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) { checkImportBinding(node); if (node.flags & 1) { @@ -15498,15 +21248,30 @@ var ts; } } } + else { + if (languageVersion >= 2) { + grammarErrorOnNode(node, ts.Diagnostics.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); + } + } } } function checkExportDeclaration(node) { - if (!checkGrammarModifiers(node) && (node.flags & 499)) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_declaration_cannot_have_modifiers); } 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); + } + } + 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)); + } } } } @@ -15517,67 +21282,58 @@ var ts; } } function checkExportAssignment(node) { - var container = node.parent.kind === 221 ? node.parent : node.parent.parent; - if (container.kind === 200 && container.name.kind === 64) { + 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); return; } - if (!checkGrammarModifiers(node) && (node.flags & 499)) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_assignment_cannot_have_modifiers); } - if (node.expression.kind === 64) { - markExportAsReferenced(node); + if (node.expression) { + if (node.expression.kind === 65) { + markExportAsReferenced(node); + } + else { + checkExpressionCached(node.expression); + } } - else { - checkExpressionCached(node.expression); + if (node.type) { + checkSourceElement(node.type); + if (!ts.isInAmbientContext(node)) { + grammarErrorOnFirstToken(node.type, ts.Diagnostics.A_type_annotation_on_an_export_statement_is_only_allowed_in_an_ambient_external_module_declaration); + } } 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); + } } function getModuleStatements(node) { - if (node.kind === 221) { + if (node.kind === 227) { return node.statements; } - if (node.kind === 200 && node.body.kind === 201) { + if (node.kind === 205 && node.body.kind === 206) { return node.body.statements; } return emptyArray; } function hasExportedMembers(moduleSymbol) { - var declarations = moduleSymbol.declarations; - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { - var current = declarations[_i]; - var statements = getModuleStatements(current); - for (var _a = 0, _b = statements.length; _a < _b; _a++) { - var node = statements[_a]; - if (node.kind === 210) { - var exportClause = node.exportClause; - if (!exportClause) { - return true; - } - var specifiers = exportClause.elements; - for (var _c = 0, _d = specifiers.length; _c < _d; _c++) { - var specifier = specifiers[_c]; - if (!(specifier.propertyName && specifier.name && specifier.name.text === "default")) { - return true; - } - } - } - else if (node.kind !== 209 && node.flags & 1 && !(node.flags & 256)) { - return true; - } + for (var id in moduleSymbol.exports) { + if (id !== "export=") { + return true; } } + return false; } function checkExternalModuleExports(node) { var moduleSymbol = getSymbolOfNode(node); var links = getSymbolLinks(moduleSymbol); if (!links.exportsChecked) { - var defaultSymbol = getExportAssignmentSymbol(moduleSymbol); - if (defaultSymbol) { - if (hasExportedMembers(moduleSymbol)) { - var declaration = getDeclarationOfAliasSymbol(defaultSymbol) || defaultSymbol.valueDeclaration; - error(declaration, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); - } + var exportEqualsSymbol = moduleSymbol.exports["export="]; + if (exportEqualsSymbol && hasExportedMembers(moduleSymbol)) { + var declaration = getDeclarationOfAliasSymbol(exportEqualsSymbol) || exportEqualsSymbol.valueDeclaration; + error(declaration, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); } links.exportsChecked = true; } @@ -15586,185 +21342,187 @@ var ts; if (!node) return; switch (node.kind) { - case 127: - return checkTypeParameter(node); case 128: - return checkParameter(node); - case 130: + return checkTypeParameter(node); case 129: - return checkPropertyDeclaration(node); - case 140: - case 141: - case 136: - case 137: - return checkSignatureDeclaration(node); - case 138: - return checkSignatureDeclaration(node); + return checkParameter(node); case 132: case 131: - return checkMethodDeclaration(node); - case 133: - return checkConstructorDeclaration(node); - case 134: - case 135: - return checkAccessorDeclaration(node); - case 139: - return checkTypeReference(node); + return checkPropertyDeclaration(node); case 142: - return checkTypeQuery(node); case 143: - return checkTypeLiteral(node); + case 138: + 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 checkTypeReferenceNode(node); case 144: - return checkArrayType(node); + return checkTypeQuery(node); case 145: - return checkTupleType(node); + return checkTypeLiteral(node); case 146: - return checkUnionType(node); + return checkArrayType(node); case 147: + return checkTupleType(node); + case 148: + return checkUnionType(node); + case 149: return checkSourceElement(node.type); - case 195: - return checkFunctionDeclaration(node); - case 174: - case 201: - return checkBlock(node); - case 175: - return checkVariableStatement(node); - case 177: - return checkExpressionStatement(node); - case 178: - return checkIfStatement(node); - case 179: - return checkDoStatement(node); - case 180: - return checkWhileStatement(node); - case 181: - return checkForStatement(node); - case 182: - return checkForInStatement(node); - case 183: - return checkForOfStatement(node); - case 184: - case 185: - return checkBreakOrContinueStatement(node); - case 186: - return checkReturnStatement(node); - case 187: - return checkWithStatement(node); - case 188: - return checkSwitchStatement(node); - case 189: - return checkLabeledStatement(node); - case 190: - return checkThrowStatement(node); - case 191: - return checkTryStatement(node); - case 193: - return checkVariableDeclaration(node); - case 150: - return checkBindingElement(node); - case 196: - return checkClassDeclaration(node); - case 197: - return checkInterfaceDeclaration(node); - case 198: - return checkTypeAliasDeclaration(node); - case 199: - return checkEnumDeclaration(node); case 200: - return checkModuleDeclaration(node); - case 204: - return checkImportDeclaration(node); - case 203: - return checkImportEqualsDeclaration(node); - case 210: - return checkExportDeclaration(node); - case 209: - return checkExportAssignment(node); - case 176: - checkGrammarStatementInAmbientContext(node); - return; + 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); + case 181: checkGrammarStatementInAmbientContext(node); return; + case 197: + checkGrammarStatementInAmbientContext(node); + return; + case 218: + return checkMissingDeclaration(node); } } function checkFunctionExpressionBodies(node) { switch (node.kind) { - case 160: - case 161: + case 162: + case 163: ts.forEach(node.parameters, checkFunctionExpressionBodies); checkFunctionExpressionOrObjectLiteralMethodBody(node); break; - case 132: - case 131: + case 134: + case 133: ts.forEach(node.parameters, checkFunctionExpressionBodies); if (ts.isObjectLiteralMethod(node)) { checkFunctionExpressionOrObjectLiteralMethodBody(node); } break; - case 133: - case 134: case 135: - case 195: + case 136: + case 137: + case 200: ts.forEach(node.parameters, checkFunctionExpressionBodies); break; - case 187: + case 192: checkFunctionExpressionBodies(node.expression); break; - case 128: - case 130: case 129: - case 148: - case 149: + case 132: + case 131: case 150: case 151: case 152: - case 218: case 153: case 154: + case 224: case 155: case 156: case 157: - case 169: - case 173: case 158: case 159: - case 163: - case 164: - case 162: + case 171: + case 176: + case 160: + case 161: case 165: case 166: + case 164: case 167: case 168: - case 171: - case 174: - case 201: - case 175: - case 177: - case 178: + case 169: + case 170: + case 173: case 179: + case 206: case 180: - case 181: case 182: case 183: case 184: case 185: case 186: + case 187: case 188: - case 202: - case 214: - case 215: case 189: case 190: case 191: - case 217: case 193: - case 194: - case 196: - case 199: + case 207: case 220: - case 209: case 221: + case 194: + case 195: + case 196: + case 223: + case 198: + case 199: + case 201: + case 204: + case 226: + case 214: + case 227: ts.forEachChild(node, checkFunctionExpressionBodies); break; } @@ -15792,6 +21550,9 @@ var ts; if (emitExtends) { links.flags |= 8; } + if (emitDecorate) { + links.flags |= 512; + } links.flags |= 1; } } @@ -15816,7 +21577,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 187 && node.parent.statement === node) { + if (node.parent.kind === 192 && node.parent.statement === node) { return true; } node = node.parent; @@ -15827,6 +21588,44 @@ var ts; function getSymbolsInScope(location, meaning) { var symbols = {}; var memberFlags = 0; + if (isInsideWithStatementBody(location)) { + return []; + } + populateSymbols(); + return symbolsToArray(symbols); + function populateSymbols() { + while (location) { + if (location.locals && !isGlobalSourceFile(location)) { + copySymbols(location.locals, meaning); + } + switch (location.kind) { + case 227: + if (!ts.isExternalModule(location)) { + break; + } + case 205: + copySymbols(getSymbolOfNode(location).exports, meaning & 8914931); + break; + case 204: + copySymbols(getSymbolOfNode(location).exports, meaning & 8); + break; + case 201: + case 202: + if (!(memberFlags & 128)) { + copySymbols(getSymbolOfNode(location).members, meaning & 793056); + } + break; + case 162: + if (location.name) { + copySymbol(location.symbol, meaning); + } + break; + } + memberFlags = location.flags; + location = location.parent; + } + copySymbols(globals, meaning); + } function copySymbol(symbol, meaning) { if (symbol.flags & meaning) { var id = symbol.name; @@ -15852,22 +21651,22 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 221: + case 227: if (!ts.isExternalModule(location)) break; - case 200: + case 205: copySymbols(getSymbolOfNode(location).exports, meaning & 8914931); break; - case 199: + case 204: copySymbols(getSymbolOfNode(location).exports, meaning & 8); break; - case 196: - case 197: + case 201: + case 202: if (!(memberFlags & 128)) { copySymbols(getSymbolOfNode(location).members, meaning & 793056); } break; - case 160: + case 162: if (location.name) { copySymbol(location.symbol, meaning); } @@ -15877,97 +21676,111 @@ var ts; location = location.parent; } copySymbols(globals, meaning); - return ts.mapToArray(symbols); + return symbolsToArray(symbols); } function isTypeDeclarationName(name) { - return name.kind == 64 && - isTypeDeclaration(name.parent) && - name.parent.name === name; + return name.kind == 65 && isTypeDeclaration(name.parent) && name.parent.name === name; } function isTypeDeclaration(node) { switch (node.kind) { - case 127: - case 196: - case 197: - case 198: - case 199: + case 128: + case 201: + case 202: + case 203: + case 204: return true; } } function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 125) + while (node.parent && node.parent.kind === 126) { node = node.parent; - return node.parent && node.parent.kind === 139; + } + return node.parent && node.parent.kind === 141; } - function isTypeNode(node) { - if (139 <= node.kind && node.kind <= 147) { + function isHeritageClauseElementIdentifier(entityName) { + var node = entityName; + while (node.parent && node.parent.kind === 155) { + node = node.parent; + } + return node.parent && node.parent.kind === 177; + } + function isTypeNodeOrHeritageClauseElement(node) { + if (141 <= node.kind && node.kind <= 149) { return true; } switch (node.kind) { - case 111: - case 118: - case 120: case 112: + case 119: case 121: + case 113: + case 122: return true; - case 98: - return node.parent.kind !== 164; + case 99: + return node.parent.kind !== 166; case 8: - return node.parent.kind === 128; - case 64: - if (node.parent.kind === 125 && node.parent.right === node) { + return node.parent.kind === 129; + case 177: + return true; + case 65: + if (node.parent.kind === 126 && node.parent.right === node) { node = node.parent; } - case 125: - ts.Debug.assert(node.kind === 64 || node.kind === 125, "'node' was expected to be a qualified name or identifier in 'isTypeNode'."); - var _parent = node.parent; - if (_parent.kind === 142) { + else if (node.parent.kind === 155 && 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'."); + var parent_5 = node.parent; + if (parent_5.kind === 144) { return false; } - if (139 <= _parent.kind && _parent.kind <= 147) { + if (141 <= parent_5.kind && parent_5.kind <= 149) { return true; } - switch (_parent.kind) { - case 127: - return node === _parent.constraint; - case 130: - case 129: + switch (parent_5.kind) { + case 177: + return true; case 128: - case 193: - return node === _parent.type; - case 195: - case 160: - case 161: - case 133: + return node === parent_5.constraint; case 132: case 131: - case 134: + case 129: + case 198: + return node === parent_5.type; + case 200: + case 162: + case 163: case 135: - return node === _parent.type; + case 134: + case 133: case 136: case 137: + return node === parent_5.type; case 138: - return node === _parent.type; - case 158: - return node === _parent.type; - case 155: - case 156: - return _parent.typeArguments && ts.indexOf(_parent.typeArguments, node) >= 0; + case 139: + case 140: + return node === parent_5.type; + case 160: + return node === parent_5.type; case 157: + case 158: + return parent_5.typeArguments && ts.indexOf(parent_5.typeArguments, node) >= 0; + case 159: return false; } } return false; } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 125) { + while (nodeOnRightSide.parent.kind === 126) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 203) { + if (nodeOnRightSide.parent.kind === 208) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 209) { + if (nodeOnRightSide.parent.kind === 214) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -15975,52 +21788,53 @@ var ts; function isInRightSideOfImportOrExportAssignment(node) { return getLeftSideOfImportEqualsOrExportAssignment(node) !== undefined; } - function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 125 && node.parent.right === node) || - (node.parent.kind === 153 && node.parent.name === node); - } function getSymbolOfEntityNameOrPropertyAccessExpression(entityName) { if (ts.isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 209) { + if (entityName.parent.kind === 214) { return resolveEntityName(entityName, 107455 | 793056 | 1536 | 8388608); } - if (entityName.kind !== 153) { + if (entityName.kind !== 155) { if (isInRightSideOfImportOrExportAssignment(entityName)) { return getSymbolOfPartOfRightHandSideOfImportEquals(entityName); } } - if (isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { + if (ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (ts.isExpression(entityName)) { - if (ts.getFullWidth(entityName) === 0) { + if (isHeritageClauseElementIdentifier(entityName)) { + var meaning = entityName.parent.kind === 177 ? 793056 : 1536; + meaning |= 8388608; + return resolveEntityName(entityName, meaning); + } + else if (ts.isExpression(entityName)) { + if (ts.nodeIsMissing(entityName)) { return undefined; } - if (entityName.kind === 64) { + if (entityName.kind === 65) { var meaning = 107455 | 8388608; return resolveEntityName(entityName, meaning); } - else if (entityName.kind === 153) { + else if (entityName.kind === 155) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccessExpression(entityName); } return getNodeLinks(entityName).resolvedSymbol; } - else if (entityName.kind === 125) { - var _symbol = getNodeLinks(entityName).resolvedSymbol; - if (!_symbol) { + else if (entityName.kind === 126) { + var symbol = getNodeLinks(entityName).resolvedSymbol; + if (!symbol) { checkQualifiedName(entityName); } return getNodeLinks(entityName).resolvedSymbol; } } else if (isTypeReferenceIdentifier(entityName)) { - var _meaning = entityName.parent.kind === 139 ? 793056 : 1536; - _meaning |= 8388608; - return resolveEntityName(entityName, _meaning); + var meaning = entityName.parent.kind === 141 ? 793056 : 1536; + meaning |= 8388608; + return resolveEntityName(entityName, meaning); } return undefined; } @@ -16031,36 +21845,31 @@ var ts; if (ts.isDeclarationName(node)) { return getSymbolOfNode(node.parent); } - if (node.kind === 64 && isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 209 - ? getSymbolOfEntityNameOrPropertyAccessExpression(node) - : getSymbolOfPartOfRightHandSideOfImportEquals(node); + if (node.kind === 65 && isInRightSideOfImportOrExportAssignment(node)) { + return node.parent.kind === 214 ? getSymbolOfEntityNameOrPropertyAccessExpression(node) : getSymbolOfPartOfRightHandSideOfImportEquals(node); } switch (node.kind) { - case 64: - case 153: - case 125: + case 65: + case 155: + case 126: return getSymbolOfEntityNameOrPropertyAccessExpression(node); - case 92: - case 90: + case 93: + case 91: var type = checkExpression(node); return type.symbol; - case 113: + case 114: var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 133) { + if (constructorDeclaration && constructorDeclaration.kind === 135) { return constructorDeclaration.parent.symbol; } return undefined; case 8: var moduleName; - if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && - ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 204 || node.parent.kind === 210) && - node.parent.moduleSpecifier === node)) { + if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || ((node.parent.kind === 209 || node.parent.kind === 215) && node.parent.moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } case 7: - if (node.parent.kind == 154 && node.parent.argumentExpression === node) { + if (node.parent.kind == 156 && node.parent.argumentExpression === node) { var objectType = checkExpression(node.parent.expression); if (objectType === unknownType) return undefined; @@ -16074,7 +21883,7 @@ var ts; return undefined; } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 219) { + if (location && location.kind === 225) { return resolveEntityName(location.name, 107455); } return undefined; @@ -16083,37 +21892,37 @@ var ts; if (isInsideWithStatementBody(node)) { return unknownType; } + if (isTypeNodeOrHeritageClauseElement(node)) { + return getTypeFromTypeNodeOrHeritageClauseElement(node); + } if (ts.isExpression(node)) { return getTypeOfExpression(node); } - if (isTypeNode(node)) { - return getTypeFromTypeNode(node); - } if (isTypeDeclaration(node)) { var symbol = getSymbolOfNode(node); return getDeclaredTypeOfSymbol(symbol); } if (isTypeDeclarationName(node)) { - var _symbol = getSymbolInfo(node); - return _symbol && getDeclaredTypeOfSymbol(_symbol); + var symbol = getSymbolInfo(node); + return symbol && getDeclaredTypeOfSymbol(symbol); } if (ts.isDeclaration(node)) { - var _symbol_1 = getSymbolOfNode(node); - return getTypeOfSymbol(_symbol_1); + var symbol = getSymbolOfNode(node); + return getTypeOfSymbol(symbol); } if (ts.isDeclarationName(node)) { - var _symbol_2 = getSymbolInfo(node); - return _symbol_2 && getTypeOfSymbol(_symbol_2); + var symbol = getSymbolInfo(node); + return symbol && getTypeOfSymbol(symbol); } if (isInRightSideOfImportOrExportAssignment(node)) { - var _symbol_3 = getSymbolInfo(node); - var declaredType = _symbol_3 && getDeclaredTypeOfSymbol(_symbol_3); - return declaredType !== unknownType ? declaredType : getTypeOfSymbol(_symbol_3); + var symbol = getSymbolInfo(node); + var declaredType = symbol && getDeclaredTypeOfSymbol(symbol); + return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); } return unknownType; } function getTypeOfExpression(expr) { - if (isRightSideOfQualifiedNameOrPropertyAccess(expr)) { + if (ts.isRightSideOfQualifiedNameOrPropertyAccess(expr)) { expr = expr.parent; } return checkExpression(expr); @@ -16133,201 +21942,126 @@ var ts; function getRootSymbols(symbol) { if (symbol.flags & 268435456) { var symbols = []; - var _name = symbol.name; + var name_10 = symbol.name; ts.forEach(getSymbolLinks(symbol).unionType.types, function (t) { - symbols.push(getPropertyOfType(t, _name)); + symbols.push(getPropertyOfType(t, name_10)); }); return symbols; } else if (symbol.flags & 67108864) { var target = getSymbolLinks(symbol).target; if (target) { - return [target]; + return [ + target + ]; } } - return [symbol]; + return [ + symbol + ]; } function isExternalModuleSymbol(symbol) { - return symbol.flags & 512 && symbol.declarations.length === 1 && symbol.declarations[0].kind === 221; + return symbol.flags & 512 && symbol.declarations.length === 1 && symbol.declarations[0].kind === 227; } - function isNodeDescendentOf(node, ancestor) { - while (node) { - if (node === ancestor) - return true; - node = node.parent; + function getAliasNameSubstitution(symbol, getGeneratedNameForNode) { + if (languageVersion >= 2) { + return undefined; } - return false; - } - function isUniqueLocalName(name, container) { - for (var node = container; isNodeDescendentOf(node, container); node = node.nextContainer) { - if (node.locals && ts.hasProperty(node.locals, name)) { - if (node.locals[name].flags & (107455 | 1048576 | 8388608)) { - return false; - } + var node = getDeclarationOfAliasSymbol(symbol); + if (node) { + if (node.kind === 210) { + return getGeneratedNameForNode(node.parent) + ".default"; } - } - return true; - } - function getGeneratedNamesForSourceFile(sourceFile) { - var links = getNodeLinks(sourceFile); - var generatedNames = links.generatedNames; - if (!generatedNames) { - generatedNames = links.generatedNames = {}; - generateNames(sourceFile); - } - return generatedNames; - function generateNames(node) { - switch (node.kind) { - case 195: - case 196: - generateNameForFunctionOrClassDeclaration(node); - break; - case 200: - generateNameForModuleOrEnum(node); - generateNames(node.body); - break; - case 199: - generateNameForModuleOrEnum(node); - break; - case 204: - generateNameForImportDeclaration(node); - break; - case 210: - generateNameForExportDeclaration(node); - break; - case 209: - generateNameForExportAssignment(node); - break; - case 221: - case 201: - ts.forEach(node.statements, generateNames); - break; - } - } - function isExistingName(name) { - return ts.hasProperty(globals, name) || ts.hasProperty(sourceFile.identifiers, name) || ts.hasProperty(generatedNames, name); - } - function makeUniqueName(baseName) { - var _name = ts.generateUniqueName(baseName, isExistingName); - return generatedNames[_name] = _name; - } - function assignGeneratedName(node, name) { - getNodeLinks(node).generatedName = ts.unescapeIdentifier(name); - } - function generateNameForFunctionOrClassDeclaration(node) { - if (!node.name) { - assignGeneratedName(node, makeUniqueName("default")); - } - } - function generateNameForModuleOrEnum(node) { - if (node.name.kind === 64) { - var _name = node.name.text; - assignGeneratedName(node, isUniqueLocalName(_name, node) ? _name : makeUniqueName(_name)); - } - } - function generateNameForImportOrExportDeclaration(node) { - var expr = ts.getExternalModuleName(node); - var baseName = expr.kind === 8 ? - ts.escapeIdentifier(ts.makeIdentifierFromModuleName(expr.text)) : "module"; - assignGeneratedName(node, makeUniqueName(baseName)); - } - function generateNameForImportDeclaration(node) { - if (node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 207) { - generateNameForImportOrExportDeclaration(node); - } - } - function generateNameForExportDeclaration(node) { - if (node.moduleSpecifier) { - generateNameForImportOrExportDeclaration(node); - } - } - function generateNameForExportAssignment(node) { - if (node.expression.kind !== 64) { - assignGeneratedName(node, makeUniqueName("default")); + if (node.kind === 213) { + var moduleName = getGeneratedNameForNode(node.parent.parent.parent); + var propertyName = node.propertyName || node.name; + return moduleName + "." + ts.unescapeIdentifier(propertyName.text); } } } - function getGeneratedNameForNode(node) { - var links = getNodeLinks(node); - if (!links.generatedName) { - getGeneratedNamesForSourceFile(getSourceFile(node)); - } - return links.generatedName; - } - function getLocalNameOfContainer(container) { - return getGeneratedNameForNode(container); - } - function getLocalNameForImportDeclaration(node) { - return getGeneratedNameForNode(node); - } - function getAliasNameSubstitution(symbol) { - var declaration = getDeclarationOfAliasSymbol(symbol); - if (declaration && declaration.kind === 208) { - var moduleName = getGeneratedNameForNode(declaration.parent.parent.parent); - var propertyName = declaration.propertyName || declaration.name; - return moduleName + "." + ts.unescapeIdentifier(propertyName.text); - } - } - function getExportNameSubstitution(symbol, location) { + function getExportNameSubstitution(symbol, location, getGeneratedNameForNode) { if (isExternalModuleSymbol(symbol.parent)) { + if (languageVersion >= 2) { + return undefined; + } return "exports." + ts.unescapeIdentifier(symbol.name); } var node = location; var containerSymbol = getParentOfSymbol(symbol); while (node) { - if ((node.kind === 200 || node.kind === 199) && getSymbolOfNode(node) === containerSymbol) { + if ((node.kind === 205 || node.kind === 204) && getSymbolOfNode(node) === containerSymbol) { return getGeneratedNameForNode(node) + "." + ts.unescapeIdentifier(symbol.name); } node = node.parent; } } - function getExpressionNameSubstitution(node) { - var symbol = getNodeLinks(node).resolvedSymbol; + function getExpressionNameSubstitution(node, getGeneratedNameForNode) { + var symbol = getNodeLinks(node).resolvedSymbol || (ts.isDeclarationName(node) ? getSymbolOfNode(node.parent) : undefined); if (symbol) { if (symbol.parent) { - return getExportNameSubstitution(symbol, node.parent); + return getExportNameSubstitution(symbol, node.parent, getGeneratedNameForNode); } var exportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); if (symbol !== exportSymbol && !(exportSymbol.flags & 944)) { - return getExportNameSubstitution(exportSymbol, node.parent); + return getExportNameSubstitution(exportSymbol, node.parent, getGeneratedNameForNode); } if (symbol.flags & 8388608) { - return getAliasNameSubstitution(symbol); + return getAliasNameSubstitution(symbol, getGeneratedNameForNode); } } } - function hasExportDefaultValue(node) { - var symbol = getResolvedExportAssignmentSymbol(getSymbolOfNode(node)); - return symbol && symbol !== unknownSymbol && symbolIsValue(symbol) && !isConstEnumSymbol(symbol); + function isValueAliasDeclaration(node) { + switch (node.kind) { + case 208: + case 210: + case 211: + case 213: + case 217: + return isAliasResolvedToValue(getSymbolOfNode(node)); + case 215: + var exportClause = node.exportClause; + return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); + case 214: + return node.expression && node.expression.kind === 65 ? isAliasResolvedToValue(getSymbolOfNode(node)) : true; + } + return false; } function isTopLevelValueImportEqualsWithEntityName(node) { - if (node.parent.kind !== 221 || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node.parent.kind !== 227 || !ts.isInternalModuleImportEqualsDeclaration(node)) { return false; } - return isAliasResolvedToValue(getSymbolOfNode(node)); + var isValue = isAliasResolvedToValue(getSymbolOfNode(node)); + return isValue && node.moduleReference && !ts.nodeIsMissing(node.moduleReference); } function isAliasResolvedToValue(symbol) { var target = resolveAlias(symbol); - return target !== unknownSymbol && target.flags & 107455 && !isConstEnumOrConstEnumOnlyModule(target); + if (target === unknownSymbol && compilerOptions.separateCompilation) { + return true; + } + return target !== unknownSymbol && target && target.flags & 107455 && !isConstEnumOrConstEnumOnlyModule(target); } function isConstEnumOrConstEnumOnlyModule(s) { return isConstEnumSymbol(s) || s.constEnumOnlyModule; } - function isReferencedAliasDeclaration(node) { - if (isAliasSymbolDeclaration(node)) { + function isReferencedAliasDeclaration(node, checkChildren) { + if (ts.isAliasSymbolDeclaration(node)) { var symbol = getSymbolOfNode(node); if (getSymbolLinks(symbol).referenced) { return true; } } - return ts.forEachChild(node, isReferencedAliasDeclaration); + if (checkChildren) { + return ts.forEachChild(node, function (node) { + return isReferencedAliasDeclaration(node, checkChildren); + }); + } + return false; } function isImplementationOfOverload(node) { if (ts.nodeIsPresent(node.body)) { var symbol = getSymbolOfNode(node); var signaturesOfSymbol = getSignaturesOfSymbol(symbol); - return signaturesOfSymbol.length > 1 || - (signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node); + return signaturesOfSymbol.length > 1 || (signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node); } return false; } @@ -16339,66 +22073,64 @@ var ts; return getNodeLinks(node).enumMemberValue; } function getConstantValue(node) { - if (node.kind === 220) { + if (node.kind === 226) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; if (symbol && (symbol.flags & 8)) { - var declaration = symbol.valueDeclaration; - var constantValue; - if (declaration.kind === 220) { - return getEnumMemberValue(declaration); + if (ts.isConstEnumDeclaration(symbol.valueDeclaration.parent)) { + return getEnumMemberValue(symbol.valueDeclaration); } } return undefined; } function writeTypeOfDeclaration(declaration, enclosingDeclaration, flags, writer) { var symbol = getSymbolOfNode(declaration); - var type = symbol && !(symbol.flags & (2048 | 131072)) - ? getTypeOfSymbol(symbol) - : unknownType; + var type = symbol && !(symbol.flags & (2048 | 131072)) ? getTypeOfSymbol(symbol) : unknownType; getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); } function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) { var signature = getSignatureFromDeclaration(signatureDeclaration); getSymbolDisplayBuilder().buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags); } - function isUnknownIdentifier(location, name) { - ts.Debug.assert(!ts.nodeIsSynthesized(location), "isUnknownIdentifier called with a synthesized location"); - return !resolveName(location, name, 107455, undefined, undefined) && - !ts.hasProperty(getGeneratedNamesForSourceFile(getSourceFile(location)), name); + function writeTypeOfExpression(expr, enclosingDeclaration, flags, writer) { + var type = getTypeOfExpression(expr); + getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); + } + function hasGlobalName(name) { + return ts.hasProperty(globals, name); + } + function resolvesToSomeValue(location, name) { + ts.Debug.assert(!ts.nodeIsSynthesized(location), "resolvesToSomeValue called with a synthesized location"); + return !!resolveName(location, name, 107455, undefined, undefined); } function getBlockScopedVariableId(n) { ts.Debug.assert(!ts.nodeIsSynthesized(n)); - if (n.parent.kind === 153 && - n.parent.name === n) { - return undefined; - } - if (n.parent.kind === 150 && - n.parent.propertyName === n) { - return undefined; - } - var declarationSymbol = (n.parent.kind === 193 && n.parent.name === n) || - n.parent.kind === 150 - ? getSymbolOfNode(n.parent) - : undefined; - var symbol = declarationSymbol || - getNodeLinks(n).resolvedSymbol || - resolveName(n, n.text, 107455 | 8388608, undefined, undefined); - var isLetOrConst = symbol && - (symbol.flags & 2) && - symbol.valueDeclaration.parent.kind !== 217; + var isVariableDeclarationOrBindingElement = n.parent.kind === 152 || (n.parent.kind === 198 && 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; if (isLetOrConst) { getSymbolLinks(symbol); return symbol.id; } return undefined; } + function instantiateSingleCallFunctionType(functionType, typeArguments) { + if (functionType === unknownType) { + return unknownType; + } + var signature = getSingleCallSignature(functionType); + if (!signature) { + return unknownType; + } + var instantiatedSignature = getSignatureInstantiation(signature, typeArguments); + return getOrCreateTypeFromSignature(instantiatedSignature); + } function createResolver() { return { - getGeneratedNameForNode: getGeneratedNameForNode, getExpressionNameSubstitution: getExpressionNameSubstitution, - hasExportDefaultValue: hasExportDefaultValue, + isValueAliasDeclaration: isValueAliasDeclaration, + hasGlobalName: hasGlobalName, isReferencedAliasDeclaration: isReferencedAliasDeclaration, getNodeCheckFlags: getNodeCheckFlags, isTopLevelValueImportEqualsWithEntityName: isTopLevelValueImportEqualsWithEntityName, @@ -16406,10 +22138,12 @@ var ts; isImplementationOfOverload: isImplementationOfOverload, writeTypeOfDeclaration: writeTypeOfDeclaration, writeReturnTypeOfSignatureDeclaration: writeReturnTypeOfSignatureDeclaration, + writeTypeOfExpression: writeTypeOfExpression, isSymbolAccessible: isSymbolAccessible, isEntityNameVisible: isEntityNameVisible, getConstantValue: getConstantValue, - isUnknownIdentifier: isUnknownIdentifier, + resolvesToSomeValue: resolvesToSomeValue, + collectLinkedAliases: collectLinkedAliases, getBlockScopedVariableId: getBlockScopedVariableId }; } @@ -16434,6 +22168,11 @@ var ts; globalNumberType = getGlobalType("Number"); globalBooleanType = getGlobalType("Boolean"); globalRegExpType = getGlobalType("RegExp"); + globalTypedPropertyDescriptorType = getTypeOfGlobalSymbol(getGlobalTypeSymbol("TypedPropertyDescriptor"), 1); + globalClassDecoratorType = getGlobalType("ClassDecorator"); + globalPropertyDecoratorType = getGlobalType("PropertyDecorator"); + globalMethodDecoratorType = getGlobalType("MethodDecorator"); + globalParameterDecoratorType = getGlobalType("ParameterDecorator"); if (languageVersion >= 2) { globalTemplateStringsArrayType = getGlobalType("TemplateStringsArray"); globalESSymbolType = getGlobalType("Symbol"); @@ -16447,28 +22186,46 @@ var ts; } anyArrayType = createArrayType(anyType); } + function checkGrammarDecorators(node) { + if (!node.decorators) { + return false; + } + if (!ts.nodeCanBeDecorated(node)) { + return grammarErrorOnNode(node, ts.Diagnostics.Decorators_are_not_valid_here); + } + else if (languageVersion < 1) { + return grammarErrorOnNode(node, ts.Diagnostics.Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher); + } + else if (node.kind === 136 || node.kind === 137) { + var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); + if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { + return grammarErrorOnNode(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); + } + } + return false; + } function checkGrammarModifiers(node) { switch (node.kind) { - case 134: + case 136: + case 137: case 135: - case 133: - case 130: - case 129: case 132: case 131: - case 138: - case 196: - case 197: - case 200: - case 199: - case 175: - case 195: - case 198: + case 134: + case 133: + case 140: + case 201: + case 202: + case 205: case 204: + case 180: + case 200: case 203: - case 210: case 209: - case 128: + case 208: + case 215: + case 214: + case 129: break; default: return false; @@ -16478,17 +22235,17 @@ var ts; } var lastStatic, lastPrivate, lastProtected, lastDeclare; var flags = 0; - for (var _i = 0, _a = node.modifiers, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; switch (modifier.kind) { + case 109: case 108: case 107: - case 106: var text = void 0; - if (modifier.kind === 108) { + if (modifier.kind === 109) { text = "public"; } - else if (modifier.kind === 107) { + else if (modifier.kind === 108) { text = "protected"; lastProtected = modifier; } @@ -16502,50 +22259,50 @@ var ts; else if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); } - else if (node.parent.kind === 201 || node.parent.kind === 221) { + else if (node.parent.kind === 206 || node.parent.kind === 227) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); } flags |= ts.modifierToFlag(modifier.kind); break; - case 109: + case 110: if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static"); } - else if (node.parent.kind === 201 || node.parent.kind === 221) { + else if (node.parent.kind === 206 || node.parent.kind === 227) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); } - else if (node.kind === 128) { + else if (node.kind === 129) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } flags |= 128; lastStatic = modifier; break; - case 77: + case 78: if (flags & 1) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "export"); } else if (flags & 2) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); } - else if (node.parent.kind === 196) { + else if (node.parent.kind === 201) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 128) { + else if (node.kind === 129) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1; break; - case 114: + case 115: if (flags & 2) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); } - else if (node.parent.kind === 196) { + else if (node.parent.kind === 201) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 128) { + else if (node.kind === 129) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 201) { + else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 206) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 2; @@ -16553,7 +22310,7 @@ var ts; break; } } - if (node.kind === 133) { + if (node.kind === 135) { if (flags & 128) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -16564,13 +22321,13 @@ var ts; return grammarErrorOnNode(lastPrivate, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); } } - else if ((node.kind === 204 || node.kind === 203) && flags & 2) { + else if ((node.kind === 209 || node.kind === 208) && flags & 2) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 197 && flags & 2) { + else if (node.kind === 202 && flags & 2) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); } - else if (node.kind === 128 && (flags & 112) && ts.isBindingPattern(node.name)) { + else if (node.kind === 129 && (flags & 112) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_a_binding_pattern); } } @@ -16582,15 +22339,14 @@ var ts; return grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Trailing_comma_not_allowed); } } - function checkGrammarTypeParameterList(node, typeParameters) { + function checkGrammarTypeParameterList(node, typeParameters, file) { if (checkGrammarForDisallowedTrailingComma(typeParameters)) { return true; } if (typeParameters && typeParameters.length === 0) { var start = typeParameters.pos - "<".length; - var sourceFile = ts.getSourceFileOfNode(node); - var end = ts.skipTrivia(sourceFile.text, typeParameters.end) + ">".length; - return grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Type_parameter_list_cannot_be_empty); + var end = ts.skipTrivia(file.text, typeParameters.end) + ">".length; + return grammarErrorAtPos(file, start, end - start, ts.Diagnostics.Type_parameter_list_cannot_be_empty); } } function checkGrammarParameterList(parameters) { @@ -16626,7 +22382,19 @@ var ts; } } function checkGrammarFunctionLikeDeclaration(node) { - return checkGrammarModifiers(node) || checkGrammarTypeParameterList(node, node.typeParameters) || checkGrammarParameterList(node.parameters); + var file = ts.getSourceFileOfNode(node); + return checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarTypeParameterList(node, node.typeParameters, file) || checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file); + } + function checkGrammarArrowFunction(node, file) { + if (node.kind === 163) { + var arrowFunction = node; + var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; + var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; + if (startLine !== endLine) { + return grammarErrorOnNode(arrowFunction.equalsGreaterThanToken, ts.Diagnostics.Line_terminator_not_permitted_before_arrow); + } + } + return false; } function checkGrammarIndexSignatureParameters(node) { var parameter = node.parameters[0]; @@ -16653,7 +22421,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 !== 120 && parameter.type.kind !== 118) { + if (parameter.type.kind !== 121 && parameter.type.kind !== 119) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); } if (!node.type) { @@ -16666,7 +22434,7 @@ var ts; } } function checkGrammarIndexSignature(node) { - checkGrammarModifiers(node) || checkGrammarIndexSignatureParameters(node) || checkGrammarForIndexSignatureModifier(node); + return checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarIndexSignatureParameters(node) || checkGrammarForIndexSignatureModifier(node); } function checkGrammarForAtLeastOneTypeArgument(node, typeArguments) { if (typeArguments && typeArguments.length === 0) { @@ -16677,23 +22445,21 @@ var ts; } } function checkGrammarTypeArguments(node, typeArguments) { - return checkGrammarForDisallowedTrailingComma(typeArguments) || - checkGrammarForAtLeastOneTypeArgument(node, typeArguments); + return checkGrammarForDisallowedTrailingComma(typeArguments) || checkGrammarForAtLeastOneTypeArgument(node, typeArguments); } function checkGrammarForOmittedArgument(node, arguments) { if (arguments) { var sourceFile = ts.getSourceFileOfNode(node); - for (var _i = 0, _n = arguments.length; _i < _n; _i++) { + for (var _i = 0; _i < arguments.length; _i++) { var arg = arguments[_i]; - if (arg.kind === 172) { + if (arg.kind === 175) { return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } } } function checkGrammarArguments(node, arguments) { - return checkGrammarForDisallowedTrailingComma(arguments) || - checkGrammarForOmittedArgument(node, arguments); + return checkGrammarForDisallowedTrailingComma(arguments) || checkGrammarForOmittedArgument(node, arguments); } function checkGrammarHeritageClause(node) { var types = node.types; @@ -16709,10 +22475,10 @@ var ts; function checkGrammarClassDeclarationHeritageClauses(node) { var seenExtendsClause = false; var seenImplementsClause = false; - if (!checkGrammarModifiers(node) && node.heritageClauses) { - for (var _i = 0, _a = node.heritageClauses, _n = _a.length; _i < _n; _i++) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && node.heritageClauses) { + for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) { var heritageClause = _a[_i]; - if (heritageClause.token === 78) { + if (heritageClause.token === 79) { if (seenExtendsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen); } @@ -16725,7 +22491,7 @@ var ts; seenExtendsClause = true; } else { - ts.Debug.assert(heritageClause.token === 102); + ts.Debug.assert(heritageClause.token === 103); if (seenImplementsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.implements_clause_already_seen); } @@ -16738,16 +22504,16 @@ var ts; function checkGrammarInterfaceDeclaration(node) { var seenExtendsClause = false; if (node.heritageClauses) { - for (var _i = 0, _a = node.heritageClauses, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) { var heritageClause = _a[_i]; - if (heritageClause.token === 78) { + if (heritageClause.token === 79) { if (seenExtendsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen); } seenExtendsClause = true; } else { - ts.Debug.assert(heritageClause.token === 102); + ts.Debug.assert(heritageClause.token === 103); return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.Interface_declaration_cannot_have_implements_clause); } checkGrammarHeritageClause(heritageClause); @@ -16756,11 +22522,11 @@ var ts; return false; } function checkGrammarComputedPropertyName(node) { - if (node.kind !== 126) { + if (node.kind !== 127) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 167 && computedPropertyName.expression.operatorToken.kind === 23) { + if (computedPropertyName.expression.kind === 169 && computedPropertyName.expression.operatorToken.kind === 23) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } @@ -16784,54 +22550,53 @@ var ts; var SetAccesor = 4; var GetOrSetAccessor = GetAccessor | SetAccesor; var inStrictMode = (node.parserContextFlags & 1) !== 0; - for (var _i = 0, _a = node.properties, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - var _name = prop.name; - if (prop.kind === 172 || - _name.kind === 126) { - checkGrammarComputedPropertyName(_name); + var name_11 = prop.name; + if (prop.kind === 175 || name_11.kind === 127) { + checkGrammarComputedPropertyName(name_11); continue; } var currentKind = void 0; - if (prop.kind === 218 || prop.kind === 219) { + if (prop.kind === 224 || prop.kind === 225) { checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); - if (_name.kind === 7) { - checkGrammarNumbericLiteral(_name); + if (name_11.kind === 7) { + checkGrammarNumbericLiteral(name_11); } currentKind = Property; } - else if (prop.kind === 132) { + else if (prop.kind === 134) { currentKind = Property; } - else if (prop.kind === 134) { + else if (prop.kind === 136) { currentKind = GetAccessor; } - else if (prop.kind === 135) { + else if (prop.kind === 137) { currentKind = SetAccesor; } else { ts.Debug.fail("Unexpected syntax kind:" + prop.kind); } - if (!ts.hasProperty(seen, _name.text)) { - seen[_name.text] = currentKind; + if (!ts.hasProperty(seen, name_11.text)) { + seen[name_11.text] = currentKind; } else { - var existingKind = seen[_name.text]; + var existingKind = seen[name_11.text]; if (currentKind === Property && existingKind === Property) { if (inStrictMode) { - grammarErrorOnNode(_name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); + grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); } } else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[_name.text] = currentKind | existingKind; + seen[name_11.text] = currentKind | existingKind; } else { - return grammarErrorOnNode(_name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + return grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); } } else { - return grammarErrorOnNode(_name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + return grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); } } } @@ -16840,27 +22605,21 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.initializer.kind === 194) { + if (forInOrOfStatement.initializer.kind === 199) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { if (variableList.declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 182 - ? 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; + var diagnostic = forInOrOfStatement.kind === 187 ? 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 === 182 - ? 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); + var diagnostic = forInOrOfStatement.kind === 187 ? 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_1 = forInOrOfStatement.kind === 182 - ? 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_1); + var diagnostic = forInOrOfStatement.kind === 187 ? 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); } } } @@ -16880,10 +22639,10 @@ var ts; else if (accessor.typeParameters) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } - else if (kind === 134 && accessor.parameters.length) { + else if (kind === 136 && accessor.parameters.length) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); } - else if (kind === 135) { + else if (kind === 137) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -16908,17 +22667,15 @@ var ts; } } function checkGrammarForNonSymbolComputedProperty(node, message) { - if (node.kind === 126 && !ts.isWellKnownSymbolSyntactically(node.expression)) { + if (node.kind === 127 && !ts.isWellKnownSymbolSyntactically(node.expression)) { return grammarErrorOnNode(node, message); } } function checkGrammarMethod(node) { - if (checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || - checkGrammarFunctionLikeDeclaration(node) || - checkGrammarForGenerator(node)) { + if (checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || checkGrammarFunctionLikeDeclaration(node) || checkGrammarForGenerator(node)) { return true; } - if (node.parent.kind === 152) { + if (node.parent.kind === 154) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { return true; } @@ -16926,7 +22683,7 @@ var ts; return grammarErrorAtPos(getSourceFile(node), node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } } - if (node.parent.kind === 196) { + if (node.parent.kind === 201) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { return true; } @@ -16937,22 +22694,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 === 197) { + else if (node.parent.kind === 202) { 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 === 143) { + else if (node.parent.kind === 145) { 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 181: - case 182: - case 183: - case 179: - case 180: + case 186: + case 187: + case 188: + case 184: + case 185: return true; - case 189: + case 194: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -16964,18 +22721,17 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 189: + case 194: if (node.label && current.label.text === node.label.text) { - var isMisplacedContinueLabel = node.kind === 184 - && !isIterationStatement(current.statement, true); + var isMisplacedContinueLabel = node.kind === 189 && !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); } return false; } break; - case 188: - if (node.kind === 185 && !node.label) { + case 193: + if (node.kind === 190 && !node.label) { return false; } break; @@ -16988,16 +22744,12 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 185 - ? 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; + var message = node.kind === 190 ? 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 === 185 - ? 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); + var message = node.kind === 190 ? 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); } } function checkGrammarBindingElement(node) { @@ -17013,11 +22765,8 @@ var ts; return checkGrammarEvalOrArgumentsInStrictMode(node, node.name); } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 182 && node.parent.parent.kind !== 183) { + if (node.parent.parent.kind !== 187 && node.parent.parent.kind !== 188) { if (ts.isInAmbientContext(node)) { - if (ts.isBindingPattern(node.name)) { - return grammarErrorOnNode(node, ts.Diagnostics.Destructuring_declarations_are_not_allowed_in_ambient_contexts); - } if (node.initializer) { var equalsTokenLength = "=".length; return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.initializer.pos - equalsTokenLength, equalsTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); @@ -17033,18 +22782,17 @@ var ts; } } var checkLetConstNames = languageVersion >= 2 && (ts.isLet(node) || ts.isConst(node)); - return (checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name)) || - checkGrammarEvalOrArgumentsInStrictMode(node, node.name); + return (checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name)) || checkGrammarEvalOrArgumentsInStrictMode(node, node.name); } function checkGrammarNameInLetOrConstDeclarations(name) { - if (name.kind === 64) { + if (name.kind === 65) { if (name.text === "let") { return grammarErrorOnNode(name, ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations); } } else { var elements = name.elements; - for (var _i = 0, _n = elements.length; _i < _n; _i++) { + for (var _i = 0; _i < elements.length; _i++) { var element = elements[_i]; checkGrammarNameInLetOrConstDeclarations(element.name); } @@ -17061,15 +22809,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 178: - case 179: - case 180: - case 187: - case 181: - case 182: case 183: + case 184: + case 185: + case 192: + case 186: + case 187: + case 188: return false; - case 189: + case 194: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -17085,7 +22833,7 @@ var ts; } } function isIntegerLiteral(expression) { - if (expression.kind === 165) { + if (expression.kind === 167) { var unaryExpression = expression; if (unaryExpression.operator === 33 || unaryExpression.operator === 34) { expression = unaryExpression.operand; @@ -17102,9 +22850,9 @@ var ts; if (!enumIsConst) { var inConstantEnumMemberSection = true; var inAmbientContext = ts.isInAmbientContext(enumDecl); - for (var _i = 0, _a = enumDecl.members, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = enumDecl.members; _i < _a.length; _i++) { var node = _a[_i]; - if (node.name.kind === 126) { + if (node.name.kind === 127) { hasError = grammarErrorOnNode(node.name, ts.Diagnostics.Computed_property_names_are_not_allowed_in_enums); } else if (inAmbientContext) { @@ -17147,7 +22895,7 @@ var ts; } } function checkGrammarEvalOrArgumentsInStrictMode(contextNode, name) { - if (name && name.kind === 64) { + if (name && name.kind === 65) { var identifier = name; if (contextNode && (contextNode.parserContextFlags & 1) && ts.isEvalOrArgumentsIdentifier(identifier)) { var nameText = ts.declarationNameToString(identifier); @@ -17166,18 +22914,17 @@ var ts; } } function checkGrammarProperty(node) { - if (node.parent.kind === 196) { - 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)) { + if (node.parent.kind === 201) { + 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 === 197) { + else if (node.parent.kind === 202) { 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 === 143) { + else if (node.parent.kind === 145) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)) { return true; } @@ -17187,20 +22934,15 @@ var ts; } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 197 || - node.kind === 204 || - node.kind === 203 || - node.kind === 210 || - node.kind === 209 || - (node.flags & 2)) { + if (node.kind === 202 || node.kind === 209 || node.kind === 208 || node.kind === 215 || node.kind === 214 || (node.flags & 2) || (node.flags & (1 | 256))) { return false; } return grammarErrorOnFirstToken(node, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); } function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { - for (var _i = 0, _a = file.statements, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 175) { + if (ts.isDeclaration(decl) || decl.kind === 180) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -17219,10 +22961,10 @@ 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 === 174 || node.parent.kind === 201 || node.parent.kind === 221) { - var _links = getNodeLinks(node.parent); - if (!_links.hasReportedStatementInAmbientContext) { - return _links.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); + if (node.parent.kind === 179 || node.parent.kind === 206 || node.parent.kind === 227) { + 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); } } else { @@ -17252,251 +22994,16 @@ var ts; } ts.createTypeChecker = createTypeChecker; })(ts || (ts = {})); +/// var ts; (function (ts) { - var indentStrings = ["", " "]; - function getIndentString(level) { - if (indentStrings[level] === undefined) { - indentStrings[level] = getIndentString(level - 1) + indentStrings[1]; - } - return indentStrings[level]; - } - ts.getIndentString = getIndentString; - function getIndentSize() { - return indentStrings[1].length; - } - function shouldEmitToOwnFile(sourceFile, compilerOptions) { - if (!ts.isDeclarationFile(sourceFile)) { - if ((ts.isExternalModule(sourceFile) || !compilerOptions.out) && !ts.fileExtensionIs(sourceFile.fileName, ".js")) { - return true; - } - return false; - } - return false; - } - ts.shouldEmitToOwnFile = shouldEmitToOwnFile; - function isExternalModuleOrDeclarationFile(sourceFile) { - return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); - } - ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; - function createTextWriter(newLine) { - var output = ""; - var indent = 0; - var lineStart = true; - var lineCount = 0; - var linePos = 0; - function write(s) { - if (s && s.length) { - if (lineStart) { - output += getIndentString(indent); - lineStart = false; - } - output += s; - } - } - function rawWrite(s) { - if (s !== undefined) { - if (lineStart) { - lineStart = false; - } - output += s; - } - } - function writeLiteral(s) { - if (s && s.length) { - write(s); - var lineStartsOfS = ts.computeLineStarts(s); - if (lineStartsOfS.length > 1) { - lineCount = lineCount + lineStartsOfS.length - 1; - linePos = output.length - s.length + lineStartsOfS[lineStartsOfS.length - 1]; - } - } - } - function writeLine() { - if (!lineStart) { - output += newLine; - lineCount++; - linePos = output.length; - lineStart = true; - } - } - function writeTextOfNode(sourceFile, node) { - write(ts.getSourceTextOfNodeFromSourceFile(sourceFile, node)); - } - return { - write: write, - rawWrite: rawWrite, - writeTextOfNode: writeTextOfNode, - writeLiteral: writeLiteral, - writeLine: writeLine, - increaseIndent: function () { return indent++; }, - decreaseIndent: function () { return indent--; }, - getIndent: function () { return indent; }, - getTextPos: function () { return output.length; }, - getLine: function () { return lineCount + 1; }, - getColumn: function () { return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; }, - getText: function () { return output; } - }; - } - function getLineOfLocalPosition(currentSourceFile, pos) { - return ts.getLineAndCharacterOfPosition(currentSourceFile, pos).line; - } - function emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments) { - if (leadingComments && leadingComments.length && node.pos !== leadingComments[0].pos && - getLineOfLocalPosition(currentSourceFile, node.pos) !== getLineOfLocalPosition(currentSourceFile, leadingComments[0].pos)) { - writer.writeLine(); - } - } - function emitComments(currentSourceFile, writer, comments, trailingSeparator, newLine, writeComment) { - var emitLeadingSpace = !trailingSeparator; - ts.forEach(comments, function (comment) { - if (emitLeadingSpace) { - writer.write(" "); - emitLeadingSpace = false; - } - writeComment(currentSourceFile, writer, comment, newLine); - if (comment.hasTrailingNewLine) { - writer.writeLine(); - } - else if (trailingSeparator) { - writer.write(" "); - } - else { - emitLeadingSpace = true; - } - }); - } - function writeCommentRange(currentSourceFile, writer, comment, newLine) { - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42) { - var firstCommentLineAndCharacter = ts.getLineAndCharacterOfPosition(currentSourceFile, comment.pos); - var lineCount = ts.getLineStarts(currentSourceFile).length; - var firstCommentLineIndent; - for (var pos = comment.pos, currentLine = firstCommentLineAndCharacter.line; pos < comment.end; currentLine++) { - var nextLineStart = (currentLine + 1) === lineCount - ? currentSourceFile.text.length + 1 - : ts.getStartPositionOfLine(currentLine + 1, currentSourceFile); - if (pos !== comment.pos) { - if (firstCommentLineIndent === undefined) { - firstCommentLineIndent = calculateIndent(ts.getStartPositionOfLine(firstCommentLineAndCharacter.line, currentSourceFile), comment.pos); - } - var currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); - var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(pos, nextLineStart); - if (spacesToEmit > 0) { - var numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); - var indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); - writer.rawWrite(indentSizeSpaceString); - while (numberOfSingleSpacesToEmit) { - writer.rawWrite(" "); - numberOfSingleSpacesToEmit--; - } - } - else { - writer.rawWrite(""); - } - } - writeTrimmedCurrentLine(pos, nextLineStart); - pos = nextLineStart; - } - } - else { - writer.write(currentSourceFile.text.substring(comment.pos, comment.end)); - } - function writeTrimmedCurrentLine(pos, nextLineStart) { - var end = Math.min(comment.end, nextLineStart - 1); - var currentLineText = currentSourceFile.text.substring(pos, end).replace(/^\s+|\s+$/g, ''); - if (currentLineText) { - writer.write(currentLineText); - if (end !== comment.end) { - writer.writeLine(); - } - } - else { - writer.writeLiteral(newLine); - } - } - function calculateIndent(pos, end) { - var currentLineIndent = 0; - for (; pos < end && ts.isWhiteSpace(currentSourceFile.text.charCodeAt(pos)); pos++) { - if (currentSourceFile.text.charCodeAt(pos) === 9) { - currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); - } - else { - currentLineIndent++; - } - } - return currentLineIndent; - } - } - function getFirstConstructorWithBody(node) { - return ts.forEach(node.members, function (member) { - if (member.kind === 133 && ts.nodeIsPresent(member.body)) { - return member; - } - }); - } - function getAllAccessorDeclarations(declarations, accessor) { - var firstAccessor; - var getAccessor; - var setAccessor; - if (ts.hasDynamicName(accessor)) { - firstAccessor = accessor; - if (accessor.kind === 134) { - getAccessor = accessor; - } - else if (accessor.kind === 135) { - setAccessor = accessor; - } - else { - ts.Debug.fail("Accessor has wrong kind"); - } - } - else { - ts.forEach(declarations, function (member) { - if ((member.kind === 134 || member.kind === 135) - && (member.flags & 128) === (accessor.flags & 128)) { - var memberName = ts.getPropertyNameForPropertyNameNode(member.name); - var accessorName = ts.getPropertyNameForPropertyNameNode(accessor.name); - if (memberName === accessorName) { - if (!firstAccessor) { - firstAccessor = member; - } - if (member.kind === 134 && !getAccessor) { - getAccessor = member; - } - if (member.kind === 135 && !setAccessor) { - setAccessor = member; - } - } - } - }); - } - return { - firstAccessor: firstAccessor, - getAccessor: getAccessor, - setAccessor: setAccessor - }; - } - function getSourceFilePathInNewDir(sourceFile, host, newDirPath) { - var sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.fileName, host.getCurrentDirectory()); - sourceFilePath = sourceFilePath.replace(host.getCommonSourceDirectory(), ""); - return ts.combinePaths(newDirPath, sourceFilePath); - } - function getOwnEmitOutputFilePath(sourceFile, host, extension) { - var compilerOptions = host.getCompilerOptions(); - var emitOutputFilePathWithoutExtension; - if (compilerOptions.outDir) { - emitOutputFilePathWithoutExtension = ts.removeFileExtension(getSourceFilePathInNewDir(sourceFile, host, compilerOptions.outDir)); - } - else { - emitOutputFilePathWithoutExtension = ts.removeFileExtension(sourceFile.fileName); - } - return emitOutputFilePathWithoutExtension + extension; - } - function writeFile(host, diagnostics, fileName, data, writeByteOrderMark) { - host.writeFile(fileName, data, writeByteOrderMark, function (hostErrorMessage) { - diagnostics.push(ts.createCompilerDiagnostic(ts.Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage)); - }); + function getDeclarationDiagnostics(host, resolver, targetSourceFile) { + var diagnostics = []; + var jsFilePath = ts.getOwnEmitOutputFilePath(targetSourceFile, host, ".js"); + emitDeclarations(host, resolver, diagnostics, jsFilePath, targetSourceFile); + return diagnostics; } + ts.getDeclarationDiagnostics = getDeclarationDiagnostics; function emitDeclarations(host, resolver, diagnostics, jsFilePath, root) { var newLine = host.getNewLine(); var compilerOptions = host.getCompilerOptions(); @@ -17510,36 +23017,48 @@ var ts; var enclosingDeclaration; var currentSourceFile; var reportedDeclarationError = false; - var emitJsDocComments = compilerOptions.removeComments ? function (declaration) { } : writeJsDocComments; + var emitJsDocComments = compilerOptions.removeComments ? function (declaration) { + } : writeJsDocComments; var emit = compilerOptions.stripInternal ? stripInternal : emitNode; - var aliasDeclarationEmitInfo = []; + var moduleElementDeclarationEmitInfo = []; + var asynchronousSubModuleDeclarationEmitInfo; var referencePathsOutput = ""; if (root) { if (!compilerOptions.noResolve) { var addedGlobalFileReference = false; ts.forEach(root.referencedFiles, function (fileReference) { var referencedFile = ts.tryResolveScriptReference(host, root, fileReference); - if (referencedFile && ((referencedFile.flags & 2048) || - shouldEmitToOwnFile(referencedFile, compilerOptions) || - !addedGlobalFileReference)) { + if (referencedFile && ((referencedFile.flags & 2048) || ts.shouldEmitToOwnFile(referencedFile, compilerOptions) || !addedGlobalFileReference)) { writeReferencePath(referencedFile); - if (!isExternalModuleOrDeclarationFile(referencedFile)) { + if (!ts.isExternalModuleOrDeclarationFile(referencedFile)) { addedGlobalFileReference = true; } } }); } emitSourceFile(root); + if (moduleElementDeclarationEmitInfo.length) { + var oldWriter = writer; + ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { + if (aliasEmitInfo.isVisible) { + ts.Debug.assert(aliasEmitInfo.node.kind === 209); + createAndSetNewTextWriterWithSymbolWriter(); + ts.Debug.assert(aliasEmitInfo.indent === 0); + writeImportDeclaration(aliasEmitInfo.node); + aliasEmitInfo.asynchronousOutput = writer.getText(); + } + }); + setWriter(oldWriter); + } } 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) && - !ts.contains(emittedReferencedFiles, referencedFile))) { + if (referencedFile && (ts.isExternalModuleOrDeclarationFile(referencedFile) && !ts.contains(emittedReferencedFiles, referencedFile))) { writeReferencePath(referencedFile); emittedReferencedFiles.push(referencedFile); } @@ -17551,7 +23070,7 @@ var ts; } return { reportedDeclarationError: reportedDeclarationError, - aliasDeclarationEmitInfo: aliasDeclarationEmitInfo, + moduleElementDeclarationEmitInfo: moduleElementDeclarationEmitInfo, synchronousDeclarationOutput: writer.getText(), referencePathsOutput: referencePathsOutput }; @@ -17570,17 +23089,17 @@ var ts; } } function createAndSetNewTextWriterWithSymbolWriter() { - var _writer = createTextWriter(newLine); - _writer.trackSymbol = trackSymbol; - _writer.writeKeyword = _writer.write; - _writer.writeOperator = _writer.write; - _writer.writePunctuation = _writer.write; - _writer.writeSpace = _writer.write; - _writer.writeStringLiteral = _writer.writeLiteral; - _writer.writeParameter = _writer.write; - _writer.writeSymbol = _writer.write; - setWriter(_writer); - return _writer; + var writer = ts.createTextWriter(newLine); + writer.trackSymbol = trackSymbol; + writer.writeKeyword = writer.write; + writer.writeOperator = writer.write; + writer.writePunctuation = writer.write; + writer.writeSpace = writer.write; + writer.writeStringLiteral = writer.writeLiteral; + writer.writeParameter = writer.write; + writer.writeSymbol = writer.write; + setWriter(writer); + return writer; } function setWriter(newWriter) { writer = newWriter; @@ -17590,17 +23109,47 @@ var ts; increaseIndent = newWriter.increaseIndent; decreaseIndent = newWriter.decreaseIndent; } - function writeAsychronousImportEqualsDeclarations(importEqualsDeclarations) { + function writeAsynchronousModuleElements(nodes) { var oldWriter = writer; - ts.forEach(importEqualsDeclarations, function (aliasToWrite) { - var aliasEmitInfo = ts.forEach(aliasDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.declaration === aliasToWrite ? declEmitInfo : undefined; }); - if (aliasEmitInfo) { - createAndSetNewTextWriterWithSymbolWriter(); - for (var declarationIndent = aliasEmitInfo.indent; declarationIndent; declarationIndent--) { - increaseIndent(); + ts.forEach(nodes, function (declaration) { + var nodeToCheck; + if (declaration.kind === 198) { + nodeToCheck = declaration.parent.parent; + } + else if (declaration.kind === 212 || declaration.kind === 213 || declaration.kind === 210) { + ts.Debug.fail("We should be getting ImportDeclaration instead to write"); + } + else { + nodeToCheck = declaration; + } + var moduleElementEmitInfo = ts.forEach(moduleElementDeclarationEmitInfo, function (declEmitInfo) { + return declEmitInfo.node === nodeToCheck ? declEmitInfo : undefined; + }); + if (!moduleElementEmitInfo && asynchronousSubModuleDeclarationEmitInfo) { + moduleElementEmitInfo = ts.forEach(asynchronousSubModuleDeclarationEmitInfo, function (declEmitInfo) { + return declEmitInfo.node === nodeToCheck ? declEmitInfo : undefined; + }); + } + if (moduleElementEmitInfo) { + if (moduleElementEmitInfo.node.kind === 209) { + moduleElementEmitInfo.isVisible = true; + } + else { + createAndSetNewTextWriterWithSymbolWriter(); + for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { + increaseIndent(); + } + if (nodeToCheck.kind === 205) { + ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); + asynchronousSubModuleDeclarationEmitInfo = []; + } + writeModuleElement(nodeToCheck); + if (nodeToCheck.kind === 205) { + moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; + asynchronousSubModuleDeclarationEmitInfo = undefined; + } + moduleElementEmitInfo.asynchronousOutput = writer.getText(); } - writeImportEqualsDeclaration(aliasToWrite); - aliasEmitInfo.asynchronousOutput = writer.getText(); } }); setWriter(oldWriter); @@ -17608,7 +23157,7 @@ var ts; function handleSymbolAccessibilityError(symbolAccesibilityResult) { if (symbolAccesibilityResult.accessibility === 0) { if (symbolAccesibilityResult && symbolAccesibilityResult.aliasesToMakeVisible) { - writeAsychronousImportEqualsDeclarations(symbolAccesibilityResult.aliasesToMakeVisible); + writeAsynchronousModuleElements(symbolAccesibilityResult.aliasesToMakeVisible); } } else { @@ -17648,30 +23197,32 @@ var ts; } } function emitLines(nodes) { - for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + for (var _i = 0; _i < nodes.length; _i++) { var node = nodes[_i]; emit(node); } } - function emitSeparatedList(nodes, separator, eachNodeEmitFn) { + function emitSeparatedList(nodes, separator, eachNodeEmitFn, canEmitFn) { var currentWriterPos = writer.getTextPos(); - for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + for (var _i = 0; _i < nodes.length; _i++) { var node = nodes[_i]; - if (currentWriterPos !== writer.getTextPos()) { - write(separator); + if (!canEmitFn || canEmitFn(node)) { + if (currentWriterPos !== writer.getTextPos()) { + write(separator); + } + currentWriterPos = writer.getTextPos(); + eachNodeEmitFn(node); } - currentWriterPos = writer.getTextPos(); - eachNodeEmitFn(node); } } - function emitCommaList(nodes, eachNodeEmitFn) { - emitSeparatedList(nodes, ", ", eachNodeEmitFn); + function emitCommaList(nodes, eachNodeEmitFn, canEmitFn) { + emitSeparatedList(nodes, ", ", eachNodeEmitFn, canEmitFn); } function writeJsDocComments(declaration) { if (declaration) { var jsDocComments = ts.getJsDocComments(declaration, currentSourceFile); - emitNewLineBeforeLeadingComments(currentSourceFile, writer, declaration, jsDocComments); - emitComments(currentSourceFile, writer, jsDocComments, true, newLine, writeCommentRange); + ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, declaration, jsDocComments); + ts.emitComments(currentSourceFile, writer, jsDocComments, true, newLine, ts.writeCommentRange); } } function emitTypeWithNewGetSymbolAccessibilityDiagnostic(type, getSymbolAccessibilityDiagnostic) { @@ -17680,51 +23231,63 @@ var ts; } function emitType(type) { switch (type.kind) { - case 111: - case 120: - case 118: case 112: case 121: - case 98: + case 119: + case 113: + case 122: + case 99: case 8: return writeTextOfNode(currentSourceFile, type); - case 139: - return emitTypeReference(type); - case 142: - return emitTypeQuery(type); - case 144: - return emitArrayType(type); - case 145: - return emitTupleType(type); - case 146: - return emitUnionType(type); - case 147: - return emitParenType(type); - case 140: + case 177: + return emitHeritageClauseElement(type); case 141: - return emitSignatureDeclarationWithJsDocComments(type); + 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); + case 142: case 143: + return emitSignatureDeclarationWithJsDocComments(type); + case 145: return emitTypeLiteral(type); - case 64: + case 65: return emitEntityName(type); - case 125: + case 126: return emitEntityName(type); - default: - ts.Debug.fail("Unknown type annotation: " + type.kind); } function emitEntityName(entityName) { - var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 203 ? entityName.parent : enclosingDeclaration); + var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 208 ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); writeEntityName(entityName); function writeEntityName(entityName) { - if (entityName.kind === 64) { + if (entityName.kind === 65) { writeTextOfNode(currentSourceFile, entityName); } else { - var qualifiedName = entityName; - writeEntityName(qualifiedName.left); + var left = entityName.kind === 126 ? entityName.left : entityName.expression; + var right = entityName.kind === 126 ? entityName.right : entityName.name; + writeEntityName(left); write("."); - writeTextOfNode(currentSourceFile, qualifiedName.right); + writeTextOfNode(currentSourceFile, right); + } + } + } + function emitHeritageClauseElement(node) { + if (ts.isSupportedHeritageClauseElement(node)) { + ts.Debug.assert(node.expression.kind === 65 || node.expression.kind === 155); + emitEntityName(node.expression); + if (node.typeArguments) { + write("<"); + emitCommaList(node.typeArguments, emitType); + write(">"); } } } @@ -17775,16 +23338,98 @@ var ts; } function emitExportAssignment(node) { write(node.isExportEquals ? "export = " : "export default "); - writeTextOfNode(currentSourceFile, node.expression); + if (node.expression.kind === 65) { + writeTextOfNode(currentSourceFile, node.expression); + } + else { + write(": "); + if (node.type) { + emitType(node.type); + } + else { + writer.getSymbolAccessibilityDiagnostic = getDefaultExportAccessibilityDiagnostic; + resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, 2, writer); + } + } write(";"); writeLine(); + if (node.expression.kind === 65) { + var nodes = resolver.collectLinkedAliases(node.expression); + writeAsynchronousModuleElements(nodes); + } + function getDefaultExportAccessibilityDiagnostic(diagnostic) { + return { + diagnosticMessage: ts.Diagnostics.Default_export_of_the_module_has_or_is_using_private_name_0, + errorNode: node + }; + } + } + function isModuleElementVisible(node) { + return resolver.isDeclarationVisible(node); + } + function emitModuleElement(node, isModuleElementVisible) { + if (isModuleElementVisible) { + writeModuleElement(node); + } + else if (node.kind === 208 || (node.parent.kind === 227 && ts.isExternalModule(currentSourceFile))) { + var isVisible; + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 227) { + asynchronousSubModuleDeclarationEmitInfo.push({ + node: node, + outputPos: writer.getTextPos(), + indent: writer.getIndent(), + isVisible: isVisible + }); + } + else { + if (node.kind === 209) { + var importDeclaration = node; + if (importDeclaration.importClause) { + isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || isVisibleNamedBinding(importDeclaration.importClause.namedBindings); + } + } + moduleElementDeclarationEmitInfo.push({ + node: node, + outputPos: writer.getTextPos(), + indent: writer.getIndent(), + isVisible: isVisible + }); + } + } + } + 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); + case 203: + return writeTypeAliasDeclaration(node); + case 204: + return writeEnumDeclaration(node); + case 205: + return writeModuleDeclaration(node); + case 208: + return writeImportEqualsDeclaration(node); + case 209: + return writeImportDeclaration(node); + default: + ts.Debug.fail("Unknown symbol kind"); + } } function emitModuleElementDeclarationFlags(node) { if (node.parent === currentSourceFile) { if (node.flags & 1) { write("export "); } - if (node.kind !== 197) { + if (node.flags & 256) { + write("default "); + } + else if (node.kind !== 202) { write("declare "); } } @@ -17800,18 +23445,6 @@ var ts; write("static "); } } - function emitImportEqualsDeclaration(node) { - var nodeEmitInfo = { - declaration: node, - outputPos: writer.getTextPos(), - indent: writer.getIndent(), - hasWritten: resolver.isDeclarationVisible(node) - }; - aliasDeclarationEmitInfo.push(nodeEmitInfo); - if (nodeEmitInfo.hasWritten) { - writeImportEqualsDeclaration(node); - } - } function writeImportEqualsDeclaration(node) { emitJsDocComments(node); if (node.flags & 1) { @@ -17838,40 +23471,112 @@ var ts; }; } } - function emitModuleDeclaration(node) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - write("module "); - writeTextOfNode(currentSourceFile, node.name); - while (node.body.kind !== 201) { - node = node.body; - write("."); - writeTextOfNode(currentSourceFile, node.name); + function isVisibleNamedBinding(namedBindings) { + if (namedBindings) { + if (namedBindings.kind === 211) { + return resolver.isDeclarationVisible(namedBindings); + } + else { + return ts.forEach(namedBindings.elements, function (namedImport) { + return resolver.isDeclarationVisible(namedImport); + }); } - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - write(" {"); - writeLine(); - increaseIndent(); - emitLines(node.body.statements); - decreaseIndent(); - write("}"); - writeLine(); - enclosingDeclaration = prevEnclosingDeclaration; } } - function emitTypeAliasDeclaration(node) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - write("type "); - writeTextOfNode(currentSourceFile, node.name); - write(" = "); - emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.type, getTypeAliasDeclarationVisibilityError); - write(";"); - writeLine(); + function writeImportDeclaration(node) { + if (!node.importClause && !(node.flags & 1)) { + return; } + emitJsDocComments(node); + if (node.flags & 1) { + write("export "); + } + write("import "); + if (node.importClause) { + var currentWriterPos = writer.getTextPos(); + if (node.importClause.name && resolver.isDeclarationVisible(node.importClause)) { + writeTextOfNode(currentSourceFile, node.importClause.name); + } + if (node.importClause.namedBindings && isVisibleNamedBinding(node.importClause.namedBindings)) { + if (currentWriterPos !== writer.getTextPos()) { + write(", "); + } + if (node.importClause.namedBindings.kind === 211) { + write("* as "); + writeTextOfNode(currentSourceFile, node.importClause.namedBindings.name); + } + else { + write("{ "); + emitCommaList(node.importClause.namedBindings.elements, emitImportOrExportSpecifier, resolver.isDeclarationVisible); + write(" }"); + } + } + write(" from "); + } + writeTextOfNode(currentSourceFile, node.moduleSpecifier); + write(";"); + writer.writeLine(); + } + function emitImportOrExportSpecifier(node) { + if (node.propertyName) { + writeTextOfNode(currentSourceFile, node.propertyName); + write(" as "); + } + writeTextOfNode(currentSourceFile, node.name); + } + function emitExportSpecifier(node) { + emitImportOrExportSpecifier(node); + var nodes = resolver.collectLinkedAliases(node.propertyName || node.name); + writeAsynchronousModuleElements(nodes); + } + function emitExportDeclaration(node) { + emitJsDocComments(node); + write("export "); + if (node.exportClause) { + write("{ "); + emitCommaList(node.exportClause.elements, emitExportSpecifier); + write(" }"); + } + else { + write("*"); + } + if (node.moduleSpecifier) { + write(" from "); + writeTextOfNode(currentSourceFile, node.moduleSpecifier); + } + write(";"); + writer.writeLine(); + } + function writeModuleDeclaration(node) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + write("module "); + writeTextOfNode(currentSourceFile, node.name); + while (node.body.kind !== 206) { + node = node.body; + write("."); + writeTextOfNode(currentSourceFile, node.name); + } + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node; + write(" {"); + writeLine(); + increaseIndent(); + emitLines(node.body.statements); + decreaseIndent(); + write("}"); + writeLine(); + enclosingDeclaration = prevEnclosingDeclaration; + } + function writeTypeAliasDeclaration(node) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + write("type "); + writeTextOfNode(currentSourceFile, node.name); + write(" = "); + emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.type, getTypeAliasDeclarationVisibilityError); + write(";"); + writeLine(); function getTypeAliasDeclarationVisibilityError(symbolAccesibilityResult) { return { diagnosticMessage: ts.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1, @@ -17880,23 +23585,21 @@ var ts; }; } } - function emitEnumDeclaration(node) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - if (ts.isConst(node)) { - write("const "); - } - write("enum "); - writeTextOfNode(currentSourceFile, node.name); - write(" {"); - writeLine(); - increaseIndent(); - emitLines(node.members); - decreaseIndent(); - write("}"); - writeLine(); + function writeEnumDeclaration(node) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + if (ts.isConst(node)) { + write("const "); } + write("enum "); + writeTextOfNode(currentSourceFile, node.name); + write(" {"); + writeLine(); + increaseIndent(); + emitLines(node.members); + decreaseIndent(); + write("}"); + writeLine(); } function emitEnumMemberDeclaration(node) { emitJsDocComments(node); @@ -17910,7 +23613,7 @@ var ts; writeLine(); } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 132 && (node.parent.flags & 32); + return node.parent.kind === 134 && (node.parent.flags & 32); } function emitTypeParameters(typeParameters) { function emitTypeParameter(node) { @@ -17920,15 +23623,8 @@ var ts; writeTextOfNode(currentSourceFile, node.name); if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); - if (node.parent.kind === 140 || - node.parent.kind === 141 || - (node.parent.parent && node.parent.parent.kind === 143)) { - ts.Debug.assert(node.parent.kind === 132 || - node.parent.kind === 131 || - node.parent.kind === 140 || - node.parent.kind === 141 || - node.parent.kind === 136 || - node.parent.kind === 137); + 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 || node.parent.kind === 143 || node.parent.kind === 138 || node.parent.kind === 139); emitType(node.constraint); } else { @@ -17938,31 +23634,31 @@ var ts; function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.parent.kind) { - case 196: + case 201: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 197: + case 202: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 137: + case 139: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 136: + case 138: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 132: - case 131: + 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 === 196) { + else if (node.parent.parent.kind === 201) { 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 195: + case 200: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: @@ -17987,13 +23683,13 @@ var ts; emitCommaList(typeReferences, emitTypeOfTypeReference); } function emitTypeOfTypeReference(node) { - emitTypeWithNewGetSymbolAccessibilityDiagnostic(node, getHeritageClauseVisibilityError); + if (ts.isSupportedHeritageClauseElement(node)) { + emitTypeWithNewGetSymbolAccessibilityDiagnostic(node, getHeritageClauseVisibilityError); + } function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.parent.parent.kind === 196) { - 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; + if (node.parent.parent.kind === 201) { + 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; } else { diagnosticMessage = ts.Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; @@ -18006,7 +23702,7 @@ var ts; } } } - function emitClassDeclaration(node) { + function writeClassDeclaration(node) { function emitParameterProperties(constructorDeclaration) { if (constructorDeclaration) { ts.forEach(constructorDeclaration.parameters, function (param) { @@ -18016,49 +23712,47 @@ var ts; }); } } - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - write("class "); - writeTextOfNode(currentSourceFile, node.name); - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - emitTypeParameters(node.typeParameters); - var baseTypeNode = ts.getClassBaseTypeNode(node); - if (baseTypeNode) { - emitHeritageClause([baseTypeNode], false); - } - emitHeritageClause(ts.getClassImplementedTypeNodes(node), true); - write(" {"); - writeLine(); - increaseIndent(); - emitParameterProperties(getFirstConstructorWithBody(node)); - emitLines(node.members); - decreaseIndent(); - write("}"); - writeLine(); - enclosingDeclaration = prevEnclosingDeclaration; + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + write("class "); + writeTextOfNode(currentSourceFile, node.name); + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node; + emitTypeParameters(node.typeParameters); + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); + if (baseTypeNode) { + emitHeritageClause([ + baseTypeNode + ], false); } + emitHeritageClause(ts.getClassImplementsHeritageClauseElements(node), true); + write(" {"); + writeLine(); + increaseIndent(); + emitParameterProperties(ts.getFirstConstructorWithBody(node)); + emitLines(node.members); + decreaseIndent(); + write("}"); + writeLine(); + enclosingDeclaration = prevEnclosingDeclaration; } - function emitInterfaceDeclaration(node) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - write("interface "); - writeTextOfNode(currentSourceFile, node.name); - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - emitTypeParameters(node.typeParameters); - emitHeritageClause(ts.getInterfaceBaseTypeNodes(node), false); - write(" {"); - writeLine(); - increaseIndent(); - emitLines(node.members); - decreaseIndent(); - write("}"); - writeLine(); - enclosingDeclaration = prevEnclosingDeclaration; - } + function writeInterfaceDeclaration(node) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + write("interface "); + writeTextOfNode(currentSourceFile, node.name); + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node; + emitTypeParameters(node.typeParameters); + emitHeritageClause(ts.getInterfaceBaseTypeNodes(node), false); + write(" {"); + writeLine(); + increaseIndent(); + emitLines(node.members); + decreaseIndent(); + write("}"); + writeLine(); + enclosingDeclaration = prevEnclosingDeclaration; } function emitPropertyDeclaration(node) { if (ts.hasDynamicName(node)) { @@ -18071,54 +23765,76 @@ var ts; writeLine(); } function emitVariableDeclaration(node) { - if (node.kind !== 193 || resolver.isDeclarationVisible(node)) { - writeTextOfNode(currentSourceFile, node.name); - if ((node.kind === 130 || node.kind === 129) && ts.hasQuestionToken(node)) { - write("?"); + if (node.kind !== 198 || resolver.isDeclarationVisible(node)) { + if (ts.isBindingPattern(node.name)) { + emitBindingPattern(node.name); } - if ((node.kind === 130 || node.kind === 129) && node.parent.kind === 143) { - emitTypeOfVariableDeclarationFromTypeLiteral(node); + else { + writeTextOfNode(currentSourceFile, node.name); + if ((node.kind === 132 || node.kind === 131) && ts.hasQuestionToken(node)) { + write("?"); + } + if ((node.kind === 132 || node.kind === 131) && node.parent.kind === 145) { + emitTypeOfVariableDeclarationFromTypeLiteral(node); + } + else if (!(node.flags & 32)) { + writeTypeOfDeclaration(node, node.type, getVariableDeclarationTypeVisibilityError); + } } - else if (!(node.flags & 32)) { - writeTypeOfDeclaration(node, node.type, getVariableDeclarationTypeVisibilityError); + } + function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { + if (node.kind === 198) { + 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) { + if (node.flags & 128) { + return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : 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) { + 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 : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; + } + else { + return symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; + } } } function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage; - if (node.kind === 193) { - diagnosticMessage = 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 === 130 || node.kind === 129) { - if (node.flags & 128) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? - ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - 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 === 196) { - diagnosticMessage = 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 : - ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; - } - else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; - } - } + var diagnosticMessage = getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult); return diagnosticMessage !== undefined ? { diagnosticMessage: diagnosticMessage, errorNode: node, typeName: node.name } : undefined; } + function emitBindingPattern(bindingPattern) { + var elements = []; + for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { + var element = _a[_i]; + if (element.kind !== 175) { + elements.push(element); + } + } + emitCommaList(elements, emitBindingElement); + } + function emitBindingElement(bindingElement) { + function getBindingElementTypeVisibilityError(symbolAccesibilityResult) { + var diagnosticMessage = getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult); + return diagnosticMessage !== undefined ? { + diagnosticMessage: diagnosticMessage, + errorNode: bindingElement, + typeName: bindingElement.name + } : undefined; + } + if (bindingElement.name) { + if (ts.isBindingPattern(bindingElement.name)) { + emitBindingPattern(bindingElement.name); + } + else { + writeTextOfNode(currentSourceFile, bindingElement.name); + writeTypeOfDeclaration(bindingElement, undefined, getBindingElementTypeVisibilityError); + } + } + } } function emitTypeOfVariableDeclarationFromTypeLiteral(node) { if (node.type) { @@ -18126,30 +23842,32 @@ var ts; emitType(node.type); } } - function emitVariableStatement(node) { - var hasDeclarationWithEmit = ts.forEach(node.declarationList.declarations, function (varDeclaration) { return resolver.isDeclarationVisible(varDeclaration); }); - if (hasDeclarationWithEmit) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - if (ts.isLet(node.declarationList)) { - write("let "); - } - else if (ts.isConst(node.declarationList)) { - write("const "); - } - else { - write("var "); - } - emitCommaList(node.declarationList.declarations, emitVariableDeclaration); - write(";"); - writeLine(); + function isVariableStatementVisible(node) { + return ts.forEach(node.declarationList.declarations, function (varDeclaration) { + return resolver.isDeclarationVisible(varDeclaration); + }); + } + function writeVariableStatement(node) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + if (ts.isLet(node.declarationList)) { + write("let "); } + else if (ts.isConst(node.declarationList)) { + write("const "); + } + else { + write("var "); + } + emitCommaList(node.declarationList.declarations, emitVariableDeclaration, resolver.isDeclarationVisible); + write(";"); + writeLine(); } function emitAccessorDeclaration(node) { if (ts.hasDynamicName(node)) { return; } - var accessors = getAllAccessorDeclarations(node.parent.members, node); + var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); var accessorWithTypeAnnotation; if (node === accessors.firstAccessor) { emitJsDocComments(accessors.getAccessor); @@ -18160,7 +23878,7 @@ var ts; accessorWithTypeAnnotation = node; var type = getTypeAnnotationFromAccessor(node); if (!type) { - var anotherAccessor = node.kind === 134 ? accessors.setAccessor : accessors.getAccessor; + var anotherAccessor = node.kind === 136 ? accessors.setAccessor : accessors.getAccessor; type = getTypeAnnotationFromAccessor(anotherAccessor); if (type) { accessorWithTypeAnnotation = anotherAccessor; @@ -18173,25 +23891,17 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 134 - ? accessor.type - : accessor.parameters.length > 0 - ? accessor.parameters[0].type - : undefined; + return accessor.kind === 136 ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type : undefined; } } function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (accessorWithTypeAnnotation.kind === 135) { + if (accessorWithTypeAnnotation.kind === 137) { 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 : - ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1; + 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 : ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1; } else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - ts.Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1; } return { diagnosticMessage: diagnosticMessage, @@ -18201,18 +23911,10 @@ var ts; } else { if (accessorWithTypeAnnotation.flags & 128) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? - ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0; } else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? - ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0; } return { diagnosticMessage: diagnosticMessage, @@ -18222,24 +23924,23 @@ var ts; } } } - function emitFunctionDeclaration(node) { + function writeFunctionDeclaration(node) { if (ts.hasDynamicName(node)) { return; } - if ((node.kind !== 195 || resolver.isDeclarationVisible(node)) && - !resolver.isImplementationOfOverload(node)) { + if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 195) { + if (node.kind === 200) { emitModuleElementDeclarationFlags(node); } - else if (node.kind === 132) { + else if (node.kind === 134) { emitClassMemberDeclarationFlags(node); } - if (node.kind === 195) { + if (node.kind === 200) { write("function "); writeTextOfNode(currentSourceFile, node.name); } - else if (node.kind === 133) { + else if (node.kind === 135) { write("constructor"); } else { @@ -18256,11 +23957,11 @@ var ts; emitSignatureDeclaration(node); } function emitSignatureDeclaration(node) { - if (node.kind === 137 || node.kind === 141) { + if (node.kind === 139 || node.kind === 143) { write("new "); } emitTypeParameters(node.typeParameters); - if (node.kind === 138) { + if (node.kind === 140) { write("["); } else { @@ -18269,20 +23970,20 @@ var ts; var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 138) { + if (node.kind === 140) { write("]"); } else { write(")"); } - var isFunctionTypeOrConstructorType = node.kind === 140 || node.kind === 141; - if (isFunctionTypeOrConstructorType || node.parent.kind === 143) { + var isFunctionTypeOrConstructorType = node.kind === 142 || node.kind === 143; + if (isFunctionTypeOrConstructorType || node.parent.kind === 145) { if (node.type) { write(isFunctionTypeOrConstructorType ? " => " : ": "); emitType(node.type); } } - else if (node.kind !== 133 && !(node.flags & 32)) { + else if (node.kind !== 135 && !(node.flags & 32)) { writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); } enclosingDeclaration = prevEnclosingDeclaration; @@ -18293,49 +23994,29 @@ var ts; function getReturnTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.kind) { - case 137: - 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 136: - 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; + case 139: + 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: - 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; + 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 132: - case 131: + case 140: + 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: + case 133: if (node.flags & 128) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? - ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - 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; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : 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 === 196) { - 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 : - ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; + else if (node.parent.kind === 201) { + 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 : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; } else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 195: - 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 : - ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; + case 200: + 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 : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; break; default: ts.Debug.fail("This is unknown kind for signature: " + node.kind); @@ -18353,7 +24034,7 @@ var ts; write("..."); } if (ts.isBindingPattern(node.name)) { - write("_" + ts.indexOf(node.parent.parameters, node)); + emitBindingPattern(node.name); } else { writeTextOfNode(currentSourceFile, node.name); @@ -18362,129 +24043,168 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 140 || - node.parent.kind === 141 || - node.parent.parent.kind === 143) { + if (node.parent.kind === 142 || node.parent.kind === 143 || node.parent.parent.kind === 145) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!(node.parent.flags & 32)) { writeTypeOfDeclaration(node, node.type, getParameterDeclarationTypeVisibilityError); } function getParameterDeclarationTypeVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage; - switch (node.parent.kind) { - case 133: - diagnosticMessage = 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; - break; - case 137: - diagnosticMessage = 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; - break; - case 136: - diagnosticMessage = 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; - break; - case 132: - case 131: - if (node.parent.flags & 128) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? - ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - 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 === 196) { - diagnosticMessage = 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 : - ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; - } - else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - 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; - } - break; - case 195: - diagnosticMessage = 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 : - ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - break; - default: - ts.Debug.fail("This is unknown parent for parameter: " + node.parent.kind); - } - return { + var diagnosticMessage = getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult); + return diagnosticMessage !== undefined ? { diagnosticMessage: diagnosticMessage, errorNode: node, typeName: node.name - }; + } : undefined; + } + function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { + switch (node.parent.kind) { + case 135: + 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: + 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: + 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: + case 133: + if (node.parent.flags & 128) { + return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : 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) { + 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 : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; + } + else { + return symbolAccesibilityResult.errorModuleName ? 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: + 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 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; + default: + ts.Debug.fail("This is unknown parent for parameter: " + node.parent.kind); + } + } + function emitBindingPattern(bindingPattern) { + if (bindingPattern.kind === 150) { + write("{"); + emitCommaList(bindingPattern.elements, emitBindingElement); + write("}"); + } + else if (bindingPattern.kind === 151) { + write("["); + var elements = bindingPattern.elements; + emitCommaList(elements, emitBindingElement); + if (elements && elements.hasTrailingComma) { + write(", "); + } + write("]"); + } + } + function emitBindingElement(bindingElement) { + function getBindingElementTypeVisibilityError(symbolAccesibilityResult) { + var diagnosticMessage = getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult); + return diagnosticMessage !== undefined ? { + diagnosticMessage: diagnosticMessage, + errorNode: bindingElement, + typeName: bindingElement.name + } : undefined; + } + if (bindingElement.kind === 175) { + write(" "); + } + else if (bindingElement.kind === 152) { + if (bindingElement.propertyName) { + writeTextOfNode(currentSourceFile, bindingElement.propertyName); + write(": "); + emitBindingPattern(bindingElement.name); + } + else if (bindingElement.name) { + if (ts.isBindingPattern(bindingElement.name)) { + emitBindingPattern(bindingElement.name); + } + else { + ts.Debug.assert(bindingElement.name.kind === 65); + if (bindingElement.dotDotDotToken) { + write("..."); + } + writeTextOfNode(currentSourceFile, bindingElement.name); + } + } + } } } 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 209: + return emitModuleElement(node, !node.importClause); + case 215: + return emitExportDeclaration(node); + case 135: + case 134: case 133: - case 195: + return writeFunctionDeclaration(node); + case 139: + case 138: + case 140: + return emitSignatureDeclarationWithJsDocComments(node); + case 136: + case 137: + return emitAccessorDeclaration(node); case 132: case 131: - return emitFunctionDeclaration(node); - case 137: - case 136: - case 138: - return emitSignatureDeclarationWithJsDocComments(node); - case 134: - case 135: - return emitAccessorDeclaration(node); - case 175: - return emitVariableStatement(node); - case 130: - case 129: return emitPropertyDeclaration(node); - case 197: - return emitInterfaceDeclaration(node); - case 196: - return emitClassDeclaration(node); - case 198: - return emitTypeAliasDeclaration(node); - case 220: + case 226: return emitEnumMemberDeclaration(node); - case 199: - return emitEnumDeclaration(node); - case 200: - return emitModuleDeclaration(node); - case 203: - return emitImportEqualsDeclaration(node); - case 209: + case 214: return emitExportAssignment(node); - case 221: + case 227: return emitSourceFile(node); } } function writeReferencePath(referencedFile) { - var declFileName = referencedFile.flags & 2048 - ? referencedFile.fileName - : shouldEmitToOwnFile(referencedFile, compilerOptions) - ? getOwnEmitOutputFilePath(referencedFile, host, ".d.ts") - : ts.removeFileExtension(compilerOptions.out) + ".d.ts"; + var declFileName = referencedFile.flags & 2048 ? referencedFile.fileName : ts.shouldEmitToOwnFile(referencedFile, compilerOptions) ? ts.getOwnEmitOutputFilePath(referencedFile, host, ".d.ts") : ts.removeFileExtension(compilerOptions.out) + ".d.ts"; declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(jsFilePath)), declFileName, host.getCurrentDirectory(), host.getCanonicalFileName, false); referencePathsOutput += "/// " + newLine; } } - function getDeclarationDiagnostics(host, resolver, targetSourceFile) { - var diagnostics = []; - var jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, host, ".js"); - emitDeclarations(host, resolver, diagnostics, jsFilePath, targetSourceFile); - return diagnostics; + function writeDeclarationFile(jsFilePath, sourceFile, host, resolver, diagnostics) { + var emitDeclarationResult = emitDeclarations(host, resolver, diagnostics, jsFilePath, sourceFile); + if (!emitDeclarationResult.reportedDeclarationError) { + var declarationOutput = emitDeclarationResult.referencePathsOutput + getDeclarationOutput(emitDeclarationResult.synchronousDeclarationOutput, emitDeclarationResult.moduleElementDeclarationEmitInfo); + ts.writeFile(host, diagnostics, ts.removeFileExtension(jsFilePath) + ".d.ts", declarationOutput, host.getCompilerOptions().emitBOM); + } + function getDeclarationOutput(synchronousDeclarationOutput, moduleElementDeclarationEmitInfo) { + var appliedSyncOutputPos = 0; + var declarationOutput = ""; + ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { + if (aliasEmitInfo.asynchronousOutput) { + declarationOutput += synchronousDeclarationOutput.substring(appliedSyncOutputPos, aliasEmitInfo.outputPos); + declarationOutput += getDeclarationOutput(aliasEmitInfo.asynchronousOutput, aliasEmitInfo.subModuleElementDeclarationEmitInfo); + appliedSyncOutputPos = aliasEmitInfo.outputPos; + } + }); + declarationOutput += synchronousDeclarationOutput.substring(appliedSyncOutputPos); + return declarationOutput; + } } - ts.getDeclarationDiagnostics = getDeclarationDiagnostics; + ts.writeDeclarationFile = writeDeclarationFile; +})(ts || (ts = {})); +/// +/// +var ts; +(function (ts) { + function isExternalModuleOrDeclarationFile(sourceFile) { + return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); + } + ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; function emitFiles(resolver, host, targetSourceFile) { var compilerOptions = host.getCompilerOptions(); var languageVersion = compilerOptions.target || 0; @@ -18493,8 +24213,8 @@ var ts; var newLine = host.getNewLine(); if (targetSourceFile === undefined) { ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (shouldEmitToOwnFile(sourceFile, compilerOptions)) { - var jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, ".js"); + if (ts.shouldEmitToOwnFile(sourceFile, compilerOptions)) { + var jsFilePath = ts.getOwnEmitOutputFilePath(sourceFile, host, ".js"); emitFile(jsFilePath, sourceFile); } }); @@ -18503,8 +24223,8 @@ var ts; } } else { - if (shouldEmitToOwnFile(targetSourceFile, compilerOptions)) { - var jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, host, ".js"); + if (ts.shouldEmitToOwnFile(targetSourceFile, compilerOptions)) { + var jsFilePath = ts.getOwnEmitOutputFilePath(targetSourceFile, host, ".js"); emitFile(jsFilePath, targetSourceFile); } else if (!ts.isDeclarationFile(targetSourceFile) && compilerOptions.out) { @@ -18517,40 +24237,58 @@ var ts; diagnostics: diagnostics, sourceMaps: sourceMapDataList }; + function isNodeDescendentOf(node, ancestor) { + while (node) { + if (node === ancestor) + return true; + node = node.parent; + } + return false; + } + function isUniqueLocalName(name, container) { + for (var node = container; isNodeDescendentOf(node, container); node = node.nextContainer) { + if (node.locals && ts.hasProperty(node.locals, name)) { + if (node.locals[name].flags & (107455 | 1048576 | 8388608)) { + return false; + } + } + } + return true; + } function emitJavaScript(jsFilePath, root) { - var writer = createTextWriter(newLine); + var writer = ts.createTextWriter(newLine); var write = writer.write; var writeTextOfNode = writer.writeTextOfNode; var writeLine = writer.writeLine; var increaseIndent = writer.increaseIndent; var decreaseIndent = writer.decreaseIndent; - var preserveNewLines = compilerOptions.preserveNewLines || false; var currentSourceFile; - var lastFrame; - var currentScopeNames; - var generatedBlockScopeNames; + var generatedNameSet = {}; + var nodeToGeneratedName = []; + var blockScopedVariableToGeneratedName; + var computedPropertyNamesToGeneratedNames; var extendsEmitted = false; - var tempCount = 0; + var decorateEmitted = false; + var tempFlags = 0; var tempVariables; var tempParameters; var externalImports; var exportSpecifiers; - var exportDefault; + var exportEquals; + var hasExportStars; var writeEmittedFiles = writeJavaScriptFile; - var emitLeadingComments = compilerOptions.removeComments ? function (node) { } : emitLeadingDeclarationComments; - var emitTrailingComments = compilerOptions.removeComments ? function (node) { } : emitTrailingDeclarationComments; - var emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos) { } : emitLeadingCommentsOfLocalPosition; var detachedCommentsInfo; - var emitDetachedComments = compilerOptions.removeComments ? function (node) { } : emitDetachedCommentsAtPosition; - var writeComment = writeCommentRange; - var emitNodeWithoutSourceMap = compilerOptions.removeComments ? emitNodeWithoutSourceMapWithoutComments : emitNodeWithoutSourceMapWithComments; + var writeComment = ts.writeCommentRange; var emit = emitNodeWithoutSourceMap; - var emitWithoutComments = emitNodeWithoutSourceMapWithoutComments; - var emitStart = function (node) { }; - var emitEnd = function (node) { }; + var emitStart = function (node) { + }; + var emitEnd = function (node) { + }; var emitToken = emitTokenText; - var scopeEmitStart = function (scopeDeclaration, scopeName) { }; - var scopeEmitEnd = function () { }; + var scopeEmitStart = function (scopeDeclaration, scopeName) { + }; + var scopeEmitEnd = function () { + }; var sourceMapData; if (compilerOptions.sourceMap) { initializeEmitterWithSourceMaps(); @@ -18572,55 +24310,105 @@ var ts; currentSourceFile = sourceFile; emit(sourceFile); } - function enterNameScope() { - var names = currentScopeNames; - currentScopeNames = undefined; - if (names) { - lastFrame = { names: names, previous: lastFrame }; - return true; - } - return false; + function isUniqueName(name) { + return !resolver.hasGlobalName(name) && !ts.hasProperty(currentSourceFile.identifiers, name) && !ts.hasProperty(generatedNameSet, name); } - function exitNameScope(popFrame) { - if (popFrame) { - currentScopeNames = lastFrame.names; - lastFrame = lastFrame.previous; - } - else { - currentScopeNames = undefined; - } - } - function generateUniqueNameForLocation(location, baseName) { - var _name; - if (!isExistingName(location, baseName)) { - _name = baseName; - } - else { - _name = ts.generateUniqueName(baseName, function (n) { return isExistingName(location, n); }); - } - return recordNameInCurrentScope(_name); - } - function recordNameInCurrentScope(name) { - if (!currentScopeNames) { - currentScopeNames = {}; - } - return currentScopeNames[name] = name; - } - function isExistingName(location, name) { - if (!resolver.isUnknownIdentifier(location, name)) { - return true; - } - if (currentScopeNames && ts.hasProperty(currentScopeNames, name)) { - return true; - } - var frame = lastFrame; - while (frame) { - if (ts.hasProperty(frame.names, name)) { - return true; + function makeTempVariableName(flags) { + if (flags && !(tempFlags & flags)) { + var name = flags === 268435456 ? "_i" : "_n"; + if (isUniqueName(name)) { + tempFlags |= flags; + return name; } - frame = frame.previous; } - return false; + while (true) { + var count = tempFlags & 268435455; + tempFlags++; + if (count !== 8 && count !== 13) { + var name_12 = count < 26 ? "_" + String.fromCharCode(97 + count) : "_" + (count - 26); + if (isUniqueName(name_12)) { + return name_12; + } + } + } + } + function makeUniqueName(baseName) { + if (baseName.charCodeAt(baseName.length - 1) !== 95) { + baseName += "_"; + } + var i = 1; + while (true) { + var generatedName = baseName + i; + if (isUniqueName(generatedName)) { + return generatedNameSet[generatedName] = generatedName; + } + i++; + } + } + function assignGeneratedName(node, name) { + nodeToGeneratedName[ts.getNodeId(node)] = ts.unescapeIdentifier(name); + } + function generateNameForFunctionOrClassDeclaration(node) { + if (!node.name) { + assignGeneratedName(node, makeUniqueName("default")); + } + } + function generateNameForModuleOrEnum(node) { + if (node.name.kind === 65) { + var name_13 = node.name.text; + assignGeneratedName(node, isUniqueLocalName(name_13, node) ? name_13 : makeUniqueName(name_13)); + } + } + function generateNameForImportOrExportDeclaration(node) { + var expr = ts.getExternalModuleName(node); + var baseName = expr.kind === 8 ? ts.escapeIdentifier(ts.makeIdentifierFromModuleName(expr.text)) : "module"; + assignGeneratedName(node, makeUniqueName(baseName)); + } + function generateNameForImportDeclaration(node) { + if (node.importClause) { + generateNameForImportOrExportDeclaration(node); + } + } + function generateNameForExportDeclaration(node) { + if (node.moduleSpecifier) { + generateNameForImportOrExportDeclaration(node); + } + } + function generateNameForExportAssignment(node) { + if (node.expression && node.expression.kind !== 65) { + assignGeneratedName(node, makeUniqueName("default")); + } + } + function generateNameForNode(node) { + switch (node.kind) { + case 200: + case 201: + generateNameForFunctionOrClassDeclaration(node); + break; + case 205: + generateNameForModuleOrEnum(node); + generateNameForNode(node.body); + break; + case 204: + generateNameForModuleOrEnum(node); + break; + case 209: + generateNameForImportDeclaration(node); + break; + case 215: + generateNameForExportDeclaration(node); + break; + case 214: + generateNameForExportAssignment(node); + break; + } + } + function getGeneratedNameForNode(node) { + var nodeId = ts.getNodeId(node); + if (!nodeToGeneratedName[nodeId]) { + generateNameForNode(node); + } + return nodeToGeneratedName[nodeId]; } function initializeEmitterWithSourceMaps() { var sourceMapDir; @@ -18696,12 +24484,7 @@ var ts; sourceLinePos.character++; var emittedLine = writer.getLine(); var emittedColumn = writer.getColumn(); - if (!lastRecordedSourceMapSpan || - lastRecordedSourceMapSpan.emittedLine != emittedLine || - lastRecordedSourceMapSpan.emittedColumn != emittedColumn || - (lastRecordedSourceMapSpan.sourceIndex === sourceMapSourceIndex && - (lastRecordedSourceMapSpan.sourceLine > sourceLinePos.line || - (lastRecordedSourceMapSpan.sourceLine === sourceLinePos.line && lastRecordedSourceMapSpan.sourceColumn > sourceLinePos.character)))) { + if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan.emittedLine != emittedLine || lastRecordedSourceMapSpan.emittedColumn != emittedColumn || (lastRecordedSourceMapSpan.sourceIndex === sourceMapSourceIndex && (lastRecordedSourceMapSpan.sourceLine > sourceLinePos.line || (lastRecordedSourceMapSpan.sourceLine === sourceLinePos.line && lastRecordedSourceMapSpan.sourceColumn > sourceLinePos.character)))) { encodeLastRecordedSourceMapSpan(); lastRecordedSourceMapSpan = { emittedLine: emittedLine, @@ -18746,8 +24529,8 @@ var ts; if (scopeName) { var parentIndex = getSourceMapNameIndex(); if (parentIndex !== -1) { - var _name = node.name; - if (!_name || _name.kind !== 126) { + var name_14 = node.name; + if (!name_14 || name_14.kind !== 127) { scopeName = "." + scopeName; } scopeName = sourceMapData.sourceMapNames[parentIndex] + scopeName; @@ -18764,20 +24547,10 @@ var ts; if (scopeName) { recordScopeNameStart(scopeName); } - else if (node.kind === 195 || - node.kind === 160 || - node.kind === 132 || - node.kind === 131 || - node.kind === 134 || - node.kind === 135 || - node.kind === 200 || - node.kind === 196 || - node.kind === 199) { + else if (node.kind === 200 || node.kind === 162 || node.kind === 134 || node.kind === 133 || node.kind === 136 || node.kind === 137 || node.kind === 205 || node.kind === 201 || node.kind === 204) { if (node.name) { - var _name = node.name; - scopeName = _name.kind === 126 - ? ts.getTextOfNode(_name) - : node.name.text; + var name_15 = node.name; + scopeName = name_15.kind === 127 ? ts.getTextOfNode(name_15) : node.name.text; } recordScopeNameStart(scopeName); } @@ -18791,7 +24564,7 @@ var ts; ; function writeCommentRangeWithMap(curentSourceFile, writer, comment, newLine) { recordSourceMapSpan(comment.pos); - writeCommentRange(currentSourceFile, writer, comment, newLine); + ts.writeCommentRange(currentSourceFile, writer, comment, newLine); recordSourceMapSpan(comment.end); } function serializeSourceMapContents(version, file, sourceRoot, sources, names, mappings) { @@ -18819,7 +24592,7 @@ var ts; } function writeJavaScriptAndSourceMapFile(emitOutput, writeByteOrderMark) { encodeLastRecordedSourceMapSpan(); - writeFile(host, diagnostics, sourceMapData.sourceMapFilePath, serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings), false); + ts.writeFile(host, diagnostics, sourceMapData.sourceMapFilePath, serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings), false); sourceMapDataList.push(sourceMapData); writeJavaScriptFile(emitOutput + "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL, writeByteOrderMark); } @@ -18842,7 +24615,7 @@ var ts; if (compilerOptions.mapRoot) { sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); if (root) { - sourceMapDir = ts.getDirectoryPath(getSourceFilePathInNewDir(root, host, sourceMapDir)); + sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(root, host, sourceMapDir)); } if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir); @@ -18855,32 +24628,24 @@ var ts; else { sourceMapDir = ts.getDirectoryPath(ts.normalizePath(jsFilePath)); } - function emitNodeWithSourceMap(node) { + function emitNodeWithSourceMap(node, allowGeneratedIdentifiers) { if (node) { if (ts.nodeIsSynthesized(node)) { - return emitNodeWithoutSourceMap(node); + return emitNodeWithoutSourceMap(node, false); } - if (node.kind != 221) { + if (node.kind != 227) { recordEmitNodeStartSpan(node); - emitNodeWithoutSourceMap(node); + emitNodeWithoutSourceMap(node, allowGeneratedIdentifiers); recordEmitNodeEndSpan(node); } else { recordNewSourceFileStart(node); - emitNodeWithoutSourceMap(node); + emitNodeWithoutSourceMap(node, false); } } } - function emitNodeWithSourceMapWithoutComments(node) { - if (node) { - recordEmitNodeStartSpan(node); - emitNodeWithoutSourceMapWithoutComments(node); - recordEmitNodeEndSpan(node); - } - } writeEmittedFiles = writeJavaScriptAndSourceMapFile; emit = emitNodeWithSourceMap; - emitWithoutComments = emitNodeWithSourceMapWithoutComments; emitStart = recordEmitNodeStartSpan; emitEnd = recordEmitNodeEndSpan; emitToken = writeTextWithSpanRecord; @@ -18889,24 +24654,11 @@ var ts; writeComment = writeCommentRangeWithMap; } function writeJavaScriptFile(emitOutput, writeByteOrderMark) { - writeFile(host, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); + ts.writeFile(host, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); } - function createTempVariable(location, preferredName) { - for (var name = preferredName; !name || isExistingName(location, name); tempCount++) { - var char = 97 + tempCount; - if (char === 105 || char === 110) { - continue; - } - if (tempCount < 26) { - name = "_" + String.fromCharCode(char); - } - else { - name = "_" + (tempCount - 26); - } - } - recordNameInCurrentScope(name); - var result = ts.createSynthesizedNode(64); - result.text = name; + function createTempVariable(flags) { + var result = ts.createSynthesizedNode(65); + result.text = makeTempVariableName(flags); return result; } function recordTempDeclaration(name) { @@ -18915,8 +24667,8 @@ var ts; } tempVariables.push(name); } - function createAndRecordTempVariable(location, preferredName) { - var temp = createTempVariable(location, preferredName); + function createAndRecordTempVariable(flags) { + var temp = createTempVariable(flags); recordTempDeclaration(temp); return temp; } @@ -18966,7 +24718,7 @@ var ts; function emitLinePreservingList(parent, nodes, allowTrailingComma, spacesBetweenBraces) { ts.Debug.assert(nodes.length > 0); increaseIndent(); - if (preserveNewLines && nodeStartPositionsAreOnSameLine(parent, nodes[0])) { + if (nodeStartPositionsAreOnSameLine(parent, nodes[0])) { if (spacesBetweenBraces) { write(" "); } @@ -18976,7 +24728,7 @@ var ts; } for (var i = 0, n = nodes.length; i < n; i++) { if (i) { - if (preserveNewLines && nodeEndIsOnSameLineAsNodeStart(nodes[i - 1], nodes[i])) { + if (nodeEndIsOnSameLineAsNodeStart(nodes[i - 1], nodes[i])) { write(", "); } else { @@ -18990,7 +24742,7 @@ var ts; write(","); } decreaseIndent(); - if (preserveNewLines && nodeEndPositionsAreOnSameLine(parent, ts.lastOrUndefined(nodes))) { + if (nodeEndPositionsAreOnSameLine(parent, ts.lastOrUndefined(nodes))) { if (spacesBetweenBraces) { write(" "); } @@ -19108,7 +24860,7 @@ var ts; write("]"); } function emitDownlevelTaggedTemplate(node) { - var tempVariable = createAndRecordTempVariable(node); + var tempVariable = createAndRecordTempVariable(0); write("("); emit(tempVariable); write(" = "); @@ -19121,11 +24873,10 @@ var ts; emitParenthesizedIf(node.tag, needsParenthesisForPropertyAccessOrInvocation(node.tag)); write("("); emit(tempVariable); - if (node.template.kind === 169) { + if (node.template.kind === 171) { ts.forEach(node.template.templateSpans, function (templateSpan) { write(", "); - var needsParens = templateSpan.expression.kind === 167 - && templateSpan.expression.operatorToken.kind === 23; + var needsParens = templateSpan.expression.kind === 169 && templateSpan.expression.operatorToken.kind === 23; emitParenthesizedIf(templateSpan.expression, needsParens); }); } @@ -19136,8 +24887,7 @@ var ts; ts.forEachChild(node, emit); return; } - var emitOuterParens = ts.isExpression(node.parent) - && templateNeedsParens(node, node.parent); + var emitOuterParens = ts.isExpression(node.parent) && templateNeedsParens(node, node.parent); if (emitOuterParens) { write("("); } @@ -19148,8 +24898,7 @@ var ts; } for (var i = 0, n = node.templateSpans.length; i < n; i++) { var templateSpan = node.templateSpans[i]; - var needsParens = templateSpan.expression.kind !== 159 - && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1; + var needsParens = templateSpan.expression.kind !== 161 && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1; if (i > 0 || headEmitted) { write(" + "); } @@ -19163,16 +24912,29 @@ var ts; write(")"); } function shouldEmitTemplateHead() { + // If this expression has an empty head literal and the first template span has a non-empty + // literal, then emitting the empty head literal is not necessary. + // `${ foo } and ${ bar }` + // can be emitted as + // foo + " and " + bar + // This is because it is only required that one of the first two operands in the emit + // output must be a string literal, so that the other operand and all following operands + // are forced into strings. + // + // If the first template span has an empty literal, then the head must still be emitted. + // `${ foo }${ bar }` + // must still be emitted as + // "" + foo + bar ts.Debug.assert(node.templateSpans.length !== 0); return node.head.text.length !== 0 || node.templateSpans[0].literal.text.length === 0; } function templateNeedsParens(template, parent) { switch (parent.kind) { - case 155: - case 156: - return parent.expression === template; case 157: + case 158: + return parent.expression === template; case 159: + case 161: return false; default: return comparePrecedenceToBinaryPlus(parent) !== -1; @@ -19180,7 +24942,7 @@ var ts; } function comparePrecedenceToBinaryPlus(expression) { switch (expression.kind) { - case 167: + case 169: switch (expression.operatorToken.kind) { case 35: case 36: @@ -19192,7 +24954,7 @@ var ts; default: return -1; } - case 168: + case 170: return -1; default: return 1; @@ -19204,11 +24966,27 @@ var ts; emit(span.literal); } function emitExpressionForPropertyName(node) { - ts.Debug.assert(node.kind !== 150); + ts.Debug.assert(node.kind !== 152); if (node.kind === 8) { emitLiteral(node); } - else if (node.kind === 126) { + else if (node.kind === 127) { + if (ts.nodeIsDecorated(node.parent)) { + if (!computedPropertyNamesToGeneratedNames) { + computedPropertyNamesToGeneratedNames = []; + } + var generatedName = computedPropertyNamesToGeneratedNames[node.id]; + if (generatedName) { + write(generatedName); + return; + } + var generatedVariable = createTempVariable(0); + generatedName = generatedVariable.text; + recordTempDeclaration(generatedVariable); + computedPropertyNamesToGeneratedNames[node.id] = generatedName; + write(generatedName); + write(" = "); + } emit(node.expression); } else { @@ -19223,38 +25001,43 @@ var ts; } } function isNotExpressionIdentifier(node) { - var _parent = node.parent; - switch (_parent.kind) { - case 128: - case 193: - case 150: - case 130: + var parent = node.parent; + switch (parent.kind) { case 129: - case 218: - case 219: - case 220: + case 198: + case 152: case 132: case 131: - case 195: + case 224: + case 225: + case 226: case 134: - case 135: - case 160: - case 196: - case 197: - case 199: + case 133: case 200: - case 203: - return _parent.name === node; - case 185: - case 184: - case 209: - return false; + case 136: + case 137: + case 162: + case 201: + case 202: + case 204: + case 205: + case 208: + case 210: + case 211: + return parent.name === node; + case 213: + case 217: + return parent.name === node || parent.propertyName === node; + case 190: case 189: + case 214: + return false; + case 194: return node.parent.label === node; } } function emitExpressionIdentifier(node) { - var substitution = resolver.getExpressionNameSubstitution(node); + var substitution = resolver.getExpressionNameSubstitution(node, getGeneratedNameForNode); if (substitution) { write(substitution); } @@ -19262,15 +25045,21 @@ var ts; writeTextOfNode(currentSourceFile, node); } } - function getBlockScopedVariableId(node) { - return !ts.nodeIsSynthesized(node) && resolver.getBlockScopedVariableId(node); + function getGeneratedNameForIdentifier(node) { + if (ts.nodeIsSynthesized(node) || !blockScopedVariableToGeneratedName) { + return undefined; + } + var variableId = resolver.getBlockScopedVariableId(node); + if (variableId === undefined) { + return undefined; + } + return blockScopedVariableToGeneratedName[variableId]; } - function emitIdentifier(node) { - var variableId = getBlockScopedVariableId(node); - if (variableId !== undefined && generatedBlockScopeNames) { - var text = generatedBlockScopeNames[variableId]; - if (text) { - write(text); + function emitIdentifier(node, allowGeneratedIdentifiers) { + if (allowGeneratedIdentifiers) { + var generatedName = getGeneratedNameForIdentifier(node); + if (generatedName) { + write(generatedName); return; } } @@ -19293,15 +25082,17 @@ var ts; } } function emitSuper(node) { - var flags = resolver.getNodeCheckFlags(node); - if (flags & 16) { - write("_super.prototype"); - } - else if (flags & 32) { - write("_super"); + if (languageVersion >= 2) { + write("super"); } else { - write("super"); + var flags = resolver.getNodeCheckFlags(node); + if (flags & 16) { + write("_super.prototype"); + } + else { + write("_super"); + } } } function emitObjectBindingPattern(node) { @@ -19318,7 +25109,7 @@ var ts; } function emitBindingElement(node) { if (node.propertyName) { - emit(node.propertyName); + emit(node.propertyName, false); write(": "); } if (node.dotDotDotToken) { @@ -19338,12 +25129,12 @@ var ts; } function needsParenthesisForPropertyAccessOrInvocation(node) { switch (node.kind) { - case 64: - case 151: + case 65: case 153: - case 154: case 155: - case 159: + case 156: + case 157: + case 161: return false; } return true; @@ -19351,8 +25142,8 @@ var ts; function emitListWithSpread(elements, multiLine, trailingComma) { var pos = 0; var group = 0; - var _length = elements.length; - while (pos < _length) { + var length = elements.length; + while (pos < length) { if (group === 1) { write(".concat("); } @@ -19360,21 +25151,21 @@ var ts; write(", "); } var e = elements[pos]; - if (e.kind === 171) { + if (e.kind === 173) { e = e.expression; emitParenthesizedIf(e, group === 0 && needsParenthesisForPropertyAccessOrInvocation(e)); pos++; } else { var i = pos; - while (i < _length && elements[i].kind !== 171) { + while (i < length && elements[i].kind !== 173) { i++; } write("["); if (multiLine) { increaseIndent(); } - emitList(elements, pos, i - pos, multiLine, trailingComma && i === _length); + emitList(elements, pos, i - pos, multiLine, trailingComma && i === length); if (multiLine) { decreaseIndent(); } @@ -19388,7 +25179,7 @@ var ts; } } function isSpreadElementExpression(node) { - return node.kind === 171; + return node.kind === 173; } function emitArrayLiteral(node) { var elements = node.elements; @@ -19409,11 +25200,11 @@ var ts; return emit(parenthesizedObjectLiteral); } function createDownlevelObjectLiteralWithComputedProperties(originalObjectLiteral, firstComputedPropertyIndex) { - var tempVar = createAndRecordTempVariable(originalObjectLiteral); - var initialObjectLiteral = ts.createSynthesizedNode(152); + var tempVar = createAndRecordTempVariable(0); + var initialObjectLiteral = ts.createSynthesizedNode(154); initialObjectLiteral.properties = originalObjectLiteral.properties.slice(0, firstComputedPropertyIndex); initialObjectLiteral.flags |= 512; - var propertyPatches = createBinaryExpression(tempVar, 52, initialObjectLiteral); + var propertyPatches = createBinaryExpression(tempVar, 53, initialObjectLiteral); ts.forEach(originalObjectLiteral.properties, function (property) { var patchedProperty = tryCreatePatchingPropertyAssignment(originalObjectLiteral, tempVar, property); if (patchedProperty) { @@ -19431,33 +25222,33 @@ var ts; function tryCreatePatchingPropertyAssignment(objectLiteral, tempVar, property) { var leftHandSide = createMemberAccessForPropertyName(tempVar, property.name); var maybeRightHandSide = tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral, property); - return maybeRightHandSide && createBinaryExpression(leftHandSide, 52, maybeRightHandSide, true); + return maybeRightHandSide && createBinaryExpression(leftHandSide, 53, maybeRightHandSide, true); } function tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral, property) { switch (property.kind) { - case 218: + case 224: return property.initializer; - case 219: - return createIdentifier(resolver.getExpressionNameSubstitution(property.name)); - case 132: - return createFunctionExpression(property.parameters, property.body); + case 225: + return createIdentifier(resolver.getExpressionNameSubstitution(property.name, getGeneratedNameForNode)); case 134: - case 135: - var _a = getAllAccessorDeclarations(objectLiteral.properties, property), firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor; + return createFunctionExpression(property.parameters, property.body); + case 136: + case 137: + var _a = ts.getAllAccessorDeclarations(objectLiteral.properties, property), firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor; if (firstAccessor !== property) { return undefined; } - var propertyDescriptor = ts.createSynthesizedNode(152); + var propertyDescriptor = ts.createSynthesizedNode(154); var descriptorProperties = []; if (getAccessor) { - var _getProperty = createPropertyAssignment(createIdentifier("get"), createFunctionExpression(getAccessor.parameters, getAccessor.body)); - descriptorProperties.push(_getProperty); + var getProperty_1 = createPropertyAssignment(createIdentifier("get"), createFunctionExpression(getAccessor.parameters, getAccessor.body)); + descriptorProperties.push(getProperty_1); } if (setAccessor) { var setProperty = createPropertyAssignment(createIdentifier("set"), createFunctionExpression(setAccessor.parameters, setAccessor.body)); descriptorProperties.push(setProperty); } - var trueExpr = ts.createSynthesizedNode(94); + var trueExpr = ts.createSynthesizedNode(95); var enumerableTrue = createPropertyAssignment(createIdentifier("enumerable"), trueExpr); descriptorProperties.push(enumerableTrue); var configurableTrue = createPropertyAssignment(createIdentifier("configurable"), trueExpr); @@ -19470,14 +25261,14 @@ var ts; } } function createParenthesizedExpression(expression) { - var result = ts.createSynthesizedNode(159); + var result = ts.createSynthesizedNode(161); result.expression = expression; return result; } function createNodeArray() { var elements = []; - for (var _i = 0; _i < arguments.length; _i++) { - elements[_i - 0] = arguments[_i]; + for (var _a = 0; _a < arguments.length; _a++) { + elements[_a - 0] = arguments[_a]; } var result = elements; result.pos = -1; @@ -19485,25 +25276,25 @@ var ts; return result; } function createBinaryExpression(left, operator, right, startsOnNewLine) { - var result = ts.createSynthesizedNode(167, startsOnNewLine); + var result = ts.createSynthesizedNode(169, startsOnNewLine); result.operatorToken = ts.createSynthesizedNode(operator); result.left = left; result.right = right; return result; } function createExpressionStatement(expression) { - var result = ts.createSynthesizedNode(177); + var result = ts.createSynthesizedNode(182); result.expression = expression; return result; } function createMemberAccessForPropertyName(expression, memberName) { - if (memberName.kind === 64) { + if (memberName.kind === 65) { return createPropertyAccessExpression(expression, memberName); } else if (memberName.kind === 8 || memberName.kind === 7) { return createElementAccessExpression(expression, memberName); } - else if (memberName.kind === 126) { + else if (memberName.kind === 127) { return createElementAccessExpression(expression, memberName.expression); } else { @@ -19511,37 +25302,37 @@ var ts; } } function createPropertyAssignment(name, initializer) { - var result = ts.createSynthesizedNode(218); + var result = ts.createSynthesizedNode(224); result.name = name; result.initializer = initializer; return result; } function createFunctionExpression(parameters, body) { - var result = ts.createSynthesizedNode(160); + var result = ts.createSynthesizedNode(162); result.parameters = parameters; result.body = body; return result; } function createPropertyAccessExpression(expression, name) { - var result = ts.createSynthesizedNode(153); + var result = ts.createSynthesizedNode(155); result.expression = expression; result.dotToken = ts.createSynthesizedNode(20); result.name = name; return result; } function createElementAccessExpression(expression, argumentExpression) { - var result = ts.createSynthesizedNode(154); + var result = ts.createSynthesizedNode(156); result.expression = expression; result.argumentExpression = argumentExpression; return result; } function createIdentifier(name, startsOnNewLine) { - var result = ts.createSynthesizedNode(64, startsOnNewLine); + var result = ts.createSynthesizedNode(65, startsOnNewLine); result.text = name; return result; } function createCallExpression(invokedExpression, arguments) { - var result = ts.createSynthesizedNode(155); + var result = ts.createSynthesizedNode(157); result.expression = invokedExpression; result.arguments = arguments; return result; @@ -19552,7 +25343,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 === 126) { + if (properties[i].name.kind === 127) { numInitialNonComputedProperties = i; break; } @@ -19571,34 +25362,47 @@ var ts; } function emitComputedPropertyName(node) { write("["); - emit(node.expression); + emitExpressionForPropertyName(node); write("]"); } function emitMethod(node) { - emit(node.name); + emit(node.name, false); if (languageVersion < 2) { write(": function "); } emitSignatureAndBody(node); } function emitPropertyAssignment(node) { - emit(node.name); + emit(node.name, false); write(": "); emit(node.initializer); } function emitShorthandPropertyAssignment(node) { - emit(node.name); - if (languageVersion < 2 || resolver.getExpressionNameSubstitution(node.name)) { + emit(node.name, false); + if (languageVersion < 2) { + write(": "); + var generatedName = getGeneratedNameForIdentifier(node.name); + if (generatedName) { + write(generatedName); + } + else { + emitExpressionIdentifier(node.name); + } + } + else if (resolver.getExpressionNameSubstitution(node.name, getGeneratedNameForNode)) { write(": "); emitExpressionIdentifier(node.name); } } function tryEmitConstantValue(node) { + if (compilerOptions.separateCompilation) { + return false; + } var constantValue = resolver.getConstantValue(node); if (constantValue !== undefined) { write(constantValue.toString()); if (!compilerOptions.removeComments) { - var propertyName = node.kind === 153 ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); + var propertyName = node.kind === 155 ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); write(" /* " + propertyName + " */"); } return true; @@ -19606,7 +25410,7 @@ var ts; return false; } function indentIfOnDifferentLines(parent, node1, node2, valueToWriteWhenNotIndenting) { - var realNodesAreOnDifferentLines = preserveNewLines && !ts.nodeIsSynthesized(parent) && !nodeEndIsOnSameLineAsNodeStart(node1, node2); + var realNodesAreOnDifferentLines = !ts.nodeIsSynthesized(parent) && !nodeEndIsOnSameLineAsNodeStart(node1, node2); var synthesizedNodeIsOnDifferentLine = synthesizedNodeStartsOnNewLine(node2); if (realNodesAreOnDifferentLines || synthesizedNodeIsOnDifferentLine) { increaseIndent(); @@ -19628,7 +25432,7 @@ var ts; var indentedBeforeDot = indentIfOnDifferentLines(node, node.expression, node.dotToken); write("."); var indentedAfterDot = indentIfOnDifferentLines(node, node.dotToken, node.name); - emit(node.name); + emit(node.name, false); decreaseIndentIf(indentedBeforeDot, indentedAfterDot); } function emitQualifiedName(node) { @@ -19646,20 +25450,22 @@ var ts; write("]"); } function hasSpreadElement(elements) { - return ts.forEach(elements, function (e) { return e.kind === 171; }); + return ts.forEach(elements, function (e) { + return e.kind === 173; + }); } function skipParentheses(node) { - while (node.kind === 159 || node.kind === 158) { + while (node.kind === 161 || node.kind === 160) { node = node.expression; } return node; } function emitCallTarget(node) { - if (node.kind === 64 || node.kind === 92 || node.kind === 90) { + if (node.kind === 65 || node.kind === 93 || node.kind === 91) { emit(node); return node; } - var temp = createAndRecordTempVariable(node); + var temp = createAndRecordTempVariable(0); write("("); emit(temp); write(" = "); @@ -19670,18 +25476,18 @@ var ts; function emitCallWithSpread(node) { var target; var expr = skipParentheses(node.expression); - if (expr.kind === 153) { + if (expr.kind === 155) { target = emitCallTarget(expr.expression); write("."); emit(expr.name); } - else if (expr.kind === 154) { + else if (expr.kind === 156) { target = emitCallTarget(expr.expression); write("["); emit(expr.argumentExpression); write("]"); } - else if (expr.kind === 90) { + else if (expr.kind === 91) { target = expr; write("_super"); } @@ -19690,7 +25496,7 @@ var ts; } write(".apply("); if (target) { - if (target.kind === 90) { + if (target.kind === 91) { emitThis(target); } else { @@ -19710,15 +25516,15 @@ var ts; return; } var superCall = false; - if (node.expression.kind === 90) { - write("_super"); + if (node.expression.kind === 91) { + emitSuper(node.expression); superCall = true; } else { emit(node.expression); - superCall = node.expression.kind === 153 && node.expression.expression.kind === 90; + superCall = node.expression.kind === 155 && node.expression.expression.kind === 91; } - if (superCall) { + if (superCall && languageVersion < 2) { write(".call("); emitThis(node.expression); if (node.arguments.length) { @@ -19743,7 +25549,7 @@ var ts; } } function emitTaggedTemplateExpression(node) { - if (compilerOptions.target >= 2) { + if (languageVersion >= 2) { emit(node.tag); write(" "); emit(node.template); @@ -19753,20 +25559,13 @@ var ts; } } function emitParenExpression(node) { - if (!node.parent || node.parent.kind !== 161) { - if (node.expression.kind === 158) { + if (!node.parent || node.parent.kind !== 163) { + if (node.expression.kind === 160) { var operand = node.expression.expression; - while (operand.kind == 158) { + while (operand.kind == 160) { operand = operand.expression; } - if (operand.kind !== 165 && - operand.kind !== 164 && - operand.kind !== 163 && - operand.kind !== 162 && - operand.kind !== 166 && - operand.kind !== 156 && - !(operand.kind === 155 && node.parent.kind === 156) && - !(operand.kind === 160 && node.parent.kind === 155)) { + if (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)) { emit(operand); return; } @@ -19777,23 +25576,23 @@ var ts; write(")"); } function emitDeleteExpression(node) { - write(ts.tokenToString(73)); + write(ts.tokenToString(74)); write(" "); emit(node.expression); } function emitVoidExpression(node) { - write(ts.tokenToString(98)); + write(ts.tokenToString(99)); write(" "); emit(node.expression); } function emitTypeOfExpression(node) { - write(ts.tokenToString(96)); + write(ts.tokenToString(97)); write(" "); emit(node.expression); } function emitPrefixUnaryExpression(node) { write(ts.tokenToString(node.operator)); - if (node.operand.kind === 165) { + if (node.operand.kind === 167) { var operand = node.operand; if (node.operator === 33 && (operand.operator === 33 || operand.operator === 38)) { write(" "); @@ -19809,9 +25608,8 @@ var ts; write(ts.tokenToString(node.operator)); } function emitBinaryExpression(node) { - if (languageVersion < 2 && node.operatorToken.kind === 52 && - (node.left.kind === 152 || node.left.kind === 151)) { - emitDestructuring(node, node.parent.kind === 177); + if (languageVersion < 2 && node.operatorToken.kind === 53 && (node.left.kind === 154 || node.left.kind === 153)) { + emitDestructuring(node, node.parent.kind === 182); } else { emit(node.left); @@ -19847,13 +25645,13 @@ var ts; } } function isSingleLineEmptyBlock(node) { - if (node && node.kind === 174) { + if (node && node.kind === 179) { var block = node; return block.statements.length === 0 && nodeEndIsOnSameLineAsNodeStart(block, block); } } function emitBlock(node) { - if (preserveNewLines && isSingleLineEmptyBlock(node)) { + if (isSingleLineEmptyBlock(node)) { emitToken(14, node.pos); write(" "); emitToken(15, node.statements.end); @@ -19862,12 +25660,12 @@ var ts; emitToken(14, node.pos); increaseIndent(); scopeEmitStart(node.parent); - if (node.kind === 201) { - ts.Debug.assert(node.parent.kind === 200); + if (node.kind === 206) { + ts.Debug.assert(node.parent.kind === 205); emitCaptureThisForNodeIfNecessary(node.parent); } emitLines(node.statements); - if (node.kind === 201) { + if (node.kind === 206) { emitTempDeclarations(true); } decreaseIndent(); @@ -19876,7 +25674,7 @@ var ts; scopeEmitEnd(); } function emitEmbeddedStatement(node) { - if (node.kind === 174) { + if (node.kind === 179) { write(" "); emit(node); } @@ -19888,11 +25686,11 @@ var ts; } } function emitExpressionStatement(node) { - emitParenthesizedIf(node.expression, node.expression.kind === 161); + emitParenthesizedIf(node.expression, node.expression.kind === 163); write(";"); } function emitIfStatement(node) { - var endPos = emitToken(83, node.pos); + var endPos = emitToken(84, node.pos); write(" "); endPos = emitToken(16, endPos); emit(node.expression); @@ -19900,8 +25698,8 @@ var ts; emitEmbeddedStatement(node.thenStatement); if (node.elseStatement) { writeLine(); - emitToken(75, node.thenStatement.end); - if (node.elseStatement.kind === 178) { + emitToken(76, node.thenStatement.end); + if (node.elseStatement.kind === 183) { write(" "); emit(node.elseStatement); } @@ -19913,7 +25711,7 @@ var ts; function emitDoStatement(node) { write("do"); emitEmbeddedStatement(node.statement); - if (node.statement.kind === 174) { + if (node.statement.kind === 179) { write(" "); } else { @@ -19930,13 +25728,13 @@ var ts; emitEmbeddedStatement(node.statement); } function emitStartOfVariableDeclarationList(decl, startPos) { - var tokenKind = 97; + var tokenKind = 98; if (decl && languageVersion >= 2) { if (ts.isLet(decl)) { - tokenKind = 104; + tokenKind = 105; } else if (ts.isConst(decl)) { - tokenKind = 69; + tokenKind = 70; } } if (startPos !== undefined) { @@ -19944,20 +25742,20 @@ var ts; } else { switch (tokenKind) { - case 97: + case 98: return write("var "); - case 104: + case 105: return write("let "); - case 69: + case 70: return write("const "); } } } function emitForStatement(node) { - var endPos = emitToken(81, node.pos); + var endPos = emitToken(82, node.pos); write(" "); endPos = emitToken(16, endPos); - if (node.initializer && node.initializer.kind === 194) { + if (node.initializer && node.initializer.kind === 199) { var variableDeclarationList = node.initializer; var declarations = variableDeclarationList.declarations; emitStartOfVariableDeclarationList(declarations[0], endPos); @@ -19975,13 +25773,13 @@ var ts; emitEmbeddedStatement(node.statement); } function emitForInOrForOfStatement(node) { - if (languageVersion < 2 && node.kind === 183) { + if (languageVersion < 2 && node.kind === 188) { return emitDownLevelForOfStatement(node); } - var endPos = emitToken(81, node.pos); + var endPos = emitToken(82, node.pos); write(" "); endPos = emitToken(16, endPos); - if (node.initializer.kind === 194) { + if (node.initializer.kind === 199) { var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length >= 1) { var decl = variableDeclarationList.declarations[0]; @@ -19993,7 +25791,7 @@ var ts; else { emit(node.initializer); } - if (node.kind === 182) { + if (node.kind === 187) { write(" in "); } else { @@ -20004,13 +25802,32 @@ var ts; emitEmbeddedStatement(node.statement); } function emitDownLevelForOfStatement(node) { - var endPos = emitToken(81, node.pos); + // The following ES6 code: + // + // for (let v of expr) { } + // + // should be emitted as + // + // for (let _i = 0, _a = expr; _i < _a.length; _i++) { + // let v = _a[_i]; + // } + // + // where _a and _i are temps emitted to capture the RHS and the counter, + // respectively. + // When the left hand side is an expression instead of a let declaration, + // the "let v" is not emitted. + // When the left hand side is a let/const, the v is renamed if there is + // another v in scope. + // Note that all assignments to the LHS are emitted in the body, including + // all destructuring. + // Note also that because an extra statement is needed to assign to the LHS, + // for-of bodies are always emitted as blocks. + var endPos = emitToken(82, node.pos); write(" "); endPos = emitToken(16, endPos); - var rhsIsIdentifier = node.expression.kind === 64; - var counter = createTempVariable(node, "_i"); - var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(node); - var cachedLength = compilerOptions.cacheDownlevelForOfLength ? createTempVariable(node, "_n") : undefined; + var rhsIsIdentifier = node.expression.kind === 65; + var counter = createTempVariable(268435456); + var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(0); emitStart(node.expression); write("var "); emitNodeWithoutSourceMap(counter); @@ -20024,24 +25841,12 @@ var ts; emitNodeWithoutSourceMap(node.expression); emitEnd(node.expression); } - if (cachedLength) { - write(", "); - emitNodeWithoutSourceMap(cachedLength); - write(" = "); - emitNodeWithoutSourceMap(rhsReference); - write(".length"); - } write("; "); emitStart(node.initializer); emitNodeWithoutSourceMap(counter); write(" < "); - if (cachedLength) { - emitNodeWithoutSourceMap(cachedLength); - } - else { - emitNodeWithoutSourceMap(rhsReference); - write(".length"); - } + emitNodeWithoutSourceMap(rhsReference); + write(".length"); emitEnd(node.initializer); write("; "); emitStart(node.initializer); @@ -20054,7 +25859,7 @@ var ts; increaseIndent(); var rhsIterationValue = createElementAccessExpression(rhsReference, counter); emitStart(node.initializer); - if (node.initializer.kind === 194) { + if (node.initializer.kind === 199) { write("var "); var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -20069,14 +25874,14 @@ var ts; } } else { - emitNodeWithoutSourceMap(createTempVariable(node)); + emitNodeWithoutSourceMap(createTempVariable(0)); write(" = "); emitNodeWithoutSourceMap(rhsIterationValue); } } else { - var assignmentExpression = createBinaryExpression(node.initializer, 52, rhsIterationValue, false); - if (node.initializer.kind === 151 || node.initializer.kind === 152) { + var assignmentExpression = createBinaryExpression(node.initializer, 53, rhsIterationValue, false); + if (node.initializer.kind === 153 || node.initializer.kind === 154) { emitDestructuring(assignmentExpression, true, undefined, node); } else { @@ -20085,7 +25890,7 @@ var ts; } emitEnd(node.initializer); write(";"); - if (node.statement.kind === 174) { + if (node.statement.kind === 179) { emitLines(node.statement.statements); } else { @@ -20097,12 +25902,12 @@ var ts; write("}"); } function emitBreakOrContinueStatement(node) { - emitToken(node.kind === 185 ? 65 : 70, node.pos); + emitToken(node.kind === 190 ? 66 : 71, node.pos); emitOptional(" ", node.label); write(";"); } function emitReturnStatement(node) { - emitToken(89, node.pos); + emitToken(90, node.pos); emitOptional(" ", node.expression); write(";"); } @@ -20113,7 +25918,7 @@ var ts; emitEmbeddedStatement(node.statement); } function emitSwitchStatement(node) { - var endPos = emitToken(91, node.pos); + var endPos = emitToken(92, node.pos); write(" "); emitToken(16, endPos); emit(node.expression); @@ -20130,19 +25935,16 @@ var ts; emitToken(15, node.clauses.end); } function nodeStartPositionsAreOnSameLine(node1, node2) { - return getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node1.pos)) === - getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); + return ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node1.pos)) === ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); } function nodeEndPositionsAreOnSameLine(node1, node2) { - return getLineOfLocalPosition(currentSourceFile, node1.end) === - getLineOfLocalPosition(currentSourceFile, node2.end); + return ts.getLineOfLocalPosition(currentSourceFile, node1.end) === ts.getLineOfLocalPosition(currentSourceFile, node2.end); } function nodeEndIsOnSameLineAsNodeStart(node1, node2) { - return getLineOfLocalPosition(currentSourceFile, node1.end) === - getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); + return ts.getLineOfLocalPosition(currentSourceFile, node1.end) === ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 214) { + if (node.kind === 220) { write("case "); emit(node.expression); write(":"); @@ -20150,7 +25952,7 @@ var ts; else { write("default:"); } - if (preserveNewLines && node.statements.length === 1 && nodeStartPositionsAreOnSameLine(node, node.statements[0])) { + if (node.statements.length === 1 && nodeStartPositionsAreOnSameLine(node, node.statements[0])) { write(" "); emit(node.statements[0]); } @@ -20177,7 +25979,7 @@ var ts; } function emitCatchClause(node) { writeLine(); - var endPos = emitToken(67, node.pos); + var endPos = emitToken(68, node.pos); write(" "); emitToken(16, endPos); emit(node.variableDeclaration); @@ -20186,7 +25988,7 @@ var ts; emitBlock(node.block); } function emitDebuggerStatement(node) { - emitToken(71, node.pos); + emitToken(72, node.pos); write(";"); } function emitLabelledStatement(node) { @@ -20197,18 +25999,24 @@ var ts; function getContainingModule(node) { do { node = node.parent; - } while (node && node.kind !== 200); + } while (node && node.kind !== 205); return node; } function emitContainingModuleName(node) { var container = getContainingModule(node); - write(container ? resolver.getGeneratedNameForNode(container) : "exports"); + write(container ? getGeneratedNameForNode(container) : "exports"); } function emitModuleMemberName(node) { emitStart(node.name); if (ts.getCombinedNodeFlags(node) & 1) { - emitContainingModuleName(node); - write("."); + var container = getContainingModule(node); + if (container) { + write(getGeneratedNameForNode(container)); + write("."); + } + else if (languageVersion < 2) { + write("exports."); + } } emitNodeWithoutSourceMap(node.name); emitEnd(node.name); @@ -20216,13 +26024,30 @@ var ts; function createVoidZero() { var zero = ts.createSynthesizedNode(7); zero.text = "0"; - var result = ts.createSynthesizedNode(164); + var result = ts.createSynthesizedNode(166); result.expression = zero; return result; } + function emitExportMemberAssignment(node) { + if (node.flags & 1) { + writeLine(); + emitStart(node); + if (node.flags & 256) { + write("exports.default"); + } + else { + emitModuleMemberName(node); + } + write(" = "); + emitDeclarationName(node); + emitEnd(node); + write(";"); + } + } function emitExportMemberAssignments(name) { - if (!exportDefault && exportSpecifiers && ts.hasProperty(exportSpecifiers, name.text)) { - ts.forEach(exportSpecifiers[name.text], function (specifier) { + if (!exportEquals && exportSpecifiers && ts.hasProperty(exportSpecifiers, name.text)) { + for (var _a = 0, _b = exportSpecifiers[name.text]; _a < _b.length; _a++) { + var specifier = _b[_a]; writeLine(); emitStart(specifier.name); emitContainingModuleName(specifier); @@ -20230,15 +26055,15 @@ var ts; emitNodeWithoutSourceMap(specifier.name); emitEnd(specifier.name); write(" = "); - emitNodeWithoutSourceMap(name); + emitExpressionIdentifier(name); write(";"); - }); + } } } function emitDestructuring(root, isAssignmentExpressionStatement, value, lowestNonSynthesizedAncestor) { var emitCount = 0; - var _isDeclaration = (root.kind === 193 && !(ts.getCombinedNodeFlags(root) & 1)) || root.kind === 128; - if (root.kind === 167) { + var isDeclaration = (root.kind === 198 && !(ts.getCombinedNodeFlags(root) & 1)) || root.kind === 129; + if (root.kind === 169) { emitAssignmentExpression(root); } else { @@ -20250,7 +26075,7 @@ var ts; write(", "); } renameNonTopLevelLetAndConst(name); - if (name.parent && (name.parent.kind === 193 || name.parent.kind === 150)) { + if (name.parent && (name.parent.kind === 198 || name.parent.kind === 152)) { emitModuleMemberName(name.parent); } else { @@ -20260,9 +26085,9 @@ var ts; emit(value); } function ensureIdentifier(expr) { - if (expr.kind !== 64) { - var identifier = createTempVariable(lowestNonSynthesizedAncestor || root); - if (!_isDeclaration) { + if (expr.kind !== 65) { + var identifier = createTempVariable(0); + if (!isDeclaration) { recordTempDeclaration(identifier); } emitAssignment(identifier, expr); @@ -20272,14 +26097,14 @@ var ts; } function createDefaultValueCheck(value, defaultValue) { value = ensureIdentifier(value); - var equals = ts.createSynthesizedNode(167); + var equals = ts.createSynthesizedNode(169); 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(168); + var cond = ts.createSynthesizedNode(170); cond.condition = condition; cond.questionToken = ts.createSynthesizedNode(50); cond.whenTrue = whenTrue; @@ -20293,21 +26118,21 @@ var ts; return node; } function parenthesizeForAccess(expr) { - if (expr.kind === 64 || expr.kind === 153 || expr.kind === 154) { + if (expr.kind === 65 || expr.kind === 155 || expr.kind === 156) { return expr; } - var node = ts.createSynthesizedNode(159); + var node = ts.createSynthesizedNode(161); node.expression = expr; return node; } function createPropertyAccess(object, propName) { - if (propName.kind !== 64) { + if (propName.kind !== 65) { return createElementAccess(object, propName); } return createPropertyAccessExpression(parenthesizeForAccess(object), propName); } function createElementAccess(object, index) { - var node = ts.createSynthesizedNode(154); + var node = ts.createSynthesizedNode(156); node.expression = parenthesizeForAccess(object); node.argumentExpression = index; return node; @@ -20317,9 +26142,9 @@ var ts; if (properties.length !== 1) { value = ensureIdentifier(value); } - for (var _i = 0, _n = properties.length; _i < _n; _i++) { - var p = properties[_i]; - if (p.kind === 218 || p.kind === 219) { + for (var _a = 0; _a < properties.length; _a++) { + var p = properties[_a]; + if (p.kind === 224 || p.kind === 225) { var propName = (p.name); emitDestructuringAssignment(p.initializer || propName, createPropertyAccess(value, propName)); } @@ -20332,8 +26157,8 @@ var ts; } for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 172) { - if (e.kind !== 171) { + if (e.kind !== 175) { + if (e.kind !== 173) { emitDestructuringAssignment(e, createElementAccess(value, createNumericLiteral(i))); } else { @@ -20347,14 +26172,14 @@ var ts; } } function emitDestructuringAssignment(target, value) { - if (target.kind === 167 && target.operatorToken.kind === 52) { + if (target.kind === 169 && target.operatorToken.kind === 53) { value = createDefaultValueCheck(value, target.right); target = target.left; } - if (target.kind === 152) { + if (target.kind === 154) { emitObjectLiteralAssignment(target, value); } - else if (target.kind === 151) { + else if (target.kind === 153) { emitArrayLiteralAssignment(target, value); } else { @@ -20363,19 +26188,19 @@ var ts; } function emitAssignmentExpression(root) { var target = root.left; - var _value = root.right; + var value = root.right; if (isAssignmentExpressionStatement) { - emitDestructuringAssignment(target, _value); + emitDestructuringAssignment(target, value); } else { - if (root.parent.kind !== 159) { + if (root.parent.kind !== 161) { write("("); } - _value = ensureIdentifier(_value); - emitDestructuringAssignment(target, _value); + value = ensureIdentifier(value); + emitDestructuringAssignment(target, value); write(", "); - emit(_value); - if (root.parent.kind !== 159) { + emit(value); + if (root.parent.kind !== 161) { write(")"); } } @@ -20395,11 +26220,11 @@ var ts; } for (var i = 0; i < elements.length; i++) { var element = elements[i]; - if (pattern.kind === 148) { + if (pattern.kind === 150) { var propName = element.propertyName || element.name; emitBindingElement(element, createPropertyAccess(value, propName)); } - else if (element.kind !== 172) { + else if (element.kind !== 175) { if (!element.dotDotDotToken) { emitBindingElement(element, createElementAccess(value, createNumericLiteral(i))); } @@ -20433,11 +26258,8 @@ var ts; 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 !== 182 && - node.parent.parent.kind !== 183) { + var isUninitializedLet = (resolver.getNodeCheckFlags(node) & 256) && (getCombinedFlagsForIdentifier(node.name) & 4096); + if (isUninitializedLet && node.parent.parent.kind !== 187 && node.parent.parent.kind !== 188) { initializer = createVoidZero(); } } @@ -20445,50 +26267,62 @@ var ts; } } function emitExportVariableAssignments(node) { - var _name = node.name; - if (_name.kind === 64) { - emitExportMemberAssignments(_name); + if (node.kind === 175) { + return; } - else if (ts.isBindingPattern(_name)) { - ts.forEach(_name.elements, emitExportVariableAssignments); + var name = node.name; + if (name.kind === 65) { + emitExportMemberAssignments(name); + } + else if (ts.isBindingPattern(name)) { + ts.forEach(name.elements, emitExportVariableAssignments); } } function getCombinedFlagsForIdentifier(node) { - if (!node.parent || (node.parent.kind !== 193 && node.parent.kind !== 150)) { + if (!node.parent || (node.parent.kind !== 198 && node.parent.kind !== 152)) { return 0; } return ts.getCombinedNodeFlags(node.parent); } function renameNonTopLevelLetAndConst(node) { - if (languageVersion >= 2 || - ts.nodeIsSynthesized(node) || - node.kind !== 64 || - (node.parent.kind !== 193 && node.parent.kind !== 150)) { + if (languageVersion >= 2 || ts.nodeIsSynthesized(node) || node.kind !== 65 || (node.parent.kind !== 198 && node.parent.kind !== 152)) { return; } var combinedFlags = getCombinedFlagsForIdentifier(node); if (((combinedFlags & 12288) === 0) || combinedFlags & 1) { return; } - var list = ts.getAncestor(node, 194); - if (list.parent.kind === 175 && list.parent.parent.kind === 221) { - 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); + if (isSourceFileLevelBinding || isModuleLevelBinding || isFunctionLevelBinding) { + return; + } } var blockScopeContainer = ts.getEnclosingBlockScopeContainer(node); - var _parent = blockScopeContainer.kind === 221 - ? blockScopeContainer - : blockScopeContainer.parent; - var generatedName = generateUniqueNameForLocation(_parent, node.text); - var variableId = resolver.getBlockScopedVariableId(node); - if (!generatedBlockScopeNames) { - generatedBlockScopeNames = []; + var parent = blockScopeContainer.kind === 227 ? blockScopeContainer : blockScopeContainer.parent; + if (resolver.resolvesToSomeValue(parent, node.text)) { + var variableId = resolver.getBlockScopedVariableId(node); + if (!blockScopedVariableToGeneratedName) { + blockScopedVariableToGeneratedName = []; + } + var generatedName = makeUniqueName(node.text); + blockScopedVariableToGeneratedName[variableId] = generatedName; } - generatedBlockScopeNames[variableId] = generatedName; + } + function isES6ExportedDeclaration(node) { + return !!(node.flags & 1) && languageVersion >= 2 && node.parent.kind === 227; } function emitVariableStatement(node) { if (!(node.flags & 1)) { emitStartOfVariableDeclarationList(node.declarationList); } + else if (isES6ExportedDeclaration(node)) { + write("export "); + emitStartOfVariableDeclarationList(node.declarationList); + } emitCommaList(node.declarationList.declarations); write(";"); if (languageVersion < 2 && node.parent === currentSourceFile) { @@ -20498,12 +26332,12 @@ var ts; function emitParameter(node) { if (languageVersion < 2) { if (ts.isBindingPattern(node.name)) { - var _name = createTempVariable(node); + var name_16 = createTempVariable(0); if (!tempParameters) { tempParameters = []; } - tempParameters.push(_name); - emit(_name); + tempParameters.push(name_16); + emit(name_16); } else { emit(node.name); @@ -20550,7 +26384,7 @@ var ts; if (languageVersion < 2 && ts.hasRestParameters(node)) { var restIndex = node.parameters.length - 1; var restParam = node.parameters[restIndex]; - var tempName = createTempVariable(node, "_i").text; + var tempName = createTempVariable(268435456).text; writeLine(); emitLeadingComments(restParam); emitStart(restParam); @@ -20585,39 +26419,53 @@ var ts; } } function emitAccessor(node) { - write(node.kind === 134 ? "get " : "set "); - emit(node.name); + write(node.kind === 136 ? "get " : "set "); + emit(node.name, false); emitSignatureAndBody(node); } function shouldEmitAsArrowFunction(node) { - return node.kind === 161 && languageVersion >= 2; + return node.kind === 163 && languageVersion >= 2; } function emitDeclarationName(node) { if (node.name) { emitNodeWithoutSourceMap(node.name); } else { - write(resolver.getGeneratedNameForNode(node)); + write(getGeneratedNameForNode(node)); + } + } + function shouldEmitFunctionName(node) { + if (node.kind === 162) { + return !!node.name; + } + if (node.kind === 200) { + return !!node.name || languageVersion < 2; } } function emitFunctionDeclaration(node) { if (ts.nodeIsMissing(node.body)) { - return emitPinnedOrTripleSlashComments(node); + return emitOnlyPinnedOrTripleSlashComments(node); } - if (node.kind !== 132 && node.kind !== 131) { + if (node.kind !== 134 && node.kind !== 133) { emitLeadingComments(node); } if (!shouldEmitAsArrowFunction(node)) { + if (isES6ExportedDeclaration(node)) { + write("export "); + if (node.flags & 256) { + write("default "); + } + } write("function "); } - if (node.kind === 195 || (node.kind === 160 && node.name)) { + if (shouldEmitFunctionName(node)) { emitDeclarationName(node); } emitSignatureAndBody(node); - if (languageVersion < 2 && node.kind === 195 && node.parent === currentSourceFile && node.name) { + if (languageVersion < 2 && node.kind === 200 && node.parent === currentSourceFile && node.name) { emitExportMemberAssignments(node.name); } - if (node.kind !== 132 && node.kind !== 131) { + if (node.kind !== 134 && node.kind !== 133) { emitTrailingComments(node); } } @@ -20648,13 +26496,12 @@ var ts; emitSignatureParameters(node); } function emitSignatureAndBody(node) { - var saveTempCount = tempCount; + var saveTempFlags = tempFlags; var saveTempVariables = tempVariables; var saveTempParameters = tempParameters; - tempCount = 0; + tempFlags = 0; tempVariables = undefined; tempParameters = undefined; - var popFrame = enterNameScope(); if (shouldEmitAsArrowFunction(node)) { emitSignatureParametersForArrow(node); write(" =>"); @@ -20665,23 +26512,16 @@ var ts; if (!node.body) { write(" { }"); } - else if (node.body.kind === 174) { + else if (node.body.kind === 179) { emitBlockFunctionBody(node, node.body); } else { emitExpressionFunctionBody(node, node.body); } - if (node.flags & 1 && !(node.flags & 256)) { - writeLine(); - emitStart(node); - emitModuleMemberName(node); - write(" = "); - emitDeclarationName(node); - emitEnd(node); - write(";"); + if (!isES6ExportedDeclaration(node)) { + emitExportMemberAssignment(node); } - exitNameScope(popFrame); - tempCount = saveTempCount; + tempFlags = saveTempFlags; tempVariables = saveTempVariables; tempParameters = saveTempParameters; } @@ -20697,10 +26537,10 @@ var ts; } write(" "); var current = body; - while (current.kind === 158) { + while (current.kind === 160) { current = current.expression; } - emitParenthesizedIf(body, current.kind === 152); + emitParenthesizedIf(body, current.kind === 154); } function emitDownLevelExpressionFunctionBody(node, body) { write(" {"); @@ -20711,11 +26551,11 @@ var ts; emitFunctionBodyPreamble(node); var preambleEmitted = writer.getTextPos() !== outPos; decreaseIndent(); - if (preserveNewLines && !preambleEmitted && nodeStartPositionsAreOnSameLine(node, body)) { + if (!preambleEmitted && nodeStartPositionsAreOnSameLine(node, body)) { write(" "); emitStart(body); write("return "); - emitWithoutComments(body); + emit(body); emitEnd(body); write(";"); emitTempDeclarations(false); @@ -20726,7 +26566,7 @@ var ts; writeLine(); emitLeadingComments(node.body); write("return "); - emitWithoutComments(node.body); + emit(body); write(";"); emitTrailingComments(node.body); emitTempDeclarations(true); @@ -20748,9 +26588,9 @@ var ts; emitFunctionBodyPreamble(node); decreaseIndent(); var preambleEmitted = writer.getTextPos() !== initialTextPos; - if (preserveNewLines && !preambleEmitted && nodeEndIsOnSameLineAsNodeStart(body, body)) { - for (var _i = 0, _a = body.statements, _n = _a.length; _i < _n; _i++) { - var statement = _a[_i]; + if (!preambleEmitted && nodeEndIsOnSameLineAsNodeStart(body, body)) { + for (var _a = 0, _b = body.statements; _a < _b.length; _a++) { + var statement = _b[_a]; write(" "); emit(statement); } @@ -20772,11 +26612,11 @@ var ts; function findInitialSuperCall(ctor) { if (ctor.body) { var statement = ctor.body.statements[0]; - if (statement && statement.kind === 177) { + if (statement && statement.kind === 182) { var expr = statement.expression; - if (expr && expr.kind === 155) { + if (expr && expr.kind === 157) { var func = expr.expression; - if (func && func.kind === 90) { + if (func && func.kind === 91) { return statement; } } @@ -20805,7 +26645,7 @@ var ts; emitNodeWithoutSourceMap(memberName); write("]"); } - else if (memberName.kind === 126) { + else if (memberName.kind === 127) { emitComputedPropertyName(memberName); } else { @@ -20815,7 +26655,7 @@ var ts; } function emitMemberAssignments(node, staticFlag) { ts.forEach(node.members, function (member) { - if (member.kind === 130 && (member.flags & 128) === staticFlag && member.initializer) { + if (member.kind === 132 && (member.flags & 128) === staticFlag && member.initializer) { writeLine(); emitLeadingComments(member); emitStart(member); @@ -20836,20 +26676,21 @@ var ts; } }); } - function emitMemberFunctions(node) { + function emitMemberFunctionsForES5AndLower(node) { ts.forEach(node.members, function (member) { - if (member.kind === 132 || node.kind === 131) { + if (member.kind === 178) { + writeLine(); + write(";"); + } + else if (member.kind === 134 || node.kind === 133) { if (!member.body) { - return emitPinnedOrTripleSlashComments(member); + return emitOnlyPinnedOrTripleSlashComments(member); } writeLine(); emitLeadingComments(member); emitStart(member); emitStart(member.name); - emitDeclarationName(node); - if (!(member.flags & 128)) { - write(".prototype"); - } + emitClassMemberPrefix(node, member); emitMemberAccessForPropertyName(member.name); emitEnd(member.name); write(" = "); @@ -20860,17 +26701,14 @@ var ts; write(";"); emitTrailingComments(member); } - else if (member.kind === 134 || member.kind === 135) { - var accessors = getAllAccessorDeclarations(node.members, member); + else if (member.kind === 136 || member.kind === 137) { + var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { writeLine(); emitStart(member); write("Object.defineProperty("); emitStart(member.name); - emitDeclarationName(node); - if (!(member.flags & 128)) { - write(".prototype"); - } + emitClassMemberPrefix(node, member); write(", "); emitExpressionForPropertyName(member.name); emitEnd(member.name); @@ -20910,15 +26748,238 @@ 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) { + emitOnlyPinnedOrTripleSlashComments(member); + } + else if (member.kind === 134 || member.kind === 136 || member.kind === 137) { + writeLine(); + emitLeadingComments(member); + emitStart(member); + if (member.flags & 128) { + write("static "); + } + if (member.kind === 136) { + write("get "); + } + else if (member.kind === 137) { + write("set "); + } + emit(member.name); + emitSignatureAndBody(member); + emitEnd(member); + emitTrailingComments(member); + } + else if (member.kind === 178) { + writeLine(); + write(";"); + } + } + } + function emitConstructor(node, baseTypeElement) { + var saveTempFlags = tempFlags; + var saveTempVariables = tempVariables; + var saveTempParameters = tempParameters; + tempFlags = 0; + tempVariables = undefined; + tempParameters = undefined; + var hasInstancePropertyWithInitializer = false; + ts.forEach(node.members, function (member) { + if (member.kind === 135 && !member.body) { + emitOnlyPinnedOrTripleSlashComments(member); + } + if (member.kind === 132 && member.initializer && (member.flags & 128) === 0) { + hasInstancePropertyWithInitializer = true; + } + }); + var ctor = ts.getFirstConstructorWithBody(node); + if (languageVersion >= 2 && !ctor && !hasInstancePropertyWithInitializer) { + return; + } + if (ctor) { + emitLeadingComments(ctor); + } + emitStart(ctor || node); + if (languageVersion < 2) { + write("function "); + emitDeclarationName(node); + emitSignatureParameters(ctor); + } + else { + write("constructor"); + if (ctor) { + emitSignatureParameters(ctor); + } + else { + if (baseTypeElement) { + write("(...args)"); + } + else { + write("()"); + } + } + } + write(" {"); + scopeEmitStart(node, "constructor"); + increaseIndent(); + if (ctor) { + emitDetachedComments(ctor.body.statements); + } + emitCaptureThisForNodeIfNecessary(node); + if (ctor) { + emitDefaultValueAssignments(ctor); + emitRestParameter(ctor); + if (baseTypeElement) { + var superCall = findInitialSuperCall(ctor); + if (superCall) { + writeLine(); + emit(superCall); + } + } + emitParameterPropertyAssignments(ctor); + } + else { + if (baseTypeElement) { + writeLine(); + emitStart(baseTypeElement); + if (languageVersion < 2) { + write("_super.apply(this, arguments);"); + } + else { + write("super(...args);"); + } + emitEnd(baseTypeElement); + } + } + emitMemberAssignments(node, 0); + if (ctor) { + var statements = ctor.body.statements; + if (superCall) { + statements = statements.slice(1); + } + emitLines(statements); + } + emitTempDeclarations(true); + writeLine(); + if (ctor) { + emitLeadingCommentsOfPosition(ctor.body.statements.end); + } + decreaseIndent(); + emitToken(15, ctor ? ctor.body.statements.end : node.members.end); + scopeEmitEnd(); + emitEnd(ctor || node); + if (ctor) { + emitTrailingComments(ctor); + } + tempFlags = saveTempFlags; + tempVariables = saveTempVariables; + tempParameters = saveTempParameters; + } + function emitClassExpression(node) { + return emitClassLikeDeclaration(node); + } function emitClassDeclaration(node) { - write("var "); - emitDeclarationName(node); - write(" = (function ("); - var baseTypeNode = ts.getClassBaseTypeNode(node); + return emitClassLikeDeclaration(node); + } + function emitClassLikeDeclaration(node) { + if (languageVersion < 2) { + emitClassLikeDeclarationBelowES6(node); + } + else { + emitClassLikeDeclarationForES6AndHigher(node); + } + } + function emitClassLikeDeclarationForES6AndHigher(node) { + var thisNodeIsDecorated = ts.nodeIsDecorated(node); + if (node.kind === 201) { + if (thisNodeIsDecorated) { + if (isES6ExportedDeclaration(node) && !(node.flags & 256)) { + write("export "); + } + write("let "); + emitDeclarationName(node); + write(" = "); + } + else if (isES6ExportedDeclaration(node)) { + write("export "); + if (node.flags & 256) { + write("default "); + } + } + } + write("class"); + if ((node.name || !(node.flags & 256)) && !thisNodeIsDecorated) { + write(" "); + emitDeclarationName(node); + } + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); + if (baseTypeNode) { + write(" extends "); + emit(baseTypeNode.expression); + } + write(" {"); + increaseIndent(); + scopeEmitStart(node); + writeLine(); + emitConstructor(node, baseTypeNode); + emitMemberFunctionsForES6AndHigher(node); + decreaseIndent(); + writeLine(); + emitToken(15, node.members.end); + scopeEmitEnd(); + if (thisNodeIsDecorated) { + write(";"); + if (node.name) { + writeLine(); + write("Object.defineProperty("); + emitDeclarationName(node); + write(", \"name\", { value: \""); + emitDeclarationName(node); + write("\", configurable: true });"); + writeLine(); + } + } + writeLine(); + emitMemberAssignments(node, 128); + emitDecoratorsOfClass(node); + if (!isES6ExportedDeclaration(node) && (node.flags & 1)) { + writeLine(); + emitStart(node); + emitModuleMemberName(node); + write(" = "); + emitDeclarationName(node); + emitEnd(node); + write(";"); + } + else if (isES6ExportedDeclaration(node) && (node.flags & 256) && thisNodeIsDecorated) { + writeLine(); + write("export default "); + emitDeclarationName(node); + write(";"); + } + } + function emitClassLikeDeclarationBelowES6(node) { + if (node.kind === 201) { + write("var "); + emitDeclarationName(node); + write(" = "); + } + write("(function ("); + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { write("_super"); } write(") {"); + var saveTempFlags = tempFlags; + var saveTempVariables = tempVariables; + var saveTempParameters = tempParameters; + var saveComputedPropertyNamesToGeneratedNames = computedPropertyNamesToGeneratedNames; + tempFlags = 0; + tempVariables = undefined; + tempParameters = undefined; + computedPropertyNamesToGeneratedNames = undefined; increaseIndent(); scopeEmitStart(node); if (baseTypeNode) { @@ -20930,15 +26991,22 @@ var ts; emitEnd(baseTypeNode); } writeLine(); - emitConstructorOfClass(); - emitMemberFunctions(node); + emitConstructor(node, baseTypeNode); + emitMemberFunctionsForES5AndLower(node); emitMemberAssignments(node, 128); writeLine(); + emitDecoratorsOfClass(node); + writeLine(); emitToken(15, node.members.end, function () { write("return "); emitDeclarationName(node); }); write(";"); + emitTempDeclarations(true); + tempFlags = saveTempFlags; + tempVariables = saveTempVariables; + tempParameters = saveTempParameters; + computedPropertyNamesToGeneratedNames = saveComputedPropertyNamesToGeneratedNames; decreaseIndent(); writeLine(); emitToken(15, node.members.end); @@ -20946,109 +27014,170 @@ var ts; emitStart(node); write(")("); if (baseTypeNode) { - emit(baseTypeNode.typeName); + emit(baseTypeNode.expression); } - write(");"); - emitEnd(node); - if (node.flags & 1 && !(node.flags & 256)) { - writeLine(); - emitStart(node); - emitModuleMemberName(node); - write(" = "); - emitDeclarationName(node); - emitEnd(node); + write(")"); + if (node.kind === 201) { write(";"); } + emitEnd(node); + if (node.kind === 201) { + emitExportMemberAssignment(node); + } if (languageVersion < 2 && node.parent === currentSourceFile && node.name) { emitExportMemberAssignments(node.name); } - function emitConstructorOfClass() { - var saveTempCount = tempCount; - var saveTempVariables = tempVariables; - var saveTempParameters = tempParameters; - tempCount = 0; - tempVariables = undefined; - tempParameters = undefined; - var popFrame = enterNameScope(); - ts.forEach(node.members, function (member) { - if (member.kind === 133 && !member.body) { - emitPinnedOrTripleSlashComments(member); - } - }); - var ctor = getFirstConstructorWithBody(node); - if (ctor) { - emitLeadingComments(ctor); - } - emitStart(ctor || node); - write("function "); - emitDeclarationName(node); - emitSignatureParameters(ctor); - write(" {"); - scopeEmitStart(node, "constructor"); - increaseIndent(); - if (ctor) { - emitDetachedComments(ctor.body.statements); - } - emitCaptureThisForNodeIfNecessary(node); - var superCall; - if (ctor) { - emitDefaultValueAssignments(ctor); - emitRestParameter(ctor); - if (baseTypeNode) { - superCall = findInitialSuperCall(ctor); - if (superCall) { - writeLine(); - emit(superCall); - } - } - emitParameterPropertyAssignments(ctor); - } - else { - if (baseTypeNode) { - writeLine(); - emitStart(baseTypeNode); - write("_super.apply(this, arguments);"); - emitEnd(baseTypeNode); - } - } - emitMemberAssignments(node, 0); - if (ctor) { - var statements = ctor.body.statements; - if (superCall) - statements = statements.slice(1); - emitLines(statements); - } - emitTempDeclarations(true); - writeLine(); - if (ctor) { - emitLeadingCommentsOfPosition(ctor.body.statements.end); - } - decreaseIndent(); - emitToken(15, ctor ? ctor.body.statements.end : node.members.end); - scopeEmitEnd(); - emitEnd(ctor || node); - if (ctor) { - emitTrailingComments(ctor); - } - exitNameScope(popFrame); - tempCount = saveTempCount; - tempVariables = saveTempVariables; - tempParameters = saveTempParameters; + } + function emitClassMemberPrefix(node, member) { + emitDeclarationName(node); + if (!(member.flags & 128)) { + write(".prototype"); } } + function emitDecoratorsOfClass(node) { + emitDecoratorsOfMembers(node, 0); + emitDecoratorsOfMembers(node, 128); + emitDecoratorsOfConstructor(node); + } + function emitDecoratorsOfConstructor(node) { + var constructor = ts.getFirstConstructorWithBody(node); + if (constructor) { + emitDecoratorsOfParameters(node, constructor); + } + if (!ts.nodeIsDecorated(node)) { + return; + } + writeLine(); + emitStart(node); + emitDeclarationName(node); + write(" = "); + emitDecorateStart(node.decorators); + emitDeclarationName(node); + write(");"); + emitEnd(node); + writeLine(); + } + function emitDecoratorsOfMembers(node, staticFlag) { + ts.forEach(node.members, function (member) { + if ((member.flags & 128) !== staticFlag) { + return; + } + var decorators; + switch (member.kind) { + case 134: + emitDecoratorsOfParameters(node, member); + decorators = member.decorators; + break; + case 136: + case 137: + var accessors = ts.getAllAccessorDeclarations(node.members, member); + if (member !== accessors.firstAccessor) { + return; + } + if (accessors.setAccessor) { + emitDecoratorsOfParameters(node, accessors.setAccessor); + } + decorators = accessors.firstAccessor.decorators; + if (!decorators && accessors.secondAccessor) { + decorators = accessors.secondAccessor.decorators; + } + break; + case 132: + decorators = member.decorators; + break; + default: + return; + } + if (!decorators) { + return; + } + writeLine(); + emitStart(member); + if (member.kind !== 132) { + write("Object.defineProperty("); + emitStart(member.name); + emitClassMemberPrefix(node, member); + write(", "); + emitExpressionForPropertyName(member.name); + emitEnd(member.name); + write(", "); + } + emitDecorateStart(decorators); + emitStart(member.name); + emitClassMemberPrefix(node, member); + write(", "); + emitExpressionForPropertyName(member.name); + emitEnd(member.name); + if (member.kind !== 132) { + write(", Object.getOwnPropertyDescriptor("); + emitStart(member.name); + emitClassMemberPrefix(node, member); + write(", "); + emitExpressionForPropertyName(member.name); + emitEnd(member.name); + write("))"); + } + write(");"); + emitEnd(member); + writeLine(); + }); + } + function emitDecoratorsOfParameters(node, member) { + ts.forEach(member.parameters, function (parameter, parameterIndex) { + if (!ts.nodeIsDecorated(parameter)) { + return; + } + writeLine(); + emitStart(parameter); + emitDecorateStart(parameter.decorators); + emitStart(parameter.name); + if (member.kind === 135) { + emitDeclarationName(node); + write(", void 0"); + } + else { + emitClassMemberPrefix(node, member); + write(", "); + emitExpressionForPropertyName(member.name); + } + write(", "); + write(String(parameterIndex)); + emitEnd(parameter.name); + write(");"); + emitEnd(parameter); + writeLine(); + }); + } + function emitDecorateStart(decorators) { + write("__decorate(["); + var decoratorCount = decorators.length; + for (var i = 0; i < decoratorCount; i++) { + if (i > 0) { + write(", "); + } + var decorator = decorators[i]; + emitStart(decorator); + emit(decorator.expression); + emitEnd(decorator); + } + write("], "); + } function emitInterfaceDeclaration(node) { - emitPinnedOrTripleSlashComments(node); + emitOnlyPinnedOrTripleSlashComments(node); } function shouldEmitEnumDeclaration(node) { var isConstEnum = ts.isConst(node); - return !isConstEnum || compilerOptions.preserveConstEnums; + return !isConstEnum || compilerOptions.preserveConstEnums || compilerOptions.separateCompilation; } function emitEnumDeclaration(node) { if (!shouldEmitEnumDeclaration(node)) { return; } - if (!(node.flags & 1)) { + if (!(node.flags & 1) || isES6ExportedDeclaration(node)) { emitStart(node); + if (isES6ExportedDeclaration(node)) { + write("export "); + } write("var "); emit(node.name); emitEnd(node); @@ -21058,7 +27187,7 @@ var ts; emitStart(node); write("(function ("); emitStart(node.name); - write(resolver.getGeneratedNameForNode(node)); + write(getGeneratedNameForNode(node)); emitEnd(node.name); write(") {"); increaseIndent(); @@ -21074,7 +27203,7 @@ var ts; emitModuleMemberName(node); write(" = {}));"); emitEnd(node); - if (node.flags & 1) { + if (!isES6ExportedDeclaration(node) && node.flags & 1) { writeLine(); emitStart(node); write("var "); @@ -21091,9 +27220,9 @@ var ts; function emitEnumMember(node) { var enumParent = node.parent; emitStart(node); - write(resolver.getGeneratedNameForNode(enumParent)); + write(getGeneratedNameForNode(enumParent)); write("["); - write(resolver.getGeneratedNameForNode(enumParent)); + write(getGeneratedNameForNode(enumParent)); write("["); emitExpressionForPropertyName(node.name); write("] = "); @@ -21104,14 +27233,12 @@ var ts; write(";"); } function writeEnumMemberDeclarationValue(member) { - if (!member.initializer || ts.isConst(member.parent)) { - var value = resolver.getConstantValue(member); - if (value !== undefined) { - write(value.toString()); - return; - } + var value = resolver.getConstantValue(member); + if (value !== undefined) { + write(value.toString()); + return; } - if (member.initializer) { + else if (member.initializer) { emit(member.initializer); } else { @@ -21119,20 +27246,23 @@ var ts; } } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 200) { + if (moduleDeclaration.body.kind === 205) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } } function shouldEmitModuleDeclaration(node) { - return ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums); + return ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation); } function emitModuleDeclaration(node) { var shouldEmit = shouldEmitModuleDeclaration(node); if (!shouldEmit) { - return emitPinnedOrTripleSlashComments(node); + return emitOnlyPinnedOrTripleSlashComments(node); } emitStart(node); + if (isES6ExportedDeclaration(node)) { + write("export "); + } write("var "); emit(node.name); write(";"); @@ -21141,18 +27271,16 @@ var ts; emitStart(node); write("(function ("); emitStart(node.name); - write(resolver.getGeneratedNameForNode(node)); + write(getGeneratedNameForNode(node)); emitEnd(node.name); write(") "); - if (node.body.kind === 201) { - var saveTempCount = tempCount; + if (node.body.kind === 206) { + var saveTempFlags = tempFlags; var saveTempVariables = tempVariables; - tempCount = 0; + tempFlags = 0; tempVariables = undefined; - var popFrame = enterNameScope(); emit(node.body); - exitNameScope(popFrame); - tempCount = saveTempCount; + tempFlags = saveTempFlags; tempVariables = saveTempVariables; } else { @@ -21169,7 +27297,7 @@ var ts; scopeEmitEnd(); } write(")("); - if (node.flags & 1) { + if ((node.flags & 1) && !isES6ExportedDeclaration(node)) { emit(node.name); write(" = "); } @@ -21178,7 +27306,7 @@ var ts; emitModuleMemberName(node); write(" = {}));"); emitEnd(node); - if (languageVersion < 2 && node.name.kind === 64 && node.parent === currentSourceFile) { + if (!isES6ExportedDeclaration(node) && node.name.kind === 65 && node.parent === currentSourceFile) { emitExportMemberAssignments(node.name); } } @@ -21189,199 +27317,300 @@ var ts; emitLiteral(moduleName); emitEnd(moduleName); emitToken(17, moduleName.end); - write(";"); } else { - write("require();"); + write("require()"); } } + function getNamespaceDeclarationNode(node) { + if (node.kind === 208) { + return node; + } + var importClause = node.importClause; + if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 211) { + return importClause.namedBindings; + } + } + function isDefaultImport(node) { + return node.kind === 209 && node.importClause && !!node.importClause.name; + } + function emitExportImportAssignments(node) { + if (ts.isAliasSymbolDeclaration(node) && resolver.isValueAliasDeclaration(node)) { + emitExportMemberAssignments(node.name); + } + ts.forEachChild(node, emitExportImportAssignments); + } function emitImportDeclaration(node) { - var info = getExternalImportInfo(node); - if (info) { - var declarationNode = info.declarationNode; - var namedImports = info.namedImports; + if (languageVersion < 2) { + return emitExternalImportDeclaration(node); + } + if (node.importClause) { + var shouldEmitDefaultBindings = resolver.isReferencedAliasDeclaration(node.importClause); + var shouldEmitNamedBindings = node.importClause.namedBindings && resolver.isReferencedAliasDeclaration(node.importClause.namedBindings, true); + if (shouldEmitDefaultBindings || shouldEmitNamedBindings) { + write("import "); + emitStart(node.importClause); + if (shouldEmitDefaultBindings) { + emit(node.importClause.name); + if (shouldEmitNamedBindings) { + write(", "); + } + } + if (shouldEmitNamedBindings) { + emitLeadingComments(node.importClause.namedBindings); + emitStart(node.importClause.namedBindings); + if (node.importClause.namedBindings.kind === 211) { + write("* as "); + emit(node.importClause.namedBindings.name); + } + else { + write("{ "); + emitExportOrImportSpecifierList(node.importClause.namedBindings.elements, resolver.isReferencedAliasDeclaration); + write(" }"); + } + emitEnd(node.importClause.namedBindings); + emitTrailingComments(node.importClause.namedBindings); + } + emitEnd(node.importClause); + write(" from "); + emit(node.moduleSpecifier); + write(";"); + } + } + else { + write("import "); + emit(node.moduleSpecifier); + write(";"); + } + } + function emitExternalImportDeclaration(node) { + if (ts.contains(externalImports, node)) { + var isExportedImport = node.kind === 208 && (node.flags & 1) !== 0; + var namespaceDeclaration = getNamespaceDeclarationNode(node); if (compilerOptions.module !== 2) { emitLeadingComments(node); emitStart(node); - var moduleName = ts.getExternalModuleName(node); - if (declarationNode) { - if (!(declarationNode.flags & 1)) + if (namespaceDeclaration && !isDefaultImport(node)) { + if (!isExportedImport) write("var "); - emitModuleMemberName(declarationNode); + emitModuleMemberName(namespaceDeclaration); write(" = "); - emitRequire(moduleName); - } - else if (namedImports) { - write("var "); - write(resolver.getGeneratedNameForNode(node)); - write(" = "); - emitRequire(moduleName); } else { - emitRequire(moduleName); + var isNakedImport = 209 && !node.importClause; + if (!isNakedImport) { + write("var "); + write(getGeneratedNameForNode(node)); + write(" = "); + } } + emitRequire(ts.getExternalModuleName(node)); + if (namespaceDeclaration && isDefaultImport(node)) { + write(", "); + emitModuleMemberName(namespaceDeclaration); + write(" = "); + write(getGeneratedNameForNode(node)); + } + write(";"); emitEnd(node); + emitExportImportAssignments(node); emitTrailingComments(node); } else { - if (declarationNode) { - if (declarationNode.flags & 1) { - emitModuleMemberName(declarationNode); - write(" = "); - emit(declarationNode.name); - write(";"); - } + if (isExportedImport) { + emitModuleMemberName(namespaceDeclaration); + write(" = "); + emit(namespaceDeclaration.name); + write(";"); } + else if (namespaceDeclaration && isDefaultImport(node)) { + write("var "); + emitModuleMemberName(namespaceDeclaration); + write(" = "); + write(getGeneratedNameForNode(node)); + write(";"); + } + emitExportImportAssignments(node); } } } function emitImportEqualsDeclaration(node) { if (ts.isExternalModuleImportEqualsDeclaration(node)) { - emitImportDeclaration(node); + emitExternalImportDeclaration(node); return; } - if (resolver.isReferencedAliasDeclaration(node) || - (!ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportEqualsWithEntityName(node))) { + if (resolver.isReferencedAliasDeclaration(node) || (!ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportEqualsWithEntityName(node))) { emitLeadingComments(node); emitStart(node); - if (!(node.flags & 1)) + if (isES6ExportedDeclaration(node)) { + write("export "); write("var "); + } + else if (!(node.flags & 1)) { + write("var "); + } emitModuleMemberName(node); write(" = "); emit(node.moduleReference); write(";"); emitEnd(node); + emitExportImportAssignments(node); emitTrailingComments(node); } } function emitExportDeclaration(node) { - if (node.moduleSpecifier) { - emitStart(node); - var generatedName = resolver.getGeneratedNameForNode(node); - if (compilerOptions.module !== 2) { - write("var "); - write(generatedName); - write(" = "); - emitRequire(ts.getExternalModuleName(node)); - } - if (node.exportClause) { - ts.forEach(node.exportClause.elements, function (specifier) { + if (languageVersion < 2) { + if (node.moduleSpecifier && (!node.exportClause || resolver.isValueAliasDeclaration(node))) { + emitStart(node); + var generatedName = getGeneratedNameForNode(node); + if (node.exportClause) { + if (compilerOptions.module !== 2) { + write("var "); + write(generatedName); + write(" = "); + emitRequire(ts.getExternalModuleName(node)); + write(";"); + } + for (var _a = 0, _b = node.exportClause.elements; _a < _b.length; _a++) { + var specifier = _b[_a]; + if (resolver.isValueAliasDeclaration(specifier)) { + writeLine(); + emitStart(specifier); + emitContainingModuleName(specifier); + write("."); + emitNodeWithoutSourceMap(specifier.name); + write(" = "); + write(generatedName); + write("."); + emitNodeWithoutSourceMap(specifier.propertyName || specifier.name); + write(";"); + emitEnd(specifier); + } + } + } + else { writeLine(); - emitStart(specifier); - emitContainingModuleName(specifier); - write("."); - emitNodeWithoutSourceMap(specifier.name); - write(" = "); - write(generatedName); - write("."); - emitNodeWithoutSourceMap(specifier.propertyName || specifier.name); + write("__export("); + if (compilerOptions.module !== 2) { + emitRequire(ts.getExternalModuleName(node)); + } + else { + write(generatedName); + } + write(");"); + } + emitEnd(node); + } + } + else { + if (!node.exportClause || resolver.isValueAliasDeclaration(node)) { + emitStart(node); + write("export "); + if (node.exportClause) { + write("{ "); + emitExportOrImportSpecifierList(node.exportClause.elements, resolver.isValueAliasDeclaration); + write(" }"); + } + else { + write("*"); + } + if (node.moduleSpecifier) { + write(" from "); + emitNodeWithoutSourceMap(node.moduleSpecifier); + } + write(";"); + emitEnd(node); + } + } + } + function emitExportOrImportSpecifierList(specifiers, shouldEmit) { + ts.Debug.assert(languageVersion >= 2); + var needsComma = false; + for (var _a = 0; _a < specifiers.length; _a++) { + var specifier = specifiers[_a]; + if (shouldEmit(specifier)) { + if (needsComma) { + write(", "); + } + emitStart(specifier); + if (specifier.propertyName) { + emitNodeWithoutSourceMap(specifier.propertyName); + write(" as "); + } + emitNodeWithoutSourceMap(specifier.name); + emitEnd(specifier); + needsComma = true; + } + } + } + function emitExportAssignment(node) { + if (!node.isExportEquals && resolver.isValueAliasDeclaration(node)) { + if (languageVersion >= 2) { + writeLine(); + emitStart(node); + write("export default "); + var expression = node.expression; + emit(expression); + if (expression.kind !== 200 && expression.kind !== 201) { write(";"); - emitEnd(specifier); - }); + } + emitEnd(node); } else { - var tempName = createTempVariable(node).text; writeLine(); - write("for (var " + tempName + " in " + generatedName + ") if (!"); + emitStart(node); emitContainingModuleName(node); - write(".hasOwnProperty(" + tempName + ")) "); - emitContainingModuleName(node); - write("[" + tempName + "] = " + generatedName + "[" + tempName + "];"); - } - emitEnd(node); - } - } - function createExternalImportInfo(node) { - if (node.kind === 203) { - if (node.moduleReference.kind === 213) { - return { - rootNode: node, - declarationNode: node - }; - } - } - else if (node.kind === 204) { - var importClause = node.importClause; - if (importClause) { - if (importClause.name) { - return { - rootNode: node, - declarationNode: importClause - }; - } - if (importClause.namedBindings.kind === 206) { - return { - rootNode: node, - declarationNode: importClause.namedBindings - }; - } - return { - rootNode: node, - namedImports: importClause.namedBindings, - localName: resolver.getGeneratedNameForNode(node) - }; - } - return { - rootNode: node - }; - } - else if (node.kind === 210) { - if (node.moduleSpecifier) { - return { - rootNode: node - }; + write(".default = "); + emit(node.expression); + write(";"); + emitEnd(node); } } } - function createExternalModuleInfo(sourceFile) { + function collectExternalModuleInfo(sourceFile) { externalImports = []; exportSpecifiers = {}; - exportDefault = undefined; - ts.forEach(sourceFile.statements, function (node) { - if (node.kind === 210 && !node.moduleSpecifier) { - ts.forEach(node.exportClause.elements, function (specifier) { - if (specifier.name.text === "default") { - exportDefault = exportDefault || specifier; + exportEquals = undefined; + hasExportStars = false; + for (var _a = 0, _b = sourceFile.statements; _a < _b.length; _a++) { + var node = _b[_a]; + switch (node.kind) { + case 209: + if (!node.importClause || resolver.isReferencedAliasDeclaration(node.importClause, true)) { + externalImports.push(node); } - var _name = (specifier.propertyName || specifier.name).text; - (exportSpecifiers[_name] || (exportSpecifiers[_name] = [])).push(specifier); - }); - } - else if (node.kind === 209) { - exportDefault = exportDefault || node; - } - else if (node.kind === 195 || node.kind === 196) { - if (node.flags & 1 && node.flags & 256) { - exportDefault = exportDefault || node; - } - } - else { - var info = createExternalImportInfo(node); - if (info) { - if ((!info.declarationNode && !info.namedImports) || resolver.isReferencedAliasDeclaration(node)) { - externalImports.push(info); + break; + case 208: + if (node.moduleReference.kind === 219 && resolver.isReferencedAliasDeclaration(node)) { + externalImports.push(node); } - } - } - }); - } - function getExternalImportInfo(node) { - if (externalImports) { - for (var _i = 0, _n = externalImports.length; _i < _n; _i++) { - var info = externalImports[_i]; - if (info.rootNode === node) { - return info; - } + break; + case 215: + if (node.moduleSpecifier) { + if (!node.exportClause) { + externalImports.push(node); + hasExportStars = true; + } + else if (resolver.isValueAliasDeclaration(node)) { + externalImports.push(node); + } + } + else { + for (var _c = 0, _d = node.exportClause.elements; _c < _d.length; _c++) { + var specifier = _d[_c]; + var name_17 = (specifier.propertyName || specifier.name).text; + (exportSpecifiers[name_17] || (exportSpecifiers[name_17] = [])).push(specifier); + } + } + break; + case 214: + if (node.isExportEquals && !exportEquals) { + exportEquals = node; + } + break; } } } - function getFirstExportAssignment(sourceFile) { - return ts.forEach(sourceFile.statements, function (node) { - if (node.kind === 209) { - return node; - } - }); - } function sortAMDModules(amdModules) { return amdModules.sort(function (moduleA, moduleB) { if (moduleA.name === moduleB.name) { @@ -21395,7 +27624,20 @@ var ts; } }); } + function emitExportStarHelper() { + if (hasExportStars) { + writeLine(); + write("function __export(m) {"); + increaseIndent(); + writeLine(); + write("for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];"); + decreaseIndent(); + writeLine(); + write("}"); + } + } function emitAMDModule(node, startIndex) { + collectExternalModuleInfo(node); writeLine(); write("define("); sortAMDModules(node.amdDependencies); @@ -21403,69 +27645,78 @@ var ts; write("\"" + node.amdModuleName + "\", "); } write("[\"require\", \"exports\""); - ts.forEach(externalImports, function (info) { + for (var _a = 0; _a < externalImports.length; _a++) { + var importNode = externalImports[_a]; write(", "); - var moduleName = ts.getExternalModuleName(info.rootNode); + var moduleName = ts.getExternalModuleName(importNode); if (moduleName.kind === 8) { emitLiteral(moduleName); } else { write("\"\""); } - }); - ts.forEach(node.amdDependencies, function (amdDependency) { + } + for (var _b = 0, _c = node.amdDependencies; _b < _c.length; _b++) { + var amdDependency = _c[_b]; var text = "\"" + amdDependency.path + "\""; write(", "); write(text); - }); + } write("], function (require, exports"); - ts.forEach(externalImports, function (info) { + for (var _d = 0; _d < externalImports.length; _d++) { + var importNode = externalImports[_d]; write(", "); - if (info.declarationNode) { - emit(info.declarationNode.name); + var namespaceDeclaration = getNamespaceDeclarationNode(importNode); + if (namespaceDeclaration && !isDefaultImport(importNode)) { + emit(namespaceDeclaration.name); } else { - write(resolver.getGeneratedNameForNode(info.rootNode)); + write(getGeneratedNameForNode(importNode)); } - }); - ts.forEach(node.amdDependencies, function (amdDependency) { + } + for (var _e = 0, _f = node.amdDependencies; _e < _f.length; _e++) { + var amdDependency = _f[_e]; if (amdDependency.name) { write(", "); write(amdDependency.name); } - }); + } write(") {"); increaseIndent(); + emitExportStarHelper(); emitCaptureThisForNodeIfNecessary(node); emitLinesStartingAt(node.statements, startIndex); emitTempDeclarations(true); - emitExportDefault(node, true); + emitExportEquals(true); decreaseIndent(); writeLine(); write("});"); } function emitCommonJSModule(node, startIndex) { + collectExternalModuleInfo(node); + emitExportStarHelper(); emitCaptureThisForNodeIfNecessary(node); emitLinesStartingAt(node.statements, startIndex); emitTempDeclarations(true); - emitExportDefault(node, false); + emitExportEquals(false); } - function emitExportDefault(sourceFile, emitAsReturn) { - if (exportDefault && resolver.hasExportDefaultValue(sourceFile)) { + function emitES6Module(node, startIndex) { + externalImports = undefined; + exportSpecifiers = undefined; + exportEquals = undefined; + hasExportStars = false; + emitCaptureThisForNodeIfNecessary(node); + emitLinesStartingAt(node.statements, startIndex); + emitTempDeclarations(true); + } + function emitExportEquals(emitAsReturn) { + if (exportEquals && resolver.isValueAliasDeclaration(exportEquals)) { writeLine(); - emitStart(exportDefault); + emitStart(exportEquals); write(emitAsReturn ? "return " : "module.exports = "); - if (exportDefault.kind === 209) { - emit(exportDefault.expression); - } - else if (exportDefault.kind === 212) { - emit(exportDefault.propertyName); - } - else { - emitDeclarationName(exportDefault); - } + emit(exportEquals.expression); write(";"); - emitEnd(exportDefault); + emitEnd(exportEquals); } } function emitDirectivePrologues(statements, startWithNewLine) { @@ -21482,11 +27733,21 @@ var ts; } return statements.length; } + function writeHelper(text) { + var lines = text.split(/\r\n|\r|\n/g); + for (var i = 0; i < lines.length; ++i) { + var line = lines[i]; + if (line.length) { + writeLine(); + write(line); + } + } + } function emitSourceFileNode(node) { writeLine(); emitDetachedComments(node); var startIndex = emitDirectivePrologues(node.statements, false); - if (!extendsEmitted && resolver.getNodeCheckFlags(node) & 8) { + if ((languageVersion < 2) && (!extendsEmitted && resolver.getNodeCheckFlags(node) & 8)) { writeLine(); write("var __extends = this.__extends || function (d, b) {"); increaseIndent(); @@ -21503,9 +27764,15 @@ var ts; write("};"); extendsEmitted = true; } + if (!decorateEmitted && resolver.getNodeCheckFlags(node) & 512) { + writeHelper("\nvar __decorate = this.__decorate || function (decorators, target, key, value) {\n var kind = typeof (arguments.length == 2 ? value = target : value);\n for (var i = decorators.length - 1; i >= 0; --i) {\n var decorator = decorators[i];\n switch (kind) {\n case \"function\": value = decorator(value) || value; break;\n case \"number\": decorator(target, key, value); break;\n case \"undefined\": decorator(target, key); break;\n case \"object\": value = decorator(target, key, value) || value; break;\n }\n }\n return value;\n};"); + decorateEmitted = true; + } if (ts.isExternalModule(node)) { - createExternalModuleInfo(node); - if (compilerOptions.module === 2) { + if (languageVersion >= 2) { + emitES6Module(node, startIndex); + } + else if (compilerOptions.module === 2) { emitAMDModule(node, startIndex); } else { @@ -21515,75 +27782,71 @@ var ts; else { externalImports = undefined; exportSpecifiers = undefined; - exportDefault = undefined; + exportEquals = undefined; + hasExportStars = false; emitCaptureThisForNodeIfNecessary(node); emitLinesStartingAt(node.statements, startIndex); emitTempDeclarations(true); } emitLeadingComments(node.endOfFileToken); } - function emitNodeWithoutSourceMapWithComments(node) { + function emitNodeWithoutSourceMap(node, allowGeneratedIdentifiers) { if (!node) { return; } if (node.flags & 2) { - return emitPinnedOrTripleSlashComments(node); + return emitOnlyPinnedOrTripleSlashComments(node); } - var _emitComments = shouldEmitLeadingAndTrailingComments(node); - if (_emitComments) { + var emitComments = shouldEmitLeadingAndTrailingComments(node); + if (emitComments) { emitLeadingComments(node); } - emitJavaScriptWorker(node); - if (_emitComments) { + emitJavaScriptWorker(node, allowGeneratedIdentifiers); + if (emitComments) { emitTrailingComments(node); } } - function emitNodeWithoutSourceMapWithoutComments(node) { - if (!node) { - return; - } - if (node.flags & 2) { - return emitPinnedOrTripleSlashComments(node); - } - emitJavaScriptWorker(node); - } function shouldEmitLeadingAndTrailingComments(node) { switch (node.kind) { - case 197: - case 195: - case 204: - case 203: - case 198: - case 209: - return false; + case 202: case 200: + case 209: + case 208: + case 203: + case 214: + return false; + case 205: return shouldEmitModuleDeclaration(node); - case 199: + case 204: return shouldEmitEnumDeclaration(node); } + if (node.kind !== 179 && node.parent && node.parent.kind === 163 && node.parent.body === node && compilerOptions.target <= 1) { + return false; + } return true; } - function emitJavaScriptWorker(node) { + function emitJavaScriptWorker(node, allowGeneratedIdentifiers) { + if (allowGeneratedIdentifiers === void 0) { allowGeneratedIdentifiers = true; } switch (node.kind) { - case 64: - return emitIdentifier(node); - case 128: + case 65: + return emitIdentifier(node, allowGeneratedIdentifiers); + case 129: return emitParameter(node); - case 132: - case 131: - return emitMethod(node); case 134: - case 135: + case 133: + return emitMethod(node); + case 136: + case 137: return emitAccessor(node); - case 92: + case 93: return emitThis(node); - case 90: + case 91: return emitSuper(node); - case 88: + case 89: return write("null"); - case 94: + case 95: return write("true"); - case 79: + case 80: return write("false"); case 7: case 8: @@ -21593,125 +27856,129 @@ var ts; case 12: case 13: return emitLiteral(node); - case 169: - return emitTemplateExpression(node); - case 173: - return emitTemplateSpan(node); - case 125: - return emitQualifiedName(node); - case 148: - return emitObjectBindingPattern(node); - case 149: - return emitArrayBindingPattern(node); - case 150: - return emitBindingElement(node); - case 151: - return emitArrayLiteral(node); - case 152: - return emitObjectLiteral(node); - case 218: - return emitPropertyAssignment(node); - case 219: - return emitShorthandPropertyAssignment(node); - case 126: - return emitComputedPropertyName(node); - case 153: - return emitPropertyAccess(node); - case 154: - return emitIndexedAccess(node); - case 155: - return emitCallExpression(node); - case 156: - return emitNewExpression(node); - case 157: - return emitTaggedTemplateExpression(node); - case 158: - return emit(node.expression); - case 159: - return emitParenExpression(node); - case 195: - case 160: - case 161: - return emitFunctionDeclaration(node); - case 162: - return emitDeleteExpression(node); - case 163: - return emitTypeOfExpression(node); - case 164: - return emitVoidExpression(node); - case 165: - return emitPrefixUnaryExpression(node); - case 166: - return emitPostfixUnaryExpression(node); - case 167: - return emitBinaryExpression(node); - case 168: - return emitConditionalExpression(node); case 171: - return emitSpreadElementExpression(node); - case 172: - return; - case 174: - case 201: - return emitBlock(node); - case 175: - return emitVariableStatement(node); + return emitTemplateExpression(node); case 176: - return write(";"); - case 177: - return emitExpressionStatement(node); - case 178: - return emitIfStatement(node); - case 179: - return emitDoStatement(node); - case 180: - return emitWhileStatement(node); - case 181: - return emitForStatement(node); - case 183: - case 182: - return emitForInOrForOfStatement(node); - case 184: - case 185: - return emitBreakOrContinueStatement(node); - case 186: - return emitReturnStatement(node); - case 187: - return emitWithStatement(node); - case 188: - return emitSwitchStatement(node); - case 214: - case 215: - return emitCaseOrDefaultClause(node); - case 189: - return emitLabelledStatement(node); - case 190: - return emitThrowStatement(node); - case 191: - return emitTryStatement(node); - case 217: - return emitCatchClause(node); - case 192: - return emitDebuggerStatement(node); - case 193: - return emitVariableDeclaration(node); - case 196: - return emitClassDeclaration(node); - case 197: - return emitInterfaceDeclaration(node); - case 199: - return emitEnumDeclaration(node); - case 220: - return emitEnumMember(node); + 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: - return emitModuleDeclaration(node); - case 204: - return emitImportDeclaration(node); - case 203: - return emitImportEqualsDeclaration(node); - case 210: - return emitExportDeclaration(node); + 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 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); + case 226: + return emitEnumMember(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); + case 227: return emitSourceFileNode(node); } } @@ -21728,34 +27995,50 @@ var ts; } return leadingComments; } + function filterComments(ranges, onlyPinnedOrTripleSlashComments) { + if (ranges && onlyPinnedOrTripleSlashComments) { + ranges = ts.filter(ranges, isPinnedOrTripleSlashComment); + if (ranges.length === 0) { + return undefined; + } + } + return ranges; + } function getLeadingCommentsToEmit(node) { if (node.parent) { - if (node.parent.kind === 221 || node.pos !== node.parent.pos) { - var leadingComments; + if (node.parent.kind === 227 || node.pos !== node.parent.pos) { if (hasDetachedComments(node.pos)) { - leadingComments = getLeadingCommentsWithoutDetachedComments(); + return getLeadingCommentsWithoutDetachedComments(); } else { - leadingComments = ts.getLeadingCommentRangesOfNode(node, currentSourceFile); + return ts.getLeadingCommentRangesOfNode(node, currentSourceFile); } - return leadingComments; } } } - function emitLeadingDeclarationComments(node) { - var leadingComments = getLeadingCommentsToEmit(node); - emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); - emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); - } - function emitTrailingDeclarationComments(node) { + function getTrailingCommentsToEmit(node) { if (node.parent) { - if (node.parent.kind === 221 || node.end !== node.parent.end) { - var trailingComments = ts.getTrailingCommentRanges(currentSourceFile.text, node.end); - emitComments(currentSourceFile, writer, trailingComments, false, newLine, writeComment); + if (node.parent.kind === 227 || node.end !== node.parent.end) { + return ts.getTrailingCommentRanges(currentSourceFile.text, node.end); } } } - function emitLeadingCommentsOfLocalPosition(pos) { + function emitOnlyPinnedOrTripleSlashComments(node) { + emitLeadingCommentsWorker(node, true); + } + function emitLeadingComments(node) { + return emitLeadingCommentsWorker(node, compilerOptions.removeComments); + } + function emitLeadingCommentsWorker(node, onlyPinnedOrTripleSlashComments) { + var leadingComments = filterComments(getLeadingCommentsToEmit(node), onlyPinnedOrTripleSlashComments); + ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); + ts.emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); + } + function emitTrailingComments(node) { + var trailingComments = filterComments(getTrailingCommentsToEmit(node), compilerOptions.removeComments); + ts.emitComments(currentSourceFile, writer, trailingComments, false, newLine, writeComment); + } + function emitLeadingCommentsOfPosition(pos) { var leadingComments; if (hasDetachedComments(pos)) { leadingComments = getLeadingCommentsWithoutDetachedComments(); @@ -21763,18 +28046,22 @@ var ts; else { leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, pos); } - emitNewLineBeforeLeadingComments(currentSourceFile, writer, { pos: pos, end: pos }, leadingComments); - emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); + leadingComments = filterComments(leadingComments, compilerOptions.removeComments); + ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, { + pos: pos, + end: pos + }, leadingComments); + ts.emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); } - function emitDetachedCommentsAtPosition(node) { + function emitDetachedComments(node) { var leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, node.pos); if (leadingComments) { var detachedComments = []; var lastComment; ts.forEach(leadingComments, function (comment) { if (lastComment) { - var lastCommentLine = getLineOfLocalPosition(currentSourceFile, lastComment.end); - var commentLine = getLineOfLocalPosition(currentSourceFile, comment.pos); + var lastCommentLine = ts.getLineOfLocalPosition(currentSourceFile, lastComment.end); + var commentLine = ts.getLineOfLocalPosition(currentSourceFile, comment.pos); if (commentLine >= lastCommentLine + 2) { return detachedComments; } @@ -21783,70 +28070,71 @@ var ts; lastComment = comment; }); if (detachedComments.length) { - var lastCommentLine = getLineOfLocalPosition(currentSourceFile, detachedComments[detachedComments.length - 1].end); - var nodeLine = getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node.pos)); + var lastCommentLine = ts.getLineOfLocalPosition(currentSourceFile, detachedComments[detachedComments.length - 1].end); + var nodeLine = ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node.pos)); if (nodeLine >= lastCommentLine + 2) { - emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); - emitComments(currentSourceFile, writer, detachedComments, true, newLine, writeComment); - var currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: detachedComments[detachedComments.length - 1].end }; + 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 + }; if (detachedCommentsInfo) { detachedCommentsInfo.push(currentDetachedCommentInfo); } else { - detachedCommentsInfo = [currentDetachedCommentInfo]; + detachedCommentsInfo = [ + currentDetachedCommentInfo + ]; } } } } } - function emitPinnedOrTripleSlashComments(node) { - var pinnedComments = ts.filter(getLeadingCommentsToEmit(node), isPinnedOrTripleSlashComment); - function isPinnedOrTripleSlashComment(comment) { - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42) { - return currentSourceFile.text.charCodeAt(comment.pos + 2) === 33; - } - else if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 47 && - comment.pos + 2 < comment.end && - currentSourceFile.text.charCodeAt(comment.pos + 2) === 47 && - currentSourceFile.text.substring(comment.pos, comment.end).match(ts.fullTripleSlashReferencePathRegEx)) { - return true; - } + function isPinnedOrTripleSlashComment(comment) { + if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42) { + return currentSourceFile.text.charCodeAt(comment.pos + 2) === 33; + } + else if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 47 && comment.pos + 2 < comment.end && currentSourceFile.text.charCodeAt(comment.pos + 2) === 47 && currentSourceFile.text.substring(comment.pos, comment.end).match(ts.fullTripleSlashReferencePathRegEx)) { + return true; } - emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, pinnedComments); - emitComments(currentSourceFile, writer, pinnedComments, true, newLine, writeComment); - } - } - function writeDeclarationFile(jsFilePath, sourceFile) { - var emitDeclarationResult = emitDeclarations(host, resolver, diagnostics, jsFilePath, sourceFile); - if (!emitDeclarationResult.reportedDeclarationError) { - var declarationOutput = emitDeclarationResult.referencePathsOutput; - var appliedSyncOutputPos = 0; - ts.forEach(emitDeclarationResult.aliasDeclarationEmitInfo, function (aliasEmitInfo) { - if (aliasEmitInfo.asynchronousOutput) { - declarationOutput += emitDeclarationResult.synchronousDeclarationOutput.substring(appliedSyncOutputPos, aliasEmitInfo.outputPos); - declarationOutput += aliasEmitInfo.asynchronousOutput; - appliedSyncOutputPos = aliasEmitInfo.outputPos; - } - }); - declarationOutput += emitDeclarationResult.synchronousDeclarationOutput.substring(appliedSyncOutputPos); - writeFile(host, diagnostics, ts.removeFileExtension(jsFilePath) + ".d.ts", declarationOutput, compilerOptions.emitBOM); } } function emitFile(jsFilePath, sourceFile) { emitJavaScript(jsFilePath, sourceFile); if (compilerOptions.declaration) { - writeDeclarationFile(jsFilePath, sourceFile); + ts.writeDeclarationFile(jsFilePath, sourceFile, host, resolver, diagnostics); } } } ts.emitFiles = emitFiles; })(ts || (ts = {})); +/// +/// var ts; (function (ts) { + ts.programTime = 0; ts.emitTime = 0; ts.ioReadTime = 0; - ts.version = "1.5.0.0"; - function createCompilerHost(options) { + ts.ioWriteTime = 0; + ts.version = "1.5.0"; + function findConfigFile(searchPath) { + var fileName = "tsconfig.json"; + while (true) { + if (ts.sys.fileExists(fileName)) { + return fileName; + } + var parentPath = ts.getDirectoryPath(searchPath); + if (parentPath === searchPath) { + break; + } + searchPath = parentPath; + fileName = "../" + fileName; + } + return undefined; + } + ts.findConfigFile = findConfigFile; + function createCompilerHost(options, setParentNodes) { var currentDirectory; var existingDirectories = {}; function getCanonicalFileName(fileName) { @@ -21862,35 +28150,35 @@ var ts; } catch (e) { if (onError) { - onError(e.number === unsupportedFileEncodingErrorCode - ? ts.createCompilerDiagnostic(ts.Diagnostics.Unsupported_file_encoding).messageText - : e.message); + onError(e.number === unsupportedFileEncodingErrorCode ? ts.createCompilerDiagnostic(ts.Diagnostics.Unsupported_file_encoding).messageText : e.message); } text = ""; } - return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion) : undefined; + return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion, setParentNodes) : undefined; + } + function directoryExists(directoryPath) { + if (ts.hasProperty(existingDirectories, directoryPath)) { + return true; + } + if (ts.sys.directoryExists(directoryPath)) { + existingDirectories[directoryPath] = true; + return true; + } + return false; + } + function ensureDirectoriesExist(directoryPath) { + if (directoryPath.length > ts.getRootLength(directoryPath) && !directoryExists(directoryPath)) { + var parentDirectory = ts.getDirectoryPath(directoryPath); + ensureDirectoriesExist(parentDirectory); + ts.sys.createDirectory(directoryPath); + } } function writeFile(fileName, data, writeByteOrderMark, onError) { - function directoryExists(directoryPath) { - if (ts.hasProperty(existingDirectories, directoryPath)) { - return true; - } - if (ts.sys.directoryExists(directoryPath)) { - existingDirectories[directoryPath] = true; - return true; - } - return false; - } - function ensureDirectoriesExist(directoryPath) { - if (directoryPath.length > ts.getRootLength(directoryPath) && !directoryExists(directoryPath)) { - var parentDirectory = ts.getDirectoryPath(directoryPath); - ensureDirectoriesExist(parentDirectory); - ts.sys.createDirectory(directoryPath); - } - } try { + var start = new Date().getTime(); ensureDirectoriesExist(ts.getDirectoryPath(ts.normalizePath(fileName))); ts.sys.writeFile(fileName, data, writeByteOrderMark); + ts.ioWriteTime += new Date().getTime() - start; } catch (e) { if (onError) { @@ -21900,17 +28188,28 @@ var ts; } return { getSourceFile: getSourceFile, - getDefaultLibFileName: function (options) { return ts.combinePaths(ts.getDirectoryPath(ts.normalizePath(ts.sys.getExecutingFilePath())), ts.getDefaultLibFileName(options)); }, + getDefaultLibFileName: function (options) { + return ts.combinePaths(ts.getDirectoryPath(ts.normalizePath(ts.sys.getExecutingFilePath())), ts.getDefaultLibFileName(options)); + }, writeFile: writeFile, - getCurrentDirectory: function () { return currentDirectory || (currentDirectory = ts.sys.getCurrentDirectory()); }, - useCaseSensitiveFileNames: function () { return ts.sys.useCaseSensitiveFileNames; }, + 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 ts.sys.newLine; + } }; } ts.createCompilerHost = createCompilerHost; function getPreEmitDiagnostics(program) { var diagnostics = program.getSyntacticDiagnostics().concat(program.getGlobalDiagnostics()).concat(program.getSemanticDiagnostics()); + if (program.getCompilerOptions().declaration) { + diagnostics.concat(program.getDeclarationDiagnostics()); + } return ts.sortAndDeduplicateDiagnostics(diagnostics); } ts.getPreEmitDiagnostics = getPreEmitDiagnostics; @@ -21944,31 +28243,49 @@ var ts; var diagnostics = ts.createDiagnosticCollection(); var seenNoDefaultLib = options.noLib; var commonSourceDirectory; + var diagnosticsProducingTypeChecker; + var noDiagnosticsTypeChecker; + var start = new Date().getTime(); host = host || createCompilerHost(options); - ts.forEach(rootNames, function (name) { return processRootFile(name, false); }); + ts.forEach(rootNames, function (name) { + return processRootFile(name, false); + }); if (!seenNoDefaultLib) { processRootFile(host.getDefaultLibFileName(options), true); } verifyCompilerOptions(); - var diagnosticsProducingTypeChecker; - var noDiagnosticsTypeChecker; + ts.programTime += new Date().getTime() - start; program = { getSourceFile: getSourceFile, - getSourceFiles: function () { return files; }, - getCompilerOptions: function () { return options; }, + getSourceFiles: function () { + return files; + }, + getCompilerOptions: function () { + return options; + }, getSyntacticDiagnostics: getSyntacticDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, getSemanticDiagnostics: getSemanticDiagnostics, getDeclarationDiagnostics: getDeclarationDiagnostics, getTypeChecker: getTypeChecker, getDiagnosticsProducingTypeChecker: getDiagnosticsProducingTypeChecker, - getCommonSourceDirectory: function () { return commonSourceDirectory; }, + getCommonSourceDirectory: function () { + return commonSourceDirectory; + }, emit: emit, getCurrentDirectory: host.getCurrentDirectory, - getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); }, - getIdentifierCount: function () { return getDiagnosticsProducingTypeChecker().getIdentifierCount(); }, - getSymbolCount: function () { return getDiagnosticsProducingTypeChecker().getSymbolCount(); }, - getTypeCount: function () { return getDiagnosticsProducingTypeChecker().getTypeCount(); } + getNodeCount: function () { + return getDiagnosticsProducingTypeChecker().getNodeCount(); + }, + getIdentifierCount: function () { + return getDiagnosticsProducingTypeChecker().getIdentifierCount(); + }, + getSymbolCount: function () { + return getDiagnosticsProducingTypeChecker().getSymbolCount(); + }, + getTypeCount: function () { + return getDiagnosticsProducingTypeChecker().getTypeCount(); + } }; return program; function getEmitHost(writeFileCallback) { @@ -21989,13 +28306,13 @@ var ts; function getTypeChecker() { return noDiagnosticsTypeChecker || (noDiagnosticsTypeChecker = ts.createTypeChecker(program, false)); } - function getDeclarationDiagnostics(targetSourceFile) { - var resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(targetSourceFile); - return ts.getDeclarationDiagnostics(getEmitHost(), resolver, targetSourceFile); - } function emit(sourceFile, writeFileCallback) { if (options.noEmitOnError && getPreEmitDiagnostics(this).length > 0) { - return { diagnostics: [], sourceMaps: undefined, emitSkipped: true }; + return { + diagnostics: [], + sourceMaps: undefined, + emitSkipped: true + }; } var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile); var start = new Date().getTime(); @@ -22023,6 +28340,9 @@ var ts; function getSemanticDiagnostics(sourceFile) { return getDiagnosticsHelper(sourceFile, getSemanticDiagnosticsForFile); } + function getDeclarationDiagnostics(sourceFile) { + return getDiagnosticsHelper(sourceFile, getDeclarationDiagnosticsForFile); + } function getSyntacticDiagnosticsForFile(sourceFile) { return sourceFile.parseDiagnostics; } @@ -22034,6 +28354,14 @@ var ts; var programDiagnostics = diagnostics.getDiagnostics(sourceFile.fileName); return bindDiagnostics.concat(checkDiagnostics).concat(programDiagnostics); } + function getDeclarationDiagnosticsForFile(sourceFile) { + if (!ts.isDeclarationFile(sourceFile)) { + var resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile); + var writeFile = function () { + }; + return ts.getDeclarationDiagnostics(getEmitHost(writeFile), resolver, sourceFile); + } + } function getGlobalDiagnostics() { var typeChecker = getDiagnosticsProducingTypeChecker(); var allDiagnostics = []; @@ -22049,10 +28377,10 @@ var ts; } function processSourceFile(fileName, isDefaultLib, refFile, refPos, refEnd) { var start; - var _length; + var length; if (refEnd !== undefined && refPos !== undefined) { start = refPos; - _length = refEnd - refPos; + length = refEnd - refPos; } var diagnostic; if (hasExtension(fileName)) { @@ -22077,7 +28405,7 @@ var ts; } if (diagnostic) { if (refFile) { - diagnostics.add(ts.createFileDiagnostic(refFile, start, _length, diagnostic, fileName)); + diagnostics.add(ts.createFileDiagnostic(refFile, start, length, diagnostic, fileName)); } else { diagnostics.add(ts.createCompilerDiagnostic(diagnostic, fileName)); @@ -22121,14 +28449,14 @@ var ts; return file; } function getSourceFileFromCache(fileName, canonicalName, useAbsolutePath) { - var _file = filesByName[canonicalName]; - if (_file && host.useCaseSensitiveFileNames()) { - var sourceFileName = useAbsolutePath ? ts.getNormalizedAbsolutePath(_file.fileName, host.getCurrentDirectory()) : _file.fileName; + var file = filesByName[canonicalName]; + if (file && host.useCaseSensitiveFileNames()) { + var sourceFileName = useAbsolutePath ? ts.getNormalizedAbsolutePath(file.fileName, host.getCurrentDirectory()) : file.fileName; if (canonicalName !== sourceFileName) { diagnostics.add(ts.createFileDiagnostic(refFile, refStart, refLength, ts.Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, fileName, sourceFileName)); } } - return _file; + return file; } } function processReferencedFiles(file, basePath) { @@ -22139,7 +28467,7 @@ var ts; } function processImportedModules(file, basePath) { ts.forEach(file.statements, function (node) { - if (node.kind === 204 || node.kind === 203 || node.kind === 210) { + if (node.kind === 209 || node.kind === 208 || node.kind === 215) { var moduleNameExpr = ts.getExternalModuleName(node); if (moduleNameExpr && moduleNameExpr.kind === 8) { var moduleNameText = moduleNameExpr.text; @@ -22159,17 +28487,16 @@ var ts; } } } - else if (node.kind === 200 && node.name.kind === 8 && (node.flags & 2 || ts.isDeclarationFile(file))) { + else if (node.kind === 205 && 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) { + if (ts.isExternalModuleImportEqualsDeclaration(node) && ts.getExternalModuleImportEqualsDeclarationExpression(node).kind === 8) { var nameLiteral = ts.getExternalModuleImportEqualsDeclarationExpression(node); var moduleName = nameLiteral.text; if (moduleName) { - var _searchName = ts.normalizePath(ts.combinePaths(basePath, moduleName)); - var tsFile = findModuleSourceFile(_searchName + ".ts", nameLiteral); + var searchName = ts.normalizePath(ts.combinePaths(basePath, moduleName)); + var tsFile = findModuleSourceFile(searchName + ".ts", nameLiteral); if (!tsFile) { - findModuleSourceFile(_searchName + ".d.ts", nameLiteral); + findModuleSourceFile(searchName + ".d.ts", nameLiteral); } } } @@ -22181,6 +28508,20 @@ var ts; } } function verifyCompilerOptions() { + if (options.separateCompilation) { + if (options.sourceMap) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_sourceMap_cannot_be_specified_with_option_separateCompilation)); + } + if (options.declaration) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_declaration_cannot_be_specified_with_option_separateCompilation)); + } + if (options.noEmitOnError) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_noEmitOnError_cannot_be_specified_with_option_separateCompilation)); + } + if (options.out) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_out_cannot_be_specified_with_option_separateCompilation)); + } + } 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)); @@ -22190,19 +28531,33 @@ var ts; } return; } - var firstExternalModuleSourceFile = ts.forEach(files, function (f) { return ts.isExternalModule(f) ? f : undefined; }); - if (firstExternalModuleSourceFile && !options.module) { + var languageVersion = options.target || 0; + var firstExternalModuleSourceFile = ts.forEach(files, function (f) { + return ts.isExternalModule(f) ? f : undefined; + }); + if (options.separateCompilation) { + if (!options.module && languageVersion < 2) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_separateCompilation_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher)); + } + 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)); + } + } + 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)); } - if (options.outDir || - options.sourceRoot || - (options.mapRoot && - (!options.out || firstExternalModuleSourceFile !== undefined))) { + if (options.module && languageVersion >= 2) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher)); + } + if (options.outDir || options.sourceRoot || (options.mapRoot && (!options.out || firstExternalModuleSourceFile !== undefined))) { var commonPathComponents; ts.forEach(files, function (sourceFile) { - if (!(sourceFile.flags & 2048) - && !ts.fileExtensionIs(sourceFile.fileName, ".js")) { + if (!(sourceFile.flags & 2048) && !ts.fileExtensionIs(sourceFile.fileName, ".js")) { var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile.fileName, host.getCurrentDirectory()); sourcePathComponents.pop(); if (commonPathComponents) { @@ -22242,6 +28597,10 @@ var ts; } ts.createProgram = createProgram; })(ts || (ts = {})); +/// +/// +/// +/// var ts; (function (ts) { ts.optionDeclarations = [ @@ -22249,10 +28608,6 @@ var ts; name: "charset", type: "string" }, - { - name: "codepage", - type: "number" - }, { name: "declaration", shortName: "d", @@ -22318,10 +28673,6 @@ var ts; name: "noLib", type: "boolean" }, - { - name: "noLibCheck", - type: "boolean" - }, { name: "noResolve", type: "boolean" @@ -22357,6 +28708,10 @@ var ts; type: "boolean", description: ts.Diagnostics.Do_not_emit_comments_to_output }, + { + name: "separateCompilation", + type: "boolean" + }, { name: "sourceMap", type: "boolean", @@ -22380,22 +28735,14 @@ var ts; description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, experimental: true }, - { - name: "preserveNewLines", - type: "boolean", - description: ts.Diagnostics.Preserve_new_lines_when_emitting_code, - experimental: true - }, - { - name: "cacheDownlevelForOfLength", - type: "boolean", - description: "Cache length access when downlevel emitting for-of statements", - experimental: true - }, { name: "target", shortName: "t", - type: { "es3": 0, "es5": 1, "es6": 2 }, + 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 @@ -22575,7 +28922,9 @@ var ts; var files = []; if (ts.hasProperty(json, "files")) { if (json["files"] instanceof Array) { - var files = ts.map(json["files"], function (s) { return ts.combinePaths(basePath, s); }); + var files = ts.map(json["files"], function (s) { + return ts.combinePaths(basePath, s); + }); } } else { @@ -22592,6 +28941,8 @@ var ts; } ts.parseConfigFile = parseConfigFile; })(ts || (ts = {})); +/// +/// var ts; (function (ts) { function validateLocaleAndSetLanguage(locale, errors) { @@ -22602,8 +28953,7 @@ var ts; } var language = matchResult[1]; var territory = matchResult[3]; - if (!trySetLanguageAndTerritory(language, territory, errors) && - !trySetLanguageAndTerritory(language, undefined, errors)) { + if (!trySetLanguageAndTerritory(language, territory, errors) && !trySetLanguageAndTerritory(language, undefined, errors)) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unsupported_locale_0, locale)); return false; } @@ -22690,22 +29040,6 @@ var ts; function isJSONSupported() { return typeof JSON === "object" && typeof JSON.parse === "function"; } - function findConfigFile() { - var searchPath = ts.normalizePath(ts.sys.getCurrentDirectory()); - var fileName = "tsconfig.json"; - while (true) { - if (ts.sys.fileExists(fileName)) { - return fileName; - } - var parentPath = ts.getDirectoryPath(searchPath); - if (parentPath === searchPath) { - break; - } - searchPath = parentPath; - fileName = "../" + fileName; - } - return undefined; - } function executeCommandLine(args) { var commandLine = ts.parseCommandLine(args); var configFileName; @@ -22719,46 +29053,47 @@ var ts; if (commandLine.options.locale) { if (!isJSONSupported()) { reportDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.The_current_host_does_not_support_the_0_option, "--locale")); - return ts.sys.exit(1); + return ts.sys.exit(ts.ExitStatus.DiagnosticsPresent_OutputsSkipped); } validateLocaleAndSetLanguage(commandLine.options.locale, commandLine.errors); } if (commandLine.errors.length > 0) { reportDiagnostics(commandLine.errors); - return ts.sys.exit(1); + return ts.sys.exit(ts.ExitStatus.DiagnosticsPresent_OutputsSkipped); } if (commandLine.options.version) { reportDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.Version_0, ts.version)); - return ts.sys.exit(0); + return ts.sys.exit(ts.ExitStatus.Success); } if (commandLine.options.help) { printVersion(); printHelp(); - return ts.sys.exit(0); + return ts.sys.exit(ts.ExitStatus.Success); } if (commandLine.options.project) { if (!isJSONSupported()) { reportDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.The_current_host_does_not_support_the_0_option, "--project")); - return ts.sys.exit(1); + return ts.sys.exit(ts.ExitStatus.DiagnosticsPresent_OutputsSkipped); } configFileName = ts.normalizePath(ts.combinePaths(commandLine.options.project, "tsconfig.json")); if (commandLine.fileNames.length !== 0) { reportDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.Option_project_cannot_be_mixed_with_source_files_on_a_command_line)); - return ts.sys.exit(1); + return ts.sys.exit(ts.ExitStatus.DiagnosticsPresent_OutputsSkipped); } } else if (commandLine.fileNames.length === 0 && isJSONSupported()) { - configFileName = findConfigFile(); + var searchPath = ts.normalizePath(ts.sys.getCurrentDirectory()); + configFileName = ts.findConfigFile(searchPath); } if (commandLine.fileNames.length === 0 && !configFileName) { printVersion(); printHelp(); - return ts.sys.exit(0); + return ts.sys.exit(ts.ExitStatus.Success); } if (commandLine.options.watch) { if (!ts.sys.watchFile) { reportDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.The_current_host_does_not_support_the_0_option, "--watch")); - return ts.sys.exit(1); + return ts.sys.exit(ts.ExitStatus.DiagnosticsPresent_OutputsSkipped); } if (configFileName) { configFileWatcher = ts.sys.watchFile(configFileName, configFileChanged); @@ -22771,12 +29106,12 @@ var ts; var configObject = ts.readConfigFile(configFileName); if (!configObject) { reportDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.Unable_to_open_file_0, configFileName)); - return ts.sys.exit(1); + return ts.sys.exit(ts.ExitStatus.DiagnosticsPresent_OutputsSkipped); } var configParseResult = ts.parseConfigFile(configObject, ts.getDirectoryPath(configFileName)); if (configParseResult.errors.length > 0) { reportDiagnostics(configParseResult.errors); - return ts.sys.exit(1); + return ts.sys.exit(ts.ExitStatus.DiagnosticsPresent_OutputsSkipped); } rootFileNames = configParseResult.fileNames; compilerOptions = ts.extend(commandLine.options, configParseResult.options); @@ -22805,7 +29140,9 @@ var ts; } var sourceFile = hostGetSourceFile(fileName, languageVersion, onError); if (sourceFile && compilerOptions.watch) { - sourceFile.fileWatcher = ts.sys.watchFile(sourceFile.fileName, function () { return sourceFileChanged(sourceFile); }); + sourceFile.fileWatcher = ts.sys.watchFile(sourceFile.fileName, function () { + return sourceFileChanged(sourceFile); + }); } return sourceFile; } @@ -22824,6 +29161,7 @@ var ts; cachedProgram = program; } function sourceFileChanged(sourceFile) { + sourceFile.fileWatcher.close(); sourceFile.fileWatcher = undefined; startTimer(); } @@ -22846,16 +29184,13 @@ var ts; ts.executeCommandLine = executeCommandLine; function compile(fileNames, compilerOptions, compilerHost) { ts.ioReadTime = 0; - ts.parseTime = 0; + ts.ioWriteTime = 0; + ts.programTime = 0; ts.bindTime = 0; ts.checkTime = 0; ts.emitTime = 0; - var start = new Date().getTime(); var program = ts.createProgram(fileNames, compilerOptions, compilerHost); - var programTime = new Date().getTime() - start; var exitStatus = compileProgram(); - var end = new Date().getTime() - start; - var compileTime = end - programTime; if (compilerOptions.listFiles) { ts.forEach(program.getSourceFiles(), function (file) { ts.sys.write(file.fileName + ts.sys.newLine); @@ -22872,16 +29207,18 @@ var ts; if (memoryUsed >= 0) { reportStatisticalValue("Memory used", Math.round(memoryUsed / 1000) + "K"); } - reportTimeStatistic("Parse time", programTime); + reportTimeStatistic("I/O read", ts.ioReadTime); + reportTimeStatistic("I/O write", ts.ioWriteTime); + reportTimeStatistic("Parse time", ts.programTime); reportTimeStatistic("Bind time", ts.bindTime); reportTimeStatistic("Check time", ts.checkTime); reportTimeStatistic("Emit time", ts.emitTime); - reportTimeStatistic("Parse time w/o IO", ts.parseTime); - reportTimeStatistic("IO read", ts.ioReadTime); - reportTimeStatistic("Compile time", compileTime); - reportTimeStatistic("Total time", end); + reportTimeStatistic("Total time", ts.programTime + ts.bindTime + ts.checkTime + ts.emitTime); } - return { program: program, exitStatus: exitStatus }; + return { + program: program, + exitStatus: exitStatus + }; function compileProgram() { var diagnostics = program.getSyntacticDiagnostics(); reportDiagnostics(diagnostics); @@ -22894,19 +29231,17 @@ var ts; } } if (compilerOptions.noEmit) { - return diagnostics.length - ? 1 - : 0; + return diagnostics.length ? ts.ExitStatus.DiagnosticsPresent_OutputsSkipped : ts.ExitStatus.Success; } var emitOutput = program.emit(); reportDiagnostics(emitOutput.diagnostics); if (emitOutput.emitSkipped) { - return 1; + return ts.ExitStatus.DiagnosticsPresent_OutputsSkipped; } if (diagnostics.length > 0 || emitOutput.diagnostics.length > 0) { - return 2; + return ts.ExitStatus.DiagnosticsPresent_OutputsGenerated; } - return 0; + return ts.ExitStatus.Success; } } function printVersion() { @@ -22927,8 +29262,12 @@ var ts; output += padding + "tsc @args.txt" + ts.sys.newLine; output += ts.sys.newLine; output += getDiagnosticText(ts.Diagnostics.Options_Colon) + ts.sys.newLine; - var optsList = ts.filter(ts.optionDeclarations.slice(), function (v) { return !v.experimental; }); - optsList.sort(function (a, b) { return ts.compareValues(a.name.toLowerCase(), b.name.toLowerCase()); }); + var optsList = ts.filter(ts.optionDeclarations.slice(), function (v) { + return !v.experimental; + }); + optsList.sort(function (a, b) { + return ts.compareValues(a.name.toLowerCase(), b.name.toLowerCase()); + }); var marginLength = 0; var usageColumn = []; var descriptionColumn = []; diff --git a/bin/tsserver.js b/bin/tsserver.js index 44075b1f778..e7cd07fc7a8 100644 --- a/bin/tsserver.js +++ b/bin/tsserver.js @@ -28,6 +28,7 @@ var ts; })(ts.DiagnosticCategory || (ts.DiagnosticCategory = {})); var DiagnosticCategory = ts.DiagnosticCategory; })(ts || (ts = {})); +/// var ts; (function (ts) { function forEach(array, callback) { @@ -44,7 +45,7 @@ var ts; ts.forEach = forEach; function contains(array, value) { if (array) { - for (var _i = 0, _n = array.length; _i < _n; _i++) { + for (var _i = 0; _i < array.length; _i++) { var v = array[_i]; if (v === value) { return true; @@ -68,7 +69,7 @@ var ts; function countWhere(array, predicate) { var count = 0; if (array) { - for (var _i = 0, _n = array.length; _i < _n; _i++) { + for (var _i = 0; _i < array.length; _i++) { var v = array[_i]; if (predicate(v)) { count++; @@ -82,10 +83,10 @@ var ts; var result; if (array) { result = []; - for (var _i = 0, _n = array.length; _i < _n; _i++) { - var _item = array[_i]; - if (f(_item)) { - result.push(_item); + for (var _i = 0; _i < array.length; _i++) { + var item_1 = array[_i]; + if (f(item_1)) { + result.push(item_1); } } } @@ -96,7 +97,7 @@ var ts; var result; if (array) { result = []; - for (var _i = 0, _n = array.length; _i < _n; _i++) { + for (var _i = 0; _i < array.length; _i++) { var v = array[_i]; result.push(f(v)); } @@ -116,10 +117,10 @@ var ts; var result; if (array) { result = []; - for (var _i = 0, _n = array.length; _i < _n; _i++) { - var _item = array[_i]; - if (!contains(result, _item)) { - result.push(_item); + for (var _i = 0; _i < array.length; _i++) { + var item_2 = array[_i]; + if (!contains(result, item_2)) { + result.push(item_2); } } } @@ -128,7 +129,7 @@ var ts; ts.deduplicate = deduplicate; function sum(array, prop) { var result = 0; - for (var _i = 0, _n = array.length; _i < _n; _i++) { + for (var _i = 0; _i < array.length; _i++) { var v = array[_i]; result += v[prop]; } @@ -136,9 +137,11 @@ var ts; } ts.sum = sum; function addRange(to, from) { - for (var _i = 0, _n = from.length; _i < _n; _i++) { - var v = from[_i]; - to.push(v); + if (to && from) { + for (var _i = 0; _i < from.length; _i++) { + var v = from[_i]; + to.push(v); + } } } ts.addRange = addRange; @@ -168,6 +171,35 @@ var ts; return ~low; } ts.binarySearch = binarySearch; + function reduceLeft(array, f, initial) { + if (array) { + var count = array.length; + if (count > 0) { + var pos = 0; + var result = arguments.length <= 2 ? array[pos++] : initial; + while (pos < count) { + result = f(result, array[pos++]); + } + return result; + } + } + return initial; + } + ts.reduceLeft = reduceLeft; + function reduceRight(array, f, initial) { + if (array) { + var pos = array.length - 1; + if (pos >= 0) { + var result = arguments.length <= 2 ? array[pos--] : initial; + while (pos >= 0) { + result = f(result, array[pos--]); + } + return result; + } + } + return initial; + } + ts.reduceRight = reduceRight; var hasOwnProperty = Object.prototype.hasOwnProperty; function hasProperty(map, key) { return hasOwnProperty.call(map, key); @@ -199,9 +231,9 @@ var ts; for (var id in first) { result[id] = first[id]; } - for (var _id in second) { - if (!hasProperty(result, _id)) { - result[_id] = second[_id]; + for (var id in second) { + if (!hasProperty(result, id)) { + result[id] = second[id]; } } return result; @@ -229,14 +261,6 @@ var ts; return hasProperty(map, key) ? map[key] : undefined; } ts.lookUp = lookUp; - function mapToArray(map) { - var result = []; - for (var id in map) { - result.push(map[id]); - } - return result; - } - ts.mapToArray = mapToArray; function copyMap(source, target) { for (var p in source) { target[p] = source[p]; @@ -403,7 +427,7 @@ var ts; function getNormalizedParts(normalizedSlashedPath, rootLength) { var parts = normalizedSlashedPath.substr(rootLength).split(ts.directorySeparator); var normalized = []; - for (var _i = 0, _n = parts.length; _i < _n; _i++) { + for (var _i = 0; _i < parts.length; _i++) { var part = parts[_i]; if (part !== ".") { if (part === ".." && normalized.length > 0 && normalized[normalized.length - 1] !== "..") { @@ -462,6 +486,9 @@ var ts; } ts.getNormalizedPathFromPathComponents = getNormalizedPathFromPathComponents; function getNormalizedPathComponentsOfUrl(url) { + // Get root length of http://www.website.com/folder1/foler2/ + // In this example the root is: http://www.website.com/ + // normalized path components should be ["http://www.website.com/", "folder1", "folder2"] var urlLength = url.length; var rootLength = url.indexOf("://") + "://".length; while (rootLength < urlLength) { @@ -545,7 +572,7 @@ var ts; ts.fileExtensionIs = fileExtensionIs; var supportedExtensions = [".d.ts", ".ts", ".js"]; function removeFileExtension(path) { - for (var _i = 0, _n = supportedExtensions.length; _i < _n; _i++) { + for (var _i = 0; _i < supportedExtensions.length; _i++) { var ext = supportedExtensions[_i]; if (fileExtensionIs(path, ext)) { return path.substr(0, path.length - ext.length); @@ -624,6 +651,7 @@ var ts; Debug.fail = fail; })(Debug = ts.Debug || (ts.Debug = {})); })(ts || (ts = {})); +/// var ts; (function (ts) { ts.sys = (function () { @@ -697,14 +725,14 @@ var ts; function visitDirectory(path) { var folder = fso.GetFolder(path || "."); var files = getNames(folder.files); - for (var _i = 0, _n = files.length; _i < _n; _i++) { - var _name = files[_i]; - if (!extension || ts.fileExtensionIs(_name, extension)) { - result.push(ts.combinePaths(path, _name)); + for (var _i = 0; _i < files.length; _i++) { + var name_1 = files[_i]; + if (!extension || ts.fileExtensionIs(name_1, extension)) { + result.push(ts.combinePaths(path, name_1)); } } var subfolders = getNames(folder.subfolders); - for (var _a = 0, _b = subfolders.length; _a < _b; _a++) { + for (var _a = 0; _a < subfolders.length; _a++) { var current = subfolders[_a]; visitDirectory(ts.combinePaths(path, current)); } @@ -791,7 +819,7 @@ var ts; function visitDirectory(path) { var files = _fs.readdirSync(path || ".").sort(); var directories = []; - for (var _i = 0, _n = files.length; _i < _n; _i++) { + for (var _i = 0; _i < files.length; _i++) { var current = files[_i]; var name = ts.combinePaths(path, current); var stat = _fs.lstatSync(name); @@ -804,9 +832,9 @@ var ts; directories.push(name); } } - for (var _a = 0, _b = directories.length; _a < _b; _a++) { - var _current = directories[_a]; - visitDirectory(_current); + for (var _a = 0; _a < directories.length; _a++) { + var current = directories[_a]; + visitDirectory(current); } } } @@ -875,559 +903,585 @@ var ts; } })(); })(ts || (ts = {})); +/// var ts; (function (ts) { ts.Diagnostics = { - Unterminated_string_literal: { code: 1002, category: 1, key: "Unterminated string literal." }, - Identifier_expected: { code: 1003, category: 1, key: "Identifier expected." }, - _0_expected: { code: 1005, category: 1, key: "'{0}' expected." }, - A_file_cannot_have_a_reference_to_itself: { code: 1006, category: 1, key: "A file cannot have a reference to itself." }, - Trailing_comma_not_allowed: { code: 1009, category: 1, key: "Trailing comma not allowed." }, - Asterisk_Slash_expected: { code: 1010, category: 1, key: "'*/' expected." }, - Unexpected_token: { code: 1012, category: 1, key: "Unexpected token." }, - A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: 1, key: "A rest parameter must be last in a parameter list." }, - Parameter_cannot_have_question_mark_and_initializer: { code: 1015, category: 1, key: "Parameter cannot have question mark and initializer." }, - A_required_parameter_cannot_follow_an_optional_parameter: { code: 1016, category: 1, key: "A required parameter cannot follow an optional parameter." }, - An_index_signature_cannot_have_a_rest_parameter: { code: 1017, category: 1, key: "An index signature cannot have a rest parameter." }, - An_index_signature_parameter_cannot_have_an_accessibility_modifier: { code: 1018, category: 1, key: "An index signature parameter cannot have an accessibility modifier." }, - An_index_signature_parameter_cannot_have_a_question_mark: { code: 1019, category: 1, key: "An index signature parameter cannot have a question mark." }, - An_index_signature_parameter_cannot_have_an_initializer: { code: 1020, category: 1, key: "An index signature parameter cannot have an initializer." }, - An_index_signature_must_have_a_type_annotation: { code: 1021, category: 1, key: "An index signature must have a type annotation." }, - An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: 1, key: "An index signature parameter must have a type annotation." }, - An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: 1, key: "An index signature parameter type must be 'string' or 'number'." }, - A_class_or_interface_declaration_can_only_have_one_extends_clause: { code: 1024, category: 1, key: "A class or interface declaration can only have one 'extends' clause." }, - An_extends_clause_must_precede_an_implements_clause: { code: 1025, category: 1, key: "An 'extends' clause must precede an 'implements' clause." }, - A_class_can_only_extend_a_single_class: { code: 1026, category: 1, key: "A class can only extend a single class." }, - A_class_declaration_can_only_have_one_implements_clause: { code: 1027, category: 1, key: "A class declaration can only have one 'implements' clause." }, - Accessibility_modifier_already_seen: { code: 1028, category: 1, key: "Accessibility modifier already seen." }, - _0_modifier_must_precede_1_modifier: { code: 1029, category: 1, key: "'{0}' modifier must precede '{1}' modifier." }, - _0_modifier_already_seen: { code: 1030, category: 1, key: "'{0}' modifier already seen." }, - _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: 1, key: "'{0}' modifier cannot appear on a class element." }, - An_interface_declaration_cannot_have_an_implements_clause: { code: 1032, category: 1, key: "An interface declaration cannot have an 'implements' clause." }, - super_must_be_followed_by_an_argument_list_or_member_access: { code: 1034, category: 1, key: "'super' must be followed by an argument list or member access." }, - Only_ambient_modules_can_use_quoted_names: { code: 1035, category: 1, key: "Only ambient modules can use quoted names." }, - Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: 1, key: "Statements are not allowed in ambient contexts." }, - A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { code: 1038, category: 1, key: "A 'declare' modifier cannot be used in an already ambient context." }, - Initializers_are_not_allowed_in_ambient_contexts: { code: 1039, category: 1, key: "Initializers are not allowed in ambient contexts." }, - _0_modifier_cannot_appear_on_a_module_element: { code: 1044, category: 1, key: "'{0}' modifier cannot appear on a module element." }, - A_declare_modifier_cannot_be_used_with_an_interface_declaration: { code: 1045, category: 1, key: "A 'declare' modifier cannot be used with an interface declaration." }, - A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { code: 1046, category: 1, key: "A 'declare' modifier is required for a top level declaration in a .d.ts file." }, - A_rest_parameter_cannot_be_optional: { code: 1047, category: 1, key: "A rest parameter cannot be optional." }, - A_rest_parameter_cannot_have_an_initializer: { code: 1048, category: 1, key: "A rest parameter cannot have an initializer." }, - A_set_accessor_must_have_exactly_one_parameter: { code: 1049, category: 1, key: "A 'set' accessor must have exactly one parameter." }, - A_set_accessor_cannot_have_an_optional_parameter: { code: 1051, category: 1, key: "A 'set' accessor cannot have an optional parameter." }, - A_set_accessor_parameter_cannot_have_an_initializer: { code: 1052, category: 1, key: "A 'set' accessor parameter cannot have an initializer." }, - A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: 1, key: "A 'set' accessor cannot have rest parameter." }, - A_get_accessor_cannot_have_parameters: { code: 1054, category: 1, key: "A 'get' accessor cannot have parameters." }, - Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: 1, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, - Enum_member_must_have_initializer: { code: 1061, category: 1, key: "Enum member must have initializer." }, - An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: 1, key: "An export assignment cannot be used in an internal module." }, - Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: 1, key: "Ambient enum elements can only have integer literal initializers." }, - Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: 1, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, - A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: 1, key: "A 'declare' modifier cannot be used with an import declaration." }, - Invalid_reference_directive_syntax: { code: 1084, category: 1, key: "Invalid 'reference' directive syntax." }, - Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: 1, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, - An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: 1, key: "An accessor cannot be declared in an ambient context." }, - _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: 1, key: "'{0}' modifier cannot appear on a constructor declaration." }, - _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: 1, key: "'{0}' modifier cannot appear on a parameter." }, - Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { code: 1091, category: 1, key: "Only a single variable declaration is allowed in a 'for...in' statement." }, - Type_parameters_cannot_appear_on_a_constructor_declaration: { code: 1092, category: 1, key: "Type parameters cannot appear on a constructor declaration." }, - Type_annotation_cannot_appear_on_a_constructor_declaration: { code: 1093, category: 1, key: "Type annotation cannot appear on a constructor declaration." }, - An_accessor_cannot_have_type_parameters: { code: 1094, category: 1, key: "An accessor cannot have type parameters." }, - A_set_accessor_cannot_have_a_return_type_annotation: { code: 1095, category: 1, key: "A 'set' accessor cannot have a return type annotation." }, - An_index_signature_must_have_exactly_one_parameter: { code: 1096, category: 1, key: "An index signature must have exactly one parameter." }, - _0_list_cannot_be_empty: { code: 1097, category: 1, key: "'{0}' list cannot be empty." }, - Type_parameter_list_cannot_be_empty: { code: 1098, category: 1, key: "Type parameter list cannot be empty." }, - Type_argument_list_cannot_be_empty: { code: 1099, category: 1, key: "Type argument list cannot be empty." }, - Invalid_use_of_0_in_strict_mode: { code: 1100, category: 1, key: "Invalid use of '{0}' in strict mode." }, - with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: 1, key: "'with' statements are not allowed in strict mode." }, - delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: 1, key: "'delete' cannot be called on an identifier in strict mode." }, - A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: 1, key: "A 'continue' statement can only be used within an enclosing iteration statement." }, - A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: 1, key: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, - Jump_target_cannot_cross_function_boundary: { code: 1107, category: 1, key: "Jump target cannot cross function boundary." }, - A_return_statement_can_only_be_used_within_a_function_body: { code: 1108, category: 1, key: "A 'return' statement can only be used within a function body." }, - Expression_expected: { code: 1109, category: 1, key: "Expression expected." }, - Type_expected: { code: 1110, category: 1, key: "Type expected." }, - A_class_member_cannot_be_declared_optional: { code: 1112, category: 1, key: "A class member cannot be declared optional." }, - A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: 1, key: "A 'default' clause cannot appear more than once in a 'switch' statement." }, - Duplicate_label_0: { code: 1114, category: 1, key: "Duplicate label '{0}'" }, - A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: 1, key: "A 'continue' statement can only jump to a label of an enclosing iteration statement." }, - A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: 1, key: "A 'break' statement can only jump to a label of an enclosing statement." }, - An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: 1, key: "An object literal cannot have multiple properties with the same name in strict mode." }, - An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: { code: 1118, category: 1, key: "An object literal cannot have multiple get/set accessors with the same name." }, - An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { code: 1119, category: 1, key: "An object literal cannot have property and accessor with the same name." }, - An_export_assignment_cannot_have_modifiers: { code: 1120, category: 1, key: "An export assignment cannot have modifiers." }, - Octal_literals_are_not_allowed_in_strict_mode: { code: 1121, category: 1, key: "Octal literals are not allowed in strict mode." }, - A_tuple_type_element_list_cannot_be_empty: { code: 1122, category: 1, key: "A tuple type element list cannot be empty." }, - Variable_declaration_list_cannot_be_empty: { code: 1123, category: 1, key: "Variable declaration list cannot be empty." }, - Digit_expected: { code: 1124, category: 1, key: "Digit expected." }, - Hexadecimal_digit_expected: { code: 1125, category: 1, key: "Hexadecimal digit expected." }, - Unexpected_end_of_text: { code: 1126, category: 1, key: "Unexpected end of text." }, - Invalid_character: { code: 1127, category: 1, key: "Invalid character." }, - Declaration_or_statement_expected: { code: 1128, category: 1, key: "Declaration or statement expected." }, - Statement_expected: { code: 1129, category: 1, key: "Statement expected." }, - case_or_default_expected: { code: 1130, category: 1, key: "'case' or 'default' expected." }, - Property_or_signature_expected: { code: 1131, category: 1, key: "Property or signature expected." }, - Enum_member_expected: { code: 1132, category: 1, key: "Enum member expected." }, - Type_reference_expected: { code: 1133, category: 1, key: "Type reference expected." }, - Variable_declaration_expected: { code: 1134, category: 1, key: "Variable declaration expected." }, - Argument_expression_expected: { code: 1135, category: 1, key: "Argument expression expected." }, - Property_assignment_expected: { code: 1136, category: 1, key: "Property assignment expected." }, - Expression_or_comma_expected: { code: 1137, category: 1, key: "Expression or comma expected." }, - Parameter_declaration_expected: { code: 1138, category: 1, key: "Parameter declaration expected." }, - Type_parameter_declaration_expected: { code: 1139, category: 1, key: "Type parameter declaration expected." }, - Type_argument_expected: { code: 1140, category: 1, key: "Type argument expected." }, - String_literal_expected: { code: 1141, category: 1, key: "String literal expected." }, - Line_break_not_permitted_here: { code: 1142, category: 1, key: "Line break not permitted here." }, - or_expected: { code: 1144, category: 1, key: "'{' or ';' expected." }, - Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: 1, key: "Modifiers not permitted on index signature members." }, - Declaration_expected: { code: 1146, category: 1, key: "Declaration expected." }, - Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: 1, 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: 1, key: "Cannot compile external modules unless the '--module' flag is provided." }, - File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: 1, 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: 1, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, - var_let_or_const_expected: { code: 1152, category: 1, key: "'var', 'let' or 'const' expected." }, - let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1153, category: 1, key: "'let' declarations are only available when targeting ECMAScript 6 and higher." }, - const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1154, category: 1, key: "'const' declarations are only available when targeting ECMAScript 6 and higher." }, - const_declarations_must_be_initialized: { code: 1155, category: 1, key: "'const' declarations must be initialized" }, - const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: 1, key: "'const' declarations can only be declared inside a block." }, - let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: 1, key: "'let' declarations can only be declared inside a block." }, - Unterminated_template_literal: { code: 1160, category: 1, key: "Unterminated template literal." }, - Unterminated_regular_expression_literal: { code: 1161, category: 1, key: "Unterminated regular expression literal." }, - An_object_member_cannot_be_declared_optional: { code: 1162, category: 1, key: "An object member cannot be declared optional." }, - yield_expression_must_be_contained_within_a_generator_declaration: { code: 1163, category: 1, key: "'yield' expression must be contained_within a generator declaration." }, - Computed_property_names_are_not_allowed_in_enums: { code: 1164, category: 1, key: "Computed property names are not allowed in enums." }, - A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_symbol: { code: 1165, category: 1, key: "A computed property name in an ambient context must directly refer to a built-in symbol." }, - A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol: { code: 1166, category: 1, key: "A computed property name in a class property declaration must directly refer to a built-in symbol." }, - Computed_property_names_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1167, category: 1, key: "Computed property names are only available when targeting ECMAScript 6 and higher." }, - A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol: { code: 1168, category: 1, key: "A computed property name in a method overload must directly refer to a built-in symbol." }, - A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol: { code: 1169, category: 1, key: "A computed property name in an interface must directly refer to a built-in symbol." }, - A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol: { code: 1170, category: 1, key: "A computed property name in a type literal must directly refer to a built-in symbol." }, - A_comma_expression_is_not_allowed_in_a_computed_property_name: { code: 1171, category: 1, key: "A comma expression is not allowed in a computed property name." }, - extends_clause_already_seen: { code: 1172, category: 1, key: "'extends' clause already seen." }, - extends_clause_must_precede_implements_clause: { code: 1173, category: 1, key: "'extends' clause must precede 'implements' clause." }, - Classes_can_only_extend_a_single_class: { code: 1174, category: 1, key: "Classes can only extend a single class." }, - implements_clause_already_seen: { code: 1175, category: 1, key: "'implements' clause already seen." }, - Interface_declaration_cannot_have_implements_clause: { code: 1176, category: 1, key: "Interface declaration cannot have 'implements' clause." }, - Binary_digit_expected: { code: 1177, category: 1, key: "Binary digit expected." }, - Octal_digit_expected: { code: 1178, category: 1, key: "Octal digit expected." }, - Unexpected_token_expected: { code: 1179, category: 1, key: "Unexpected token. '{' expected." }, - Property_destructuring_pattern_expected: { code: 1180, category: 1, key: "Property destructuring pattern expected." }, - Array_element_destructuring_pattern_expected: { code: 1181, category: 1, key: "Array element destructuring pattern expected." }, - A_destructuring_declaration_must_have_an_initializer: { code: 1182, category: 1, key: "A destructuring declaration must have an initializer." }, - Destructuring_declarations_are_not_allowed_in_ambient_contexts: { code: 1183, category: 1, key: "Destructuring declarations are not allowed in ambient contexts." }, - An_implementation_cannot_be_declared_in_ambient_contexts: { code: 1184, category: 1, key: "An implementation cannot be declared in ambient contexts." }, - Modifiers_cannot_appear_here: { code: 1184, category: 1, key: "Modifiers cannot appear here." }, - Merge_conflict_marker_encountered: { code: 1185, category: 1, key: "Merge conflict marker encountered." }, - A_rest_element_cannot_have_an_initializer: { code: 1186, category: 1, key: "A rest element cannot have an initializer." }, - A_parameter_property_may_not_be_a_binding_pattern: { code: 1187, category: 1, key: "A parameter property may not be a binding pattern." }, - Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement: { code: 1188, category: 1, key: "Only a single variable declaration is allowed in a 'for...of' statement." }, - The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer: { code: 1189, category: 1, 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: 1, key: "The variable declaration of a 'for...of' statement cannot have an initializer." }, - An_import_declaration_cannot_have_modifiers: { code: 1191, category: 1, key: "An import declaration cannot have modifiers." }, - External_module_0_has_no_default_export_or_export_assignment: { code: 1192, category: 1, key: "External module '{0}' has no default export or export assignment." }, - An_export_declaration_cannot_have_modifiers: { code: 1193, category: 1, key: "An export declaration cannot have modifiers." }, - Export_declarations_are_not_permitted_in_an_internal_module: { code: 1194, category: 1, key: "Export declarations are not permitted in an internal module." }, - Catch_clause_variable_name_must_be_an_identifier: { code: 1195, category: 1, key: "Catch clause variable name must be an identifier." }, - Catch_clause_variable_cannot_have_a_type_annotation: { code: 1196, category: 1, key: "Catch clause variable cannot have a type annotation." }, - Catch_clause_variable_cannot_have_an_initializer: { code: 1197, category: 1, key: "Catch clause variable cannot have an initializer." }, - An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: { code: 1198, category: 1, key: "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive." }, - Unterminated_Unicode_escape_sequence: { code: 1199, category: 1, key: "Unterminated Unicode escape sequence." }, - Duplicate_identifier_0: { code: 2300, category: 1, key: "Duplicate identifier '{0}'." }, - Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: 1, 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: 1, key: "Static members cannot reference class type parameters." }, - Circular_definition_of_import_alias_0: { code: 2303, category: 1, key: "Circular definition of import alias '{0}'." }, - Cannot_find_name_0: { code: 2304, category: 1, key: "Cannot find name '{0}'." }, - Module_0_has_no_exported_member_1: { code: 2305, category: 1, key: "Module '{0}' has no exported member '{1}'." }, - File_0_is_not_an_external_module: { code: 2306, category: 1, key: "File '{0}' is not an external module." }, - Cannot_find_external_module_0: { code: 2307, category: 1, key: "Cannot find external module '{0}'." }, - A_module_cannot_have_more_than_one_export_assignment: { code: 2308, category: 1, 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: 1, 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: 1, key: "Type '{0}' recursively references itself as a base type." }, - A_class_may_only_extend_another_class: { code: 2311, category: 1, key: "A class may only extend another class." }, - An_interface_may_only_extend_a_class_or_another_interface: { code: 2312, category: 1, key: "An interface may only extend a class or another interface." }, - Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2313, category: 1, key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, - Generic_type_0_requires_1_type_argument_s: { code: 2314, category: 1, key: "Generic type '{0}' requires {1} type argument(s)." }, - Type_0_is_not_generic: { code: 2315, category: 1, key: "Type '{0}' is not generic." }, - Global_type_0_must_be_a_class_or_interface_type: { code: 2316, category: 1, key: "Global type '{0}' must be a class or interface type." }, - Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: 1, key: "Global type '{0}' must have {1} type parameter(s)." }, - Cannot_find_global_type_0: { code: 2318, category: 1, key: "Cannot find global type '{0}'." }, - Named_property_0_of_types_1_and_2_are_not_identical: { code: 2319, category: 1, key: "Named property '{0}' of types '{1}' and '{2}' are not identical." }, - Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: 1, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." }, - Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: 1, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, - Type_0_is_not_assignable_to_type_1: { code: 2322, category: 1, key: "Type '{0}' is not assignable to type '{1}'." }, - Property_0_is_missing_in_type_1: { code: 2324, category: 1, key: "Property '{0}' is missing in type '{1}'." }, - Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: 1, key: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, - Types_of_property_0_are_incompatible: { code: 2326, category: 1, key: "Types of property '{0}' are incompatible." }, - Property_0_is_optional_in_type_1_but_required_in_type_2: { code: 2327, category: 1, key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." }, - Types_of_parameters_0_and_1_are_incompatible: { code: 2328, category: 1, key: "Types of parameters '{0}' and '{1}' are incompatible." }, - Index_signature_is_missing_in_type_0: { code: 2329, category: 1, key: "Index signature is missing in type '{0}'." }, - Index_signatures_are_incompatible: { code: 2330, category: 1, key: "Index signatures are incompatible." }, - this_cannot_be_referenced_in_a_module_body: { code: 2331, category: 1, key: "'this' cannot be referenced in a module body." }, - this_cannot_be_referenced_in_current_location: { code: 2332, category: 1, key: "'this' cannot be referenced in current location." }, - this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: 1, key: "'this' cannot be referenced in constructor arguments." }, - this_cannot_be_referenced_in_a_static_property_initializer: { code: 2334, category: 1, key: "'this' cannot be referenced in a static property initializer." }, - super_can_only_be_referenced_in_a_derived_class: { code: 2335, category: 1, key: "'super' can only be referenced in a derived class." }, - super_cannot_be_referenced_in_constructor_arguments: { code: 2336, category: 1, key: "'super' cannot be referenced in constructor arguments." }, - Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: 2337, category: 1, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, - super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2338, category: 1, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, - Property_0_does_not_exist_on_type_1: { code: 2339, category: 1, key: "Property '{0}' does not exist on type '{1}'." }, - Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: 1, key: "Only public and protected methods of the base class are accessible via the 'super' keyword" }, - Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: 1, key: "Property '{0}' is private and only accessible within class '{1}'." }, - An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: { code: 2342, category: 1, key: "An index expression argument must be of type 'string', 'number', 'symbol, or 'any'." }, - Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: 1, key: "Type '{0}' does not satisfy the constraint '{1}'." }, - Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: 1, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, - Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: 1, key: "Supplied parameters do not match any signature of call target." }, - Untyped_function_calls_may_not_accept_type_arguments: { code: 2347, category: 1, key: "Untyped function calls may not accept type arguments." }, - Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { code: 2348, category: 1, key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" }, - Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { code: 2349, category: 1, key: "Cannot invoke an expression whose type lacks a call signature." }, - Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: 1, key: "Only a void function can be called with the 'new' keyword." }, - Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: 1, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, - Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: 1, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, - No_best_common_type_exists_among_return_expressions: { code: 2354, category: 1, key: "No best common type exists among return expressions." }, - A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: 1, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, - An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: 1, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, - The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2357, category: 1, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, - The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: 1, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, - The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: 1, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, - The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: { code: 2360, category: 1, key: "The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'." }, - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: 1, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, - The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: 1, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: 1, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - Invalid_left_hand_side_of_assignment_expression: { code: 2364, category: 1, key: "Invalid left-hand side of assignment expression." }, - Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: 1, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, - Type_parameter_name_cannot_be_0: { code: 2368, category: 1, key: "Type parameter name cannot be '{0}'" }, - A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: 1, key: "A parameter property is only allowed in a constructor implementation." }, - A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: 1, key: "A rest parameter must be of an array type." }, - A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: 1, key: "A parameter initializer is only allowed in a function or constructor implementation." }, - Parameter_0_cannot_be_referenced_in_its_initializer: { code: 2372, category: 1, key: "Parameter '{0}' cannot be referenced in its initializer." }, - Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { code: 2373, category: 1, key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." }, - Duplicate_string_index_signature: { code: 2374, category: 1, key: "Duplicate string index signature." }, - Duplicate_number_index_signature: { code: 2375, category: 1, key: "Duplicate number index signature." }, - A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: 2376, category: 1, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, - Constructors_for_derived_classes_must_contain_a_super_call: { code: 2377, category: 1, key: "Constructors for derived classes must contain a 'super' call." }, - A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2378, category: 1, key: "A 'get' accessor must return a value or consist of a single 'throw' statement." }, - Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2379, category: 1, key: "Getter and setter accessors do not agree in visibility." }, - get_and_set_accessor_must_have_the_same_type: { code: 2380, category: 1, key: "'get' and 'set' accessor must have the same type." }, - A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2381, category: 1, key: "A signature with an implementation cannot use a string literal type." }, - Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 2382, category: 1, key: "Specialized overload signature is not assignable to any non-specialized signature." }, - Overload_signatures_must_all_be_exported_or_not_exported: { code: 2383, category: 1, key: "Overload signatures must all be exported or not exported." }, - Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2384, category: 1, key: "Overload signatures must all be ambient or non-ambient." }, - Overload_signatures_must_all_be_public_private_or_protected: { code: 2385, category: 1, key: "Overload signatures must all be public, private or protected." }, - Overload_signatures_must_all_be_optional_or_required: { code: 2386, category: 1, key: "Overload signatures must all be optional or required." }, - Function_overload_must_be_static: { code: 2387, category: 1, key: "Function overload must be static." }, - Function_overload_must_not_be_static: { code: 2388, category: 1, key: "Function overload must not be static." }, - Function_implementation_name_must_be_0: { code: 2389, category: 1, key: "Function implementation name must be '{0}'." }, - Constructor_implementation_is_missing: { code: 2390, category: 1, key: "Constructor implementation is missing." }, - Function_implementation_is_missing_or_not_immediately_following_the_declaration: { code: 2391, category: 1, key: "Function implementation is missing or not immediately following the declaration." }, - Multiple_constructor_implementations_are_not_allowed: { code: 2392, category: 1, key: "Multiple constructor implementations are not allowed." }, - Duplicate_function_implementation: { code: 2393, category: 1, key: "Duplicate function implementation." }, - Overload_signature_is_not_compatible_with_function_implementation: { code: 2394, category: 1, key: "Overload signature is not compatible with function implementation." }, - Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2395, category: 1, key: "Individual declarations in merged declaration {0} must be all exported or all local." }, - Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2396, category: 1, key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, - Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2399, category: 1, key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, - Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2400, category: 1, key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, - Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2401, category: 1, key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, - Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { code: 2402, category: 1, key: "Expression resolves to '_super' that compiler uses to capture base class reference." }, - Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { code: 2403, category: 1, key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." }, - The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { code: 2404, category: 1, key: "The left-hand side of a 'for...in' statement cannot use a type annotation." }, - The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { code: 2405, category: 1, key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." }, - Invalid_left_hand_side_in_for_in_statement: { code: 2406, category: 1, key: "Invalid left-hand side in 'for...in' statement." }, - The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: 1, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, - Setters_cannot_return_a_value: { code: 2408, category: 1, key: "Setters cannot return a value." }, - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: 1, key: "Return type of constructor signature must be assignable to the instance type of the class" }, - All_symbols_within_a_with_block_will_be_resolved_to_any: { code: 2410, category: 1, key: "All symbols within a 'with' block will be resolved to 'any'." }, - Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: 1, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, - Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: 1, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, - Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: 1, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, - Class_name_cannot_be_0: { code: 2414, category: 1, key: "Class name cannot be '{0}'" }, - Class_0_incorrectly_extends_base_class_1: { code: 2415, category: 1, key: "Class '{0}' incorrectly extends base class '{1}'." }, - Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: 1, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, - Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: 1, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, - Class_0_incorrectly_implements_interface_1: { code: 2420, category: 1, key: "Class '{0}' incorrectly implements interface '{1}'." }, - A_class_may_only_implement_another_class_or_interface: { code: 2422, category: 1, key: "A class may only implement another class or interface." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: 1, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: 1, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, - Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: 1, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, - Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: 1, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, - Interface_name_cannot_be_0: { code: 2427, category: 1, key: "Interface name cannot be '{0}'" }, - All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: 1, key: "All declarations of an interface must have identical type parameters." }, - Interface_0_incorrectly_extends_interface_1: { code: 2430, category: 1, key: "Interface '{0}' incorrectly extends interface '{1}'." }, - Enum_name_cannot_be_0: { code: 2431, category: 1, 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: 1, 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: 1, 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: 1, 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: 1, key: "Ambient external modules cannot be nested in other modules." }, - Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: 1, key: "Ambient external module declaration cannot specify relative module name." }, - Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: 1, key: "Module '{0}' is hidden by a local declaration with the same name" }, - Import_name_cannot_be_0: { code: 2438, category: 1, 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: 1, key: "Import or export declaration in an ambient external module declaration cannot reference external module through relative external module name." }, - Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: 1, 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: 1, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module." }, - Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: 1, 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: 1, 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: 1, key: "Property '{0}' is protected in type '{1}' but public in type '{2}'." }, - Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { code: 2445, category: 1, key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." }, - Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: 1, key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, - The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: 1, key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, - Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: 1, key: "Block-scoped variable '{0}' used before its declaration." }, - The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant: { code: 2449, category: 1, key: "The operand of an increment or decrement operator cannot be a constant." }, - Left_hand_side_of_assignment_expression_cannot_be_a_constant: { code: 2450, category: 1, key: "Left-hand side of assignment expression cannot be a constant." }, - Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: 1, key: "Cannot redeclare block-scoped variable '{0}'." }, - An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: 1, key: "An enum member cannot have a numeric name." }, - The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: 1, key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, - Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: 1, key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, - Type_alias_0_circularly_references_itself: { code: 2456, category: 1, key: "Type alias '{0}' circularly references itself." }, - Type_alias_name_cannot_be_0: { code: 2457, category: 1, key: "Type alias name cannot be '{0}'" }, - An_AMD_module_cannot_have_multiple_name_assignments: { code: 2458, category: 1, key: "An AMD module cannot have multiple name assignments." }, - Type_0_has_no_property_1_and_no_string_index_signature: { code: 2459, category: 1, key: "Type '{0}' has no property '{1}' and no string index signature." }, - Type_0_has_no_property_1: { code: 2460, category: 1, key: "Type '{0}' has no property '{1}'." }, - Type_0_is_not_an_array_type: { code: 2461, category: 1, key: "Type '{0}' is not an array type." }, - A_rest_element_must_be_last_in_an_array_destructuring_pattern: { code: 2462, category: 1, key: "A rest element must be last in an array destructuring pattern" }, - A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: { code: 2463, category: 1, key: "A binding pattern parameter cannot be optional in an implementation signature." }, - A_computed_property_name_must_be_of_type_string_number_symbol_or_any: { code: 2464, category: 1, key: "A computed property name must be of type 'string', 'number', 'symbol', or 'any'." }, - this_cannot_be_referenced_in_a_computed_property_name: { code: 2465, category: 1, key: "'this' cannot be referenced in a computed property name." }, - super_cannot_be_referenced_in_a_computed_property_name: { code: 2466, category: 1, key: "'super' cannot be referenced in a computed property name." }, - A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: { code: 2467, category: 1, key: "A computed property name cannot reference a type parameter from its containing type." }, - Cannot_find_global_value_0: { code: 2468, category: 1, key: "Cannot find global value '{0}'." }, - The_0_operator_cannot_be_applied_to_type_symbol: { code: 2469, category: 1, key: "The '{0}' operator cannot be applied to type 'symbol'." }, - Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object: { code: 2470, category: 1, key: "'Symbol' reference does not refer to the global Symbol constructor object." }, - A_computed_property_name_of_the_form_0_must_be_of_type_symbol: { code: 2471, category: 1, key: "A computed property name of the form '{0}' must be of type 'symbol'." }, - Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_6_and_higher: { code: 2472, category: 1, key: "Spread operator in 'new' expressions is only available when targeting ECMAScript 6 and higher." }, - Enum_declarations_must_all_be_const_or_non_const: { code: 2473, category: 1, key: "Enum declarations must all be const or non-const." }, - In_const_enum_declarations_member_initializer_must_be_constant_expression: { code: 2474, category: 1, key: "In 'const' enum declarations member initializer must be constant expression." }, - const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: { code: 2475, category: 1, key: "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment." }, - A_const_enum_member_can_only_be_accessed_using_a_string_literal: { code: 2476, category: 1, key: "A const enum member can only be accessed using a string literal." }, - const_enum_member_initializer_was_evaluated_to_a_non_finite_value: { code: 2477, category: 1, key: "'const' enum member initializer was evaluated to a non-finite value." }, - const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: { code: 2478, category: 1, key: "'const' enum member initializer was evaluated to disallowed value 'NaN'." }, - Property_0_does_not_exist_on_const_enum_1: { code: 2479, category: 1, key: "Property '{0}' does not exist on 'const' enum '{1}'." }, - let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { code: 2480, category: 1, key: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." }, - Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { code: 2481, category: 1, key: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." }, - The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: { code: 2483, category: 1, key: "The left-hand side of a 'for...of' statement cannot use a type annotation." }, - Export_declaration_conflicts_with_exported_declaration_of_0: { code: 2484, category: 1, key: "Export declaration conflicts with exported declaration of '{0}'" }, - The_left_hand_side_of_a_for_of_statement_cannot_be_a_previously_defined_constant: { code: 2485, category: 1, key: "The left-hand side of a 'for...of' statement cannot be a previously defined constant." }, - The_left_hand_side_of_a_for_in_statement_cannot_be_a_previously_defined_constant: { code: 2486, category: 1, key: "The left-hand side of a 'for...in' statement cannot be a previously defined constant." }, - Invalid_left_hand_side_in_for_of_statement: { code: 2487, category: 1, key: "Invalid left-hand side in 'for...of' statement." }, - The_right_hand_side_of_a_for_of_statement_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2488, category: 1, key: "The right-hand side of a 'for...of' statement must have a '[Symbol.iterator]()' method that returns an iterator." }, - The_iterator_returned_by_the_right_hand_side_of_a_for_of_statement_must_have_a_next_method: { code: 2489, category: 1, key: "The iterator returned by the right-hand side of a 'for...of' statement must have a 'next()' method." }, - The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: { code: 2490, category: 1, key: "The type returned by the 'next()' method of an iterator must have a 'value' property." }, - The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: { code: 2491, category: 1, key: "The left-hand side of a 'for...in' statement cannot be a destructuring pattern." }, - Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: 1, key: "Cannot redeclare identifier '{0}' in catch clause" }, - Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: { code: 2493, category: 1, key: "Tuple type '{0}' with length '{1}' cannot be assigned to tuple with length '{2}'." }, - Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: { code: 2494, category: 1, 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: 2461, category: 1, key: "Type '{0}' is not an array type or a string type." }, - Import_declaration_0_is_using_private_name_1: { code: 4000, category: 1, 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: 1, 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: 1, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4006, category: 1, key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4008, category: 1, key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4010, category: 1, key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4012, category: 1, key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: 1, key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: 1, key: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, - Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: 1, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: 1, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: 1, key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, - Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: 1, key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, - Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: 1, key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, - Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: 1, key: "Exported variable '{0}' has or is using private name '{1}'." }, - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4026, category: 1, key: "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4027, category: 1, key: "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4028, category: 1, key: "Public static property '{0}' of exported class has or is using private name '{1}'." }, - Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4029, category: 1, key: "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4030, category: 1, key: "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Public_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4031, category: 1, key: "Public property '{0}' of exported class has or is using private name '{1}'." }, - Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4032, category: 1, key: "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, - Property_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4033, category: 1, key: "Property '{0}' of exported interface has or is using private name '{1}'." }, - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4034, category: 1, key: "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4035, category: 1, key: "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4036, category: 1, key: "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4037, category: 1, key: "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4038, category: 1, key: "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4039, category: 1, key: "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4040, category: 1, key: "Return type of public static property getter from exported class has or is using private name '{0}'." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4041, category: 1, key: "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4042, category: 1, key: "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4043, category: 1, key: "Return type of public property getter from exported class has or is using private name '{0}'." }, - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4044, category: 1, key: "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4045, category: 1, key: "Return type of constructor signature from exported interface has or is using private name '{0}'." }, - Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4046, category: 1, key: "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4047, category: 1, key: "Return type of call signature from exported interface has or is using private name '{0}'." }, - Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4048, category: 1, key: "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4049, category: 1, key: "Return type of index signature from exported interface has or is using private name '{0}'." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4050, category: 1, key: "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4051, category: 1, key: "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: { code: 4052, category: 1, key: "Return type of public static method from exported class has or is using private name '{0}'." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4053, category: 1, key: "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4054, category: 1, key: "Return type of public method from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: { code: 4055, category: 1, key: "Return type of public method from exported class has or is using private name '{0}'." }, - Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4056, category: 1, key: "Return type of method from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: { code: 4057, category: 1, key: "Return type of method from exported interface has or is using private name '{0}'." }, - Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4058, category: 1, key: "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: { code: 4059, category: 1, key: "Return type of exported function has or is using name '{0}' from private module '{1}'." }, - Return_type_of_exported_function_has_or_is_using_private_name_0: { code: 4060, category: 1, key: "Return type of exported function has or is using private name '{0}'." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4061, category: 1, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4062, category: 1, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: { code: 4063, category: 1, key: "Parameter '{0}' of constructor from exported class has or is using private name '{1}'." }, - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4064, category: 1, key: "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4065, category: 1, key: "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4066, category: 1, key: "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4067, category: 1, key: "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4068, category: 1, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4069, category: 1, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4070, category: 1, key: "Parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4071, category: 1, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4072, category: 1, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4073, category: 1, key: "Parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4074, category: 1, key: "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4075, category: 1, key: "Parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: 1, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: 1, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: 1, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, - Exported_type_alias_0_has_or_is_using_private_name_1: { code: 4081, category: 1, key: "Exported type alias '{0}' has or is using private name '{1}'." }, - Loop_contains_block_scoped_variable_0_referenced_by_a_function_in_the_loop_This_is_only_supported_in_ECMAScript_6_or_higher: { code: 4091, category: 1, key: "Loop contains block-scoped variable '{0}' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher." }, - The_current_host_does_not_support_the_0_option: { code: 5001, category: 1, key: "The current host does not support the '{0}' option." }, - Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: 1, key: "Cannot find the common subdirectory path for the input files." }, - Cannot_read_file_0_Colon_1: { code: 5012, category: 1, key: "Cannot read file '{0}': {1}" }, - Unsupported_file_encoding: { code: 5013, category: 1, key: "Unsupported file encoding." }, - Unknown_compiler_option_0: { code: 5023, category: 1, key: "Unknown compiler option '{0}'." }, - Compiler_option_0_requires_a_value_of_type_1: { code: 5024, category: 1, key: "Compiler option '{0}' requires a value of type {1}." }, - Could_not_write_file_0_Colon_1: { code: 5033, category: 1, key: "Could not write file '{0}': {1}" }, - Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5038, category: 1, key: "Option 'mapRoot' cannot be specified without specifying 'sourcemap' option." }, - Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5039, category: 1, key: "Option 'sourceRoot' cannot be specified without specifying 'sourcemap' option." }, - Option_noEmit_cannot_be_specified_with_option_out_or_outDir: { code: 5040, category: 1, key: "Option 'noEmit' cannot be specified with option 'out' or 'outDir'." }, - Option_noEmit_cannot_be_specified_with_option_declaration: { code: 5041, category: 1, key: "Option 'noEmit' cannot be specified with option 'declaration'." }, - Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { code: 5042, category: 1, key: "Option 'project' cannot be mixed with source files on a command line." }, - Concatenate_and_emit_output_to_single_file: { code: 6001, category: 2, key: "Concatenate and emit output to single file." }, - Generates_corresponding_d_ts_file: { code: 6002, category: 2, key: "Generates corresponding '.d.ts' file." }, - Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: 2, key: "Specifies the location where debugger should locate map files instead of generated locations." }, - Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { code: 6004, category: 2, key: "Specifies the location where debugger should locate TypeScript files instead of source locations." }, - Watch_input_files: { code: 6005, category: 2, key: "Watch input files." }, - Redirect_output_structure_to_the_directory: { code: 6006, category: 2, key: "Redirect output structure to the directory." }, - Do_not_erase_const_enum_declarations_in_generated_code: { code: 6007, category: 2, key: "Do not erase const enum declarations in generated code." }, - Do_not_emit_outputs_if_any_type_checking_errors_were_reported: { code: 6008, category: 2, key: "Do not emit outputs if any type checking errors were reported." }, - Do_not_emit_comments_to_output: { code: 6009, category: 2, key: "Do not emit comments to output." }, - Do_not_emit_outputs: { code: 6010, category: 2, key: "Do not emit outputs." }, - Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: 2, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" }, - Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: 2, key: "Specify module code generation: 'commonjs' or 'amd'" }, - Print_this_message: { code: 6017, category: 2, key: "Print this message." }, - Print_the_compiler_s_version: { code: 6019, category: 2, key: "Print the compiler's version." }, - Compile_the_project_in_the_given_directory: { code: 6020, category: 2, key: "Compile the project in the given directory." }, - Syntax_Colon_0: { code: 6023, category: 2, key: "Syntax: {0}" }, - options: { code: 6024, category: 2, key: "options" }, - file: { code: 6025, category: 2, key: "file" }, - Examples_Colon_0: { code: 6026, category: 2, key: "Examples: {0}" }, - Options_Colon: { code: 6027, category: 2, key: "Options:" }, - Version_0: { code: 6029, category: 2, key: "Version {0}" }, - Insert_command_line_options_and_files_from_a_file: { code: 6030, category: 2, key: "Insert command line options and files from a file." }, - File_change_detected_Starting_incremental_compilation: { code: 6032, category: 2, key: "File change detected. Starting incremental compilation..." }, - KIND: { code: 6034, category: 2, key: "KIND" }, - FILE: { code: 6035, category: 2, key: "FILE" }, - VERSION: { code: 6036, category: 2, key: "VERSION" }, - LOCATION: { code: 6037, category: 2, key: "LOCATION" }, - DIRECTORY: { code: 6038, category: 2, key: "DIRECTORY" }, - Compilation_complete_Watching_for_file_changes: { code: 6042, category: 2, key: "Compilation complete. Watching for file changes." }, - Generates_corresponding_map_file: { code: 6043, category: 2, key: "Generates corresponding '.map' file." }, - Compiler_option_0_expects_an_argument: { code: 6044, category: 1, key: "Compiler option '{0}' expects an argument." }, - Unterminated_quoted_string_in_response_file_0: { code: 6045, category: 1, key: "Unterminated quoted string in response file '{0}'." }, - Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: 1, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, - Argument_for_target_option_must_be_es3_es5_or_es6: { code: 6047, category: 1, 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: 1, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, - Unsupported_locale_0: { code: 6049, category: 1, key: "Unsupported locale '{0}'." }, - Unable_to_open_file_0: { code: 6050, category: 1, key: "Unable to open file '{0}'." }, - Corrupted_locale_file_0: { code: 6051, category: 1, key: "Corrupted locale file {0}." }, - Raise_error_on_expressions_and_declarations_with_an_implied_any_type: { code: 6052, category: 2, key: "Raise error on expressions and declarations with an implied 'any' type." }, - File_0_not_found: { code: 6053, category: 1, key: "File '{0}' not found." }, - File_0_must_have_extension_ts_or_d_ts: { code: 6054, category: 1, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, - Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: { code: 6055, category: 2, key: "Suppress noImplicitAny errors for indexing objects lacking index signatures." }, - Do_not_emit_declarations_for_code_that_has_an_internal_annotation: { code: 6056, category: 2, key: "Do not emit declarations for code that has an '@internal' annotation." }, - Preserve_new_lines_when_emitting_code: { code: 6057, category: 2, key: "Preserve new-lines when emitting code." }, - Variable_0_implicitly_has_an_1_type: { code: 7005, category: 1, key: "Variable '{0}' implicitly has an '{1}' type." }, - Parameter_0_implicitly_has_an_1_type: { code: 7006, category: 1, key: "Parameter '{0}' implicitly has an '{1}' type." }, - Member_0_implicitly_has_an_1_type: { code: 7008, category: 1, key: "Member '{0}' implicitly has an '{1}' type." }, - new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: { code: 7009, category: 1, key: "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type." }, - _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: 1, key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, - Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: 1, key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, - Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: 1, key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: 1, key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, - Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: 1, key: "Index signature of object type implicitly has an 'any' type." }, - Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: 1, key: "Object literal's property '{0}' implicitly has an '{1}' type." }, - Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: 1, 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: 1, 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: 1, 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: 1, 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: 1, 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: 1, 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." }, - You_cannot_rename_this_element: { code: 8000, category: 1, key: "You cannot rename this element." }, - You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: { code: 8001, category: 1, key: "You cannot rename elements that are defined in the standard TypeScript library." }, - yield_expressions_are_not_currently_supported: { code: 9000, category: 1, key: "'yield' expressions are not currently supported." }, - Generators_are_not_currently_supported: { code: 9001, category: 1, key: "Generators are not currently supported." }, - The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression: { code: 9002, category: 1, key: "The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression." } + Unterminated_string_literal: { code: 1002, category: ts.DiagnosticCategory.Error, key: "Unterminated string literal." }, + Identifier_expected: { code: 1003, category: ts.DiagnosticCategory.Error, key: "Identifier expected." }, + _0_expected: { code: 1005, category: ts.DiagnosticCategory.Error, key: "'{0}' expected." }, + A_file_cannot_have_a_reference_to_itself: { code: 1006, category: ts.DiagnosticCategory.Error, key: "A file cannot have a reference to itself." }, + Trailing_comma_not_allowed: { code: 1009, category: ts.DiagnosticCategory.Error, key: "Trailing comma not allowed." }, + Asterisk_Slash_expected: { code: 1010, category: ts.DiagnosticCategory.Error, key: "'*/' expected." }, + Unexpected_token: { code: 1012, category: ts.DiagnosticCategory.Error, key: "Unexpected token." }, + A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: ts.DiagnosticCategory.Error, key: "A rest parameter must be last in a parameter list." }, + Parameter_cannot_have_question_mark_and_initializer: { code: 1015, category: ts.DiagnosticCategory.Error, key: "Parameter cannot have question mark and initializer." }, + A_required_parameter_cannot_follow_an_optional_parameter: { code: 1016, category: ts.DiagnosticCategory.Error, key: "A required parameter cannot follow an optional parameter." }, + An_index_signature_cannot_have_a_rest_parameter: { code: 1017, category: ts.DiagnosticCategory.Error, key: "An index signature cannot have a rest parameter." }, + An_index_signature_parameter_cannot_have_an_accessibility_modifier: { code: 1018, category: ts.DiagnosticCategory.Error, key: "An index signature parameter cannot have an accessibility modifier." }, + An_index_signature_parameter_cannot_have_a_question_mark: { code: 1019, category: ts.DiagnosticCategory.Error, key: "An index signature parameter cannot have a question mark." }, + An_index_signature_parameter_cannot_have_an_initializer: { code: 1020, category: ts.DiagnosticCategory.Error, key: "An index signature parameter cannot have an initializer." }, + An_index_signature_must_have_a_type_annotation: { code: 1021, category: ts.DiagnosticCategory.Error, key: "An index signature must have a type annotation." }, + An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: ts.DiagnosticCategory.Error, key: "An index signature parameter must have a type annotation." }, + An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: ts.DiagnosticCategory.Error, key: "An index signature parameter type must be 'string' or 'number'." }, + A_class_or_interface_declaration_can_only_have_one_extends_clause: { code: 1024, category: ts.DiagnosticCategory.Error, key: "A class or interface declaration can only have one 'extends' clause." }, + An_extends_clause_must_precede_an_implements_clause: { code: 1025, category: ts.DiagnosticCategory.Error, key: "An 'extends' clause must precede an 'implements' clause." }, + A_class_can_only_extend_a_single_class: { code: 1026, category: ts.DiagnosticCategory.Error, key: "A class can only extend a single class." }, + A_class_declaration_can_only_have_one_implements_clause: { code: 1027, category: ts.DiagnosticCategory.Error, key: "A class declaration can only have one 'implements' clause." }, + Accessibility_modifier_already_seen: { code: 1028, category: ts.DiagnosticCategory.Error, key: "Accessibility modifier already seen." }, + _0_modifier_must_precede_1_modifier: { code: 1029, category: ts.DiagnosticCategory.Error, key: "'{0}' modifier must precede '{1}' modifier." }, + _0_modifier_already_seen: { code: 1030, category: ts.DiagnosticCategory.Error, key: "'{0}' modifier already seen." }, + _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: ts.DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a class element." }, + An_interface_declaration_cannot_have_an_implements_clause: { code: 1032, category: ts.DiagnosticCategory.Error, key: "An interface declaration cannot have an 'implements' clause." }, + super_must_be_followed_by_an_argument_list_or_member_access: { code: 1034, category: ts.DiagnosticCategory.Error, key: "'super' must be followed by an argument list or member access." }, + Only_ambient_modules_can_use_quoted_names: { code: 1035, category: ts.DiagnosticCategory.Error, key: "Only ambient modules can use quoted names." }, + Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: ts.DiagnosticCategory.Error, key: "Statements are not allowed in ambient contexts." }, + A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { code: 1038, category: ts.DiagnosticCategory.Error, key: "A 'declare' modifier cannot be used in an already ambient context." }, + Initializers_are_not_allowed_in_ambient_contexts: { code: 1039, category: ts.DiagnosticCategory.Error, key: "Initializers are not allowed in ambient contexts." }, + _0_modifier_cannot_appear_on_a_module_element: { code: 1044, category: ts.DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a module element." }, + A_declare_modifier_cannot_be_used_with_an_interface_declaration: { code: 1045, category: ts.DiagnosticCategory.Error, key: "A 'declare' modifier cannot be used with an interface declaration." }, + A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { code: 1046, category: ts.DiagnosticCategory.Error, key: "A 'declare' modifier is required for a top level declaration in a .d.ts file." }, + A_rest_parameter_cannot_be_optional: { code: 1047, category: ts.DiagnosticCategory.Error, key: "A rest parameter cannot be optional." }, + A_rest_parameter_cannot_have_an_initializer: { code: 1048, category: ts.DiagnosticCategory.Error, key: "A rest parameter cannot have an initializer." }, + A_set_accessor_must_have_exactly_one_parameter: { code: 1049, category: ts.DiagnosticCategory.Error, key: "A 'set' accessor must have exactly one parameter." }, + A_set_accessor_cannot_have_an_optional_parameter: { code: 1051, category: ts.DiagnosticCategory.Error, key: "A 'set' accessor cannot have an optional parameter." }, + A_set_accessor_parameter_cannot_have_an_initializer: { code: 1052, category: ts.DiagnosticCategory.Error, key: "A 'set' accessor parameter cannot have an initializer." }, + A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: ts.DiagnosticCategory.Error, key: "A 'set' accessor cannot have rest parameter." }, + 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." }, + 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." }, + Invalid_reference_directive_syntax: { code: 1084, category: ts.DiagnosticCategory.Error, key: "Invalid 'reference' directive syntax." }, + Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: ts.DiagnosticCategory.Error, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, + An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: ts.DiagnosticCategory.Error, key: "An accessor cannot be declared in an ambient context." }, + _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: ts.DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a constructor declaration." }, + _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: ts.DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a parameter." }, + Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { code: 1091, category: ts.DiagnosticCategory.Error, key: "Only a single variable declaration is allowed in a 'for...in' statement." }, + Type_parameters_cannot_appear_on_a_constructor_declaration: { code: 1092, category: ts.DiagnosticCategory.Error, key: "Type parameters cannot appear on a constructor declaration." }, + Type_annotation_cannot_appear_on_a_constructor_declaration: { code: 1093, category: ts.DiagnosticCategory.Error, key: "Type annotation cannot appear on a constructor declaration." }, + An_accessor_cannot_have_type_parameters: { code: 1094, category: ts.DiagnosticCategory.Error, key: "An accessor cannot have type parameters." }, + A_set_accessor_cannot_have_a_return_type_annotation: { code: 1095, category: ts.DiagnosticCategory.Error, key: "A 'set' accessor cannot have a return type annotation." }, + An_index_signature_must_have_exactly_one_parameter: { code: 1096, category: ts.DiagnosticCategory.Error, key: "An index signature must have exactly one parameter." }, + _0_list_cannot_be_empty: { code: 1097, category: ts.DiagnosticCategory.Error, key: "'{0}' list cannot be empty." }, + Type_parameter_list_cannot_be_empty: { code: 1098, category: ts.DiagnosticCategory.Error, key: "Type parameter list cannot be empty." }, + Type_argument_list_cannot_be_empty: { code: 1099, category: ts.DiagnosticCategory.Error, key: "Type argument list cannot be empty." }, + Invalid_use_of_0_in_strict_mode: { code: 1100, category: ts.DiagnosticCategory.Error, key: "Invalid use of '{0}' in strict mode." }, + with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: ts.DiagnosticCategory.Error, key: "'with' statements are not allowed in strict mode." }, + delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: ts.DiagnosticCategory.Error, key: "'delete' cannot be called on an identifier in strict mode." }, + A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: ts.DiagnosticCategory.Error, key: "A 'continue' statement can only be used within an enclosing iteration statement." }, + A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: ts.DiagnosticCategory.Error, key: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, + Jump_target_cannot_cross_function_boundary: { code: 1107, category: ts.DiagnosticCategory.Error, key: "Jump target cannot cross function boundary." }, + A_return_statement_can_only_be_used_within_a_function_body: { code: 1108, category: ts.DiagnosticCategory.Error, key: "A 'return' statement can only be used within a function body." }, + Expression_expected: { code: 1109, category: ts.DiagnosticCategory.Error, key: "Expression expected." }, + Type_expected: { code: 1110, category: ts.DiagnosticCategory.Error, key: "Type expected." }, + A_class_member_cannot_be_declared_optional: { code: 1112, category: ts.DiagnosticCategory.Error, key: "A class member cannot be declared optional." }, + A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: ts.DiagnosticCategory.Error, key: "A 'default' clause cannot appear more than once in a 'switch' statement." }, + Duplicate_label_0: { code: 1114, category: ts.DiagnosticCategory.Error, key: "Duplicate label '{0}'" }, + A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: ts.DiagnosticCategory.Error, key: "A 'continue' statement can only jump to a label of an enclosing iteration statement." }, + A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: ts.DiagnosticCategory.Error, key: "A 'break' statement can only jump to a label of an enclosing statement." }, + An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: ts.DiagnosticCategory.Error, key: "An object literal cannot have multiple properties with the same name in strict mode." }, + An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: { code: 1118, category: ts.DiagnosticCategory.Error, key: "An object literal cannot have multiple get/set accessors with the same name." }, + An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { code: 1119, category: ts.DiagnosticCategory.Error, key: "An object literal cannot have property and accessor with the same name." }, + An_export_assignment_cannot_have_modifiers: { code: 1120, category: ts.DiagnosticCategory.Error, key: "An export assignment cannot have modifiers." }, + Octal_literals_are_not_allowed_in_strict_mode: { code: 1121, category: ts.DiagnosticCategory.Error, key: "Octal literals are not allowed in strict mode." }, + A_tuple_type_element_list_cannot_be_empty: { code: 1122, category: ts.DiagnosticCategory.Error, key: "A tuple type element list cannot be empty." }, + Variable_declaration_list_cannot_be_empty: { code: 1123, category: ts.DiagnosticCategory.Error, key: "Variable declaration list cannot be empty." }, + Digit_expected: { code: 1124, category: ts.DiagnosticCategory.Error, key: "Digit expected." }, + Hexadecimal_digit_expected: { code: 1125, category: ts.DiagnosticCategory.Error, key: "Hexadecimal digit expected." }, + Unexpected_end_of_text: { code: 1126, category: ts.DiagnosticCategory.Error, key: "Unexpected end of text." }, + Invalid_character: { code: 1127, category: ts.DiagnosticCategory.Error, key: "Invalid character." }, + Declaration_or_statement_expected: { code: 1128, category: ts.DiagnosticCategory.Error, key: "Declaration or statement expected." }, + Statement_expected: { code: 1129, category: ts.DiagnosticCategory.Error, key: "Statement expected." }, + case_or_default_expected: { code: 1130, category: ts.DiagnosticCategory.Error, key: "'case' or 'default' expected." }, + Property_or_signature_expected: { code: 1131, category: ts.DiagnosticCategory.Error, key: "Property or signature expected." }, + Enum_member_expected: { code: 1132, category: ts.DiagnosticCategory.Error, key: "Enum member expected." }, + Type_reference_expected: { code: 1133, category: ts.DiagnosticCategory.Error, key: "Type reference expected." }, + Variable_declaration_expected: { code: 1134, category: ts.DiagnosticCategory.Error, key: "Variable declaration expected." }, + Argument_expression_expected: { code: 1135, category: ts.DiagnosticCategory.Error, key: "Argument expression expected." }, + Property_assignment_expected: { code: 1136, category: ts.DiagnosticCategory.Error, key: "Property assignment expected." }, + Expression_or_comma_expected: { code: 1137, category: ts.DiagnosticCategory.Error, key: "Expression or comma expected." }, + Parameter_declaration_expected: { code: 1138, category: ts.DiagnosticCategory.Error, key: "Parameter declaration expected." }, + Type_parameter_declaration_expected: { code: 1139, category: ts.DiagnosticCategory.Error, key: "Type parameter declaration expected." }, + Type_argument_expected: { code: 1140, category: ts.DiagnosticCategory.Error, key: "Type argument expected." }, + String_literal_expected: { code: 1141, category: ts.DiagnosticCategory.Error, key: "String literal expected." }, + Line_break_not_permitted_here: { code: 1142, category: ts.DiagnosticCategory.Error, key: "Line break not permitted here." }, + 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." }, + 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." }, + let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1153, category: ts.DiagnosticCategory.Error, key: "'let' declarations are only available when targeting ECMAScript 6 and higher." }, + const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1154, category: ts.DiagnosticCategory.Error, key: "'const' declarations are only available when targeting ECMAScript 6 and higher." }, + const_declarations_must_be_initialized: { code: 1155, category: ts.DiagnosticCategory.Error, key: "'const' declarations must be initialized" }, + const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: ts.DiagnosticCategory.Error, key: "'const' declarations can only be declared inside a block." }, + let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: ts.DiagnosticCategory.Error, key: "'let' declarations can only be declared inside a block." }, + Unterminated_template_literal: { code: 1160, category: ts.DiagnosticCategory.Error, key: "Unterminated template literal." }, + Unterminated_regular_expression_literal: { code: 1161, category: ts.DiagnosticCategory.Error, key: "Unterminated regular expression literal." }, + An_object_member_cannot_be_declared_optional: { code: 1162, category: ts.DiagnosticCategory.Error, key: "An object member cannot be declared optional." }, + yield_expression_must_be_contained_within_a_generator_declaration: { code: 1163, category: ts.DiagnosticCategory.Error, key: "'yield' expression must be contained_within a generator declaration." }, + Computed_property_names_are_not_allowed_in_enums: { code: 1164, category: ts.DiagnosticCategory.Error, key: "Computed property names are not allowed in enums." }, + A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_symbol: { code: 1165, category: ts.DiagnosticCategory.Error, key: "A computed property name in an ambient context must directly refer to a built-in symbol." }, + A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol: { code: 1166, category: ts.DiagnosticCategory.Error, key: "A computed property name in a class property declaration must directly refer to a built-in symbol." }, + Computed_property_names_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1167, category: ts.DiagnosticCategory.Error, key: "Computed property names are only available when targeting ECMAScript 6 and higher." }, + A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol: { code: 1168, category: ts.DiagnosticCategory.Error, key: "A computed property name in a method overload must directly refer to a built-in symbol." }, + A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol: { code: 1169, category: ts.DiagnosticCategory.Error, key: "A computed property name in an interface must directly refer to a built-in symbol." }, + A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol: { code: 1170, category: ts.DiagnosticCategory.Error, key: "A computed property name in a type literal must directly refer to a built-in symbol." }, + A_comma_expression_is_not_allowed_in_a_computed_property_name: { code: 1171, category: ts.DiagnosticCategory.Error, key: "A comma expression is not allowed in a computed property name." }, + extends_clause_already_seen: { code: 1172, category: ts.DiagnosticCategory.Error, key: "'extends' clause already seen." }, + extends_clause_must_precede_implements_clause: { code: 1173, category: ts.DiagnosticCategory.Error, key: "'extends' clause must precede 'implements' clause." }, + Classes_can_only_extend_a_single_class: { code: 1174, category: ts.DiagnosticCategory.Error, key: "Classes can only extend a single class." }, + implements_clause_already_seen: { code: 1175, category: ts.DiagnosticCategory.Error, key: "'implements' clause already seen." }, + Interface_declaration_cannot_have_implements_clause: { code: 1176, category: ts.DiagnosticCategory.Error, key: "Interface declaration cannot have 'implements' clause." }, + Binary_digit_expected: { code: 1177, category: ts.DiagnosticCategory.Error, key: "Binary digit expected." }, + Octal_digit_expected: { code: 1178, category: ts.DiagnosticCategory.Error, key: "Octal digit expected." }, + Unexpected_token_expected: { code: 1179, category: ts.DiagnosticCategory.Error, key: "Unexpected token. '{' expected." }, + Property_destructuring_pattern_expected: { code: 1180, category: ts.DiagnosticCategory.Error, key: "Property destructuring pattern expected." }, + Array_element_destructuring_pattern_expected: { code: 1181, category: ts.DiagnosticCategory.Error, key: "Array element destructuring pattern expected." }, + A_destructuring_declaration_must_have_an_initializer: { code: 1182, category: ts.DiagnosticCategory.Error, key: "A destructuring declaration must have an initializer." }, + Destructuring_declarations_are_not_allowed_in_ambient_contexts: { code: 1183, category: ts.DiagnosticCategory.Error, key: "Destructuring declarations are not allowed in ambient contexts." }, + An_implementation_cannot_be_declared_in_ambient_contexts: { code: 1184, category: ts.DiagnosticCategory.Error, key: "An implementation cannot be declared in ambient contexts." }, + Modifiers_cannot_appear_here: { code: 1184, category: ts.DiagnosticCategory.Error, key: "Modifiers cannot appear here." }, + Merge_conflict_marker_encountered: { code: 1185, category: ts.DiagnosticCategory.Error, key: "Merge conflict marker encountered." }, + A_rest_element_cannot_have_an_initializer: { code: 1186, category: ts.DiagnosticCategory.Error, key: "A rest element cannot have an initializer." }, + A_parameter_property_may_not_be_a_binding_pattern: { code: 1187, category: ts.DiagnosticCategory.Error, key: "A parameter property may not be a binding pattern." }, + Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement: { code: 1188, category: ts.DiagnosticCategory.Error, key: "Only a single variable declaration is allowed in a 'for...of' statement." }, + 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." }, + 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." }, + 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." }, + An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: { code: 1198, category: ts.DiagnosticCategory.Error, key: "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive." }, + Unterminated_Unicode_escape_sequence: { code: 1199, category: ts.DiagnosticCategory.Error, key: "Unterminated Unicode escape sequence." }, + Line_terminator_not_permitted_before_arrow: { code: 1200, category: ts.DiagnosticCategory.Error, key: "Line terminator not permitted before arrow." }, + A_type_annotation_on_an_export_statement_is_only_allowed_in_an_ambient_external_module_declaration: { code: 1201, category: ts.DiagnosticCategory.Error, key: "A type annotation on an export statement is only allowed in an ambient external module declaration." }, + 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." }, + 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." }, + 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." }, + 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}'." }, + 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." }, + A_class_may_only_extend_another_class: { code: 2311, category: ts.DiagnosticCategory.Error, key: "A class may only extend another class." }, + An_interface_may_only_extend_a_class_or_another_interface: { code: 2312, category: ts.DiagnosticCategory.Error, key: "An interface may only extend a class or another interface." }, + Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2313, category: ts.DiagnosticCategory.Error, key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, + Generic_type_0_requires_1_type_argument_s: { code: 2314, category: ts.DiagnosticCategory.Error, key: "Generic type '{0}' requires {1} type argument(s)." }, + Type_0_is_not_generic: { code: 2315, category: ts.DiagnosticCategory.Error, key: "Type '{0}' is not generic." }, + Global_type_0_must_be_a_class_or_interface_type: { code: 2316, category: ts.DiagnosticCategory.Error, key: "Global type '{0}' must be a class or interface type." }, + Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: ts.DiagnosticCategory.Error, key: "Global type '{0}' must have {1} type parameter(s)." }, + Cannot_find_global_type_0: { code: 2318, category: ts.DiagnosticCategory.Error, key: "Cannot find global type '{0}'." }, + Named_property_0_of_types_1_and_2_are_not_identical: { code: 2319, category: ts.DiagnosticCategory.Error, key: "Named property '{0}' of types '{1}' and '{2}' are not identical." }, + Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: ts.DiagnosticCategory.Error, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." }, + Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: ts.DiagnosticCategory.Error, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, + Type_0_is_not_assignable_to_type_1: { code: 2322, category: ts.DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}'." }, + Property_0_is_missing_in_type_1: { code: 2324, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is missing in type '{1}'." }, + Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, + Types_of_property_0_are_incompatible: { code: 2326, category: ts.DiagnosticCategory.Error, key: "Types of property '{0}' are incompatible." }, + Property_0_is_optional_in_type_1_but_required_in_type_2: { code: 2327, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." }, + 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_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." }, + super_can_only_be_referenced_in_a_derived_class: { code: 2335, category: ts.DiagnosticCategory.Error, key: "'super' can only be referenced in a derived class." }, + super_cannot_be_referenced_in_constructor_arguments: { code: 2336, category: ts.DiagnosticCategory.Error, key: "'super' cannot be referenced in constructor arguments." }, + Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: 2337, category: ts.DiagnosticCategory.Error, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, + super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2338, category: ts.DiagnosticCategory.Error, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, + Property_0_does_not_exist_on_type_1: { code: 2339, category: ts.DiagnosticCategory.Error, key: "Property '{0}' does not exist on type '{1}'." }, + Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: ts.DiagnosticCategory.Error, key: "Only public and protected methods of the base class are accessible via the 'super' keyword" }, + Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is private and only accessible within class '{1}'." }, + An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: { code: 2342, category: ts.DiagnosticCategory.Error, key: "An index expression argument must be of type 'string', 'number', 'symbol, or 'any'." }, + Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: ts.DiagnosticCategory.Error, key: "Type '{0}' does not satisfy the constraint '{1}'." }, + Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: ts.DiagnosticCategory.Error, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, + Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: ts.DiagnosticCategory.Error, key: "Supplied parameters do not match any signature of call target." }, + Untyped_function_calls_may_not_accept_type_arguments: { code: 2347, category: ts.DiagnosticCategory.Error, key: "Untyped function calls may not accept type arguments." }, + Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { code: 2348, category: ts.DiagnosticCategory.Error, key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" }, + Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { code: 2349, category: ts.DiagnosticCategory.Error, key: "Cannot invoke an expression whose type lacks a call signature." }, + Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: ts.DiagnosticCategory.Error, key: "Only a void function can be called with the 'new' keyword." }, + Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: ts.DiagnosticCategory.Error, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, + Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: ts.DiagnosticCategory.Error, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, + No_best_common_type_exists_among_return_expressions: { code: 2354, category: ts.DiagnosticCategory.Error, key: "No best common type exists among return expressions." }, + A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: ts.DiagnosticCategory.Error, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, + An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: ts.DiagnosticCategory.Error, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, + The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2357, category: ts.DiagnosticCategory.Error, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, + The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: ts.DiagnosticCategory.Error, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, + The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: ts.DiagnosticCategory.Error, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, + The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: { code: 2360, category: ts.DiagnosticCategory.Error, key: "The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'." }, + The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: ts.DiagnosticCategory.Error, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, + The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: ts.DiagnosticCategory.Error, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, + The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: ts.DiagnosticCategory.Error, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, + Invalid_left_hand_side_of_assignment_expression: { code: 2364, category: ts.DiagnosticCategory.Error, key: "Invalid left-hand side of assignment expression." }, + Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: ts.DiagnosticCategory.Error, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, + Type_parameter_name_cannot_be_0: { code: 2368, category: ts.DiagnosticCategory.Error, key: "Type parameter name cannot be '{0}'" }, + A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: ts.DiagnosticCategory.Error, key: "A parameter property is only allowed in a constructor implementation." }, + A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: ts.DiagnosticCategory.Error, key: "A rest parameter must be of an array type." }, + A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: ts.DiagnosticCategory.Error, key: "A parameter initializer is only allowed in a function or constructor implementation." }, + Parameter_0_cannot_be_referenced_in_its_initializer: { code: 2372, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' cannot be referenced in its initializer." }, + Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { code: 2373, category: ts.DiagnosticCategory.Error, key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." }, + Duplicate_string_index_signature: { code: 2374, category: ts.DiagnosticCategory.Error, key: "Duplicate string index signature." }, + Duplicate_number_index_signature: { code: 2375, category: ts.DiagnosticCategory.Error, key: "Duplicate number index signature." }, + A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: 2376, category: ts.DiagnosticCategory.Error, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, + Constructors_for_derived_classes_must_contain_a_super_call: { code: 2377, category: ts.DiagnosticCategory.Error, key: "Constructors for derived classes must contain a 'super' call." }, + A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2378, category: ts.DiagnosticCategory.Error, key: "A 'get' accessor must return a value or consist of a single 'throw' statement." }, + Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2379, category: ts.DiagnosticCategory.Error, key: "Getter and setter accessors do not agree in visibility." }, + get_and_set_accessor_must_have_the_same_type: { code: 2380, category: ts.DiagnosticCategory.Error, key: "'get' and 'set' accessor must have the same type." }, + A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2381, category: ts.DiagnosticCategory.Error, key: "A signature with an implementation cannot use a string literal type." }, + Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 2382, category: ts.DiagnosticCategory.Error, key: "Specialized overload signature is not assignable to any non-specialized signature." }, + Overload_signatures_must_all_be_exported_or_not_exported: { code: 2383, category: ts.DiagnosticCategory.Error, key: "Overload signatures must all be exported or not exported." }, + Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2384, category: ts.DiagnosticCategory.Error, key: "Overload signatures must all be ambient or non-ambient." }, + Overload_signatures_must_all_be_public_private_or_protected: { code: 2385, category: ts.DiagnosticCategory.Error, key: "Overload signatures must all be public, private or protected." }, + Overload_signatures_must_all_be_optional_or_required: { code: 2386, category: ts.DiagnosticCategory.Error, key: "Overload signatures must all be optional or required." }, + Function_overload_must_be_static: { code: 2387, category: ts.DiagnosticCategory.Error, key: "Function overload must be static." }, + Function_overload_must_not_be_static: { code: 2388, category: ts.DiagnosticCategory.Error, key: "Function overload must not be static." }, + Function_implementation_name_must_be_0: { code: 2389, category: ts.DiagnosticCategory.Error, key: "Function implementation name must be '{0}'." }, + Constructor_implementation_is_missing: { code: 2390, category: ts.DiagnosticCategory.Error, key: "Constructor implementation is missing." }, + Function_implementation_is_missing_or_not_immediately_following_the_declaration: { code: 2391, category: ts.DiagnosticCategory.Error, key: "Function implementation is missing or not immediately following the declaration." }, + Multiple_constructor_implementations_are_not_allowed: { code: 2392, category: ts.DiagnosticCategory.Error, key: "Multiple constructor implementations are not allowed." }, + Duplicate_function_implementation: { code: 2393, category: ts.DiagnosticCategory.Error, key: "Duplicate function implementation." }, + Overload_signature_is_not_compatible_with_function_implementation: { code: 2394, category: ts.DiagnosticCategory.Error, key: "Overload signature is not compatible with function implementation." }, + Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2395, category: ts.DiagnosticCategory.Error, key: "Individual declarations in merged declaration {0} must be all exported or all local." }, + Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2396, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, + Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2399, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, + Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2400, category: ts.DiagnosticCategory.Error, key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, + Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2401, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, + Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { code: 2402, category: ts.DiagnosticCategory.Error, key: "Expression resolves to '_super' that compiler uses to capture base class reference." }, + Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { code: 2403, category: ts.DiagnosticCategory.Error, key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." }, + The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { code: 2404, category: ts.DiagnosticCategory.Error, key: "The left-hand side of a 'for...in' statement cannot use a type annotation." }, + The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { code: 2405, category: ts.DiagnosticCategory.Error, key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." }, + Invalid_left_hand_side_in_for_in_statement: { code: 2406, category: ts.DiagnosticCategory.Error, key: "Invalid left-hand side in 'for...in' statement." }, + The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: ts.DiagnosticCategory.Error, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, + Setters_cannot_return_a_value: { code: 2408, category: ts.DiagnosticCategory.Error, key: "Setters cannot return a value." }, + Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: ts.DiagnosticCategory.Error, key: "Return type of constructor signature must be assignable to the instance type of the class" }, + All_symbols_within_a_with_block_will_be_resolved_to_any: { code: 2410, category: ts.DiagnosticCategory.Error, key: "All symbols within a 'with' block will be resolved to 'any'." }, + Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: ts.DiagnosticCategory.Error, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, + Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: ts.DiagnosticCategory.Error, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, + Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: ts.DiagnosticCategory.Error, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, + Class_name_cannot_be_0: { code: 2414, category: ts.DiagnosticCategory.Error, key: "Class name cannot be '{0}'" }, + Class_0_incorrectly_extends_base_class_1: { code: 2415, category: ts.DiagnosticCategory.Error, key: "Class '{0}' incorrectly extends base class '{1}'." }, + Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: ts.DiagnosticCategory.Error, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, + Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: ts.DiagnosticCategory.Error, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, + Class_0_incorrectly_implements_interface_1: { code: 2420, category: ts.DiagnosticCategory.Error, key: "Class '{0}' incorrectly implements interface '{1}'." }, + A_class_may_only_implement_another_class_or_interface: { code: 2422, category: ts.DiagnosticCategory.Error, key: "A class may only implement another class or interface." }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: ts.DiagnosticCategory.Error, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: ts.DiagnosticCategory.Error, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, + Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: ts.DiagnosticCategory.Error, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, + Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: ts.DiagnosticCategory.Error, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, + Interface_name_cannot_be_0: { code: 2427, category: ts.DiagnosticCategory.Error, key: "Interface name cannot be '{0}'" }, + All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: ts.DiagnosticCategory.Error, key: "All declarations of an interface must have identical type parameters." }, + 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." }, + 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_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." }, + 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}'." }, + Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { code: 2445, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." }, + Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, + The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: ts.DiagnosticCategory.Error, key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, + Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: ts.DiagnosticCategory.Error, key: "Block-scoped variable '{0}' used before its declaration." }, + The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant: { code: 2449, category: ts.DiagnosticCategory.Error, key: "The operand of an increment or decrement operator cannot be a constant." }, + Left_hand_side_of_assignment_expression_cannot_be_a_constant: { code: 2450, category: ts.DiagnosticCategory.Error, key: "Left-hand side of assignment expression cannot be a constant." }, + Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: ts.DiagnosticCategory.Error, key: "Cannot redeclare block-scoped variable '{0}'." }, + An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: ts.DiagnosticCategory.Error, key: "An enum member cannot have a numeric name." }, + The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: ts.DiagnosticCategory.Error, key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, + Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: ts.DiagnosticCategory.Error, key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, + Type_alias_0_circularly_references_itself: { code: 2456, category: ts.DiagnosticCategory.Error, key: "Type alias '{0}' circularly references itself." }, + Type_alias_name_cannot_be_0: { code: 2457, category: ts.DiagnosticCategory.Error, key: "Type alias name cannot be '{0}'" }, + An_AMD_module_cannot_have_multiple_name_assignments: { code: 2458, category: ts.DiagnosticCategory.Error, key: "An AMD module cannot have multiple name assignments." }, + Type_0_has_no_property_1_and_no_string_index_signature: { code: 2459, category: ts.DiagnosticCategory.Error, key: "Type '{0}' has no property '{1}' and no string index signature." }, + Type_0_has_no_property_1: { code: 2460, category: ts.DiagnosticCategory.Error, key: "Type '{0}' has no property '{1}'." }, + Type_0_is_not_an_array_type: { code: 2461, category: ts.DiagnosticCategory.Error, key: "Type '{0}' is not an array type." }, + A_rest_element_must_be_last_in_an_array_destructuring_pattern: { code: 2462, category: ts.DiagnosticCategory.Error, key: "A rest element must be last in an array destructuring pattern" }, + A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: { code: 2463, category: ts.DiagnosticCategory.Error, key: "A binding pattern parameter cannot be optional in an implementation signature." }, + A_computed_property_name_must_be_of_type_string_number_symbol_or_any: { code: 2464, category: ts.DiagnosticCategory.Error, key: "A computed property name must be of type 'string', 'number', 'symbol', or 'any'." }, + this_cannot_be_referenced_in_a_computed_property_name: { code: 2465, category: ts.DiagnosticCategory.Error, key: "'this' cannot be referenced in a computed property name." }, + super_cannot_be_referenced_in_a_computed_property_name: { code: 2466, category: ts.DiagnosticCategory.Error, key: "'super' cannot be referenced in a computed property name." }, + A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: { code: 2467, category: ts.DiagnosticCategory.Error, key: "A computed property name cannot reference a type parameter from its containing type." }, + Cannot_find_global_value_0: { code: 2468, category: ts.DiagnosticCategory.Error, key: "Cannot find global value '{0}'." }, + The_0_operator_cannot_be_applied_to_type_symbol: { code: 2469, category: ts.DiagnosticCategory.Error, key: "The '{0}' operator cannot be applied to type 'symbol'." }, + Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object: { code: 2470, category: ts.DiagnosticCategory.Error, key: "'Symbol' reference does not refer to the global Symbol constructor object." }, + A_computed_property_name_of_the_form_0_must_be_of_type_symbol: { code: 2471, category: ts.DiagnosticCategory.Error, key: "A computed property name of the form '{0}' must be of type 'symbol'." }, + Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_6_and_higher: { code: 2472, category: ts.DiagnosticCategory.Error, key: "Spread operator in 'new' expressions is only available when targeting ECMAScript 6 and higher." }, + Enum_declarations_must_all_be_const_or_non_const: { code: 2473, category: ts.DiagnosticCategory.Error, key: "Enum declarations must all be const or non-const." }, + In_const_enum_declarations_member_initializer_must_be_constant_expression: { code: 2474, category: ts.DiagnosticCategory.Error, key: "In 'const' enum declarations member initializer must be constant expression." }, + const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: { code: 2475, category: ts.DiagnosticCategory.Error, key: "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment." }, + A_const_enum_member_can_only_be_accessed_using_a_string_literal: { code: 2476, category: ts.DiagnosticCategory.Error, key: "A const enum member can only be accessed using a string literal." }, + const_enum_member_initializer_was_evaluated_to_a_non_finite_value: { code: 2477, category: ts.DiagnosticCategory.Error, key: "'const' enum member initializer was evaluated to a non-finite value." }, + const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: { code: 2478, category: ts.DiagnosticCategory.Error, key: "'const' enum member initializer was evaluated to disallowed value 'NaN'." }, + Property_0_does_not_exist_on_const_enum_1: { code: 2479, category: ts.DiagnosticCategory.Error, key: "Property '{0}' does not exist on 'const' enum '{1}'." }, + let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { code: 2480, category: ts.DiagnosticCategory.Error, key: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." }, + Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { code: 2481, category: ts.DiagnosticCategory.Error, key: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." }, + The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: { code: 2483, category: ts.DiagnosticCategory.Error, key: "The left-hand side of a 'for...of' statement cannot use a type annotation." }, + Export_declaration_conflicts_with_exported_declaration_of_0: { code: 2484, category: ts.DiagnosticCategory.Error, key: "Export declaration conflicts with exported declaration of '{0}'" }, + The_left_hand_side_of_a_for_of_statement_cannot_be_a_previously_defined_constant: { code: 2485, category: ts.DiagnosticCategory.Error, key: "The left-hand side of a 'for...of' statement cannot be a previously defined constant." }, + The_left_hand_side_of_a_for_in_statement_cannot_be_a_previously_defined_constant: { code: 2486, category: ts.DiagnosticCategory.Error, key: "The left-hand side of a 'for...in' statement cannot be a previously defined constant." }, + Invalid_left_hand_side_in_for_of_statement: { code: 2487, category: ts.DiagnosticCategory.Error, key: "Invalid left-hand side in 'for...of' statement." }, + The_right_hand_side_of_a_for_of_statement_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2488, category: ts.DiagnosticCategory.Error, key: "The right-hand side of a 'for...of' statement must have a '[Symbol.iterator]()' method that returns an iterator." }, + The_iterator_returned_by_the_right_hand_side_of_a_for_of_statement_must_have_a_next_method: { code: 2489, category: ts.DiagnosticCategory.Error, key: "The iterator returned by the right-hand side of a 'for...of' statement must have a 'next()' method." }, + The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: { code: 2490, category: ts.DiagnosticCategory.Error, key: "The type returned by the 'next()' method of an iterator must have a 'value' property." }, + The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: { code: 2491, category: ts.DiagnosticCategory.Error, key: "The left-hand side of a 'for...in' statement cannot be a destructuring pattern." }, + Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: ts.DiagnosticCategory.Error, key: "Cannot redeclare identifier '{0}' in catch clause" }, + Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: { code: 2493, category: ts.DiagnosticCategory.Error, key: "Tuple type '{0}' with length '{1}' cannot be assigned to tuple with length '{2}'." }, + 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_Consider_using_a_standard_function_expression: { code: 2496, category: ts.DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an arrow function. 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 *'." }, + 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." }, + 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}'." }, + Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4006, category: ts.DiagnosticCategory.Error, key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4008, category: ts.DiagnosticCategory.Error, key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4010, category: ts.DiagnosticCategory.Error, key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, + Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4012, category: ts.DiagnosticCategory.Error, key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." }, + Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: ts.DiagnosticCategory.Error, key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: ts.DiagnosticCategory.Error, key: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, + Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: ts.DiagnosticCategory.Error, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, + Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: ts.DiagnosticCategory.Error, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, + Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: ts.DiagnosticCategory.Error, key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, + Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: ts.DiagnosticCategory.Error, key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, + Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: ts.DiagnosticCategory.Error, key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, + Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: ts.DiagnosticCategory.Error, key: "Exported variable '{0}' has or is using private name '{1}'." }, + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4026, category: ts.DiagnosticCategory.Error, key: "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4027, category: ts.DiagnosticCategory.Error, key: "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, + Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4028, category: ts.DiagnosticCategory.Error, key: "Public static property '{0}' of exported class has or is using private name '{1}'." }, + Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4029, category: ts.DiagnosticCategory.Error, key: "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4030, category: ts.DiagnosticCategory.Error, key: "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, + Public_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4031, category: ts.DiagnosticCategory.Error, key: "Public property '{0}' of exported class has or is using private name '{1}'." }, + Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4032, category: ts.DiagnosticCategory.Error, key: "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, + Property_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4033, category: ts.DiagnosticCategory.Error, key: "Property '{0}' of exported interface has or is using private name '{1}'." }, + Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4034, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4035, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'." }, + Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4036, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4037, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'." }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4038, category: ts.DiagnosticCategory.Error, key: "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4039, category: ts.DiagnosticCategory.Error, key: "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4040, category: ts.DiagnosticCategory.Error, key: "Return type of public static property getter from exported class has or is using private name '{0}'." }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4041, category: ts.DiagnosticCategory.Error, key: "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4042, category: ts.DiagnosticCategory.Error, key: "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4043, category: ts.DiagnosticCategory.Error, key: "Return type of public property getter from exported class has or is using private name '{0}'." }, + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4044, category: ts.DiagnosticCategory.Error, key: "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4045, category: ts.DiagnosticCategory.Error, key: "Return type of constructor signature from exported interface has or is using private name '{0}'." }, + Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4046, category: ts.DiagnosticCategory.Error, key: "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4047, category: ts.DiagnosticCategory.Error, key: "Return type of call signature from exported interface has or is using private name '{0}'." }, + Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4048, category: ts.DiagnosticCategory.Error, key: "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4049, category: ts.DiagnosticCategory.Error, key: "Return type of index signature from exported interface has or is using private name '{0}'." }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4050, category: ts.DiagnosticCategory.Error, key: "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4051, category: ts.DiagnosticCategory.Error, key: "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: { code: 4052, category: ts.DiagnosticCategory.Error, key: "Return type of public static method from exported class has or is using private name '{0}'." }, + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4053, category: ts.DiagnosticCategory.Error, key: "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4054, category: ts.DiagnosticCategory.Error, key: "Return type of public method from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: { code: 4055, category: ts.DiagnosticCategory.Error, key: "Return type of public method from exported class has or is using private name '{0}'." }, + Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4056, category: ts.DiagnosticCategory.Error, key: "Return type of method from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: { code: 4057, category: ts.DiagnosticCategory.Error, key: "Return type of method from exported interface has or is using private name '{0}'." }, + Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4058, category: ts.DiagnosticCategory.Error, key: "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: { code: 4059, category: ts.DiagnosticCategory.Error, key: "Return type of exported function has or is using name '{0}' from private module '{1}'." }, + Return_type_of_exported_function_has_or_is_using_private_name_0: { code: 4060, category: ts.DiagnosticCategory.Error, key: "Return type of exported function has or is using private name '{0}'." }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4061, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4062, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: { code: 4063, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of constructor from exported class has or is using private name '{1}'." }, + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4064, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4065, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4066, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4067, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4068, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4069, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4070, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4071, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4072, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4073, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public method from exported class has or is using private name '{1}'." }, + Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4074, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4075, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of method from exported interface has or is using private name '{1}'." }, + Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, + Exported_type_alias_0_has_or_is_using_private_name_1: { code: 4081, category: ts.DiagnosticCategory.Error, key: "Exported type alias '{0}' has or is using private name '{1}'." }, + Default_export_of_the_module_has_or_is_using_private_name_0: { code: 4082, category: ts.DiagnosticCategory.Error, key: "Default export of the module has or is using private name '{0}'." }, + Loop_contains_block_scoped_variable_0_referenced_by_a_function_in_the_loop_This_is_only_supported_in_ECMAScript_6_or_higher: { code: 4091, category: ts.DiagnosticCategory.Error, key: "Loop contains block-scoped variable '{0}' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher." }, + The_current_host_does_not_support_the_0_option: { code: 5001, category: ts.DiagnosticCategory.Error, key: "The current host does not support the '{0}' option." }, + 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." }, + 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}" }, + Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5038, category: ts.DiagnosticCategory.Error, key: "Option 'mapRoot' cannot be specified without specifying 'sourcemap' option." }, + Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5039, category: ts.DiagnosticCategory.Error, key: "Option 'sourceRoot' cannot be specified without specifying 'sourcemap' option." }, + Option_noEmit_cannot_be_specified_with_option_out_or_outDir: { code: 5040, category: ts.DiagnosticCategory.Error, key: "Option 'noEmit' cannot be specified with option 'out' or 'outDir'." }, + Option_noEmit_cannot_be_specified_with_option_declaration: { code: 5041, category: ts.DiagnosticCategory.Error, key: "Option 'noEmit' cannot be specified with option 'declaration'." }, + Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { code: 5042, category: ts.DiagnosticCategory.Error, key: "Option 'project' cannot be mixed with source files on a command line." }, + Option_sourceMap_cannot_be_specified_with_option_separateCompilation: { code: 5043, category: ts.DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'separateCompilation'." }, + Option_declaration_cannot_be_specified_with_option_separateCompilation: { code: 5044, category: ts.DiagnosticCategory.Error, key: "Option 'declaration' cannot be specified with option 'separateCompilation'." }, + 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." }, + 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." }, + Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { code: 6004, category: ts.DiagnosticCategory.Message, key: "Specifies the location where debugger should locate TypeScript files instead of source locations." }, + Watch_input_files: { code: 6005, category: ts.DiagnosticCategory.Message, key: "Watch input files." }, + Redirect_output_structure_to_the_directory: { code: 6006, category: ts.DiagnosticCategory.Message, key: "Redirect output structure to the directory." }, + Do_not_erase_const_enum_declarations_in_generated_code: { code: 6007, category: ts.DiagnosticCategory.Message, key: "Do not erase const enum declarations in generated code." }, + Do_not_emit_outputs_if_any_type_checking_errors_were_reported: { code: 6008, category: ts.DiagnosticCategory.Message, key: "Do not emit outputs if any type checking errors were reported." }, + 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'" }, + 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." }, + Syntax_Colon_0: { code: 6023, category: ts.DiagnosticCategory.Message, key: "Syntax: {0}" }, + options: { code: 6024, category: ts.DiagnosticCategory.Message, key: "options" }, + file: { code: 6025, category: ts.DiagnosticCategory.Message, key: "file" }, + Examples_Colon_0: { code: 6026, category: ts.DiagnosticCategory.Message, key: "Examples: {0}" }, + Options_Colon: { code: 6027, category: ts.DiagnosticCategory.Message, key: "Options:" }, + Version_0: { code: 6029, category: ts.DiagnosticCategory.Message, key: "Version {0}" }, + Insert_command_line_options_and_files_from_a_file: { code: 6030, category: ts.DiagnosticCategory.Message, key: "Insert command line options and files from a file." }, + File_change_detected_Starting_incremental_compilation: { code: 6032, category: ts.DiagnosticCategory.Message, key: "File change detected. Starting incremental compilation..." }, + KIND: { code: 6034, category: ts.DiagnosticCategory.Message, key: "KIND" }, + FILE: { code: 6035, category: ts.DiagnosticCategory.Message, key: "FILE" }, + VERSION: { code: 6036, category: ts.DiagnosticCategory.Message, key: "VERSION" }, + LOCATION: { code: 6037, category: ts.DiagnosticCategory.Message, key: "LOCATION" }, + DIRECTORY: { code: 6038, category: ts.DiagnosticCategory.Message, key: "DIRECTORY" }, + Compilation_complete_Watching_for_file_changes: { code: 6042, category: ts.DiagnosticCategory.Message, key: "Compilation complete. Watching for file changes." }, + 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'." }, + 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}'." }, + Corrupted_locale_file_0: { code: 6051, category: ts.DiagnosticCategory.Error, key: "Corrupted locale file {0}." }, + Raise_error_on_expressions_and_declarations_with_an_implied_any_type: { code: 6052, category: ts.DiagnosticCategory.Message, key: "Raise error on expressions and declarations with an implied 'any' type." }, + File_0_not_found: { code: 6053, category: ts.DiagnosticCategory.Error, key: "File '{0}' not found." }, + File_0_must_have_extension_ts_or_d_ts: { code: 6054, category: ts.DiagnosticCategory.Error, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, + Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: { code: 6055, category: ts.DiagnosticCategory.Message, key: "Suppress noImplicitAny errors for indexing objects lacking index signatures." }, + Do_not_emit_declarations_for_code_that_has_an_internal_annotation: { code: 6056, category: ts.DiagnosticCategory.Message, key: "Do not emit declarations for code that has an '@internal' annotation." }, + Preserve_new_lines_when_emitting_code: { code: 6057, category: ts.DiagnosticCategory.Message, key: "Preserve new-lines when emitting code." }, + 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." }, + new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: { code: 7009, category: ts.DiagnosticCategory.Error, key: "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type." }, + _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: ts.DiagnosticCategory.Error, key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, + Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: ts.DiagnosticCategory.Error, key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, + Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: ts.DiagnosticCategory.Error, key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, + Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: ts.DiagnosticCategory.Error, key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, + Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: ts.DiagnosticCategory.Error, key: "Index signature of object type implicitly has an 'any' type." }, + 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." }, + You_cannot_rename_this_element: { code: 8000, category: ts.DiagnosticCategory.Error, key: "You cannot rename this element." }, + You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: { code: 8001, category: ts.DiagnosticCategory.Error, key: "You cannot rename elements that are defined in the standard TypeScript library." }, + yield_expressions_are_not_currently_supported: { code: 9000, category: ts.DiagnosticCategory.Error, key: "'yield' expressions are not currently supported." }, + Generators_are_not_currently_supported: { code: 9001, category: ts.DiagnosticCategory.Error, key: "Generators are not currently supported." }, + Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clauses: { code: 9002, category: ts.DiagnosticCategory.Error, key: "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses." }, + class_expressions_are_not_currently_supported: { code: 9003, category: ts.DiagnosticCategory.Error, key: "'class' expressions are not currently supported." }, + class_declarations_are_only_supported_directly_inside_a_module_or_as_a_top_level_declaration: { code: 9004, category: ts.DiagnosticCategory.Error, key: "'class' declarations are only supported directly inside a module or as a top level declaration." } }; })(ts || (ts = {})); +/// +/// var ts; (function (ts) { var textToToken = { - "any": 111, - "as": 101, - "boolean": 112, - "break": 65, - "case": 66, - "catch": 67, - "class": 68, - "continue": 70, - "const": 69, - "constructor": 113, - "debugger": 71, - "declare": 114, - "default": 72, - "delete": 73, - "do": 74, - "else": 75, - "enum": 76, - "export": 77, - "extends": 78, - "false": 79, - "finally": 80, - "for": 81, - "from": 123, - "function": 82, - "get": 115, - "if": 83, - "implements": 102, - "import": 84, - "in": 85, - "instanceof": 86, - "interface": 103, - "let": 104, - "module": 116, - "new": 87, - "null": 88, - "number": 118, - "package": 105, - "private": 106, - "protected": 107, - "public": 108, - "require": 117, - "return": 89, - "set": 119, - "static": 109, - "string": 120, - "super": 90, - "switch": 91, - "symbol": 121, - "this": 92, - "throw": 93, - "true": 94, - "try": 95, - "type": 122, - "typeof": 96, - "var": 97, - "void": 98, - "while": 99, - "with": 100, - "yield": 110, - "of": 124, + "any": 112, + "as": 102, + "boolean": 113, + "break": 66, + "case": 67, + "catch": 68, + "class": 69, + "continue": 71, + "const": 70, + "constructor": 114, + "debugger": 72, + "declare": 115, + "default": 73, + "delete": 74, + "do": 75, + "else": 76, + "enum": 77, + "export": 78, + "extends": 79, + "false": 80, + "finally": 81, + "for": 82, + "from": 124, + "function": 83, + "get": 116, + "if": 84, + "implements": 103, + "import": 85, + "in": 86, + "instanceof": 87, + "interface": 104, + "let": 105, + "module": 117, + "new": 88, + "null": 89, + "number": 119, + "package": 106, + "private": 107, + "protected": 108, + "public": 109, + "require": 118, + "return": 90, + "set": 120, + "static": 110, + "string": 121, + "super": 91, + "switch": 92, + "symbol": 122, + "this": 93, + "throw": 94, + "true": 95, + "try": 96, + "type": 123, + "typeof": 97, + "var": 98, + "void": 99, + "while": 100, + "with": 101, + "yield": 111, + "of": 125, "{": 14, "}": 15, "(": 16, @@ -1466,18 +1520,19 @@ var ts; "||": 49, "?": 50, ":": 51, - "=": 52, - "+=": 53, - "-=": 54, - "*=": 55, - "/=": 56, - "%=": 57, - "<<=": 58, - ">>=": 59, - ">>>=": 60, - "&=": 61, - "|=": 62, - "^=": 63 + "=": 53, + "+=": 54, + "-=": 55, + "*=": 56, + "/=": 57, + "%=": 58, + "<<=": 59, + ">>=": 60, + ">>>=": 61, + "&=": 62, + "|=": 63, + "^=": 64, + "@": 52 }; var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; @@ -1518,9 +1573,9 @@ var ts; } function makeReverseMap(source) { var result = []; - for (var _name in source) { - if (source.hasOwnProperty(_name)) { - result[source[_name]] = _name; + for (var name_2 in source) { + if (source.hasOwnProperty(name_2)) { + result[source[name_2]] = name_2; } } return result; @@ -1530,6 +1585,10 @@ var ts; return tokenStrings[t]; } ts.tokenToString = tokenToString; + function stringToToken(s) { + return textToToken[s]; + } + ts.stringToToken = stringToToken; function computeLineStarts(text) { var result = new Array(); var pos = 0; @@ -1587,13 +1646,35 @@ var ts; ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition; var hasOwnProperty = Object.prototype.hasOwnProperty; function isWhiteSpace(ch) { - return ch === 32 || ch === 9 || ch === 11 || ch === 12 || - ch === 160 || ch === 5760 || ch >= 8192 && ch <= 8203 || - ch === 8239 || ch === 8287 || ch === 12288 || ch === 65279; + return ch === 32 || + ch === 9 || + ch === 11 || + ch === 12 || + ch === 160 || + ch === 133 || + ch === 5760 || + ch >= 8192 && ch <= 8203 || + ch === 8239 || + ch === 8287 || + ch === 12288 || + ch === 65279; } ts.isWhiteSpace = isWhiteSpace; function isLineBreak(ch) { - return ch === 10 || ch === 13 || ch === 8232 || ch === 8233 || ch === 133; + // ES5 7.3: + // The ECMAScript line terminator characters are listed in Table 3. + // Table 3 � Line Terminator Characters + // Code Unit Value Name Formal Name + // \u000A Line Feed + // \u000D Carriage Return + // \u2028 Line separator + // \u2029 Paragraph separator + // Only the characters in Table 3 are treated as line terminators. Other new line or line + // breaking characters are treated as white space but not as line terminators. + return ch === 10 || + ch === 13 || + ch === 8232 || + ch === 8233; } ts.isLineBreak = isLineBreak; function isDigit(ch) { @@ -1696,8 +1777,8 @@ var ts; else { ts.Debug.assert(ch === 61); while (pos < len) { - var _ch = text.charCodeAt(pos); - if (_ch === 62 && isConflictMarkerTrivia(text, pos)) { + var ch_1 = text.charCodeAt(pos); + if (ch_1 === 62 && isConflictMarkerTrivia(text, pos)) { break; } pos++; @@ -1712,8 +1793,9 @@ var ts; var ch = text.charCodeAt(pos); switch (ch) { case 13: - if (text.charCodeAt(pos + 1) === 10) + if (text.charCodeAt(pos + 1) === 10) { pos++; + } case 10: pos++; if (trailing) { @@ -1755,8 +1837,9 @@ var ts; } } if (collecting) { - if (!result) + if (!result) { result = []; + } result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine }); } continue; @@ -2095,14 +2178,14 @@ var ts; return result; } function getIdentifierToken() { - var _len = tokenValue.length; - if (_len >= 2 && _len <= 11) { + var len = tokenValue.length; + if (len >= 2 && len <= 11) { var ch = tokenValue.charCodeAt(0); if (ch >= 97 && ch <= 122 && hasOwnProperty.call(textToToken, tokenValue)) { return token = textToToken[tokenValue]; } } - return token = 64; + return token = 65; } function scanBinaryOrOctalDigits(base) { ts.Debug.assert(base !== 2 || base !== 8, "Expected either base 2 or base 8"); @@ -2181,7 +2264,7 @@ var ts; return token = scanTemplateAndSetTokenValue(); case 37: if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 57; + return pos += 2, token = 58; } return pos++, token = 37; case 38: @@ -2189,7 +2272,7 @@ var ts; return pos += 2, token = 48; } if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 61; + return pos += 2, token = 62; } return pos++, token = 43; case 40: @@ -2198,7 +2281,7 @@ var ts; return pos++, token = 17; case 42: if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 55; + return pos += 2, token = 56; } return pos++, token = 35; case 43: @@ -2206,7 +2289,7 @@ var ts; return pos += 2, token = 38; } if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 53; + return pos += 2, token = 54; } return pos++, token = 33; case 44: @@ -2216,7 +2299,7 @@ var ts; return pos += 2, token = 39; } if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 54; + return pos += 2, token = 55; } return pos++, token = 34; case 46: @@ -2248,13 +2331,13 @@ var ts; pos += 2; var commentClosed = false; while (pos < len) { - var _ch = text.charCodeAt(pos); - if (_ch === 42 && text.charCodeAt(pos + 1) === 47) { + var ch_2 = text.charCodeAt(pos); + if (ch_2 === 42 && text.charCodeAt(pos + 1) === 47) { pos += 2; commentClosed = true; break; } - if (isLineBreak(_ch)) { + if (isLineBreak(ch_2)) { precedingLineBreak = true; } pos++; @@ -2271,7 +2354,7 @@ var ts; } } if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 56; + return pos += 2, token = 57; } return pos++, token = 36; case 48: @@ -2287,22 +2370,22 @@ var ts; } else if (pos + 2 < len && (text.charCodeAt(pos + 1) === 66 || text.charCodeAt(pos + 1) === 98)) { pos += 2; - var _value = scanBinaryOrOctalDigits(2); - if (_value < 0) { + var value = scanBinaryOrOctalDigits(2); + if (value < 0) { error(ts.Diagnostics.Binary_digit_expected); - _value = 0; + value = 0; } - tokenValue = "" + _value; + tokenValue = "" + value; return token = 7; } else if (pos + 2 < len && (text.charCodeAt(pos + 1) === 79 || text.charCodeAt(pos + 1) === 111)) { pos += 2; - var _value_1 = scanBinaryOrOctalDigits(8); - if (_value_1 < 0) { + var value = scanBinaryOrOctalDigits(8); + if (value < 0) { error(ts.Diagnostics.Octal_digit_expected); - _value_1 = 0; + value = 0; } - tokenValue = "" + _value_1; + tokenValue = "" + value; return token = 7; } if (pos + 1 < len && isOctalDigit(text.charCodeAt(pos + 1))) { @@ -2336,7 +2419,7 @@ var ts; } if (text.charCodeAt(pos + 1) === 60) { if (text.charCodeAt(pos + 2) === 61) { - return pos += 3, token = 58; + return pos += 3, token = 59; } return pos += 2, token = 40; } @@ -2363,7 +2446,7 @@ var ts; if (text.charCodeAt(pos + 1) === 62) { return pos += 2, token = 32; } - return pos++, token = 52; + return pos++, token = 53; case 62: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); @@ -2383,7 +2466,7 @@ var ts; return pos++, token = 19; case 94: if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 63; + return pos += 2, token = 64; } return pos++, token = 45; case 123: @@ -2393,13 +2476,15 @@ var ts; return pos += 2, token = 49; } if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 62; + return pos += 2, token = 63; } return pos++, token = 44; case 125: return pos++, token = 15; case 126: return pos++, token = 47; + case 64: + return pos++, token = 52; case 92: var cookedChar = peekUnicodeEscape(); if (cookedChar >= 0 && isIdentifierStart(cookedChar)) { @@ -2439,12 +2524,12 @@ var ts; if (text.charCodeAt(pos) === 62) { if (text.charCodeAt(pos + 1) === 62) { if (text.charCodeAt(pos + 2) === 61) { - return pos += 3, token = 60; + return pos += 3, token = 61; } return pos += 2, token = 42; } if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 59; + return pos += 2, token = 60; } return pos++, token = 41; } @@ -2455,7 +2540,7 @@ var ts; return token; } function reScanSlashToken() { - if (token === 36 || token === 56) { + if (token === 36 || token === 57) { var p = tokenPos + 1; var inEscape = false; var inCharacterClass = false; @@ -2549,8 +2634,8 @@ var ts; getTokenValue: function () { return tokenValue; }, hasExtendedUnicodeEscape: function () { return hasExtendedUnicodeEscape; }, hasPrecedingLineBreak: function () { return precedingLineBreak; }, - isIdentifier: function () { return token === 64 || token > 100; }, - isReservedWord: function () { return token >= 65 && token <= 100; }, + isIdentifier: function () { return token === 65 || token > 101; }, + isReservedWord: function () { return token >= 66 && token <= 101; }, isUnterminated: function () { return tokenIsUnterminated; }, reScanGreaterToken: reScanGreaterToken, reScanSlashToken: reScanSlashToken, @@ -2564,6 +2649,10 @@ var ts; } ts.createScanner = createScanner; })(ts || (ts = {})); +/// +/// +/// +/// var ts; (function (ts) { ts.optionDeclarations = [ @@ -2571,10 +2660,6 @@ var ts; name: "charset", type: "string" }, - { - name: "codepage", - type: "number" - }, { name: "declaration", shortName: "d", @@ -2640,10 +2725,6 @@ var ts; name: "noLib", type: "boolean" }, - { - name: "noLibCheck", - type: "boolean" - }, { name: "noResolve", type: "boolean" @@ -2679,6 +2760,10 @@ var ts; type: "boolean", description: ts.Diagnostics.Do_not_emit_comments_to_output }, + { + name: "separateCompilation", + type: "boolean" + }, { name: "sourceMap", type: "boolean", @@ -2702,18 +2787,6 @@ var ts; description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, experimental: true }, - { - name: "preserveNewLines", - type: "boolean", - description: ts.Diagnostics.Preserve_new_lines_when_emitting_code, - experimental: true - }, - { - name: "cacheDownlevelForOfLength", - type: "boolean", - description: "Cache length access when downlevel emitting for-of statements", - experimental: true - }, { name: "target", shortName: "t", @@ -2914,11 +2987,12 @@ var ts; } ts.parseConfigFile = parseConfigFile; })(ts || (ts = {})); +/// var ts; (function (ts) { function getDeclarationOfKind(symbol, kind) { var declarations = symbol.declarations; - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; if (declaration.kind === kind) { return declaration; @@ -2962,21 +3036,21 @@ var ts; ts.getFullWidth = getFullWidth; function containsParseError(node) { aggregateChildData(node); - return (node.parserContextFlags & 32) !== 0; + return (node.parserContextFlags & 64) !== 0; } ts.containsParseError = containsParseError; function aggregateChildData(node) { - if (!(node.parserContextFlags & 64)) { - var thisNodeOrAnySubNodesHasError = ((node.parserContextFlags & 16) !== 0) || + if (!(node.parserContextFlags & 128)) { + var thisNodeOrAnySubNodesHasError = ((node.parserContextFlags & 32) !== 0) || ts.forEachChild(node, containsParseError); if (thisNodeOrAnySubNodesHasError) { - node.parserContextFlags |= 32; + node.parserContextFlags |= 64; } - node.parserContextFlags |= 64; + node.parserContextFlags |= 128; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 221) { + while (node && node.kind !== 227) { node = node.parent; } return node; @@ -3058,15 +3132,15 @@ var ts; return current; } switch (current.kind) { - case 221: - case 202: - case 217: - case 200: - case 181: - case 182: - case 183: + case 227: + case 207: + case 223: + case 205: + case 186: + case 187: + case 188: return current; - case 174: + case 179: if (!isFunctionLike(current.parent)) { return current; } @@ -3077,9 +3151,9 @@ var ts; ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; function isCatchClauseVariableDeclaration(declaration) { return declaration && - declaration.kind === 193 && + declaration.kind === 198 && declaration.parent && - declaration.parent.kind === 217; + declaration.parent.kind === 223; } ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration; function declarationNameToString(name) { @@ -3116,15 +3190,22 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 193: - case 150: - case 196: - case 197: + case 227: + var pos_1 = ts.skipTrivia(sourceFile.text, 0, false); + if (pos_1 === sourceFile.text.length) { + return createTextSpan(0, 0); + } + return getSpanOfTokenAtPosition(sourceFile, pos_1); + case 198: + case 152: + case 201: + case 174: + case 202: + case 205: + case 204: + case 226: case 200: - case 199: - case 220: - case 195: - case 160: + case 162: errorNode = node.name; break; } @@ -3146,11 +3227,11 @@ var ts; } ts.isDeclarationFile = isDeclarationFile; function isConstEnumDeclaration(node) { - return node.kind === 199 && isConst(node); + return node.kind === 204 && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 150 || isBindingPattern(node))) { + while (node && (node.kind === 152 || isBindingPattern(node))) { node = node.parent; } return node; @@ -3158,14 +3239,14 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 193) { + if (node.kind === 198) { node = node.parent; } - if (node && node.kind === 194) { + if (node && node.kind === 199) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 175) { + if (node && node.kind === 180) { flags |= node.flags; } return flags; @@ -3180,12 +3261,11 @@ var ts; } ts.isLet = isLet; function isPrologueDirective(node) { - return node.kind === 177 && node.expression.kind === 8; + return node.kind === 182 && node.expression.kind === 8; } ts.isPrologueDirective = isPrologueDirective; function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { - sourceFileOfNode = sourceFileOfNode || getSourceFileOfNode(node); - if (node.kind === 128 || node.kind === 127) { + if (node.kind === 129 || node.kind === 128) { return ts.concatenate(ts.getTrailingCommentRanges(sourceFileOfNode.text, node.pos), ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos)); } else { @@ -3207,23 +3287,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 186: + case 191: return visitor(node); - case 202: - case 174: - case 178: + case 207: case 179: - case 180: - case 181: - case 182: case 183: + case 184: + case 185: + case 186: case 187: case 188: - case 214: - case 215: - case 189: - case 191: - case 217: + case 192: + case 193: + case 220: + case 221: + case 194: + case 196: + case 223: return ts.forEachChild(node, traverse); } } @@ -3232,14 +3312,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 150: - case 220: - case 128: - case 218: - case 130: + case 152: + case 226: case 129: - case 219: - case 193: + case 224: + case 132: + case 131: + case 225: + case 198: return true; } } @@ -3249,22 +3329,22 @@ var ts; function isFunctionLike(node) { if (node) { switch (node.kind) { - case 133: - case 160: - case 195: - case 161: - case 132: - case 131: - case 134: case 135: + case 162: + case 200: + case 163: + case 134: + case 133: case 136: case 137: case 138: + case 139: case 140: - case 141: - case 160: - case 161: - case 195: + case 142: + case 143: + case 162: + case 163: + case 200: return true; } } @@ -3272,11 +3352,11 @@ var ts; } ts.isFunctionLike = isFunctionLike; function isFunctionBlock(node) { - return node && node.kind === 174 && isFunctionLike(node.parent); + return node && node.kind === 179 && isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 132 && node.parent.kind === 152; + return node && node.kind === 134 && node.parent.kind === 154; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function getContainingFunction(node) { @@ -3295,28 +3375,28 @@ var ts; return undefined; } switch (node.kind) { - case 126: - if (node.parent.parent.kind === 196) { + case 127: + if (node.parent.parent.kind === 201) { return node; } node = node.parent; break; - case 161: + case 163: if (!includeArrowFunctions) { continue; } - case 195: - case 160: case 200: - case 130: - case 129: + case 162: + case 205: case 132: case 131: - case 133: case 134: + case 133: case 135: - case 199: - case 221: + case 136: + case 137: + case 204: + case 227: return node; } } @@ -3328,47 +3408,104 @@ var ts; if (!node) return node; switch (node.kind) { - case 126: - if (node.parent.parent.kind === 196) { + case 127: + if (node.parent.parent.kind === 201) { return node; } node = node.parent; break; - case 195: - case 160: - case 161: + case 200: + case 162: + case 163: if (!includeFunctions) { continue; } - case 130: - case 129: case 132: case 131: - case 133: case 134: + case 133: case 135: + case 136: + case 137: return node; } } } ts.getSuperContainer = getSuperContainer; function getInvokedExpression(node) { - if (node.kind === 157) { + if (node.kind === 159) { return node.tag; } return node.expression; } ts.getInvokedExpression = getInvokedExpression; + function nodeCanBeDecorated(node) { + switch (node.kind) { + case 201: + return true; + case 132: + return node.parent.kind === 201; + case 129: + return node.parent.body && node.parent.parent.kind === 201; + case 136: + case 137: + case 134: + return node.body && node.parent.kind === 201; + } + return false; + } + ts.nodeCanBeDecorated = nodeCanBeDecorated; + function nodeIsDecorated(node) { + switch (node.kind) { + case 201: + if (node.decorators) { + return true; + } + return false; + case 132: + case 129: + if (node.decorators) { + return true; + } + return false; + case 136: + if (node.body && node.decorators) { + return true; + } + return false; + case 134: + case 137: + if (node.body && node.decorators) { + return true; + } + return false; + } + return false; + } + ts.nodeIsDecorated = nodeIsDecorated; + function childIsDecorated(node) { + switch (node.kind) { + case 201: + return ts.forEach(node.members, nodeOrChildIsDecorated); + case 134: + case 137: + return ts.forEach(node.parameters, nodeIsDecorated); + } + return false; + } + ts.childIsDecorated = childIsDecorated; + function nodeOrChildIsDecorated(node) { + return nodeIsDecorated(node) || childIsDecorated(node); + } + ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function isExpression(node) { switch (node.kind) { - case 92: - case 90: - case 88: - case 94: - case 79: + case 93: + case 91: + case 89: + case 95: + case 80: case 9: - case 151: - case 152: case 153: case 154: case 155: @@ -3378,68 +3515,71 @@ var ts; case 159: case 160: case 161: - case 164: case 162: + case 174: case 163: - case 165: case 166: + case 164: + case 165: case 167: case 168: - case 171: case 169: + case 170: + case 173: + case 171: case 10: - case 172: + case 175: return true; - case 125: - while (node.parent.kind === 125) { + case 126: + while (node.parent.kind === 126) { node = node.parent; } - return node.parent.kind === 142; - case 64: - if (node.parent.kind === 142) { + return node.parent.kind === 144; + case 65: + if (node.parent.kind === 144) { return true; } case 7: case 8: - var _parent = node.parent; - switch (_parent.kind) { - case 193: - case 128: - case 130: + var parent_1 = node.parent; + switch (parent_1.kind) { + case 198: case 129: - case 220: - case 218: - case 150: - return _parent.initializer === node; - case 177: - case 178: - case 179: - case 180: - case 186: - case 187: - case 188: - case 214: - case 190: - case 188: - return _parent.expression === node; - case 181: - var forStatement = _parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 194) || - forStatement.condition === node || - forStatement.iterator === node; + case 132: + case 131: + case 226: + case 224: + case 152: + return parent_1.initializer === node; case 182: case 183: - var forInStatement = _parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 194) || + case 184: + case 185: + case 191: + case 192: + case 193: + case 220: + case 195: + case 193: + 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: + case 188: + var forInStatement = parent_1; + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 199) || forInStatement.expression === node; - case 158: - return node === _parent.expression; - case 173: - return node === _parent.expression; - case 126: - return node === _parent.expression; + case 160: + return node === parent_1.expression; + case 176: + return node === parent_1.expression; + case 127: + return node === parent_1.expression; default: - if (isExpression(_parent)) { + if (isExpression(parent_1)) { return true; } } @@ -3454,7 +3594,7 @@ var ts; } ts.isInstantiatedModule = isInstantiatedModule; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 203 && node.moduleReference.kind === 213; + return node.kind === 208 && node.moduleReference.kind === 219; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -3463,41 +3603,41 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 203 && node.moduleReference.kind !== 213; + return node.kind === 208 && node.moduleReference.kind !== 219; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function getExternalModuleName(node) { - if (node.kind === 204) { + if (node.kind === 209) { return node.moduleSpecifier; } - if (node.kind === 203) { + if (node.kind === 208) { var reference = node.moduleReference; - if (reference.kind === 213) { + if (reference.kind === 219) { return reference.expression; } } - if (node.kind === 210) { + if (node.kind === 215) { return node.moduleSpecifier; } } ts.getExternalModuleName = getExternalModuleName; function hasDotDotDotToken(node) { - return node && node.kind === 128 && node.dotDotDotToken !== undefined; + return node && node.kind === 129 && node.dotDotDotToken !== undefined; } ts.hasDotDotDotToken = hasDotDotDotToken; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 128: + case 129: return node.questionToken !== undefined; + case 134: + case 133: + return node.questionToken !== undefined; + case 225: + case 224: case 132: case 131: return node.questionToken !== undefined; - case 219: - case 218: - case 130: - case 129: - return node.questionToken !== undefined; } } return false; @@ -3520,7 +3660,7 @@ var ts; } ts.isTemplateLiteralKind = isTemplateLiteralKind; function isBindingPattern(node) { - return !!node && (node.kind === 149 || node.kind === 148); + return !!node && (node.kind === 151 || node.kind === 150); } ts.isBindingPattern = isBindingPattern; function isInAmbientContext(node) { @@ -3535,33 +3675,33 @@ var ts; ts.isInAmbientContext = isInAmbientContext; function isDeclaration(node) { switch (node.kind) { - case 161: - case 150: - case 196: - case 133: - case 199: - case 220: - case 212: - case 195: - case 160: - case 134: - case 205: - case 203: + 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 197: + case 213: + case 202: + case 134: + case 133: + case 205: + case 211: + case 129: + case 224: case 132: case 131: - case 200: - case 206: + case 137: + case 225: + case 203: case 128: - case 218: - case 130: - case 129: - case 135: - case 219: case 198: - case 127: - case 193: return true; } return false; @@ -3569,65 +3709,88 @@ var ts; ts.isDeclaration = isDeclaration; function isStatement(n) { switch (n.kind) { - case 185: - case 184: - case 192: - case 179: - case 177: - case 176: - case 182: - case 183: - case 181: - case 178: + case 190: case 189: - case 186: - case 188: - case 93: - case 191: - case 175: - case 180: + case 197: + case 184: + case 182: + case 181: case 187: - case 209: + case 188: + case 186: + case 183: + case 194: + case 191: + case 193: + case 94: + case 196: + case 180: + case 185: + case 192: + case 214: return true; default: return false; } } ts.isStatement = isStatement; + function isClassElement(n) { + switch (n.kind) { + case 135: + case 132: + case 134: + case 136: + case 137: + case 140: + return true; + default: + return false; + } + } + ts.isClassElement = isClassElement; function isDeclarationName(name) { - if (name.kind !== 64 && name.kind !== 8 && name.kind !== 7) { + if (name.kind !== 65 && name.kind !== 8 && name.kind !== 7) { return false; } - var _parent = name.parent; - if (_parent.kind === 208 || _parent.kind === 212) { - if (_parent.propertyName) { + var parent = name.parent; + if (parent.kind === 213 || parent.kind === 217) { + if (parent.propertyName) { return true; } } - if (isDeclaration(_parent)) { - return _parent.name === name; + if (isDeclaration(parent)) { + return parent.name === name; } return false; } ts.isDeclarationName = isDeclarationName; - function getClassBaseTypeNode(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 78); + 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; + } + ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; + function getClassExtendsHeritageClauseElement(node) { + var heritageClause = getHeritageClause(node.heritageClauses, 79); return heritageClause && heritageClause.types.length > 0 ? heritageClause.types[0] : undefined; } - ts.getClassBaseTypeNode = getClassBaseTypeNode; - function getClassImplementedTypeNodes(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 102); + ts.getClassExtendsHeritageClauseElement = getClassExtendsHeritageClauseElement; + function getClassImplementsHeritageClauseElements(node) { + var heritageClause = getHeritageClause(node.heritageClauses, 103); return heritageClause ? heritageClause.types : undefined; } - ts.getClassImplementedTypeNodes = getClassImplementedTypeNodes; + ts.getClassImplementsHeritageClauseElements = getClassImplementsHeritageClauseElements; function getInterfaceBaseTypeNodes(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 78); + var heritageClause = getHeritageClause(node.heritageClauses, 79); return heritageClause ? heritageClause.types : undefined; } ts.getInterfaceBaseTypeNodes = getInterfaceBaseTypeNodes; function getHeritageClause(clauses, kind) { if (clauses) { - for (var _i = 0, _n = clauses.length; _i < _n; _i++) { + for (var _i = 0; _i < clauses.length; _i++) { var clause = clauses[_i]; if (clause.token === kind) { return clause; @@ -3690,7 +3853,7 @@ var ts; } ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; function isKeyword(token) { - return 65 <= token && token <= 124; + return 66 <= token && token <= 125; } ts.isKeyword = isKeyword; function isTrivia(token) { @@ -3699,19 +3862,19 @@ var ts; ts.isTrivia = isTrivia; function hasDynamicName(declaration) { return declaration.name && - declaration.name.kind === 126 && + declaration.name.kind === 127 && !isWellKnownSymbolSyntactically(declaration.name.expression); } ts.hasDynamicName = hasDynamicName; function isWellKnownSymbolSyntactically(node) { - return node.kind === 153 && isESSymbolIdentifier(node.expression); + return node.kind === 155 && isESSymbolIdentifier(node.expression); } ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically; function getPropertyNameForPropertyNameNode(name) { - if (name.kind === 64 || name.kind === 8 || name.kind === 7) { + if (name.kind === 65 || name.kind === 8 || name.kind === 7) { return name.text; } - if (name.kind === 126) { + if (name.kind === 127) { var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { var rightHandSideName = nameExpression.name.text; @@ -3726,19 +3889,19 @@ var ts; } ts.getPropertyNameForKnownSymbolName = getPropertyNameForKnownSymbolName; function isESSymbolIdentifier(node) { - return node.kind === 64 && node.text === "Symbol"; + return node.kind === 65 && node.text === "Symbol"; } ts.isESSymbolIdentifier = isESSymbolIdentifier; function isModifier(token) { switch (token) { - case 108: - case 106: - case 107: case 109: - case 77: - case 114: - case 69: - case 72: + case 107: + case 108: + case 110: + case 78: + case 115: + case 70: + case 73: return true; } return false; @@ -3854,7 +4017,7 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function nodeStartsNewLexicalEnvironment(n) { - return isFunctionLike(n) || n.kind === 200 || n.kind === 221; + return isFunctionLike(n) || n.kind === 205 || n.kind === 227; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(node) { @@ -3869,26 +4032,6 @@ var ts; return node; } ts.createSynthesizedNode = createSynthesizedNode; - function generateUniqueName(baseName, isExistingName) { - if (baseName.charCodeAt(0) !== 95) { - baseName = "_" + baseName; - if (!isExistingName(baseName)) { - return baseName; - } - } - if (baseName.charCodeAt(baseName.length - 1) !== 95) { - baseName += "_"; - } - var i = 1; - while (true) { - var _name = baseName + i; - if (!isExistingName(_name)) { - return _name; - } - i++; - } - } - ts.generateUniqueName = generateUniqueName; function createDiagnosticCollection() { var nonFileDiagnostics = []; var fileDiagnostics = {}; @@ -3989,10 +4132,291 @@ var ts; s; } ts.escapeNonAsciiCharacters = escapeNonAsciiCharacters; + var indentStrings = ["", " "]; + function getIndentString(level) { + if (indentStrings[level] === undefined) { + indentStrings[level] = getIndentString(level - 1) + indentStrings[1]; + } + return indentStrings[level]; + } + ts.getIndentString = getIndentString; + function getIndentSize() { + return indentStrings[1].length; + } + ts.getIndentSize = getIndentSize; + function createTextWriter(newLine) { + var output = ""; + var indent = 0; + var lineStart = true; + var lineCount = 0; + var linePos = 0; + function write(s) { + if (s && s.length) { + if (lineStart) { + output += getIndentString(indent); + lineStart = false; + } + output += s; + } + } + function rawWrite(s) { + if (s !== undefined) { + if (lineStart) { + lineStart = false; + } + output += s; + } + } + function writeLiteral(s) { + if (s && s.length) { + write(s); + var lineStartsOfS = ts.computeLineStarts(s); + if (lineStartsOfS.length > 1) { + lineCount = lineCount + lineStartsOfS.length - 1; + linePos = output.length - s.length + lineStartsOfS[lineStartsOfS.length - 1]; + } + } + } + function writeLine() { + if (!lineStart) { + output += newLine; + lineCount++; + linePos = output.length; + lineStart = true; + } + } + function writeTextOfNode(sourceFile, node) { + write(getSourceTextOfNodeFromSourceFile(sourceFile, node)); + } + return { + write: write, + rawWrite: rawWrite, + writeTextOfNode: writeTextOfNode, + writeLiteral: writeLiteral, + writeLine: writeLine, + increaseIndent: function () { return indent++; }, + decreaseIndent: function () { return indent--; }, + getIndent: function () { return indent; }, + getTextPos: function () { return output.length; }, + getLine: function () { return lineCount + 1; }, + getColumn: function () { return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; }, + getText: function () { return output; } + }; + } + ts.createTextWriter = createTextWriter; + function getOwnEmitOutputFilePath(sourceFile, host, extension) { + var compilerOptions = host.getCompilerOptions(); + var emitOutputFilePathWithoutExtension; + if (compilerOptions.outDir) { + emitOutputFilePathWithoutExtension = ts.removeFileExtension(getSourceFilePathInNewDir(sourceFile, host, compilerOptions.outDir)); + } + else { + emitOutputFilePathWithoutExtension = ts.removeFileExtension(sourceFile.fileName); + } + return emitOutputFilePathWithoutExtension + extension; + } + ts.getOwnEmitOutputFilePath = getOwnEmitOutputFilePath; + function getSourceFilePathInNewDir(sourceFile, host, newDirPath) { + var sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.fileName, host.getCurrentDirectory()); + sourceFilePath = sourceFilePath.replace(host.getCommonSourceDirectory(), ""); + return ts.combinePaths(newDirPath, sourceFilePath); + } + ts.getSourceFilePathInNewDir = getSourceFilePathInNewDir; + function writeFile(host, diagnostics, fileName, data, writeByteOrderMark) { + host.writeFile(fileName, data, writeByteOrderMark, function (hostErrorMessage) { + diagnostics.push(ts.createCompilerDiagnostic(ts.Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage)); + }); + } + ts.writeFile = writeFile; + function getLineOfLocalPosition(currentSourceFile, pos) { + return ts.getLineAndCharacterOfPosition(currentSourceFile, pos).line; + } + ts.getLineOfLocalPosition = getLineOfLocalPosition; + function getFirstConstructorWithBody(node) { + return ts.forEach(node.members, function (member) { + if (member.kind === 135 && nodeIsPresent(member.body)) { + return member; + } + }); + } + ts.getFirstConstructorWithBody = getFirstConstructorWithBody; + function shouldEmitToOwnFile(sourceFile, compilerOptions) { + if (!isDeclarationFile(sourceFile)) { + if ((isExternalModule(sourceFile) || !compilerOptions.out) && !ts.fileExtensionIs(sourceFile.fileName, ".js")) { + return true; + } + return false; + } + return false; + } + ts.shouldEmitToOwnFile = shouldEmitToOwnFile; + function getAllAccessorDeclarations(declarations, accessor) { + var firstAccessor; + var secondAccessor; + var getAccessor; + var setAccessor; + if (hasDynamicName(accessor)) { + firstAccessor = accessor; + if (accessor.kind === 136) { + getAccessor = accessor; + } + else if (accessor.kind === 137) { + setAccessor = accessor; + } + else { + ts.Debug.fail("Accessor has wrong kind"); + } + } + else { + ts.forEach(declarations, function (member) { + if ((member.kind === 136 || member.kind === 137) + && (member.flags & 128) === (accessor.flags & 128)) { + var memberName = getPropertyNameForPropertyNameNode(member.name); + var accessorName = getPropertyNameForPropertyNameNode(accessor.name); + if (memberName === accessorName) { + if (!firstAccessor) { + firstAccessor = member; + } + else if (!secondAccessor) { + secondAccessor = member; + } + if (member.kind === 136 && !getAccessor) { + getAccessor = member; + } + if (member.kind === 137 && !setAccessor) { + setAccessor = member; + } + } + } + }); + } + return { + firstAccessor: firstAccessor, + secondAccessor: secondAccessor, + getAccessor: getAccessor, + setAccessor: setAccessor + }; + } + ts.getAllAccessorDeclarations = getAllAccessorDeclarations; + function emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments) { + if (leadingComments && leadingComments.length && node.pos !== leadingComments[0].pos && + getLineOfLocalPosition(currentSourceFile, node.pos) !== getLineOfLocalPosition(currentSourceFile, leadingComments[0].pos)) { + writer.writeLine(); + } + } + ts.emitNewLineBeforeLeadingComments = emitNewLineBeforeLeadingComments; + function emitComments(currentSourceFile, writer, comments, trailingSeparator, newLine, writeComment) { + var emitLeadingSpace = !trailingSeparator; + ts.forEach(comments, function (comment) { + if (emitLeadingSpace) { + writer.write(" "); + emitLeadingSpace = false; + } + writeComment(currentSourceFile, writer, comment, newLine); + if (comment.hasTrailingNewLine) { + writer.writeLine(); + } + else if (trailingSeparator) { + writer.write(" "); + } + else { + emitLeadingSpace = true; + } + }); + } + ts.emitComments = emitComments; + function writeCommentRange(currentSourceFile, writer, comment, newLine) { + if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42) { + var firstCommentLineAndCharacter = ts.getLineAndCharacterOfPosition(currentSourceFile, comment.pos); + var lineCount = ts.getLineStarts(currentSourceFile).length; + var firstCommentLineIndent; + for (var pos = comment.pos, currentLine = firstCommentLineAndCharacter.line; pos < comment.end; currentLine++) { + var nextLineStart = (currentLine + 1) === lineCount + ? currentSourceFile.text.length + 1 + : getStartPositionOfLine(currentLine + 1, currentSourceFile); + if (pos !== comment.pos) { + if (firstCommentLineIndent === undefined) { + firstCommentLineIndent = calculateIndent(getStartPositionOfLine(firstCommentLineAndCharacter.line, currentSourceFile), comment.pos); + } + var currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); + var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(pos, nextLineStart); + if (spacesToEmit > 0) { + var numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); + var indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); + writer.rawWrite(indentSizeSpaceString); + while (numberOfSingleSpacesToEmit) { + writer.rawWrite(" "); + numberOfSingleSpacesToEmit--; + } + } + else { + writer.rawWrite(""); + } + } + writeTrimmedCurrentLine(pos, nextLineStart); + pos = nextLineStart; + } + } + else { + writer.write(currentSourceFile.text.substring(comment.pos, comment.end)); + } + function writeTrimmedCurrentLine(pos, nextLineStart) { + var end = Math.min(comment.end, nextLineStart - 1); + var currentLineText = currentSourceFile.text.substring(pos, end).replace(/^\s+|\s+$/g, ''); + if (currentLineText) { + writer.write(currentLineText); + if (end !== comment.end) { + writer.writeLine(); + } + } + else { + writer.writeLiteral(newLine); + } + } + function calculateIndent(pos, end) { + var currentLineIndent = 0; + for (; pos < end && ts.isWhiteSpace(currentSourceFile.text.charCodeAt(pos)); pos++) { + if (currentSourceFile.text.charCodeAt(pos) === 9) { + currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); + } + else { + currentLineIndent++; + } + } + return currentLineIndent; + } + } + ts.writeCommentRange = writeCommentRange; + function isSupportedHeritageClauseElement(node) { + return isSupportedHeritageClauseElementExpression(node.expression); + } + ts.isSupportedHeritageClauseElement = isSupportedHeritageClauseElement; + function isSupportedHeritageClauseElementExpression(node) { + if (node.kind === 65) { + return true; + } + else if (node.kind === 155) { + return isSupportedHeritageClauseElementExpression(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); + } + ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; + function getLocalSymbolForExportDefault(symbol) { + return symbol && symbol.valueDeclaration && (symbol.valueDeclaration.flags & 256) ? symbol.valueDeclaration.localSymbol : undefined; + } + ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; })(ts || (ts = {})); +/// +/// var ts; (function (ts) { - var nodeConstructors = new Array(223); + var nodeConstructors = new Array(229); ts.parseTime = 0; function getNodeConstructor(kind) { return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); @@ -4014,7 +4438,7 @@ var ts; } function visitEachNode(cbNode, nodes) { if (nodes) { - for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + for (var _i = 0; _i < nodes.length; _i++) { var node = nodes[_i]; var result = cbNode(node); if (result) { @@ -4030,249 +4454,272 @@ var ts; var visitNodes = cbNodeArray ? visitNodeArray : visitEachNode; var cbNodes = cbNodeArray || cbNode; switch (node.kind) { - case 125: + case 126: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 127: + case 128: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.expression); - case 128: - case 130: case 129: - case 218: - case 219: - case 193: - case 150: - return visitNodes(cbNodes, node.modifiers) || + case 132: + case 131: + case 224: + case 225: + case 198: + case 152: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 140: - case 141: - case 136: - case 137: + case 142: + case 143: case 138: - return visitNodes(cbNodes, node.modifiers) || + case 139: + case 140: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 132: - case 131: - case 133: case 134: + case 133: case 135: - case 160: - case 195: - case 161: - return visitNodes(cbNodes, node.modifiers) || + case 136: + case 137: + case 162: + case 200: + case 163: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type) || + visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 139: + case 141: return visitNode(cbNode, node.typeName) || visitNodes(cbNodes, node.typeArguments); - case 142: - return visitNode(cbNode, node.exprName); - case 143: - return visitNodes(cbNodes, node.members); case 144: - return visitNode(cbNode, node.elementType); + return visitNode(cbNode, node.exprName); case 145: - return visitNodes(cbNodes, node.elementTypes); + return visitNodes(cbNodes, node.members); case 146: - return visitNodes(cbNodes, node.types); + return visitNode(cbNode, node.elementType); case 147: - return visitNode(cbNode, node.type); + return visitNodes(cbNodes, node.elementTypes); case 148: + return visitNodes(cbNodes, node.types); case 149: - return visitNodes(cbNodes, node.elements); + return visitNode(cbNode, node.type); + case 150: case 151: return visitNodes(cbNodes, node.elements); - case 152: - return visitNodes(cbNodes, node.properties); case 153: + return visitNodes(cbNodes, node.elements); + case 154: + return visitNodes(cbNodes, node.properties); + case 155: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.dotToken) || visitNode(cbNode, node.name); - case 154: + case 156: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 155: - case 156: + case 157: + case 158: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments) || visitNodes(cbNodes, node.arguments); - case 157: + case 159: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 158: + case 160: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 159: - return visitNode(cbNode, node.expression); - case 162: - return visitNode(cbNode, node.expression); - case 163: + case 161: return visitNode(cbNode, node.expression); case 164: 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 170: + case 172: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 166: + case 168: return visitNode(cbNode, node.operand); - case 167: + case 169: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 168: + case 170: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 171: + case 173: return visitNode(cbNode, node.expression); - case 174: - case 201: + case 179: + case 206: return visitNodes(cbNodes, node.statements); - case 221: + case 227: return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 175: - return visitNodes(cbNodes, node.modifiers) || + case 180: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 194: + case 199: return visitNodes(cbNodes, node.declarations); - case 177: + case 182: return visitNode(cbNode, node.expression); - case 178: + case 183: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 179: + case 184: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 180: + case 185: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 181: + case 186: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.iterator) || visitNode(cbNode, node.statement); - case 182: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); - case 183: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); - case 184: - case 185: - return visitNode(cbNode, node.label); - case 186: - return visitNode(cbNode, node.expression); case 187: - return visitNode(cbNode, node.expression) || + return visitNode(cbNode, node.initializer) || + visitNode(cbNode, node.expression) || 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) || + visitNode(cbNode, node.statement); + case 193: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 202: + case 207: return visitNodes(cbNodes, node.clauses); - case 214: + case 220: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.statements); - case 215: + case 221: return visitNodes(cbNodes, node.statements); - case 189: + case 194: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 190: + case 195: return visitNode(cbNode, node.expression); - case 191: + case 196: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 217: + case 223: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 196: - return visitNodes(cbNodes, node.modifiers) || + case 130: + 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 197: - return visitNodes(cbNodes, node.modifiers) || + case 202: + 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 198: - return visitNodes(cbNodes, node.modifiers) || + case 203: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.type); - case 199: - return visitNodes(cbNodes, node.modifiers) || + case 204: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.members); - case 220: + case 226: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 200: - return visitNodes(cbNodes, node.modifiers) || + case 205: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 203: - return visitNodes(cbNodes, node.modifiers) || + case 208: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 204: - return visitNodes(cbNodes, node.modifiers) || + case 209: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 205: + case 210: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 206: - return visitNode(cbNode, node.name); - case 207: case 211: + return visitNode(cbNode, node.name); + case 212: + case 216: return visitNodes(cbNodes, node.elements); - case 210: - return visitNodes(cbNodes, node.modifiers) || + case 215: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 208: - case 212: + case 213: + case 217: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 209: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.expression); - case 169: + case 214: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.expression) || + visitNode(cbNode, node.type); + case 171: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); - case 173: + case 176: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 126: + case 127: return visitNode(cbNode, node.expression); - case 216: + case 222: return visitNodes(cbNodes, node.types); - case 213: + case 177: + return visitNode(cbNode, node.expression) || + visitNodes(cbNodes, node.typeArguments); + case 219: return visitNode(cbNode, node.expression); + case 218: + return visitNodes(cbNodes, node.decorators); } } ts.forEachChild = forEachChild; @@ -4286,7 +4733,7 @@ var ts; case 5: return ts.Diagnostics.Property_or_signature_expected; case 6: return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; case 7: return ts.Diagnostics.Enum_member_expected; - case 8: return ts.Diagnostics.Type_reference_expected; + case 8: return ts.Diagnostics.Expression_expected; case 9: return ts.Diagnostics.Variable_declaration_expected; case 10: return ts.Diagnostics.Property_destructuring_pattern_expected; case 11: return ts.Diagnostics.Array_element_destructuring_pattern_expected; @@ -4304,29 +4751,33 @@ var ts; ; function modifierToFlag(token) { switch (token) { - case 109: return 128; - case 108: return 16; - case 107: return 64; - case 106: return 32; - case 77: return 1; - case 114: return 2; - case 69: return 8192; - case 72: return 256; + case 110: return 128; + case 109: return 16; + case 108: return 64; + case 107: return 32; + case 78: return 1; + case 115: return 2; + case 70: return 8192; + case 73: return 256; } return 0; } ts.modifierToFlag = modifierToFlag; function fixupParentReferences(sourceFile) { - var _parent = sourceFile; + // normally parent references are set during binding. However, for clients that only need + // a syntax tree, and no semantic features, then the binding process is an unnecessary + // overhead. This functions allows us to set all the parents, without all the expense of + // binding. + var parent = sourceFile; forEachChild(sourceFile, visitNode); return; function visitNode(n) { - if (n.parent !== _parent) { - n.parent = _parent; - var saveParent = _parent; - _parent = n; + if (n.parent !== parent) { + n.parent = parent; + var saveParent = parent; + parent = n; forEachChild(n, visitNode); - _parent = saveParent; + parent = saveParent; } } } @@ -4334,7 +4785,7 @@ var ts; switch (node.kind) { case 8: case 7: - case 64: + case 65: return true; } return false; @@ -4364,7 +4815,7 @@ var ts; array._children = undefined; array.pos += delta; array.end += delta; - for (var _i = 0, _n = array.length; _i < _n; _i++) { + for (var _i = 0; _i < array.length; _i++) { var node = array[_i]; visitNode(node); } @@ -4428,7 +4879,7 @@ var ts; array.intersectsChange = true; array._children = undefined; adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); - for (var _i = 0, _n = array.length; _i < _n; _i++) { + for (var _i = 0; _i < array.length; _i++) { var node = array[_i]; visitNode(node); } @@ -4544,7 +4995,7 @@ var ts; } ts.updateSourceFile = updateSourceFile; function isEvalOrArgumentsIdentifier(node) { - return node.kind === 64 && + return node.kind === 65 && (node.text === "eval" || node.text === "arguments"); } ts.isEvalOrArgumentsIdentifier = isEvalOrArgumentsIdentifier; @@ -4622,12 +5073,13 @@ var ts; ts.createSourceFile = createSourceFile; function parseSourceFile(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes) { if (setParentNodes === void 0) { setParentNodes = false; } + var disallowInAndDecoratorContext = 2 | 16; var parsingContext = 0; var identifiers = {}; var identifierCount = 0; var nodeCount = 0; var token; - var sourceFile = createNode(221, 0); + var sourceFile = createNode(227, 0); sourceFile.pos = 0; sourceFile.end = sourceText.length; sourceFile.text = sourceText; @@ -4673,6 +5125,19 @@ var ts; function setGeneratorParameterContext(val) { setContextFlag(val, 8); } + function setDecoratorContext(val) { + setContextFlag(val, 16); + } + function doOutsideOfContext(flags, func) { + var currentContextFlags = contextFlags & flags; + if (currentContextFlags) { + setContextFlag(false, currentContextFlags); + var result = func(); + setContextFlag(true, currentContextFlags); + return result; + } + return func(); + } function allowInAnd(func) { if (contextFlags & 2) { setDisallowInContext(false); @@ -4709,6 +5174,15 @@ var ts; } return func(); } + function doInDecoratorContext(func) { + if (contextFlags & 16) { + return func(); + } + setDecoratorContext(true); + var result = func(); + setDecoratorContext(false); + return result; + } function inYieldContext() { return (contextFlags & 4) !== 0; } @@ -4721,10 +5195,13 @@ var ts; function inDisallowInContext() { return (contextFlags & 2) !== 0; } + function inDecoratorContext() { + return (contextFlags & 16) !== 0; + } function parseErrorAtCurrentToken(message, arg0) { var start = scanner.getTokenPos(); - var _length = scanner.getTextPos() - start; - parseErrorAtPosition(start, _length, message, arg0); + var length = scanner.getTextPos() - start; + parseErrorAtPosition(start, length, message, arg0); } function parseErrorAtPosition(start, length, message, arg0) { var lastError = ts.lastOrUndefined(sourceFile.parseDiagnostics); @@ -4781,13 +5258,13 @@ var ts; return speculationHelper(callback, false); } function isIdentifier() { - if (token === 64) { + if (token === 65) { return true; } - if (token === 110 && inYieldContext()) { + if (token === 111 && inYieldContext()) { return false; } - return inStrictModeContext() ? token > 110 : token > 100; + return inStrictModeContext() ? token > 111 : token > 101; } function parseExpected(kind, diagnosticMessage) { if (token === kind) { @@ -4858,7 +5335,7 @@ var ts; } if (parseErrorBeforeNextFinishedNode) { parseErrorBeforeNextFinishedNode = false; - node.parserContextFlags |= 16; + node.parserContextFlags |= 32; } return node; } @@ -4880,12 +5357,12 @@ var ts; function createIdentifier(isIdentifier, diagnosticMessage) { identifierCount++; if (isIdentifier) { - var node = createNode(64); + var node = createNode(65); node.text = internIdentifier(scanner.getTokenValue()); nextToken(); return finishNode(node); } - return createMissingNode(64, false, diagnosticMessage || ts.Diagnostics.Identifier_expected); + return createMissingNode(65, false, diagnosticMessage || ts.Diagnostics.Identifier_expected); } function parseIdentifier(diagnosticMessage) { return createIdentifier(isIdentifier(), diagnosticMessage); @@ -4908,7 +5385,7 @@ var ts; return parseIdentifierName(); } function parseComputedPropertyName() { - var node = createNode(126); + var node = createNode(127); parseExpected(18); var yieldContext = inYieldContext(); if (inGeneratorParameterContext()) { @@ -4932,17 +5409,17 @@ var ts; return ts.isModifier(token) && tryParse(nextTokenCanFollowContextualModifier); } function nextTokenCanFollowContextualModifier() { - if (token === 69) { - return nextToken() === 76; + if (token === 70) { + return nextToken() === 77; } - if (token === 77) { + if (token === 78) { nextToken(); - if (token === 72) { + if (token === 73) { return lookAhead(nextTokenIsClassOrFunction); } return token !== 35 && token !== 14 && canFollowModifier(); } - if (token === 72) { + if (token === 73) { return nextTokenIsClassOrFunction(); } nextToken(); @@ -4956,7 +5433,7 @@ var ts; } function nextTokenIsClassOrFunction() { nextToken(); - return token === 68 || token === 82; + return token === 69 || token === 83; } function isListElement(parsingContext, inErrorRecovery) { var node = currentNode(parsingContext); @@ -4971,11 +5448,11 @@ var ts; case 4: return isStartOfStatement(inErrorRecovery); case 3: - return token === 66 || token === 72; + return token === 67 || token === 73; case 5: return isStartOfTypeMember(); case 6: - return lookAhead(isClassMemberStart); + return lookAhead(isClassMemberStart) || (token === 22 && !inErrorRecovery); case 7: return token === 18 || isLiteralPropertyName(); case 13: @@ -4983,7 +5460,15 @@ var ts; case 10: return isLiteralPropertyName(); case 8: - return isIdentifier() && !isNotHeritageClauseTypeName(); + if (token === 14) { + return lookAhead(isValidHeritageClauseObjectLiteral); + } + if (!inErrorRecovery) { + return isStartOfLeftHandSideExpression() && !isHeritageClauseExtendsOrImplementsKeyword(); + } + else { + return isIdentifier() && !isHeritageClauseExtendsOrImplementsKeyword(); + } case 9: return isIdentifierOrPattern(); case 11: @@ -5005,17 +5490,29 @@ var ts; } ts.Debug.fail("Non-exhaustive case in 'isListElement'."); } + function isValidHeritageClauseObjectLiteral() { + ts.Debug.assert(token === 14); + if (nextToken() === 15) { + var next = nextToken(); + return next === 23 || next === 14 || next === 79 || next === 103; + } + return true; + } function nextTokenIsIdentifier() { nextToken(); return isIdentifier(); } - function isNotHeritageClauseTypeName() { - if (token === 102 || - token === 78) { - return lookAhead(nextTokenIsIdentifier); + function isHeritageClauseExtendsOrImplementsKeyword() { + if (token === 103 || + token === 79) { + return lookAhead(nextTokenIsStartOfExpression); } return false; } + function nextTokenIsStartOfExpression() { + nextToken(); + return isStartOfExpression(); + } function isListTerminator(kind) { if (token === 1) { return true; @@ -5032,13 +5529,13 @@ var ts; case 20: return token === 15; case 4: - return token === 15 || token === 66 || token === 72; + return token === 15 || token === 67 || token === 73; case 8: - return token === 14 || token === 78 || token === 102; + return token === 14 || token === 79 || token === 103; case 9: return isVariableDeclaratorListTerminator(); case 16: - return token === 25 || token === 16 || token === 14 || token === 78 || token === 102; + return token === 25 || token === 16 || token === 14 || token === 79 || token === 103; case 12: return token === 17 || token === 22; case 14: @@ -5131,7 +5628,7 @@ var ts; if (ts.containsParseError(node)) { return undefined; } - var nodeContextFlags = node.parserContextFlags & 31; + var nodeContextFlags = node.parserContextFlags & 63; if (nodeContextFlags !== contextFlags) { return undefined; } @@ -5165,26 +5662,26 @@ var ts; case 15: return isReusableParameter(node); case 19: - case 8: case 16: case 18: case 17: case 12: case 13: + case 8: } return false; } function isReusableModuleElement(node) { if (node) { switch (node.kind) { - case 204: - case 203: - case 210: case 209: - case 196: - case 197: - case 200: - case 199: + case 208: + case 215: + case 214: + case 201: + case 202: + case 205: + case 204: return true; } return isReusableStatement(node); @@ -5194,12 +5691,13 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 133: - case 138: - case 132: - case 134: case 135: - case 130: + case 140: + case 134: + case 136: + case 137: + case 132: + case 178: return true; } } @@ -5208,8 +5706,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 214: - case 215: + case 220: + case 221: return true; } } @@ -5218,56 +5716,56 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 195: - case 175: - case 174: - case 178: - case 177: - case 190: - case 186: - case 188: - case 185: - case 184: - case 182: - case 183: - case 181: + case 200: case 180: - case 187: - case 176: - case 191: - case 189: case 179: + case 183: + case 182: + case 195: + case 191: + case 193: + case 190: + case 189: + case 187: + case 188: + case 186: + case 185: case 192: + case 181: + case 196: + case 194: + case 184: + case 197: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 220; + return node.kind === 226; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 137: + case 139: + case 133: + case 140: case 131: case 138: - case 129: - case 136: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 193) { + if (node.kind !== 198) { return false; } var variableDeclarator = node; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 128) { + if (node.kind !== 129) { return false; } var parameter = node; @@ -5336,7 +5834,7 @@ var ts; function parseEntityName(allowReservedWords, diagnosticMessage) { var entity = parseIdentifier(diagnosticMessage); while (parseOptional(20)) { - var node = createNode(125, entity.pos); + var node = createNode(126, entity.pos); node.left = entity; node.right = parseRightSideOfDot(allowReservedWords); entity = finishNode(node); @@ -5347,13 +5845,13 @@ var ts; if (scanner.hasPrecedingLineBreak() && scanner.isReservedWord()) { var matchesPattern = lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); if (matchesPattern) { - return createMissingNode(64, true, ts.Diagnostics.Identifier_expected); + return createMissingNode(65, true, ts.Diagnostics.Identifier_expected); } } return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(169); + var template = createNode(171); template.head = parseLiteralNode(); ts.Debug.assert(template.head.kind === 11, "Template head has wrong token kind"); var templateSpans = []; @@ -5366,7 +5864,7 @@ var ts; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(173); + var span = createNode(176); span.expression = allowInAnd(parseExpression); var literal; if (token === 15) { @@ -5400,7 +5898,7 @@ var ts; return node; } function parseTypeReference() { - var node = createNode(139); + var node = createNode(141); node.typeName = parseEntityName(false, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && token === 24) { node.typeArguments = parseBracketedList(17, parseType, 24, 25); @@ -5408,15 +5906,15 @@ var ts; return finishNode(node); } function parseTypeQuery() { - var node = createNode(142); - parseExpected(96); + var node = createNode(144); + parseExpected(97); node.exprName = parseEntityName(true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(127); + var node = createNode(128); node.name = parseIdentifier(); - if (parseOptional(78)) { + if (parseOptional(79)) { if (isStartOfType() || !isStartOfExpression()) { node.constraint = parseType(); } @@ -5440,7 +5938,7 @@ var ts; return undefined; } function isStartOfParameter() { - return token === 21 || isIdentifierOrPattern() || ts.isModifier(token); + return token === 21 || isIdentifierOrPattern() || ts.isModifier(token) || token === 52; } function setModifiers(node, modifiers) { if (modifiers) { @@ -5449,7 +5947,8 @@ var ts; } } function parseParameter() { - var node = createNode(128); + var node = createNode(129); + node.decorators = parseDecorators(); setModifiers(node, parseModifiers()); node.dotDotDotToken = parseOptionalToken(21); node.name = inGeneratorParameterContext() ? doInYieldContext(parseIdentifierOrPattern) : parseIdentifierOrPattern(); @@ -5500,8 +5999,8 @@ var ts; } function parseSignatureMember(kind) { var node = createNode(kind); - if (kind === 137) { - parseExpected(87); + if (kind === 139) { + parseExpected(88); } fillSignature(51, false, false, node); parseTypeMemberSemicolon(); @@ -5539,9 +6038,9 @@ var ts; nextToken(); return token === 51 || token === 23 || token === 19; } - function parseIndexSignatureDeclaration(modifiers) { - var fullStart = modifiers ? modifiers.pos : scanner.getStartPos(); - var node = createNode(138, fullStart); + function parseIndexSignatureDeclaration(fullStart, decorators, modifiers) { + var node = createNode(140, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); node.parameters = parseBracketedList(15, parseParameter, 18, 19); node.type = parseTypeAnnotation(); @@ -5550,19 +6049,19 @@ var ts; } function parsePropertyOrMethodSignature() { var fullStart = scanner.getStartPos(); - var _name = parsePropertyName(); + var name = parsePropertyName(); var questionToken = parseOptionalToken(50); if (token === 16 || token === 24) { - var method = createNode(131, fullStart); - method.name = _name; + var method = createNode(133, fullStart); + method.name = name; method.questionToken = questionToken; fillSignature(51, false, false, method); parseTypeMemberSemicolon(); return finishNode(method); } else { - var property = createNode(129, fullStart); - property.name = _name; + var property = createNode(131, fullStart); + property.name = name; property.questionToken = questionToken; property.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -5603,14 +6102,14 @@ var ts; switch (token) { case 16: case 24: - return parseSignatureMember(136); + return parseSignatureMember(138); case 18: return isIndexSignature() - ? parseIndexSignatureDeclaration(undefined) + ? parseIndexSignatureDeclaration(scanner.getStartPos(), undefined, undefined) : parsePropertyOrMethodSignature(); - case 87: + case 88: if (lookAhead(isStartOfConstructSignature)) { - return parseSignatureMember(137); + return parseSignatureMember(139); } case 8: case 7: @@ -5628,9 +6127,11 @@ var ts; } } function parseIndexSignatureWithModifiers() { + var fullStart = scanner.getStartPos(); + var decorators = parseDecorators(); var modifiers = parseModifiers(); return isIndexSignature() - ? parseIndexSignatureDeclaration(modifiers) + ? parseIndexSignatureDeclaration(fullStart, decorators, modifiers) : undefined; } function isStartOfConstructSignature() { @@ -5638,7 +6139,7 @@ var ts; return token === 16 || token === 24; } function parseTypeLiteral() { - var node = createNode(143); + var node = createNode(145); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -5654,12 +6155,12 @@ var ts; return members; } function parseTupleType() { - var node = createNode(145); + var node = createNode(147); node.elementTypes = parseBracketedList(18, parseType, 18, 19); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(147); + var node = createNode(149); parseExpected(16); node.type = parseType(); parseExpected(17); @@ -5667,8 +6168,8 @@ var ts; } function parseFunctionOrConstructorType(kind) { var node = createNode(kind); - if (kind === 141) { - parseExpected(87); + if (kind === 143) { + parseExpected(88); } fillSignature(32, false, false, node); return finishNode(node); @@ -5679,16 +6180,16 @@ var ts; } function parseNonArrayType() { switch (token) { - case 111: - case 120: - case 118: case 112: case 121: + case 119: + case 113: + case 122: var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReference(); - case 98: + case 99: return parseTokenNode(); - case 96: + case 97: return parseTypeQuery(); case 14: return parseTypeLiteral(); @@ -5702,17 +6203,17 @@ var ts; } function isStartOfType() { switch (token) { - case 111: - case 120: - case 118: case 112: case 121: - case 98: - case 96: + case 119: + case 113: + case 122: + case 99: + case 97: case 14: case 18: case 24: - case 87: + case 88: return true; case 16: return lookAhead(isStartOfParenthesizedOrFunctionType); @@ -5728,7 +6229,7 @@ var ts; var type = parseNonArrayType(); while (!scanner.hasPrecedingLineBreak() && parseOptional(18)) { parseExpected(19); - var node = createNode(144, type.pos); + var node = createNode(146, type.pos); node.elementType = type; type = finishNode(node); } @@ -5743,7 +6244,7 @@ var ts; types.push(parseArrayTypeOrHigher()); } types.end = getNodeEnd(); - var node = createNode(146, type.pos); + var node = createNode(148, type.pos); node.types = types; type = finishNode(node); } @@ -5763,7 +6264,7 @@ var ts; if (isIdentifier() || ts.isModifier(token)) { nextToken(); if (token === 51 || token === 23 || - token === 50 || token === 52 || + token === 50 || token === 53 || isIdentifier() || ts.isModifier(token)) { return true; } @@ -5788,23 +6289,23 @@ var ts; } function parseTypeWorker() { if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(140); + return parseFunctionOrConstructorType(142); } - if (token === 87) { - return parseFunctionOrConstructorType(141); + if (token === 88) { + return parseFunctionOrConstructorType(143); } return parseUnionTypeOrHigher(); } function parseTypeAnnotation() { return parseOptional(51) ? parseType() : undefined; } - function isStartOfExpression() { + function isStartOfLeftHandSideExpression() { switch (token) { - case 92: - case 90: - case 88: - case 94: - case 79: + case 93: + case 91: + case 89: + case 95: + case 80: case 7: case 8: case 10: @@ -5812,22 +6313,33 @@ var ts; case 16: case 18: case 14: - case 82: - case 87: + case 83: + case 69: + case 88: case 36: - case 56: + case 57: + case 65: + return true; + default: + return isIdentifier(); + } + } + function isStartOfExpression() { + if (isStartOfLeftHandSideExpression()) { + return true; + } + switch (token) { case 33: case 34: case 47: case 46: - case 73: - case 96: - case 98: + case 74: + case 97: + case 99: case 38: case 39: case 24: - case 64: - case 110: + case 111: return true; default: if (isBinaryOperator()) { @@ -5837,26 +6349,49 @@ var ts; } } function isStartOfExpressionStatement() { - return token !== 14 && token !== 82 && isStartOfExpression(); + return token !== 14 && + token !== 83 && + token !== 69 && + token !== 52 && + isStartOfExpression(); } function parseExpression() { + // Expression[in]: + // AssignmentExpression[in] + // Expression[in] , AssignmentExpression[in] + var saveDecoratorContext = inDecoratorContext(); + if (saveDecoratorContext) { + setDecoratorContext(false); + } var expr = parseAssignmentExpressionOrHigher(); var operatorToken; while ((operatorToken = parseOptionalToken(23))) { expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher()); } + if (saveDecoratorContext) { + setDecoratorContext(true); + } return expr; } function parseInitializer(inParameter) { - if (token !== 52) { + if (token !== 53) { if (scanner.hasPrecedingLineBreak() || (inParameter && token === 14) || !isStartOfExpression()) { return undefined; } } - parseExpected(52); + parseExpected(53); return parseAssignmentExpressionOrHigher(); } function parseAssignmentExpressionOrHigher() { + // AssignmentExpression[in,yield]: + // 1) ConditionalExpression[?in,?yield] + // 2) LeftHandSideExpression = AssignmentExpression[?in,?yield] + // 3) LeftHandSideExpression AssignmentOperator AssignmentExpression[?in,?yield] + // 4) ArrowFunctionExpression[?in,?yield] + // 5) [+Yield] YieldExpression[?In] + // + // Note: for ease of implementation we treat productions '2' and '3' as the same thing. + // (i.e. they're both BinaryExpressions with an assignment operator in it). if (isYieldExpression()) { return parseYieldExpression(); } @@ -5865,7 +6400,7 @@ var ts; return arrowExpression; } var expr = parseBinaryExpressionOrHigher(0); - if (expr.kind === 64 && token === 32) { + if (expr.kind === 65 && token === 32) { return parseSimpleArrowFunctionExpression(expr); } if (isLeftHandSideExpression(expr) && isAssignmentOperator(reScanGreaterToken())) { @@ -5874,7 +6409,7 @@ var ts; return parseConditionalExpressionRest(expr); } function isYieldExpression() { - if (token === 110) { + if (token === 111) { if (inYieldContext()) { return true; } @@ -5895,7 +6430,7 @@ var ts; (isIdentifier() || token === 14 || token === 18); } function parseYieldExpression() { - var node = createNode(170); + var node = createNode(172); nextToken(); if (!scanner.hasPrecedingLineBreak() && (token === 35 || isStartOfExpression())) { @@ -5909,14 +6444,14 @@ var ts; } function parseSimpleArrowFunctionExpression(identifier) { ts.Debug.assert(token === 32, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); - var node = createNode(161, identifier.pos); - var parameter = createNode(128, identifier.pos); + var node = createNode(163, identifier.pos); + var parameter = createNode(129, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = [parameter]; node.parameters.pos = parameter.pos; node.parameters.end = parameter.end; - parseExpected(32); + node.equalsGreaterThanToken = parseExpectedToken(32, false, ts.Diagnostics._0_expected, "=>"); node.body = parseArrowFunctionExpressionBody(); return finishNode(node); } @@ -5931,12 +6466,11 @@ var ts; if (!arrowFunction) { return undefined; } - if (parseExpected(32) || token === 14) { - arrowFunction.body = parseArrowFunctionExpressionBody(); - } - else { - arrowFunction.body = parseIdentifier(); - } + var lastToken = token; + arrowFunction.equalsGreaterThanToken = parseExpectedToken(32, false, ts.Diagnostics._0_expected, "=>"); + arrowFunction.body = (lastToken === 32 || lastToken === 14) + ? parseArrowFunctionExpressionBody() + : parseIdentifier(); return finishNode(arrowFunction); } function isParenthesizedArrowFunctionExpression() { @@ -5986,7 +6520,7 @@ var ts; return parseParenthesizedArrowFunctionExpressionHead(false); } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNode(161); + var node = createNode(163); fillSignature(51, false, !allowAmbiguity, node); if (!node.parameters) { return undefined; @@ -6000,7 +6534,10 @@ var ts; if (token === 14) { return parseFunctionBlock(false, false); } - if (isStartOfStatement(true) && !isStartOfExpressionStatement() && token !== 82) { + if (isStartOfStatement(true) && + !isStartOfExpressionStatement() && + token !== 83 && + token !== 69) { return parseFunctionBlock(false, true); } return parseAssignmentExpressionOrHigher(); @@ -6010,10 +6547,10 @@ var ts; if (!questionToken) { return leftOperand; } - var node = createNode(168, leftOperand.pos); + var node = createNode(170, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; - node.whenTrue = allowInAnd(parseAssignmentExpressionOrHigher); + node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); node.colonToken = parseExpectedToken(51, false, ts.Diagnostics._0_expected, ts.tokenToString(51)); node.whenFalse = parseAssignmentExpressionOrHigher(); return finishNode(node); @@ -6023,7 +6560,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 85 || t === 124; + return t === 86 || t === 125; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -6032,7 +6569,7 @@ var ts; if (newPrecedence <= precedence) { break; } - if (token === 85 && inDisallowInContext()) { + if (token === 86 && inDisallowInContext()) { break; } leftOperand = makeBinaryExpression(leftOperand, parseTokenNode(), parseBinaryExpressionOrHigher(newPrecedence)); @@ -6040,7 +6577,7 @@ var ts; return leftOperand; } function isBinaryOperator() { - if (inDisallowInContext() && token === 85) { + if (inDisallowInContext() && token === 86) { return false; } return getBinaryOperatorPrecedence() > 0; @@ -6066,8 +6603,8 @@ var ts; case 25: case 26: case 27: + case 87: case 86: - case 85: return 7; case 40: case 41: @@ -6084,33 +6621,33 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(167, left.pos); + var node = createNode(169, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(165); + var node = createNode(167); node.operator = token; nextToken(); node.operand = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(162); + var node = createNode(164); nextToken(); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(163); + var node = createNode(165); nextToken(); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(164); + var node = createNode(166); nextToken(); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); @@ -6124,11 +6661,11 @@ var ts; case 38: case 39: return parsePrefixUnaryExpression(); - case 73: + case 74: return parseDeleteExpression(); - case 96: + case 97: return parseTypeOfExpression(); - case 98: + case 99: return parseVoidExpression(); case 24: return parseTypeAssertion(); @@ -6140,7 +6677,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(isLeftHandSideExpression(expression)); if ((token === 38 || token === 39) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(166, expression.pos); + var node = createNode(168, expression.pos); node.operand = expression; node.operator = token; nextToken(); @@ -6149,7 +6686,7 @@ var ts; return expression; } function parseLeftHandSideExpressionOrHigher() { - var expression = token === 90 + var expression = token === 91 ? parseSuperExpression() : parseMemberExpressionOrHigher(); return parseCallExpressionRest(expression); @@ -6163,14 +6700,14 @@ var ts; if (token === 16 || token === 20) { return expression; } - var node = createNode(153, expression.pos); + var node = createNode(155, 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(158); + var node = createNode(160); parseExpected(24); node.type = parseType(); parseExpected(25); @@ -6181,15 +6718,15 @@ var ts; while (true) { var dotToken = parseOptionalToken(20); if (dotToken) { - var propertyAccess = createNode(153, expression.pos); + var propertyAccess = createNode(155, expression.pos); propertyAccess.expression = expression; propertyAccess.dotToken = dotToken; propertyAccess.name = parseRightSideOfDot(true); expression = finishNode(propertyAccess); continue; } - if (parseOptional(18)) { - var indexedAccess = createNode(154, expression.pos); + if (!inDecoratorContext() && parseOptional(18)) { + var indexedAccess = createNode(156, expression.pos); indexedAccess.expression = expression; if (token !== 19) { indexedAccess.argumentExpression = allowInAnd(parseExpression); @@ -6203,7 +6740,7 @@ var ts; continue; } if (token === 10 || token === 11) { - var tagExpression = createNode(157, expression.pos); + var tagExpression = createNode(159, expression.pos); tagExpression.tag = expression; tagExpression.template = token === 10 ? parseLiteralNode() @@ -6222,7 +6759,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(155, expression.pos); + var callExpr = createNode(157, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -6230,10 +6767,10 @@ var ts; continue; } else if (token === 16) { - var _callExpr = createNode(155, expression.pos); - _callExpr.expression = expression; - _callExpr.arguments = parseArgumentList(); - expression = finishNode(_callExpr); + var callExpr = createNode(157, expression.pos); + callExpr.expression = expression; + callExpr.arguments = parseArgumentList(); + expression = finishNode(callExpr); continue; } return expression; @@ -6265,7 +6802,6 @@ var ts; case 19: case 51: case 22: - case 23: case 50: case 28: case 30: @@ -6279,6 +6815,8 @@ var ts; case 15: case 1: return true; + case 23: + case 14: default: return false; } @@ -6289,11 +6827,11 @@ var ts; case 8: case 10: return parseLiteralNode(); - case 92: - case 90: - case 88: - case 94: - case 79: + case 93: + case 91: + case 89: + case 95: + case 80: return parseTokenNode(); case 16: return parseParenthesizedExpression(); @@ -6301,12 +6839,14 @@ var ts; return parseArrayLiteralExpression(); case 14: return parseObjectLiteralExpression(); - case 82: + case 69: + return parseClassExpression(); + case 83: return parseFunctionExpression(); - case 87: + case 88: return parseNewExpression(); case 36: - case 56: + case 57: if (reScanSlashToken() === 9) { return parseLiteralNode(); } @@ -6317,28 +6857,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNode(159); + var node = createNode(161); parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); return finishNode(node); } function parseSpreadElement() { - var node = createNode(171); + var node = createNode(173); parseExpected(21); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token === 21 ? parseSpreadElement() : - token === 23 ? createNode(172) : + token === 23 ? createNode(175) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { - return allowInAnd(parseArgumentOrArrayLiteralElement); + return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(151); + var node = createNode(153); parseExpected(18); if (scanner.hasPrecedingLineBreak()) node.flags |= 512; @@ -6346,19 +6886,20 @@ var ts; parseExpected(19); return finishNode(node); } - function tryParseAccessorDeclaration(fullStart, modifiers) { - if (parseContextualModifier(115)) { - return parseAccessorDeclaration(134, fullStart, modifiers); + function tryParseAccessorDeclaration(fullStart, decorators, modifiers) { + if (parseContextualModifier(116)) { + return parseAccessorDeclaration(136, fullStart, decorators, modifiers); } - else if (parseContextualModifier(119)) { - return parseAccessorDeclaration(135, fullStart, modifiers); + else if (parseContextualModifier(120)) { + return parseAccessorDeclaration(137, fullStart, decorators, modifiers); } return undefined; } function parseObjectLiteralElement() { var fullStart = scanner.getStartPos(); + var decorators = parseDecorators(); var modifiers = parseModifiers(); - var accessor = tryParseAccessorDeclaration(fullStart, modifiers); + var accessor = tryParseAccessorDeclaration(fullStart, decorators, modifiers); if (accessor) { return accessor; } @@ -6368,16 +6909,16 @@ var ts; var propertyName = parsePropertyName(); var questionToken = parseOptionalToken(50); if (asteriskToken || token === 16 || token === 24) { - return parseMethodDeclaration(fullStart, modifiers, asteriskToken, propertyName, questionToken); + return parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, propertyName, questionToken); } if ((token === 23 || token === 15) && tokenIsIdentifier) { - var shorthandDeclaration = createNode(219, fullStart); + var shorthandDeclaration = createNode(225, fullStart); shorthandDeclaration.name = propertyName; shorthandDeclaration.questionToken = questionToken; return finishNode(shorthandDeclaration); } else { - var propertyAssignment = createNode(218, fullStart); + var propertyAssignment = createNode(224, fullStart); propertyAssignment.name = propertyName; propertyAssignment.questionToken = questionToken; parseExpected(51); @@ -6386,7 +6927,7 @@ var ts; } } function parseObjectLiteralExpression() { - var node = createNode(152); + var node = createNode(154); parseExpected(14); if (scanner.hasPrecedingLineBreak()) { node.flags |= 512; @@ -6396,20 +6937,27 @@ var ts; return finishNode(node); } function parseFunctionExpression() { - var node = createNode(160); - parseExpected(82); + var saveDecoratorContext = inDecoratorContext(); + if (saveDecoratorContext) { + setDecoratorContext(false); + } + var node = createNode(162); + parseExpected(83); node.asteriskToken = parseOptionalToken(35); node.name = node.asteriskToken ? doInYieldContext(parseOptionalIdentifier) : parseOptionalIdentifier(); fillSignature(51, !!node.asteriskToken, false, node); node.body = parseFunctionBlock(!!node.asteriskToken, false); + if (saveDecoratorContext) { + setDecoratorContext(true); + } return finishNode(node); } function parseOptionalIdentifier() { return isIdentifier() ? parseIdentifier() : undefined; } function parseNewExpression() { - var node = createNode(156); - parseExpected(87); + var node = createNode(158); + parseExpected(88); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); if (node.typeArguments || token === 16) { @@ -6418,7 +6966,7 @@ var ts; return finishNode(node); } function parseBlock(ignoreMissingOpenBrace, checkForStrictMode, diagnosticMessage) { - var node = createNode(174); + var node = createNode(179); if (parseExpected(14, diagnosticMessage) || ignoreMissingOpenBrace) { node.statements = parseList(2, checkForStrictMode, parseStatement); parseExpected(15); @@ -6431,30 +6979,37 @@ var ts; function parseFunctionBlock(allowYield, ignoreMissingOpenBrace, diagnosticMessage) { var savedYieldContext = inYieldContext(); setYieldContext(allowYield); + var saveDecoratorContext = inDecoratorContext(); + if (saveDecoratorContext) { + setDecoratorContext(false); + } var block = parseBlock(ignoreMissingOpenBrace, true, diagnosticMessage); + if (saveDecoratorContext) { + setDecoratorContext(true); + } setYieldContext(savedYieldContext); return block; } function parseEmptyStatement() { - var node = createNode(176); + var node = createNode(181); parseExpected(22); return finishNode(node); } function parseIfStatement() { - var node = createNode(178); - parseExpected(83); + var node = createNode(183); + parseExpected(84); parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); node.thenStatement = parseStatement(); - node.elseStatement = parseOptional(75) ? parseStatement() : undefined; + node.elseStatement = parseOptional(76) ? parseStatement() : undefined; return finishNode(node); } function parseDoStatement() { - var node = createNode(179); - parseExpected(74); + var node = createNode(184); + parseExpected(75); node.statement = parseStatement(); - parseExpected(99); + parseExpected(100); parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); @@ -6462,8 +7017,8 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(180); - parseExpected(99); + var node = createNode(185); + parseExpected(100); parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); @@ -6472,11 +7027,11 @@ var ts; } function parseForOrForInOrForOfStatement() { var pos = getNodePos(); - parseExpected(81); + parseExpected(82); parseExpected(16); var initializer = undefined; if (token !== 22) { - if (token === 97 || token === 104 || token === 69) { + if (token === 98 || token === 105 || token === 70) { initializer = parseVariableDeclarationList(true); } else { @@ -6484,22 +7039,22 @@ var ts; } } var forOrForInOrForOfStatement; - if (parseOptional(85)) { - var forInStatement = createNode(182, pos); + if (parseOptional(86)) { + var forInStatement = createNode(187, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(17); forOrForInOrForOfStatement = forInStatement; } - else if (parseOptional(124)) { - var forOfStatement = createNode(183, pos); + else if (parseOptional(125)) { + var forOfStatement = createNode(188, pos); forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(17); forOrForInOrForOfStatement = forOfStatement; } else { - var forStatement = createNode(181, pos); + var forStatement = createNode(186, pos); forStatement.initializer = initializer; parseExpected(22); if (token !== 22 && token !== 17) { @@ -6517,7 +7072,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 185 ? 65 : 70); + parseExpected(kind === 190 ? 66 : 71); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -6525,8 +7080,8 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(186); - parseExpected(89); + var node = createNode(191); + parseExpected(90); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); } @@ -6534,8 +7089,8 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(187); - parseExpected(100); + var node = createNode(192); + parseExpected(101); parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); @@ -6543,30 +7098,30 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(214); - parseExpected(66); + var node = createNode(220); + parseExpected(67); node.expression = allowInAnd(parseExpression); parseExpected(51); node.statements = parseList(4, false, parseStatement); return finishNode(node); } function parseDefaultClause() { - var node = createNode(215); - parseExpected(72); + var node = createNode(221); + parseExpected(73); parseExpected(51); node.statements = parseList(4, false, parseStatement); return finishNode(node); } function parseCaseOrDefaultClause() { - return token === 66 ? parseCaseClause() : parseDefaultClause(); + return token === 67 ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(188); - parseExpected(91); + var node = createNode(193); + parseExpected(92); parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); - var caseBlock = createNode(202, scanner.getStartPos()); + var caseBlock = createNode(207, scanner.getStartPos()); parseExpected(14); caseBlock.clauses = parseList(3, false, parseCaseOrDefaultClause); parseExpected(15); @@ -6574,26 +7129,28 @@ var ts; return finishNode(node); } function parseThrowStatement() { - var node = createNode(190); - parseExpected(93); + // ThrowStatement[Yield] : + // throw [no LineTerminator here]Expression[In, ?Yield]; + var node = createNode(195); + parseExpected(94); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); return finishNode(node); } function parseTryStatement() { - var node = createNode(191); - parseExpected(95); + var node = createNode(196); + parseExpected(96); node.tryBlock = parseBlock(false, false); - node.catchClause = token === 67 ? parseCatchClause() : undefined; - if (!node.catchClause || token === 80) { - parseExpected(80); + node.catchClause = token === 68 ? parseCatchClause() : undefined; + if (!node.catchClause || token === 81) { + parseExpected(81); node.finallyBlock = parseBlock(false, false); } return finishNode(node); } function parseCatchClause() { - var result = createNode(217); - parseExpected(67); + var result = createNode(223); + parseExpected(68); if (parseExpected(16)) { result.variableDeclaration = parseVariableDeclaration(); } @@ -6602,22 +7159,22 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(192); - parseExpected(71); + var node = createNode(197); + parseExpected(72); parseSemicolon(); return finishNode(node); } function parseExpressionOrLabeledStatement() { var fullStart = scanner.getStartPos(); var expression = allowInAnd(parseExpression); - if (expression.kind === 64 && parseOptional(51)) { - var labeledStatement = createNode(189, fullStart); + if (expression.kind === 65 && parseOptional(51)) { + var labeledStatement = createNode(194, fullStart); labeledStatement.label = expression; labeledStatement.statement = parseStatement(); return finishNode(labeledStatement); } else { - var expressionStatement = createNode(177, fullStart); + var expressionStatement = createNode(182, fullStart); expressionStatement.expression = expression; parseSemicolon(); return finishNode(expressionStatement); @@ -6625,7 +7182,7 @@ var ts; } function isStartOfStatement(inErrorRecovery) { if (ts.isModifier(token)) { - var result = lookAhead(parseVariableStatementOrFunctionDeclarationWithModifiers); + var result = lookAhead(parseVariableStatementOrFunctionDeclarationOrClassDeclarationWithDecoratorsOrModifiers); if (result) { return true; } @@ -6634,39 +7191,39 @@ var ts; case 22: return !inErrorRecovery; case 14: - case 97: - case 104: - case 82: + case 98: + case 105: case 83: - case 74: - case 99: - case 81: - case 70: - case 65: - case 89: - case 100: - case 91: - case 93: - case 95: - case 71: - case 67: - case 80: - return true; case 69: + case 84: + case 75: + case 100: + case 82: + case 71: + case 66: + case 90: + case 101: + case 92: + case 94: + case 96: + case 72: + case 68: + case 81: + return true; + case 70: var isConstEnum = lookAhead(nextTokenIsEnumKeyword); return !isConstEnum; - case 103: - case 68: - case 116: - case 76: - case 122: + case 104: + case 117: + case 77: + case 123: if (isDeclarationStart()) { return false; } - case 108: - case 106: - case 107: case 109: + case 107: + case 108: + case 110: if (lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine)) { return false; } @@ -6676,7 +7233,7 @@ var ts; } function nextTokenIsEnumKeyword() { nextToken(); - return token === 76; + return token === 77; } function nextTokenIsIdentifierOrKeywordOnSameLine() { nextToken(); @@ -6686,46 +7243,48 @@ var ts; switch (token) { case 14: return parseBlock(false, false); - case 97: + case 98: + case 70: + return parseVariableStatement(scanner.getStartPos(), undefined, undefined); + case 83: + return parseFunctionDeclaration(scanner.getStartPos(), undefined, undefined); case 69: - return parseVariableStatement(scanner.getStartPos(), undefined); - case 82: - return parseFunctionDeclaration(scanner.getStartPos(), undefined); + return parseClassDeclaration(scanner.getStartPos(), undefined, undefined); case 22: return parseEmptyStatement(); - case 83: + case 84: return parseIfStatement(); - case 74: + case 75: return parseDoStatement(); - case 99: - return parseWhileStatement(); - case 81: - return parseForOrForInOrForOfStatement(); - case 70: - return parseBreakOrContinueStatement(184); - case 65: - return parseBreakOrContinueStatement(185); - case 89: - return parseReturnStatement(); case 100: - return parseWithStatement(); - case 91: - return parseSwitchStatement(); - case 93: - return parseThrowStatement(); - case 95: - case 67: - case 80: - return parseTryStatement(); + return parseWhileStatement(); + case 82: + return parseForOrForInOrForOfStatement(); case 71: + return parseBreakOrContinueStatement(189); + case 66: + return parseBreakOrContinueStatement(190); + case 90: + return parseReturnStatement(); + case 101: + return parseWithStatement(); + case 92: + return parseSwitchStatement(); + case 94: + return parseThrowStatement(); + case 96: + case 68: + case 81: + return parseTryStatement(); + case 72: return parseDebuggerStatement(); - case 104: + case 105: if (isLetDeclaration()) { - return parseVariableStatement(scanner.getStartPos(), undefined); + return parseVariableStatement(scanner.getStartPos(), undefined, undefined); } default: - if (ts.isModifier(token)) { - var result = tryParse(parseVariableStatementOrFunctionDeclarationWithModifiers); + if (ts.isModifier(token) || token === 52) { + var result = tryParse(parseVariableStatementOrFunctionDeclarationOrClassDeclarationWithDecoratorsOrModifiers); if (result) { return result; } @@ -6733,25 +7292,28 @@ var ts; return parseExpressionOrLabeledStatement(); } } - function parseVariableStatementOrFunctionDeclarationWithModifiers() { + function parseVariableStatementOrFunctionDeclarationOrClassDeclarationWithDecoratorsOrModifiers() { var start = scanner.getStartPos(); + var decorators = parseDecorators(); var modifiers = parseModifiers(); switch (token) { - case 69: + case 70: var nextTokenIsEnum = lookAhead(nextTokenIsEnumKeyword); if (nextTokenIsEnum) { return undefined; } - return parseVariableStatement(start, modifiers); - case 104: + return parseVariableStatement(start, decorators, modifiers); + case 105: if (!isLetDeclaration()) { return undefined; } - return parseVariableStatement(start, modifiers); - case 97: - return parseVariableStatement(start, modifiers); - case 82: - return parseFunctionDeclaration(start, modifiers); + return parseVariableStatement(start, decorators, modifiers); + case 98: + return parseVariableStatement(start, decorators, modifiers); + case 83: + return parseFunctionDeclaration(start, decorators, modifiers); + case 69: + return parseClassDeclaration(start, decorators, modifiers); } return undefined; } @@ -6764,18 +7326,18 @@ var ts; } function parseArrayBindingElement() { if (token === 23) { - return createNode(172); + return createNode(175); } - var node = createNode(150); + var node = createNode(152); node.dotDotDotToken = parseOptionalToken(21); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(false); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(150); + var node = createNode(152); var id = parsePropertyName(); - if (id.kind === 64 && token !== 51) { + if (id.kind === 65 && token !== 51) { node.name = id; } else { @@ -6787,14 +7349,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(148); + var node = createNode(150); parseExpected(14); node.elements = parseDelimitedList(10, parseObjectBindingElement); parseExpected(15); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(149); + var node = createNode(151); parseExpected(18); node.elements = parseDelimitedList(11, parseArrayBindingElement); parseExpected(19); @@ -6813,7 +7375,7 @@ var ts; return parseIdentifier(); } function parseVariableDeclaration() { - var node = createNode(193); + var node = createNode(198); node.name = parseIdentifierOrPattern(); node.type = parseTypeAnnotation(); if (!isInOrOfKeyword(token)) { @@ -6822,21 +7384,21 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(194); + var node = createNode(199); switch (token) { - case 97: + case 98: break; - case 104: + case 105: node.flags |= 4096; break; - case 69: + case 70: node.flags |= 8192; break; default: ts.Debug.fail(); } nextToken(); - if (token === 124 && lookAhead(canFollowContextualOfKeyword)) { + if (token === 125 && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -6850,33 +7412,37 @@ var ts; function canFollowContextualOfKeyword() { return nextTokenIsIdentifier() && nextToken() === 17; } - function parseVariableStatement(fullStart, modifiers) { - var node = createNode(175, fullStart); + function parseVariableStatement(fullStart, decorators, modifiers) { + var node = createNode(180, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); node.declarationList = parseVariableDeclarationList(false); parseSemicolon(); return finishNode(node); } - function parseFunctionDeclaration(fullStart, modifiers) { - var node = createNode(195, fullStart); + function parseFunctionDeclaration(fullStart, decorators, modifiers) { + var node = createNode(200, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(82); + parseExpected(83); node.asteriskToken = parseOptionalToken(35); node.name = node.flags & 256 ? parseOptionalIdentifier() : parseIdentifier(); fillSignature(51, !!node.asteriskToken, false, node); node.body = parseFunctionBlockOrSemicolon(!!node.asteriskToken, ts.Diagnostics.or_expected); return finishNode(node); } - function parseConstructorDeclaration(pos, modifiers) { - var node = createNode(133, pos); + function parseConstructorDeclaration(pos, decorators, modifiers) { + var node = createNode(135, pos); + node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(113); + parseExpected(114); fillSignature(51, false, false, node); node.body = parseFunctionBlockOrSemicolon(false, ts.Diagnostics.or_expected); return finishNode(node); } - function parseMethodDeclaration(fullStart, modifiers, asteriskToken, name, questionToken, diagnosticMessage) { - var method = createNode(132, fullStart); + function parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, diagnosticMessage) { + var method = createNode(134, fullStart); + method.decorators = decorators; setModifiers(method, modifiers); method.asteriskToken = asteriskToken; method.name = name; @@ -6885,29 +7451,34 @@ var ts; method.body = parseFunctionBlockOrSemicolon(!!asteriskToken, diagnosticMessage); return finishNode(method); } - function parsePropertyOrMethodDeclaration(fullStart, modifiers) { + function parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken) { + var property = createNode(132, fullStart); + property.decorators = decorators; + setModifiers(property, modifiers); + property.name = name; + property.questionToken = questionToken; + property.type = parseTypeAnnotation(); + property.initializer = allowInAnd(parseNonParameterInitializer); + parseSemicolon(); + return finishNode(property); + } + function parsePropertyOrMethodDeclaration(fullStart, decorators, modifiers) { var asteriskToken = parseOptionalToken(35); - var _name = parsePropertyName(); + var name = parsePropertyName(); var questionToken = parseOptionalToken(50); if (asteriskToken || token === 16 || token === 24) { - return parseMethodDeclaration(fullStart, modifiers, asteriskToken, _name, questionToken, ts.Diagnostics.or_expected); + return parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, ts.Diagnostics.or_expected); } else { - var property = createNode(130, fullStart); - setModifiers(property, modifiers); - property.name = _name; - property.questionToken = questionToken; - property.type = parseTypeAnnotation(); - property.initializer = allowInAnd(parseNonParameterInitializer); - parseSemicolon(); - return finishNode(property); + return parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken); } } function parseNonParameterInitializer() { return parseInitializer(false); } - function parseAccessorDeclaration(kind, fullStart, modifiers) { + function parseAccessorDeclaration(kind, fullStart, decorators, modifiers) { var node = createNode(kind, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); node.name = parsePropertyName(); fillSignature(51, false, false, node); @@ -6916,6 +7487,9 @@ var ts; } function isClassMemberStart() { var idToken; + if (token === 52) { + return true; + } while (ts.isModifier(token)) { idToken = token; nextToken(); @@ -6931,14 +7505,14 @@ var ts; return true; } if (idToken !== undefined) { - if (!ts.isKeyword(idToken) || idToken === 119 || idToken === 115) { + if (!ts.isKeyword(idToken) || idToken === 120 || idToken === 116) { return true; } switch (token) { case 16: case 24: case 51: - case 52: + case 53: case 50: return true; default: @@ -6947,6 +7521,26 @@ var ts; } return false; } + function parseDecorators() { + var decorators; + while (true) { + var decoratorStart = getNodePos(); + if (!parseOptional(52)) { + break; + } + if (!decorators) { + decorators = []; + decorators.pos = scanner.getStartPos(); + } + var decorator = createNode(130, decoratorStart); + decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); + decorators.push(finishNode(decorator)); + } + if (decorators) { + decorators.end = getNodeEnd(); + } + return decorators; + } function parseModifiers() { var flags = 0; var modifiers; @@ -6970,31 +7564,52 @@ var ts; return modifiers; } function parseClassElement() { + if (token === 22) { + var result = createNode(178); + nextToken(); + return finishNode(result); + } var fullStart = getNodePos(); + var decorators = parseDecorators(); var modifiers = parseModifiers(); - var accessor = tryParseAccessorDeclaration(fullStart, modifiers); + var accessor = tryParseAccessorDeclaration(fullStart, decorators, modifiers); if (accessor) { return accessor; } - if (token === 113) { - return parseConstructorDeclaration(fullStart, modifiers); + if (token === 114) { + return parseConstructorDeclaration(fullStart, decorators, modifiers); } if (isIndexSignature()) { - return parseIndexSignatureDeclaration(modifiers); + return parseIndexSignatureDeclaration(fullStart, decorators, modifiers); } if (isIdentifierOrKeyword() || token === 8 || token === 7 || token === 35 || token === 18) { - return parsePropertyOrMethodDeclaration(fullStart, modifiers); + return parsePropertyOrMethodDeclaration(fullStart, decorators, modifiers); + } + if (decorators) { + var name_3 = createMissingNode(65, true, ts.Diagnostics.Declaration_expected); + return parsePropertyDeclaration(fullStart, decorators, modifiers, name_3, undefined); } ts.Debug.fail("Should not have attempted to parse class member declaration."); } - function parseClassDeclaration(fullStart, modifiers) { - var node = createNode(196, fullStart); + function parseClassExpression() { + return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 174); + } + function parseClassDeclaration(fullStart, decorators, modifiers) { + return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 201); + } + function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) { + var savedStrictModeContext = inStrictModeContext(); + if (languageVersion >= 2) { + setStrictModeContext(true); + } + var node = createNode(kind, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(68); + parseExpected(69); node.name = node.flags & 256 ? parseOptionalIdentifier() : parseIdentifier(); node.typeParameters = parseTypeParameters(); node.heritageClauses = parseHeritageClauses(true); @@ -7007,9 +7622,14 @@ var ts; else { node.members = createMissingList(); } - return finishNode(node); + var finishedNode = finishNode(node); + setStrictModeContext(savedStrictModeContext); + return finishedNode; } function parseHeritageClauses(isClassHeritageClause) { + // ClassTail[Yield,GeneratorParameter] : See 14.5 + // [~GeneratorParameter]ClassHeritage[?Yield]opt { ClassBody[?Yield]opt } + // [+GeneratorParameter] ClassHeritageopt { ClassBodyopt } if (isHeritageClause()) { return isClassHeritageClause && inGeneratorParameterContext() ? doOutsideOfYieldContext(parseHeritageClausesWorker) @@ -7021,51 +7641,62 @@ var ts; return parseList(19, false, parseHeritageClause); } function parseHeritageClause() { - if (token === 78 || token === 102) { - var node = createNode(216); + if (token === 79 || token === 103) { + var node = createNode(222); node.token = token; nextToken(); - node.types = parseDelimitedList(8, parseTypeReference); + node.types = parseDelimitedList(8, parseHeritageClauseElement); return finishNode(node); } return undefined; } + function parseHeritageClauseElement() { + var node = createNode(177); + node.expression = parseLeftHandSideExpressionOrHigher(); + if (token === 24) { + node.typeArguments = parseBracketedList(17, parseType, 24, 25); + } + return finishNode(node); + } function isHeritageClause() { - return token === 78 || token === 102; + return token === 79 || token === 103; } function parseClassMembers() { return parseList(6, false, parseClassElement); } - function parseInterfaceDeclaration(fullStart, modifiers) { - var node = createNode(197, fullStart); + function parseInterfaceDeclaration(fullStart, decorators, modifiers) { + var node = createNode(202, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(103); + parseExpected(104); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); node.heritageClauses = parseHeritageClauses(false); node.members = parseObjectTypeMembers(); return finishNode(node); } - function parseTypeAliasDeclaration(fullStart, modifiers) { - var node = createNode(198, fullStart); + function parseTypeAliasDeclaration(fullStart, decorators, modifiers) { + var node = createNode(203, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(122); + parseExpected(123); node.name = parseIdentifier(); - parseExpected(52); + parseExpected(53); node.type = parseType(); parseSemicolon(); return finishNode(node); } function parseEnumMember() { - var node = createNode(220, scanner.getStartPos()); + var node = createNode(226, scanner.getStartPos()); node.name = parsePropertyName(); node.initializer = allowInAnd(parseNonParameterInitializer); return finishNode(node); } - function parseEnumDeclaration(fullStart, modifiers) { - var node = createNode(199, fullStart); + function parseEnumDeclaration(fullStart, decorators, modifiers) { + var node = createNode(204, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(76); + parseExpected(77); node.name = parseIdentifier(); if (parseExpected(14)) { node.members = parseDelimitedList(7, parseEnumMember); @@ -7077,7 +7708,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(201, scanner.getStartPos()); + var node = createNode(206, scanner.getStartPos()); if (parseExpected(14)) { node.statements = parseList(1, false, parseModuleElement); parseExpected(15); @@ -7087,31 +7718,33 @@ var ts; } return finishNode(node); } - function parseInternalModuleTail(fullStart, modifiers, flags) { - var node = createNode(200, fullStart); + function parseInternalModuleTail(fullStart, decorators, modifiers, flags) { + var node = createNode(205, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); node.flags |= flags; node.name = parseIdentifier(); node.body = parseOptional(20) - ? parseInternalModuleTail(getNodePos(), undefined, 1) + ? parseInternalModuleTail(getNodePos(), undefined, undefined, 1) : parseModuleBlock(); return finishNode(node); } - function parseAmbientExternalModuleDeclaration(fullStart, modifiers) { - var node = createNode(200, fullStart); + function parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) { + var node = createNode(205, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); node.name = parseLiteralNode(true); node.body = parseModuleBlock(); return finishNode(node); } - function parseModuleDeclaration(fullStart, modifiers) { - parseExpected(116); + function parseModuleDeclaration(fullStart, decorators, modifiers) { + parseExpected(117); return token === 8 - ? parseAmbientExternalModuleDeclaration(fullStart, modifiers) - : parseInternalModuleTail(fullStart, modifiers, modifiers ? modifiers.flags : 0); + ? parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) + : parseInternalModuleTail(fullStart, decorators, modifiers, modifiers ? modifiers.flags : 0); } function isExternalModuleReference() { - return token === 117 && + return token === 118 && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -7120,44 +7753,52 @@ var ts; function nextTokenIsCommaOrFromKeyword() { nextToken(); return token === 23 || - token === 123; + token === 124; } - function parseImportDeclarationOrImportEqualsDeclaration(fullStart, modifiers) { - parseExpected(84); + function parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers) { + parseExpected(85); var afterImportPos = scanner.getStartPos(); var identifier; if (isIdentifier()) { identifier = parseIdentifier(); - if (token !== 23 && token !== 123) { - var importEqualsDeclaration = createNode(203, fullStart); + if (token !== 23 && token !== 124) { + var importEqualsDeclaration = createNode(208, fullStart); + importEqualsDeclaration.decorators = decorators; setModifiers(importEqualsDeclaration, modifiers); importEqualsDeclaration.name = identifier; - parseExpected(52); + parseExpected(53); importEqualsDeclaration.moduleReference = parseModuleReference(); parseSemicolon(); return finishNode(importEqualsDeclaration); } } - var importDeclaration = createNode(204, fullStart); + var importDeclaration = createNode(209, fullStart); + importDeclaration.decorators = decorators; setModifiers(importDeclaration, modifiers); if (identifier || token === 35 || token === 14) { importDeclaration.importClause = parseImportClause(identifier, afterImportPos); - parseExpected(123); + parseExpected(124); } importDeclaration.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); return finishNode(importDeclaration); } function parseImportClause(identifier, fullStart) { - var importClause = createNode(205, fullStart); + //ImportClause: + // ImportedDefaultBinding + // NameSpaceImport + // NamedImports + // ImportedDefaultBinding, NameSpaceImport + // ImportedDefaultBinding, NamedImports + var importClause = createNode(210, fullStart); if (identifier) { importClause.name = identifier; } if (!importClause.name || parseOptional(23)) { - importClause.namedBindings = token === 35 ? parseNamespaceImport() : parseNamedImportsOrExports(207); + importClause.namedBindings = token === 35 ? parseNamespaceImport() : parseNamedImportsOrExports(212); } return finishNode(importClause); } @@ -7167,8 +7808,8 @@ var ts; : parseEntityName(false); } function parseExternalModuleReference() { - var node = createNode(213); - parseExpected(117); + var node = createNode(219); + parseExpected(118); parseExpected(16); node.expression = parseModuleSpecifier(); parseExpected(17); @@ -7182,107 +7823,116 @@ var ts; return result; } function parseNamespaceImport() { - var namespaceImport = createNode(206); + var namespaceImport = createNode(211); parseExpected(35); - parseExpected(101); + parseExpected(102); namespaceImport.name = parseIdentifier(); return finishNode(namespaceImport); } function parseNamedImportsOrExports(kind) { var node = createNode(kind); - node.elements = parseBracketedList(20, kind === 207 ? parseImportSpecifier : parseExportSpecifier, 14, 15); + node.elements = parseBracketedList(20, kind === 212 ? parseImportSpecifier : parseExportSpecifier, 14, 15); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(212); + return parseImportOrExportSpecifier(217); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(208); + return parseImportOrExportSpecifier(213); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); - var isFirstIdentifierNameNotAnIdentifier = ts.isKeyword(token) && !isIdentifier(); - var start = scanner.getTokenPos(); + var checkIdentifierIsKeyword = ts.isKeyword(token) && !isIdentifier(); + var checkIdentifierStart = scanner.getTokenPos(); + var checkIdentifierEnd = scanner.getTextPos(); var identifierName = parseIdentifierName(); - if (token === 101) { + if (token === 102) { node.propertyName = identifierName; - parseExpected(101); - if (isIdentifier()) { - node.name = parseIdentifierName(); - } - else { - parseErrorAtCurrentToken(ts.Diagnostics.Identifier_expected); - } + parseExpected(102); + checkIdentifierIsKeyword = ts.isKeyword(token) && !isIdentifier(); + checkIdentifierStart = scanner.getTokenPos(); + checkIdentifierEnd = scanner.getTextPos(); + node.name = parseIdentifierName(); } else { node.name = identifierName; - if (isFirstIdentifierNameNotAnIdentifier) { - parseErrorAtPosition(start, identifierName.end - start, ts.Diagnostics.Identifier_expected); - } + } + if (kind === 213 && checkIdentifierIsKeyword) { + parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } - function parseExportDeclaration(fullStart, modifiers) { - var node = createNode(210, fullStart); + function parseExportDeclaration(fullStart, decorators, modifiers) { + var node = createNode(215, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); if (parseOptional(35)) { - parseExpected(123); + parseExpected(124); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(211); - if (parseOptional(123)) { + node.exportClause = parseNamedImportsOrExports(216); + if (parseOptional(124)) { node.moduleSpecifier = parseModuleSpecifier(); } } parseSemicolon(); return finishNode(node); } - function parseExportAssignment(fullStart, modifiers) { - var node = createNode(209, fullStart); + function parseExportAssignment(fullStart, decorators, modifiers) { + var node = createNode(214, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); - if (parseOptional(52)) { + if (parseOptional(53)) { node.isExportEquals = true; + node.expression = parseAssignmentExpressionOrHigher(); } else { - parseExpected(72); + parseExpected(73); + if (parseOptional(51)) { + node.type = parseType(); + } + else { + node.expression = parseAssignmentExpressionOrHigher(); + } } - node.expression = parseAssignmentExpressionOrHigher(); parseSemicolon(); return finishNode(node); } function isLetDeclaration() { return inStrictModeContext() || lookAhead(nextTokenIsIdentifierOrStartOfDestructuringOnTheSameLine); } - function isDeclarationStart() { + function isDeclarationStart(followsModifier) { switch (token) { - case 97: - case 69: - case 82: + case 98: + case 70: + case 83: return true; - case 104: + case 105: return isLetDeclaration(); - case 68: - case 103: - case 76: - case 122: - return lookAhead(nextTokenIsIdentifierOrKeyword); - case 84: - return lookAhead(nextTokenCanFollowImportKeyword); - case 116: - return lookAhead(nextTokenIsIdentifierOrKeywordOrStringLiteral); + case 69: + case 104: case 77: + case 123: + return lookAhead(nextTokenIsIdentifierOrKeyword); + case 85: + return lookAhead(nextTokenCanFollowImportKeyword); + case 117: + return lookAhead(nextTokenIsIdentifierOrKeywordOrStringLiteral); + case 78: return lookAhead(nextTokenCanFollowExportKeyword); - case 114: - case 108: - case 106: - case 107: + case 115: case 109: + case 107: + case 108: + case 110: return lookAhead(nextTokenIsDeclarationStart); + case 52: + return !followsModifier; } } function isIdentifierOrKeyword() { - return token >= 64; + return token >= 65; } function nextTokenIsIdentifierOrKeyword() { nextToken(); @@ -7299,48 +7949,56 @@ var ts; } function nextTokenCanFollowExportKeyword() { nextToken(); - return token === 52 || token === 35 || - token === 14 || token === 72 || isDeclarationStart(); + return token === 53 || token === 35 || + token === 14 || token === 73 || isDeclarationStart(true); } function nextTokenIsDeclarationStart() { nextToken(); - return isDeclarationStart(); + return isDeclarationStart(true); } function nextTokenIsAsKeyword() { - return nextToken() === 101; + return nextToken() === 102; } function parseDeclaration() { var fullStart = getNodePos(); + var decorators = parseDecorators(); var modifiers = parseModifiers(); - if (token === 77) { + if (token === 78) { nextToken(); - if (token === 72 || token === 52) { - return parseExportAssignment(fullStart, modifiers); + if (token === 73 || token === 53) { + return parseExportAssignment(fullStart, decorators, modifiers); } if (token === 35 || token === 14) { - return parseExportDeclaration(fullStart, modifiers); + return parseExportDeclaration(fullStart, decorators, modifiers); } } switch (token) { - case 97: - case 104: + case 98: + case 105: + case 70: + return parseVariableStatement(fullStart, decorators, modifiers); + case 83: + return parseFunctionDeclaration(fullStart, decorators, modifiers); case 69: - return parseVariableStatement(fullStart, modifiers); - case 82: - return parseFunctionDeclaration(fullStart, modifiers); - case 68: - return parseClassDeclaration(fullStart, modifiers); - case 103: - return parseInterfaceDeclaration(fullStart, modifiers); - case 122: - return parseTypeAliasDeclaration(fullStart, modifiers); - case 76: - return parseEnumDeclaration(fullStart, modifiers); - case 116: - return parseModuleDeclaration(fullStart, modifiers); - case 84: - return parseImportDeclarationOrImportEqualsDeclaration(fullStart, modifiers); + return parseClassDeclaration(fullStart, decorators, modifiers); + case 104: + return parseInterfaceDeclaration(fullStart, decorators, modifiers); + case 123: + return parseTypeAliasDeclaration(fullStart, decorators, modifiers); + case 77: + return parseEnumDeclaration(fullStart, decorators, modifiers); + case 117: + return parseModuleDeclaration(fullStart, decorators, modifiers); + case 85: + return parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers); default: + if (decorators) { + var node = createMissingNode(218, true, ts.Diagnostics.Declaration_expected); + node.pos = fullStart; + node.decorators = decorators; + setModifiers(node, modifiers); + return finishNode(node); + } ts.Debug.fail("Mismatch between isDeclarationStart and parseDeclaration"); } } @@ -7415,10 +8073,10 @@ var ts; function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { return node.flags & 1 - || node.kind === 203 && node.moduleReference.kind === 213 - || node.kind === 204 + || node.kind === 208 && node.moduleReference.kind === 219 || node.kind === 209 - || node.kind === 210 + || node.kind === 214 + || node.kind === 215 ? node : undefined; }); @@ -7427,26 +8085,27 @@ var ts; function isLeftHandSideExpression(expr) { if (expr) { switch (expr.kind) { - case 153: - case 154: - case 156: case 155: + case 156: + case 158: case 157: - case 151: case 159: - case 152: - case 160: - case 64: + case 153: + case 161: + case 154: + case 174: + case 162: + case 65: case 9: case 7: case 8: case 10: - case 169: - case 79: - case 88: - case 92: - case 94: - case 90: + case 171: + case 80: + case 89: + case 93: + case 95: + case 91: return true; } } @@ -7454,24 +8113,25 @@ var ts; } ts.isLeftHandSideExpression = isLeftHandSideExpression; function isAssignmentOperator(token) { - return token >= 52 && token <= 63; + return token >= 53 && token <= 64; } ts.isAssignmentOperator = isAssignmentOperator; })(ts || (ts = {})); +/// var ts; (function (ts) { ts.bindTime = 0; function getModuleInstanceState(node) { - if (node.kind === 197 || node.kind === 198) { + if (node.kind === 202 || node.kind === 203) { return 0; } else if (ts.isConstEnumDeclaration(node)) { return 2; } - else if ((node.kind === 204 || node.kind === 203) && !(node.flags & 1)) { + else if ((node.kind === 209 || node.kind === 208) && !(node.flags & 1)) { return 0; } - else if (node.kind === 201) { + else if (node.kind === 206) { var state = 0; ts.forEachChild(node, function (n) { switch (getModuleInstanceState(n)) { @@ -7487,7 +8147,7 @@ var ts; }); return state; } - else if (node.kind === 200) { + else if (node.kind === 205) { return getModuleInstanceState(node.body); } else { @@ -7502,7 +8162,7 @@ var ts; } ts.bindSourceFile = bindSourceFile; function bindSourceFileWorker(file) { - var _parent; + var parent; var container; var blockScopeContainer; var lastContainer; @@ -7540,10 +8200,10 @@ var ts; } function getDeclarationName(node) { if (node.name) { - if (node.kind === 200 && node.name.kind === 8) { + if (node.kind === 205 && node.name.kind === 8) { return '"' + node.name.text + '"'; } - if (node.name.kind === 126) { + if (node.name.kind === 127) { var nameExpression = node.name.expression; ts.Debug.assert(ts.isWellKnownSymbolSyntactically(nameExpression)); return ts.getPropertyNameForKnownSymbolName(nameExpression.name.text); @@ -7551,22 +8211,22 @@ var ts; return node.name.text; } switch (node.kind) { - case 141: - case 133: + case 143: + case 135: return "__constructor"; - case 140: - case 136: - return "__call"; - case 137: - return "__new"; + case 142: case 138: + return "__call"; + case 139: + return "__new"; + case 140: return "__index"; - case 210: + case 215: return "__export"; - case 209: - return "default"; - case 195: - case 196: + case 214: + return node.isExportEquals ? "export=" : "default"; + case 200: + case 201: return node.flags & 256 ? "default" : undefined; } } @@ -7575,10 +8235,10 @@ var ts; } function declareSymbol(symbols, parent, node, includes, excludes) { ts.Debug.assert(!ts.hasDynamicName(node)); - var _name = node.flags & 256 && parent ? "default" : getDeclarationName(node); + var name = node.flags & 256 && parent ? "default" : getDeclarationName(node); var symbol; - if (_name !== undefined) { - symbol = ts.hasProperty(symbols, _name) ? symbols[_name] : (symbols[_name] = createSymbol(0, _name)); + if (name !== undefined) { + symbol = ts.hasProperty(symbols, name) ? symbols[name] : (symbols[name] = createSymbol(0, name)); if (symbol.flags & excludes) { if (node.name) { node.name.parent = node; @@ -7590,7 +8250,7 @@ var ts; file.bindDiagnostics.push(ts.createDiagnosticForNode(declaration.name || declaration, message, getDisplayName(declaration))); }); file.bindDiagnostics.push(ts.createDiagnosticForNode(node.name || node, message, getDisplayName(node))); - symbol = createSymbol(0, _name); + symbol = createSymbol(0, name); } } else { @@ -7598,7 +8258,7 @@ var ts; } addDeclarationToSymbol(symbol, node, includes); symbol.parent = parent; - if (node.kind === 196 && symbol.exports) { + if ((node.kind === 201 || node.kind === 174) && symbol.exports) { var prototypeSymbol = createSymbol(4 | 134217728, "prototype"); if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { if (node.name) { @@ -7611,18 +8271,10 @@ var ts; } return symbol; } - function isAmbientContext(node) { - while (node) { - if (node.flags & 2) - return true; - node = node.parent; - } - return false; - } function declareModuleMember(node, symbolKind, symbolExcludes) { var hasExportModifier = ts.getCombinedNodeFlags(node) & 1; if (symbolKind & 8388608) { - if (node.kind === 212 || (node.kind === 203 && hasExportModifier)) { + if (node.kind === 217 || (node.kind === 208 && hasExportModifier)) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); } else { @@ -7630,7 +8282,7 @@ var ts; } } else { - if (hasExportModifier || isAmbientContext(container)) { + if (hasExportModifier || container.flags & 32768) { var exportKind = (symbolKind & 107455 ? 1048576 : 0) | (symbolKind & 793056 ? 2097152 : 0) | (symbolKind & 1536 ? 4194304 : 0); @@ -7647,10 +8299,10 @@ var ts; if (symbolKind & 255504) { node.locals = {}; } - var saveParent = _parent; + var saveParent = parent; var saveContainer = container; var savedBlockScopeContainer = blockScopeContainer; - _parent = node; + parent = node; if (symbolKind & 262128) { container = node; if (lastContainer) { @@ -7659,55 +8311,85 @@ var ts; lastContainer = container; } if (isBlockScopeContainer) { - setBlockScopeContainer(node, (symbolKind & 255504) === 0 && node.kind !== 221); + setBlockScopeContainer(node, (symbolKind & 255504) === 0 && node.kind !== 227); } ts.forEachChild(node, bind); container = saveContainer; - _parent = saveParent; + parent = saveParent; blockScopeContainer = savedBlockScopeContainer; } function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) { switch (container.kind) { - case 200: + case 205: declareModuleMember(node, symbolKind, symbolExcludes); break; - case 221: + case 227: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolKind, symbolExcludes); break; } + case 142: + case 143: + case 138: + case 139: case 140: - case 141: + case 134: + case 133: + case 135: case 136: case 137: - case 138: - case 132: - case 131: - case 133: - case 134: - case 135: - case 195: - case 160: - case 161: + case 200: + case 162: + case 163: declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); break; - case 196: + case 174: + case 201: if (node.flags & 128) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } - case 143: - case 152: - case 197: + case 145: + case 154: + case 202: declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes); break; - case 199: + case 204: declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } bindChildren(node, symbolKind, isBlockScopeContainer); } + function isAmbientContext(node) { + while (node) { + if (node.flags & 2) + return true; + node = node.parent; + } + return false; + } + function hasExportDeclarations(node) { + var body = node.kind === 227 ? node : node.body; + if (body.kind === 227 || body.kind === 206) { + for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { + var stat = _a[_i]; + if (stat.kind === 215 || stat.kind === 214) { + return true; + } + } + } + return false; + } + function setExportContextFlag(node) { + if (isAmbientContext(node) && !hasExportDeclarations(node)) { + node.flags |= 32768; + } + else { + node.flags &= ~32768; + } + } function bindModuleDeclaration(node) { + setExportContextFlag(node); if (node.name.kind === 8) { bindDeclaration(node, 512, 106639, true); } @@ -7718,23 +8400,30 @@ var ts; } else { bindDeclaration(node, 512, 106639, true); - if (state === 2) { - node.symbol.constEnumOnlyModule = true; + var currentModuleIsConstEnumOnly = state === 2; + if (node.symbol.constEnumOnlyModule === undefined) { + node.symbol.constEnumOnlyModule = currentModuleIsConstEnumOnly; } - else if (node.symbol.constEnumOnlyModule) { - node.symbol.constEnumOnlyModule = false; + else { + node.symbol.constEnumOnlyModule = node.symbol.constEnumOnlyModule && currentModuleIsConstEnumOnly; } } } } function bindFunctionOrConstructorType(node) { + // For a given function symbol "<...>(...) => T" we want to generate a symbol identical + // to the one we would get for: { <...>(...): T } + // + // We do that by making an anonymous type literal symbol, and then setting the function + // symbol as its sole member. To the rest of the system, this symbol will be indistinguishable + // from an actual type literal symbol you would have gotten had you used the long form. var symbol = createSymbol(131072, getDeclarationName(node)); addDeclarationToSymbol(symbol, node, 131072); bindChildren(node, 131072, false); var typeLiteralSymbol = createSymbol(2048, "__type"); addDeclarationToSymbol(typeLiteralSymbol, node, 2048); typeLiteralSymbol.members = {}; - typeLiteralSymbol.members[node.kind === 140 ? "__call" : "__new"] = symbol; + typeLiteralSymbol.members[node.kind === 142 ? "__call" : "__new"] = symbol; } function bindAnonymousDeclaration(node, symbolKind, name, isBlockScopeContainer) { var symbol = createSymbol(symbolKind, name); @@ -7746,10 +8435,10 @@ var ts; } function bindBlockScopedVariableDeclaration(node) { switch (blockScopeContainer.kind) { - case 200: + case 205: declareModuleMember(node, 2, 107455); break; - case 221: + case 227: if (ts.isExternalModule(container)) { declareModuleMember(node, 2, 107455); break; @@ -7766,16 +8455,16 @@ var ts; return "__" + ts.indexOf(node.parent.parameters, node); } function bind(node) { - node.parent = _parent; + node.parent = parent; switch (node.kind) { - case 127: + case 128: bindDeclaration(node, 262144, 530912, false); break; - case 128: + case 129: bindParameter(node); break; - case 193: - case 150: + case 198: + case 152: if (ts.isBindingPattern(node.name)) { bindChildren(node, 0, false); } @@ -7786,65 +8475,68 @@ var ts; bindDeclaration(node, 1, 107454, false); } break; - case 130: - case 129: - bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 107455, false); - break; - case 218: - case 219: - bindPropertyOrMethodOrAccessor(node, 4, 107455, false); - break; - case 220: - bindPropertyOrMethodOrAccessor(node, 8, 107455, false); - break; - case 136: - case 137: - case 138: - bindDeclaration(node, 131072, 0, false); - break; case 132: case 131: - bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 107455 : 99263, true); + bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 107455, false); break; - case 195: - bindDeclaration(node, 16, 106927, true); + case 224: + case 225: + bindPropertyOrMethodOrAccessor(node, 4, 107455, false); break; - case 133: - bindDeclaration(node, 16384, 0, true); + case 226: + bindPropertyOrMethodOrAccessor(node, 8, 107455, false); + break; + case 138: + case 139: + case 140: + bindDeclaration(node, 131072, 0, false); break; case 134: - bindPropertyOrMethodOrAccessor(node, 32768, 41919, true); + case 133: + bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 107455 : 99263, true); + break; + case 200: + bindDeclaration(node, 16, 106927, true); break; case 135: + bindDeclaration(node, 16384, 0, true); + break; + case 136: + bindPropertyOrMethodOrAccessor(node, 32768, 41919, true); + break; + case 137: bindPropertyOrMethodOrAccessor(node, 65536, 74687, true); break; - case 140: - case 141: + case 142: + case 143: bindFunctionOrConstructorType(node); break; - case 143: + case 145: bindAnonymousDeclaration(node, 2048, "__type", false); break; - case 152: + case 154: bindAnonymousDeclaration(node, 4096, "__object", false); break; - case 160: - case 161: + case 162: + case 163: bindAnonymousDeclaration(node, 16, "__function", true); break; - case 217: + case 174: + bindAnonymousDeclaration(node, 32, "__class", false); + break; + case 223: bindCatchVariableDeclaration(node); break; - case 196: + case 201: bindDeclaration(node, 32, 899583, false); break; - case 197: + case 202: bindDeclaration(node, 64, 792992, false); break; - case 198: + case 203: bindDeclaration(node, 524288, 793056, false); break; - case 199: + case 204: if (ts.isConst(node)) { bindDeclaration(node, 128, 899967, false); } @@ -7852,16 +8544,16 @@ var ts; bindDeclaration(node, 256, 899327, false); } break; - case 200: + case 205: bindModuleDeclaration(node); break; - case 203: - case 206: case 208: - case 212: + case 211: + case 213: + case 217: bindDeclaration(node, 8388608, 8388608, false); break; - case 205: + case 210: if (node.name) { bindDeclaration(node, 8388608, 8388608, false); } @@ -7869,41 +8561,42 @@ var ts; bindChildren(node, 0, false); } break; - case 210: + case 215: if (!node.exportClause) { declareSymbol(container.symbol.exports, container.symbol, node, 1073741824, 0); } bindChildren(node, 0, false); break; - case 209: - if (node.expression.kind === 64) { - declareSymbol(container.symbol.exports, container.symbol, node, 8388608, 8388608); + case 214: + if (node.expression && node.expression.kind === 65) { + declareSymbol(container.symbol.exports, container.symbol, node, 8388608, 107455 | 8388608); } else { - declareSymbol(container.symbol.exports, container.symbol, node, 4, 107455); + declareSymbol(container.symbol.exports, container.symbol, node, 4, 107455 | 8388608); } bindChildren(node, 0, false); break; - case 221: + case 227: + setExportContextFlag(node); if (ts.isExternalModule(node)) { bindAnonymousDeclaration(node, 512, '"' + ts.removeFileExtension(node.fileName) + '"', true); break; } - case 174: + case 179: bindChildren(node, 0, !ts.isFunctionLike(node.parent)); break; - case 217: - case 181: - case 182: - case 183: - case 202: + case 223: + case 186: + case 187: + case 188: + case 207: bindChildren(node, 0, true); break; default: - var saveParent = _parent; - _parent = node; + var saveParent = parent; + parent = node; ts.forEachChild(node, bind); - _parent = saveParent; + parent = saveParent; } } function bindParameter(node) { @@ -7914,8 +8607,8 @@ var ts; bindDeclaration(node, 1, 107455, false); } if (node.flags & 112 && - node.parent.kind === 133 && - node.parent.parent.kind === 196) { + node.parent.kind === 135 && + (node.parent.parent.kind === 201 || node.parent.parent.kind === 174)) { var classDeclaration = node.parent.parent; declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4, 107455); } @@ -7930,12 +8623,26 @@ var ts; } } })(ts || (ts = {})); +/// var ts; (function (ts) { var nextSymbolId = 1; var nextNodeId = 1; var nextMergeId = 1; + function getNodeId(node) { + if (!node.id) + node.id = nextNodeId++; + return node.id; + } + ts.getNodeId = getNodeId; ts.checkTime = 0; + function getSymbolId(symbol) { + if (!symbol.id) { + symbol.id = nextSymbolId++; + } + return symbol.id; + } + ts.getSymbolId = getSymbolId; function createTypeChecker(host, produceDiagnostics) { var Symbol = ts.objectAllocator.getSymbolConstructor(); var Type = ts.objectAllocator.getTypeConstructor(); @@ -7999,7 +8706,6 @@ var ts; 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); - var inferenceFailureType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anySignature = createSignature(undefined, undefined, emptyArray, anyType, 0, false, false); var unknownSignature = createSignature(undefined, undefined, emptyArray, unknownType, 0, false, false); var globals = {}; @@ -8016,10 +8722,16 @@ var ts; var globalESSymbolType; var globalIterableType; var anyArrayType; + var globalTypedPropertyDescriptorType; + var globalClassDecoratorType; + var globalParameterDecoratorType; + var globalPropertyDecoratorType; + var globalMethodDecoratorType; var tupleTypes = {}; var unionTypes = {}; var stringLiteralTypes = {}; var emitExtends = false; + var emitDecorate = false; var mergedSymbols = []; var symbolLinks = []; var nodeLinks = []; @@ -8174,20 +8886,18 @@ var ts; function getSymbolLinks(symbol) { if (symbol.flags & 67108864) return symbol; - if (!symbol.id) - symbol.id = nextSymbolId++; - return symbolLinks[symbol.id] || (symbolLinks[symbol.id] = {}); + var id = getSymbolId(symbol); + return symbolLinks[id] || (symbolLinks[id] = {}); } function getNodeLinks(node) { - if (!node.id) - node.id = nextNodeId++; - return nodeLinks[node.id] || (nodeLinks[node.id] = {}); + var nodeId = getNodeId(node); + return nodeLinks[nodeId] || (nodeLinks[nodeId] = {}); } function getSourceFile(node) { - return ts.getAncestor(node, 221); + return ts.getAncestor(node, 227); } function isGlobalSourceFile(node) { - return node.kind === 221 && !ts.isExternalModule(node); + return node.kind === 227 && !ts.isExternalModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { @@ -8221,6 +8931,7 @@ var ts; var lastLocation; var propertyWithInvalidInitializer; var errorLocation = location; + var grandparent; loop: while (location) { if (location.locals && !isGlobalSourceFile(location)) { if (result = getSymbol(location.locals, name, meaning)) { @@ -8228,25 +8939,33 @@ var ts; } } switch (location.kind) { - case 221: + case 227: if (!ts.isExternalModule(location)) break; - case 200: + case 205: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8914931)) { - if (!(result.flags & 8388608 && getDeclarationOfAliasSymbol(result).kind === 212)) { + if (result.flags & meaning || !(result.flags & 8388608 && getDeclarationOfAliasSymbol(result).kind === 217)) { + break loop; + } + result = undefined; + } + else if (location.kind === 227) { + result = getSymbol(getSymbolOfNode(location).exports, "default", meaning & 8914931); + var localSymbol = ts.getLocalSymbolForExportDefault(result); + if (result && (result.flags & meaning) && localSymbol && localSymbol.name === name) { break loop; } result = undefined; } break; - case 199: + case 204: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8)) { break loop; } break; - case 130: - case 129: - if (location.parent.kind === 196 && !(location.flags & 128)) { + case 132: + case 131: + if (location.parent.kind === 201 && !(location.flags & 128)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { if (getSymbol(ctor.locals, name, meaning & 107455)) { @@ -8255,8 +8974,8 @@ var ts; } } break; - case 196: - case 197: + case 201: + case 202: 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); @@ -8265,38 +8984,53 @@ var ts; break loop; } break; - case 126: - var grandparent = location.parent.parent; - if (grandparent.kind === 196 || grandparent.kind === 197) { + case 127: + grandparent = location.parent.parent; + if (grandparent.kind === 201 || grandparent.kind === 202) { 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 132: - case 131: - case 133: case 134: + case 133: case 135: - case 195: - case 161: + case 136: + case 137: + case 200: + case 163: if (name === "arguments") { result = argumentsSymbol; break loop; } break; - case 160: + case 162: if (name === "arguments") { result = argumentsSymbol; break loop; } - var id = location.name; - if (id && name === id.text) { + var functionName = location.name; + if (functionName && name === functionName.text) { result = location.symbol; break loop; } break; + case 174: + var className = location.name; + if (className && name === className.text) { + result = location.symbol; + break loop; + } + break; + case 130: + if (location.parent && location.parent.kind === 129) { + location = location.parent; + } + if (location.parent && ts.isClassElement(location.parent)) { + location = location.parent; + } + break; } lastLocation = location; location = location.parent; @@ -8328,14 +9062,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, 193); + var variableDeclaration = ts.getAncestor(declaration, 198); var container = ts.getEnclosingBlockScopeContainer(variableDeclaration); - if (variableDeclaration.parent.parent.kind === 175 || - variableDeclaration.parent.parent.kind === 181) { + if (variableDeclaration.parent.parent.kind === 180 || + variableDeclaration.parent.parent.kind === 186) { isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, variableDeclaration, container); } - else if (variableDeclaration.parent.parent.kind === 183 || - variableDeclaration.parent.parent.kind === 182) { + else if (variableDeclaration.parent.parent.kind === 188 || + variableDeclaration.parent.parent.kind === 187) { var expression = variableDeclaration.parent.parent.expression; isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, expression, container); } @@ -8355,49 +9089,94 @@ var ts; } return false; } - function isAliasSymbolDeclaration(node) { - return node.kind === 203 || - node.kind === 205 && !!node.name || - node.kind === 206 || - node.kind === 208 || - node.kind === 212 || - node.kind === 209; + function getAnyImportSyntax(node) { + if (ts.isAliasSymbolDeclaration(node)) { + if (node.kind === 208) { + return node; + } + while (node && node.kind !== 209) { + node = node.parent; + } + return node; + } } function getDeclarationOfAliasSymbol(symbol) { - return ts.forEach(symbol.declarations, function (d) { return isAliasSymbolDeclaration(d) ? d : undefined; }); + return ts.forEach(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; }); } function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 213) { - var moduleSymbol = resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)); - var exportAssignmentSymbol = moduleSymbol && getResolvedExportAssignmentSymbol(moduleSymbol); - return exportAssignmentSymbol || moduleSymbol; + if (node.moduleReference.kind === 219) { + return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, node); } function getTargetOfImportClause(node) { var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); if (moduleSymbol) { - var exportAssignmentSymbol = getResolvedExportAssignmentSymbol(moduleSymbol); - if (!exportAssignmentSymbol) { - error(node.name, ts.Diagnostics.External_module_0_has_no_default_export_or_export_assignment, symbolToString(moduleSymbol)); + var exportDefaultSymbol = resolveSymbol(moduleSymbol.exports["default"]); + if (!exportDefaultSymbol) { + error(node.name, ts.Diagnostics.External_module_0_has_no_default_export, symbolToString(moduleSymbol)); } - return exportAssignmentSymbol; + return exportDefaultSymbol; } } function getTargetOfNamespaceImport(node) { - return resolveExternalModuleName(node, node.parent.parent.moduleSpecifier); + var moduleSpecifier = node.parent.parent.moduleSpecifier; + return resolveESModuleSymbol(resolveExternalModuleName(node, moduleSpecifier), moduleSpecifier); + } + function getMemberOfModuleVariable(moduleSymbol, name) { + if (moduleSymbol.flags & 3) { + var typeAnnotation = moduleSymbol.valueDeclaration.type; + if (typeAnnotation) { + return getPropertyOfType(getTypeFromTypeNodeOrHeritageClauseElement(typeAnnotation), name); + } + } + } + function combineValueAndTypeSymbols(valueSymbol, typeSymbol) { + if (valueSymbol.flags & (793056 | 1536)) { + return valueSymbol; + } + var result = createSymbol(valueSymbol.flags | typeSymbol.flags, valueSymbol.name); + result.declarations = ts.concatenate(valueSymbol.declarations, typeSymbol.declarations); + result.parent = valueSymbol.parent || typeSymbol.parent; + if (valueSymbol.valueDeclaration) + result.valueDeclaration = valueSymbol.valueDeclaration; + if (typeSymbol.members) + result.members = typeSymbol.members; + if (valueSymbol.exports) + result.exports = valueSymbol.exports; + return result; + } + function getExportOfModule(symbol, name) { + if (symbol.flags & 1536) { + var exports_1 = getExportsOfSymbol(symbol); + if (ts.hasProperty(exports_1, name)) { + return resolveSymbol(exports_1[name]); + } + } + } + function getPropertyOfVariable(symbol, name) { + if (symbol.flags & 3) { + var typeAnnotation = symbol.valueDeclaration.type; + if (typeAnnotation) { + return resolveSymbol(getPropertyOfType(getTypeFromTypeNodeOrHeritageClauseElement(typeAnnotation), name)); + } + } } function getExternalModuleMember(node, specifier) { var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); - if (moduleSymbol) { - var _name = specifier.propertyName || specifier.name; - if (_name.text) { - var symbol = getSymbol(getExportsOfSymbol(moduleSymbol), _name.text, 107455 | 793056 | 1536); + var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier); + if (targetSymbol) { + var name_4 = specifier.propertyName || specifier.name; + if (name_4.text) { + var symbolFromModule = getExportOfModule(targetSymbol, name_4.text); + var symbolFromVariable = getPropertyOfVariable(targetSymbol, name_4.text); + var symbol = symbolFromModule && symbolFromVariable ? + combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) : + symbolFromModule || symbolFromVariable; if (!symbol) { - error(_name, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(_name)); - return; + error(name_4, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name_4)); } - return symbol.flags & (107455 | 793056 | 1536) ? symbol : resolveAlias(symbol); + return symbol; } } } @@ -8410,31 +9189,34 @@ var ts; resolveEntityName(node.propertyName || node.name, 107455 | 793056 | 1536); } function getTargetOfExportAssignment(node) { - return resolveEntityName(node.expression, 107455 | 793056 | 1536); + return node.expression && resolveEntityName(node.expression, 107455 | 793056 | 1536); } - function getTargetOfImportDeclaration(node) { + function getTargetOfAliasDeclaration(node) { switch (node.kind) { - case 203: - return getTargetOfImportEqualsDeclaration(node); - case 205: - return getTargetOfImportClause(node); - case 206: - return getTargetOfNamespaceImport(node); case 208: + return getTargetOfImportEqualsDeclaration(node); + case 210: + return getTargetOfImportClause(node); + case 211: + return getTargetOfNamespaceImport(node); + case 213: return getTargetOfImportSpecifier(node); - case 212: + case 217: return getTargetOfExportSpecifier(node); - case 209: + case 214: return getTargetOfExportAssignment(node); } } + function resolveSymbol(symbol) { + return symbol && symbol.flags & 8388608 && !(symbol.flags & (107455 | 793056 | 1536)) ? resolveAlias(symbol) : symbol; + } function resolveAlias(symbol) { ts.Debug.assert((symbol.flags & 8388608) !== 0, "Should only get Alias here."); var links = getSymbolLinks(symbol); if (!links.target) { links.target = resolvingSymbol; var node = getDeclarationOfAliasSymbol(symbol); - var target = getTargetOfImportDeclaration(node); + var target = getTargetOfAliasDeclaration(node); if (links.target === resolvingSymbol) { links.target = target || unknownSymbol; } @@ -8450,8 +9232,12 @@ var ts; function markExportAsReferenced(node) { var symbol = getSymbolOfNode(node); var target = resolveAlias(symbol); - if (target && target !== unknownSymbol && target.flags & 107455 && !isConstEnumOrConstEnumOnlyModule(target)) { - markAliasSymbolAsReferenced(symbol); + if (target) { + var markAlias = (target === unknownSymbol && compilerOptions.separateCompilation) || + (target !== unknownSymbol && (target.flags & 107455) && !isConstEnumOrConstEnumOnlyModule(target)); + if (markAlias) { + markAliasSymbolAsReferenced(symbol); + } } } function markAliasSymbolAsReferenced(symbol) { @@ -8459,10 +9245,10 @@ var ts; if (!links.referenced) { links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); - if (node.kind === 209) { + if (node.kind === 214 && node.expression) { checkExpressionCached(node.expression); } - else if (node.kind === 212) { + else if (node.kind === 217) { checkExpressionCached(node.propertyName || node.name); } else if (ts.isInternalModuleImportEqualsDeclaration(node)) { @@ -8472,17 +9258,17 @@ var ts; } function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 203); + importDeclaration = ts.getAncestor(entityName, 208); ts.Debug.assert(importDeclaration !== undefined); } - if (entityName.kind === 64 && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { + if (entityName.kind === 65 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 64 || entityName.parent.kind === 125) { + if (entityName.kind === 65 || entityName.parent.kind === 126) { return resolveEntityName(entityName, 1536); } else { - ts.Debug.assert(entityName.parent.kind === 203); + ts.Debug.assert(entityName.parent.kind === 208); return resolveEntityName(entityName, 107455 | 793056 | 1536); } } @@ -8490,28 +9276,32 @@ var ts; return symbol.parent ? getFullyQualifiedName(symbol.parent) + "." + symbolToString(symbol) : symbolToString(symbol); } function resolveEntityName(name, meaning) { - if (ts.getFullWidth(name) === 0) { + if (ts.nodeIsMissing(name)) { return undefined; } var symbol; - if (name.kind === 64) { + if (name.kind === 65) { symbol = resolveName(name, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, name); if (!symbol) { return undefined; } } - else if (name.kind === 125) { - var namespace = resolveEntityName(name.left, 1536); - if (!namespace || namespace === unknownSymbol || ts.getFullWidth(name.right) === 0) { + 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; + var namespace = resolveEntityName(left, 1536); + if (!namespace || namespace === unknownSymbol || ts.nodeIsMissing(right)) { return undefined; } - var right = name.right; symbol = getSymbol(getExportsOfSymbol(namespace), right.text, meaning); if (!symbol) { error(right, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), ts.declarationNameToString(right)); return undefined; } } + else { + ts.Debug.fail("Unknown entity name kind."); + } ts.Debug.assert((symbol.flags & 16777216) === 0, "Should never get an instantiated symbol here."); return symbol.flags & meaning ? symbol : resolveAlias(symbol); } @@ -8556,22 +9346,22 @@ var ts; } error(moduleReferenceLiteral, ts.Diagnostics.Cannot_find_external_module_0, moduleName); } - function getExportAssignmentSymbol(moduleSymbol) { - return moduleSymbol.exports["default"]; + function resolveExternalModuleSymbol(moduleSymbol) { + return moduleSymbol && resolveSymbol(moduleSymbol.exports["export="]) || moduleSymbol; } - function getResolvedExportAssignmentSymbol(moduleSymbol) { - var symbol = getExportAssignmentSymbol(moduleSymbol); - if (symbol) { - if (symbol.flags & (107455 | 793056 | 1536)) { - return symbol; - } - if (symbol.flags & 8388608) { - return resolveAlias(symbol); - } + 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)); + symbol = undefined; } + return symbol; + } + function getExportAssignmentSymbol(moduleSymbol) { + return moduleSymbol.exports["export="]; } function getExportsOfSymbol(symbol) { - return symbol.flags & 1536 ? getExportsOfModule(symbol) : symbol.exports; + return symbol.flags & 1536 ? getExportsOfModule(symbol) : symbol.exports || emptySymbols; } function getExportsOfModule(moduleSymbol) { var links = getSymbolLinks(moduleSymbol); @@ -8585,20 +9375,12 @@ var ts; } } function getExportsForModule(moduleSymbol) { - if (compilerOptions.target < 2) { - var defaultSymbol = getExportAssignmentSymbol(moduleSymbol); - if (defaultSymbol) { - return { - "default": defaultSymbol - }; - } - } var result; var visitedSymbols = []; visit(moduleSymbol); return result || moduleSymbol.exports; function visit(symbol) { - if (!ts.contains(visitedSymbols, symbol)) { + if (symbol.flags & 1952 && !ts.contains(visitedSymbols, symbol)) { visitedSymbols.push(symbol); if (symbol !== moduleSymbol) { if (!result) { @@ -8608,9 +9390,10 @@ var ts; } var exportStars = symbol.exports["__export"]; if (exportStars) { - ts.forEach(exportStars.declarations, function (node) { + for (var _i = 0, _a = exportStars.declarations; _i < _a.length; _i++) { + var node = _a[_i]; visit(resolveExternalModuleName(node, node.moduleSpecifier)); - }); + } } } } @@ -8644,9 +9427,9 @@ var ts; } function findConstructorDeclaration(node) { var members = node.members; - for (var _i = 0, _n = members.length; _i < _n; _i++) { + for (var _i = 0; _i < members.length; _i++) { var member = members[_i]; - if (member.kind === 133 && ts.nodeIsPresent(member.body)) { + if (member.kind === 135 && ts.nodeIsPresent(member.body)) { return member; } } @@ -8704,25 +9487,25 @@ var ts; } function forEachSymbolTableInScope(enclosingDeclaration, callback) { var result; - for (var _location = enclosingDeclaration; _location; _location = _location.parent) { - if (_location.locals && !isGlobalSourceFile(_location)) { - if (result = callback(_location.locals)) { + for (var location_1 = enclosingDeclaration; location_1; location_1 = location_1.parent) { + if (location_1.locals && !isGlobalSourceFile(location_1)) { + if (result = callback(location_1.locals)) { return result; } } - switch (_location.kind) { - case 221: - if (!ts.isExternalModule(_location)) { + switch (location_1.kind) { + case 227: + if (!ts.isExternalModule(location_1)) { break; } - case 200: - if (result = callback(getSymbolOfNode(_location).exports)) { + case 205: + if (result = callback(getSymbolOfNode(location_1).exports)) { return result; } break; - case 196: - case 197: - if (result = callback(getSymbolOfNode(_location).members)) { + case 201: + case 202: + if (result = callback(getSymbolOfNode(location_1).members)) { return result; } break; @@ -8752,7 +9535,7 @@ var ts; return [symbol]; } return ts.forEachValue(symbols, function (symbolFromSymbolTable) { - if (symbolFromSymbolTable.flags & 8388608) { + if (symbolFromSymbolTable.flags & 8388608 && symbolFromSymbolTable.name !== "export=") { if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); @@ -8836,8 +9619,8 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 200 && declaration.name.kind === 8) || - (declaration.kind === 221 && ts.isExternalModule(declaration)); + return (declaration.kind === 205 && declaration.name.kind === 8) || + (declaration.kind === 227 && ts.isExternalModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -8847,17 +9630,18 @@ var ts; return { accessibility: 0, aliasesToMakeVisible: aliasesToMakeVisible }; function getIsDeclarationVisible(declaration) { if (!isDeclarationVisible(declaration)) { - if (declaration.kind === 203 && - !(declaration.flags & 1) && - isDeclarationVisible(declaration.parent)) { + var anyImportSyntax = getAnyImportSyntax(declaration); + if (anyImportSyntax && + !(anyImportSyntax.flags & 1) && + isDeclarationVisible(anyImportSyntax.parent)) { getNodeLinks(declaration).isVisible = true; if (aliasesToMakeVisible) { - if (!ts.contains(aliasesToMakeVisible, declaration)) { - aliasesToMakeVisible.push(declaration); + if (!ts.contains(aliasesToMakeVisible, anyImportSyntax)) { + aliasesToMakeVisible.push(anyImportSyntax); } } else { - aliasesToMakeVisible = [declaration]; + aliasesToMakeVisible = [anyImportSyntax]; } return true; } @@ -8868,11 +9652,11 @@ var ts; } function isEntityNameVisible(entityName, enclosingDeclaration) { var meaning; - if (entityName.parent.kind === 142) { + if (entityName.parent.kind === 144) { meaning = 107455 | 1048576; } - else if (entityName.kind === 125 || - entityName.parent.kind === 203) { + else if (entityName.kind === 126 || entityName.kind === 155 || + entityName.parent.kind === 208) { meaning = 1536; } else { @@ -8916,10 +9700,10 @@ var ts; function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048) { var node = type.symbol.declarations[0].parent; - while (node.kind === 147) { + while (node.kind === 149) { node = node.parent; } - if (node.kind === 198) { + if (node.kind === 203) { return getSymbolOfNode(node); } } @@ -8963,7 +9747,7 @@ var ts; walkSymbol(getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol), getQualifiedLeftMeaning(meaning)); } if (accessibleSymbolChain) { - for (var _i = 0, _n = accessibleSymbolChain.length; _i < _n; _i++) { + for (var _i = 0; _i < accessibleSymbolChain.length; _i++) { var accessibleSymbol = accessibleSymbolChain[_i]; appendParentTypeArgumentsAndSymbolName(accessibleSymbol); } @@ -9073,7 +9857,7 @@ var ts; buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, 793056, 0, flags); } else { - writeKeyword(writer, 111); + writeKeyword(writer, 112); } } else { @@ -9091,7 +9875,7 @@ var ts; var isNonLocalFunctionSymbol = !!(type.symbol.flags & 16) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { - return declaration.parent.kind === 221 || declaration.parent.kind === 201; + return declaration.parent.kind === 227 || declaration.parent.kind === 206; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return !!(flags & 2) || @@ -9101,7 +9885,7 @@ var ts; } } function writeTypeofSymbol(type, typeFormatFlags) { - writeKeyword(writer, 96); + writeKeyword(writer, 97); writeSpace(writer); buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 107455, 0, typeFormatFlags); } @@ -9135,7 +9919,7 @@ var ts; if (flags & 64) { writePunctuation(writer, 16); } - writeKeyword(writer, 87); + writeKeyword(writer, 88); writeSpace(writer); buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8, typeStack); if (flags & 64) { @@ -9147,17 +9931,17 @@ var ts; writePunctuation(writer, 14); writer.writeLine(); writer.increaseIndent(); - for (var _i = 0, _a = resolved.callSignatures, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = resolved.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); writePunctuation(writer, 22); writer.writeLine(); } - for (var _b = 0, _c = resolved.constructSignatures, _d = _c.length; _b < _d; _b++) { - var _signature = _c[_b]; - writeKeyword(writer, 87); + for (var _b = 0, _c = resolved.constructSignatures; _b < _c.length; _b++) { + var signature = _c[_b]; + writeKeyword(writer, 88); writeSpace(writer); - buildSignatureDisplay(_signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); + buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); writePunctuation(writer, 22); writer.writeLine(); } @@ -9166,7 +9950,7 @@ var ts; writer.writeParameter(getIndexerParameterName(resolved, 0, "x")); writePunctuation(writer, 51); writeSpace(writer); - writeKeyword(writer, 120); + writeKeyword(writer, 121); writePunctuation(writer, 19); writePunctuation(writer, 51); writeSpace(writer); @@ -9179,7 +9963,7 @@ var ts; writer.writeParameter(getIndexerParameterName(resolved, 1, "x")); writePunctuation(writer, 51); writeSpace(writer); - writeKeyword(writer, 118); + writeKeyword(writer, 119); writePunctuation(writer, 19); writePunctuation(writer, 51); writeSpace(writer); @@ -9187,18 +9971,18 @@ var ts; writePunctuation(writer, 22); writer.writeLine(); } - for (var _e = 0, _f = resolved.properties, _g = _f.length; _e < _g; _e++) { - var p = _f[_e]; + for (var _d = 0, _e = resolved.properties; _d < _e.length; _d++) { + var p = _e[_d]; var t = getTypeOfSymbol(p); if (p.flags & (16 | 8192) && !getPropertiesOfObjectType(t).length) { var signatures = getSignaturesOfType(t, 0); - for (var _h = 0, _j = signatures.length; _h < _j; _h++) { - var _signature_1 = signatures[_h]; + for (var _f = 0; _f < signatures.length; _f++) { + var signature = signatures[_f]; buildSymbolDisplay(p, writer); if (p.flags & 536870912) { writePunctuation(writer, 50); } - buildSignatureDisplay(_signature_1, writer, enclosingDeclaration, globalFlagsToPass, typeStack); + buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); writePunctuation(writer, 22); writer.writeLine(); } @@ -9230,7 +10014,7 @@ var ts; var constraint = getConstraintOfTypeParameter(tp); if (constraint) { writeSpace(writer); - writeKeyword(writer, 78); + writeKeyword(writer, 79); writeSpace(writer); buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, typeStack); } @@ -9323,12 +10107,12 @@ var ts; function isDeclarationVisible(node) { function getContainingExternalModule(node) { for (; node; node = node.parent) { - if (node.kind === 200) { + if (node.kind === 205) { if (node.name.kind === 8) { return node; } } - else if (node.kind === 221) { + else if (node.kind === 227) { return ts.isExternalModule(node) ? node : undefined; } } @@ -9371,48 +10155,59 @@ var ts; } function determineIfDeclarationIsVisible() { switch (node.kind) { - case 193: - case 150: - case 200: - case 196: - case 197: + case 152: + return isDeclarationVisible(node.parent.parent); case 198: - case 195: - case 199: - case 203: - var _parent = getDeclarationContainer(node); - if (!(ts.getCombinedNodeFlags(node) & 1) && - !(node.kind !== 203 && _parent.kind !== 221 && ts.isInAmbientContext(_parent))) { - return isGlobalSourceFile(_parent) || isUsedInExportAssignment(node); + if (ts.isBindingPattern(node.name) && + !node.name.elements.length) { + return false; } - return isDeclarationVisible(_parent); - case 130: - case 129: - case 134: - case 135: + case 205: + case 201: + case 202: + case 203: + case 200: + case 204: + case 208: + var parent_2 = getDeclarationContainer(node); + if (!(ts.getCombinedNodeFlags(node) & 1) && + !(node.kind !== 208 && parent_2.kind !== 227 && ts.isInAmbientContext(parent_2))) { + return isGlobalSourceFile(parent_2); + } + return isDeclarationVisible(parent_2); case 132: case 131: + case 136: + case 137: + case 134: + case 133: if (node.flags & (32 | 64)) { return false; } - case 133: - case 137: - case 136: - case 138: - case 128: - case 201: - case 140: - case 141: - case 143: + case 135: case 139: - case 144: + case 138: + case 140: + case 129: + case 206: + case 142: + case 143: case 145: + case 141: case 146: case 147: + case 148: + case 149: return isDeclarationVisible(node.parent); - case 127: - case 221: + case 210: + case 211: + case 213: + return false; + case 128: + case 227: return true; + case 214: + return false; default: ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); } @@ -9425,15 +10220,44 @@ var ts; return links.isVisible; } } + function collectLinkedAliases(node) { + var exportSymbol; + if (node.parent && node.parent.kind === 214) { + exportSymbol = resolveName(node.parent, node.text, 107455 | 793056 | 1536, ts.Diagnostics.Cannot_find_name_0, node); + } + else if (node.parent.kind === 217) { + exportSymbol = getTargetOfExportSpecifier(node.parent); + } + var result = []; + if (exportSymbol) { + buildVisibleNodeList(exportSymbol.declarations); + } + return result; + function buildVisibleNodeList(declarations) { + ts.forEach(declarations, function (declaration) { + getNodeLinks(declaration).isVisible = true; + var resultNode = getAnyImportSyntax(declaration) || declaration; + if (!ts.contains(result, resultNode)) { + result.push(resultNode); + } + if (ts.isInternalModuleImportEqualsDeclaration(declaration)) { + var internalModuleReference = declaration.moduleReference; + var firstIdentifier = getFirstIdentifier(internalModuleReference); + var importSymbol = resolveName(declaration, firstIdentifier.text, 107455 | 793056 | 1536, ts.Diagnostics.Cannot_find_name_0, firstIdentifier); + buildVisibleNodeList(importSymbol.declarations); + } + }); + } + } function getRootDeclaration(node) { - while (node.kind === 150) { + while (node.kind === 152) { node = node.parent.parent; } return node; } function getDeclarationContainer(node) { node = getRootDeclaration(node); - return node.kind === 193 ? node.parent.parent.parent : node.parent; + return node.kind === 198 ? node.parent.parent.parent : node.parent; } function getTypeOfPrototypeProperty(prototype) { var classType = getDeclaredTypeOfSymbol(prototype.parent); @@ -9456,13 +10280,13 @@ var ts; return parentType; } var type; - if (pattern.kind === 148) { - var _name = declaration.propertyName || declaration.name; - type = getTypeOfPropertyOfType(parentType, _name.text) || - isNumericLiteralName(_name.text) && getIndexTypeOfType(parentType, 1) || + if (pattern.kind === 150) { + var name_5 = declaration.propertyName || declaration.name; + type = getTypeOfPropertyOfType(parentType, name_5.text) || + isNumericLiteralName(name_5.text) && getIndexTypeOfType(parentType, 1) || getIndexTypeOfType(parentType, 0); if (!type) { - error(_name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(_name)); + error(name_5, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name_5)); return unknownType; } } @@ -9491,22 +10315,22 @@ var ts; return type; } function getTypeForVariableLikeDeclaration(declaration) { - if (declaration.parent.parent.kind === 182) { + if (declaration.parent.parent.kind === 187) { return anyType; } - if (declaration.parent.parent.kind === 183) { + if (declaration.parent.parent.kind === 188) { return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType; } if (ts.isBindingPattern(declaration.parent)) { return getTypeForBindingElement(declaration); } if (declaration.type) { - return getTypeFromTypeNode(declaration.type); + return getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); } - if (declaration.kind === 128) { + if (declaration.kind === 129) { var func = declaration.parent; - if (func.kind === 135 && !ts.hasDynamicName(func)) { - var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 134); + if (func.kind === 137 && !ts.hasDynamicName(func)) { + var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 136); if (getter) { return getReturnTypeOfSignature(getSignatureFromDeclaration(getter)); } @@ -9519,7 +10343,7 @@ var ts; if (declaration.initializer) { return checkExpressionCached(declaration.initializer); } - if (declaration.kind === 219) { + if (declaration.kind === 225) { return checkIdentifier(declaration.name); } return undefined; @@ -9537,8 +10361,8 @@ var ts; var members = {}; ts.forEach(pattern.elements, function (e) { var flags = 4 | 67108864 | (e.initializer ? 536870912 : 0); - var _name = e.propertyName || e.name; - var symbol = createSymbol(flags, _name.text); + var name = e.propertyName || e.name; + var symbol = createSymbol(flags, name.text); symbol.type = getTypeFromBindingElement(e); members[symbol.name] = symbol; }); @@ -9548,7 +10372,7 @@ var ts; var hasSpreadElement = false; var elementTypes = []; ts.forEach(pattern.elements, function (e) { - elementTypes.push(e.kind === 172 || e.dotDotDotToken ? anyType : getTypeFromBindingElement(e)); + elementTypes.push(e.kind === 175 || e.dotDotDotToken ? anyType : getTypeFromBindingElement(e)); if (e.dotDotDotToken) { hasSpreadElement = true; } @@ -9556,7 +10380,7 @@ var ts; return !elementTypes.length ? anyArrayType : hasSpreadElement ? createArrayType(getUnionType(elementTypes)) : createTupleType(elementTypes); } function getTypeFromBindingPattern(pattern) { - return pattern.kind === 148 + return pattern.kind === 150 ? getTypeFromObjectBindingPattern(pattern) : getTypeFromArrayBindingPattern(pattern); } @@ -9566,7 +10390,7 @@ var ts; if (reportErrors) { reportErrorsFromWidening(declaration, type); } - return declaration.kind !== 218 ? getWidenedType(type) : type; + return declaration.kind !== 224 ? getWidenedType(type) : type; } if (ts.isBindingPattern(declaration.name)) { return getTypeFromBindingPattern(declaration.name); @@ -9574,7 +10398,7 @@ var ts; type = declaration.dotDotDotToken ? anyArrayType : anyType; if (reportErrors && compilerOptions.noImplicitAny) { var root = getRootDeclaration(declaration); - if (!isPrivateWithinAmbient(root) && !(root.kind === 128 && isPrivateWithinAmbient(root.parent))) { + if (!isPrivateWithinAmbient(root) && !(root.kind === 129 && isPrivateWithinAmbient(root.parent))) { reportImplicitAnyError(declaration, type); } } @@ -9587,11 +10411,20 @@ var ts; return links.type = getTypeOfPrototypeProperty(symbol); } var declaration = symbol.valueDeclaration; - if (declaration.parent.kind === 217) { + if (declaration.parent.kind === 223) { return links.type = anyType; } - if (declaration.kind === 209) { - return links.type = checkExpression(declaration.expression); + if (declaration.kind === 214) { + var exportAssignment = declaration; + if (exportAssignment.expression) { + return links.type = checkExpression(exportAssignment.expression); + } + else if (exportAssignment.type) { + return links.type = getTypeFromTypeNodeOrHeritageClauseElement(exportAssignment.type); + } + else { + return links.type = anyType; + } } links.type = resolvingType; var type = getWidenedTypeForVariableLikeDeclaration(declaration, true); @@ -9615,12 +10448,12 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 134) { - return accessor.type && getTypeFromTypeNode(accessor.type); + if (accessor.kind === 136) { + return accessor.type && getTypeFromTypeNodeOrHeritageClauseElement(accessor.type); } else { var setterTypeAnnotation = getSetAccessorTypeAnnotationNode(accessor); - return setterTypeAnnotation && getTypeFromTypeNode(setterTypeAnnotation); + return setterTypeAnnotation && getTypeFromTypeNodeOrHeritageClauseElement(setterTypeAnnotation); } } return undefined; @@ -9634,8 +10467,8 @@ var ts; links = links || getSymbolLinks(symbol); if (!links.type) { links.type = resolvingType; - var getter = ts.getDeclarationOfKind(symbol, 134); - var setter = ts.getDeclarationOfKind(symbol, 135); + var getter = ts.getDeclarationOfKind(symbol, 136); + var setter = ts.getDeclarationOfKind(symbol, 137); var type; var getterReturnType = getAnnotatedAccessorType(getter); if (getterReturnType) { @@ -9665,8 +10498,8 @@ var ts; else if (links.type === resolvingType) { links.type = anyType; if (compilerOptions.noImplicitAny) { - var _getter = ts.getDeclarationOfKind(symbol, 134); - 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)); + 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)); } } } @@ -9732,7 +10565,7 @@ var ts; function getTypeParametersOfClassOrInterface(symbol) { var result; ts.forEach(symbol.declarations, function (node) { - if (node.kind === 197 || node.kind === 196) { + if (node.kind === 202 || node.kind === 201) { var declaration = node; if (declaration.typeParameters && declaration.typeParameters.length) { ts.forEach(declaration.typeParameters, function (node) { @@ -9763,10 +10596,10 @@ var ts; type.typeArguments = type.typeParameters; } type.baseTypes = []; - var declaration = ts.getDeclarationOfKind(symbol, 196); - var baseTypeNode = ts.getClassBaseTypeNode(declaration); + var declaration = ts.getDeclarationOfKind(symbol, 201); + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(declaration); if (baseTypeNode) { - var baseType = getTypeFromTypeReferenceNode(baseTypeNode); + var baseType = getTypeFromHeritageClauseElement(baseTypeNode); if (baseType !== unknownType) { if (getTargetType(baseType).flags & 1024) { if (type !== baseType && !hasBaseType(baseType, type)) { @@ -9804,9 +10637,9 @@ var ts; } type.baseTypes = []; ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 197 && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 202 && ts.getInterfaceBaseTypeNodes(declaration)) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), function (node) { - var baseType = getTypeFromTypeReferenceNode(node); + var baseType = getTypeFromHeritageClauseElement(node); if (baseType !== unknownType) { if (getTargetType(baseType).flags & (1024 | 2048)) { if (type !== baseType && !hasBaseType(baseType, type)) { @@ -9835,16 +10668,16 @@ var ts; var links = getSymbolLinks(symbol); if (!links.declaredType) { links.declaredType = resolvingType; - var declaration = ts.getDeclarationOfKind(symbol, 198); - var type = getTypeFromTypeNode(declaration.type); + var declaration = ts.getDeclarationOfKind(symbol, 203); + var type = getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); if (links.declaredType === resolvingType) { links.declaredType = type; } } else if (links.declaredType === resolvingType) { links.declaredType = unknownType; - var _declaration = ts.getDeclarationOfKind(symbol, 198); - error(_declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); + var declaration = ts.getDeclarationOfKind(symbol, 203); + error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); } return links.declaredType; } @@ -9862,7 +10695,7 @@ var ts; if (!links.declaredType) { var type = createType(512); type.symbol = symbol; - if (!ts.getDeclarationOfKind(symbol, 127).constraint) { + if (!ts.getDeclarationOfKind(symbol, 128).constraint) { type.constraint = noConstraintType; } links.declaredType = type; @@ -9900,7 +10733,7 @@ var ts; } function createSymbolTable(symbols) { var result = {}; - for (var _i = 0, _n = symbols.length; _i < _n; _i++) { + for (var _i = 0; _i < symbols.length; _i++) { var symbol = symbols[_i]; result[symbol.name] = symbol; } @@ -9908,14 +10741,14 @@ var ts; } function createInstantiatedSymbolTable(symbols, mapper) { var result = {}; - for (var _i = 0, _n = symbols.length; _i < _n; _i++) { + for (var _i = 0; _i < symbols.length; _i++) { var symbol = symbols[_i]; result[symbol.name] = instantiateSymbol(symbol, mapper); } return result; } function addInheritedMembers(symbols, baseSymbols) { - for (var _i = 0, _n = baseSymbols.length; _i < _n; _i++) { + for (var _i = 0; _i < baseSymbols.length; _i++) { var s = baseSymbols[_i]; if (!ts.hasProperty(symbols, s.name)) { symbols[s.name] = s; @@ -9924,7 +10757,7 @@ var ts; } function addInheritedSignatures(signatures, baseSignatures) { if (baseSignatures) { - for (var _i = 0, _n = baseSignatures.length; _i < _n; _i++) { + for (var _i = 0; _i < baseSignatures.length; _i++) { var signature = baseSignatures[_i]; signatures.push(signature); } @@ -10023,14 +10856,14 @@ var ts; function getUnionSignatures(types, kind) { var signatureLists = ts.map(types, function (t) { return getSignaturesOfType(t, kind); }); var signatures = signatureLists[0]; - for (var _i = 0, _n = signatures.length; _i < _n; _i++) { + for (var _i = 0; _i < signatures.length; _i++) { var signature = signatures[_i]; if (signature.typeParameters) { return emptyArray; } } - for (var _i_1 = 1; _i_1 < signatureLists.length; _i_1++) { - if (!signatureListsIdentical(signatures, signatureLists[_i_1])) { + for (var i_1 = 1; i_1 < signatureLists.length; i_1++) { + if (!signatureListsIdentical(signatures, signatureLists[i_1])) { return emptyArray; } } @@ -10044,7 +10877,7 @@ var ts; } function getUnionIndexType(types, kind) { var indexTypes = []; - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var type = types[_i]; var indexType = getIndexTypeOfType(type, kind); if (!indexType) { @@ -10180,7 +11013,7 @@ var ts; function createUnionProperty(unionType, name) { var types = unionType.types; var props; - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var current = types[_i]; var type = getApparentType(current); if (type !== unknownType) { @@ -10198,12 +11031,12 @@ var ts; } var propTypes = []; var declarations = []; - for (var _a = 0, _b = props.length; _a < _b; _a++) { - var _prop = props[_a]; - if (_prop.declarations) { - declarations.push.apply(declarations, _prop.declarations); + for (var _a = 0; _a < props.length; _a++) { + var prop = props[_a]; + if (prop.declarations) { + declarations.push.apply(declarations, prop.declarations); } - propTypes.push(getTypeOfSymbol(_prop)); + propTypes.push(getTypeOfSymbol(prop)); } var result = createSymbol(4 | 67108864 | 268435456, name); result.unionType = unionType; @@ -10240,9 +11073,9 @@ var ts; } } if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { - var _symbol = getPropertyOfObjectType(globalFunctionType, name); - if (_symbol) - return _symbol; + var symbol = getPropertyOfObjectType(globalFunctionType, name); + if (symbol) + return symbol; } return getPropertyOfObjectType(globalObjectType, name); } @@ -10275,20 +11108,29 @@ var ts; }); return result; } + function symbolsToArray(symbols) { + var result = []; + for (var id in symbols) { + if (!isReservedMemberName(id)) { + result.push(symbols[id]); + } + } + return result; + } function getExportsOfExternalModule(node) { if (!node.moduleSpecifier) { return emptyArray; } - var _module = resolveExternalModuleName(node, node.moduleSpecifier); - if (!_module || !_module.exports) { + var module = resolveExternalModuleName(node, node.moduleSpecifier); + if (!module) { return emptyArray; } - return ts.mapToArray(getExportsOfModule(_module)); + return symbolsToArray(getExportsOfModule(module)); } function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { - var classType = declaration.kind === 133 ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; + var classType = declaration.kind === 135 ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; var typeParameters = classType ? classType.typeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; var parameters = []; @@ -10314,11 +11156,11 @@ var ts; returnType = classType; } else if (declaration.type) { - returnType = getTypeFromTypeNode(declaration.type); + returnType = getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); } else { - if (declaration.kind === 134 && !ts.hasDynamicName(declaration)) { - var setter = ts.getDeclarationOfKind(declaration.symbol, 135); + if (declaration.kind === 136 && !ts.hasDynamicName(declaration)) { + var setter = ts.getDeclarationOfKind(declaration.symbol, 137); returnType = getAnnotatedAccessorType(setter); } if (!returnType && ts.nodeIsMissing(declaration.body)) { @@ -10336,19 +11178,19 @@ var ts; for (var i = 0, len = symbol.declarations.length; i < len; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 140: - case 141: - case 195: - case 132: - case 131: + case 142: + case 143: + case 200: + case 134: case 133: + case 135: + case 138: + case 139: + case 140: case 136: case 137: - case 138: - case 134: - case 135: - case 160: - case 161: + case 162: + case 163: if (i > 0 && node.body) { var previous = symbol.declarations[i - 1]; if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { @@ -10418,7 +11260,7 @@ var ts; } function getOrCreateTypeFromSignature(signature) { if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 133 || signature.declaration.kind === 137; + var isConstructor = signature.declaration.kind === 135 || signature.declaration.kind === 139; var type = createObjectType(32768 | 65536); type.members = emptySymbols; type.properties = emptyArray; @@ -10432,11 +11274,11 @@ var ts; return symbol.members["__index"]; } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 ? 118 : 120; + var syntaxKind = kind === 1 ? 119 : 121; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { var len = indexSymbol.declarations.length; - for (var _i = 0, _a = indexSymbol.declarations, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; var node = decl; if (node.parameters.length === 1) { @@ -10452,7 +11294,7 @@ var ts; function getIndexTypeOfSymbol(symbol, kind) { var declaration = getIndexDeclarationOfSymbol(symbol, kind); return declaration - ? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType + ? declaration.type ? getTypeFromTypeNodeOrHeritageClauseElement(declaration.type) : anyType : undefined; } function getConstraintOfTypeParameter(type) { @@ -10462,7 +11304,7 @@ var ts; type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNode(ts.getDeclarationOfKind(type.symbol, 127).constraint); + type.constraint = getTypeFromTypeNodeOrHeritageClauseElement(ts.getDeclarationOfKind(type.symbol, 128).constraint); } } return type.constraint === noConstraintType ? undefined : type.constraint; @@ -10486,7 +11328,7 @@ var ts; } function getWideningFlagsOfTypes(types) { var result = 0; - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var type = types[_i]; result |= type.flags; } @@ -10512,13 +11354,13 @@ var ts; while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) { currentNode = currentNode.parent; } - links.isIllegalTypeReferenceInConstraint = currentNode.kind === 127; + links.isIllegalTypeReferenceInConstraint = currentNode.kind === 128; return links.isIllegalTypeReferenceInConstraint; } function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter) { var typeParameterSymbol; function check(n) { - if (n.kind === 139 && n.typeName.kind === 64) { + if (n.kind === 141 && n.typeName.kind === 65) { var links = getNodeLinks(n); if (links.isIllegalTypeReferenceInConstraint === undefined) { var symbol = resolveName(typeParameter, n.typeName.text, 793056, undefined, undefined); @@ -10537,31 +11379,42 @@ var ts; check(typeParameter.constraint); } } - function getTypeFromTypeReferenceNode(node) { + function getTypeFromTypeReference(node) { + return getTypeFromTypeReferenceOrHeritageClauseElement(node); + } + function getTypeFromHeritageClauseElement(node) { + return getTypeFromTypeReferenceOrHeritageClauseElement(node); + } + function getTypeFromTypeReferenceOrHeritageClauseElement(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - var symbol = resolveEntityName(node.typeName, 793056); var type; - if (symbol) { - if ((symbol.flags & 262144) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { - type = unknownType; - } - else { - type = getDeclaredTypeOfSymbol(symbol); - if (type.flags & (1024 | 2048) && type.flags & 4096) { - var typeParameters = type.typeParameters; - if (node.typeArguments && node.typeArguments.length === typeParameters.length) { - type = createTypeReference(type, ts.map(node.typeArguments, getTypeFromTypeNode)); - } - else { - error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, undefined, 1), typeParameters.length); - type = undefined; - } + if (node.kind !== 177 || ts.isSupportedHeritageClauseElement(node)) { + var typeNameOrExpression = node.kind === 141 + ? node.typeName + : node.expression; + var symbol = resolveEntityName(typeNameOrExpression, 793056); + if (symbol) { + if ((symbol.flags & 262144) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { + type = unknownType; } else { - if (node.typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); - type = undefined; + type = getDeclaredTypeOfSymbol(symbol); + if (type.flags & (1024 | 2048) && type.flags & 4096) { + var typeParameters = type.typeParameters; + if (node.typeArguments && node.typeArguments.length === typeParameters.length) { + type = createTypeReference(type, ts.map(node.typeArguments, getTypeFromTypeNodeOrHeritageClauseElement)); + } + else { + error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, undefined, 1), typeParameters.length); + type = undefined; + } + } + else { + if (node.typeArguments) { + error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); + type = undefined; + } } } } @@ -10580,12 +11433,12 @@ var ts; function getTypeOfGlobalSymbol(symbol, arity) { function getTypeDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; switch (declaration.kind) { - case 196: - case 197: - case 199: + case 201: + case 202: + case 204: return declaration; } } @@ -10627,7 +11480,7 @@ var ts; function getTypeFromArrayTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = createArrayType(getTypeFromTypeNode(node.elementType)); + links.resolvedType = createArrayType(getTypeFromTypeNodeOrHeritageClauseElement(node.elementType)); } return links.resolvedType; } @@ -10643,7 +11496,7 @@ var ts; function getTypeFromTupleTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = createTupleType(ts.map(node.elementTypes, getTypeFromTypeNode)); + links.resolvedType = createTupleType(ts.map(node.elementTypes, getTypeFromTypeNodeOrHeritageClauseElement)); } return links.resolvedType; } @@ -10663,13 +11516,13 @@ var ts; } } function addTypesToSortedSet(sortedTypes, types) { - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var type = types[_i]; addTypeToSortedSet(sortedTypes, type); } } function isSubtypeOfAny(candidate, types) { - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var type = types[_i]; if (candidate !== type && isTypeSubtypeOf(candidate, type)) { return true; @@ -10687,7 +11540,7 @@ var ts; } } function containsAnyType(types) { - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var type = types[_i]; if (type.flags & 1) { return true; @@ -10734,7 +11587,7 @@ var ts; function getTypeFromUnionTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNode), true); + links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNodeOrHeritageClauseElement), true); } return links.resolvedType; } @@ -10760,40 +11613,42 @@ var ts; } return links.resolvedType; } - function getTypeFromTypeNode(node) { + function getTypeFromTypeNodeOrHeritageClauseElement(node) { switch (node.kind) { - case 111: - return anyType; - case 120: - return stringType; - case 118: - return numberType; case 112: - return booleanType; + return anyType; case 121: + return stringType; + case 119: + return numberType; + case 113: + return booleanType; + case 122: return esSymbolType; - case 98: + case 99: return voidType; case 8: return getTypeFromStringLiteral(node); - case 139: - return getTypeFromTypeReferenceNode(node); - case 142: - return getTypeFromTypeQueryNode(node); - case 144: - return getTypeFromArrayTypeNode(node); - case 145: - return getTypeFromTupleTypeNode(node); - case 146: - return getTypeFromUnionTypeNode(node); - case 147: - return getTypeFromTypeNode(node.type); - case 140: 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 getTypeFromTypeNodeOrHeritageClauseElement(node.type); + case 142: case 143: + case 145: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 64: - case 125: + case 65: + case 126: var symbol = getSymbolInfo(node); return symbol && getDeclaredTypeOfSymbol(symbol); default: @@ -10803,7 +11658,7 @@ var ts; function instantiateList(items, mapper, instantiator) { if (items && items.length) { var result = []; - for (var _i = 0, _n = items.length; _i < _n; _i++) { + for (var _i = 0; _i < items.length; _i++) { var v = items[_i]; result.push(instantiator(v, mapper)); } @@ -10843,7 +11698,7 @@ var ts; case 2: return createBinaryTypeEraser(sources[0], sources[1]); } return function (t) { - for (var _i = 0, _n = sources.length; _i < _n; _i++) { + for (var _i = 0; _i < sources.length; _i++) { var source = sources[_i]; if (t === source) { return anyType; @@ -10856,6 +11711,7 @@ var ts; return function (t) { for (var i = 0; i < context.typeParameters.length; i++) { if (t === context.typeParameters[i]) { + context.inferences[i].isFixed = true; return getInferredType(context, i); } } @@ -10943,27 +11799,27 @@ var ts; return type; } function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 132 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 160: - case 161: + case 162: + case 163: return isContextSensitiveFunctionLikeDeclaration(node); - case 152: + case 154: return ts.forEach(node.properties, isContextSensitive); - case 151: + case 153: return ts.forEach(node.elements, isContextSensitive); - case 168: + case 170: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 167: + case 169: return node.operatorToken.kind === 49 && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 218: + case 224: return isContextSensitive(node.initializer); - case 132: - case 131: + case 134: + case 133: return isContextSensitiveFunctionLikeDeclaration(node); - case 159: + case 161: return isContextSensitive(node.expression); } return false; @@ -11019,6 +11875,7 @@ var ts; var expandingFlags; var depth = 0; var overflow = false; + var elaborateErrors = false; ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); var result = isRelatedTo(source, target, errorNode !== undefined, headMessage); if (overflow) { @@ -11027,7 +11884,8 @@ var ts; else if (errorInfo) { if (errorInfo.next === undefined) { errorInfo = undefined; - isRelatedTo(source, target, errorNode !== undefined, headMessage, true); + elaborateErrors = true; + isRelatedTo(source, target, errorNode !== undefined, headMessage); } if (containingMessageChain) { errorInfo = ts.concatenateDiagnosticMessageChains(containingMessageChain, errorInfo); @@ -11038,9 +11896,8 @@ var ts; function reportError(message, arg0, arg1, arg2) { errorInfo = ts.chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2); } - function isRelatedTo(source, target, reportErrors, headMessage, elaborateErrors) { - if (elaborateErrors === void 0) { elaborateErrors = false; } - var _result; + function isRelatedTo(source, target, reportErrors, headMessage) { + var result; if (source === target) return -1; if (relation !== identityRelation) { @@ -11064,54 +11921,54 @@ var ts; if (source.flags & 16384 || target.flags & 16384) { if (relation === identityRelation) { if (source.flags & 16384 && target.flags & 16384) { - if (_result = unionTypeRelatedToUnionType(source, target)) { - if (_result &= unionTypeRelatedToUnionType(target, source)) { - return _result; + if (result = unionTypeRelatedToUnionType(source, target)) { + if (result &= unionTypeRelatedToUnionType(target, source)) { + return result; } } } else if (source.flags & 16384) { - if (_result = unionTypeRelatedToType(source, target, reportErrors)) { - return _result; + if (result = unionTypeRelatedToType(source, target, reportErrors)) { + return result; } } else { - if (_result = unionTypeRelatedToType(target, source, reportErrors)) { - return _result; + if (result = unionTypeRelatedToType(target, source, reportErrors)) { + return result; } } } else { if (source.flags & 16384) { - if (_result = unionTypeRelatedToType(source, target, reportErrors)) { - return _result; + if (result = unionTypeRelatedToType(source, target, reportErrors)) { + return result; } } else { - if (_result = typeRelatedToUnionType(source, target, reportErrors)) { - return _result; + if (result = typeRelatedToUnionType(source, target, reportErrors)) { + return result; } } } } else if (source.flags & 512 && target.flags & 512) { - if (_result = typeParameterRelatedTo(source, target, reportErrors)) { - return _result; + if (result = typeParameterRelatedTo(source, target, reportErrors)) { + return result; } } else { var saveErrorInfo = errorInfo; if (source.flags & 4096 && target.flags & 4096 && source.target === target.target) { - if (_result = typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { - return _result; + if (result = typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { + return result; } } var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; var sourceOrApparentType = relation === identityRelation ? source : getApparentType(source); if (sourceOrApparentType.flags & 48128 && target.flags & 48128 && - (_result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors, elaborateErrors))) { + (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors))) { errorInfo = saveErrorInfo; - return _result; + return result; } } if (reportErrors) { @@ -11127,17 +11984,17 @@ var ts; return 0; } function unionTypeRelatedToUnionType(source, target) { - var _result = -1; + var result = -1; var sourceTypes = source.types; - for (var _i = 0, _n = sourceTypes.length; _i < _n; _i++) { + for (var _i = 0; _i < sourceTypes.length; _i++) { var sourceType = sourceTypes[_i]; var related = typeRelatedToUnionType(sourceType, target, false); if (!related) { return 0; } - _result &= related; + result &= related; } - return _result; + return result; } function typeRelatedToUnionType(source, target, reportErrors) { var targetTypes = target.types; @@ -11150,28 +12007,28 @@ var ts; return 0; } function unionTypeRelatedToType(source, target, reportErrors) { - var _result = -1; + var result = -1; var sourceTypes = source.types; - for (var _i = 0, _n = sourceTypes.length; _i < _n; _i++) { + for (var _i = 0; _i < sourceTypes.length; _i++) { var sourceType = sourceTypes[_i]; var related = isRelatedTo(sourceType, target, reportErrors); if (!related) { return 0; } - _result &= related; + result &= related; } - return _result; + return result; } function typesRelatedTo(sources, targets, reportErrors) { - var _result = -1; + var result = -1; for (var i = 0, len = sources.length; i < len; i++) { var related = isRelatedTo(sources[i], targets[i], reportErrors); if (!related) { return 0; } - _result &= related; + result &= related; } - return _result; + return result; } function typeParameterRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { @@ -11198,8 +12055,7 @@ var ts; return 0; } } - function objectTypeRelatedTo(source, target, reportErrors, elaborateErrors) { - if (elaborateErrors === void 0) { elaborateErrors = false; } + function objectTypeRelatedTo(source, target, reportErrors) { if (overflow) { return 0; } @@ -11237,20 +12093,20 @@ var ts; expandingFlags |= 1; if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack)) expandingFlags |= 2; - var _result; + var result; if (expandingFlags === 3) { - _result = 1; + result = 1; } else { - _result = propertiesRelatedTo(source, target, reportErrors); - if (_result) { - _result &= signaturesRelatedTo(source, target, 0, reportErrors); - if (_result) { - _result &= signaturesRelatedTo(source, target, 1, reportErrors); - if (_result) { - _result &= stringIndexTypesRelatedTo(source, target, reportErrors); - if (_result) { - _result &= numberIndexTypesRelatedTo(source, target, reportErrors); + result = propertiesRelatedTo(source, target, reportErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 0, reportErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 1, reportErrors); + if (result) { + result &= stringIndexTypesRelatedTo(source, target, reportErrors); + if (result) { + result &= numberIndexTypesRelatedTo(source, target, reportErrors); } } } @@ -11258,23 +12114,23 @@ var ts; } expandingFlags = saveExpandingFlags; depth--; - if (_result) { + if (result) { var maybeCache = maybeStack[depth]; - var destinationCache = (_result === -1 || depth === 0) ? relation : maybeStack[depth - 1]; + var destinationCache = (result === -1 || depth === 0) ? relation : maybeStack[depth - 1]; ts.copyMap(maybeCache, destinationCache); } else { relation[id] = reportErrors ? 3 : 2; } - return _result; + return result; } function isDeeplyNestedGeneric(type, stack) { if (type.flags & 4096 && depth >= 10) { - var _target = type.target; + var target_1 = type.target; var count = 0; for (var i = 0; i < depth; i++) { var t = stack[i]; - if (t.flags & 4096 && t.target === _target) { + if (t.flags & 4096 && t.target === target_1) { count++; if (count >= 10) return true; @@ -11287,10 +12143,10 @@ var ts; if (relation === identityRelation) { return propertiesIdenticalTo(source, target); } - var _result = -1; + var result = -1; var properties = getPropertiesOfObjectType(target); var requireOptionalProperties = relation === subtypeRelation && !(source.flags & 131072); - for (var _i = 0, _n = properties.length; _i < _n; _i++) { + for (var _i = 0; _i < properties.length; _i++) { var targetProp = properties[_i]; var sourceProp = getPropertyOfType(source, targetProp.name); if (sourceProp !== targetProp) { @@ -11342,7 +12198,7 @@ var ts; } return 0; } - _result &= related; + result &= related; if (sourceProp.flags & 536870912 && !(targetProp.flags & 536870912)) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); @@ -11352,7 +12208,7 @@ var ts; } } } - return _result; + return result; } function propertiesIdenticalTo(source, target) { var sourceProperties = getPropertiesOfObjectType(source); @@ -11360,8 +12216,8 @@ var ts; if (sourceProperties.length !== targetProperties.length) { return 0; } - var _result = -1; - for (var _i = 0, _n = sourceProperties.length; _i < _n; _i++) { + var result = -1; + for (var _i = 0; _i < sourceProperties.length; _i++) { var sourceProp = sourceProperties[_i]; var targetProp = getPropertyOfObjectType(target, sourceProp.name); if (!targetProp) { @@ -11371,9 +12227,9 @@ var ts; if (!related) { return 0; } - _result &= related; + result &= related; } - return _result; + return result; } function signaturesRelatedTo(source, target, kind, reportErrors) { if (relation === identityRelation) { @@ -11384,18 +12240,18 @@ var ts; } var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); - var _result = -1; + var result = -1; var saveErrorInfo = errorInfo; - outer: for (var _i = 0, _n = targetSignatures.length; _i < _n; _i++) { + outer: for (var _i = 0; _i < targetSignatures.length; _i++) { var t = targetSignatures[_i]; if (!t.hasStringLiterals || target.flags & 65536) { var localErrors = reportErrors; - for (var _a = 0, _b = sourceSignatures.length; _a < _b; _a++) { + for (var _a = 0; _a < sourceSignatures.length; _a++) { var s = sourceSignatures[_a]; if (!s.hasStringLiterals || source.flags & 65536) { var related = signatureRelatedTo(s, t, localErrors); if (related) { - _result &= related; + result &= related; errorInfo = saveErrorInfo; continue outer; } @@ -11405,7 +12261,7 @@ var ts; return 0; } } - return _result; + return result; } function signatureRelatedTo(source, target, reportErrors) { if (source === target) { @@ -11435,14 +12291,14 @@ var ts; } source = getErasedSignature(source); target = getErasedSignature(target); - var _result = -1; + var result = -1; for (var i = 0; i < checkCount; i++) { - var _s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); - var _t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); + var s_1 = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); + var t_1 = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); var saveErrorInfo = errorInfo; - var related = isRelatedTo(_s, _t, reportErrors); + var related = isRelatedTo(s_1, t_1, reportErrors); if (!related) { - related = isRelatedTo(_t, _s, false); + related = isRelatedTo(t_1, s_1, false); if (!related) { if (reportErrors) { reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); @@ -11451,13 +12307,13 @@ var ts; } errorInfo = saveErrorInfo; } - _result &= related; + result &= related; } var t = getReturnTypeOfSignature(target); if (t === voidType) - return _result; + return result; var s = getReturnTypeOfSignature(source); - return _result & isRelatedTo(s, t, reportErrors); + return result & isRelatedTo(s, t, reportErrors); } function signaturesIdenticalTo(source, target, kind) { var sourceSignatures = getSignaturesOfType(source, kind); @@ -11465,15 +12321,15 @@ var ts; if (sourceSignatures.length !== targetSignatures.length) { return 0; } - var _result = -1; + var result = -1; for (var i = 0, len = sourceSignatures.length; i < len; ++i) { var related = compareSignatures(sourceSignatures[i], targetSignatures[i], true, isRelatedTo); if (!related) { return 0; } - _result &= related; + result &= related; } - return _result; + return result; } function stringIndexTypesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { @@ -11593,14 +12449,14 @@ var ts; } source = getErasedSignature(source); target = getErasedSignature(target); - for (var _i = 0, _len = source.parameters.length; _i < _len; _i++) { - var s = source.hasRestParameter && _i === _len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[_i]); - var t = target.hasRestParameter && _i === _len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[_i]); - var _related = compareTypes(s, t); - if (!_related) { + for (var i = 0, len = source.parameters.length; i < len; i++) { + var s = source.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); + var t = target.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]); + var related = compareTypes(s, t); + if (!related) { return 0; } - result &= _related; + result &= related; } if (compareReturnTypes) { result &= compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); @@ -11608,7 +12464,7 @@ var ts; return result; } function isSupertypeOfEach(candidate, types) { - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var type = types[_i]; if (candidate !== type && !isTypeSubtypeOf(type, candidate)) return false; @@ -11633,6 +12489,7 @@ var ts; downfallType = types[j]; } } + ts.Debug.assert(!!downfallType, "If there is no common supertype, each type should have a downfallType"); if (score > bestSupertypeScore) { bestSupertype = types[i]; bestSupertypeDownfallType = downfallType; @@ -11713,17 +12570,17 @@ var ts; return reportWideningErrorsInType(type.typeArguments[0]); } if (type.flags & 131072) { - var _errorReported = false; + var errorReported = false; ts.forEach(getPropertiesOfObjectType(type), function (p) { var t = getTypeOfSymbol(p); if (t.flags & 262144) { if (!reportWideningErrorsInType(t)) { error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, p.name, typeToString(getWidenedType(t))); } - _errorReported = true; + errorReported = true; } }); - return _errorReported; + return errorReported; } return false; } @@ -11731,22 +12588,22 @@ var ts; var typeAsString = typeToString(getWidenedType(type)); var diagnostic; switch (declaration.kind) { - case 130: - case 129: + case 132: + case 131: diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 128: + case 129: diagnostic = declaration.dotDotDotToken ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; - case 195: - case 132: - case 131: + case 200: case 134: - case 135: - case 160: - case 161: + case 133: + case 136: + case 137: + case 162: + case 163: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; @@ -11793,14 +12650,13 @@ var ts; } function createInferenceContext(typeParameters, inferUnionTypes) { var inferences = []; - for (var _i = 0, _n = typeParameters.length; _i < _n; _i++) { + for (var _i = 0; _i < typeParameters.length; _i++) { var unused = typeParameters[_i]; - inferences.push({ primary: undefined, secondary: undefined }); + inferences.push({ primary: undefined, secondary: undefined, isFixed: false }); } return { typeParameters: typeParameters, inferUnionTypes: inferUnionTypes, - inferenceCount: 0, inferences: inferences, inferredTypes: new Array(typeParameters.length) }; @@ -11821,11 +12677,11 @@ var ts; } function isWithinDepthLimit(type, stack) { if (depth >= 5) { - var _target = type.target; + var target_2 = type.target; var count = 0; for (var i = 0; i < depth; i++) { var t = stack[i]; - if (t.flags & 4096 && t.target === _target) { + if (t.flags & 4096 && t.target === target_2) { count++; } } @@ -11842,28 +12698,31 @@ var ts; for (var i = 0; i < typeParameters.length; i++) { if (target === typeParameters[i]) { var inferences = context.inferences[i]; - var candidates = inferiority ? - inferences.secondary || (inferences.secondary = []) : - inferences.primary || (inferences.primary = []); - if (!ts.contains(candidates, source)) - candidates.push(source); - break; + if (!inferences.isFixed) { + var candidates = inferiority ? + inferences.secondary || (inferences.secondary = []) : + inferences.primary || (inferences.primary = []); + if (!ts.contains(candidates, source)) { + candidates.push(source); + } + } + return; } } } else if (source.flags & 4096 && target.flags & 4096 && source.target === target.target) { var sourceTypes = source.typeArguments; var targetTypes = target.typeArguments; - for (var _i = 0; _i < sourceTypes.length; _i++) { - inferFromTypes(sourceTypes[_i], targetTypes[_i]); + for (var i = 0; i < sourceTypes.length; i++) { + inferFromTypes(sourceTypes[i], targetTypes[i]); } } else if (target.flags & 16384) { - var _targetTypes = target.types; + var targetTypes = target.types; var typeParameterCount = 0; var typeParameter; - for (var _a = 0, _n = _targetTypes.length; _a < _n; _a++) { - var t = _targetTypes[_a]; + for (var _i = 0; _i < targetTypes.length; _i++) { + var t = targetTypes[_i]; if (t.flags & 512 && ts.contains(context.typeParameters, t)) { typeParameter = t; typeParameterCount++; @@ -11879,9 +12738,9 @@ var ts; } } else if (source.flags & 16384) { - var _sourceTypes = source.types; - for (var _b = 0, _c = _sourceTypes.length; _b < _c; _b++) { - var sourceType = _sourceTypes[_b]; + var sourceTypes = source.types; + for (var _a = 0; _a < sourceTypes.length; _a++) { + var sourceType = sourceTypes[_a]; inferFromTypes(sourceType, target); } } @@ -11907,7 +12766,7 @@ var ts; } function inferFromProperties(source, target) { var properties = getPropertiesOfObjectType(target); - for (var _i = 0, _n = properties.length; _i < _n; _i++) { + for (var _i = 0; _i < properties.length; _i++) { var targetProp = properties[_i]; var sourceProp = getPropertyOfObjectType(source, targetProp.name); if (sourceProp) { @@ -11945,19 +12804,25 @@ var ts; } function getInferredType(context, index) { var inferredType = context.inferredTypes[index]; + var inferenceSucceeded; if (!inferredType) { var inferences = getInferenceCandidates(context, index); if (inferences.length) { var unionOrSuperType = context.inferUnionTypes ? getUnionType(inferences) : getCommonSupertype(inferences); - inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : inferenceFailureType; + inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : unknownType; + inferenceSucceeded = !!unionOrSuperType; } else { inferredType = emptyObjectType; + inferenceSucceeded = true; } - if (inferredType !== inferenceFailureType) { + if (inferenceSucceeded) { var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); inferredType = constraint && !isTypeAssignableTo(inferredType, constraint) ? constraint : inferredType; } + else if (context.failedTypeParameterIndex === undefined || context.failedTypeParameterIndex > index) { + context.failedTypeParameterIndex = index; + } context.inferredTypes[index] = inferredType; } return inferredType; @@ -11974,17 +12839,17 @@ var ts; function getResolvedSymbol(node) { var links = getNodeLinks(node); if (!links.resolvedSymbol) { - links.resolvedSymbol = (ts.getFullWidth(node) > 0 && resolveName(node, node.text, 107455 | 1048576, ts.Diagnostics.Cannot_find_name_0, node)) || unknownSymbol; + links.resolvedSymbol = (!ts.nodeIsMissing(node) && resolveName(node, node.text, 107455 | 1048576, ts.Diagnostics.Cannot_find_name_0, node)) || unknownSymbol; } return links.resolvedSymbol; } function isInTypeQuery(node) { while (node) { switch (node.kind) { - case 142: + case 144: return true; - case 64: - case 125: + case 65: + case 126: node = node.parent; continue; default: @@ -12024,12 +12889,12 @@ var ts; } return links.assignmentChecks[symbol.id] = isAssignedIn(node); function isAssignedInBinaryExpression(node) { - if (node.operatorToken.kind >= 52 && node.operatorToken.kind <= 63) { + if (node.operatorToken.kind >= 53 && node.operatorToken.kind <= 64) { var n = node.left; - while (n.kind === 159) { + while (n.kind === 161) { n = n.expression; } - if (n.kind === 64 && getResolvedSymbol(n) === symbol) { + if (n.kind === 65 && getResolvedSymbol(n) === symbol) { return true; } } @@ -12043,46 +12908,46 @@ var ts; } function isAssignedIn(node) { switch (node.kind) { - case 167: + case 169: return isAssignedInBinaryExpression(node); - case 193: - case 150: - return isAssignedInVariableDeclaration(node); - case 148: - case 149: - case 151: + case 198: case 152: + return isAssignedInVariableDeclaration(node); + case 150: + case 151: case 153: case 154: case 155: case 156: + case 157: case 158: - case 159: - case 165: - case 162: - case 163: + case 160: + case 161: + case 167: case 164: + case 165: case 166: case 168: - case 171: - case 174: - case 175: - case 177: - case 178: + case 170: + case 173: case 179: case 180: - case 181: case 182: case 183: + case 184: + case 185: case 186: case 187: case 188: - case 214: - case 215: - case 189: - case 190: case 191: - case 217: + case 192: + case 193: + case 220: + case 221: + case 194: + case 195: + case 196: + case 223: return ts.forEachChild(node, isAssignedIn); } return false; @@ -12090,10 +12955,10 @@ var ts; } function resolveLocation(node) { var containerNodes = []; - for (var _parent = node.parent; _parent; _parent = _parent.parent) { - if ((ts.isExpression(_parent) || ts.isObjectLiteralMethod(node)) && - isContextSensitive(_parent)) { - containerNodes.unshift(_parent); + for (var parent_3 = node.parent; parent_3; parent_3 = parent_3.parent) { + if ((ts.isExpression(parent_3) || ts.isObjectLiteralMethod(node)) && + isContextSensitive(parent_3)) { + containerNodes.unshift(parent_3); } } ts.forEach(containerNodes, function (node) { getTypeOfNode(node); }); @@ -12118,17 +12983,17 @@ var ts; node = node.parent; var narrowedType = type; switch (node.kind) { - case 178: + case 183: if (child !== node.expression) { narrowedType = narrowType(type, node.expression, child === node.thenStatement); } break; - case 168: + case 170: if (child !== node.condition) { narrowedType = narrowType(type, node.condition, child === node.whenTrue); } break; - case 167: + case 169: if (child === node.right) { if (node.operatorToken.kind === 48) { narrowedType = narrowType(type, node.left, true); @@ -12138,14 +13003,14 @@ var ts; } } break; - case 221: + case 227: + case 205: case 200: - case 195: - case 132: - case 131: case 134: - case 135: case 133: + case 136: + case 137: + case 135: break loop; } if (narrowedType !== type) { @@ -12158,12 +13023,12 @@ var ts; } return type; function narrowTypeByEquality(type, expr, assumeTrue) { - if (expr.left.kind !== 163 || expr.right.kind !== 8) { + if (expr.left.kind !== 165 || expr.right.kind !== 8) { return type; } var left = expr.left; var right = expr.right; - if (left.expression.kind !== 64 || getResolvedSymbol(left.expression) !== symbol) { + if (left.expression.kind !== 65 || getResolvedSymbol(left.expression) !== symbol) { return type; } var typeInfo = primitiveTypeInfo[right.text]; @@ -12209,7 +13074,7 @@ var ts; } } function narrowTypeByInstanceof(type, expr, assumeTrue) { - if (type.flags & 1 || !assumeTrue || expr.left.kind !== 64 || getResolvedSymbol(expr.left) !== symbol) { + if (type.flags & 1 || !assumeTrue || expr.left.kind !== 65 || getResolvedSymbol(expr.left) !== symbol) { return type; } var rightType = checkExpression(expr.right); @@ -12231,9 +13096,9 @@ var ts; } function narrowType(type, expr, assumeTrue) { switch (expr.kind) { - case 159: + case 161: return narrowType(type, expr.expression, assumeTrue); - case 167: + case 169: var operator = expr.operatorToken.kind; if (operator === 30 || operator === 31) { return narrowTypeByEquality(type, expr, assumeTrue); @@ -12244,11 +13109,11 @@ var ts; else if (operator === 49) { return narrowTypeByOr(type, expr, assumeTrue); } - else if (operator === 86) { + else if (operator === 87) { return narrowTypeByInstanceof(type, expr, assumeTrue); } break; - case 165: + case 167: if (expr.operator === 46) { return narrowType(type, expr.operand, !assumeTrue); } @@ -12259,7 +13124,7 @@ var ts; } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); - if (symbol === argumentsSymbol && ts.getContainingFunction(node).kind === 161) { + if (symbol === argumentsSymbol && ts.getContainingFunction(node).kind === 163) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression); } if (symbol.flags & 8388608 && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { @@ -12283,15 +13148,15 @@ var ts; function checkBlockScopedBindingCapturedInLoop(node, symbol) { if (languageVersion >= 2 || (symbol.flags & 2) === 0 || - symbol.valueDeclaration.parent.kind === 217) { + symbol.valueDeclaration.parent.kind === 223) { return; } var container = symbol.valueDeclaration; - while (container.kind !== 194) { + while (container.kind !== 199) { container = container.parent; } container = container.parent; - if (container.kind === 175) { + if (container.kind === 180) { container = container.parent; } var inFunction = isInsideFunction(node.parent, container); @@ -12308,9 +13173,9 @@ var ts; } } function captureLexicalThis(node, container) { - var classNode = container.parent && container.parent.kind === 196 ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 201 ? container.parent : undefined; getNodeLinks(node).flags |= 2; - if (container.kind === 130 || container.kind === 133) { + if (container.kind === 132 || container.kind === 135) { getNodeLinks(classNode).flags |= 4; } else { @@ -12320,36 +13185,36 @@ var ts; function checkThisExpression(node) { var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; - if (container.kind === 161) { + if (container.kind === 163) { container = ts.getThisContainer(container, false); needToCaptureLexicalThis = (languageVersion < 2); } switch (container.kind) { - case 200: + case 205: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_body); break; - case 199: + case 204: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); break; - case 133: + case 135: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; - case 130: - case 129: + case 132: + case 131: if (container.flags & 128) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } break; - case 126: + case 127: 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 === 196 ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 201 ? container.parent : undefined; if (classNode) { var symbol = getSymbolOfNode(classNode); return container.flags & 128 ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); @@ -12358,17 +13223,17 @@ var ts; } function isInConstructorArgumentInitializer(node, constructorDecl) { for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 128) { + if (n.kind === 129) { return true; } } return false; } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 155 && node.parent.expression === node; - var enclosingClass = ts.getAncestor(node, 196); + var isCallExpression = node.parent.kind === 157 && node.parent.expression === node; + var enclosingClass = ts.getAncestor(node, 201); var baseClass; - if (enclosingClass && ts.getClassBaseTypeNode(enclosingClass)) { + if (enclosingClass && ts.getClassExtendsHeritageClauseElement(enclosingClass)) { var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); baseClass = classType.baseTypes.length && classType.baseTypes[0]; } @@ -12381,31 +13246,31 @@ var ts; var canUseSuperExpression = false; var needToCaptureLexicalThis; if (isCallExpression) { - canUseSuperExpression = container.kind === 133; + canUseSuperExpression = container.kind === 135; } else { needToCaptureLexicalThis = false; - while (container && container.kind === 161) { + while (container && container.kind === 163) { container = ts.getSuperContainer(container, true); needToCaptureLexicalThis = true; } - if (container && container.parent && container.parent.kind === 196) { + if (container && container.parent && container.parent.kind === 201) { if (container.flags & 128) { canUseSuperExpression = - container.kind === 132 || - container.kind === 131 || - container.kind === 134 || - container.kind === 135; + container.kind === 134 || + container.kind === 133 || + container.kind === 136 || + container.kind === 137; } else { canUseSuperExpression = - container.kind === 132 || + container.kind === 134 || + container.kind === 133 || + container.kind === 136 || + container.kind === 137 || + container.kind === 132 || container.kind === 131 || - container.kind === 134 || - container.kind === 135 || - container.kind === 130 || - container.kind === 129 || - container.kind === 133; + container.kind === 135; } } } @@ -12419,7 +13284,7 @@ var ts; getNodeLinks(node).flags |= 16; returnType = baseClass; } - if (container.kind === 133 && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 135 && isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); returnType = unknownType; } @@ -12429,7 +13294,7 @@ var ts; return returnType; } } - if (container.kind === 126) { + if (container.kind === 127) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { @@ -12465,9 +13330,9 @@ var ts; var declaration = node.parent; if (node === declaration.initializer) { if (declaration.type) { - return getTypeFromTypeNode(declaration.type); + return getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); } - if (declaration.kind === 128) { + if (declaration.kind === 129) { var type = getContextuallyTypedParameterType(declaration); if (type) { return type; @@ -12482,7 +13347,7 @@ var ts; function getContextualTypeForReturnExpression(node) { var func = ts.getContainingFunction(node); if (func) { - if (func.type || func.kind === 133 || func.kind === 134 && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(func.symbol, 135))) { + if (func.type || func.kind === 135 || func.kind === 136 && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(func.symbol, 137))) { return getReturnTypeOfSignature(getSignatureFromDeclaration(func)); } var signature = getContextualSignatureForFunctionLikeDeclaration(func); @@ -12502,7 +13367,7 @@ var ts; return undefined; } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 157) { + if (template.parent.kind === 159) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -12510,7 +13375,7 @@ var ts; function getContextualTypeForBinaryOperand(node) { var binaryExpression = node.parent; var operator = binaryExpression.operatorToken.kind; - if (operator >= 52 && operator <= 63) { + if (operator >= 53 && operator <= 64) { if (node === binaryExpression.right) { return checkExpression(binaryExpression.left); } @@ -12531,7 +13396,7 @@ var ts; var types = type.types; var mappedType; var mappedTypes; - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var current = types[_i]; var t = mapper(current); if (t) { @@ -12608,35 +13473,35 @@ var ts; if (node.contextualType) { return node.contextualType; } - var _parent = node.parent; - switch (_parent.kind) { - case 193: - case 128: - case 130: + var parent = node.parent; + switch (parent.kind) { + case 198: case 129: - case 150: + case 132: + case 131: + case 152: return getContextualTypeForInitializerExpression(node); - case 161: - case 186: + case 163: + case 191: return getContextualTypeForReturnExpression(node); - case 155: - case 156: - return getContextualTypeForArgument(_parent, node); + case 157: case 158: - return getTypeFromTypeNode(_parent.type); - case 167: + return getContextualTypeForArgument(parent, node); + case 160: + return getTypeFromTypeNodeOrHeritageClauseElement(parent.type); + case 169: return getContextualTypeForBinaryOperand(node); - case 218: - return getContextualTypeForObjectLiteralElement(_parent); - case 151: + case 224: + return getContextualTypeForObjectLiteralElement(parent); + case 153: return getContextualTypeForElementExpression(node); - case 168: + case 170: return getContextualTypeForConditionalOperand(node); - case 173: - ts.Debug.assert(_parent.parent.kind === 169); - return getContextualTypeForSubstitutionExpression(_parent.parent, node); - case 159: - return getContextualType(_parent); + case 176: + ts.Debug.assert(parent.parent.kind === 171); + return getContextualTypeForSubstitutionExpression(parent.parent, node); + case 161: + return getContextualType(parent); } return undefined; } @@ -12650,13 +13515,13 @@ var ts; } } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 160 || node.kind === 161; + return node.kind === 162 || node.kind === 163; } function getContextualSignatureForFunctionLikeDeclaration(node) { return isFunctionExpressionOrArrowFunction(node) ? getContextualSignature(node) : undefined; } function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 132 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); var type = ts.isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node) : getContextualType(node); @@ -12668,7 +13533,7 @@ var ts; } var signatureList; var types = type.types; - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var current = types[_i]; if (signatureList && getSignaturesOfObjectOrUnionType(current, 0).length > 1) { @@ -12699,15 +13564,15 @@ var ts; return mapper && mapper !== identityMapper; } function isAssignmentTarget(node) { - var _parent = node.parent; - if (_parent.kind === 167 && _parent.operatorToken.kind === 52 && _parent.left === node) { + var parent = node.parent; + if (parent.kind === 169 && parent.operatorToken.kind === 53 && parent.left === node) { return true; } - if (_parent.kind === 218) { - return isAssignmentTarget(_parent.parent); + if (parent.kind === 224) { + return isAssignmentTarget(parent.parent); } - if (_parent.kind === 151) { - return isAssignmentTarget(_parent); + if (parent.kind === 153) { + return isAssignmentTarget(parent); } return false; } @@ -12728,7 +13593,7 @@ var ts; var elementTypes = []; ts.forEach(elements, function (e) { var type = checkExpression(e, contextualMapper); - if (e.kind === 171) { + if (e.kind === 173) { elementTypes.push(getIndexTypeOfType(type, 1) || anyType); hasSpreadElement = true; } @@ -12745,7 +13610,7 @@ var ts; return createArrayType(getUnionType(elementTypes)); } function isNumericName(name) { - return name.kind === 126 ? isNumericComputedName(name) : isNumericLiteralName(name.text); + return name.kind === 127 ? isNumericComputedName(name) : isNumericLiteralName(name.text); } function isNumericComputedName(name) { return allConstituentTypesHaveKind(checkComputedPropertyName(name), 1 | 132); @@ -12772,22 +13637,22 @@ var ts; var propertiesArray = []; var contextualType = getContextualType(node); var typeFlags; - for (var _i = 0, _a = node.properties, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var memberDecl = _a[_i]; var member = memberDecl.symbol; - if (memberDecl.kind === 218 || - memberDecl.kind === 219 || + if (memberDecl.kind === 224 || + memberDecl.kind === 225 || ts.isObjectLiteralMethod(memberDecl)) { var type = void 0; - if (memberDecl.kind === 218) { + if (memberDecl.kind === 224) { type = checkPropertyAssignment(memberDecl, contextualMapper); } - else if (memberDecl.kind === 132) { + else if (memberDecl.kind === 134) { type = checkObjectLiteralMethod(memberDecl, contextualMapper); } else { - ts.Debug.assert(memberDecl.kind === 219); - type = memberDecl.name.kind === 126 + ts.Debug.assert(memberDecl.kind === 225); + type = memberDecl.name.kind === 127 ? unknownType : checkExpression(memberDecl.name, contextualMapper); } @@ -12803,7 +13668,7 @@ var ts; member = prop; } else { - ts.Debug.assert(memberDecl.kind === 134 || memberDecl.kind === 135); + ts.Debug.assert(memberDecl.kind === 136 || memberDecl.kind === 137); checkAccessorDeclaration(memberDecl); } if (!ts.hasDynamicName(memberDecl)) { @@ -12822,21 +13687,21 @@ var ts; for (var i = 0; i < propertiesArray.length; i++) { var propertyDecl = node.properties[i]; if (kind === 0 || isNumericName(propertyDecl.name)) { - var _type = getTypeOfSymbol(propertiesArray[i]); - if (!ts.contains(propTypes, _type)) { - propTypes.push(_type); + var type = getTypeOfSymbol(propertiesArray[i]); + if (!ts.contains(propTypes, type)) { + propTypes.push(type); } } } - var _result = propTypes.length ? getUnionType(propTypes) : undefinedType; - typeFlags |= _result.flags; - return _result; + var result_1 = propTypes.length ? getUnionType(propTypes) : undefinedType; + typeFlags |= result_1.flags; + return result_1; } return undefined; } } function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 130; + return s.valueDeclaration ? s.valueDeclaration.kind : 132; } function getDeclarationFlagsFromSymbol(s) { return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : s.flags & 134217728 ? 16 | 128 : 0; @@ -12846,7 +13711,7 @@ var ts; if (!(flags & (32 | 64))) { return; } - var enclosingClassDeclaration = ts.getAncestor(node, 196); + var enclosingClassDeclaration = ts.getAncestor(node, 201); var enclosingClass = enclosingClassDeclaration ? getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClassDeclaration)) : undefined; var declaringClass = getDeclaredTypeOfSymbol(prop.parent); if (flags & 32) { @@ -12855,7 +13720,7 @@ var ts; } return; } - if (left.kind === 90) { + if (left.kind === 91) { return; } if (!enclosingClass || !hasBaseType(enclosingClass, declaringClass)) { @@ -12893,7 +13758,7 @@ var ts; } getNodeLinks(node).resolvedSymbol = prop; if (prop.parent && prop.parent.flags & 32) { - if (left.kind === 90 && getDeclarationKindFromSymbol(prop) !== 132) { + if (left.kind === 91 && getDeclarationKindFromSymbol(prop) !== 134) { error(right, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); } else { @@ -12905,14 +13770,14 @@ var ts; return anyType; } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 153 + var left = node.kind === 155 ? 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 === 90 && getDeclarationKindFromSymbol(prop) !== 132) { + if (left.kind === 91 && getDeclarationKindFromSymbol(prop) !== 134) { return false; } else { @@ -12927,15 +13792,15 @@ var ts; function checkIndexedAccess(node) { if (!node.argumentExpression) { var sourceFile = getSourceFile(node); - if (node.parent.kind === 156 && node.parent.expression === node) { + if (node.parent.kind === 158 && 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); } else { - var _start = node.end - "]".length; - var _end = node.end; - grammarErrorAtPos(sourceFile, _start, _end - _start, ts.Diagnostics.Expression_expected); + var start = node.end - "]".length; + var end = node.end; + grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Expression_expected); } } var objectType = getApparentType(checkExpression(node.expression)); @@ -12950,15 +13815,15 @@ var ts; return unknownType; } if (node.argumentExpression) { - var _name = getPropertyNameForIndexedAccess(node.argumentExpression, indexType); - if (_name !== undefined) { - var prop = getPropertyOfType(objectType, _name); + var name_6 = getPropertyNameForIndexedAccess(node.argumentExpression, indexType); + if (name_6 !== undefined) { + var prop = getPropertyOfType(objectType, name_6); if (prop) { getNodeLinks(node).resolvedSymbol = prop; return getTypeOfSymbol(prop); } else if (isConstEnum) { - error(node.argumentExpression, ts.Diagnostics.Property_0_does_not_exist_on_const_enum_1, _name, symbolToString(objectType.symbol)); + error(node.argumentExpression, ts.Diagnostics.Property_0_does_not_exist_on_const_enum_1, name_6, symbolToString(objectType.symbol)); return unknownType; } } @@ -13023,7 +13888,7 @@ var ts; return true; } function resolveUntypedCall(node) { - if (node.kind === 157) { + if (node.kind === 159) { checkExpression(node.template); } else { @@ -13045,22 +13910,22 @@ var ts; var specializedIndex = -1; var spliceIndex; ts.Debug.assert(!result.length); - for (var _i = 0, _n = signatures.length; _i < _n; _i++) { + for (var _i = 0; _i < signatures.length; _i++) { var signature = signatures[_i]; var symbol = signature.declaration && getSymbolOfNode(signature.declaration); - var _parent = signature.declaration && signature.declaration.parent; + var parent_4 = signature.declaration && signature.declaration.parent; if (!lastSymbol || symbol === lastSymbol) { - if (lastParent && _parent === lastParent) { + if (lastParent && parent_4 === lastParent) { index++; } else { - lastParent = _parent; + lastParent = parent_4; index = cutoffIndex; } } else { index = cutoffIndex = result.length; - lastParent = _parent; + lastParent = parent_4; } lastSymbol = symbol; if (signature.hasStringLiterals) { @@ -13076,7 +13941,7 @@ var ts; } function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { - if (args[i].kind === 171) { + if (args[i].kind === 173) { return i; } } @@ -13086,15 +13951,15 @@ var ts; var adjustedArgCount; var typeArguments; var callIsIncomplete; - if (node.kind === 157) { + if (node.kind === 159) { var tagExpression = node; adjustedArgCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === 169) { + if (tagExpression.template.kind === 171) { var templateExpression = tagExpression.template; var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans); ts.Debug.assert(lastSpan !== undefined); - callIsIncomplete = ts.getFullWidth(lastSpan.literal) === 0 || !!lastSpan.literal.isUnterminated; + callIsIncomplete = ts.nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated; } else { var templateLiteral = tagExpression.template; @@ -13105,7 +13970,7 @@ var ts; else { var callExpression = node; if (!callExpression.arguments) { - ts.Debug.assert(callExpression.kind === 156); + ts.Debug.assert(callExpression.kind === 158); return signature.minArgumentCount === 0; } adjustedArgCount = callExpression.arguments.hasTrailingComma ? args.length + 1 : args.length; @@ -13144,16 +14009,23 @@ var ts; }); return getSignatureInstantiation(signature, getInferredTypes(context)); } - function inferTypeArguments(signature, args, excludeArgument) { + function inferTypeArguments(signature, args, excludeArgument, context) { var typeParameters = signature.typeParameters; - var context = createInferenceContext(typeParameters, false); var inferenceMapper = createInferenceMapper(context); + for (var i = 0; i < typeParameters.length; i++) { + if (!context.inferences[i].isFixed) { + context.inferredTypes[i] = undefined; + } + } + if (context.failedTypeParameterIndex !== undefined && !context.inferences[context.failedTypeParameterIndex].isFixed) { + context.failedTypeParameterIndex = undefined; + } for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg.kind !== 172) { - var paramType = getTypeAtPosition(signature, arg.kind === 171 ? -1 : i); + if (arg.kind !== 175) { + var paramType = getTypeAtPosition(signature, arg.kind === 173 ? -1 : i); var argType = void 0; - if (i === 0 && args[i].parent.kind === 157) { + if (i === 0 && args[i].parent.kind === 159) { argType = globalTemplateStringsArrayType; } else { @@ -13164,29 +14036,22 @@ var ts; } } if (excludeArgument) { - for (var _i = 0; _i < args.length; _i++) { - if (excludeArgument[_i] === false) { - var _arg = args[_i]; - var _paramType = getTypeAtPosition(signature, _arg.kind === 171 ? -1 : _i); - inferTypes(context, checkExpressionWithContextualType(_arg, _paramType, inferenceMapper), _paramType); + for (var i = 0; i < args.length; i++) { + if (excludeArgument[i] === false) { + var arg = args[i]; + var paramType = getTypeAtPosition(signature, arg.kind === 173 ? -1 : i); + inferTypes(context, checkExpressionWithContextualType(arg, paramType, inferenceMapper), paramType); } } } - var inferredTypes = getInferredTypes(context); - context.failedTypeParameterIndex = ts.indexOf(inferredTypes, inferenceFailureType); - for (var _i_1 = 0; _i_1 < inferredTypes.length; _i_1++) { - if (inferredTypes[_i_1] === inferenceFailureType) { - inferredTypes[_i_1] = unknownType; - } - } - return context; + getInferredTypes(context); } function checkTypeArguments(signature, typeArguments, typeArgumentResultTypes, reportErrors) { var typeParameters = signature.typeParameters; var typeArgumentsAreAssignable = true; for (var i = 0; i < typeParameters.length; i++) { var typeArgNode = typeArguments[i]; - var typeArgument = getTypeFromTypeNode(typeArgNode); + var typeArgument = getTypeFromTypeNodeOrHeritageClauseElement(typeArgNode); typeArgumentResultTypes[i] = typeArgument; if (typeArgumentsAreAssignable) { var constraint = getConstraintOfTypeParameter(typeParameters[i]); @@ -13200,9 +14065,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 !== 172) { - var paramType = getTypeAtPosition(signature, arg.kind === 171 ? -1 : i); - var argType = i === 0 && node.kind === 157 ? globalTemplateStringsArrayType : + if (arg.kind !== 175) { + var paramType = getTypeAtPosition(signature, arg.kind === 173 ? -1 : i); + var argType = i === 0 && node.kind === 159 ? globalTemplateStringsArrayType : arg.kind === 8 && !reportErrors ? getStringLiteralType(arg) : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); if (!checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1)) { @@ -13214,10 +14079,10 @@ var ts; } function getEffectiveCallArguments(node) { var args; - if (node.kind === 157) { + if (node.kind === 159) { var template = node.template; args = [template]; - if (template.kind === 169) { + if (template.kind === 171) { ts.forEach(template.templateSpans, function (span) { args.push(span.expression); }); @@ -13229,9 +14094,9 @@ var ts; return args; } function getEffectiveTypeArguments(callExpression) { - if (callExpression.expression.kind === 90) { - var containingClass = ts.getAncestor(callExpression, 196); - var baseClassTypeNode = containingClass && ts.getClassBaseTypeNode(containingClass); + if (callExpression.expression.kind === 91) { + var containingClass = ts.getAncestor(callExpression, 201); + var baseClassTypeNode = containingClass && ts.getClassExtendsHeritageClauseElement(containingClass); return baseClassTypeNode && baseClassTypeNode.typeArguments; } else { @@ -13239,11 +14104,11 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray) { - var isTaggedTemplate = node.kind === 157; + var isTaggedTemplate = node.kind === 159; var typeArguments; if (!isTaggedTemplate) { typeArguments = getEffectiveTypeArguments(node); - if (node.expression.kind !== 90) { + if (node.expression.kind !== 91) { ts.forEach(typeArguments, checkSourceElement); } } @@ -13298,7 +14163,7 @@ var ts; error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); } if (!produceDiagnostics) { - for (var _i = 0, _n = candidates.length; _i < _n; _i++) { + for (var _i = 0; _i < candidates.length; _i++) { var candidate = candidates[_i]; if (hasCorrectArity(node, args, candidate)) { return candidate; @@ -13307,56 +14172,57 @@ var ts; } return resolveErrorCall(node); function chooseOverload(candidates, relation) { - for (var _a = 0, _b = candidates.length; _a < _b; _a++) { - var current = candidates[_a]; - if (!hasCorrectArity(node, args, current)) { + for (var _i = 0; _i < candidates.length; _i++) { + var originalCandidate = candidates[_i]; + if (!hasCorrectArity(node, args, originalCandidate)) { continue; } - var originalCandidate = current; - var inferenceResult = void 0; - var _candidate = void 0; + var candidate = void 0; var typeArgumentsAreValid = void 0; + var inferenceContext = originalCandidate.typeParameters + ? createInferenceContext(originalCandidate.typeParameters, false) + : undefined; while (true) { - _candidate = originalCandidate; - if (_candidate.typeParameters) { + candidate = originalCandidate; + if (candidate.typeParameters) { var typeArgumentTypes = void 0; if (typeArguments) { - typeArgumentTypes = new Array(_candidate.typeParameters.length); - typeArgumentsAreValid = checkTypeArguments(_candidate, typeArguments, typeArgumentTypes, false); + typeArgumentTypes = new Array(candidate.typeParameters.length); + typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, false); } else { - inferenceResult = inferTypeArguments(_candidate, args, excludeArgument); - typeArgumentsAreValid = inferenceResult.failedTypeParameterIndex < 0; - typeArgumentTypes = inferenceResult.inferredTypes; + inferTypeArguments(candidate, args, excludeArgument, inferenceContext); + typeArgumentsAreValid = inferenceContext.failedTypeParameterIndex === undefined; + typeArgumentTypes = inferenceContext.inferredTypes; } if (!typeArgumentsAreValid) { break; } - _candidate = getSignatureInstantiation(_candidate, typeArgumentTypes); + candidate = getSignatureInstantiation(candidate, typeArgumentTypes); } - if (!checkApplicableSignature(node, args, _candidate, relation, excludeArgument, false)) { + if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, false)) { break; } var index = excludeArgument ? ts.indexOf(excludeArgument, true) : -1; if (index < 0) { - return _candidate; + return candidate; } excludeArgument[index] = false; } if (originalCandidate.typeParameters) { - var instantiatedCandidate = _candidate; + var instantiatedCandidate = candidate; if (typeArgumentsAreValid) { candidateForArgumentError = instantiatedCandidate; } else { candidateForTypeArgumentError = originalCandidate; if (!typeArguments) { - resultOfFailedInference = inferenceResult; + resultOfFailedInference = inferenceContext; } } } else { - ts.Debug.assert(originalCandidate === _candidate); + ts.Debug.assert(originalCandidate === candidate); candidateForArgumentError = originalCandidate; } } @@ -13364,7 +14230,7 @@ var ts; } } function resolveCallExpression(node, candidatesOutArray) { - if (node.expression.kind === 90) { + if (node.expression.kind === 91) { var superType = checkSuperExpression(node.expression); if (superType !== unknownType) { return resolveCall(node, getSignaturesOfType(superType, 1), candidatesOutArray); @@ -13448,13 +14314,13 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - if (node.kind === 155) { + if (node.kind === 157) { links.resolvedSignature = resolveCallExpression(node, candidatesOutArray); } - else if (node.kind === 156) { + else if (node.kind === 158) { links.resolvedSignature = resolveNewExpression(node, candidatesOutArray); } - else if (node.kind === 157) { + else if (node.kind === 159) { links.resolvedSignature = resolveTaggedTemplateExpression(node, candidatesOutArray); } else { @@ -13466,15 +14332,15 @@ var ts; function checkCallExpression(node) { checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node, node.arguments); var signature = getResolvedSignature(node); - if (node.expression.kind === 90) { + if (node.expression.kind === 91) { return voidType; } - if (node.kind === 156) { + if (node.kind === 158) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 133 && - declaration.kind !== 137 && - declaration.kind !== 141) { + declaration.kind !== 135 && + declaration.kind !== 139 && + declaration.kind !== 143) { if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } @@ -13488,7 +14354,7 @@ var ts; } function checkTypeAssertion(node) { var exprType = checkExpression(node.expression); - var targetType = getTypeFromTypeNode(node.type); + var targetType = getTypeFromTypeNodeOrHeritageClauseElement(node.type); if (produceDiagnostics && targetType !== unknownType) { var widenedType = getWidenedType(exprType); if (!(isTypeAssignableTo(targetType, widenedType))) { @@ -13515,9 +14381,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 _links = getSymbolLinks(_parameter); - _links.type = instantiateType(getTypeOfSymbol(context.parameters[context.parameters.length - 1]), mapper); + var parameter = signature.parameters[signature.parameters.length - 1]; + var links = getSymbolLinks(parameter); + links.type = instantiateType(getTypeOfSymbol(context.parameters[context.parameters.length - 1]), mapper); } } function getReturnTypeFromBody(func, contextualMapper) { @@ -13526,7 +14392,7 @@ var ts; return unknownType; } var type; - if (func.body.kind !== 174) { + if (func.body.kind !== 179) { type = checkExpressionCached(func.body, contextualMapper); } else { @@ -13564,7 +14430,7 @@ var ts; }); } function bodyContainsSingleThrowStatement(body) { - return (body.statements.length === 1) && (body.statements[0].kind === 190); + return (body.statements.length === 1) && (body.statements[0].kind === 195); } function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func, returnType) { if (!produceDiagnostics) { @@ -13573,7 +14439,7 @@ var ts; if (returnType === voidType || returnType === anyType) { return; } - if (ts.nodeIsMissing(func.body) || func.body.kind !== 174) { + if (ts.nodeIsMissing(func.body) || func.body.kind !== 179) { return; } var bodyBlock = func.body; @@ -13586,9 +14452,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 !== 132 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 160) { + if (!hasGrammarError && node.kind === 162) { checkGrammarFunctionName(node.name) || checkGrammarForGenerator(node); } if (contextualMapper === identityMapper && isContextSensitive(node)) { @@ -13616,25 +14482,25 @@ var ts; checkSignatureDeclaration(node); } } - if (produceDiagnostics && node.kind !== 132 && node.kind !== 131) { + if (produceDiagnostics && node.kind !== 134 && node.kind !== 133) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); } return type; } function checkFunctionExpressionOrObjectLiteralMethodBody(node) { - ts.Debug.assert(node.kind !== 132 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); if (node.type) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); + checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type)); } if (node.body) { - if (node.body.kind === 174) { + if (node.body.kind === 179) { checkSourceElement(node.body); } else { var exprType = checkExpression(node.body); if (node.type) { - checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, undefined); + checkTypeAssignableTo(exprType, getTypeFromTypeNodeOrHeritageClauseElement(node.type), node.body, undefined); } checkFunctionExpressionBodies(node.body); } @@ -13654,17 +14520,17 @@ var ts; } function isReferenceOrErrorExpression(n) { switch (n.kind) { - case 64: { + case 65: { var symbol = findSymbol(n); return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3) !== 0; } - case 153: { - var _symbol = findSymbol(n); - return !_symbol || _symbol === unknownSymbol || (_symbol.flags & ~8) !== 0; + case 155: { + var symbol = findSymbol(n); + return !symbol || symbol === unknownSymbol || (symbol.flags & ~8) !== 0; } - case 154: + case 156: return true; - case 159: + case 161: return isReferenceOrErrorExpression(n.expression); default: return false; @@ -13672,22 +14538,22 @@ var ts; } function isConstVariableReference(n) { switch (n.kind) { - case 64: - case 153: { + case 65: + case 155: { var symbol = findSymbol(n); return symbol && (symbol.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 8192) !== 0; } - case 154: { + case 156: { var index = n.argumentExpression; - var _symbol = findSymbol(n.expression); - if (_symbol && index && index.kind === 8) { - var _name = index.text; - var prop = getPropertyOfType(getTypeOfSymbol(_symbol), _name); + var symbol = findSymbol(n.expression); + if (symbol && index && index.kind === 8) { + var name_7 = index.text; + var prop = getPropertyOfType(getTypeOfSymbol(symbol), name_7); return prop && (prop.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(prop) & 8192) !== 0; } return false; } - case 159: + case 161: return isConstVariableReference(n.expression); default: return false; @@ -13704,7 +14570,7 @@ var ts; return true; } function checkDeleteExpression(node) { - if (node.parserContextFlags & 1 && node.expression.kind === 64) { + if (node.parserContextFlags & 1 && node.expression.kind === 65) { grammarErrorOnNode(node.expression, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode); } var operandType = checkExpression(node.expression); @@ -13758,7 +14624,7 @@ var ts; } if (type.flags & 16384) { var types = type.types; - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var current = types[_i]; if (current.flags & kind) { return true; @@ -13774,7 +14640,7 @@ var ts; } if (type.flags & 16384) { var types = type.types; - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var current = types[_i]; if (!(current.flags & kind)) { return false; @@ -13810,19 +14676,19 @@ var ts; } function checkObjectLiteralAssignment(node, sourceType, contextualMapper) { var properties = node.properties; - for (var _i = 0, _n = properties.length; _i < _n; _i++) { + for (var _i = 0; _i < properties.length; _i++) { var p = properties[_i]; - if (p.kind === 218 || p.kind === 219) { - var _name = p.name; + if (p.kind === 224 || p.kind === 225) { + var name_8 = p.name; var type = sourceType.flags & 1 ? sourceType : - getTypeOfPropertyOfType(sourceType, _name.text) || - isNumericLiteralName(_name.text) && getIndexTypeOfType(sourceType, 1) || + getTypeOfPropertyOfType(sourceType, name_8.text) || + isNumericLiteralName(name_8.text) && getIndexTypeOfType(sourceType, 1) || getIndexTypeOfType(sourceType, 0); if (type) { - checkDestructuringAssignment(p.initializer || _name, type); + checkDestructuringAssignment(p.initializer || name_8, type); } else { - error(_name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(sourceType), ts.declarationNameToString(_name)); + error(name_8, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(sourceType), ts.declarationNameToString(name_8)); } } else { @@ -13839,8 +14705,8 @@ var ts; var elements = node.elements; for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 172) { - if (e.kind !== 171) { + if (e.kind !== 175) { + if (e.kind !== 173) { var propName = "" + i; var type = sourceType.flags & 1 ? sourceType : isTupleLikeType(sourceType) ? getTypeOfPropertyOfType(sourceType, propName) : @@ -13870,14 +14736,14 @@ var ts; return sourceType; } function checkDestructuringAssignment(target, sourceType, contextualMapper) { - if (target.kind === 167 && target.operatorToken.kind === 52) { + if (target.kind === 169 && target.operatorToken.kind === 53) { checkBinaryExpression(target, contextualMapper); target = target.left; } - if (target.kind === 152) { + if (target.kind === 154) { return checkObjectLiteralAssignment(target, sourceType, contextualMapper); } - if (target.kind === 151) { + if (target.kind === 153) { return checkArrayLiteralAssignment(target, sourceType, contextualMapper); } return checkReferenceAssignment(target, sourceType, contextualMapper); @@ -13894,32 +14760,32 @@ var ts; checkGrammarEvalOrArgumentsInStrictMode(node, node.left); } var operator = node.operatorToken.kind; - if (operator === 52 && (node.left.kind === 152 || node.left.kind === 151)) { + if (operator === 53 && (node.left.kind === 154 || node.left.kind === 153)) { return checkDestructuringAssignment(node.left, checkExpression(node.right, contextualMapper), contextualMapper); } var leftType = checkExpression(node.left, contextualMapper); var rightType = checkExpression(node.right, contextualMapper); switch (operator) { case 35: - case 55: - case 36: case 56: - case 37: + case 36: case 57: - case 34: - case 54: - case 40: + case 37: case 58: - case 41: + case 34: + case 55: + case 40: case 59: - case 42: + case 41: case 60: - case 44: - case 62: - case 45: - case 63: - case 43: + case 42: case 61: + case 44: + case 63: + case 45: + case 64: + case 43: + case 62: if (leftType.flags & (32 | 64)) leftType = rightType; if (rightType.flags & (32 | 64)) @@ -13939,7 +14805,7 @@ var ts; } return numberType; case 33: - case 53: + case 54: if (leftType.flags & (32 | 64)) leftType = rightType; if (rightType.flags & (32 | 64)) @@ -13963,7 +14829,7 @@ var ts; reportOperatorError(); return anyType; } - if (operator === 53) { + if (operator === 54) { checkAssignmentOperator(resultType); } return resultType; @@ -13982,15 +14848,15 @@ var ts; reportOperatorError(); } return booleanType; - case 86: + case 87: return checkInstanceOfExpression(node, leftType, rightType); - case 85: + case 86: return checkInExpression(node, leftType, rightType); case 48: return rightType; case 49: return getUnionType([leftType, rightType]); - case 52: + case 53: checkAssignmentOperator(rightType); return rightType; case 23: @@ -14009,20 +14875,20 @@ var ts; function getSuggestedBooleanOperator(operator) { switch (operator) { case 44: - case 62: + case 63: return 49; case 45: - case 63: + case 64: return 31; case 43: - case 61: + case 62: return 48; default: return undefined; } } function checkAssignmentOperator(valueType) { - if (produceDiagnostics && operator >= 52 && operator <= 63) { + if (produceDiagnostics && operator >= 53 && operator <= 64) { var ok = checkReferenceExpression(node.left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression, ts.Diagnostics.Left_hand_side_of_assignment_expression_cannot_be_a_constant); if (ok) { checkTypeAssignableTo(valueType, leftType, node.left, undefined); @@ -14068,14 +14934,14 @@ var ts; return links.resolvedType; } function checkPropertyAssignment(node, contextualMapper) { - if (node.name.kind === 126) { + if (node.name.kind === 127) { checkComputedPropertyName(node.name); } return checkExpression(node.initializer, contextualMapper); } function checkObjectLiteralMethod(node, contextualMapper) { checkGrammarMethod(node); - if (node.name.kind === 126) { + if (node.name.kind === 127) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); @@ -14101,7 +14967,7 @@ var ts; } function checkExpressionOrQualifiedName(node, contextualMapper) { var type; - if (node.kind == 125) { + if (node.kind == 126) { type = checkQualifiedName(node); } else { @@ -14109,9 +14975,9 @@ var ts; type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); } if (isConstEnumObjectType(type)) { - var ok = (node.parent.kind === 153 && node.parent.expression === node) || - (node.parent.kind === 154 && node.parent.expression === node) || - ((node.kind === 64 || node.kind === 125) && isInRightSideOfImportOrExportAssignment(node)); + 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)); 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); } @@ -14124,65 +14990,67 @@ var ts; } function checkExpressionWorker(node, contextualMapper) { switch (node.kind) { - case 64: + case 65: return checkIdentifier(node); - case 92: + case 93: return checkThisExpression(node); - case 90: + case 91: return checkSuperExpression(node); - case 88: + case 89: return nullType; - case 94: - case 79: + case 95: + case 80: return booleanType; case 7: return checkNumericLiteral(node); - case 169: + case 171: return checkTemplateExpression(node); case 8: case 10: return stringType; case 9: return globalRegExpType; - case 151: - return checkArrayLiteral(node, contextualMapper); - case 152: - return checkObjectLiteral(node, contextualMapper); case 153: - return checkPropertyAccessExpression(node); + return checkArrayLiteral(node, contextualMapper); case 154: - return checkIndexedAccess(node); + return checkObjectLiteral(node, contextualMapper); case 155: + return checkPropertyAccessExpression(node); case 156: - return checkCallExpression(node); + return checkIndexedAccess(node); case 157: - return checkTaggedTemplateExpression(node); case 158: - return checkTypeAssertion(node); + return checkCallExpression(node); case 159: - return checkExpression(node.expression, contextualMapper); + return checkTaggedTemplateExpression(node); case 160: + return checkTypeAssertion(node); case 161: - return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - case 163: - return checkTypeOfExpression(node); + return checkExpression(node.expression, contextualMapper); + case 174: + return checkClassExpression(node); case 162: - return checkDeleteExpression(node); - case 164: - return checkVoidExpression(node); + case 163: + return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); case 165: - return checkPrefixUnaryExpression(node); + return checkTypeOfExpression(node); + case 164: + return checkDeleteExpression(node); case 166: - return checkPostfixUnaryExpression(node); + return checkVoidExpression(node); case 167: - return checkBinaryExpression(node, contextualMapper); + return checkPrefixUnaryExpression(node); case 168: - return checkConditionalExpression(node, contextualMapper); - case 171: - return checkSpreadElementExpression(node, contextualMapper); - case 172: - return undefinedType; + return checkPostfixUnaryExpression(node); + case 169: + return checkBinaryExpression(node, contextualMapper); case 170: + return checkConditionalExpression(node, contextualMapper); + case 173: + return checkSpreadElementExpression(node, contextualMapper); + case 175: + return undefinedType; + case 172: checkYieldExpression(node); return unknownType; } @@ -14199,12 +15067,18 @@ var ts; } } function checkParameter(node) { - checkGrammarModifiers(node) || checkGrammarEvalOrArgumentsInStrictMode(node, node.name); + // Grammar checking + // It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs as the + // Identifier in a PropertySetParameterList of a PropertyAssignment that is contained in strict code + // or if its FunctionBody is strict code(11.1.5). + // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a + // strict mode FunctionLikeDeclaration or FunctionExpression(13.1) + checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarEvalOrArgumentsInStrictMode(node, node.name); checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (node.flags & 112) { func = ts.getContainingFunction(node); - if (!(func.kind === 133 && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 135 && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -14218,12 +15092,12 @@ var ts; } } function checkSignatureDeclaration(node) { - if (node.kind === 138) { + if (node.kind === 140) { checkGrammarIndexSignature(node); } - else if (node.kind === 140 || node.kind === 195 || node.kind === 141 || - node.kind === 136 || node.kind === 133 || - node.kind === 137) { + else if (node.kind === 142 || node.kind === 200 || node.kind === 143 || + node.kind === 138 || node.kind === 135 || + node.kind === 139) { checkGrammarFunctionLikeDeclaration(node); } checkTypeParameters(node.typeParameters); @@ -14235,10 +15109,10 @@ var ts; checkCollisionWithArgumentsInGeneratedCode(node); if (compilerOptions.noImplicitAny && !node.type) { switch (node.kind) { - case 137: + case 139: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 136: + case 138: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -14247,7 +15121,7 @@ var ts; checkSpecializedSignatureDeclaration(node); } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 197) { + if (node.kind === 202) { var nodeSymbol = getSymbolOfNode(node); if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -14257,12 +15131,12 @@ var ts; if (indexSymbol) { var seenNumericIndexer = false; var seenStringIndexer = false; - for (var _i = 0, _a = indexSymbol.declarations, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 120: + case 121: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -14270,7 +15144,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 118: + case 119: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -14284,7 +15158,7 @@ var ts; } } function checkPropertyDeclaration(node) { - checkGrammarModifiers(node) || checkGrammarProperty(node) || checkGrammarComputedPropertyName(node.name); + checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarProperty(node) || checkGrammarComputedPropertyName(node.name); checkVariableLikeDeclaration(node); } function checkMethodDeclaration(node) { @@ -14307,40 +15181,40 @@ var ts; return; } function isSuperCallExpression(n) { - return n.kind === 155 && n.expression.kind === 90; + return n.kind === 157 && n.expression.kind === 91; } function containsSuperCall(n) { if (isSuperCallExpression(n)) { return true; } switch (n.kind) { - case 160: - case 195: - case 161: - case 152: return false; + case 162: + case 200: + case 163: + case 154: return false; default: return ts.forEachChild(n, containsSuperCall); } } function markThisReferencesAsErrors(n) { - if (n.kind === 92) { + if (n.kind === 93) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 160 && n.kind !== 195) { + else if (n.kind !== 162 && n.kind !== 200) { ts.forEachChild(n, markThisReferencesAsErrors); } } function isInstancePropertyWithInitializer(n) { - return n.kind === 130 && + return n.kind === 132 && !(n.flags & 128) && !!n.initializer; } - if (ts.getClassBaseTypeNode(node.parent)) { + if (ts.getClassExtendsHeritageClauseElement(node.parent)) { if (containsSuperCall(node.body)) { var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || 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 !== 177 || !isSuperCallExpression(statements[0].expression)) { + if (!statements.length || statements[0].kind !== 182 || !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 { @@ -14356,13 +15230,13 @@ var ts; function checkAccessorDeclaration(node) { if (produceDiagnostics) { checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name); - if (node.kind === 134) { + if (node.kind === 136) { 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 === 134 ? 135 : 134; + var otherKind = node.kind === 136 ? 137 : 136; var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { if (((node.flags & 112) !== (otherAccessor.flags & 112))) { @@ -14381,9 +15255,18 @@ var ts; } checkFunctionLikeDeclaration(node); } - function checkTypeReference(node) { + function checkMissingDeclaration(node) { + checkDecorators(node); + } + function checkTypeReferenceNode(node) { + return checkTypeReferenceOrHeritageClauseElement(node); + } + function checkHeritageClauseElement(node) { + return checkTypeReferenceOrHeritageClauseElement(node); + } + function checkTypeReferenceOrHeritageClauseElement(node) { checkGrammarTypeArguments(node, node.typeArguments); - var type = getTypeFromTypeReferenceNode(node); + var type = getTypeFromTypeReferenceOrHeritageClauseElement(node); if (type !== unknownType && node.typeArguments) { var len = node.typeArguments.length; for (var i = 0; i < len; i++) { @@ -14436,9 +15319,9 @@ var ts; return; } var signaturesToCheck; - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 197) { - ts.Debug.assert(signatureDeclarationNode.kind === 136 || signatureDeclarationNode.kind === 137); - var signatureKind = signatureDeclarationNode.kind === 136 ? 0 : 1; + 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; var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); var containingType = getDeclaredTypeOfSymbol(containingSymbol); signaturesToCheck = getSignaturesOfType(containingType, signatureKind); @@ -14446,7 +15329,7 @@ var ts; else { signaturesToCheck = getSignaturesOfSymbol(getSymbolOfNode(signatureDeclarationNode)); } - for (var _i = 0, _n = signaturesToCheck.length; _i < _n; _i++) { + for (var _i = 0; _i < signaturesToCheck.length; _i++) { var otherSignature = signaturesToCheck[_i]; if (!otherSignature.hasStringLiterals && isSignatureAssignableTo(signature, otherSignature)) { return; @@ -14456,7 +15339,7 @@ var ts; } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = ts.getCombinedNodeFlags(n); - if (n.parent.kind !== 197 && ts.isInAmbientContext(n)) { + if (n.parent.kind !== 202 && ts.isInAmbientContext(n)) { if (!(flags & 2)) { flags |= 1; } @@ -14513,7 +15396,7 @@ var ts; var declarations = symbol.declarations; var isConstructor = (symbol.flags & 16384) !== 0; function reportImplementationExpectedError(node) { - if (node.name && ts.getFullWidth(node.name) === 0) { + if (node.name && ts.nodeIsMissing(node.name)) { return; } var seen = false; @@ -14527,16 +15410,16 @@ var ts; }); if (subsequentNode) { if (subsequentNode.kind === node.kind) { - var _errorNode = subsequentNode.name || subsequentNode; + var errorNode_1 = subsequentNode.name || subsequentNode; if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - ts.Debug.assert(node.kind === 132 || node.kind === 131); + ts.Debug.assert(node.kind === 134 || node.kind === 133); 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, diagnostic); + error(errorNode_1, diagnostic); return; } else if (ts.nodeIsPresent(subsequentNode.body)) { - error(_errorNode, ts.Diagnostics.Function_implementation_name_must_be_0, ts.declarationNameToString(node.name)); + error(errorNode_1, ts.Diagnostics.Function_implementation_name_must_be_0, ts.declarationNameToString(node.name)); return; } } @@ -14552,15 +15435,15 @@ var ts; var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & 1536; var duplicateFunctionDeclaration = false; var multipleConstructorImplementation = false; - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + for (var _i = 0; _i < declarations.length; _i++) { var current = declarations[_i]; var node = current; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 197 || node.parent.kind === 143 || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 202 || node.parent.kind === 145 || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = undefined; } - if (node.kind === 195 || node.kind === 132 || node.kind === 131 || node.kind === 133) { + if (node.kind === 200 || node.kind === 134 || node.kind === 133 || node.kind === 135) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -14611,7 +15494,7 @@ var ts; var signatures = getSignaturesOfSymbol(symbol); var bodySignature = getSignatureFromDeclaration(bodyDeclaration); if (!bodySignature.hasStringLiterals) { - for (var _a = 0, _b = signatures.length; _a < _b; _a++) { + for (var _a = 0; _a < signatures.length; _a++) { var signature = signatures[_a]; if (!signature.hasStringLiterals && !isSignatureAssignableTo(bodySignature, signature)) { error(signature.declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation); @@ -14657,16 +15540,16 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 197: + case 202: return 2097152; - case 200: + case 205: return d.name.kind === 8 || ts.getModuleInstanceState(d) !== 0 ? 4194304 | 1048576 : 4194304; - case 196: - case 199: + case 201: + case 204: return 2097152 | 1048576; - case 203: + case 208: var result = 0; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result |= getDeclarationSpaces(d); }); @@ -14676,6 +15559,49 @@ var ts; } } } + function checkDecorator(node) { + var expression = node.expression; + var exprType = checkExpression(expression); + switch (node.parent.kind) { + case 201: + var classSymbol = getSymbolOfNode(node.parent); + var classConstructorType = getTypeOfSymbol(classSymbol); + var classDecoratorType = instantiateSingleCallFunctionType(globalClassDecoratorType, [classConstructorType]); + checkTypeAssignableTo(exprType, classDecoratorType, node); + break; + case 132: + checkTypeAssignableTo(exprType, globalPropertyDecoratorType, node); + break; + case 134: + case 136: + case 137: + var methodType = getTypeOfNode(node.parent); + var methodDecoratorType = instantiateSingleCallFunctionType(globalMethodDecoratorType, [methodType]); + checkTypeAssignableTo(exprType, methodDecoratorType, node); + break; + case 129: + checkTypeAssignableTo(exprType, globalParameterDecoratorType, node); + break; + } + } + function checkDecorators(node) { + if (!node.decorators) { + return; + } + switch (node.kind) { + case 201: + case 134: + case 136: + case 137: + case 132: + case 129: + emitDecorate = true; + break; + default: + return; + } + ts.forEach(node.decorators, checkDecorator); + } function checkFunctionDeclaration(node) { if (produceDiagnostics) { checkFunctionLikeDeclaration(node) || @@ -14688,8 +15614,9 @@ var ts; } } function checkFunctionLikeDeclaration(node) { + checkDecorators(node); checkSignatureDeclaration(node); - if (node.name && node.name.kind === 126) { + if (node.name && node.name.kind === 127) { checkComputedPropertyName(node.name); } if (!ts.hasDynamicName(node)) { @@ -14707,18 +15634,18 @@ var ts; } checkSourceElement(node.body); if (node.type && !isAccessor(node.kind)) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); + checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type)); } if (compilerOptions.noImplicitAny && ts.nodeIsMissing(node.body) && !node.type && !isPrivateWithinAmbient(node)) { reportImplicitAnyError(node, anyType); } } function checkBlock(node) { - if (node.kind === 174) { + if (node.kind === 179) { checkGrammarStatementInAmbientContext(node); } ts.forEach(node.statements, checkSourceElement); - if (ts.isFunctionBlock(node) || node.kind === 201) { + if (ts.isFunctionBlock(node) || node.kind === 206) { checkFunctionExpressionBodies(node); } } @@ -14736,19 +15663,19 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 130 || - node.kind === 129 || - node.kind === 132 || + if (node.kind === 132 || node.kind === 131 || node.kind === 134 || - node.kind === 135) { + node.kind === 133 || + node.kind === 136 || + node.kind === 137) { return false; } if (ts.isInAmbientContext(node)) { return false; } var root = getRootDeclaration(node); - if (root.kind === 128 && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 129 && ts.nodeIsMissing(root.parent.body)) { return false; } return true; @@ -14762,8 +15689,8 @@ var ts; var current = node; while (current) { if (getNodeCheckFlags(current) & 4) { - var _isDeclaration = node.kind !== 64; - if (_isDeclaration) { + var isDeclaration_1 = node.kind !== 65; + if (isDeclaration_1) { error(node.name, ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference); } else { @@ -14778,13 +15705,13 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "_super")) { return; } - var enclosingClass = ts.getAncestor(node, 196); + var enclosingClass = ts.getAncestor(node, 201); if (!enclosingClass || ts.isInAmbientContext(enclosingClass)) { return; } - if (ts.getClassBaseTypeNode(enclosingClass)) { - var _isDeclaration = node.kind !== 64; - if (_isDeclaration) { + if (ts.getClassExtendsHeritageClauseElement(enclosingClass)) { + var isDeclaration_2 = node.kind !== 65; + if (isDeclaration_2) { error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); } else { @@ -14796,56 +15723,65 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { return; } - if (node.kind === 200 && ts.getModuleInstanceState(node) !== 1) { + if (node.kind === 205 && ts.getModuleInstanceState(node) !== 1) { return; } - var _parent = getDeclarationContainer(node); - if (_parent.kind === 221 && ts.isExternalModule(_parent)) { + 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)); } } function checkVarDeclaredNamesNotShadowed(node) { - if (node.initializer && (ts.getCombinedNodeFlags(node) & 12288) === 0) { - var symbol = getSymbolOfNode(node); - if (symbol.flags & 1) { - var localDeclarationSymbol = resolveName(node, node.name.text, 3, undefined, undefined); - if (localDeclarationSymbol && - localDeclarationSymbol !== symbol && - localDeclarationSymbol.flags & 2) { - if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 12288) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 194); - var container = varDeclList.parent.kind === 175 && - varDeclList.parent.parent; - var namesShareScope = container && - (container.kind === 174 && ts.isFunctionLike(container.parent) || - (container.kind === 201 && container.kind === 200) || - container.kind === 221); - if (!namesShareScope) { - var _name = symbolToString(localDeclarationSymbol); - error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, _name, _name); - } + // - ScriptBody : StatementList + // It is a Syntax Error if any element of the LexicallyDeclaredNames of StatementList + // also occurs in the VarDeclaredNames of StatementList. + if ((ts.getCombinedNodeFlags(node) & 12288) !== 0 || isParameterDeclaration(node)) { + return; + } + if (node.kind === 198 && !node.initializer) { + return; + } + var symbol = getSymbolOfNode(node); + if (symbol.flags & 1) { + var localDeclarationSymbol = resolveName(node, node.name.text, 3, undefined, undefined); + if (localDeclarationSymbol && + 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 + ? varDeclList.parent.parent + : undefined; + var namesShareScope = container && + (container.kind === 179 && ts.isFunctionLike(container.parent) || + container.kind === 206 || + container.kind === 205 || + container.kind === 227); + 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); } } } } } function isParameterDeclaration(node) { - while (node.kind === 150) { + while (node.kind === 152) { node = node.parent.parent; } - return node.kind === 128; + return node.kind === 129; } function checkParameterInitializer(node) { - if (getRootDeclaration(node).kind !== 128) { + if (getRootDeclaration(node).kind !== 129) { return; } var func = ts.getContainingFunction(node); visit(node.initializer); function visit(n) { - if (n.kind === 64) { + if (n.kind === 65) { var referencedSymbol = getNodeLinks(n).resolvedSymbol; if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(func.locals, referencedSymbol.name, 107455) === referencedSymbol) { - if (referencedSymbol.valueDeclaration.kind === 128) { + if (referencedSymbol.valueDeclaration.kind === 129) { if (referencedSymbol.valueDeclaration === node) { error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.declarationNameToString(node.name)); return; @@ -14863,8 +15799,9 @@ var ts; } } function checkVariableLikeDeclaration(node) { + checkDecorators(node); checkSourceElement(node.type); - if (node.name.kind === 126) { + if (node.name.kind === 127) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); @@ -14873,7 +15810,7 @@ var ts; if (ts.isBindingPattern(node.name)) { ts.forEach(node.name.elements, checkSourceElement); } - if (node.initializer && getRootDeclaration(node).kind === 128 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && getRootDeclaration(node).kind === 129 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } @@ -14901,9 +15838,9 @@ var ts; checkTypeAssignableTo(checkExpressionCached(node.initializer), declarationType, node, undefined); } } - if (node.kind !== 130 && node.kind !== 129) { + if (node.kind !== 132 && node.kind !== 131) { checkExportsOnMergedDeclarations(node); - if (node.kind === 193 || node.kind === 150) { + if (node.kind === 198 || node.kind === 152) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); @@ -14920,7 +15857,7 @@ var ts; return checkVariableLikeDeclaration(node); } function checkVariableStatement(node) { - checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || checkGrammarModifiers(node) || checkGrammarVariableDeclarationList(node.declarationList) || checkGrammarForDisallowedLetOrConstStatement(node); + checkGrammarDecorators(node) || checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || checkGrammarModifiers(node) || checkGrammarVariableDeclarationList(node.declarationList) || checkGrammarForDisallowedLetOrConstStatement(node); ts.forEach(node.declarationList.declarations, checkSourceElement); } function checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) { @@ -14932,7 +15869,7 @@ var ts; } function inBlockOrObjectLiteralExpression(node) { while (node) { - if (node.kind === 174 || node.kind === 152) { + if (node.kind === 179 || node.kind === 154) { return true; } node = node.parent; @@ -14960,12 +15897,12 @@ var ts; } function checkForStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind == 194) { + if (node.initializer && node.initializer.kind == 199) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 194) { + if (node.initializer.kind === 199) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -14980,13 +15917,13 @@ var ts; } function checkForOfStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.initializer.kind === 194) { + if (node.initializer.kind === 199) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression); - if (varExpr.kind === 151 || varExpr.kind === 152) { + if (varExpr.kind === 153 || varExpr.kind === 154) { checkDestructuringAssignment(varExpr, iteratedType || unknownType); } else { @@ -15001,7 +15938,7 @@ var ts; } function checkForInStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.initializer.kind === 194) { + if (node.initializer.kind === 199) { 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); @@ -15011,7 +15948,7 @@ var ts; else { var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 151 || varExpr.kind === 152) { + if (varExpr.kind === 153 || varExpr.kind === 154) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!allConstituentTypesHaveKind(leftType, 1 | 258)) { @@ -15051,6 +15988,31 @@ var ts; } return iteratedType; function getIteratedType(iterable, expressionForError) { + // We want to treat type as an iterable, and get the type it is an iterable of. The iterable + // must have the following structure (annotated with the names of the variables below): + // + // { // iterable + // [Symbol.iterator]: { // iteratorFunction + // (): { // iterator + // next: { // iteratorNextFunction + // (): { // iteratorNextResult + // value: T // iteratorNextValue + // } + // } + // } + // } + // } + // + // T is the type we are after. At every level that involves analyzing return types + // of signatures, we union the return types of all the signatures. + // + // Another thing to note is that at any step of this process, we could run into a dead end, + // meaning either the property is missing, or we run into the anyType. If either of these things + // happens, we return undefined to signal that we could not find the iterated type. If a property + // is missing, and the previous step did not result in 'any', then we also give an error if the + // caller requested it. Then the caller can decide what to do in the case where there is no iterated + // type. This is different from returning anyType, because that would signify that we have matched the + // whole pattern and that T (above) is 'any'. if (allConstituentTypesHaveKind(iterable, 1)) { return undefined; } @@ -15130,7 +16092,7 @@ var ts; checkGrammarStatementInAmbientContext(node) || checkGrammarBreakOrContinueStatement(node); } function isGetAccessorWithAnnotatatedSetAccessor(node) { - return !!(node.kind === 134 && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 135))); + return !!(node.kind === 136 && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 137))); } function checkReturnStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { @@ -15144,11 +16106,11 @@ var ts; if (func) { var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func)); var exprType = checkExpressionCached(node.expression); - if (func.kind === 135) { + if (func.kind === 137) { error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); } else { - if (func.kind === 133) { + if (func.kind === 135) { if (!isTypeAssignableTo(exprType, returnType)) { error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -15175,7 +16137,7 @@ var ts; var hasDuplicateDefaultClause = false; var expressionType = checkExpression(node.expression); ts.forEach(node.caseBlock.clauses, function (clause) { - if (clause.kind === 215 && !hasDuplicateDefaultClause) { + if (clause.kind === 221 && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -15187,7 +16149,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 214) { + if (produceDiagnostics && clause.kind === 220) { var caseClause = clause; var caseType = checkExpression(caseClause.expression); if (!isTypeAssignableTo(expressionType, caseType)) { @@ -15204,7 +16166,7 @@ var ts; if (ts.isFunctionLike(current)) { break; } - if (current.kind === 189 && current.label.text === node.label.text) { + if (current.kind === 194 && 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; @@ -15230,7 +16192,7 @@ var ts; var catchClause = node.catchClause; if (catchClause) { if (catchClause.variableDeclaration) { - if (catchClause.variableDeclaration.name.kind !== 64) { + if (catchClause.variableDeclaration.name.kind !== 65) { grammarErrorOnFirstToken(catchClause.variableDeclaration.name, ts.Diagnostics.Catch_clause_variable_name_must_be_an_identifier); } else if (catchClause.variableDeclaration.type) { @@ -15268,9 +16230,9 @@ var ts; checkIndexConstraintForProperty(prop, propType, type, declaredStringIndexer, stringIndexType, 0); checkIndexConstraintForProperty(prop, propType, type, declaredNumberIndexer, numberIndexType, 1); }); - if (type.flags & 1024 && type.symbol.valueDeclaration.kind === 196) { + if (type.flags & 1024 && type.symbol.valueDeclaration.kind === 201) { var classDeclaration = type.symbol.valueDeclaration; - for (var _i = 0, _a = classDeclaration.members, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = classDeclaration.members; _i < _a.length; _i++) { var member = _a[_i]; if (!(member.flags & 128) && ts.hasDynamicName(member)) { var propType = getTypeOfSymbol(member.symbol); @@ -15298,22 +16260,22 @@ var ts; if (indexKind === 1 && !isNumericName(prop.valueDeclaration.name)) { return; } - var _errorNode; - if (prop.valueDeclaration.name.kind === 126 || prop.parent === containingType.symbol) { - _errorNode = prop.valueDeclaration; + var errorNode; + if (prop.valueDeclaration.name.kind === 127 || prop.parent === containingType.symbol) { + errorNode = prop.valueDeclaration; } else if (indexDeclaration) { - _errorNode = indexDeclaration; + errorNode = indexDeclaration; } else if (containingType.flags & 2048) { var someBaseClassHasBothPropertyAndIndexer = ts.forEach(containingType.baseTypes, function (base) { return getPropertyOfObjectType(base, prop.name) && getIndexTypeOfType(base, indexKind); }); - _errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : containingType.symbol.declarations[0]; + errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : containingType.symbol.declarations[0]; } - if (_errorNode && !isTypeAssignableTo(propertyType, indexType)) { + if (errorNode && !isTypeAssignableTo(propertyType, indexType)) { var errorMessage = indexKind === 0 ? ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_string_index_type_2 : ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2; - error(_errorNode, errorMessage, symbolToString(prop), typeToString(propertyType), typeToString(indexType)); + error(errorNode, errorMessage, symbolToString(prop), typeToString(propertyType), typeToString(indexType)); } } } @@ -15343,8 +16305,17 @@ var ts; } } } + function checkClassExpression(node) { + grammarErrorOnNode(node, ts.Diagnostics.class_expressions_are_not_currently_supported); + ts.forEach(node.members, checkSourceElement); + return unknownType; + } function checkClassDeclaration(node) { + if (node.parent.kind !== 206 && node.parent.kind !== 227) { + grammarErrorOnNode(node, ts.Diagnostics.class_declarations_are_only_supported_directly_inside_a_module_or_as_a_top_level_declaration); + } checkGrammarClassDeclarationHeritageClauses(node); + checkDecorators(node); if (node.name) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Class_name_cannot_be_0); checkCollisionWithCapturedThisVariable(node, node.name); @@ -15355,10 +16326,13 @@ var ts; var symbol = getSymbolOfNode(node); var type = getDeclaredTypeOfSymbol(symbol); var staticType = getTypeOfSymbol(symbol); - var baseTypeNode = ts.getClassBaseTypeNode(node); + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { + if (!ts.isSupportedHeritageClauseElement(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); - checkTypeReference(baseTypeNode); + checkHeritageClauseElement(baseTypeNode); } if (type.baseTypes.length) { if (produceDiagnostics) { @@ -15366,19 +16340,24 @@ var ts; checkTypeAssignableTo(type, baseType, node.name || node, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); var staticBaseType = getTypeOfSymbol(baseType.symbol); checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name || node, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); - if (baseType.symbol !== resolveEntityName(baseTypeNode.typeName, 107455)) { + if (baseType.symbol !== resolveEntityName(baseTypeNode.expression, 107455)) { error(baseTypeNode, ts.Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType)); } checkKindsOfPropertyMemberOverrides(type, baseType); } - checkExpressionOrQualifiedName(baseTypeNode.typeName); } - var implementedTypeNodes = ts.getClassImplementedTypeNodes(node); + if (type.baseTypes.length || (baseTypeNode && compilerOptions.separateCompilation)) { + checkExpressionOrQualifiedName(baseTypeNode.expression); + } + var implementedTypeNodes = ts.getClassImplementsHeritageClauseElements(node); if (implementedTypeNodes) { ts.forEach(implementedTypeNodes, function (typeRefNode) { - checkTypeReference(typeRefNode); + if (!ts.isSupportedHeritageClauseElement(typeRefNode)) { + error(typeRefNode.expression, ts.Diagnostics.A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments); + } + checkHeritageClauseElement(typeRefNode); if (produceDiagnostics) { - var t = getTypeFromTypeReferenceNode(typeRefNode); + var t = getTypeFromHeritageClauseElement(typeRefNode); if (t !== unknownType) { var declaredType = (t.flags & 4096) ? t.target : t; if (declaredType.flags & (1024 | 2048)) { @@ -15401,8 +16380,21 @@ var ts; return s.flags & 16777216 ? getSymbolLinks(s).target : s; } function checkKindsOfPropertyMemberOverrides(type, baseType) { + // TypeScript 1.0 spec (April 2014): 8.2.3 + // A derived class inherits all members from its base class it doesn't override. + // Inheritance means that a derived class implicitly contains all non - overridden members of the base class. + // Both public and private property members are inherited, but only public property members can be overridden. + // A property member in a derived class is said to override a property member in a base class + // when the derived class property member has the same name and kind(instance or static) + // as the base class property member. + // The type of an overriding property member must be assignable(section 3.8.4) + // to the type of the overridden property member, or otherwise a compile - time error occurs. + // Base class instance member functions can be overridden by derived class instance member functions, + // but not by other kinds of members. + // Base class instance member variables and accessors can be overridden by + // derived class instance member variables and accessors, but not by other kinds of members. var baseProperties = getPropertiesOfObjectType(baseType); - for (var _i = 0, _n = baseProperties.length; _i < _n; _i++) { + for (var _i = 0; _i < baseProperties.length; _i++) { var baseProperty = baseProperties[_i]; var base = getTargetSymbol(baseProperty); if (base.flags & 134217728) { @@ -15445,7 +16437,7 @@ var ts; } } function isAccessor(kind) { - return kind === 134 || kind === 135; + return kind === 136 || kind === 137; } function areTypeParametersIdentical(list1, list2) { if (!list1 && !list2) { @@ -15466,7 +16458,7 @@ var ts; if (!tp1.constraint || !tp2.constraint) { return false; } - if (!isTypeIdenticalTo(getTypeFromTypeNode(tp1.constraint), getTypeFromTypeNode(tp2.constraint))) { + if (!isTypeIdenticalTo(getTypeFromTypeNodeOrHeritageClauseElement(tp1.constraint), getTypeFromTypeNodeOrHeritageClauseElement(tp2.constraint))) { return false; } } @@ -15479,10 +16471,10 @@ var ts; var seen = {}; ts.forEach(type.declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; }); var ok = true; - for (var _i = 0, _a = type.baseTypes, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = type.baseTypes; _i < _a.length; _i++) { var base = _a[_i]; var properties = getPropertiesOfObjectType(base); - for (var _b = 0, _c = properties.length; _b < _c; _b++) { + for (var _b = 0; _b < properties.length; _b++) { var prop = properties[_b]; if (!ts.hasProperty(seen, prop.name)) { seen[prop.name] = { prop: prop, containingType: base }; @@ -15504,13 +16496,13 @@ var ts; return ok; } function checkInterfaceDeclaration(node) { - checkGrammarModifiers(node) || checkGrammarInterfaceDeclaration(node); + checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarInterfaceDeclaration(node); checkTypeParameters(node.typeParameters); if (produceDiagnostics) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 197); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 202); 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); @@ -15526,32 +16518,37 @@ var ts; } } } - ts.forEach(ts.getInterfaceBaseTypeNodes(node), checkTypeReference); + ts.forEach(ts.getInterfaceBaseTypeNodes(node), function (heritageElement) { + if (!ts.isSupportedHeritageClauseElement(heritageElement)) { + error(heritageElement.expression, ts.Diagnostics.An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments); + } + checkHeritageClauseElement(heritageElement); + }); ts.forEach(node.members, checkSourceElement); if (produceDiagnostics) { checkTypeForDuplicateIndexSignatures(node); } } function checkTypeAliasDeclaration(node) { - checkGrammarModifiers(node); + checkGrammarDecorators(node) || checkGrammarModifiers(node); checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_alias_name_cannot_be_0); checkSourceElement(node.type); } function computeEnumMemberValues(node) { - var _nodeLinks = getNodeLinks(node); - if (!(_nodeLinks.flags & 128)) { + var nodeLinks = getNodeLinks(node); + if (!(nodeLinks.flags & 128)) { var enumSymbol = getSymbolOfNode(node); var enumType = getDeclaredTypeOfSymbol(enumSymbol); var autoValue = 0; var ambient = ts.isInAmbientContext(node); var enumIsConst = ts.isConst(node); ts.forEach(node.members, function (member) { - if (member.name.kind !== 126 && isNumericLiteralName(member.name.text)) { + if (member.name.kind !== 127 && isNumericLiteralName(member.name.text)) { error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name); } var initializer = member.initializer; if (initializer) { - autoValue = getConstantValueForEnumMemberInitializer(initializer, enumIsConst); + autoValue = getConstantValueForEnumMemberInitializer(initializer); if (autoValue === undefined) { if (enumIsConst) { error(initializer, ts.Diagnostics.In_const_enum_declarations_member_initializer_must_be_constant_expression); @@ -15576,13 +16573,13 @@ var ts; getNodeLinks(member).enumMemberValue = autoValue++; } }); - _nodeLinks.flags |= 128; + nodeLinks.flags |= 128; } - function getConstantValueForEnumMemberInitializer(initializer, enumIsConst) { + function getConstantValueForEnumMemberInitializer(initializer) { return evalConstant(initializer); function evalConstant(e) { switch (e.kind) { - case 165: + case 167: var value = evalConstant(e.operand); if (value === undefined) { return undefined; @@ -15590,13 +16587,10 @@ var ts; switch (e.operator) { case 33: return value; case 34: return -value; - case 47: return enumIsConst ? ~value : undefined; + case 47: return ~value; } return undefined; - case 167: - if (!enumIsConst) { - return undefined; - } + case 169: var left = evalConstant(e.left); if (left === undefined) { return undefined; @@ -15621,43 +16615,54 @@ var ts; return undefined; case 7: return +e.text; - case 159: - return enumIsConst ? evalConstant(e.expression) : undefined; - case 64: - case 154: - case 153: - if (!enumIsConst) { - return undefined; - } + case 161: + return evalConstant(e.expression); + case 65: + case 156: + case 155: var member = initializer.parent; var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); - var _enumType; + var enumType; var propertyName; - if (e.kind === 64) { - _enumType = currentType; + if (e.kind === 65) { + enumType = currentType; propertyName = e.text; } else { - if (e.kind === 154) { + var expression; + if (e.kind === 156) { if (e.argumentExpression === undefined || e.argumentExpression.kind !== 8) { return undefined; } - _enumType = getTypeOfNode(e.expression); + expression = e.expression; propertyName = e.argumentExpression.text; } else { - _enumType = getTypeOfNode(e.expression); + expression = e.expression; propertyName = e.name.text; } - if (_enumType !== currentType) { + var current = expression; + while (current) { + if (current.kind === 65) { + break; + } + else if (current.kind === 155) { + current = current.expression; + } + else { + return undefined; + } + } + enumType = checkExpression(expression); + if (!(enumType.symbol && (enumType.symbol.flags & 384))) { return undefined; } } if (propertyName === undefined) { return undefined; } - var property = getPropertyOfObjectType(_enumType, propertyName); + var property = getPropertyOfObjectType(enumType, propertyName); if (!property || !(property.flags & 8)) { return undefined; } @@ -15677,17 +16682,20 @@ var ts; if (!produceDiagnostics) { return; } - checkGrammarModifiers(node) || checkGrammarEnumDeclaration(node); + checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarEnumDeclaration(node); checkTypeNameIsReserved(node.name, ts.Diagnostics.Enum_name_cannot_be_0); checkCollisionWithCapturedThisVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); computeEnumMemberValues(node); + var enumIsConst = ts.isConst(node); + if (compilerOptions.separateCompilation && enumIsConst && ts.isInAmbientContext(node)) { + error(node.name, ts.Diagnostics.Ambient_const_enums_are_not_allowed_when_the_separateCompilation_flag_is_provided); + } var enumSymbol = getSymbolOfNode(node); var firstDeclaration = ts.getDeclarationOfKind(enumSymbol, node.kind); if (node === firstDeclaration) { if (enumSymbol.declarations.length > 1) { - var enumIsConst = ts.isConst(node); ts.forEach(enumSymbol.declarations, function (decl) { if (ts.isConstEnumDeclaration(decl) !== enumIsConst) { error(decl.name, ts.Diagnostics.Enum_declarations_must_all_be_const_or_non_const); @@ -15696,7 +16704,7 @@ var ts; } var seenEnumMissingInitialInitializer = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 199) { + if (declaration.kind !== 204) { return false; } var enumDeclaration = declaration; @@ -15717,9 +16725,9 @@ var ts; } function getFirstNonAmbientClassOrFunctionDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; - if ((declaration.kind === 196 || (declaration.kind === 195 && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { + if ((declaration.kind === 201 || (declaration.kind === 200 && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { return declaration; } } @@ -15727,7 +16735,7 @@ var ts; } function checkModuleDeclaration(node) { if (produceDiagnostics) { - if (!checkGrammarModifiers(node)) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node)) { if (!ts.isInAmbientContext(node) && node.name.kind === 8) { grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names); } @@ -15739,7 +16747,7 @@ var ts; if (symbol.flags & 512 && symbol.declarations.length > 1 && !ts.isInAmbientContext(node) - && ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums)) { + && ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation)) { var classOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (classOrFunc) { if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(classOrFunc)) { @@ -15762,20 +16770,29 @@ var ts; checkSourceElement(node.body); } function getFirstIdentifier(node) { - while (node.kind === 125) { - node = node.left; + while (true) { + if (node.kind === 126) { + node = node.left; + } + else if (node.kind === 155) { + node = node.expression; + } + else { + break; + } } + ts.Debug.assert(node.kind === 65); return node; } function checkExternalImportOrExportDeclaration(node) { var moduleName = ts.getExternalModuleName(node); - if (ts.getFullWidth(moduleName) !== 0 && moduleName.kind !== 8) { + if (!ts.nodeIsMissing(moduleName) && moduleName.kind !== 8) { error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 201 && node.parent.parent.name.kind === 8; - if (node.parent.kind !== 221 && !inAmbientExternalModule) { - error(moduleName, node.kind === 210 ? + 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); return false; @@ -15794,7 +16811,7 @@ var ts; (symbol.flags & 793056 ? 793056 : 0) | (symbol.flags & 1536 ? 1536 : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 212 ? + var message = node.kind === 217 ? 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)); @@ -15807,7 +16824,7 @@ var ts; checkAliasSymbol(node); } function checkImportDeclaration(node) { - if (!checkGrammarModifiers(node) && (node.flags & 499)) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_import_declaration_cannot_have_modifiers); } if (checkExternalImportOrExportDeclaration(node)) { @@ -15817,7 +16834,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 206) { + if (importClause.namedBindings.kind === 211) { checkImportBinding(importClause.namedBindings); } else { @@ -15828,7 +16845,7 @@ var ts; } } function checkImportEqualsDeclaration(node) { - checkGrammarModifiers(node); + checkGrammarDecorators(node) || checkGrammarModifiers(node); if (ts.isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) { checkImportBinding(node); if (node.flags & 1) { @@ -15848,15 +16865,30 @@ var ts; } } } + else { + if (languageVersion >= 2) { + grammarErrorOnNode(node, ts.Diagnostics.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); + } + } } } function checkExportDeclaration(node) { - if (!checkGrammarModifiers(node) && (node.flags & 499)) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_declaration_cannot_have_modifiers); } 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); + } + } + 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)); + } } } } @@ -15867,67 +16899,58 @@ var ts; } } function checkExportAssignment(node) { - var container = node.parent.kind === 221 ? node.parent : node.parent.parent; - if (container.kind === 200 && container.name.kind === 64) { + 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); return; } - if (!checkGrammarModifiers(node) && (node.flags & 499)) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_assignment_cannot_have_modifiers); } - if (node.expression.kind === 64) { - markExportAsReferenced(node); + if (node.expression) { + if (node.expression.kind === 65) { + markExportAsReferenced(node); + } + else { + checkExpressionCached(node.expression); + } } - else { - checkExpressionCached(node.expression); + if (node.type) { + checkSourceElement(node.type); + if (!ts.isInAmbientContext(node)) { + grammarErrorOnFirstToken(node.type, ts.Diagnostics.A_type_annotation_on_an_export_statement_is_only_allowed_in_an_ambient_external_module_declaration); + } } 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); + } } function getModuleStatements(node) { - if (node.kind === 221) { + if (node.kind === 227) { return node.statements; } - if (node.kind === 200 && node.body.kind === 201) { + if (node.kind === 205 && node.body.kind === 206) { return node.body.statements; } return emptyArray; } function hasExportedMembers(moduleSymbol) { - var declarations = moduleSymbol.declarations; - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { - var current = declarations[_i]; - var statements = getModuleStatements(current); - for (var _a = 0, _b = statements.length; _a < _b; _a++) { - var node = statements[_a]; - if (node.kind === 210) { - var exportClause = node.exportClause; - if (!exportClause) { - return true; - } - var specifiers = exportClause.elements; - for (var _c = 0, _d = specifiers.length; _c < _d; _c++) { - var specifier = specifiers[_c]; - if (!(specifier.propertyName && specifier.name && specifier.name.text === "default")) { - return true; - } - } - } - else if (node.kind !== 209 && node.flags & 1 && !(node.flags & 256)) { - return true; - } + for (var id in moduleSymbol.exports) { + if (id !== "export=") { + return true; } } + return false; } function checkExternalModuleExports(node) { var moduleSymbol = getSymbolOfNode(node); var links = getSymbolLinks(moduleSymbol); if (!links.exportsChecked) { - var defaultSymbol = getExportAssignmentSymbol(moduleSymbol); - if (defaultSymbol) { - if (hasExportedMembers(moduleSymbol)) { - var declaration = getDeclarationOfAliasSymbol(defaultSymbol) || defaultSymbol.valueDeclaration; - error(declaration, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); - } + var exportEqualsSymbol = moduleSymbol.exports["export="]; + if (exportEqualsSymbol && hasExportedMembers(moduleSymbol)) { + var declaration = getDeclarationOfAliasSymbol(exportEqualsSymbol) || exportEqualsSymbol.valueDeclaration; + error(declaration, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); } links.exportsChecked = true; } @@ -15936,185 +16959,187 @@ var ts; if (!node) return; switch (node.kind) { - case 127: - return checkTypeParameter(node); case 128: - return checkParameter(node); - case 130: + return checkTypeParameter(node); case 129: - return checkPropertyDeclaration(node); - case 140: - case 141: - case 136: - case 137: - return checkSignatureDeclaration(node); - case 138: - return checkSignatureDeclaration(node); + return checkParameter(node); case 132: case 131: - return checkMethodDeclaration(node); - case 133: - return checkConstructorDeclaration(node); - case 134: - case 135: - return checkAccessorDeclaration(node); - case 139: - return checkTypeReference(node); + return checkPropertyDeclaration(node); case 142: - return checkTypeQuery(node); case 143: - return checkTypeLiteral(node); + case 138: + 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 checkTypeReferenceNode(node); case 144: - return checkArrayType(node); + return checkTypeQuery(node); case 145: - return checkTupleType(node); + return checkTypeLiteral(node); case 146: - return checkUnionType(node); + return checkArrayType(node); case 147: + return checkTupleType(node); + case 148: + return checkUnionType(node); + case 149: return checkSourceElement(node.type); - case 195: - return checkFunctionDeclaration(node); - case 174: - case 201: - return checkBlock(node); - case 175: - return checkVariableStatement(node); - case 177: - return checkExpressionStatement(node); - case 178: - return checkIfStatement(node); - case 179: - return checkDoStatement(node); - case 180: - return checkWhileStatement(node); - case 181: - return checkForStatement(node); - case 182: - return checkForInStatement(node); - case 183: - return checkForOfStatement(node); - case 184: - case 185: - return checkBreakOrContinueStatement(node); - case 186: - return checkReturnStatement(node); - case 187: - return checkWithStatement(node); - case 188: - return checkSwitchStatement(node); - case 189: - return checkLabeledStatement(node); - case 190: - return checkThrowStatement(node); - case 191: - return checkTryStatement(node); - case 193: - return checkVariableDeclaration(node); - case 150: - return checkBindingElement(node); - case 196: - return checkClassDeclaration(node); - case 197: - return checkInterfaceDeclaration(node); - case 198: - return checkTypeAliasDeclaration(node); - case 199: - return checkEnumDeclaration(node); case 200: - return checkModuleDeclaration(node); - case 204: - return checkImportDeclaration(node); - case 203: - return checkImportEqualsDeclaration(node); - case 210: - return checkExportDeclaration(node); - case 209: - return checkExportAssignment(node); - case 176: - checkGrammarStatementInAmbientContext(node); - return; + 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); + case 181: checkGrammarStatementInAmbientContext(node); return; + case 197: + checkGrammarStatementInAmbientContext(node); + return; + case 218: + return checkMissingDeclaration(node); } } function checkFunctionExpressionBodies(node) { switch (node.kind) { - case 160: - case 161: + case 162: + case 163: ts.forEach(node.parameters, checkFunctionExpressionBodies); checkFunctionExpressionOrObjectLiteralMethodBody(node); break; - case 132: - case 131: + case 134: + case 133: ts.forEach(node.parameters, checkFunctionExpressionBodies); if (ts.isObjectLiteralMethod(node)) { checkFunctionExpressionOrObjectLiteralMethodBody(node); } break; - case 133: - case 134: case 135: - case 195: + case 136: + case 137: + case 200: ts.forEach(node.parameters, checkFunctionExpressionBodies); break; - case 187: + case 192: checkFunctionExpressionBodies(node.expression); break; - case 128: - case 130: case 129: - case 148: - case 149: + case 132: + case 131: case 150: case 151: case 152: - case 218: case 153: case 154: + case 224: case 155: case 156: case 157: - case 169: - case 173: case 158: case 159: - case 163: - case 164: - case 162: + case 171: + case 176: + case 160: + case 161: case 165: case 166: + case 164: case 167: case 168: - case 171: - case 174: - case 201: - case 175: - case 177: - case 178: + case 169: + case 170: + case 173: case 179: + case 206: case 180: - case 181: case 182: case 183: case 184: case 185: case 186: + case 187: case 188: - case 202: - case 214: - case 215: case 189: case 190: case 191: - case 217: case 193: - case 194: - case 196: - case 199: + case 207: case 220: - case 209: case 221: + case 194: + case 195: + case 196: + case 223: + case 198: + case 199: + case 201: + case 204: + case 226: + case 214: + case 227: ts.forEachChild(node, checkFunctionExpressionBodies); break; } @@ -16142,6 +17167,9 @@ var ts; if (emitExtends) { links.flags |= 8; } + if (emitDecorate) { + links.flags |= 512; + } links.flags |= 1; } } @@ -16166,7 +17194,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 187 && node.parent.statement === node) { + if (node.parent.kind === 192 && node.parent.statement === node) { return true; } node = node.parent; @@ -16177,6 +17205,44 @@ var ts; function getSymbolsInScope(location, meaning) { var symbols = {}; var memberFlags = 0; + if (isInsideWithStatementBody(location)) { + return []; + } + populateSymbols(); + return symbolsToArray(symbols); + function populateSymbols() { + while (location) { + if (location.locals && !isGlobalSourceFile(location)) { + copySymbols(location.locals, meaning); + } + switch (location.kind) { + case 227: + if (!ts.isExternalModule(location)) { + break; + } + case 205: + copySymbols(getSymbolOfNode(location).exports, meaning & 8914931); + break; + case 204: + copySymbols(getSymbolOfNode(location).exports, meaning & 8); + break; + case 201: + case 202: + if (!(memberFlags & 128)) { + copySymbols(getSymbolOfNode(location).members, meaning & 793056); + } + break; + case 162: + if (location.name) { + copySymbol(location.symbol, meaning); + } + break; + } + memberFlags = location.flags; + location = location.parent; + } + copySymbols(globals, meaning); + } function copySymbol(symbol, meaning) { if (symbol.flags & meaning) { var id = symbol.name; @@ -16202,22 +17268,22 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 221: + case 227: if (!ts.isExternalModule(location)) break; - case 200: + case 205: copySymbols(getSymbolOfNode(location).exports, meaning & 8914931); break; - case 199: + case 204: copySymbols(getSymbolOfNode(location).exports, meaning & 8); break; - case 196: - case 197: + case 201: + case 202: if (!(memberFlags & 128)) { copySymbols(getSymbolOfNode(location).members, meaning & 793056); } break; - case 160: + case 162: if (location.name) { copySymbol(location.symbol, meaning); } @@ -16227,97 +17293,113 @@ var ts; location = location.parent; } copySymbols(globals, meaning); - return ts.mapToArray(symbols); + return symbolsToArray(symbols); } function isTypeDeclarationName(name) { - return name.kind == 64 && + return name.kind == 65 && isTypeDeclaration(name.parent) && name.parent.name === name; } function isTypeDeclaration(node) { switch (node.kind) { - case 127: - case 196: - case 197: - case 198: - case 199: + case 128: + case 201: + case 202: + case 203: + case 204: return true; } } function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 125) + while (node.parent && node.parent.kind === 126) { node = node.parent; - return node.parent && node.parent.kind === 139; + } + return node.parent && node.parent.kind === 141; } - function isTypeNode(node) { - if (139 <= node.kind && node.kind <= 147) { + function isHeritageClauseElementIdentifier(entityName) { + var node = entityName; + while (node.parent && node.parent.kind === 155) { + node = node.parent; + } + return node.parent && node.parent.kind === 177; + } + function isTypeNodeOrHeritageClauseElement(node) { + if (141 <= node.kind && node.kind <= 149) { return true; } switch (node.kind) { - case 111: - case 118: - case 120: case 112: + case 119: case 121: + case 113: + case 122: return true; - case 98: - return node.parent.kind !== 164; + case 99: + return node.parent.kind !== 166; case 8: - return node.parent.kind === 128; - case 64: - if (node.parent.kind === 125 && node.parent.right === node) { + return node.parent.kind === 129; + case 177: + return true; + case 65: + if (node.parent.kind === 126 && node.parent.right === node) { node = node.parent; } - case 125: - ts.Debug.assert(node.kind === 64 || node.kind === 125, "'node' was expected to be a qualified name or identifier in 'isTypeNode'."); - var _parent = node.parent; - if (_parent.kind === 142) { + else if (node.parent.kind === 155 && 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'."); + var parent_5 = node.parent; + if (parent_5.kind === 144) { return false; } - if (139 <= _parent.kind && _parent.kind <= 147) { + if (141 <= parent_5.kind && parent_5.kind <= 149) { return true; } - switch (_parent.kind) { - case 127: - return node === _parent.constraint; - case 130: - case 129: + switch (parent_5.kind) { + case 177: + return true; case 128: - case 193: - return node === _parent.type; - case 195: - case 160: - case 161: - case 133: + return node === parent_5.constraint; case 132: case 131: - case 134: + case 129: + case 198: + return node === parent_5.type; + case 200: + case 162: + case 163: case 135: - return node === _parent.type; + case 134: + case 133: case 136: case 137: + return node === parent_5.type; case 138: - return node === _parent.type; - case 158: - return node === _parent.type; - case 155: - case 156: - return _parent.typeArguments && ts.indexOf(_parent.typeArguments, node) >= 0; + case 139: + case 140: + return node === parent_5.type; + case 160: + return node === parent_5.type; case 157: + case 158: + return parent_5.typeArguments && ts.indexOf(parent_5.typeArguments, node) >= 0; + case 159: return false; } } return false; } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 125) { + while (nodeOnRightSide.parent.kind === 126) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 203) { + if (nodeOnRightSide.parent.kind === 208) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 209) { + if (nodeOnRightSide.parent.kind === 214) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -16325,52 +17407,53 @@ var ts; function isInRightSideOfImportOrExportAssignment(node) { return getLeftSideOfImportEqualsOrExportAssignment(node) !== undefined; } - function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 125 && node.parent.right === node) || - (node.parent.kind === 153 && node.parent.name === node); - } function getSymbolOfEntityNameOrPropertyAccessExpression(entityName) { if (ts.isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 209) { + if (entityName.parent.kind === 214) { return resolveEntityName(entityName, 107455 | 793056 | 1536 | 8388608); } - if (entityName.kind !== 153) { + if (entityName.kind !== 155) { if (isInRightSideOfImportOrExportAssignment(entityName)) { return getSymbolOfPartOfRightHandSideOfImportEquals(entityName); } } - if (isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { + if (ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (ts.isExpression(entityName)) { - if (ts.getFullWidth(entityName) === 0) { + if (isHeritageClauseElementIdentifier(entityName)) { + var meaning = entityName.parent.kind === 177 ? 793056 : 1536; + meaning |= 8388608; + return resolveEntityName(entityName, meaning); + } + else if (ts.isExpression(entityName)) { + if (ts.nodeIsMissing(entityName)) { return undefined; } - if (entityName.kind === 64) { + if (entityName.kind === 65) { var meaning = 107455 | 8388608; return resolveEntityName(entityName, meaning); } - else if (entityName.kind === 153) { + else if (entityName.kind === 155) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccessExpression(entityName); } return getNodeLinks(entityName).resolvedSymbol; } - else if (entityName.kind === 125) { - var _symbol = getNodeLinks(entityName).resolvedSymbol; - if (!_symbol) { + else if (entityName.kind === 126) { + var symbol = getNodeLinks(entityName).resolvedSymbol; + if (!symbol) { checkQualifiedName(entityName); } return getNodeLinks(entityName).resolvedSymbol; } } else if (isTypeReferenceIdentifier(entityName)) { - var _meaning = entityName.parent.kind === 139 ? 793056 : 1536; - _meaning |= 8388608; - return resolveEntityName(entityName, _meaning); + var meaning = entityName.parent.kind === 141 ? 793056 : 1536; + meaning |= 8388608; + return resolveEntityName(entityName, meaning); } return undefined; } @@ -16381,23 +17464,23 @@ var ts; if (ts.isDeclarationName(node)) { return getSymbolOfNode(node.parent); } - if (node.kind === 64 && isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 209 + if (node.kind === 65 && isInRightSideOfImportOrExportAssignment(node)) { + return node.parent.kind === 214 ? getSymbolOfEntityNameOrPropertyAccessExpression(node) : getSymbolOfPartOfRightHandSideOfImportEquals(node); } switch (node.kind) { - case 64: - case 153: - case 125: + case 65: + case 155: + case 126: return getSymbolOfEntityNameOrPropertyAccessExpression(node); - case 92: - case 90: + case 93: + case 91: var type = checkExpression(node); return type.symbol; - case 113: + case 114: var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 133) { + if (constructorDeclaration && constructorDeclaration.kind === 135) { return constructorDeclaration.parent.symbol; } return undefined; @@ -16405,12 +17488,12 @@ var ts; var moduleName; if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 204 || node.parent.kind === 210) && + ((node.parent.kind === 209 || node.parent.kind === 215) && node.parent.moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } case 7: - if (node.parent.kind == 154 && node.parent.argumentExpression === node) { + if (node.parent.kind == 156 && node.parent.argumentExpression === node) { var objectType = checkExpression(node.parent.expression); if (objectType === unknownType) return undefined; @@ -16424,7 +17507,7 @@ var ts; return undefined; } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 219) { + if (location && location.kind === 225) { return resolveEntityName(location.name, 107455); } return undefined; @@ -16433,37 +17516,37 @@ var ts; if (isInsideWithStatementBody(node)) { return unknownType; } + if (isTypeNodeOrHeritageClauseElement(node)) { + return getTypeFromTypeNodeOrHeritageClauseElement(node); + } if (ts.isExpression(node)) { return getTypeOfExpression(node); } - if (isTypeNode(node)) { - return getTypeFromTypeNode(node); - } if (isTypeDeclaration(node)) { var symbol = getSymbolOfNode(node); return getDeclaredTypeOfSymbol(symbol); } if (isTypeDeclarationName(node)) { - var _symbol = getSymbolInfo(node); - return _symbol && getDeclaredTypeOfSymbol(_symbol); + var symbol = getSymbolInfo(node); + return symbol && getDeclaredTypeOfSymbol(symbol); } if (ts.isDeclaration(node)) { - var _symbol_1 = getSymbolOfNode(node); - return getTypeOfSymbol(_symbol_1); + var symbol = getSymbolOfNode(node); + return getTypeOfSymbol(symbol); } if (ts.isDeclarationName(node)) { - var _symbol_2 = getSymbolInfo(node); - return _symbol_2 && getTypeOfSymbol(_symbol_2); + var symbol = getSymbolInfo(node); + return symbol && getTypeOfSymbol(symbol); } if (isInRightSideOfImportOrExportAssignment(node)) { - var _symbol_3 = getSymbolInfo(node); - var declaredType = _symbol_3 && getDeclaredTypeOfSymbol(_symbol_3); - return declaredType !== unknownType ? declaredType : getTypeOfSymbol(_symbol_3); + var symbol = getSymbolInfo(node); + var declaredType = symbol && getDeclaredTypeOfSymbol(symbol); + return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); } return unknownType; } function getTypeOfExpression(expr) { - if (isRightSideOfQualifiedNameOrPropertyAccess(expr)) { + if (ts.isRightSideOfQualifiedNameOrPropertyAccess(expr)) { expr = expr.parent; } return checkExpression(expr); @@ -16483,9 +17566,9 @@ var ts; function getRootSymbols(symbol) { if (symbol.flags & 268435456) { var symbols = []; - var _name = symbol.name; + var name_10 = symbol.name; ts.forEach(getSymbolLinks(symbol).unionType.types, function (t) { - symbols.push(getPropertyOfType(t, _name)); + symbols.push(getPropertyOfType(t, name_10)); }); return symbols; } @@ -16498,179 +17581,99 @@ var ts; return [symbol]; } function isExternalModuleSymbol(symbol) { - return symbol.flags & 512 && symbol.declarations.length === 1 && symbol.declarations[0].kind === 221; + return symbol.flags & 512 && symbol.declarations.length === 1 && symbol.declarations[0].kind === 227; } - function isNodeDescendentOf(node, ancestor) { - while (node) { - if (node === ancestor) - return true; - node = node.parent; + function getAliasNameSubstitution(symbol, getGeneratedNameForNode) { + if (languageVersion >= 2) { + return undefined; } - return false; - } - function isUniqueLocalName(name, container) { - for (var node = container; isNodeDescendentOf(node, container); node = node.nextContainer) { - if (node.locals && ts.hasProperty(node.locals, name)) { - if (node.locals[name].flags & (107455 | 1048576 | 8388608)) { - return false; - } + var node = getDeclarationOfAliasSymbol(symbol); + if (node) { + if (node.kind === 210) { + return getGeneratedNameForNode(node.parent) + ".default"; } - } - return true; - } - function getGeneratedNamesForSourceFile(sourceFile) { - var links = getNodeLinks(sourceFile); - var generatedNames = links.generatedNames; - if (!generatedNames) { - generatedNames = links.generatedNames = {}; - generateNames(sourceFile); - } - return generatedNames; - function generateNames(node) { - switch (node.kind) { - case 195: - case 196: - generateNameForFunctionOrClassDeclaration(node); - break; - case 200: - generateNameForModuleOrEnum(node); - generateNames(node.body); - break; - case 199: - generateNameForModuleOrEnum(node); - break; - case 204: - generateNameForImportDeclaration(node); - break; - case 210: - generateNameForExportDeclaration(node); - break; - case 209: - generateNameForExportAssignment(node); - break; - case 221: - case 201: - ts.forEach(node.statements, generateNames); - break; - } - } - function isExistingName(name) { - return ts.hasProperty(globals, name) || ts.hasProperty(sourceFile.identifiers, name) || ts.hasProperty(generatedNames, name); - } - function makeUniqueName(baseName) { - var _name = ts.generateUniqueName(baseName, isExistingName); - return generatedNames[_name] = _name; - } - function assignGeneratedName(node, name) { - getNodeLinks(node).generatedName = ts.unescapeIdentifier(name); - } - function generateNameForFunctionOrClassDeclaration(node) { - if (!node.name) { - assignGeneratedName(node, makeUniqueName("default")); - } - } - function generateNameForModuleOrEnum(node) { - if (node.name.kind === 64) { - var _name = node.name.text; - assignGeneratedName(node, isUniqueLocalName(_name, node) ? _name : makeUniqueName(_name)); - } - } - function generateNameForImportOrExportDeclaration(node) { - var expr = ts.getExternalModuleName(node); - var baseName = expr.kind === 8 ? - ts.escapeIdentifier(ts.makeIdentifierFromModuleName(expr.text)) : "module"; - assignGeneratedName(node, makeUniqueName(baseName)); - } - function generateNameForImportDeclaration(node) { - if (node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 207) { - generateNameForImportOrExportDeclaration(node); - } - } - function generateNameForExportDeclaration(node) { - if (node.moduleSpecifier) { - generateNameForImportOrExportDeclaration(node); - } - } - function generateNameForExportAssignment(node) { - if (node.expression.kind !== 64) { - assignGeneratedName(node, makeUniqueName("default")); + if (node.kind === 213) { + var moduleName = getGeneratedNameForNode(node.parent.parent.parent); + var propertyName = node.propertyName || node.name; + return moduleName + "." + ts.unescapeIdentifier(propertyName.text); } } } - function getGeneratedNameForNode(node) { - var links = getNodeLinks(node); - if (!links.generatedName) { - getGeneratedNamesForSourceFile(getSourceFile(node)); - } - return links.generatedName; - } - function getLocalNameOfContainer(container) { - return getGeneratedNameForNode(container); - } - function getLocalNameForImportDeclaration(node) { - return getGeneratedNameForNode(node); - } - function getAliasNameSubstitution(symbol) { - var declaration = getDeclarationOfAliasSymbol(symbol); - if (declaration && declaration.kind === 208) { - var moduleName = getGeneratedNameForNode(declaration.parent.parent.parent); - var propertyName = declaration.propertyName || declaration.name; - return moduleName + "." + ts.unescapeIdentifier(propertyName.text); - } - } - function getExportNameSubstitution(symbol, location) { + function getExportNameSubstitution(symbol, location, getGeneratedNameForNode) { if (isExternalModuleSymbol(symbol.parent)) { + if (languageVersion >= 2) { + return undefined; + } return "exports." + ts.unescapeIdentifier(symbol.name); } var node = location; var containerSymbol = getParentOfSymbol(symbol); while (node) { - if ((node.kind === 200 || node.kind === 199) && getSymbolOfNode(node) === containerSymbol) { + if ((node.kind === 205 || node.kind === 204) && getSymbolOfNode(node) === containerSymbol) { return getGeneratedNameForNode(node) + "." + ts.unescapeIdentifier(symbol.name); } node = node.parent; } } - function getExpressionNameSubstitution(node) { - var symbol = getNodeLinks(node).resolvedSymbol; + function getExpressionNameSubstitution(node, getGeneratedNameForNode) { + var symbol = getNodeLinks(node).resolvedSymbol || (ts.isDeclarationName(node) ? getSymbolOfNode(node.parent) : undefined); if (symbol) { if (symbol.parent) { - return getExportNameSubstitution(symbol, node.parent); + return getExportNameSubstitution(symbol, node.parent, getGeneratedNameForNode); } var exportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); if (symbol !== exportSymbol && !(exportSymbol.flags & 944)) { - return getExportNameSubstitution(exportSymbol, node.parent); + return getExportNameSubstitution(exportSymbol, node.parent, getGeneratedNameForNode); } if (symbol.flags & 8388608) { - return getAliasNameSubstitution(symbol); + return getAliasNameSubstitution(symbol, getGeneratedNameForNode); } } } - function hasExportDefaultValue(node) { - var symbol = getResolvedExportAssignmentSymbol(getSymbolOfNode(node)); - return symbol && symbol !== unknownSymbol && symbolIsValue(symbol) && !isConstEnumSymbol(symbol); + function isValueAliasDeclaration(node) { + switch (node.kind) { + case 208: + case 210: + case 211: + case 213: + case 217: + return isAliasResolvedToValue(getSymbolOfNode(node)); + case 215: + var exportClause = node.exportClause; + return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); + case 214: + return node.expression && node.expression.kind === 65 ? isAliasResolvedToValue(getSymbolOfNode(node)) : true; + } + return false; } function isTopLevelValueImportEqualsWithEntityName(node) { - if (node.parent.kind !== 221 || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node.parent.kind !== 227 || !ts.isInternalModuleImportEqualsDeclaration(node)) { return false; } - return isAliasResolvedToValue(getSymbolOfNode(node)); + var isValue = isAliasResolvedToValue(getSymbolOfNode(node)); + return isValue && node.moduleReference && !ts.nodeIsMissing(node.moduleReference); } function isAliasResolvedToValue(symbol) { var target = resolveAlias(symbol); - return target !== unknownSymbol && target.flags & 107455 && !isConstEnumOrConstEnumOnlyModule(target); + if (target === unknownSymbol && compilerOptions.separateCompilation) { + return true; + } + return target !== unknownSymbol && target && target.flags & 107455 && !isConstEnumOrConstEnumOnlyModule(target); } function isConstEnumOrConstEnumOnlyModule(s) { return isConstEnumSymbol(s) || s.constEnumOnlyModule; } - function isReferencedAliasDeclaration(node) { - if (isAliasSymbolDeclaration(node)) { + function isReferencedAliasDeclaration(node, checkChildren) { + if (ts.isAliasSymbolDeclaration(node)) { var symbol = getSymbolOfNode(node); if (getSymbolLinks(symbol).referenced) { return true; } } - return ts.forEachChild(node, isReferencedAliasDeclaration); + if (checkChildren) { + return ts.forEachChild(node, function (node) { return isReferencedAliasDeclaration(node, checkChildren); }); + } + return false; } function isImplementationOfOverload(node) { if (ts.nodeIsPresent(node.body)) { @@ -16689,15 +17692,13 @@ var ts; return getNodeLinks(node).enumMemberValue; } function getConstantValue(node) { - if (node.kind === 220) { + if (node.kind === 226) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; if (symbol && (symbol.flags & 8)) { - var declaration = symbol.valueDeclaration; - var constantValue; - if (declaration.kind === 220) { - return getEnumMemberValue(declaration); + if (ts.isConstEnumDeclaration(symbol.valueDeclaration.parent)) { + return getEnumMemberValue(symbol.valueDeclaration); } } return undefined; @@ -16713,42 +17714,48 @@ var ts; var signature = getSignatureFromDeclaration(signatureDeclaration); getSymbolDisplayBuilder().buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags); } - function isUnknownIdentifier(location, name) { - ts.Debug.assert(!ts.nodeIsSynthesized(location), "isUnknownIdentifier called with a synthesized location"); - return !resolveName(location, name, 107455, undefined, undefined) && - !ts.hasProperty(getGeneratedNamesForSourceFile(getSourceFile(location)), name); + function writeTypeOfExpression(expr, enclosingDeclaration, flags, writer) { + var type = getTypeOfExpression(expr); + getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); + } + function hasGlobalName(name) { + return ts.hasProperty(globals, name); + } + function resolvesToSomeValue(location, name) { + ts.Debug.assert(!ts.nodeIsSynthesized(location), "resolvesToSomeValue called with a synthesized location"); + return !!resolveName(location, name, 107455, undefined, undefined); } function getBlockScopedVariableId(n) { ts.Debug.assert(!ts.nodeIsSynthesized(n)); - if (n.parent.kind === 153 && - n.parent.name === n) { - return undefined; - } - if (n.parent.kind === 150 && - n.parent.propertyName === n) { - return undefined; - } - var declarationSymbol = (n.parent.kind === 193 && n.parent.name === n) || - n.parent.kind === 150 - ? getSymbolOfNode(n.parent) - : undefined; - var symbol = declarationSymbol || + var isVariableDeclarationOrBindingElement = n.parent.kind === 152 || (n.parent.kind === 198 && 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 !== 217; + symbol.valueDeclaration.parent.kind !== 223; if (isLetOrConst) { getSymbolLinks(symbol); return symbol.id; } return undefined; } + function instantiateSingleCallFunctionType(functionType, typeArguments) { + if (functionType === unknownType) { + return unknownType; + } + var signature = getSingleCallSignature(functionType); + if (!signature) { + return unknownType; + } + var instantiatedSignature = getSignatureInstantiation(signature, typeArguments); + return getOrCreateTypeFromSignature(instantiatedSignature); + } function createResolver() { return { - getGeneratedNameForNode: getGeneratedNameForNode, getExpressionNameSubstitution: getExpressionNameSubstitution, - hasExportDefaultValue: hasExportDefaultValue, + isValueAliasDeclaration: isValueAliasDeclaration, + hasGlobalName: hasGlobalName, isReferencedAliasDeclaration: isReferencedAliasDeclaration, getNodeCheckFlags: getNodeCheckFlags, isTopLevelValueImportEqualsWithEntityName: isTopLevelValueImportEqualsWithEntityName, @@ -16756,10 +17763,12 @@ var ts; isImplementationOfOverload: isImplementationOfOverload, writeTypeOfDeclaration: writeTypeOfDeclaration, writeReturnTypeOfSignatureDeclaration: writeReturnTypeOfSignatureDeclaration, + writeTypeOfExpression: writeTypeOfExpression, isSymbolAccessible: isSymbolAccessible, isEntityNameVisible: isEntityNameVisible, getConstantValue: getConstantValue, - isUnknownIdentifier: isUnknownIdentifier, + resolvesToSomeValue: resolvesToSomeValue, + collectLinkedAliases: collectLinkedAliases, getBlockScopedVariableId: getBlockScopedVariableId }; } @@ -16784,6 +17793,11 @@ var ts; globalNumberType = getGlobalType("Number"); globalBooleanType = getGlobalType("Boolean"); globalRegExpType = getGlobalType("RegExp"); + globalTypedPropertyDescriptorType = getTypeOfGlobalSymbol(getGlobalTypeSymbol("TypedPropertyDescriptor"), 1); + globalClassDecoratorType = getGlobalType("ClassDecorator"); + globalPropertyDecoratorType = getGlobalType("PropertyDecorator"); + globalMethodDecoratorType = getGlobalType("MethodDecorator"); + globalParameterDecoratorType = getGlobalType("ParameterDecorator"); if (languageVersion >= 2) { globalTemplateStringsArrayType = getGlobalType("TemplateStringsArray"); globalESSymbolType = getGlobalType("Symbol"); @@ -16797,28 +17811,46 @@ var ts; } anyArrayType = createArrayType(anyType); } + function checkGrammarDecorators(node) { + if (!node.decorators) { + return false; + } + if (!ts.nodeCanBeDecorated(node)) { + return grammarErrorOnNode(node, ts.Diagnostics.Decorators_are_not_valid_here); + } + else if (languageVersion < 1) { + return grammarErrorOnNode(node, ts.Diagnostics.Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher); + } + else if (node.kind === 136 || node.kind === 137) { + var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); + if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { + return grammarErrorOnNode(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); + } + } + return false; + } function checkGrammarModifiers(node) { switch (node.kind) { - case 134: + case 136: + case 137: case 135: - case 133: - case 130: - case 129: case 132: case 131: - case 138: - case 196: - case 197: - case 200: - case 199: - case 175: - case 195: - case 198: + case 134: + case 133: + case 140: + case 201: + case 202: + case 205: case 204: + case 180: + case 200: case 203: - case 210: case 209: - case 128: + case 208: + case 215: + case 214: + case 129: break; default: return false; @@ -16828,17 +17860,17 @@ var ts; } var lastStatic, lastPrivate, lastProtected, lastDeclare; var flags = 0; - for (var _i = 0, _a = node.modifiers, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; switch (modifier.kind) { + case 109: case 108: case 107: - case 106: var text = void 0; - if (modifier.kind === 108) { + if (modifier.kind === 109) { text = "public"; } - else if (modifier.kind === 107) { + else if (modifier.kind === 108) { text = "protected"; lastProtected = modifier; } @@ -16852,50 +17884,50 @@ var ts; else if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); } - else if (node.parent.kind === 201 || node.parent.kind === 221) { + else if (node.parent.kind === 206 || node.parent.kind === 227) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); } flags |= ts.modifierToFlag(modifier.kind); break; - case 109: + case 110: if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static"); } - else if (node.parent.kind === 201 || node.parent.kind === 221) { + else if (node.parent.kind === 206 || node.parent.kind === 227) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); } - else if (node.kind === 128) { + else if (node.kind === 129) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } flags |= 128; lastStatic = modifier; break; - case 77: + case 78: if (flags & 1) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "export"); } else if (flags & 2) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); } - else if (node.parent.kind === 196) { + else if (node.parent.kind === 201) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 128) { + else if (node.kind === 129) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1; break; - case 114: + case 115: if (flags & 2) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); } - else if (node.parent.kind === 196) { + else if (node.parent.kind === 201) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 128) { + else if (node.kind === 129) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 201) { + else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 206) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 2; @@ -16903,7 +17935,7 @@ var ts; break; } } - if (node.kind === 133) { + if (node.kind === 135) { if (flags & 128) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -16914,13 +17946,13 @@ var ts; return grammarErrorOnNode(lastPrivate, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); } } - else if ((node.kind === 204 || node.kind === 203) && flags & 2) { + else if ((node.kind === 209 || node.kind === 208) && flags & 2) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 197 && flags & 2) { + else if (node.kind === 202 && flags & 2) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); } - else if (node.kind === 128 && (flags & 112) && ts.isBindingPattern(node.name)) { + else if (node.kind === 129 && (flags & 112) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_a_binding_pattern); } } @@ -16932,15 +17964,14 @@ var ts; return grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Trailing_comma_not_allowed); } } - function checkGrammarTypeParameterList(node, typeParameters) { + function checkGrammarTypeParameterList(node, typeParameters, file) { if (checkGrammarForDisallowedTrailingComma(typeParameters)) { return true; } if (typeParameters && typeParameters.length === 0) { var start = typeParameters.pos - "<".length; - var sourceFile = ts.getSourceFileOfNode(node); - var end = ts.skipTrivia(sourceFile.text, typeParameters.end) + ">".length; - return grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Type_parameter_list_cannot_be_empty); + var end = ts.skipTrivia(file.text, typeParameters.end) + ">".length; + return grammarErrorAtPos(file, start, end - start, ts.Diagnostics.Type_parameter_list_cannot_be_empty); } } function checkGrammarParameterList(parameters) { @@ -16976,7 +18007,20 @@ var ts; } } function checkGrammarFunctionLikeDeclaration(node) { - return checkGrammarModifiers(node) || checkGrammarTypeParameterList(node, node.typeParameters) || checkGrammarParameterList(node.parameters); + var file = ts.getSourceFileOfNode(node); + return checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarTypeParameterList(node, node.typeParameters, file) || + checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file); + } + function checkGrammarArrowFunction(node, file) { + if (node.kind === 163) { + var arrowFunction = node; + var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; + var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; + if (startLine !== endLine) { + return grammarErrorOnNode(arrowFunction.equalsGreaterThanToken, ts.Diagnostics.Line_terminator_not_permitted_before_arrow); + } + } + return false; } function checkGrammarIndexSignatureParameters(node) { var parameter = node.parameters[0]; @@ -17003,7 +18047,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 !== 120 && parameter.type.kind !== 118) { + if (parameter.type.kind !== 121 && parameter.type.kind !== 119) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); } if (!node.type) { @@ -17016,7 +18060,7 @@ var ts; } } function checkGrammarIndexSignature(node) { - checkGrammarModifiers(node) || checkGrammarIndexSignatureParameters(node) || checkGrammarForIndexSignatureModifier(node); + return checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarIndexSignatureParameters(node) || checkGrammarForIndexSignatureModifier(node); } function checkGrammarForAtLeastOneTypeArgument(node, typeArguments) { if (typeArguments && typeArguments.length === 0) { @@ -17033,9 +18077,9 @@ var ts; function checkGrammarForOmittedArgument(node, arguments) { if (arguments) { var sourceFile = ts.getSourceFileOfNode(node); - for (var _i = 0, _n = arguments.length; _i < _n; _i++) { + for (var _i = 0; _i < arguments.length; _i++) { var arg = arguments[_i]; - if (arg.kind === 172) { + if (arg.kind === 175) { return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -17059,10 +18103,10 @@ var ts; function checkGrammarClassDeclarationHeritageClauses(node) { var seenExtendsClause = false; var seenImplementsClause = false; - if (!checkGrammarModifiers(node) && node.heritageClauses) { - for (var _i = 0, _a = node.heritageClauses, _n = _a.length; _i < _n; _i++) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && node.heritageClauses) { + for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) { var heritageClause = _a[_i]; - if (heritageClause.token === 78) { + if (heritageClause.token === 79) { if (seenExtendsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen); } @@ -17075,7 +18119,7 @@ var ts; seenExtendsClause = true; } else { - ts.Debug.assert(heritageClause.token === 102); + ts.Debug.assert(heritageClause.token === 103); if (seenImplementsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.implements_clause_already_seen); } @@ -17088,16 +18132,16 @@ var ts; function checkGrammarInterfaceDeclaration(node) { var seenExtendsClause = false; if (node.heritageClauses) { - for (var _i = 0, _a = node.heritageClauses, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) { var heritageClause = _a[_i]; - if (heritageClause.token === 78) { + if (heritageClause.token === 79) { if (seenExtendsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen); } seenExtendsClause = true; } else { - ts.Debug.assert(heritageClause.token === 102); + ts.Debug.assert(heritageClause.token === 103); return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.Interface_declaration_cannot_have_implements_clause); } checkGrammarHeritageClause(heritageClause); @@ -17106,11 +18150,11 @@ var ts; return false; } function checkGrammarComputedPropertyName(node) { - if (node.kind !== 126) { + if (node.kind !== 127) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 167 && computedPropertyName.expression.operatorToken.kind === 23) { + if (computedPropertyName.expression.kind === 169 && computedPropertyName.expression.operatorToken.kind === 23) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } @@ -17134,54 +18178,54 @@ var ts; var SetAccesor = 4; var GetOrSetAccessor = GetAccessor | SetAccesor; var inStrictMode = (node.parserContextFlags & 1) !== 0; - for (var _i = 0, _a = node.properties, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - var _name = prop.name; - if (prop.kind === 172 || - _name.kind === 126) { - checkGrammarComputedPropertyName(_name); + var name_11 = prop.name; + if (prop.kind === 175 || + name_11.kind === 127) { + checkGrammarComputedPropertyName(name_11); continue; } var currentKind = void 0; - if (prop.kind === 218 || prop.kind === 219) { + if (prop.kind === 224 || prop.kind === 225) { checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); - if (_name.kind === 7) { - checkGrammarNumbericLiteral(_name); + if (name_11.kind === 7) { + checkGrammarNumbericLiteral(name_11); } currentKind = Property; } - else if (prop.kind === 132) { + else if (prop.kind === 134) { currentKind = Property; } - else if (prop.kind === 134) { + else if (prop.kind === 136) { currentKind = GetAccessor; } - else if (prop.kind === 135) { + else if (prop.kind === 137) { currentKind = SetAccesor; } else { ts.Debug.fail("Unexpected syntax kind:" + prop.kind); } - if (!ts.hasProperty(seen, _name.text)) { - seen[_name.text] = currentKind; + if (!ts.hasProperty(seen, name_11.text)) { + seen[name_11.text] = currentKind; } else { - var existingKind = seen[_name.text]; + var existingKind = seen[name_11.text]; if (currentKind === Property && existingKind === Property) { if (inStrictMode) { - grammarErrorOnNode(_name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); + grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); } } else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[_name.text] = currentKind | existingKind; + seen[name_11.text] = currentKind | existingKind; } else { - return grammarErrorOnNode(_name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + return grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); } } else { - return grammarErrorOnNode(_name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + return grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); } } } @@ -17190,27 +18234,27 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.initializer.kind === 194) { + if (forInOrOfStatement.initializer.kind === 199) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { if (variableList.declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 182 + var diagnostic = forInOrOfStatement.kind === 187 ? 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 === 182 + var diagnostic = forInOrOfStatement.kind === 187 ? 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); + return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var _diagnostic_1 = forInOrOfStatement.kind === 182 + var diagnostic = forInOrOfStatement.kind === 187 ? 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_1); + return grammarErrorOnNode(firstDeclaration, diagnostic); } } } @@ -17230,10 +18274,10 @@ var ts; else if (accessor.typeParameters) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } - else if (kind === 134 && accessor.parameters.length) { + else if (kind === 136 && accessor.parameters.length) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); } - else if (kind === 135) { + else if (kind === 137) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -17258,7 +18302,7 @@ var ts; } } function checkGrammarForNonSymbolComputedProperty(node, message) { - if (node.kind === 126 && !ts.isWellKnownSymbolSyntactically(node.expression)) { + if (node.kind === 127 && !ts.isWellKnownSymbolSyntactically(node.expression)) { return grammarErrorOnNode(node, message); } } @@ -17268,7 +18312,7 @@ var ts; checkGrammarForGenerator(node)) { return true; } - if (node.parent.kind === 152) { + if (node.parent.kind === 154) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { return true; } @@ -17276,7 +18320,7 @@ var ts; return grammarErrorAtPos(getSourceFile(node), node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } } - if (node.parent.kind === 196) { + if (node.parent.kind === 201) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { return true; } @@ -17287,22 +18331,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 === 197) { + else if (node.parent.kind === 202) { 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 === 143) { + else if (node.parent.kind === 145) { 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 181: - case 182: - case 183: - case 179: - case 180: + case 186: + case 187: + case 188: + case 184: + case 185: return true; - case 189: + case 194: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -17314,9 +18358,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 189: + case 194: if (node.label && current.label.text === node.label.text) { - var isMisplacedContinueLabel = node.kind === 184 + var isMisplacedContinueLabel = node.kind === 189 && !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); @@ -17324,8 +18368,8 @@ var ts; return false; } break; - case 188: - if (node.kind === 185 && !node.label) { + case 193: + if (node.kind === 190 && !node.label) { return false; } break; @@ -17338,16 +18382,16 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 185 + var message = node.kind === 190 ? 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 === 185 + var message = node.kind === 190 ? 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); + return grammarErrorOnNode(node, message); } } function checkGrammarBindingElement(node) { @@ -17363,11 +18407,8 @@ var ts; return checkGrammarEvalOrArgumentsInStrictMode(node, node.name); } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 182 && node.parent.parent.kind !== 183) { + if (node.parent.parent.kind !== 187 && node.parent.parent.kind !== 188) { if (ts.isInAmbientContext(node)) { - if (ts.isBindingPattern(node.name)) { - return grammarErrorOnNode(node, ts.Diagnostics.Destructuring_declarations_are_not_allowed_in_ambient_contexts); - } if (node.initializer) { var equalsTokenLength = "=".length; return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.initializer.pos - equalsTokenLength, equalsTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); @@ -17387,14 +18428,14 @@ var ts; checkGrammarEvalOrArgumentsInStrictMode(node, node.name); } function checkGrammarNameInLetOrConstDeclarations(name) { - if (name.kind === 64) { + if (name.kind === 65) { if (name.text === "let") { return grammarErrorOnNode(name, ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations); } } else { var elements = name.elements; - for (var _i = 0, _n = elements.length; _i < _n; _i++) { + for (var _i = 0; _i < elements.length; _i++) { var element = elements[_i]; checkGrammarNameInLetOrConstDeclarations(element.name); } @@ -17411,15 +18452,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 178: - case 179: - case 180: - case 187: - case 181: - case 182: case 183: + case 184: + case 185: + case 192: + case 186: + case 187: + case 188: return false; - case 189: + case 194: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -17435,7 +18476,7 @@ var ts; } } function isIntegerLiteral(expression) { - if (expression.kind === 165) { + if (expression.kind === 167) { var unaryExpression = expression; if (unaryExpression.operator === 33 || unaryExpression.operator === 34) { expression = unaryExpression.operand; @@ -17452,9 +18493,9 @@ var ts; if (!enumIsConst) { var inConstantEnumMemberSection = true; var inAmbientContext = ts.isInAmbientContext(enumDecl); - for (var _i = 0, _a = enumDecl.members, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = enumDecl.members; _i < _a.length; _i++) { var node = _a[_i]; - if (node.name.kind === 126) { + if (node.name.kind === 127) { hasError = grammarErrorOnNode(node.name, ts.Diagnostics.Computed_property_names_are_not_allowed_in_enums); } else if (inAmbientContext) { @@ -17497,7 +18538,7 @@ var ts; } } function checkGrammarEvalOrArgumentsInStrictMode(contextNode, name) { - if (name && name.kind === 64) { + if (name && name.kind === 65) { var identifier = name; if (contextNode && (contextNode.parserContextFlags & 1) && ts.isEvalOrArgumentsIdentifier(identifier)) { var nameText = ts.declarationNameToString(identifier); @@ -17516,18 +18557,18 @@ var ts; } } function checkGrammarProperty(node) { - if (node.parent.kind === 196) { + if (node.parent.kind === 201) { 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 === 197) { + else if (node.parent.kind === 202) { 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 === 143) { + else if (node.parent.kind === 145) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)) { return true; } @@ -17537,20 +18578,21 @@ var ts; } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 197 || - node.kind === 204 || - node.kind === 203 || - node.kind === 210 || + if (node.kind === 202 || node.kind === 209 || - (node.flags & 2)) { + node.kind === 208 || + node.kind === 215 || + node.kind === 214 || + (node.flags & 2) || + (node.flags & (1 | 256))) { return false; } return grammarErrorOnFirstToken(node, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); } function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { - for (var _i = 0, _a = file.statements, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 175) { + if (ts.isDeclaration(decl) || decl.kind === 180) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -17569,10 +18611,10 @@ 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 === 174 || node.parent.kind === 201 || node.parent.kind === 221) { - var _links = getNodeLinks(node.parent); - if (!_links.hasReportedStatementInAmbientContext) { - return _links.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); + if (node.parent.kind === 179 || node.parent.kind === 206 || node.parent.kind === 227) { + 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); } } else { @@ -17602,251 +18644,16 @@ var ts; } ts.createTypeChecker = createTypeChecker; })(ts || (ts = {})); +/// var ts; (function (ts) { - var indentStrings = ["", " "]; - function getIndentString(level) { - if (indentStrings[level] === undefined) { - indentStrings[level] = getIndentString(level - 1) + indentStrings[1]; - } - return indentStrings[level]; - } - ts.getIndentString = getIndentString; - function getIndentSize() { - return indentStrings[1].length; - } - function shouldEmitToOwnFile(sourceFile, compilerOptions) { - if (!ts.isDeclarationFile(sourceFile)) { - if ((ts.isExternalModule(sourceFile) || !compilerOptions.out) && !ts.fileExtensionIs(sourceFile.fileName, ".js")) { - return true; - } - return false; - } - return false; - } - ts.shouldEmitToOwnFile = shouldEmitToOwnFile; - function isExternalModuleOrDeclarationFile(sourceFile) { - return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); - } - ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; - function createTextWriter(newLine) { - var output = ""; - var indent = 0; - var lineStart = true; - var lineCount = 0; - var linePos = 0; - function write(s) { - if (s && s.length) { - if (lineStart) { - output += getIndentString(indent); - lineStart = false; - } - output += s; - } - } - function rawWrite(s) { - if (s !== undefined) { - if (lineStart) { - lineStart = false; - } - output += s; - } - } - function writeLiteral(s) { - if (s && s.length) { - write(s); - var lineStartsOfS = ts.computeLineStarts(s); - if (lineStartsOfS.length > 1) { - lineCount = lineCount + lineStartsOfS.length - 1; - linePos = output.length - s.length + lineStartsOfS[lineStartsOfS.length - 1]; - } - } - } - function writeLine() { - if (!lineStart) { - output += newLine; - lineCount++; - linePos = output.length; - lineStart = true; - } - } - function writeTextOfNode(sourceFile, node) { - write(ts.getSourceTextOfNodeFromSourceFile(sourceFile, node)); - } - return { - write: write, - rawWrite: rawWrite, - writeTextOfNode: writeTextOfNode, - writeLiteral: writeLiteral, - writeLine: writeLine, - increaseIndent: function () { return indent++; }, - decreaseIndent: function () { return indent--; }, - getIndent: function () { return indent; }, - getTextPos: function () { return output.length; }, - getLine: function () { return lineCount + 1; }, - getColumn: function () { return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; }, - getText: function () { return output; } - }; - } - function getLineOfLocalPosition(currentSourceFile, pos) { - return ts.getLineAndCharacterOfPosition(currentSourceFile, pos).line; - } - function emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments) { - if (leadingComments && leadingComments.length && node.pos !== leadingComments[0].pos && - getLineOfLocalPosition(currentSourceFile, node.pos) !== getLineOfLocalPosition(currentSourceFile, leadingComments[0].pos)) { - writer.writeLine(); - } - } - function emitComments(currentSourceFile, writer, comments, trailingSeparator, newLine, writeComment) { - var emitLeadingSpace = !trailingSeparator; - ts.forEach(comments, function (comment) { - if (emitLeadingSpace) { - writer.write(" "); - emitLeadingSpace = false; - } - writeComment(currentSourceFile, writer, comment, newLine); - if (comment.hasTrailingNewLine) { - writer.writeLine(); - } - else if (trailingSeparator) { - writer.write(" "); - } - else { - emitLeadingSpace = true; - } - }); - } - function writeCommentRange(currentSourceFile, writer, comment, newLine) { - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42) { - var firstCommentLineAndCharacter = ts.getLineAndCharacterOfPosition(currentSourceFile, comment.pos); - var lineCount = ts.getLineStarts(currentSourceFile).length; - var firstCommentLineIndent; - for (var pos = comment.pos, currentLine = firstCommentLineAndCharacter.line; pos < comment.end; currentLine++) { - var nextLineStart = (currentLine + 1) === lineCount - ? currentSourceFile.text.length + 1 - : ts.getStartPositionOfLine(currentLine + 1, currentSourceFile); - if (pos !== comment.pos) { - if (firstCommentLineIndent === undefined) { - firstCommentLineIndent = calculateIndent(ts.getStartPositionOfLine(firstCommentLineAndCharacter.line, currentSourceFile), comment.pos); - } - var currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); - var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(pos, nextLineStart); - if (spacesToEmit > 0) { - var numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); - var indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); - writer.rawWrite(indentSizeSpaceString); - while (numberOfSingleSpacesToEmit) { - writer.rawWrite(" "); - numberOfSingleSpacesToEmit--; - } - } - else { - writer.rawWrite(""); - } - } - writeTrimmedCurrentLine(pos, nextLineStart); - pos = nextLineStart; - } - } - else { - writer.write(currentSourceFile.text.substring(comment.pos, comment.end)); - } - function writeTrimmedCurrentLine(pos, nextLineStart) { - var end = Math.min(comment.end, nextLineStart - 1); - var currentLineText = currentSourceFile.text.substring(pos, end).replace(/^\s+|\s+$/g, ''); - if (currentLineText) { - writer.write(currentLineText); - if (end !== comment.end) { - writer.writeLine(); - } - } - else { - writer.writeLiteral(newLine); - } - } - function calculateIndent(pos, end) { - var currentLineIndent = 0; - for (; pos < end && ts.isWhiteSpace(currentSourceFile.text.charCodeAt(pos)); pos++) { - if (currentSourceFile.text.charCodeAt(pos) === 9) { - currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); - } - else { - currentLineIndent++; - } - } - return currentLineIndent; - } - } - function getFirstConstructorWithBody(node) { - return ts.forEach(node.members, function (member) { - if (member.kind === 133 && ts.nodeIsPresent(member.body)) { - return member; - } - }); - } - function getAllAccessorDeclarations(declarations, accessor) { - var firstAccessor; - var getAccessor; - var setAccessor; - if (ts.hasDynamicName(accessor)) { - firstAccessor = accessor; - if (accessor.kind === 134) { - getAccessor = accessor; - } - else if (accessor.kind === 135) { - setAccessor = accessor; - } - else { - ts.Debug.fail("Accessor has wrong kind"); - } - } - else { - ts.forEach(declarations, function (member) { - if ((member.kind === 134 || member.kind === 135) - && (member.flags & 128) === (accessor.flags & 128)) { - var memberName = ts.getPropertyNameForPropertyNameNode(member.name); - var accessorName = ts.getPropertyNameForPropertyNameNode(accessor.name); - if (memberName === accessorName) { - if (!firstAccessor) { - firstAccessor = member; - } - if (member.kind === 134 && !getAccessor) { - getAccessor = member; - } - if (member.kind === 135 && !setAccessor) { - setAccessor = member; - } - } - } - }); - } - return { - firstAccessor: firstAccessor, - getAccessor: getAccessor, - setAccessor: setAccessor - }; - } - function getSourceFilePathInNewDir(sourceFile, host, newDirPath) { - var sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.fileName, host.getCurrentDirectory()); - sourceFilePath = sourceFilePath.replace(host.getCommonSourceDirectory(), ""); - return ts.combinePaths(newDirPath, sourceFilePath); - } - function getOwnEmitOutputFilePath(sourceFile, host, extension) { - var compilerOptions = host.getCompilerOptions(); - var emitOutputFilePathWithoutExtension; - if (compilerOptions.outDir) { - emitOutputFilePathWithoutExtension = ts.removeFileExtension(getSourceFilePathInNewDir(sourceFile, host, compilerOptions.outDir)); - } - else { - emitOutputFilePathWithoutExtension = ts.removeFileExtension(sourceFile.fileName); - } - return emitOutputFilePathWithoutExtension + extension; - } - function writeFile(host, diagnostics, fileName, data, writeByteOrderMark) { - host.writeFile(fileName, data, writeByteOrderMark, function (hostErrorMessage) { - diagnostics.push(ts.createCompilerDiagnostic(ts.Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage)); - }); + function getDeclarationDiagnostics(host, resolver, targetSourceFile) { + var diagnostics = []; + var jsFilePath = ts.getOwnEmitOutputFilePath(targetSourceFile, host, ".js"); + emitDeclarations(host, resolver, diagnostics, jsFilePath, targetSourceFile); + return diagnostics; } + ts.getDeclarationDiagnostics = getDeclarationDiagnostics; function emitDeclarations(host, resolver, diagnostics, jsFilePath, root) { var newLine = host.getNewLine(); var compilerOptions = host.getCompilerOptions(); @@ -17862,7 +18669,8 @@ var ts; var reportedDeclarationError = false; var emitJsDocComments = compilerOptions.removeComments ? function (declaration) { } : writeJsDocComments; var emit = compilerOptions.stripInternal ? stripInternal : emitNode; - var aliasDeclarationEmitInfo = []; + var moduleElementDeclarationEmitInfo = []; + var asynchronousSubModuleDeclarationEmitInfo; var referencePathsOutput = ""; if (root) { if (!compilerOptions.noResolve) { @@ -17870,25 +18678,38 @@ var ts; ts.forEach(root.referencedFiles, function (fileReference) { var referencedFile = ts.tryResolveScriptReference(host, root, fileReference); if (referencedFile && ((referencedFile.flags & 2048) || - shouldEmitToOwnFile(referencedFile, compilerOptions) || + ts.shouldEmitToOwnFile(referencedFile, compilerOptions) || !addedGlobalFileReference)) { writeReferencePath(referencedFile); - if (!isExternalModuleOrDeclarationFile(referencedFile)) { + if (!ts.isExternalModuleOrDeclarationFile(referencedFile)) { addedGlobalFileReference = true; } } }); } emitSourceFile(root); + if (moduleElementDeclarationEmitInfo.length) { + var oldWriter = writer; + ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { + if (aliasEmitInfo.isVisible) { + ts.Debug.assert(aliasEmitInfo.node.kind === 209); + createAndSetNewTextWriterWithSymbolWriter(); + ts.Debug.assert(aliasEmitInfo.indent === 0); + writeImportDeclaration(aliasEmitInfo.node); + aliasEmitInfo.asynchronousOutput = writer.getText(); + } + }); + setWriter(oldWriter); + } } 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); @@ -17901,7 +18722,7 @@ var ts; } return { reportedDeclarationError: reportedDeclarationError, - aliasDeclarationEmitInfo: aliasDeclarationEmitInfo, + moduleElementDeclarationEmitInfo: moduleElementDeclarationEmitInfo, synchronousDeclarationOutput: writer.getText(), referencePathsOutput: referencePathsOutput }; @@ -17920,17 +18741,17 @@ var ts; } } function createAndSetNewTextWriterWithSymbolWriter() { - var _writer = createTextWriter(newLine); - _writer.trackSymbol = trackSymbol; - _writer.writeKeyword = _writer.write; - _writer.writeOperator = _writer.write; - _writer.writePunctuation = _writer.write; - _writer.writeSpace = _writer.write; - _writer.writeStringLiteral = _writer.writeLiteral; - _writer.writeParameter = _writer.write; - _writer.writeSymbol = _writer.write; - setWriter(_writer); - return _writer; + var writer = ts.createTextWriter(newLine); + writer.trackSymbol = trackSymbol; + writer.writeKeyword = writer.write; + writer.writeOperator = writer.write; + writer.writePunctuation = writer.write; + writer.writeSpace = writer.write; + writer.writeStringLiteral = writer.writeLiteral; + writer.writeParameter = writer.write; + writer.writeSymbol = writer.write; + setWriter(writer); + return writer; } function setWriter(newWriter) { writer = newWriter; @@ -17940,17 +18761,43 @@ var ts; increaseIndent = newWriter.increaseIndent; decreaseIndent = newWriter.decreaseIndent; } - function writeAsychronousImportEqualsDeclarations(importEqualsDeclarations) { + function writeAsynchronousModuleElements(nodes) { var oldWriter = writer; - ts.forEach(importEqualsDeclarations, function (aliasToWrite) { - var aliasEmitInfo = ts.forEach(aliasDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.declaration === aliasToWrite ? declEmitInfo : undefined; }); - if (aliasEmitInfo) { - createAndSetNewTextWriterWithSymbolWriter(); - for (var declarationIndent = aliasEmitInfo.indent; declarationIndent; declarationIndent--) { - increaseIndent(); + ts.forEach(nodes, function (declaration) { + var nodeToCheck; + if (declaration.kind === 198) { + nodeToCheck = declaration.parent.parent; + } + else if (declaration.kind === 212 || declaration.kind === 213 || declaration.kind === 210) { + ts.Debug.fail("We should be getting ImportDeclaration instead to write"); + } + else { + nodeToCheck = declaration; + } + var moduleElementEmitInfo = ts.forEach(moduleElementDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.node === nodeToCheck ? declEmitInfo : undefined; }); + if (!moduleElementEmitInfo && asynchronousSubModuleDeclarationEmitInfo) { + moduleElementEmitInfo = ts.forEach(asynchronousSubModuleDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.node === nodeToCheck ? declEmitInfo : undefined; }); + } + if (moduleElementEmitInfo) { + if (moduleElementEmitInfo.node.kind === 209) { + moduleElementEmitInfo.isVisible = true; + } + else { + createAndSetNewTextWriterWithSymbolWriter(); + for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { + increaseIndent(); + } + if (nodeToCheck.kind === 205) { + ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); + asynchronousSubModuleDeclarationEmitInfo = []; + } + writeModuleElement(nodeToCheck); + if (nodeToCheck.kind === 205) { + moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; + asynchronousSubModuleDeclarationEmitInfo = undefined; + } + moduleElementEmitInfo.asynchronousOutput = writer.getText(); } - writeImportEqualsDeclaration(aliasToWrite); - aliasEmitInfo.asynchronousOutput = writer.getText(); } }); setWriter(oldWriter); @@ -17958,7 +18805,7 @@ var ts; function handleSymbolAccessibilityError(symbolAccesibilityResult) { if (symbolAccesibilityResult.accessibility === 0) { if (symbolAccesibilityResult && symbolAccesibilityResult.aliasesToMakeVisible) { - writeAsychronousImportEqualsDeclarations(symbolAccesibilityResult.aliasesToMakeVisible); + writeAsynchronousModuleElements(symbolAccesibilityResult.aliasesToMakeVisible); } } else { @@ -17998,30 +18845,32 @@ var ts; } } function emitLines(nodes) { - for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + for (var _i = 0; _i < nodes.length; _i++) { var node = nodes[_i]; emit(node); } } - function emitSeparatedList(nodes, separator, eachNodeEmitFn) { + function emitSeparatedList(nodes, separator, eachNodeEmitFn, canEmitFn) { var currentWriterPos = writer.getTextPos(); - for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + for (var _i = 0; _i < nodes.length; _i++) { var node = nodes[_i]; - if (currentWriterPos !== writer.getTextPos()) { - write(separator); + if (!canEmitFn || canEmitFn(node)) { + if (currentWriterPos !== writer.getTextPos()) { + write(separator); + } + currentWriterPos = writer.getTextPos(); + eachNodeEmitFn(node); } - currentWriterPos = writer.getTextPos(); - eachNodeEmitFn(node); } } - function emitCommaList(nodes, eachNodeEmitFn) { - emitSeparatedList(nodes, ", ", eachNodeEmitFn); + function emitCommaList(nodes, eachNodeEmitFn, canEmitFn) { + emitSeparatedList(nodes, ", ", eachNodeEmitFn, canEmitFn); } function writeJsDocComments(declaration) { if (declaration) { var jsDocComments = ts.getJsDocComments(declaration, currentSourceFile); - emitNewLineBeforeLeadingComments(currentSourceFile, writer, declaration, jsDocComments); - emitComments(currentSourceFile, writer, jsDocComments, true, newLine, writeCommentRange); + ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, declaration, jsDocComments); + ts.emitComments(currentSourceFile, writer, jsDocComments, true, newLine, ts.writeCommentRange); } } function emitTypeWithNewGetSymbolAccessibilityDiagnostic(type, getSymbolAccessibilityDiagnostic) { @@ -18030,51 +18879,63 @@ var ts; } function emitType(type) { switch (type.kind) { - case 111: - case 120: - case 118: case 112: case 121: - case 98: + case 119: + case 113: + case 122: + case 99: case 8: return writeTextOfNode(currentSourceFile, type); - case 139: - return emitTypeReference(type); - case 142: - return emitTypeQuery(type); - case 144: - return emitArrayType(type); - case 145: - return emitTupleType(type); - case 146: - return emitUnionType(type); - case 147: - return emitParenType(type); - case 140: + case 177: + return emitHeritageClauseElement(type); case 141: - return emitSignatureDeclarationWithJsDocComments(type); + 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); + case 142: case 143: + return emitSignatureDeclarationWithJsDocComments(type); + case 145: return emitTypeLiteral(type); - case 64: + case 65: return emitEntityName(type); - case 125: + case 126: return emitEntityName(type); - default: - ts.Debug.fail("Unknown type annotation: " + type.kind); } function emitEntityName(entityName) { - var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 203 ? entityName.parent : enclosingDeclaration); + var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 208 ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); writeEntityName(entityName); function writeEntityName(entityName) { - if (entityName.kind === 64) { + if (entityName.kind === 65) { writeTextOfNode(currentSourceFile, entityName); } else { - var qualifiedName = entityName; - writeEntityName(qualifiedName.left); + var left = entityName.kind === 126 ? entityName.left : entityName.expression; + var right = entityName.kind === 126 ? entityName.right : entityName.name; + writeEntityName(left); write("."); - writeTextOfNode(currentSourceFile, qualifiedName.right); + writeTextOfNode(currentSourceFile, right); + } + } + } + function emitHeritageClauseElement(node) { + if (ts.isSupportedHeritageClauseElement(node)) { + ts.Debug.assert(node.expression.kind === 65 || node.expression.kind === 155); + emitEntityName(node.expression); + if (node.typeArguments) { + write("<"); + emitCommaList(node.typeArguments, emitType); + write(">"); } } } @@ -18125,16 +18986,100 @@ var ts; } function emitExportAssignment(node) { write(node.isExportEquals ? "export = " : "export default "); - writeTextOfNode(currentSourceFile, node.expression); + if (node.expression.kind === 65) { + writeTextOfNode(currentSourceFile, node.expression); + } + else { + write(": "); + if (node.type) { + emitType(node.type); + } + else { + writer.getSymbolAccessibilityDiagnostic = getDefaultExportAccessibilityDiagnostic; + resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, 2, writer); + } + } write(";"); writeLine(); + if (node.expression.kind === 65) { + var nodes = resolver.collectLinkedAliases(node.expression); + writeAsynchronousModuleElements(nodes); + } + function getDefaultExportAccessibilityDiagnostic(diagnostic) { + return { + diagnosticMessage: ts.Diagnostics.Default_export_of_the_module_has_or_is_using_private_name_0, + errorNode: node + }; + } + } + function isModuleElementVisible(node) { + return resolver.isDeclarationVisible(node); + } + function emitModuleElement(node, isModuleElementVisible) { + if (isModuleElementVisible) { + writeModuleElement(node); + } + else if (node.kind === 208 || + (node.parent.kind === 227 && ts.isExternalModule(currentSourceFile))) { + var isVisible; + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 227) { + asynchronousSubModuleDeclarationEmitInfo.push({ + node: node, + outputPos: writer.getTextPos(), + indent: writer.getIndent(), + isVisible: isVisible + }); + } + else { + if (node.kind === 209) { + var importDeclaration = node; + if (importDeclaration.importClause) { + isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || + isVisibleNamedBinding(importDeclaration.importClause.namedBindings); + } + } + moduleElementDeclarationEmitInfo.push({ + node: node, + outputPos: writer.getTextPos(), + indent: writer.getIndent(), + isVisible: isVisible + }); + } + } + } + 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); + case 203: + return writeTypeAliasDeclaration(node); + case 204: + return writeEnumDeclaration(node); + case 205: + return writeModuleDeclaration(node); + case 208: + return writeImportEqualsDeclaration(node); + case 209: + return writeImportDeclaration(node); + default: + ts.Debug.fail("Unknown symbol kind"); + } } function emitModuleElementDeclarationFlags(node) { if (node.parent === currentSourceFile) { if (node.flags & 1) { write("export "); } - if (node.kind !== 197) { + if (node.flags & 256) { + write("default "); + } + else if (node.kind !== 202) { write("declare "); } } @@ -18150,18 +19095,6 @@ var ts; write("static "); } } - function emitImportEqualsDeclaration(node) { - var nodeEmitInfo = { - declaration: node, - outputPos: writer.getTextPos(), - indent: writer.getIndent(), - hasWritten: resolver.isDeclarationVisible(node) - }; - aliasDeclarationEmitInfo.push(nodeEmitInfo); - if (nodeEmitInfo.hasWritten) { - writeImportEqualsDeclaration(node); - } - } function writeImportEqualsDeclaration(node) { emitJsDocComments(node); if (node.flags & 1) { @@ -18188,40 +19121,110 @@ var ts; }; } } - function emitModuleDeclaration(node) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - write("module "); - writeTextOfNode(currentSourceFile, node.name); - while (node.body.kind !== 201) { - node = node.body; - write("."); - writeTextOfNode(currentSourceFile, node.name); + function isVisibleNamedBinding(namedBindings) { + if (namedBindings) { + if (namedBindings.kind === 211) { + return resolver.isDeclarationVisible(namedBindings); + } + else { + return ts.forEach(namedBindings.elements, function (namedImport) { return resolver.isDeclarationVisible(namedImport); }); } - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - write(" {"); - writeLine(); - increaseIndent(); - emitLines(node.body.statements); - decreaseIndent(); - write("}"); - writeLine(); - enclosingDeclaration = prevEnclosingDeclaration; } } - function emitTypeAliasDeclaration(node) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - write("type "); - writeTextOfNode(currentSourceFile, node.name); - write(" = "); - emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.type, getTypeAliasDeclarationVisibilityError); - write(";"); - writeLine(); + function writeImportDeclaration(node) { + if (!node.importClause && !(node.flags & 1)) { + return; } + emitJsDocComments(node); + if (node.flags & 1) { + write("export "); + } + write("import "); + if (node.importClause) { + var currentWriterPos = writer.getTextPos(); + if (node.importClause.name && resolver.isDeclarationVisible(node.importClause)) { + writeTextOfNode(currentSourceFile, node.importClause.name); + } + if (node.importClause.namedBindings && isVisibleNamedBinding(node.importClause.namedBindings)) { + if (currentWriterPos !== writer.getTextPos()) { + write(", "); + } + if (node.importClause.namedBindings.kind === 211) { + write("* as "); + writeTextOfNode(currentSourceFile, node.importClause.namedBindings.name); + } + else { + write("{ "); + emitCommaList(node.importClause.namedBindings.elements, emitImportOrExportSpecifier, resolver.isDeclarationVisible); + write(" }"); + } + } + write(" from "); + } + writeTextOfNode(currentSourceFile, node.moduleSpecifier); + write(";"); + writer.writeLine(); + } + function emitImportOrExportSpecifier(node) { + if (node.propertyName) { + writeTextOfNode(currentSourceFile, node.propertyName); + write(" as "); + } + writeTextOfNode(currentSourceFile, node.name); + } + function emitExportSpecifier(node) { + emitImportOrExportSpecifier(node); + var nodes = resolver.collectLinkedAliases(node.propertyName || node.name); + writeAsynchronousModuleElements(nodes); + } + function emitExportDeclaration(node) { + emitJsDocComments(node); + write("export "); + if (node.exportClause) { + write("{ "); + emitCommaList(node.exportClause.elements, emitExportSpecifier); + write(" }"); + } + else { + write("*"); + } + if (node.moduleSpecifier) { + write(" from "); + writeTextOfNode(currentSourceFile, node.moduleSpecifier); + } + write(";"); + writer.writeLine(); + } + function writeModuleDeclaration(node) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + write("module "); + writeTextOfNode(currentSourceFile, node.name); + while (node.body.kind !== 206) { + node = node.body; + write("."); + writeTextOfNode(currentSourceFile, node.name); + } + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node; + write(" {"); + writeLine(); + increaseIndent(); + emitLines(node.body.statements); + decreaseIndent(); + write("}"); + writeLine(); + enclosingDeclaration = prevEnclosingDeclaration; + } + function writeTypeAliasDeclaration(node) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + write("type "); + writeTextOfNode(currentSourceFile, node.name); + write(" = "); + emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.type, getTypeAliasDeclarationVisibilityError); + write(";"); + writeLine(); function getTypeAliasDeclarationVisibilityError(symbolAccesibilityResult) { return { diagnosticMessage: ts.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1, @@ -18230,23 +19233,21 @@ var ts; }; } } - function emitEnumDeclaration(node) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - if (ts.isConst(node)) { - write("const "); - } - write("enum "); - writeTextOfNode(currentSourceFile, node.name); - write(" {"); - writeLine(); - increaseIndent(); - emitLines(node.members); - decreaseIndent(); - write("}"); - writeLine(); + function writeEnumDeclaration(node) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + if (ts.isConst(node)) { + write("const "); } + write("enum "); + writeTextOfNode(currentSourceFile, node.name); + write(" {"); + writeLine(); + increaseIndent(); + emitLines(node.members); + decreaseIndent(); + write("}"); + writeLine(); } function emitEnumMemberDeclaration(node) { emitJsDocComments(node); @@ -18260,7 +19261,7 @@ var ts; writeLine(); } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 132 && (node.parent.flags & 32); + return node.parent.kind === 134 && (node.parent.flags & 32); } function emitTypeParameters(typeParameters) { function emitTypeParameter(node) { @@ -18270,15 +19271,15 @@ var ts; writeTextOfNode(currentSourceFile, node.name); if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); - if (node.parent.kind === 140 || - node.parent.kind === 141 || - (node.parent.parent && node.parent.parent.kind === 143)) { - ts.Debug.assert(node.parent.kind === 132 || - node.parent.kind === 131 || - node.parent.kind === 140 || - node.parent.kind === 141 || - node.parent.kind === 136 || - node.parent.kind === 137); + 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 || + node.parent.kind === 143 || + node.parent.kind === 138 || + node.parent.kind === 139); emitType(node.constraint); } else { @@ -18288,31 +19289,31 @@ var ts; function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.parent.kind) { - case 196: + case 201: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 197: + case 202: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 137: + case 139: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 136: + case 138: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 132: - case 131: + 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 === 196) { + else if (node.parent.parent.kind === 201) { 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 195: + case 200: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: @@ -18337,10 +19338,12 @@ var ts; emitCommaList(typeReferences, emitTypeOfTypeReference); } function emitTypeOfTypeReference(node) { - emitTypeWithNewGetSymbolAccessibilityDiagnostic(node, getHeritageClauseVisibilityError); + if (ts.isSupportedHeritageClauseElement(node)) { + emitTypeWithNewGetSymbolAccessibilityDiagnostic(node, getHeritageClauseVisibilityError); + } function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.parent.parent.kind === 196) { + if (node.parent.parent.kind === 201) { 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; @@ -18356,7 +19359,7 @@ var ts; } } } - function emitClassDeclaration(node) { + function writeClassDeclaration(node) { function emitParameterProperties(constructorDeclaration) { if (constructorDeclaration) { ts.forEach(constructorDeclaration.parameters, function (param) { @@ -18366,49 +19369,45 @@ var ts; }); } } - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - write("class "); - writeTextOfNode(currentSourceFile, node.name); - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - emitTypeParameters(node.typeParameters); - var baseTypeNode = ts.getClassBaseTypeNode(node); - if (baseTypeNode) { - emitHeritageClause([baseTypeNode], false); - } - emitHeritageClause(ts.getClassImplementedTypeNodes(node), true); - write(" {"); - writeLine(); - increaseIndent(); - emitParameterProperties(getFirstConstructorWithBody(node)); - emitLines(node.members); - decreaseIndent(); - write("}"); - writeLine(); - enclosingDeclaration = prevEnclosingDeclaration; + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + write("class "); + writeTextOfNode(currentSourceFile, node.name); + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node; + emitTypeParameters(node.typeParameters); + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); + if (baseTypeNode) { + emitHeritageClause([baseTypeNode], false); } + emitHeritageClause(ts.getClassImplementsHeritageClauseElements(node), true); + write(" {"); + writeLine(); + increaseIndent(); + emitParameterProperties(ts.getFirstConstructorWithBody(node)); + emitLines(node.members); + decreaseIndent(); + write("}"); + writeLine(); + enclosingDeclaration = prevEnclosingDeclaration; } - function emitInterfaceDeclaration(node) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - write("interface "); - writeTextOfNode(currentSourceFile, node.name); - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - emitTypeParameters(node.typeParameters); - emitHeritageClause(ts.getInterfaceBaseTypeNodes(node), false); - write(" {"); - writeLine(); - increaseIndent(); - emitLines(node.members); - decreaseIndent(); - write("}"); - writeLine(); - enclosingDeclaration = prevEnclosingDeclaration; - } + function writeInterfaceDeclaration(node) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + write("interface "); + writeTextOfNode(currentSourceFile, node.name); + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node; + emitTypeParameters(node.typeParameters); + emitHeritageClause(ts.getInterfaceBaseTypeNodes(node), false); + write(" {"); + writeLine(); + increaseIndent(); + emitLines(node.members); + decreaseIndent(); + write("}"); + writeLine(); + enclosingDeclaration = prevEnclosingDeclaration; } function emitPropertyDeclaration(node) { if (ts.hasDynamicName(node)) { @@ -18421,54 +19420,90 @@ var ts; writeLine(); } function emitVariableDeclaration(node) { - if (node.kind !== 193 || resolver.isDeclarationVisible(node)) { - writeTextOfNode(currentSourceFile, node.name); - if ((node.kind === 130 || node.kind === 129) && ts.hasQuestionToken(node)) { - write("?"); + if (node.kind !== 198 || resolver.isDeclarationVisible(node)) { + if (ts.isBindingPattern(node.name)) { + emitBindingPattern(node.name); } - if ((node.kind === 130 || node.kind === 129) && node.parent.kind === 143) { - emitTypeOfVariableDeclarationFromTypeLiteral(node); - } - else if (!(node.flags & 32)) { - writeTypeOfDeclaration(node, node.type, getVariableDeclarationTypeVisibilityError); + else { + writeTextOfNode(currentSourceFile, node.name); + if ((node.kind === 132 || node.kind === 131) && ts.hasQuestionToken(node)) { + write("?"); + } + if ((node.kind === 132 || node.kind === 131) && node.parent.kind === 145) { + emitTypeOfVariableDeclarationFromTypeLiteral(node); + } + else if (!(node.flags & 32)) { + writeTypeOfDeclaration(node, node.type, getVariableDeclarationTypeVisibilityError); + } } } - function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage; - if (node.kind === 193) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { + if (node.kind === 198) { + 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 === 130 || node.kind === 129) { + else if (node.kind === 132 || node.kind === 131) { if (node.flags & 128) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : 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 === 196) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + else if (node.parent.kind === 201) { + 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 : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; } else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + return symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; } } + } + function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult) { + var diagnosticMessage = getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult); return diagnosticMessage !== undefined ? { diagnosticMessage: diagnosticMessage, errorNode: node, typeName: node.name } : undefined; } + function emitBindingPattern(bindingPattern) { + var elements = []; + for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { + var element = _a[_i]; + if (element.kind !== 175) { + elements.push(element); + } + } + emitCommaList(elements, emitBindingElement); + } + function emitBindingElement(bindingElement) { + function getBindingElementTypeVisibilityError(symbolAccesibilityResult) { + var diagnosticMessage = getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult); + return diagnosticMessage !== undefined ? { + diagnosticMessage: diagnosticMessage, + errorNode: bindingElement, + typeName: bindingElement.name + } : undefined; + } + if (bindingElement.name) { + if (ts.isBindingPattern(bindingElement.name)) { + emitBindingPattern(bindingElement.name); + } + else { + writeTextOfNode(currentSourceFile, bindingElement.name); + writeTypeOfDeclaration(bindingElement, undefined, getBindingElementTypeVisibilityError); + } + } + } } function emitTypeOfVariableDeclarationFromTypeLiteral(node) { if (node.type) { @@ -18476,30 +19511,30 @@ var ts; emitType(node.type); } } - function emitVariableStatement(node) { - var hasDeclarationWithEmit = ts.forEach(node.declarationList.declarations, function (varDeclaration) { return resolver.isDeclarationVisible(varDeclaration); }); - if (hasDeclarationWithEmit) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - if (ts.isLet(node.declarationList)) { - write("let "); - } - else if (ts.isConst(node.declarationList)) { - write("const "); - } - else { - write("var "); - } - emitCommaList(node.declarationList.declarations, emitVariableDeclaration); - write(";"); - writeLine(); + function isVariableStatementVisible(node) { + return ts.forEach(node.declarationList.declarations, function (varDeclaration) { return resolver.isDeclarationVisible(varDeclaration); }); + } + function writeVariableStatement(node) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + if (ts.isLet(node.declarationList)) { + write("let "); } + else if (ts.isConst(node.declarationList)) { + write("const "); + } + else { + write("var "); + } + emitCommaList(node.declarationList.declarations, emitVariableDeclaration, resolver.isDeclarationVisible); + write(";"); + writeLine(); } function emitAccessorDeclaration(node) { if (ts.hasDynamicName(node)) { return; } - var accessors = getAllAccessorDeclarations(node.parent.members, node); + var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); var accessorWithTypeAnnotation; if (node === accessors.firstAccessor) { emitJsDocComments(accessors.getAccessor); @@ -18510,7 +19545,7 @@ var ts; accessorWithTypeAnnotation = node; var type = getTypeAnnotationFromAccessor(node); if (!type) { - var anotherAccessor = node.kind === 134 ? accessors.setAccessor : accessors.getAccessor; + var anotherAccessor = node.kind === 136 ? accessors.setAccessor : accessors.getAccessor; type = getTypeAnnotationFromAccessor(anotherAccessor); if (type) { accessorWithTypeAnnotation = anotherAccessor; @@ -18523,7 +19558,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 134 + return accessor.kind === 136 ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type @@ -18532,7 +19567,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (accessorWithTypeAnnotation.kind === 135) { + if (accessorWithTypeAnnotation.kind === 137) { 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 : @@ -18572,24 +19607,23 @@ var ts; } } } - function emitFunctionDeclaration(node) { + function writeFunctionDeclaration(node) { if (ts.hasDynamicName(node)) { return; } - if ((node.kind !== 195 || resolver.isDeclarationVisible(node)) && - !resolver.isImplementationOfOverload(node)) { + if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 195) { + if (node.kind === 200) { emitModuleElementDeclarationFlags(node); } - else if (node.kind === 132) { + else if (node.kind === 134) { emitClassMemberDeclarationFlags(node); } - if (node.kind === 195) { + if (node.kind === 200) { write("function "); writeTextOfNode(currentSourceFile, node.name); } - else if (node.kind === 133) { + else if (node.kind === 135) { write("constructor"); } else { @@ -18606,11 +19640,11 @@ var ts; emitSignatureDeclaration(node); } function emitSignatureDeclaration(node) { - if (node.kind === 137 || node.kind === 141) { + if (node.kind === 139 || node.kind === 143) { write("new "); } emitTypeParameters(node.typeParameters); - if (node.kind === 138) { + if (node.kind === 140) { write("["); } else { @@ -18619,20 +19653,20 @@ var ts; var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 138) { + if (node.kind === 140) { write("]"); } else { write(")"); } - var isFunctionTypeOrConstructorType = node.kind === 140 || node.kind === 141; - if (isFunctionTypeOrConstructorType || node.parent.kind === 143) { + var isFunctionTypeOrConstructorType = node.kind === 142 || node.kind === 143; + if (isFunctionTypeOrConstructorType || node.parent.kind === 145) { if (node.type) { write(isFunctionTypeOrConstructorType ? " => " : ": "); emitType(node.type); } } - else if (node.kind !== 133 && !(node.flags & 32)) { + else if (node.kind !== 135 && !(node.flags & 32)) { writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); } enclosingDeclaration = prevEnclosingDeclaration; @@ -18643,23 +19677,23 @@ var ts; function getReturnTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.kind) { - case 137: + case 139: 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 136: + case 138: 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 138: + case 140: 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 132: - case 131: + case 134: + case 133: if (node.flags & 128) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? @@ -18667,7 +19701,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 === 196) { + else if (node.parent.kind === 201) { 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 : @@ -18680,7 +19714,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 195: + case 200: 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 : @@ -18703,7 +19737,7 @@ var ts; write("..."); } if (ts.isBindingPattern(node.name)) { - write("_" + ts.indexOf(node.parent.parameters, node)); + emitBindingPattern(node.name); } else { writeTextOfNode(currentSourceFile, node.name); @@ -18712,129 +19746,197 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 140 || - node.parent.kind === 141 || - node.parent.parent.kind === 143) { + if (node.parent.kind === 142 || + node.parent.kind === 143 || + node.parent.parent.kind === 145) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!(node.parent.flags & 32)) { writeTypeOfDeclaration(node, node.type, getParameterDeclarationTypeVisibilityError); } function getParameterDeclarationTypeVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage; + var diagnosticMessage = getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult); + return diagnosticMessage !== undefined ? { + diagnosticMessage: diagnosticMessage, + errorNode: node, + typeName: node.name + } : undefined; + } + function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { switch (node.parent.kind) { - case 133: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + case 135: + 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; - break; - case 137: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + case 139: + 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; - break; - case 136: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + case 138: + 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; - break; - case 132: - case 131: + case 134: + case 133: if (node.parent.flags & 128) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : 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 === 196) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + else if (node.parent.parent.kind === 201) { + 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 : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + return symbolAccesibilityResult.errorModuleName ? 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; } - break; - case 195: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + case 200: + 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 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - break; default: ts.Debug.fail("This is unknown parent for parameter: " + node.parent.kind); } - return { - diagnosticMessage: diagnosticMessage, - errorNode: node, - typeName: node.name - }; + } + function emitBindingPattern(bindingPattern) { + if (bindingPattern.kind === 150) { + write("{"); + emitCommaList(bindingPattern.elements, emitBindingElement); + write("}"); + } + else if (bindingPattern.kind === 151) { + write("["); + var elements = bindingPattern.elements; + emitCommaList(elements, emitBindingElement); + if (elements && elements.hasTrailingComma) { + write(", "); + } + write("]"); + } + } + function emitBindingElement(bindingElement) { + function getBindingElementTypeVisibilityError(symbolAccesibilityResult) { + var diagnosticMessage = getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult); + return diagnosticMessage !== undefined ? { + diagnosticMessage: diagnosticMessage, + errorNode: bindingElement, + typeName: bindingElement.name + } : undefined; + } + if (bindingElement.kind === 175) { + write(" "); + } + else if (bindingElement.kind === 152) { + if (bindingElement.propertyName) { + writeTextOfNode(currentSourceFile, bindingElement.propertyName); + write(": "); + emitBindingPattern(bindingElement.name); + } + else if (bindingElement.name) { + if (ts.isBindingPattern(bindingElement.name)) { + emitBindingPattern(bindingElement.name); + } + else { + ts.Debug.assert(bindingElement.name.kind === 65); + if (bindingElement.dotDotDotToken) { + write("..."); + } + writeTextOfNode(currentSourceFile, bindingElement.name); + } + } + } } } 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 209: + return emitModuleElement(node, !node.importClause); + case 215: + return emitExportDeclaration(node); + case 135: + case 134: case 133: - case 195: + return writeFunctionDeclaration(node); + case 139: + case 138: + case 140: + return emitSignatureDeclarationWithJsDocComments(node); + case 136: + case 137: + return emitAccessorDeclaration(node); case 132: case 131: - return emitFunctionDeclaration(node); - case 137: - case 136: - case 138: - return emitSignatureDeclarationWithJsDocComments(node); - case 134: - case 135: - return emitAccessorDeclaration(node); - case 175: - return emitVariableStatement(node); - case 130: - case 129: return emitPropertyDeclaration(node); - case 197: - return emitInterfaceDeclaration(node); - case 196: - return emitClassDeclaration(node); - case 198: - return emitTypeAliasDeclaration(node); - case 220: + case 226: return emitEnumMemberDeclaration(node); - case 199: - return emitEnumDeclaration(node); - case 200: - return emitModuleDeclaration(node); - case 203: - return emitImportEqualsDeclaration(node); - case 209: + case 214: return emitExportAssignment(node); - case 221: + case 227: return emitSourceFile(node); } } function writeReferencePath(referencedFile) { var declFileName = referencedFile.flags & 2048 ? referencedFile.fileName - : shouldEmitToOwnFile(referencedFile, compilerOptions) - ? getOwnEmitOutputFilePath(referencedFile, host, ".d.ts") + : ts.shouldEmitToOwnFile(referencedFile, compilerOptions) + ? ts.getOwnEmitOutputFilePath(referencedFile, host, ".d.ts") : ts.removeFileExtension(compilerOptions.out) + ".d.ts"; declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(jsFilePath)), declFileName, host.getCurrentDirectory(), host.getCanonicalFileName, false); referencePathsOutput += "/// " + newLine; } } - function getDeclarationDiagnostics(host, resolver, targetSourceFile) { - var diagnostics = []; - var jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, host, ".js"); - emitDeclarations(host, resolver, diagnostics, jsFilePath, targetSourceFile); - return diagnostics; + function writeDeclarationFile(jsFilePath, sourceFile, host, resolver, diagnostics) { + var emitDeclarationResult = emitDeclarations(host, resolver, diagnostics, jsFilePath, sourceFile); + if (!emitDeclarationResult.reportedDeclarationError) { + var declarationOutput = emitDeclarationResult.referencePathsOutput + + getDeclarationOutput(emitDeclarationResult.synchronousDeclarationOutput, emitDeclarationResult.moduleElementDeclarationEmitInfo); + ts.writeFile(host, diagnostics, ts.removeFileExtension(jsFilePath) + ".d.ts", declarationOutput, host.getCompilerOptions().emitBOM); + } + function getDeclarationOutput(synchronousDeclarationOutput, moduleElementDeclarationEmitInfo) { + var appliedSyncOutputPos = 0; + var declarationOutput = ""; + ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { + if (aliasEmitInfo.asynchronousOutput) { + declarationOutput += synchronousDeclarationOutput.substring(appliedSyncOutputPos, aliasEmitInfo.outputPos); + declarationOutput += getDeclarationOutput(aliasEmitInfo.asynchronousOutput, aliasEmitInfo.subModuleElementDeclarationEmitInfo); + appliedSyncOutputPos = aliasEmitInfo.outputPos; + } + }); + declarationOutput += synchronousDeclarationOutput.substring(appliedSyncOutputPos); + return declarationOutput; + } } - ts.getDeclarationDiagnostics = getDeclarationDiagnostics; + ts.writeDeclarationFile = writeDeclarationFile; +})(ts || (ts = {})); +/// +/// +var ts; +(function (ts) { + function isExternalModuleOrDeclarationFile(sourceFile) { + return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); + } + ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; function emitFiles(resolver, host, targetSourceFile) { var compilerOptions = host.getCompilerOptions(); var languageVersion = compilerOptions.target || 0; @@ -18843,8 +19945,8 @@ var ts; var newLine = host.getNewLine(); if (targetSourceFile === undefined) { ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (shouldEmitToOwnFile(sourceFile, compilerOptions)) { - var jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, ".js"); + if (ts.shouldEmitToOwnFile(sourceFile, compilerOptions)) { + var jsFilePath = ts.getOwnEmitOutputFilePath(sourceFile, host, ".js"); emitFile(jsFilePath, sourceFile); } }); @@ -18853,8 +19955,8 @@ var ts; } } else { - if (shouldEmitToOwnFile(targetSourceFile, compilerOptions)) { - var jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, host, ".js"); + if (ts.shouldEmitToOwnFile(targetSourceFile, compilerOptions)) { + var jsFilePath = ts.getOwnEmitOutputFilePath(targetSourceFile, host, ".js"); emitFile(jsFilePath, targetSourceFile); } else if (!ts.isDeclarationFile(targetSourceFile) && compilerOptions.out) { @@ -18867,35 +19969,49 @@ var ts; diagnostics: diagnostics, sourceMaps: sourceMapDataList }; + function isNodeDescendentOf(node, ancestor) { + while (node) { + if (node === ancestor) + return true; + node = node.parent; + } + return false; + } + function isUniqueLocalName(name, container) { + for (var node = container; isNodeDescendentOf(node, container); node = node.nextContainer) { + if (node.locals && ts.hasProperty(node.locals, name)) { + if (node.locals[name].flags & (107455 | 1048576 | 8388608)) { + return false; + } + } + } + return true; + } function emitJavaScript(jsFilePath, root) { - var writer = createTextWriter(newLine); + var writer = ts.createTextWriter(newLine); var write = writer.write; var writeTextOfNode = writer.writeTextOfNode; var writeLine = writer.writeLine; var increaseIndent = writer.increaseIndent; var decreaseIndent = writer.decreaseIndent; - var preserveNewLines = compilerOptions.preserveNewLines || false; var currentSourceFile; - var lastFrame; - var currentScopeNames; - var generatedBlockScopeNames; + var generatedNameSet = {}; + var nodeToGeneratedName = []; + var blockScopedVariableToGeneratedName; + var computedPropertyNamesToGeneratedNames; var extendsEmitted = false; - var tempCount = 0; + var decorateEmitted = false; + var tempFlags = 0; var tempVariables; var tempParameters; var externalImports; var exportSpecifiers; - var exportDefault; + var exportEquals; + var hasExportStars; var writeEmittedFiles = writeJavaScriptFile; - var emitLeadingComments = compilerOptions.removeComments ? function (node) { } : emitLeadingDeclarationComments; - var emitTrailingComments = compilerOptions.removeComments ? function (node) { } : emitTrailingDeclarationComments; - var emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos) { } : emitLeadingCommentsOfLocalPosition; var detachedCommentsInfo; - var emitDetachedComments = compilerOptions.removeComments ? function (node) { } : emitDetachedCommentsAtPosition; - var writeComment = writeCommentRange; - var emitNodeWithoutSourceMap = compilerOptions.removeComments ? emitNodeWithoutSourceMapWithoutComments : emitNodeWithoutSourceMapWithComments; + var writeComment = ts.writeCommentRange; var emit = emitNodeWithoutSourceMap; - var emitWithoutComments = emitNodeWithoutSourceMapWithoutComments; var emitStart = function (node) { }; var emitEnd = function (node) { }; var emitToken = emitTokenText; @@ -18922,55 +20038,108 @@ var ts; currentSourceFile = sourceFile; emit(sourceFile); } - function enterNameScope() { - var names = currentScopeNames; - currentScopeNames = undefined; - if (names) { - lastFrame = { names: names, previous: lastFrame }; - return true; - } - return false; + function isUniqueName(name) { + return !resolver.hasGlobalName(name) && + !ts.hasProperty(currentSourceFile.identifiers, name) && + !ts.hasProperty(generatedNameSet, name); } - function exitNameScope(popFrame) { - if (popFrame) { - currentScopeNames = lastFrame.names; - lastFrame = lastFrame.previous; - } - else { - currentScopeNames = undefined; - } - } - function generateUniqueNameForLocation(location, baseName) { - var _name; - if (!isExistingName(location, baseName)) { - _name = baseName; - } - else { - _name = ts.generateUniqueName(baseName, function (n) { return isExistingName(location, n); }); - } - return recordNameInCurrentScope(_name); - } - function recordNameInCurrentScope(name) { - if (!currentScopeNames) { - currentScopeNames = {}; - } - return currentScopeNames[name] = name; - } - function isExistingName(location, name) { - if (!resolver.isUnknownIdentifier(location, name)) { - return true; - } - if (currentScopeNames && ts.hasProperty(currentScopeNames, name)) { - return true; - } - var frame = lastFrame; - while (frame) { - if (ts.hasProperty(frame.names, name)) { - return true; + function makeTempVariableName(flags) { + if (flags && !(tempFlags & flags)) { + var name = flags === 268435456 ? "_i" : "_n"; + if (isUniqueName(name)) { + tempFlags |= flags; + return name; } - frame = frame.previous; } - return false; + while (true) { + var count = tempFlags & 268435455; + tempFlags++; + if (count !== 8 && count !== 13) { + var name_12 = count < 26 ? "_" + String.fromCharCode(97 + count) : "_" + (count - 26); + if (isUniqueName(name_12)) { + return name_12; + } + } + } + } + function makeUniqueName(baseName) { + if (baseName.charCodeAt(baseName.length - 1) !== 95) { + baseName += "_"; + } + var i = 1; + while (true) { + var generatedName = baseName + i; + if (isUniqueName(generatedName)) { + return generatedNameSet[generatedName] = generatedName; + } + i++; + } + } + function assignGeneratedName(node, name) { + nodeToGeneratedName[ts.getNodeId(node)] = ts.unescapeIdentifier(name); + } + function generateNameForFunctionOrClassDeclaration(node) { + if (!node.name) { + assignGeneratedName(node, makeUniqueName("default")); + } + } + function generateNameForModuleOrEnum(node) { + if (node.name.kind === 65) { + var name_13 = node.name.text; + assignGeneratedName(node, isUniqueLocalName(name_13, node) ? name_13 : makeUniqueName(name_13)); + } + } + function generateNameForImportOrExportDeclaration(node) { + var expr = ts.getExternalModuleName(node); + var baseName = expr.kind === 8 ? + ts.escapeIdentifier(ts.makeIdentifierFromModuleName(expr.text)) : "module"; + assignGeneratedName(node, makeUniqueName(baseName)); + } + function generateNameForImportDeclaration(node) { + if (node.importClause) { + generateNameForImportOrExportDeclaration(node); + } + } + function generateNameForExportDeclaration(node) { + if (node.moduleSpecifier) { + generateNameForImportOrExportDeclaration(node); + } + } + function generateNameForExportAssignment(node) { + if (node.expression && node.expression.kind !== 65) { + assignGeneratedName(node, makeUniqueName("default")); + } + } + function generateNameForNode(node) { + switch (node.kind) { + case 200: + case 201: + generateNameForFunctionOrClassDeclaration(node); + break; + case 205: + generateNameForModuleOrEnum(node); + generateNameForNode(node.body); + break; + case 204: + generateNameForModuleOrEnum(node); + break; + case 209: + generateNameForImportDeclaration(node); + break; + case 215: + generateNameForExportDeclaration(node); + break; + case 214: + generateNameForExportAssignment(node); + break; + } + } + function getGeneratedNameForNode(node) { + var nodeId = ts.getNodeId(node); + if (!nodeToGeneratedName[nodeId]) { + generateNameForNode(node); + } + return nodeToGeneratedName[nodeId]; } function initializeEmitterWithSourceMaps() { var sourceMapDir; @@ -19096,8 +20265,8 @@ var ts; if (scopeName) { var parentIndex = getSourceMapNameIndex(); if (parentIndex !== -1) { - var _name = node.name; - if (!_name || _name.kind !== 126) { + var name_14 = node.name; + if (!name_14 || name_14.kind !== 127) { scopeName = "." + scopeName; } scopeName = sourceMapData.sourceMapNames[parentIndex] + scopeName; @@ -19114,19 +20283,19 @@ var ts; if (scopeName) { recordScopeNameStart(scopeName); } - else if (node.kind === 195 || - node.kind === 160 || - node.kind === 132 || - node.kind === 131 || + else if (node.kind === 200 || + node.kind === 162 || node.kind === 134 || - node.kind === 135 || - node.kind === 200 || - node.kind === 196 || - node.kind === 199) { + node.kind === 133 || + node.kind === 136 || + node.kind === 137 || + node.kind === 205 || + node.kind === 201 || + node.kind === 204) { if (node.name) { - var _name = node.name; - scopeName = _name.kind === 126 - ? ts.getTextOfNode(_name) + var name_15 = node.name; + scopeName = name_15.kind === 127 + ? ts.getTextOfNode(name_15) : node.name.text; } recordScopeNameStart(scopeName); @@ -19141,7 +20310,7 @@ var ts; ; function writeCommentRangeWithMap(curentSourceFile, writer, comment, newLine) { recordSourceMapSpan(comment.pos); - writeCommentRange(currentSourceFile, writer, comment, newLine); + ts.writeCommentRange(currentSourceFile, writer, comment, newLine); recordSourceMapSpan(comment.end); } function serializeSourceMapContents(version, file, sourceRoot, sources, names, mappings) { @@ -19169,7 +20338,7 @@ var ts; } function writeJavaScriptAndSourceMapFile(emitOutput, writeByteOrderMark) { encodeLastRecordedSourceMapSpan(); - writeFile(host, diagnostics, sourceMapData.sourceMapFilePath, serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings), false); + ts.writeFile(host, diagnostics, sourceMapData.sourceMapFilePath, serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings), false); sourceMapDataList.push(sourceMapData); writeJavaScriptFile(emitOutput + "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL, writeByteOrderMark); } @@ -19192,7 +20361,7 @@ var ts; if (compilerOptions.mapRoot) { sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); if (root) { - sourceMapDir = ts.getDirectoryPath(getSourceFilePathInNewDir(root, host, sourceMapDir)); + sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(root, host, sourceMapDir)); } if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir); @@ -19205,32 +20374,24 @@ var ts; else { sourceMapDir = ts.getDirectoryPath(ts.normalizePath(jsFilePath)); } - function emitNodeWithSourceMap(node) { + function emitNodeWithSourceMap(node, allowGeneratedIdentifiers) { if (node) { if (ts.nodeIsSynthesized(node)) { - return emitNodeWithoutSourceMap(node); + return emitNodeWithoutSourceMap(node, false); } - if (node.kind != 221) { + if (node.kind != 227) { recordEmitNodeStartSpan(node); - emitNodeWithoutSourceMap(node); + emitNodeWithoutSourceMap(node, allowGeneratedIdentifiers); recordEmitNodeEndSpan(node); } else { recordNewSourceFileStart(node); - emitNodeWithoutSourceMap(node); + emitNodeWithoutSourceMap(node, false); } } } - function emitNodeWithSourceMapWithoutComments(node) { - if (node) { - recordEmitNodeStartSpan(node); - emitNodeWithoutSourceMapWithoutComments(node); - recordEmitNodeEndSpan(node); - } - } writeEmittedFiles = writeJavaScriptAndSourceMapFile; emit = emitNodeWithSourceMap; - emitWithoutComments = emitNodeWithSourceMapWithoutComments; emitStart = recordEmitNodeStartSpan; emitEnd = recordEmitNodeEndSpan; emitToken = writeTextWithSpanRecord; @@ -19239,24 +20400,11 @@ var ts; writeComment = writeCommentRangeWithMap; } function writeJavaScriptFile(emitOutput, writeByteOrderMark) { - writeFile(host, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); + ts.writeFile(host, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); } - function createTempVariable(location, preferredName) { - for (var name = preferredName; !name || isExistingName(location, name); tempCount++) { - var char = 97 + tempCount; - if (char === 105 || char === 110) { - continue; - } - if (tempCount < 26) { - name = "_" + String.fromCharCode(char); - } - else { - name = "_" + (tempCount - 26); - } - } - recordNameInCurrentScope(name); - var result = ts.createSynthesizedNode(64); - result.text = name; + function createTempVariable(flags) { + var result = ts.createSynthesizedNode(65); + result.text = makeTempVariableName(flags); return result; } function recordTempDeclaration(name) { @@ -19265,8 +20413,8 @@ var ts; } tempVariables.push(name); } - function createAndRecordTempVariable(location, preferredName) { - var temp = createTempVariable(location, preferredName); + function createAndRecordTempVariable(flags) { + var temp = createTempVariable(flags); recordTempDeclaration(temp); return temp; } @@ -19316,7 +20464,7 @@ var ts; function emitLinePreservingList(parent, nodes, allowTrailingComma, spacesBetweenBraces) { ts.Debug.assert(nodes.length > 0); increaseIndent(); - if (preserveNewLines && nodeStartPositionsAreOnSameLine(parent, nodes[0])) { + if (nodeStartPositionsAreOnSameLine(parent, nodes[0])) { if (spacesBetweenBraces) { write(" "); } @@ -19326,7 +20474,7 @@ var ts; } for (var i = 0, n = nodes.length; i < n; i++) { if (i) { - if (preserveNewLines && nodeEndIsOnSameLineAsNodeStart(nodes[i - 1], nodes[i])) { + if (nodeEndIsOnSameLineAsNodeStart(nodes[i - 1], nodes[i])) { write(", "); } else { @@ -19340,7 +20488,7 @@ var ts; write(","); } decreaseIndent(); - if (preserveNewLines && nodeEndPositionsAreOnSameLine(parent, ts.lastOrUndefined(nodes))) { + if (nodeEndPositionsAreOnSameLine(parent, ts.lastOrUndefined(nodes))) { if (spacesBetweenBraces) { write(" "); } @@ -19458,7 +20606,7 @@ var ts; write("]"); } function emitDownlevelTaggedTemplate(node) { - var tempVariable = createAndRecordTempVariable(node); + var tempVariable = createAndRecordTempVariable(0); write("("); emit(tempVariable); write(" = "); @@ -19471,10 +20619,10 @@ var ts; emitParenthesizedIf(node.tag, needsParenthesisForPropertyAccessOrInvocation(node.tag)); write("("); emit(tempVariable); - if (node.template.kind === 169) { + if (node.template.kind === 171) { ts.forEach(node.template.templateSpans, function (templateSpan) { write(", "); - var needsParens = templateSpan.expression.kind === 167 + var needsParens = templateSpan.expression.kind === 169 && templateSpan.expression.operatorToken.kind === 23; emitParenthesizedIf(templateSpan.expression, needsParens); }); @@ -19498,7 +20646,7 @@ var ts; } for (var i = 0, n = node.templateSpans.length; i < n; i++) { var templateSpan = node.templateSpans[i]; - var needsParens = templateSpan.expression.kind !== 159 + var needsParens = templateSpan.expression.kind !== 161 && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1; if (i > 0 || headEmitted) { write(" + "); @@ -19513,16 +20661,29 @@ var ts; write(")"); } function shouldEmitTemplateHead() { + // If this expression has an empty head literal and the first template span has a non-empty + // literal, then emitting the empty head literal is not necessary. + // `${ foo } and ${ bar }` + // can be emitted as + // foo + " and " + bar + // This is because it is only required that one of the first two operands in the emit + // output must be a string literal, so that the other operand and all following operands + // are forced into strings. + // + // If the first template span has an empty literal, then the head must still be emitted. + // `${ foo }${ bar }` + // must still be emitted as + // "" + foo + bar ts.Debug.assert(node.templateSpans.length !== 0); return node.head.text.length !== 0 || node.templateSpans[0].literal.text.length === 0; } function templateNeedsParens(template, parent) { switch (parent.kind) { - case 155: - case 156: - return parent.expression === template; case 157: + case 158: + return parent.expression === template; case 159: + case 161: return false; default: return comparePrecedenceToBinaryPlus(parent) !== -1; @@ -19530,7 +20691,7 @@ var ts; } function comparePrecedenceToBinaryPlus(expression) { switch (expression.kind) { - case 167: + case 169: switch (expression.operatorToken.kind) { case 35: case 36: @@ -19542,7 +20703,7 @@ var ts; default: return -1; } - case 168: + case 170: return -1; default: return 1; @@ -19554,11 +20715,27 @@ var ts; emit(span.literal); } function emitExpressionForPropertyName(node) { - ts.Debug.assert(node.kind !== 150); + ts.Debug.assert(node.kind !== 152); if (node.kind === 8) { emitLiteral(node); } - else if (node.kind === 126) { + else if (node.kind === 127) { + if (ts.nodeIsDecorated(node.parent)) { + if (!computedPropertyNamesToGeneratedNames) { + computedPropertyNamesToGeneratedNames = []; + } + var generatedName = computedPropertyNamesToGeneratedNames[node.id]; + if (generatedName) { + write(generatedName); + return; + } + var generatedVariable = createTempVariable(0); + generatedName = generatedVariable.text; + recordTempDeclaration(generatedVariable); + computedPropertyNamesToGeneratedNames[node.id] = generatedName; + write(generatedName); + write(" = "); + } emit(node.expression); } else { @@ -19573,38 +20750,43 @@ var ts; } } function isNotExpressionIdentifier(node) { - var _parent = node.parent; - switch (_parent.kind) { - case 128: - case 193: - case 150: - case 130: + var parent = node.parent; + switch (parent.kind) { case 129: - case 218: - case 219: - case 220: + case 198: + case 152: case 132: case 131: - case 195: + case 224: + case 225: + case 226: case 134: - case 135: - case 160: - case 196: - case 197: - case 199: + case 133: case 200: - case 203: - return _parent.name === node; - case 185: - case 184: - case 209: - return false; + case 136: + case 137: + case 162: + case 201: + case 202: + case 204: + case 205: + case 208: + case 210: + case 211: + return parent.name === node; + case 213: + case 217: + return parent.name === node || parent.propertyName === node; + case 190: case 189: + case 214: + return false; + case 194: return node.parent.label === node; } } function emitExpressionIdentifier(node) { - var substitution = resolver.getExpressionNameSubstitution(node); + var substitution = resolver.getExpressionNameSubstitution(node, getGeneratedNameForNode); if (substitution) { write(substitution); } @@ -19612,15 +20794,21 @@ var ts; writeTextOfNode(currentSourceFile, node); } } - function getBlockScopedVariableId(node) { - return !ts.nodeIsSynthesized(node) && resolver.getBlockScopedVariableId(node); + function getGeneratedNameForIdentifier(node) { + if (ts.nodeIsSynthesized(node) || !blockScopedVariableToGeneratedName) { + return undefined; + } + var variableId = resolver.getBlockScopedVariableId(node); + if (variableId === undefined) { + return undefined; + } + return blockScopedVariableToGeneratedName[variableId]; } - function emitIdentifier(node) { - var variableId = getBlockScopedVariableId(node); - if (variableId !== undefined && generatedBlockScopeNames) { - var text = generatedBlockScopeNames[variableId]; - if (text) { - write(text); + function emitIdentifier(node, allowGeneratedIdentifiers) { + if (allowGeneratedIdentifiers) { + var generatedName = getGeneratedNameForIdentifier(node); + if (generatedName) { + write(generatedName); return; } } @@ -19643,15 +20831,17 @@ var ts; } } function emitSuper(node) { - var flags = resolver.getNodeCheckFlags(node); - if (flags & 16) { - write("_super.prototype"); - } - else if (flags & 32) { - write("_super"); + if (languageVersion >= 2) { + write("super"); } else { - write("super"); + var flags = resolver.getNodeCheckFlags(node); + if (flags & 16) { + write("_super.prototype"); + } + else { + write("_super"); + } } } function emitObjectBindingPattern(node) { @@ -19668,7 +20858,7 @@ var ts; } function emitBindingElement(node) { if (node.propertyName) { - emit(node.propertyName); + emit(node.propertyName, false); write(": "); } if (node.dotDotDotToken) { @@ -19688,12 +20878,12 @@ var ts; } function needsParenthesisForPropertyAccessOrInvocation(node) { switch (node.kind) { - case 64: - case 151: + case 65: case 153: - case 154: case 155: - case 159: + case 156: + case 157: + case 161: return false; } return true; @@ -19701,8 +20891,8 @@ var ts; function emitListWithSpread(elements, multiLine, trailingComma) { var pos = 0; var group = 0; - var _length = elements.length; - while (pos < _length) { + var length = elements.length; + while (pos < length) { if (group === 1) { write(".concat("); } @@ -19710,21 +20900,21 @@ var ts; write(", "); } var e = elements[pos]; - if (e.kind === 171) { + if (e.kind === 173) { e = e.expression; emitParenthesizedIf(e, group === 0 && needsParenthesisForPropertyAccessOrInvocation(e)); pos++; } else { var i = pos; - while (i < _length && elements[i].kind !== 171) { + while (i < length && elements[i].kind !== 173) { i++; } write("["); if (multiLine) { increaseIndent(); } - emitList(elements, pos, i - pos, multiLine, trailingComma && i === _length); + emitList(elements, pos, i - pos, multiLine, trailingComma && i === length); if (multiLine) { decreaseIndent(); } @@ -19738,7 +20928,7 @@ var ts; } } function isSpreadElementExpression(node) { - return node.kind === 171; + return node.kind === 173; } function emitArrayLiteral(node) { var elements = node.elements; @@ -19759,11 +20949,11 @@ var ts; return emit(parenthesizedObjectLiteral); } function createDownlevelObjectLiteralWithComputedProperties(originalObjectLiteral, firstComputedPropertyIndex) { - var tempVar = createAndRecordTempVariable(originalObjectLiteral); - var initialObjectLiteral = ts.createSynthesizedNode(152); + var tempVar = createAndRecordTempVariable(0); + var initialObjectLiteral = ts.createSynthesizedNode(154); initialObjectLiteral.properties = originalObjectLiteral.properties.slice(0, firstComputedPropertyIndex); initialObjectLiteral.flags |= 512; - var propertyPatches = createBinaryExpression(tempVar, 52, initialObjectLiteral); + var propertyPatches = createBinaryExpression(tempVar, 53, initialObjectLiteral); ts.forEach(originalObjectLiteral.properties, function (property) { var patchedProperty = tryCreatePatchingPropertyAssignment(originalObjectLiteral, tempVar, property); if (patchedProperty) { @@ -19781,33 +20971,33 @@ var ts; function tryCreatePatchingPropertyAssignment(objectLiteral, tempVar, property) { var leftHandSide = createMemberAccessForPropertyName(tempVar, property.name); var maybeRightHandSide = tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral, property); - return maybeRightHandSide && createBinaryExpression(leftHandSide, 52, maybeRightHandSide, true); + return maybeRightHandSide && createBinaryExpression(leftHandSide, 53, maybeRightHandSide, true); } function tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral, property) { switch (property.kind) { - case 218: + case 224: return property.initializer; - case 219: - return createIdentifier(resolver.getExpressionNameSubstitution(property.name)); - case 132: - return createFunctionExpression(property.parameters, property.body); + case 225: + return createIdentifier(resolver.getExpressionNameSubstitution(property.name, getGeneratedNameForNode)); case 134: - case 135: - var _a = getAllAccessorDeclarations(objectLiteral.properties, property), firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor; + return createFunctionExpression(property.parameters, property.body); + case 136: + case 137: + var _a = ts.getAllAccessorDeclarations(objectLiteral.properties, property), firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor; if (firstAccessor !== property) { return undefined; } - var propertyDescriptor = ts.createSynthesizedNode(152); + var propertyDescriptor = ts.createSynthesizedNode(154); var descriptorProperties = []; if (getAccessor) { - var _getProperty = createPropertyAssignment(createIdentifier("get"), createFunctionExpression(getAccessor.parameters, getAccessor.body)); - descriptorProperties.push(_getProperty); + var getProperty_1 = createPropertyAssignment(createIdentifier("get"), createFunctionExpression(getAccessor.parameters, getAccessor.body)); + descriptorProperties.push(getProperty_1); } if (setAccessor) { var setProperty = createPropertyAssignment(createIdentifier("set"), createFunctionExpression(setAccessor.parameters, setAccessor.body)); descriptorProperties.push(setProperty); } - var trueExpr = ts.createSynthesizedNode(94); + var trueExpr = ts.createSynthesizedNode(95); var enumerableTrue = createPropertyAssignment(createIdentifier("enumerable"), trueExpr); descriptorProperties.push(enumerableTrue); var configurableTrue = createPropertyAssignment(createIdentifier("configurable"), trueExpr); @@ -19820,14 +21010,14 @@ var ts; } } function createParenthesizedExpression(expression) { - var result = ts.createSynthesizedNode(159); + var result = ts.createSynthesizedNode(161); result.expression = expression; return result; } function createNodeArray() { var elements = []; - for (var _i = 0; _i < arguments.length; _i++) { - elements[_i - 0] = arguments[_i]; + for (var _a = 0; _a < arguments.length; _a++) { + elements[_a - 0] = arguments[_a]; } var result = elements; result.pos = -1; @@ -19835,25 +21025,25 @@ var ts; return result; } function createBinaryExpression(left, operator, right, startsOnNewLine) { - var result = ts.createSynthesizedNode(167, startsOnNewLine); + var result = ts.createSynthesizedNode(169, startsOnNewLine); result.operatorToken = ts.createSynthesizedNode(operator); result.left = left; result.right = right; return result; } function createExpressionStatement(expression) { - var result = ts.createSynthesizedNode(177); + var result = ts.createSynthesizedNode(182); result.expression = expression; return result; } function createMemberAccessForPropertyName(expression, memberName) { - if (memberName.kind === 64) { + if (memberName.kind === 65) { return createPropertyAccessExpression(expression, memberName); } else if (memberName.kind === 8 || memberName.kind === 7) { return createElementAccessExpression(expression, memberName); } - else if (memberName.kind === 126) { + else if (memberName.kind === 127) { return createElementAccessExpression(expression, memberName.expression); } else { @@ -19861,37 +21051,37 @@ var ts; } } function createPropertyAssignment(name, initializer) { - var result = ts.createSynthesizedNode(218); + var result = ts.createSynthesizedNode(224); result.name = name; result.initializer = initializer; return result; } function createFunctionExpression(parameters, body) { - var result = ts.createSynthesizedNode(160); + var result = ts.createSynthesizedNode(162); result.parameters = parameters; result.body = body; return result; } function createPropertyAccessExpression(expression, name) { - var result = ts.createSynthesizedNode(153); + var result = ts.createSynthesizedNode(155); result.expression = expression; result.dotToken = ts.createSynthesizedNode(20); result.name = name; return result; } function createElementAccessExpression(expression, argumentExpression) { - var result = ts.createSynthesizedNode(154); + var result = ts.createSynthesizedNode(156); result.expression = expression; result.argumentExpression = argumentExpression; return result; } function createIdentifier(name, startsOnNewLine) { - var result = ts.createSynthesizedNode(64, startsOnNewLine); + var result = ts.createSynthesizedNode(65, startsOnNewLine); result.text = name; return result; } function createCallExpression(invokedExpression, arguments) { - var result = ts.createSynthesizedNode(155); + var result = ts.createSynthesizedNode(157); result.expression = invokedExpression; result.arguments = arguments; return result; @@ -19902,7 +21092,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 === 126) { + if (properties[i].name.kind === 127) { numInitialNonComputedProperties = i; break; } @@ -19921,34 +21111,47 @@ var ts; } function emitComputedPropertyName(node) { write("["); - emit(node.expression); + emitExpressionForPropertyName(node); write("]"); } function emitMethod(node) { - emit(node.name); + emit(node.name, false); if (languageVersion < 2) { write(": function "); } emitSignatureAndBody(node); } function emitPropertyAssignment(node) { - emit(node.name); + emit(node.name, false); write(": "); emit(node.initializer); } function emitShorthandPropertyAssignment(node) { - emit(node.name); - if (languageVersion < 2 || resolver.getExpressionNameSubstitution(node.name)) { + emit(node.name, false); + if (languageVersion < 2) { + write(": "); + var generatedName = getGeneratedNameForIdentifier(node.name); + if (generatedName) { + write(generatedName); + } + else { + emitExpressionIdentifier(node.name); + } + } + else if (resolver.getExpressionNameSubstitution(node.name, getGeneratedNameForNode)) { write(": "); emitExpressionIdentifier(node.name); } } function tryEmitConstantValue(node) { + if (compilerOptions.separateCompilation) { + return false; + } var constantValue = resolver.getConstantValue(node); if (constantValue !== undefined) { write(constantValue.toString()); if (!compilerOptions.removeComments) { - var propertyName = node.kind === 153 ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); + var propertyName = node.kind === 155 ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); write(" /* " + propertyName + " */"); } return true; @@ -19956,7 +21159,7 @@ var ts; return false; } function indentIfOnDifferentLines(parent, node1, node2, valueToWriteWhenNotIndenting) { - var realNodesAreOnDifferentLines = preserveNewLines && !ts.nodeIsSynthesized(parent) && !nodeEndIsOnSameLineAsNodeStart(node1, node2); + var realNodesAreOnDifferentLines = !ts.nodeIsSynthesized(parent) && !nodeEndIsOnSameLineAsNodeStart(node1, node2); var synthesizedNodeIsOnDifferentLine = synthesizedNodeStartsOnNewLine(node2); if (realNodesAreOnDifferentLines || synthesizedNodeIsOnDifferentLine) { increaseIndent(); @@ -19978,7 +21181,7 @@ var ts; var indentedBeforeDot = indentIfOnDifferentLines(node, node.expression, node.dotToken); write("."); var indentedAfterDot = indentIfOnDifferentLines(node, node.dotToken, node.name); - emit(node.name); + emit(node.name, false); decreaseIndentIf(indentedBeforeDot, indentedAfterDot); } function emitQualifiedName(node) { @@ -19996,20 +21199,20 @@ var ts; write("]"); } function hasSpreadElement(elements) { - return ts.forEach(elements, function (e) { return e.kind === 171; }); + return ts.forEach(elements, function (e) { return e.kind === 173; }); } function skipParentheses(node) { - while (node.kind === 159 || node.kind === 158) { + while (node.kind === 161 || node.kind === 160) { node = node.expression; } return node; } function emitCallTarget(node) { - if (node.kind === 64 || node.kind === 92 || node.kind === 90) { + if (node.kind === 65 || node.kind === 93 || node.kind === 91) { emit(node); return node; } - var temp = createAndRecordTempVariable(node); + var temp = createAndRecordTempVariable(0); write("("); emit(temp); write(" = "); @@ -20020,18 +21223,18 @@ var ts; function emitCallWithSpread(node) { var target; var expr = skipParentheses(node.expression); - if (expr.kind === 153) { + if (expr.kind === 155) { target = emitCallTarget(expr.expression); write("."); emit(expr.name); } - else if (expr.kind === 154) { + else if (expr.kind === 156) { target = emitCallTarget(expr.expression); write("["); emit(expr.argumentExpression); write("]"); } - else if (expr.kind === 90) { + else if (expr.kind === 91) { target = expr; write("_super"); } @@ -20040,7 +21243,7 @@ var ts; } write(".apply("); if (target) { - if (target.kind === 90) { + if (target.kind === 91) { emitThis(target); } else { @@ -20060,15 +21263,15 @@ var ts; return; } var superCall = false; - if (node.expression.kind === 90) { - write("_super"); + if (node.expression.kind === 91) { + emitSuper(node.expression); superCall = true; } else { emit(node.expression); - superCall = node.expression.kind === 153 && node.expression.expression.kind === 90; + superCall = node.expression.kind === 155 && node.expression.expression.kind === 91; } - if (superCall) { + if (superCall && languageVersion < 2) { write(".call("); emitThis(node.expression); if (node.arguments.length) { @@ -20093,7 +21296,7 @@ var ts; } } function emitTaggedTemplateExpression(node) { - if (compilerOptions.target >= 2) { + if (languageVersion >= 2) { emit(node.tag); write(" "); emit(node.template); @@ -20103,20 +21306,20 @@ var ts; } } function emitParenExpression(node) { - if (!node.parent || node.parent.kind !== 161) { - if (node.expression.kind === 158) { + if (!node.parent || node.parent.kind !== 163) { + if (node.expression.kind === 160) { var operand = node.expression.expression; - while (operand.kind == 158) { + while (operand.kind == 160) { operand = operand.expression; } - if (operand.kind !== 165 && - operand.kind !== 164 && - operand.kind !== 163 && - operand.kind !== 162 && + if (operand.kind !== 167 && operand.kind !== 166 && - operand.kind !== 156 && - !(operand.kind === 155 && node.parent.kind === 156) && - !(operand.kind === 160 && node.parent.kind === 155)) { + 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)) { emit(operand); return; } @@ -20127,23 +21330,23 @@ var ts; write(")"); } function emitDeleteExpression(node) { - write(ts.tokenToString(73)); + write(ts.tokenToString(74)); write(" "); emit(node.expression); } function emitVoidExpression(node) { - write(ts.tokenToString(98)); + write(ts.tokenToString(99)); write(" "); emit(node.expression); } function emitTypeOfExpression(node) { - write(ts.tokenToString(96)); + write(ts.tokenToString(97)); write(" "); emit(node.expression); } function emitPrefixUnaryExpression(node) { write(ts.tokenToString(node.operator)); - if (node.operand.kind === 165) { + if (node.operand.kind === 167) { var operand = node.operand; if (node.operator === 33 && (operand.operator === 33 || operand.operator === 38)) { write(" "); @@ -20159,9 +21362,9 @@ var ts; write(ts.tokenToString(node.operator)); } function emitBinaryExpression(node) { - if (languageVersion < 2 && node.operatorToken.kind === 52 && - (node.left.kind === 152 || node.left.kind === 151)) { - emitDestructuring(node, node.parent.kind === 177); + if (languageVersion < 2 && node.operatorToken.kind === 53 && + (node.left.kind === 154 || node.left.kind === 153)) { + emitDestructuring(node, node.parent.kind === 182); } else { emit(node.left); @@ -20197,13 +21400,13 @@ var ts; } } function isSingleLineEmptyBlock(node) { - if (node && node.kind === 174) { + if (node && node.kind === 179) { var block = node; return block.statements.length === 0 && nodeEndIsOnSameLineAsNodeStart(block, block); } } function emitBlock(node) { - if (preserveNewLines && isSingleLineEmptyBlock(node)) { + if (isSingleLineEmptyBlock(node)) { emitToken(14, node.pos); write(" "); emitToken(15, node.statements.end); @@ -20212,12 +21415,12 @@ var ts; emitToken(14, node.pos); increaseIndent(); scopeEmitStart(node.parent); - if (node.kind === 201) { - ts.Debug.assert(node.parent.kind === 200); + if (node.kind === 206) { + ts.Debug.assert(node.parent.kind === 205); emitCaptureThisForNodeIfNecessary(node.parent); } emitLines(node.statements); - if (node.kind === 201) { + if (node.kind === 206) { emitTempDeclarations(true); } decreaseIndent(); @@ -20226,7 +21429,7 @@ var ts; scopeEmitEnd(); } function emitEmbeddedStatement(node) { - if (node.kind === 174) { + if (node.kind === 179) { write(" "); emit(node); } @@ -20238,11 +21441,11 @@ var ts; } } function emitExpressionStatement(node) { - emitParenthesizedIf(node.expression, node.expression.kind === 161); + emitParenthesizedIf(node.expression, node.expression.kind === 163); write(";"); } function emitIfStatement(node) { - var endPos = emitToken(83, node.pos); + var endPos = emitToken(84, node.pos); write(" "); endPos = emitToken(16, endPos); emit(node.expression); @@ -20250,8 +21453,8 @@ var ts; emitEmbeddedStatement(node.thenStatement); if (node.elseStatement) { writeLine(); - emitToken(75, node.thenStatement.end); - if (node.elseStatement.kind === 178) { + emitToken(76, node.thenStatement.end); + if (node.elseStatement.kind === 183) { write(" "); emit(node.elseStatement); } @@ -20263,7 +21466,7 @@ var ts; function emitDoStatement(node) { write("do"); emitEmbeddedStatement(node.statement); - if (node.statement.kind === 174) { + if (node.statement.kind === 179) { write(" "); } else { @@ -20280,13 +21483,13 @@ var ts; emitEmbeddedStatement(node.statement); } function emitStartOfVariableDeclarationList(decl, startPos) { - var tokenKind = 97; + var tokenKind = 98; if (decl && languageVersion >= 2) { if (ts.isLet(decl)) { - tokenKind = 104; + tokenKind = 105; } else if (ts.isConst(decl)) { - tokenKind = 69; + tokenKind = 70; } } if (startPos !== undefined) { @@ -20294,20 +21497,20 @@ var ts; } else { switch (tokenKind) { - case 97: + case 98: return write("var "); - case 104: + case 105: return write("let "); - case 69: + case 70: return write("const "); } } } function emitForStatement(node) { - var endPos = emitToken(81, node.pos); + var endPos = emitToken(82, node.pos); write(" "); endPos = emitToken(16, endPos); - if (node.initializer && node.initializer.kind === 194) { + if (node.initializer && node.initializer.kind === 199) { var variableDeclarationList = node.initializer; var declarations = variableDeclarationList.declarations; emitStartOfVariableDeclarationList(declarations[0], endPos); @@ -20325,13 +21528,13 @@ var ts; emitEmbeddedStatement(node.statement); } function emitForInOrForOfStatement(node) { - if (languageVersion < 2 && node.kind === 183) { + if (languageVersion < 2 && node.kind === 188) { return emitDownLevelForOfStatement(node); } - var endPos = emitToken(81, node.pos); + var endPos = emitToken(82, node.pos); write(" "); endPos = emitToken(16, endPos); - if (node.initializer.kind === 194) { + if (node.initializer.kind === 199) { var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length >= 1) { var decl = variableDeclarationList.declarations[0]; @@ -20343,7 +21546,7 @@ var ts; else { emit(node.initializer); } - if (node.kind === 182) { + if (node.kind === 187) { write(" in "); } else { @@ -20354,13 +21557,32 @@ var ts; emitEmbeddedStatement(node.statement); } function emitDownLevelForOfStatement(node) { - var endPos = emitToken(81, node.pos); + // The following ES6 code: + // + // for (let v of expr) { } + // + // should be emitted as + // + // for (let _i = 0, _a = expr; _i < _a.length; _i++) { + // let v = _a[_i]; + // } + // + // where _a and _i are temps emitted to capture the RHS and the counter, + // respectively. + // When the left hand side is an expression instead of a let declaration, + // the "let v" is not emitted. + // When the left hand side is a let/const, the v is renamed if there is + // another v in scope. + // Note that all assignments to the LHS are emitted in the body, including + // all destructuring. + // Note also that because an extra statement is needed to assign to the LHS, + // for-of bodies are always emitted as blocks. + var endPos = emitToken(82, node.pos); write(" "); endPos = emitToken(16, endPos); - var rhsIsIdentifier = node.expression.kind === 64; - var counter = createTempVariable(node, "_i"); - var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(node); - var cachedLength = compilerOptions.cacheDownlevelForOfLength ? createTempVariable(node, "_n") : undefined; + var rhsIsIdentifier = node.expression.kind === 65; + var counter = createTempVariable(268435456); + var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(0); emitStart(node.expression); write("var "); emitNodeWithoutSourceMap(counter); @@ -20374,24 +21596,12 @@ var ts; emitNodeWithoutSourceMap(node.expression); emitEnd(node.expression); } - if (cachedLength) { - write(", "); - emitNodeWithoutSourceMap(cachedLength); - write(" = "); - emitNodeWithoutSourceMap(rhsReference); - write(".length"); - } write("; "); emitStart(node.initializer); emitNodeWithoutSourceMap(counter); write(" < "); - if (cachedLength) { - emitNodeWithoutSourceMap(cachedLength); - } - else { - emitNodeWithoutSourceMap(rhsReference); - write(".length"); - } + emitNodeWithoutSourceMap(rhsReference); + write(".length"); emitEnd(node.initializer); write("; "); emitStart(node.initializer); @@ -20404,7 +21614,7 @@ var ts; increaseIndent(); var rhsIterationValue = createElementAccessExpression(rhsReference, counter); emitStart(node.initializer); - if (node.initializer.kind === 194) { + if (node.initializer.kind === 199) { write("var "); var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -20419,14 +21629,14 @@ var ts; } } else { - emitNodeWithoutSourceMap(createTempVariable(node)); + emitNodeWithoutSourceMap(createTempVariable(0)); write(" = "); emitNodeWithoutSourceMap(rhsIterationValue); } } else { - var assignmentExpression = createBinaryExpression(node.initializer, 52, rhsIterationValue, false); - if (node.initializer.kind === 151 || node.initializer.kind === 152) { + var assignmentExpression = createBinaryExpression(node.initializer, 53, rhsIterationValue, false); + if (node.initializer.kind === 153 || node.initializer.kind === 154) { emitDestructuring(assignmentExpression, true, undefined, node); } else { @@ -20435,7 +21645,7 @@ var ts; } emitEnd(node.initializer); write(";"); - if (node.statement.kind === 174) { + if (node.statement.kind === 179) { emitLines(node.statement.statements); } else { @@ -20447,12 +21657,12 @@ var ts; write("}"); } function emitBreakOrContinueStatement(node) { - emitToken(node.kind === 185 ? 65 : 70, node.pos); + emitToken(node.kind === 190 ? 66 : 71, node.pos); emitOptional(" ", node.label); write(";"); } function emitReturnStatement(node) { - emitToken(89, node.pos); + emitToken(90, node.pos); emitOptional(" ", node.expression); write(";"); } @@ -20463,7 +21673,7 @@ var ts; emitEmbeddedStatement(node.statement); } function emitSwitchStatement(node) { - var endPos = emitToken(91, node.pos); + var endPos = emitToken(92, node.pos); write(" "); emitToken(16, endPos); emit(node.expression); @@ -20480,19 +21690,19 @@ var ts; emitToken(15, node.clauses.end); } function nodeStartPositionsAreOnSameLine(node1, node2) { - return getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node1.pos)) === - getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); + return ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node1.pos)) === + ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); } function nodeEndPositionsAreOnSameLine(node1, node2) { - return getLineOfLocalPosition(currentSourceFile, node1.end) === - getLineOfLocalPosition(currentSourceFile, node2.end); + return ts.getLineOfLocalPosition(currentSourceFile, node1.end) === + ts.getLineOfLocalPosition(currentSourceFile, node2.end); } function nodeEndIsOnSameLineAsNodeStart(node1, node2) { - return getLineOfLocalPosition(currentSourceFile, node1.end) === - getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); + return ts.getLineOfLocalPosition(currentSourceFile, node1.end) === + ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 214) { + if (node.kind === 220) { write("case "); emit(node.expression); write(":"); @@ -20500,7 +21710,7 @@ var ts; else { write("default:"); } - if (preserveNewLines && node.statements.length === 1 && nodeStartPositionsAreOnSameLine(node, node.statements[0])) { + if (node.statements.length === 1 && nodeStartPositionsAreOnSameLine(node, node.statements[0])) { write(" "); emit(node.statements[0]); } @@ -20527,7 +21737,7 @@ var ts; } function emitCatchClause(node) { writeLine(); - var endPos = emitToken(67, node.pos); + var endPos = emitToken(68, node.pos); write(" "); emitToken(16, endPos); emit(node.variableDeclaration); @@ -20536,7 +21746,7 @@ var ts; emitBlock(node.block); } function emitDebuggerStatement(node) { - emitToken(71, node.pos); + emitToken(72, node.pos); write(";"); } function emitLabelledStatement(node) { @@ -20547,18 +21757,24 @@ var ts; function getContainingModule(node) { do { node = node.parent; - } while (node && node.kind !== 200); + } while (node && node.kind !== 205); return node; } function emitContainingModuleName(node) { var container = getContainingModule(node); - write(container ? resolver.getGeneratedNameForNode(container) : "exports"); + write(container ? getGeneratedNameForNode(container) : "exports"); } function emitModuleMemberName(node) { emitStart(node.name); if (ts.getCombinedNodeFlags(node) & 1) { - emitContainingModuleName(node); - write("."); + var container = getContainingModule(node); + if (container) { + write(getGeneratedNameForNode(container)); + write("."); + } + else if (languageVersion < 2) { + write("exports."); + } } emitNodeWithoutSourceMap(node.name); emitEnd(node.name); @@ -20566,13 +21782,30 @@ var ts; function createVoidZero() { var zero = ts.createSynthesizedNode(7); zero.text = "0"; - var result = ts.createSynthesizedNode(164); + var result = ts.createSynthesizedNode(166); result.expression = zero; return result; } + function emitExportMemberAssignment(node) { + if (node.flags & 1) { + writeLine(); + emitStart(node); + if (node.flags & 256) { + write("exports.default"); + } + else { + emitModuleMemberName(node); + } + write(" = "); + emitDeclarationName(node); + emitEnd(node); + write(";"); + } + } function emitExportMemberAssignments(name) { - if (!exportDefault && exportSpecifiers && ts.hasProperty(exportSpecifiers, name.text)) { - ts.forEach(exportSpecifiers[name.text], function (specifier) { + if (!exportEquals && exportSpecifiers && ts.hasProperty(exportSpecifiers, name.text)) { + for (var _a = 0, _b = exportSpecifiers[name.text]; _a < _b.length; _a++) { + var specifier = _b[_a]; writeLine(); emitStart(specifier.name); emitContainingModuleName(specifier); @@ -20580,15 +21813,15 @@ var ts; emitNodeWithoutSourceMap(specifier.name); emitEnd(specifier.name); write(" = "); - emitNodeWithoutSourceMap(name); + emitExpressionIdentifier(name); write(";"); - }); + } } } function emitDestructuring(root, isAssignmentExpressionStatement, value, lowestNonSynthesizedAncestor) { var emitCount = 0; - var _isDeclaration = (root.kind === 193 && !(ts.getCombinedNodeFlags(root) & 1)) || root.kind === 128; - if (root.kind === 167) { + var isDeclaration = (root.kind === 198 && !(ts.getCombinedNodeFlags(root) & 1)) || root.kind === 129; + if (root.kind === 169) { emitAssignmentExpression(root); } else { @@ -20600,7 +21833,7 @@ var ts; write(", "); } renameNonTopLevelLetAndConst(name); - if (name.parent && (name.parent.kind === 193 || name.parent.kind === 150)) { + if (name.parent && (name.parent.kind === 198 || name.parent.kind === 152)) { emitModuleMemberName(name.parent); } else { @@ -20610,9 +21843,9 @@ var ts; emit(value); } function ensureIdentifier(expr) { - if (expr.kind !== 64) { - var identifier = createTempVariable(lowestNonSynthesizedAncestor || root); - if (!_isDeclaration) { + if (expr.kind !== 65) { + var identifier = createTempVariable(0); + if (!isDeclaration) { recordTempDeclaration(identifier); } emitAssignment(identifier, expr); @@ -20622,14 +21855,14 @@ var ts; } function createDefaultValueCheck(value, defaultValue) { value = ensureIdentifier(value); - var equals = ts.createSynthesizedNode(167); + var equals = ts.createSynthesizedNode(169); 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(168); + var cond = ts.createSynthesizedNode(170); cond.condition = condition; cond.questionToken = ts.createSynthesizedNode(50); cond.whenTrue = whenTrue; @@ -20643,21 +21876,21 @@ var ts; return node; } function parenthesizeForAccess(expr) { - if (expr.kind === 64 || expr.kind === 153 || expr.kind === 154) { + if (expr.kind === 65 || expr.kind === 155 || expr.kind === 156) { return expr; } - var node = ts.createSynthesizedNode(159); + var node = ts.createSynthesizedNode(161); node.expression = expr; return node; } function createPropertyAccess(object, propName) { - if (propName.kind !== 64) { + if (propName.kind !== 65) { return createElementAccess(object, propName); } return createPropertyAccessExpression(parenthesizeForAccess(object), propName); } function createElementAccess(object, index) { - var node = ts.createSynthesizedNode(154); + var node = ts.createSynthesizedNode(156); node.expression = parenthesizeForAccess(object); node.argumentExpression = index; return node; @@ -20667,9 +21900,9 @@ var ts; if (properties.length !== 1) { value = ensureIdentifier(value); } - for (var _i = 0, _n = properties.length; _i < _n; _i++) { - var p = properties[_i]; - if (p.kind === 218 || p.kind === 219) { + for (var _a = 0; _a < properties.length; _a++) { + var p = properties[_a]; + if (p.kind === 224 || p.kind === 225) { var propName = (p.name); emitDestructuringAssignment(p.initializer || propName, createPropertyAccess(value, propName)); } @@ -20682,8 +21915,8 @@ var ts; } for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 172) { - if (e.kind !== 171) { + if (e.kind !== 175) { + if (e.kind !== 173) { emitDestructuringAssignment(e, createElementAccess(value, createNumericLiteral(i))); } else { @@ -20697,14 +21930,14 @@ var ts; } } function emitDestructuringAssignment(target, value) { - if (target.kind === 167 && target.operatorToken.kind === 52) { + if (target.kind === 169 && target.operatorToken.kind === 53) { value = createDefaultValueCheck(value, target.right); target = target.left; } - if (target.kind === 152) { + if (target.kind === 154) { emitObjectLiteralAssignment(target, value); } - else if (target.kind === 151) { + else if (target.kind === 153) { emitArrayLiteralAssignment(target, value); } else { @@ -20713,19 +21946,19 @@ var ts; } function emitAssignmentExpression(root) { var target = root.left; - var _value = root.right; + var value = root.right; if (isAssignmentExpressionStatement) { - emitDestructuringAssignment(target, _value); + emitDestructuringAssignment(target, value); } else { - if (root.parent.kind !== 159) { + if (root.parent.kind !== 161) { write("("); } - _value = ensureIdentifier(_value); - emitDestructuringAssignment(target, _value); + value = ensureIdentifier(value); + emitDestructuringAssignment(target, value); write(", "); - emit(_value); - if (root.parent.kind !== 159) { + emit(value); + if (root.parent.kind !== 161) { write(")"); } } @@ -20745,11 +21978,11 @@ var ts; } for (var i = 0; i < elements.length; i++) { var element = elements[i]; - if (pattern.kind === 148) { + if (pattern.kind === 150) { var propName = element.propertyName || element.name; emitBindingElement(element, createPropertyAccess(value, propName)); } - else if (element.kind !== 172) { + else if (element.kind !== 175) { if (!element.dotDotDotToken) { emitBindingElement(element, createElementAccess(value, createNumericLiteral(i))); } @@ -20786,8 +22019,8 @@ var ts; var isUninitializedLet = (resolver.getNodeCheckFlags(node) & 256) && (getCombinedFlagsForIdentifier(node.name) & 4096); if (isUninitializedLet && - node.parent.parent.kind !== 182 && - node.parent.parent.kind !== 183) { + node.parent.parent.kind !== 187 && + node.parent.parent.kind !== 188) { initializer = createVoidZero(); } } @@ -20795,16 +22028,19 @@ var ts; } } function emitExportVariableAssignments(node) { - var _name = node.name; - if (_name.kind === 64) { - emitExportMemberAssignments(_name); + if (node.kind === 175) { + return; } - else if (ts.isBindingPattern(_name)) { - ts.forEach(_name.elements, emitExportVariableAssignments); + var name = node.name; + if (name.kind === 65) { + emitExportMemberAssignments(name); + } + else if (ts.isBindingPattern(name)) { + ts.forEach(name.elements, emitExportVariableAssignments); } } function getCombinedFlagsForIdentifier(node) { - if (!node.parent || (node.parent.kind !== 193 && node.parent.kind !== 150)) { + if (!node.parent || (node.parent.kind !== 198 && node.parent.kind !== 152)) { return 0; } return ts.getCombinedNodeFlags(node.parent); @@ -20812,33 +22048,49 @@ var ts; function renameNonTopLevelLetAndConst(node) { if (languageVersion >= 2 || ts.nodeIsSynthesized(node) || - node.kind !== 64 || - (node.parent.kind !== 193 && node.parent.kind !== 150)) { + node.kind !== 65 || + (node.parent.kind !== 198 && node.parent.kind !== 152)) { return; } var combinedFlags = getCombinedFlagsForIdentifier(node); if (((combinedFlags & 12288) === 0) || combinedFlags & 1) { return; } - var list = ts.getAncestor(node, 194); - if (list.parent.kind === 175 && list.parent.parent.kind === 221) { - 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); + if (isSourceFileLevelBinding || isModuleLevelBinding || isFunctionLevelBinding) { + return; + } } var blockScopeContainer = ts.getEnclosingBlockScopeContainer(node); - var _parent = blockScopeContainer.kind === 221 + var parent = blockScopeContainer.kind === 227 ? blockScopeContainer : blockScopeContainer.parent; - var generatedName = generateUniqueNameForLocation(_parent, node.text); - var variableId = resolver.getBlockScopedVariableId(node); - if (!generatedBlockScopeNames) { - generatedBlockScopeNames = []; + if (resolver.resolvesToSomeValue(parent, node.text)) { + var variableId = resolver.getBlockScopedVariableId(node); + if (!blockScopedVariableToGeneratedName) { + blockScopedVariableToGeneratedName = []; + } + var generatedName = makeUniqueName(node.text); + blockScopedVariableToGeneratedName[variableId] = generatedName; } - generatedBlockScopeNames[variableId] = generatedName; + } + function isES6ExportedDeclaration(node) { + return !!(node.flags & 1) && + languageVersion >= 2 && + node.parent.kind === 227; } function emitVariableStatement(node) { if (!(node.flags & 1)) { emitStartOfVariableDeclarationList(node.declarationList); } + else if (isES6ExportedDeclaration(node)) { + write("export "); + emitStartOfVariableDeclarationList(node.declarationList); + } emitCommaList(node.declarationList.declarations); write(";"); if (languageVersion < 2 && node.parent === currentSourceFile) { @@ -20848,12 +22100,12 @@ var ts; function emitParameter(node) { if (languageVersion < 2) { if (ts.isBindingPattern(node.name)) { - var _name = createTempVariable(node); + var name_16 = createTempVariable(0); if (!tempParameters) { tempParameters = []; } - tempParameters.push(_name); - emit(_name); + tempParameters.push(name_16); + emit(name_16); } else { emit(node.name); @@ -20900,7 +22152,7 @@ var ts; if (languageVersion < 2 && ts.hasRestParameters(node)) { var restIndex = node.parameters.length - 1; var restParam = node.parameters[restIndex]; - var tempName = createTempVariable(node, "_i").text; + var tempName = createTempVariable(268435456).text; writeLine(); emitLeadingComments(restParam); emitStart(restParam); @@ -20935,39 +22187,53 @@ var ts; } } function emitAccessor(node) { - write(node.kind === 134 ? "get " : "set "); - emit(node.name); + write(node.kind === 136 ? "get " : "set "); + emit(node.name, false); emitSignatureAndBody(node); } function shouldEmitAsArrowFunction(node) { - return node.kind === 161 && languageVersion >= 2; + return node.kind === 163 && languageVersion >= 2; } function emitDeclarationName(node) { if (node.name) { emitNodeWithoutSourceMap(node.name); } else { - write(resolver.getGeneratedNameForNode(node)); + write(getGeneratedNameForNode(node)); + } + } + function shouldEmitFunctionName(node) { + if (node.kind === 162) { + return !!node.name; + } + if (node.kind === 200) { + return !!node.name || languageVersion < 2; } } function emitFunctionDeclaration(node) { if (ts.nodeIsMissing(node.body)) { - return emitPinnedOrTripleSlashComments(node); + return emitOnlyPinnedOrTripleSlashComments(node); } - if (node.kind !== 132 && node.kind !== 131) { + if (node.kind !== 134 && node.kind !== 133) { emitLeadingComments(node); } if (!shouldEmitAsArrowFunction(node)) { + if (isES6ExportedDeclaration(node)) { + write("export "); + if (node.flags & 256) { + write("default "); + } + } write("function "); } - if (node.kind === 195 || (node.kind === 160 && node.name)) { + if (shouldEmitFunctionName(node)) { emitDeclarationName(node); } emitSignatureAndBody(node); - if (languageVersion < 2 && node.kind === 195 && node.parent === currentSourceFile && node.name) { + if (languageVersion < 2 && node.kind === 200 && node.parent === currentSourceFile && node.name) { emitExportMemberAssignments(node.name); } - if (node.kind !== 132 && node.kind !== 131) { + if (node.kind !== 134 && node.kind !== 133) { emitTrailingComments(node); } } @@ -20998,13 +22264,12 @@ var ts; emitSignatureParameters(node); } function emitSignatureAndBody(node) { - var saveTempCount = tempCount; + var saveTempFlags = tempFlags; var saveTempVariables = tempVariables; var saveTempParameters = tempParameters; - tempCount = 0; + tempFlags = 0; tempVariables = undefined; tempParameters = undefined; - var popFrame = enterNameScope(); if (shouldEmitAsArrowFunction(node)) { emitSignatureParametersForArrow(node); write(" =>"); @@ -21015,23 +22280,16 @@ var ts; if (!node.body) { write(" { }"); } - else if (node.body.kind === 174) { + else if (node.body.kind === 179) { emitBlockFunctionBody(node, node.body); } else { emitExpressionFunctionBody(node, node.body); } - if (node.flags & 1 && !(node.flags & 256)) { - writeLine(); - emitStart(node); - emitModuleMemberName(node); - write(" = "); - emitDeclarationName(node); - emitEnd(node); - write(";"); + if (!isES6ExportedDeclaration(node)) { + emitExportMemberAssignment(node); } - exitNameScope(popFrame); - tempCount = saveTempCount; + tempFlags = saveTempFlags; tempVariables = saveTempVariables; tempParameters = saveTempParameters; } @@ -21047,10 +22305,10 @@ var ts; } write(" "); var current = body; - while (current.kind === 158) { + while (current.kind === 160) { current = current.expression; } - emitParenthesizedIf(body, current.kind === 152); + emitParenthesizedIf(body, current.kind === 154); } function emitDownLevelExpressionFunctionBody(node, body) { write(" {"); @@ -21061,11 +22319,11 @@ var ts; emitFunctionBodyPreamble(node); var preambleEmitted = writer.getTextPos() !== outPos; decreaseIndent(); - if (preserveNewLines && !preambleEmitted && nodeStartPositionsAreOnSameLine(node, body)) { + if (!preambleEmitted && nodeStartPositionsAreOnSameLine(node, body)) { write(" "); emitStart(body); write("return "); - emitWithoutComments(body); + emit(body); emitEnd(body); write(";"); emitTempDeclarations(false); @@ -21076,7 +22334,7 @@ var ts; writeLine(); emitLeadingComments(node.body); write("return "); - emitWithoutComments(node.body); + emit(body); write(";"); emitTrailingComments(node.body); emitTempDeclarations(true); @@ -21098,9 +22356,9 @@ var ts; emitFunctionBodyPreamble(node); decreaseIndent(); var preambleEmitted = writer.getTextPos() !== initialTextPos; - if (preserveNewLines && !preambleEmitted && nodeEndIsOnSameLineAsNodeStart(body, body)) { - for (var _i = 0, _a = body.statements, _n = _a.length; _i < _n; _i++) { - var statement = _a[_i]; + if (!preambleEmitted && nodeEndIsOnSameLineAsNodeStart(body, body)) { + for (var _a = 0, _b = body.statements; _a < _b.length; _a++) { + var statement = _b[_a]; write(" "); emit(statement); } @@ -21122,11 +22380,11 @@ var ts; function findInitialSuperCall(ctor) { if (ctor.body) { var statement = ctor.body.statements[0]; - if (statement && statement.kind === 177) { + if (statement && statement.kind === 182) { var expr = statement.expression; - if (expr && expr.kind === 155) { + if (expr && expr.kind === 157) { var func = expr.expression; - if (func && func.kind === 90) { + if (func && func.kind === 91) { return statement; } } @@ -21155,7 +22413,7 @@ var ts; emitNodeWithoutSourceMap(memberName); write("]"); } - else if (memberName.kind === 126) { + else if (memberName.kind === 127) { emitComputedPropertyName(memberName); } else { @@ -21165,7 +22423,7 @@ var ts; } function emitMemberAssignments(node, staticFlag) { ts.forEach(node.members, function (member) { - if (member.kind === 130 && (member.flags & 128) === staticFlag && member.initializer) { + if (member.kind === 132 && (member.flags & 128) === staticFlag && member.initializer) { writeLine(); emitLeadingComments(member); emitStart(member); @@ -21186,20 +22444,21 @@ var ts; } }); } - function emitMemberFunctions(node) { + function emitMemberFunctionsForES5AndLower(node) { ts.forEach(node.members, function (member) { - if (member.kind === 132 || node.kind === 131) { + if (member.kind === 178) { + writeLine(); + write(";"); + } + else if (member.kind === 134 || node.kind === 133) { if (!member.body) { - return emitPinnedOrTripleSlashComments(member); + return emitOnlyPinnedOrTripleSlashComments(member); } writeLine(); emitLeadingComments(member); emitStart(member); emitStart(member.name); - emitDeclarationName(node); - if (!(member.flags & 128)) { - write(".prototype"); - } + emitClassMemberPrefix(node, member); emitMemberAccessForPropertyName(member.name); emitEnd(member.name); write(" = "); @@ -21210,17 +22469,14 @@ var ts; write(";"); emitTrailingComments(member); } - else if (member.kind === 134 || member.kind === 135) { - var accessors = getAllAccessorDeclarations(node.members, member); + else if (member.kind === 136 || member.kind === 137) { + var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { writeLine(); emitStart(member); write("Object.defineProperty("); emitStart(member.name); - emitDeclarationName(node); - if (!(member.flags & 128)) { - write(".prototype"); - } + emitClassMemberPrefix(node, member); write(", "); emitExpressionForPropertyName(member.name); emitEnd(member.name); @@ -21260,15 +22516,240 @@ 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) { + emitOnlyPinnedOrTripleSlashComments(member); + } + else if (member.kind === 134 || + member.kind === 136 || + member.kind === 137) { + writeLine(); + emitLeadingComments(member); + emitStart(member); + if (member.flags & 128) { + write("static "); + } + if (member.kind === 136) { + write("get "); + } + else if (member.kind === 137) { + write("set "); + } + emit(member.name); + emitSignatureAndBody(member); + emitEnd(member); + emitTrailingComments(member); + } + else if (member.kind === 178) { + writeLine(); + write(";"); + } + } + } + function emitConstructor(node, baseTypeElement) { + var saveTempFlags = tempFlags; + var saveTempVariables = tempVariables; + var saveTempParameters = tempParameters; + tempFlags = 0; + tempVariables = undefined; + tempParameters = undefined; + var hasInstancePropertyWithInitializer = false; + ts.forEach(node.members, function (member) { + if (member.kind === 135 && !member.body) { + emitOnlyPinnedOrTripleSlashComments(member); + } + if (member.kind === 132 && member.initializer && (member.flags & 128) === 0) { + hasInstancePropertyWithInitializer = true; + } + }); + var ctor = ts.getFirstConstructorWithBody(node); + if (languageVersion >= 2 && !ctor && !hasInstancePropertyWithInitializer) { + return; + } + if (ctor) { + emitLeadingComments(ctor); + } + emitStart(ctor || node); + if (languageVersion < 2) { + write("function "); + emitDeclarationName(node); + emitSignatureParameters(ctor); + } + else { + write("constructor"); + if (ctor) { + emitSignatureParameters(ctor); + } + else { + if (baseTypeElement) { + write("(...args)"); + } + else { + write("()"); + } + } + } + write(" {"); + scopeEmitStart(node, "constructor"); + increaseIndent(); + if (ctor) { + emitDetachedComments(ctor.body.statements); + } + emitCaptureThisForNodeIfNecessary(node); + if (ctor) { + emitDefaultValueAssignments(ctor); + emitRestParameter(ctor); + if (baseTypeElement) { + var superCall = findInitialSuperCall(ctor); + if (superCall) { + writeLine(); + emit(superCall); + } + } + emitParameterPropertyAssignments(ctor); + } + else { + if (baseTypeElement) { + writeLine(); + emitStart(baseTypeElement); + if (languageVersion < 2) { + write("_super.apply(this, arguments);"); + } + else { + write("super(...args);"); + } + emitEnd(baseTypeElement); + } + } + emitMemberAssignments(node, 0); + if (ctor) { + var statements = ctor.body.statements; + if (superCall) { + statements = statements.slice(1); + } + emitLines(statements); + } + emitTempDeclarations(true); + writeLine(); + if (ctor) { + emitLeadingCommentsOfPosition(ctor.body.statements.end); + } + decreaseIndent(); + emitToken(15, ctor ? ctor.body.statements.end : node.members.end); + scopeEmitEnd(); + emitEnd(ctor || node); + if (ctor) { + emitTrailingComments(ctor); + } + tempFlags = saveTempFlags; + tempVariables = saveTempVariables; + tempParameters = saveTempParameters; + } + function emitClassExpression(node) { + return emitClassLikeDeclaration(node); + } function emitClassDeclaration(node) { - write("var "); - emitDeclarationName(node); - write(" = (function ("); - var baseTypeNode = ts.getClassBaseTypeNode(node); + return emitClassLikeDeclaration(node); + } + function emitClassLikeDeclaration(node) { + if (languageVersion < 2) { + emitClassLikeDeclarationBelowES6(node); + } + else { + emitClassLikeDeclarationForES6AndHigher(node); + } + } + function emitClassLikeDeclarationForES6AndHigher(node) { + var thisNodeIsDecorated = ts.nodeIsDecorated(node); + if (node.kind === 201) { + if (thisNodeIsDecorated) { + if (isES6ExportedDeclaration(node) && !(node.flags & 256)) { + write("export "); + } + write("let "); + emitDeclarationName(node); + write(" = "); + } + else if (isES6ExportedDeclaration(node)) { + write("export "); + if (node.flags & 256) { + write("default "); + } + } + } + write("class"); + if ((node.name || !(node.flags & 256)) && !thisNodeIsDecorated) { + write(" "); + emitDeclarationName(node); + } + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); + if (baseTypeNode) { + write(" extends "); + emit(baseTypeNode.expression); + } + write(" {"); + increaseIndent(); + scopeEmitStart(node); + writeLine(); + emitConstructor(node, baseTypeNode); + emitMemberFunctionsForES6AndHigher(node); + decreaseIndent(); + writeLine(); + emitToken(15, node.members.end); + scopeEmitEnd(); + if (thisNodeIsDecorated) { + write(";"); + if (node.name) { + writeLine(); + write("Object.defineProperty("); + emitDeclarationName(node); + write(", \"name\", { value: \""); + emitDeclarationName(node); + write("\", configurable: true });"); + writeLine(); + } + } + writeLine(); + emitMemberAssignments(node, 128); + emitDecoratorsOfClass(node); + if (!isES6ExportedDeclaration(node) && (node.flags & 1)) { + writeLine(); + emitStart(node); + emitModuleMemberName(node); + write(" = "); + emitDeclarationName(node); + emitEnd(node); + write(";"); + } + else if (isES6ExportedDeclaration(node) && (node.flags & 256) && thisNodeIsDecorated) { + writeLine(); + write("export default "); + emitDeclarationName(node); + write(";"); + } + } + function emitClassLikeDeclarationBelowES6(node) { + if (node.kind === 201) { + write("var "); + emitDeclarationName(node); + write(" = "); + } + write("(function ("); + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { write("_super"); } write(") {"); + var saveTempFlags = tempFlags; + var saveTempVariables = tempVariables; + var saveTempParameters = tempParameters; + var saveComputedPropertyNamesToGeneratedNames = computedPropertyNamesToGeneratedNames; + tempFlags = 0; + tempVariables = undefined; + tempParameters = undefined; + computedPropertyNamesToGeneratedNames = undefined; increaseIndent(); scopeEmitStart(node); if (baseTypeNode) { @@ -21280,15 +22761,22 @@ var ts; emitEnd(baseTypeNode); } writeLine(); - emitConstructorOfClass(); - emitMemberFunctions(node); + emitConstructor(node, baseTypeNode); + emitMemberFunctionsForES5AndLower(node); emitMemberAssignments(node, 128); writeLine(); + emitDecoratorsOfClass(node); + writeLine(); emitToken(15, node.members.end, function () { write("return "); emitDeclarationName(node); }); write(";"); + emitTempDeclarations(true); + tempFlags = saveTempFlags; + tempVariables = saveTempVariables; + tempParameters = saveTempParameters; + computedPropertyNamesToGeneratedNames = saveComputedPropertyNamesToGeneratedNames; decreaseIndent(); writeLine(); emitToken(15, node.members.end); @@ -21296,109 +22784,170 @@ var ts; emitStart(node); write(")("); if (baseTypeNode) { - emit(baseTypeNode.typeName); + emit(baseTypeNode.expression); } - write(");"); - emitEnd(node); - if (node.flags & 1 && !(node.flags & 256)) { - writeLine(); - emitStart(node); - emitModuleMemberName(node); - write(" = "); - emitDeclarationName(node); - emitEnd(node); + write(")"); + if (node.kind === 201) { write(";"); } + emitEnd(node); + if (node.kind === 201) { + emitExportMemberAssignment(node); + } if (languageVersion < 2 && node.parent === currentSourceFile && node.name) { emitExportMemberAssignments(node.name); } - function emitConstructorOfClass() { - var saveTempCount = tempCount; - var saveTempVariables = tempVariables; - var saveTempParameters = tempParameters; - tempCount = 0; - tempVariables = undefined; - tempParameters = undefined; - var popFrame = enterNameScope(); - ts.forEach(node.members, function (member) { - if (member.kind === 133 && !member.body) { - emitPinnedOrTripleSlashComments(member); - } - }); - var ctor = getFirstConstructorWithBody(node); - if (ctor) { - emitLeadingComments(ctor); - } - emitStart(ctor || node); - write("function "); - emitDeclarationName(node); - emitSignatureParameters(ctor); - write(" {"); - scopeEmitStart(node, "constructor"); - increaseIndent(); - if (ctor) { - emitDetachedComments(ctor.body.statements); - } - emitCaptureThisForNodeIfNecessary(node); - var superCall; - if (ctor) { - emitDefaultValueAssignments(ctor); - emitRestParameter(ctor); - if (baseTypeNode) { - superCall = findInitialSuperCall(ctor); - if (superCall) { - writeLine(); - emit(superCall); - } - } - emitParameterPropertyAssignments(ctor); - } - else { - if (baseTypeNode) { - writeLine(); - emitStart(baseTypeNode); - write("_super.apply(this, arguments);"); - emitEnd(baseTypeNode); - } - } - emitMemberAssignments(node, 0); - if (ctor) { - var statements = ctor.body.statements; - if (superCall) - statements = statements.slice(1); - emitLines(statements); - } - emitTempDeclarations(true); - writeLine(); - if (ctor) { - emitLeadingCommentsOfPosition(ctor.body.statements.end); - } - decreaseIndent(); - emitToken(15, ctor ? ctor.body.statements.end : node.members.end); - scopeEmitEnd(); - emitEnd(ctor || node); - if (ctor) { - emitTrailingComments(ctor); - } - exitNameScope(popFrame); - tempCount = saveTempCount; - tempVariables = saveTempVariables; - tempParameters = saveTempParameters; + } + function emitClassMemberPrefix(node, member) { + emitDeclarationName(node); + if (!(member.flags & 128)) { + write(".prototype"); } } + function emitDecoratorsOfClass(node) { + emitDecoratorsOfMembers(node, 0); + emitDecoratorsOfMembers(node, 128); + emitDecoratorsOfConstructor(node); + } + function emitDecoratorsOfConstructor(node) { + var constructor = ts.getFirstConstructorWithBody(node); + if (constructor) { + emitDecoratorsOfParameters(node, constructor); + } + if (!ts.nodeIsDecorated(node)) { + return; + } + writeLine(); + emitStart(node); + emitDeclarationName(node); + write(" = "); + emitDecorateStart(node.decorators); + emitDeclarationName(node); + write(");"); + emitEnd(node); + writeLine(); + } + function emitDecoratorsOfMembers(node, staticFlag) { + ts.forEach(node.members, function (member) { + if ((member.flags & 128) !== staticFlag) { + return; + } + var decorators; + switch (member.kind) { + case 134: + emitDecoratorsOfParameters(node, member); + decorators = member.decorators; + break; + case 136: + case 137: + var accessors = ts.getAllAccessorDeclarations(node.members, member); + if (member !== accessors.firstAccessor) { + return; + } + if (accessors.setAccessor) { + emitDecoratorsOfParameters(node, accessors.setAccessor); + } + decorators = accessors.firstAccessor.decorators; + if (!decorators && accessors.secondAccessor) { + decorators = accessors.secondAccessor.decorators; + } + break; + case 132: + decorators = member.decorators; + break; + default: + return; + } + if (!decorators) { + return; + } + writeLine(); + emitStart(member); + if (member.kind !== 132) { + write("Object.defineProperty("); + emitStart(member.name); + emitClassMemberPrefix(node, member); + write(", "); + emitExpressionForPropertyName(member.name); + emitEnd(member.name); + write(", "); + } + emitDecorateStart(decorators); + emitStart(member.name); + emitClassMemberPrefix(node, member); + write(", "); + emitExpressionForPropertyName(member.name); + emitEnd(member.name); + if (member.kind !== 132) { + write(", Object.getOwnPropertyDescriptor("); + emitStart(member.name); + emitClassMemberPrefix(node, member); + write(", "); + emitExpressionForPropertyName(member.name); + emitEnd(member.name); + write("))"); + } + write(");"); + emitEnd(member); + writeLine(); + }); + } + function emitDecoratorsOfParameters(node, member) { + ts.forEach(member.parameters, function (parameter, parameterIndex) { + if (!ts.nodeIsDecorated(parameter)) { + return; + } + writeLine(); + emitStart(parameter); + emitDecorateStart(parameter.decorators); + emitStart(parameter.name); + if (member.kind === 135) { + emitDeclarationName(node); + write(", void 0"); + } + else { + emitClassMemberPrefix(node, member); + write(", "); + emitExpressionForPropertyName(member.name); + } + write(", "); + write(String(parameterIndex)); + emitEnd(parameter.name); + write(");"); + emitEnd(parameter); + writeLine(); + }); + } + function emitDecorateStart(decorators) { + write("__decorate(["); + var decoratorCount = decorators.length; + for (var i = 0; i < decoratorCount; i++) { + if (i > 0) { + write(", "); + } + var decorator = decorators[i]; + emitStart(decorator); + emit(decorator.expression); + emitEnd(decorator); + } + write("], "); + } function emitInterfaceDeclaration(node) { - emitPinnedOrTripleSlashComments(node); + emitOnlyPinnedOrTripleSlashComments(node); } function shouldEmitEnumDeclaration(node) { var isConstEnum = ts.isConst(node); - return !isConstEnum || compilerOptions.preserveConstEnums; + return !isConstEnum || compilerOptions.preserveConstEnums || compilerOptions.separateCompilation; } function emitEnumDeclaration(node) { if (!shouldEmitEnumDeclaration(node)) { return; } - if (!(node.flags & 1)) { + if (!(node.flags & 1) || isES6ExportedDeclaration(node)) { emitStart(node); + if (isES6ExportedDeclaration(node)) { + write("export "); + } write("var "); emit(node.name); emitEnd(node); @@ -21408,7 +22957,7 @@ var ts; emitStart(node); write("(function ("); emitStart(node.name); - write(resolver.getGeneratedNameForNode(node)); + write(getGeneratedNameForNode(node)); emitEnd(node.name); write(") {"); increaseIndent(); @@ -21424,7 +22973,7 @@ var ts; emitModuleMemberName(node); write(" = {}));"); emitEnd(node); - if (node.flags & 1) { + if (!isES6ExportedDeclaration(node) && node.flags & 1) { writeLine(); emitStart(node); write("var "); @@ -21441,9 +22990,9 @@ var ts; function emitEnumMember(node) { var enumParent = node.parent; emitStart(node); - write(resolver.getGeneratedNameForNode(enumParent)); + write(getGeneratedNameForNode(enumParent)); write("["); - write(resolver.getGeneratedNameForNode(enumParent)); + write(getGeneratedNameForNode(enumParent)); write("["); emitExpressionForPropertyName(node.name); write("] = "); @@ -21454,14 +23003,12 @@ var ts; write(";"); } function writeEnumMemberDeclarationValue(member) { - if (!member.initializer || ts.isConst(member.parent)) { - var value = resolver.getConstantValue(member); - if (value !== undefined) { - write(value.toString()); - return; - } + var value = resolver.getConstantValue(member); + if (value !== undefined) { + write(value.toString()); + return; } - if (member.initializer) { + else if (member.initializer) { emit(member.initializer); } else { @@ -21469,20 +23016,23 @@ var ts; } } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 200) { + if (moduleDeclaration.body.kind === 205) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } } function shouldEmitModuleDeclaration(node) { - return ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums); + return ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation); } function emitModuleDeclaration(node) { var shouldEmit = shouldEmitModuleDeclaration(node); if (!shouldEmit) { - return emitPinnedOrTripleSlashComments(node); + return emitOnlyPinnedOrTripleSlashComments(node); } emitStart(node); + if (isES6ExportedDeclaration(node)) { + write("export "); + } write("var "); emit(node.name); write(";"); @@ -21491,18 +23041,16 @@ var ts; emitStart(node); write("(function ("); emitStart(node.name); - write(resolver.getGeneratedNameForNode(node)); + write(getGeneratedNameForNode(node)); emitEnd(node.name); write(") "); - if (node.body.kind === 201) { - var saveTempCount = tempCount; + if (node.body.kind === 206) { + var saveTempFlags = tempFlags; var saveTempVariables = tempVariables; - tempCount = 0; + tempFlags = 0; tempVariables = undefined; - var popFrame = enterNameScope(); emit(node.body); - exitNameScope(popFrame); - tempCount = saveTempCount; + tempFlags = saveTempFlags; tempVariables = saveTempVariables; } else { @@ -21519,7 +23067,7 @@ var ts; scopeEmitEnd(); } write(")("); - if (node.flags & 1) { + if ((node.flags & 1) && !isES6ExportedDeclaration(node)) { emit(node.name); write(" = "); } @@ -21528,7 +23076,7 @@ var ts; emitModuleMemberName(node); write(" = {}));"); emitEnd(node); - if (languageVersion < 2 && node.name.kind === 64 && node.parent === currentSourceFile) { + if (!isES6ExportedDeclaration(node) && node.name.kind === 65 && node.parent === currentSourceFile) { emitExportMemberAssignments(node.name); } } @@ -21539,199 +23087,303 @@ var ts; emitLiteral(moduleName); emitEnd(moduleName); emitToken(17, moduleName.end); - write(";"); } else { - write("require();"); + write("require()"); } } + function getNamespaceDeclarationNode(node) { + if (node.kind === 208) { + return node; + } + var importClause = node.importClause; + if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 211) { + return importClause.namedBindings; + } + } + function isDefaultImport(node) { + return node.kind === 209 && node.importClause && !!node.importClause.name; + } + function emitExportImportAssignments(node) { + if (ts.isAliasSymbolDeclaration(node) && resolver.isValueAliasDeclaration(node)) { + emitExportMemberAssignments(node.name); + } + ts.forEachChild(node, emitExportImportAssignments); + } function emitImportDeclaration(node) { - var info = getExternalImportInfo(node); - if (info) { - var declarationNode = info.declarationNode; - var namedImports = info.namedImports; + if (languageVersion < 2) { + return emitExternalImportDeclaration(node); + } + if (node.importClause) { + var shouldEmitDefaultBindings = resolver.isReferencedAliasDeclaration(node.importClause); + var shouldEmitNamedBindings = node.importClause.namedBindings && resolver.isReferencedAliasDeclaration(node.importClause.namedBindings, true); + if (shouldEmitDefaultBindings || shouldEmitNamedBindings) { + write("import "); + emitStart(node.importClause); + if (shouldEmitDefaultBindings) { + emit(node.importClause.name); + if (shouldEmitNamedBindings) { + write(", "); + } + } + if (shouldEmitNamedBindings) { + emitLeadingComments(node.importClause.namedBindings); + emitStart(node.importClause.namedBindings); + if (node.importClause.namedBindings.kind === 211) { + write("* as "); + emit(node.importClause.namedBindings.name); + } + else { + write("{ "); + emitExportOrImportSpecifierList(node.importClause.namedBindings.elements, resolver.isReferencedAliasDeclaration); + write(" }"); + } + emitEnd(node.importClause.namedBindings); + emitTrailingComments(node.importClause.namedBindings); + } + emitEnd(node.importClause); + write(" from "); + emit(node.moduleSpecifier); + write(";"); + } + } + else { + write("import "); + emit(node.moduleSpecifier); + write(";"); + } + } + function emitExternalImportDeclaration(node) { + if (ts.contains(externalImports, node)) { + var isExportedImport = node.kind === 208 && (node.flags & 1) !== 0; + var namespaceDeclaration = getNamespaceDeclarationNode(node); if (compilerOptions.module !== 2) { emitLeadingComments(node); emitStart(node); - var moduleName = ts.getExternalModuleName(node); - if (declarationNode) { - if (!(declarationNode.flags & 1)) + if (namespaceDeclaration && !isDefaultImport(node)) { + if (!isExportedImport) write("var "); - emitModuleMemberName(declarationNode); + emitModuleMemberName(namespaceDeclaration); write(" = "); - emitRequire(moduleName); - } - else if (namedImports) { - write("var "); - write(resolver.getGeneratedNameForNode(node)); - write(" = "); - emitRequire(moduleName); } else { - emitRequire(moduleName); + var isNakedImport = 209 && !node.importClause; + if (!isNakedImport) { + write("var "); + write(getGeneratedNameForNode(node)); + write(" = "); + } } + emitRequire(ts.getExternalModuleName(node)); + if (namespaceDeclaration && isDefaultImport(node)) { + write(", "); + emitModuleMemberName(namespaceDeclaration); + write(" = "); + write(getGeneratedNameForNode(node)); + } + write(";"); emitEnd(node); + emitExportImportAssignments(node); emitTrailingComments(node); } else { - if (declarationNode) { - if (declarationNode.flags & 1) { - emitModuleMemberName(declarationNode); - write(" = "); - emit(declarationNode.name); - write(";"); - } + if (isExportedImport) { + emitModuleMemberName(namespaceDeclaration); + write(" = "); + emit(namespaceDeclaration.name); + write(";"); } + else if (namespaceDeclaration && isDefaultImport(node)) { + write("var "); + emitModuleMemberName(namespaceDeclaration); + write(" = "); + write(getGeneratedNameForNode(node)); + write(";"); + } + emitExportImportAssignments(node); } } } function emitImportEqualsDeclaration(node) { if (ts.isExternalModuleImportEqualsDeclaration(node)) { - emitImportDeclaration(node); + emitExternalImportDeclaration(node); return; } if (resolver.isReferencedAliasDeclaration(node) || (!ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportEqualsWithEntityName(node))) { emitLeadingComments(node); emitStart(node); - if (!(node.flags & 1)) + if (isES6ExportedDeclaration(node)) { + write("export "); write("var "); + } + else if (!(node.flags & 1)) { + write("var "); + } emitModuleMemberName(node); write(" = "); emit(node.moduleReference); write(";"); emitEnd(node); + emitExportImportAssignments(node); emitTrailingComments(node); } } function emitExportDeclaration(node) { - if (node.moduleSpecifier) { - emitStart(node); - var generatedName = resolver.getGeneratedNameForNode(node); - if (compilerOptions.module !== 2) { - write("var "); - write(generatedName); - write(" = "); - emitRequire(ts.getExternalModuleName(node)); - } - if (node.exportClause) { - ts.forEach(node.exportClause.elements, function (specifier) { + if (languageVersion < 2) { + if (node.moduleSpecifier && (!node.exportClause || resolver.isValueAliasDeclaration(node))) { + emitStart(node); + var generatedName = getGeneratedNameForNode(node); + if (node.exportClause) { + if (compilerOptions.module !== 2) { + write("var "); + write(generatedName); + write(" = "); + emitRequire(ts.getExternalModuleName(node)); + write(";"); + } + for (var _a = 0, _b = node.exportClause.elements; _a < _b.length; _a++) { + var specifier = _b[_a]; + if (resolver.isValueAliasDeclaration(specifier)) { + writeLine(); + emitStart(specifier); + emitContainingModuleName(specifier); + write("."); + emitNodeWithoutSourceMap(specifier.name); + write(" = "); + write(generatedName); + write("."); + emitNodeWithoutSourceMap(specifier.propertyName || specifier.name); + write(";"); + emitEnd(specifier); + } + } + } + else { writeLine(); - emitStart(specifier); - emitContainingModuleName(specifier); - write("."); - emitNodeWithoutSourceMap(specifier.name); - write(" = "); - write(generatedName); - write("."); - emitNodeWithoutSourceMap(specifier.propertyName || specifier.name); + write("__export("); + if (compilerOptions.module !== 2) { + emitRequire(ts.getExternalModuleName(node)); + } + else { + write(generatedName); + } + write(");"); + } + emitEnd(node); + } + } + else { + if (!node.exportClause || resolver.isValueAliasDeclaration(node)) { + emitStart(node); + write("export "); + if (node.exportClause) { + write("{ "); + emitExportOrImportSpecifierList(node.exportClause.elements, resolver.isValueAliasDeclaration); + write(" }"); + } + else { + write("*"); + } + if (node.moduleSpecifier) { + write(" from "); + emitNodeWithoutSourceMap(node.moduleSpecifier); + } + write(";"); + emitEnd(node); + } + } + } + function emitExportOrImportSpecifierList(specifiers, shouldEmit) { + ts.Debug.assert(languageVersion >= 2); + var needsComma = false; + for (var _a = 0; _a < specifiers.length; _a++) { + var specifier = specifiers[_a]; + if (shouldEmit(specifier)) { + if (needsComma) { + write(", "); + } + emitStart(specifier); + if (specifier.propertyName) { + emitNodeWithoutSourceMap(specifier.propertyName); + write(" as "); + } + emitNodeWithoutSourceMap(specifier.name); + emitEnd(specifier); + needsComma = true; + } + } + } + function emitExportAssignment(node) { + if (!node.isExportEquals && resolver.isValueAliasDeclaration(node)) { + if (languageVersion >= 2) { + writeLine(); + emitStart(node); + write("export default "); + var expression = node.expression; + emit(expression); + if (expression.kind !== 200 && + expression.kind !== 201) { write(";"); - emitEnd(specifier); - }); + } + emitEnd(node); } else { - var tempName = createTempVariable(node).text; writeLine(); - write("for (var " + tempName + " in " + generatedName + ") if (!"); + emitStart(node); emitContainingModuleName(node); - write(".hasOwnProperty(" + tempName + ")) "); - emitContainingModuleName(node); - write("[" + tempName + "] = " + generatedName + "[" + tempName + "];"); - } - emitEnd(node); - } - } - function createExternalImportInfo(node) { - if (node.kind === 203) { - if (node.moduleReference.kind === 213) { - return { - rootNode: node, - declarationNode: node - }; - } - } - else if (node.kind === 204) { - var importClause = node.importClause; - if (importClause) { - if (importClause.name) { - return { - rootNode: node, - declarationNode: importClause - }; - } - if (importClause.namedBindings.kind === 206) { - return { - rootNode: node, - declarationNode: importClause.namedBindings - }; - } - return { - rootNode: node, - namedImports: importClause.namedBindings, - localName: resolver.getGeneratedNameForNode(node) - }; - } - return { - rootNode: node - }; - } - else if (node.kind === 210) { - if (node.moduleSpecifier) { - return { - rootNode: node - }; + write(".default = "); + emit(node.expression); + write(";"); + emitEnd(node); } } } - function createExternalModuleInfo(sourceFile) { + function collectExternalModuleInfo(sourceFile) { externalImports = []; exportSpecifiers = {}; - exportDefault = undefined; - ts.forEach(sourceFile.statements, function (node) { - if (node.kind === 210 && !node.moduleSpecifier) { - ts.forEach(node.exportClause.elements, function (specifier) { - if (specifier.name.text === "default") { - exportDefault = exportDefault || specifier; + exportEquals = undefined; + hasExportStars = false; + for (var _a = 0, _b = sourceFile.statements; _a < _b.length; _a++) { + var node = _b[_a]; + switch (node.kind) { + case 209: + if (!node.importClause || + resolver.isReferencedAliasDeclaration(node.importClause, true)) { + externalImports.push(node); } - var _name = (specifier.propertyName || specifier.name).text; - (exportSpecifiers[_name] || (exportSpecifiers[_name] = [])).push(specifier); - }); - } - else if (node.kind === 209) { - exportDefault = exportDefault || node; - } - else if (node.kind === 195 || node.kind === 196) { - if (node.flags & 1 && node.flags & 256) { - exportDefault = exportDefault || node; - } - } - else { - var info = createExternalImportInfo(node); - if (info) { - if ((!info.declarationNode && !info.namedImports) || resolver.isReferencedAliasDeclaration(node)) { - externalImports.push(info); + break; + case 208: + if (node.moduleReference.kind === 219 && resolver.isReferencedAliasDeclaration(node)) { + externalImports.push(node); } - } - } - }); - } - function getExternalImportInfo(node) { - if (externalImports) { - for (var _i = 0, _n = externalImports.length; _i < _n; _i++) { - var info = externalImports[_i]; - if (info.rootNode === node) { - return info; - } + break; + case 215: + if (node.moduleSpecifier) { + if (!node.exportClause) { + externalImports.push(node); + hasExportStars = true; + } + else if (resolver.isValueAliasDeclaration(node)) { + externalImports.push(node); + } + } + else { + for (var _c = 0, _d = node.exportClause.elements; _c < _d.length; _c++) { + var specifier = _d[_c]; + var name_17 = (specifier.propertyName || specifier.name).text; + (exportSpecifiers[name_17] || (exportSpecifiers[name_17] = [])).push(specifier); + } + } + break; + case 214: + if (node.isExportEquals && !exportEquals) { + exportEquals = node; + } + break; } } } - function getFirstExportAssignment(sourceFile) { - return ts.forEach(sourceFile.statements, function (node) { - if (node.kind === 209) { - return node; - } - }); - } function sortAMDModules(amdModules) { return amdModules.sort(function (moduleA, moduleB) { if (moduleA.name === moduleB.name) { @@ -21745,7 +23397,20 @@ var ts; } }); } + function emitExportStarHelper() { + if (hasExportStars) { + writeLine(); + write("function __export(m) {"); + increaseIndent(); + writeLine(); + write("for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];"); + decreaseIndent(); + writeLine(); + write("}"); + } + } function emitAMDModule(node, startIndex) { + collectExternalModuleInfo(node); writeLine(); write("define("); sortAMDModules(node.amdDependencies); @@ -21753,69 +23418,78 @@ var ts; write("\"" + node.amdModuleName + "\", "); } write("[\"require\", \"exports\""); - ts.forEach(externalImports, function (info) { + for (var _a = 0; _a < externalImports.length; _a++) { + var importNode = externalImports[_a]; write(", "); - var moduleName = ts.getExternalModuleName(info.rootNode); + var moduleName = ts.getExternalModuleName(importNode); if (moduleName.kind === 8) { emitLiteral(moduleName); } else { write("\"\""); } - }); - ts.forEach(node.amdDependencies, function (amdDependency) { + } + for (var _b = 0, _c = node.amdDependencies; _b < _c.length; _b++) { + var amdDependency = _c[_b]; var text = "\"" + amdDependency.path + "\""; write(", "); write(text); - }); + } write("], function (require, exports"); - ts.forEach(externalImports, function (info) { + for (var _d = 0; _d < externalImports.length; _d++) { + var importNode = externalImports[_d]; write(", "); - if (info.declarationNode) { - emit(info.declarationNode.name); + var namespaceDeclaration = getNamespaceDeclarationNode(importNode); + if (namespaceDeclaration && !isDefaultImport(importNode)) { + emit(namespaceDeclaration.name); } else { - write(resolver.getGeneratedNameForNode(info.rootNode)); + write(getGeneratedNameForNode(importNode)); } - }); - ts.forEach(node.amdDependencies, function (amdDependency) { + } + for (var _e = 0, _f = node.amdDependencies; _e < _f.length; _e++) { + var amdDependency = _f[_e]; if (amdDependency.name) { write(", "); write(amdDependency.name); } - }); + } write(") {"); increaseIndent(); + emitExportStarHelper(); emitCaptureThisForNodeIfNecessary(node); emitLinesStartingAt(node.statements, startIndex); emitTempDeclarations(true); - emitExportDefault(node, true); + emitExportEquals(true); decreaseIndent(); writeLine(); write("});"); } function emitCommonJSModule(node, startIndex) { + collectExternalModuleInfo(node); + emitExportStarHelper(); emitCaptureThisForNodeIfNecessary(node); emitLinesStartingAt(node.statements, startIndex); emitTempDeclarations(true); - emitExportDefault(node, false); + emitExportEquals(false); } - function emitExportDefault(sourceFile, emitAsReturn) { - if (exportDefault && resolver.hasExportDefaultValue(sourceFile)) { + function emitES6Module(node, startIndex) { + externalImports = undefined; + exportSpecifiers = undefined; + exportEquals = undefined; + hasExportStars = false; + emitCaptureThisForNodeIfNecessary(node); + emitLinesStartingAt(node.statements, startIndex); + emitTempDeclarations(true); + } + function emitExportEquals(emitAsReturn) { + if (exportEquals && resolver.isValueAliasDeclaration(exportEquals)) { writeLine(); - emitStart(exportDefault); + emitStart(exportEquals); write(emitAsReturn ? "return " : "module.exports = "); - if (exportDefault.kind === 209) { - emit(exportDefault.expression); - } - else if (exportDefault.kind === 212) { - emit(exportDefault.propertyName); - } - else { - emitDeclarationName(exportDefault); - } + emit(exportEquals.expression); write(";"); - emitEnd(exportDefault); + emitEnd(exportEquals); } } function emitDirectivePrologues(statements, startWithNewLine) { @@ -21832,11 +23506,21 @@ var ts; } return statements.length; } + function writeHelper(text) { + var lines = text.split(/\r\n|\r|\n/g); + for (var i = 0; i < lines.length; ++i) { + var line = lines[i]; + if (line.length) { + writeLine(); + write(line); + } + } + } function emitSourceFileNode(node) { writeLine(); emitDetachedComments(node); var startIndex = emitDirectivePrologues(node.statements, false); - if (!extendsEmitted && resolver.getNodeCheckFlags(node) & 8) { + if ((languageVersion < 2) && (!extendsEmitted && resolver.getNodeCheckFlags(node) & 8)) { writeLine(); write("var __extends = this.__extends || function (d, b) {"); increaseIndent(); @@ -21853,9 +23537,15 @@ var ts; write("};"); extendsEmitted = true; } + if (!decorateEmitted && resolver.getNodeCheckFlags(node) & 512) { + writeHelper("\nvar __decorate = this.__decorate || function (decorators, target, key, value) {\n var kind = typeof (arguments.length == 2 ? value = target : value);\n for (var i = decorators.length - 1; i >= 0; --i) {\n var decorator = decorators[i];\n switch (kind) {\n case \"function\": value = decorator(value) || value; break;\n case \"number\": decorator(target, key, value); break;\n case \"undefined\": decorator(target, key); break;\n case \"object\": value = decorator(target, key, value) || value; break;\n }\n }\n return value;\n};"); + decorateEmitted = true; + } if (ts.isExternalModule(node)) { - createExternalModuleInfo(node); - if (compilerOptions.module === 2) { + if (languageVersion >= 2) { + emitES6Module(node, startIndex); + } + else if (compilerOptions.module === 2) { emitAMDModule(node, startIndex); } else { @@ -21865,75 +23555,75 @@ var ts; else { externalImports = undefined; exportSpecifiers = undefined; - exportDefault = undefined; + exportEquals = undefined; + hasExportStars = false; emitCaptureThisForNodeIfNecessary(node); emitLinesStartingAt(node.statements, startIndex); emitTempDeclarations(true); } emitLeadingComments(node.endOfFileToken); } - function emitNodeWithoutSourceMapWithComments(node) { + function emitNodeWithoutSourceMap(node, allowGeneratedIdentifiers) { if (!node) { return; } if (node.flags & 2) { - return emitPinnedOrTripleSlashComments(node); + return emitOnlyPinnedOrTripleSlashComments(node); } - var _emitComments = shouldEmitLeadingAndTrailingComments(node); - if (_emitComments) { + var emitComments = shouldEmitLeadingAndTrailingComments(node); + if (emitComments) { emitLeadingComments(node); } - emitJavaScriptWorker(node); - if (_emitComments) { + emitJavaScriptWorker(node, allowGeneratedIdentifiers); + if (emitComments) { emitTrailingComments(node); } } - function emitNodeWithoutSourceMapWithoutComments(node) { - if (!node) { - return; - } - if (node.flags & 2) { - return emitPinnedOrTripleSlashComments(node); - } - emitJavaScriptWorker(node); - } function shouldEmitLeadingAndTrailingComments(node) { switch (node.kind) { - case 197: - case 195: - case 204: - case 203: - case 198: - case 209: - return false; + case 202: case 200: + case 209: + case 208: + case 203: + case 214: + return false; + case 205: return shouldEmitModuleDeclaration(node); - case 199: + case 204: return shouldEmitEnumDeclaration(node); } + if (node.kind !== 179 && + node.parent && + node.parent.kind === 163 && + node.parent.body === node && + compilerOptions.target <= 1) { + return false; + } return true; } - function emitJavaScriptWorker(node) { + function emitJavaScriptWorker(node, allowGeneratedIdentifiers) { + if (allowGeneratedIdentifiers === void 0) { allowGeneratedIdentifiers = true; } switch (node.kind) { - case 64: - return emitIdentifier(node); - case 128: + case 65: + return emitIdentifier(node, allowGeneratedIdentifiers); + case 129: return emitParameter(node); - case 132: - case 131: - return emitMethod(node); case 134: - case 135: + case 133: + return emitMethod(node); + case 136: + case 137: return emitAccessor(node); - case 92: + case 93: return emitThis(node); - case 90: + case 91: return emitSuper(node); - case 88: + case 89: return write("null"); - case 94: + case 95: return write("true"); - case 79: + case 80: return write("false"); case 7: case 8: @@ -21943,125 +23633,129 @@ var ts; case 12: case 13: return emitLiteral(node); - case 169: - return emitTemplateExpression(node); - case 173: - return emitTemplateSpan(node); - case 125: - return emitQualifiedName(node); - case 148: - return emitObjectBindingPattern(node); - case 149: - return emitArrayBindingPattern(node); - case 150: - return emitBindingElement(node); - case 151: - return emitArrayLiteral(node); - case 152: - return emitObjectLiteral(node); - case 218: - return emitPropertyAssignment(node); - case 219: - return emitShorthandPropertyAssignment(node); - case 126: - return emitComputedPropertyName(node); - case 153: - return emitPropertyAccess(node); - case 154: - return emitIndexedAccess(node); - case 155: - return emitCallExpression(node); - case 156: - return emitNewExpression(node); - case 157: - return emitTaggedTemplateExpression(node); - case 158: - return emit(node.expression); - case 159: - return emitParenExpression(node); - case 195: - case 160: - case 161: - return emitFunctionDeclaration(node); - case 162: - return emitDeleteExpression(node); - case 163: - return emitTypeOfExpression(node); - case 164: - return emitVoidExpression(node); - case 165: - return emitPrefixUnaryExpression(node); - case 166: - return emitPostfixUnaryExpression(node); - case 167: - return emitBinaryExpression(node); - case 168: - return emitConditionalExpression(node); case 171: - return emitSpreadElementExpression(node); - case 172: - return; - case 174: - case 201: - return emitBlock(node); - case 175: - return emitVariableStatement(node); + return emitTemplateExpression(node); case 176: - return write(";"); - case 177: - return emitExpressionStatement(node); - case 178: - return emitIfStatement(node); - case 179: - return emitDoStatement(node); - case 180: - return emitWhileStatement(node); - case 181: - return emitForStatement(node); - case 183: - case 182: - return emitForInOrForOfStatement(node); - case 184: - case 185: - return emitBreakOrContinueStatement(node); - case 186: - return emitReturnStatement(node); - case 187: - return emitWithStatement(node); - case 188: - return emitSwitchStatement(node); - case 214: - case 215: - return emitCaseOrDefaultClause(node); - case 189: - return emitLabelledStatement(node); - case 190: - return emitThrowStatement(node); - case 191: - return emitTryStatement(node); - case 217: - return emitCatchClause(node); - case 192: - return emitDebuggerStatement(node); - case 193: - return emitVariableDeclaration(node); - case 196: - return emitClassDeclaration(node); - case 197: - return emitInterfaceDeclaration(node); - case 199: - return emitEnumDeclaration(node); - case 220: - return emitEnumMember(node); + 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: - return emitModuleDeclaration(node); - case 204: - return emitImportDeclaration(node); - case 203: - return emitImportEqualsDeclaration(node); - case 210: - return emitExportDeclaration(node); + 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 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); + case 226: + return emitEnumMember(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); + case 227: return emitSourceFileNode(node); } } @@ -22078,34 +23772,50 @@ var ts; } return leadingComments; } + function filterComments(ranges, onlyPinnedOrTripleSlashComments) { + if (ranges && onlyPinnedOrTripleSlashComments) { + ranges = ts.filter(ranges, isPinnedOrTripleSlashComment); + if (ranges.length === 0) { + return undefined; + } + } + return ranges; + } function getLeadingCommentsToEmit(node) { if (node.parent) { - if (node.parent.kind === 221 || node.pos !== node.parent.pos) { - var leadingComments; + if (node.parent.kind === 227 || node.pos !== node.parent.pos) { if (hasDetachedComments(node.pos)) { - leadingComments = getLeadingCommentsWithoutDetachedComments(); + return getLeadingCommentsWithoutDetachedComments(); } else { - leadingComments = ts.getLeadingCommentRangesOfNode(node, currentSourceFile); + return ts.getLeadingCommentRangesOfNode(node, currentSourceFile); } - return leadingComments; } } } - function emitLeadingDeclarationComments(node) { - var leadingComments = getLeadingCommentsToEmit(node); - emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); - emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); - } - function emitTrailingDeclarationComments(node) { + function getTrailingCommentsToEmit(node) { if (node.parent) { - if (node.parent.kind === 221 || node.end !== node.parent.end) { - var trailingComments = ts.getTrailingCommentRanges(currentSourceFile.text, node.end); - emitComments(currentSourceFile, writer, trailingComments, false, newLine, writeComment); + if (node.parent.kind === 227 || node.end !== node.parent.end) { + return ts.getTrailingCommentRanges(currentSourceFile.text, node.end); } } } - function emitLeadingCommentsOfLocalPosition(pos) { + function emitOnlyPinnedOrTripleSlashComments(node) { + emitLeadingCommentsWorker(node, true); + } + function emitLeadingComments(node) { + return emitLeadingCommentsWorker(node, compilerOptions.removeComments); + } + function emitLeadingCommentsWorker(node, onlyPinnedOrTripleSlashComments) { + var leadingComments = filterComments(getLeadingCommentsToEmit(node), onlyPinnedOrTripleSlashComments); + ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); + ts.emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); + } + function emitTrailingComments(node) { + var trailingComments = filterComments(getTrailingCommentsToEmit(node), compilerOptions.removeComments); + ts.emitComments(currentSourceFile, writer, trailingComments, false, newLine, writeComment); + } + function emitLeadingCommentsOfPosition(pos) { var leadingComments; if (hasDetachedComments(pos)) { leadingComments = getLeadingCommentsWithoutDetachedComments(); @@ -22113,18 +23823,19 @@ var ts; else { leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, pos); } - emitNewLineBeforeLeadingComments(currentSourceFile, writer, { pos: pos, end: pos }, leadingComments); - emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); + leadingComments = filterComments(leadingComments, compilerOptions.removeComments); + ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, { pos: pos, end: pos }, leadingComments); + ts.emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); } - function emitDetachedCommentsAtPosition(node) { + function emitDetachedComments(node) { var leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, node.pos); if (leadingComments) { var detachedComments = []; var lastComment; ts.forEach(leadingComments, function (comment) { if (lastComment) { - var lastCommentLine = getLineOfLocalPosition(currentSourceFile, lastComment.end); - var commentLine = getLineOfLocalPosition(currentSourceFile, comment.pos); + var lastCommentLine = ts.getLineOfLocalPosition(currentSourceFile, lastComment.end); + var commentLine = ts.getLineOfLocalPosition(currentSourceFile, comment.pos); if (commentLine >= lastCommentLine + 2) { return detachedComments; } @@ -22133,11 +23844,11 @@ var ts; lastComment = comment; }); if (detachedComments.length) { - var lastCommentLine = getLineOfLocalPosition(currentSourceFile, detachedComments[detachedComments.length - 1].end); - var nodeLine = getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node.pos)); + var lastCommentLine = ts.getLineOfLocalPosition(currentSourceFile, detachedComments[detachedComments.length - 1].end); + var nodeLine = ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node.pos)); if (nodeLine >= lastCommentLine + 2) { - emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); - emitComments(currentSourceFile, writer, detachedComments, true, newLine, writeComment); + 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 }; if (detachedCommentsInfo) { detachedCommentsInfo.push(currentDetachedCommentInfo); @@ -22149,54 +23860,53 @@ var ts; } } } - function emitPinnedOrTripleSlashComments(node) { - var pinnedComments = ts.filter(getLeadingCommentsToEmit(node), isPinnedOrTripleSlashComment); - function isPinnedOrTripleSlashComment(comment) { - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42) { - return currentSourceFile.text.charCodeAt(comment.pos + 2) === 33; - } - else if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 47 && - comment.pos + 2 < comment.end && - currentSourceFile.text.charCodeAt(comment.pos + 2) === 47 && - currentSourceFile.text.substring(comment.pos, comment.end).match(ts.fullTripleSlashReferencePathRegEx)) { - return true; - } + function isPinnedOrTripleSlashComment(comment) { + if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42) { + return currentSourceFile.text.charCodeAt(comment.pos + 2) === 33; + } + else if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 47 && + comment.pos + 2 < comment.end && + currentSourceFile.text.charCodeAt(comment.pos + 2) === 47 && + currentSourceFile.text.substring(comment.pos, comment.end).match(ts.fullTripleSlashReferencePathRegEx)) { + return true; } - emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, pinnedComments); - emitComments(currentSourceFile, writer, pinnedComments, true, newLine, writeComment); - } - } - function writeDeclarationFile(jsFilePath, sourceFile) { - var emitDeclarationResult = emitDeclarations(host, resolver, diagnostics, jsFilePath, sourceFile); - if (!emitDeclarationResult.reportedDeclarationError) { - var declarationOutput = emitDeclarationResult.referencePathsOutput; - var appliedSyncOutputPos = 0; - ts.forEach(emitDeclarationResult.aliasDeclarationEmitInfo, function (aliasEmitInfo) { - if (aliasEmitInfo.asynchronousOutput) { - declarationOutput += emitDeclarationResult.synchronousDeclarationOutput.substring(appliedSyncOutputPos, aliasEmitInfo.outputPos); - declarationOutput += aliasEmitInfo.asynchronousOutput; - appliedSyncOutputPos = aliasEmitInfo.outputPos; - } - }); - declarationOutput += emitDeclarationResult.synchronousDeclarationOutput.substring(appliedSyncOutputPos); - writeFile(host, diagnostics, ts.removeFileExtension(jsFilePath) + ".d.ts", declarationOutput, compilerOptions.emitBOM); } } function emitFile(jsFilePath, sourceFile) { emitJavaScript(jsFilePath, sourceFile); if (compilerOptions.declaration) { - writeDeclarationFile(jsFilePath, sourceFile); + ts.writeDeclarationFile(jsFilePath, sourceFile, host, resolver, diagnostics); } } } ts.emitFiles = emitFiles; })(ts || (ts = {})); +/// +/// var ts; (function (ts) { + ts.programTime = 0; ts.emitTime = 0; ts.ioReadTime = 0; - ts.version = "1.5.0.0"; - function createCompilerHost(options) { + ts.ioWriteTime = 0; + ts.version = "1.5.0"; + function findConfigFile(searchPath) { + var fileName = "tsconfig.json"; + while (true) { + if (ts.sys.fileExists(fileName)) { + return fileName; + } + var parentPath = ts.getDirectoryPath(searchPath); + if (parentPath === searchPath) { + break; + } + searchPath = parentPath; + fileName = "../" + fileName; + } + return undefined; + } + ts.findConfigFile = findConfigFile; + function createCompilerHost(options, setParentNodes) { var currentDirectory; var existingDirectories = {}; function getCanonicalFileName(fileName) { @@ -22218,29 +23928,31 @@ var ts; } text = ""; } - return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion) : undefined; + return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion, setParentNodes) : undefined; + } + function directoryExists(directoryPath) { + if (ts.hasProperty(existingDirectories, directoryPath)) { + return true; + } + if (ts.sys.directoryExists(directoryPath)) { + existingDirectories[directoryPath] = true; + return true; + } + return false; + } + function ensureDirectoriesExist(directoryPath) { + if (directoryPath.length > ts.getRootLength(directoryPath) && !directoryExists(directoryPath)) { + var parentDirectory = ts.getDirectoryPath(directoryPath); + ensureDirectoriesExist(parentDirectory); + ts.sys.createDirectory(directoryPath); + } } function writeFile(fileName, data, writeByteOrderMark, onError) { - function directoryExists(directoryPath) { - if (ts.hasProperty(existingDirectories, directoryPath)) { - return true; - } - if (ts.sys.directoryExists(directoryPath)) { - existingDirectories[directoryPath] = true; - return true; - } - return false; - } - function ensureDirectoriesExist(directoryPath) { - if (directoryPath.length > ts.getRootLength(directoryPath) && !directoryExists(directoryPath)) { - var parentDirectory = ts.getDirectoryPath(directoryPath); - ensureDirectoriesExist(parentDirectory); - ts.sys.createDirectory(directoryPath); - } - } try { + var start = new Date().getTime(); ensureDirectoriesExist(ts.getDirectoryPath(ts.normalizePath(fileName))); ts.sys.writeFile(fileName, data, writeByteOrderMark); + ts.ioWriteTime += new Date().getTime() - start; } catch (e) { if (onError) { @@ -22261,6 +23973,9 @@ var ts; ts.createCompilerHost = createCompilerHost; function getPreEmitDiagnostics(program) { var diagnostics = program.getSyntacticDiagnostics().concat(program.getGlobalDiagnostics()).concat(program.getSemanticDiagnostics()); + if (program.getCompilerOptions().declaration) { + diagnostics.concat(program.getDeclarationDiagnostics()); + } return ts.sortAndDeduplicateDiagnostics(diagnostics); } ts.getPreEmitDiagnostics = getPreEmitDiagnostics; @@ -22294,14 +24009,16 @@ var ts; var diagnostics = ts.createDiagnosticCollection(); var seenNoDefaultLib = options.noLib; var commonSourceDirectory; + var diagnosticsProducingTypeChecker; + var noDiagnosticsTypeChecker; + var start = new Date().getTime(); host = host || createCompilerHost(options); ts.forEach(rootNames, function (name) { return processRootFile(name, false); }); if (!seenNoDefaultLib) { processRootFile(host.getDefaultLibFileName(options), true); } verifyCompilerOptions(); - var diagnosticsProducingTypeChecker; - var noDiagnosticsTypeChecker; + ts.programTime += new Date().getTime() - start; program = { getSourceFile: getSourceFile, getSourceFiles: function () { return files; }, @@ -22339,10 +24056,6 @@ var ts; function getTypeChecker() { return noDiagnosticsTypeChecker || (noDiagnosticsTypeChecker = ts.createTypeChecker(program, false)); } - function getDeclarationDiagnostics(targetSourceFile) { - var resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(targetSourceFile); - return ts.getDeclarationDiagnostics(getEmitHost(), resolver, targetSourceFile); - } function emit(sourceFile, writeFileCallback) { if (options.noEmitOnError && getPreEmitDiagnostics(this).length > 0) { return { diagnostics: [], sourceMaps: undefined, emitSkipped: true }; @@ -22373,6 +24086,9 @@ var ts; function getSemanticDiagnostics(sourceFile) { return getDiagnosticsHelper(sourceFile, getSemanticDiagnosticsForFile); } + function getDeclarationDiagnostics(sourceFile) { + return getDiagnosticsHelper(sourceFile, getDeclarationDiagnosticsForFile); + } function getSyntacticDiagnosticsForFile(sourceFile) { return sourceFile.parseDiagnostics; } @@ -22384,6 +24100,13 @@ var ts; var programDiagnostics = diagnostics.getDiagnostics(sourceFile.fileName); return bindDiagnostics.concat(checkDiagnostics).concat(programDiagnostics); } + function getDeclarationDiagnosticsForFile(sourceFile) { + if (!ts.isDeclarationFile(sourceFile)) { + var resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile); + var writeFile = function () { }; + return ts.getDeclarationDiagnostics(getEmitHost(writeFile), resolver, sourceFile); + } + } function getGlobalDiagnostics() { var typeChecker = getDiagnosticsProducingTypeChecker(); var allDiagnostics = []; @@ -22399,10 +24122,10 @@ var ts; } function processSourceFile(fileName, isDefaultLib, refFile, refPos, refEnd) { var start; - var _length; + var length; if (refEnd !== undefined && refPos !== undefined) { start = refPos; - _length = refEnd - refPos; + length = refEnd - refPos; } var diagnostic; if (hasExtension(fileName)) { @@ -22427,7 +24150,7 @@ var ts; } if (diagnostic) { if (refFile) { - diagnostics.add(ts.createFileDiagnostic(refFile, start, _length, diagnostic, fileName)); + diagnostics.add(ts.createFileDiagnostic(refFile, start, length, diagnostic, fileName)); } else { diagnostics.add(ts.createCompilerDiagnostic(diagnostic, fileName)); @@ -22471,14 +24194,14 @@ var ts; return file; } function getSourceFileFromCache(fileName, canonicalName, useAbsolutePath) { - var _file = filesByName[canonicalName]; - if (_file && host.useCaseSensitiveFileNames()) { - var sourceFileName = useAbsolutePath ? ts.getNormalizedAbsolutePath(_file.fileName, host.getCurrentDirectory()) : _file.fileName; + var file = filesByName[canonicalName]; + if (file && host.useCaseSensitiveFileNames()) { + var sourceFileName = useAbsolutePath ? ts.getNormalizedAbsolutePath(file.fileName, host.getCurrentDirectory()) : file.fileName; if (canonicalName !== sourceFileName) { diagnostics.add(ts.createFileDiagnostic(refFile, refStart, refLength, ts.Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, fileName, sourceFileName)); } } - return _file; + return file; } } function processReferencedFiles(file, basePath) { @@ -22489,7 +24212,7 @@ var ts; } function processImportedModules(file, basePath) { ts.forEach(file.statements, function (node) { - if (node.kind === 204 || node.kind === 203 || node.kind === 210) { + if (node.kind === 209 || node.kind === 208 || node.kind === 215) { var moduleNameExpr = ts.getExternalModuleName(node); if (moduleNameExpr && moduleNameExpr.kind === 8) { var moduleNameText = moduleNameExpr.text; @@ -22509,17 +24232,17 @@ var ts; } } } - else if (node.kind === 200 && node.name.kind === 8 && (node.flags & 2 || ts.isDeclarationFile(file))) { + else if (node.kind === 205 && 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) { var nameLiteral = ts.getExternalModuleImportEqualsDeclarationExpression(node); var moduleName = nameLiteral.text; if (moduleName) { - var _searchName = ts.normalizePath(ts.combinePaths(basePath, moduleName)); - var tsFile = findModuleSourceFile(_searchName + ".ts", nameLiteral); + var searchName = ts.normalizePath(ts.combinePaths(basePath, moduleName)); + var tsFile = findModuleSourceFile(searchName + ".ts", nameLiteral); if (!tsFile) { - findModuleSourceFile(_searchName + ".d.ts", nameLiteral); + findModuleSourceFile(searchName + ".d.ts", nameLiteral); } } } @@ -22531,6 +24254,20 @@ var ts; } } function verifyCompilerOptions() { + if (options.separateCompilation) { + if (options.sourceMap) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_sourceMap_cannot_be_specified_with_option_separateCompilation)); + } + if (options.declaration) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_declaration_cannot_be_specified_with_option_separateCompilation)); + } + if (options.noEmitOnError) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_noEmitOnError_cannot_be_specified_with_option_separateCompilation)); + } + if (options.out) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_out_cannot_be_specified_with_option_separateCompilation)); + } + } 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)); @@ -22540,11 +24277,25 @@ var ts; } return; } + var languageVersion = options.target || 0; var firstExternalModuleSourceFile = ts.forEach(files, function (f) { return ts.isExternalModule(f) ? f : undefined; }); - if (firstExternalModuleSourceFile && !options.module) { + if (options.separateCompilation) { + if (!options.module && languageVersion < 2) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_separateCompilation_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher)); + } + 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)); + } + } + 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)); } + if (options.module && languageVersion >= 2) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher)); + } if (options.outDir || options.sourceRoot || (options.mapRoot && @@ -22592,6 +24343,9 @@ var ts; } ts.createProgram = createProgram; })(ts || (ts = {})); +// Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. +// See LICENSE.txt in the project root for complete license information. +/// var ts; (function (ts) { var BreakpointResolver; @@ -22630,98 +24384,101 @@ var ts; function spanInNode(node) { if (node) { if (ts.isExpression(node)) { - if (node.parent.kind === 179) { + if (node.parent.kind === 184) { return spanInPreviousNode(node); } - if (node.parent.kind === 181) { + if (node.parent.kind === 186) { return textSpan(node); } - if (node.parent.kind === 167 && node.parent.operatorToken.kind === 23) { + if (node.parent.kind === 169 && node.parent.operatorToken.kind === 23) { return textSpan(node); } - if (node.parent.kind == 161 && node.parent.body == node) { + if (node.parent.kind == 163 && node.parent.body == node) { return textSpan(node); } } switch (node.kind) { - case 175: + case 180: return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 193: - case 130: - case 129: - return spanInVariableDeclaration(node); - case 128: - return spanInParameterDeclaration(node); - case 195: + case 198: case 132: case 131: + return spanInVariableDeclaration(node); + case 129: + return spanInParameterDeclaration(node); + case 200: case 134: - case 135: case 133: - case 160: - case 161: + case 136: + case 137: + case 135: + case 162: + case 163: return spanInFunctionDeclaration(node); - case 174: + case 179: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } - case 201: + case 206: return spanInBlock(node); - case 217: + case 223: return spanInBlock(node.block); - case 177: - return textSpan(node.expression); - case 186: - return textSpan(node.getChildAt(0), node.expression); - case 180: - return textSpan(node, ts.findNextToken(node.expression, node)); - case 179: - return spanInNode(node.statement); - case 192: - return textSpan(node.getChildAt(0)); - case 178: - return textSpan(node, ts.findNextToken(node.expression, node)); - case 189: - return spanInNode(node.statement); - case 185: - case 184: - return textSpan(node.getChildAt(0), node.label); - case 181: - return spanInForStatement(node); 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, 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 214: - case 215: + case 193: + return textSpan(node, ts.findNextToken(node.expression, node)); + case 220: + case 221: return spanInNode(node.statements[0]); - case 191: + case 196: return spanInBlock(node.tryBlock); - case 190: + case 195: return textSpan(node, node.expression); - case 209: + case 214: + if (!node.expression) { + return undefined; + } return textSpan(node, node.expression); - case 203: + case 208: return textSpan(node, node.moduleReference); - case 204: + case 209: return textSpan(node, node.moduleSpecifier); - case 210: + case 215: return textSpan(node, node.moduleSpecifier); - case 200: + case 205: if (ts.getModuleInstanceState(node) !== 1) { return undefined; } - case 196: - case 199: - case 220: - case 155: - case 156: + case 201: + case 204: + case 226: + case 157: + case 158: return textSpan(node); - case 187: + case 192: return spanInNode(node.statement); - case 197: - case 198: + case 202: + case 203: return undefined; case 22: case 1: @@ -22741,17 +24498,17 @@ var ts; case 25: case 24: return spanInGreaterThanOrLessThanToken(node); - case 99: + case 100: return spanInWhileKeyword(node); - case 75: - case 67: - case 80: + case 76: + case 68: + case 81: return spanInNextNode(node); default: - if (node.parent.kind === 218 && node.parent.name === node) { + if (node.parent.kind === 224 && node.parent.name === node) { return spanInNode(node.parent.initializer); } - if (node.parent.kind === 158 && node.parent.type === node) { + if (node.parent.kind === 160 && node.parent.type === node) { return spanInNode(node.parent.expression); } if (ts.isFunctionLike(node.parent) && node.parent.type === node) { @@ -22761,12 +24518,12 @@ var ts; } } function spanInVariableDeclaration(variableDeclaration) { - if (variableDeclaration.parent.parent.kind === 182 || - variableDeclaration.parent.parent.kind === 183) { + if (variableDeclaration.parent.parent.kind === 187 || + variableDeclaration.parent.parent.kind === 188) { return spanInNode(variableDeclaration.parent.parent); } - var isParentVariableStatement = variableDeclaration.parent.parent.kind === 175; - var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 181 && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); + var isParentVariableStatement = variableDeclaration.parent.parent.kind === 180; + var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 186 && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); var declarations = isParentVariableStatement ? variableDeclaration.parent.parent.declarationList.declarations : isDeclarationOfForStatement @@ -22812,7 +24569,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return !!(functionDeclaration.flags & 1) || - (functionDeclaration.parent.kind === 196 && functionDeclaration.kind !== 133); + (functionDeclaration.parent.kind === 201 && functionDeclaration.kind !== 135); } function spanInFunctionDeclaration(functionDeclaration) { if (!functionDeclaration.body) { @@ -22832,23 +24589,23 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 200: + case 205: if (ts.getModuleInstanceState(block.parent) !== 1) { return undefined; } - case 180: - case 178: - case 182: + case 185: case 183: + case 187: + case 188: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); - case 181: + case 186: 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 === 194) { + if (forStatement.initializer.kind === 199) { var variableDeclarationList = forStatement.initializer; if (variableDeclarationList.declarations.length > 0) { return spanInNode(variableDeclarationList.declarations[0]); @@ -22867,34 +24624,34 @@ var ts; } function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 199: + case 204: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 196: + case 201: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 202: + case 207: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } return spanInNode(node.parent); } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 201: + case 206: if (ts.getModuleInstanceState(node.parent.parent) !== 1) { return undefined; } - case 199: - case 196: + case 204: + case 201: return textSpan(node); - case 174: + case 179: if (ts.isFunctionBlock(node.parent)) { return textSpan(node); } - case 217: + case 223: return spanInNode(node.parent.statements[node.parent.statements.length - 1]); ; - case 202: + case 207: var caseBlock = node.parent; var lastClause = caseBlock.clauses[caseBlock.clauses.length - 1]; if (lastClause) { @@ -22906,24 +24663,24 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 179) { + if (node.parent.kind === 184) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInCloseParenToken(node) { switch (node.parent.kind) { - case 160: - case 195: - case 161: - case 132: - case 131: + case 162: + case 200: + case 163: case 134: - case 135: case 133: - case 180: - case 179: - case 181: + case 136: + case 137: + case 135: + case 185: + case 184: + case 186: return spanInPreviousNode(node); default: return spanInNode(node.parent); @@ -22931,19 +24688,19 @@ var ts; return spanInNode(node.parent); } function spanInColonToken(node) { - if (ts.isFunctionLike(node.parent) || node.parent.kind === 218) { + if (ts.isFunctionLike(node.parent) || node.parent.kind === 224) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 158) { + if (node.parent.kind === 160) { return spanInNode(node.parent.expression); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 179) { + if (node.parent.kind === 184) { return textSpan(node, ts.findNextToken(node.parent.expression, node.parent)); } return spanInNode(node.parent); @@ -22953,6 +24710,20 @@ var ts; BreakpointResolver.spanInSourceFileAtLocation = spanInSourceFileAtLocation; })(BreakpointResolver = ts.BreakpointResolver || (ts.BreakpointResolver = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// var ts; (function (ts) { var OutliningElementsCollector; @@ -22972,7 +24743,7 @@ var ts; } } function autoCollapse(node) { - return ts.isFunctionBlock(node) && node.parent.kind !== 161; + return ts.isFunctionBlock(node) && node.parent.kind !== 163; } var depth = 0; var maxDepth = 20; @@ -22981,30 +24752,30 @@ var ts; return; } switch (n.kind) { - case 174: + case 179: if (!ts.isFunctionBlock(n)) { - var _parent = n.parent; + var parent_6 = n.parent; var openBrace = ts.findChildOfKind(n, 14, sourceFile); var closeBrace = ts.findChildOfKind(n, 15, sourceFile); - if (_parent.kind === 179 || - _parent.kind === 182 || - _parent.kind === 183 || - _parent.kind === 181 || - _parent.kind === 178 || - _parent.kind === 180 || - _parent.kind === 187 || - _parent.kind === 217) { - addOutliningSpan(_parent, openBrace, closeBrace, autoCollapse(n)); + if (parent_6.kind === 184 || + parent_6.kind === 187 || + parent_6.kind === 188 || + parent_6.kind === 186 || + parent_6.kind === 183 || + parent_6.kind === 185 || + parent_6.kind === 192 || + parent_6.kind === 223) { + addOutliningSpan(parent_6, openBrace, closeBrace, autoCollapse(n)); break; } - if (_parent.kind === 191) { - var tryStatement = _parent; + if (parent_6.kind === 196) { + var tryStatement = parent_6; if (tryStatement.tryBlock === n) { - addOutliningSpan(_parent, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(parent_6, openBrace, closeBrace, autoCollapse(n)); break; } else if (tryStatement.finallyBlock === n) { - var finallyKeyword = ts.findChildOfKind(tryStatement, 80, sourceFile); + var finallyKeyword = ts.findChildOfKind(tryStatement, 81, sourceFile); if (finallyKeyword) { addOutliningSpan(finallyKeyword, openBrace, closeBrace, autoCollapse(n)); break; @@ -23020,23 +24791,23 @@ var ts; }); break; } - case 201: { - var _openBrace = ts.findChildOfKind(n, 14, sourceFile); - var _closeBrace = ts.findChildOfKind(n, 15, sourceFile); - addOutliningSpan(n.parent, _openBrace, _closeBrace, autoCollapse(n)); + case 206: { + var openBrace = ts.findChildOfKind(n, 14, sourceFile); + var closeBrace = ts.findChildOfKind(n, 15, sourceFile); + addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); break; } - case 196: - case 197: - case 199: - case 152: - case 202: { - var _openBrace_1 = ts.findChildOfKind(n, 14, sourceFile); - var _closeBrace_1 = ts.findChildOfKind(n, 15, sourceFile); - addOutliningSpan(n, _openBrace_1, _closeBrace_1, autoCollapse(n)); + case 201: + case 202: + case 204: + case 154: + case 207: { + var openBrace = ts.findChildOfKind(n, 14, sourceFile); + var closeBrace = ts.findChildOfKind(n, 15, sourceFile); + addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); break; } - case 151: + case 153: var openBracket = ts.findChildOfKind(n, 18, sourceFile); var closeBracket = ts.findChildOfKind(n, 19, sourceFile); addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); @@ -23062,7 +24833,7 @@ var ts; ts.forEach(program.getSourceFiles(), function (sourceFile) { cancellationToken.throwIfCancellationRequested(); var declarations = sourceFile.getNamedDeclarations(); - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; var name = getDeclarationName(declaration); if (name !== undefined) { @@ -23094,7 +24865,7 @@ var ts; return items; function allMatchesAreCaseSensitive(matches) { ts.Debug.assert(matches.length > 0); - for (var _i = 0, _n = matches.length; _i < _n; _i++) { + for (var _i = 0; _i < matches.length; _i++) { var match = matches[_i]; if (!match.isCaseSensitive) { return false; @@ -23107,9 +24878,9 @@ var ts; if (result !== undefined) { return result; } - if (declaration.name.kind === 126) { + if (declaration.name.kind === 127) { var expr = declaration.name.expression; - if (expr.kind === 153) { + if (expr.kind === 155) { return expr.name.text; } return getTextOfIdentifierOrLiteral(expr); @@ -23117,7 +24888,7 @@ var ts; return undefined; } function getTextOfIdentifierOrLiteral(node) { - if (node.kind === 64 || + if (node.kind === 65 || node.kind === 8 || node.kind === 7) { return node.text; @@ -23130,7 +24901,7 @@ var ts; if (text !== undefined) { containers.unshift(text); } - else if (declaration.name.kind === 126) { + else if (declaration.name.kind === 127) { return tryAddComputedPropertyName(declaration.name.expression, containers, true); } else { @@ -23147,7 +24918,7 @@ var ts; } return true; } - if (expression.kind === 153) { + if (expression.kind === 155) { var propertyAccess = expression; if (includeLastPortion) { containers.unshift(propertyAccess.name.text); @@ -23158,7 +24929,7 @@ var ts; } function getContainers(declaration) { var containers = []; - if (declaration.name.kind === 126) { + if (declaration.name.kind === 127) { if (!tryAddComputedPropertyName(declaration.name.expression, containers, false)) { return undefined; } @@ -23174,15 +24945,15 @@ var ts; } function bestMatchKind(matches) { ts.Debug.assert(matches.length > 0); - var _bestMatchKind = 3; - for (var _i = 0, _n = matches.length; _i < _n; _i++) { + var bestMatchKind = ts.PatternMatchKind.camelCase; + for (var _i = 0; _i < matches.length; _i++) { var match = matches[_i]; var kind = match.kind; - if (kind < _bestMatchKind) { - _bestMatchKind = kind; + if (kind < bestMatchKind) { + bestMatchKind = kind; } } - return _bestMatchKind; + return bestMatchKind; } var baseSensitivity = { sensitivity: "base" }; function compareNavigateToItems(i1, i2) { @@ -23209,6 +24980,7 @@ var ts; NavigateTo.getNavigateToItems = getNavigateToItems; })(NavigateTo = ts.NavigateTo || (ts.NavigateTo = {})); })(ts || (ts = {})); +/// var ts; (function (ts) { var NavigationBar; @@ -23221,14 +24993,14 @@ var ts; var current = node.parent; while (current) { switch (current.kind) { - case 200: + case 205: do { current = current.parent; - } while (current.kind === 200); - case 196: - case 199: - case 197: - case 195: + } while (current.kind === 205); + case 201: + case 204: + case 202: + case 200: indent++; } current = current.parent; @@ -23239,26 +25011,26 @@ var ts; var childNodes = []; function visit(node) { switch (node.kind) { - case 175: + case 180: ts.forEach(node.declarationList.declarations, visit); break; - case 148: - case 149: + case 150: + case 151: ts.forEach(node.elements, visit); break; - case 210: + case 215: if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 204: + case 209: var importClause = node.importClause; if (importClause) { if (importClause.name) { childNodes.push(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 206) { + if (importClause.namedBindings.kind === 211) { childNodes.push(importClause.namedBindings); } else { @@ -23267,20 +25039,20 @@ var ts; } } break; - case 150: - case 193: + case 152: + case 198: if (ts.isBindingPattern(node.name)) { visit(node.name); break; } - case 196: - case 199: - case 197: + case 201: + case 204: + case 202: + case 205: case 200: - case 195: - case 203: case 208: - case 212: + case 213: + case 217: childNodes.push(node); break; } @@ -23312,20 +25084,20 @@ var ts; } function addTopLevelNodes(nodes, topLevelNodes) { nodes = sortNodes(nodes); - for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + for (var _i = 0; _i < nodes.length; _i++) { var node = nodes[_i]; switch (node.kind) { - case 196: - case 199: - case 197: + case 201: + case 204: + case 202: topLevelNodes.push(node); break; - case 200: + case 205: var moduleDeclaration = node; topLevelNodes.push(node); addTopLevelNodes(getInnermostModule(moduleDeclaration).body.statements, topLevelNodes); break; - case 195: + case 200: var functionDeclaration = node; if (isTopLevelFunctionDeclaration(functionDeclaration)) { topLevelNodes.push(node); @@ -23336,9 +25108,9 @@ var ts; } } function isTopLevelFunctionDeclaration(functionDeclaration) { - if (functionDeclaration.kind === 195) { - if (functionDeclaration.body && functionDeclaration.body.kind === 174) { - if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 195 && !isEmpty(s.name.text); })) { + 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); })) { return true; } if (!ts.isFunctionBlock(functionDeclaration.parent)) { @@ -23351,19 +25123,19 @@ var ts; function getItemsWorker(nodes, createItem) { var items = []; var keyToItem = {}; - for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + for (var _i = 0; _i < nodes.length; _i++) { var child = nodes[_i]; - var _item = createItem(child); - if (_item !== undefined) { - if (_item.text.length > 0) { - var key = _item.text + "-" + _item.kind + "-" + _item.indent; + var item_3 = createItem(child); + if (item_3 !== undefined) { + if (item_3.text.length > 0) { + var key = item_3.text + "-" + item_3.kind + "-" + item_3.indent; var itemWithSameName = keyToItem[key]; if (itemWithSameName) { - merge(itemWithSameName, _item); + merge(itemWithSameName, item_3); } else { - keyToItem[key] = _item; - items.push(_item); + keyToItem[key] = item_3; + items.push(item_3); } } } @@ -23376,9 +25148,9 @@ var ts; if (!target.childItems) { target.childItems = []; } - outer: for (var _i = 0, _a = source.childItems, _n = _a.length; _i < _n; _i++) { + outer: for (var _i = 0, _a = source.childItems; _i < _a.length; _i++) { var sourceChild = _a[_i]; - for (var _b = 0, _c = target.childItems, _d = _c.length; _b < _d; _b++) { + for (var _b = 0, _c = target.childItems; _b < _c.length; _b++) { var targetChild = _c[_b]; if (targetChild.text === sourceChild.text && targetChild.kind === sourceChild.kind) { merge(targetChild, sourceChild); @@ -23391,7 +25163,7 @@ var ts; } function createChildItem(node) { switch (node.kind) { - case 128: + case 129: if (ts.isBindingPattern(node.name)) { break; } @@ -23399,34 +25171,34 @@ var ts; return undefined; } return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); + 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); + 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.memberFunctionElement); - case 134: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberGetAccessorElement); - case 135: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberSetAccessorElement); - case 138: - return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement); - case 220: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 136: - return createItem(node, "()", ts.ScriptElementKind.callSignatureElement); - case 137: - return createItem(node, "new()", ts.ScriptElementKind.constructSignatureElement); - case 130: - case 129: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 195: + case 200: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.functionElement); - case 193: - case 150: + case 198: + case 152: var variableDeclarationNode; - var _name; - if (node.kind === 150) { - _name = node.name; + var name_18; + if (node.kind === 152) { + name_18 = node.name; variableDeclarationNode = node; - while (variableDeclarationNode && variableDeclarationNode.kind !== 193) { + while (variableDeclarationNode && variableDeclarationNode.kind !== 198) { variableDeclarationNode = variableDeclarationNode.parent; } ts.Debug.assert(variableDeclarationNode !== undefined); @@ -23434,24 +25206,24 @@ var ts; else { ts.Debug.assert(!ts.isBindingPattern(node.name)); variableDeclarationNode = node; - _name = node.name; + name_18 = node.name; } if (ts.isConst(variableDeclarationNode)) { - return createItem(node, getTextOfNode(_name), ts.ScriptElementKind.constElement); + return createItem(node, getTextOfNode(name_18), ts.ScriptElementKind.constElement); } else if (ts.isLet(variableDeclarationNode)) { - return createItem(node, getTextOfNode(_name), ts.ScriptElementKind.letElement); + return createItem(node, getTextOfNode(name_18), ts.ScriptElementKind.letElement); } else { - return createItem(node, getTextOfNode(_name), ts.ScriptElementKind.variableElement); + return createItem(node, getTextOfNode(name_18), ts.ScriptElementKind.variableElement); } - case 133: + case 135: return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); - case 212: + case 217: + case 213: case 208: - case 203: - case 205: - case 206: + case 210: + case 211: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.alias); } return undefined; @@ -23481,17 +25253,17 @@ var ts; } function createTopLevelItem(node) { switch (node.kind) { - case 221: + case 227: return createSourceFileItem(node); - case 196: + case 201: return createClassItem(node); - case 199: + case 204: return createEnumItem(node); - case 197: + case 202: return createIterfaceItem(node); - case 200: + case 205: return createModuleItem(node); - case 195: + case 200: return createFunctionItem(node); } return undefined; @@ -23501,7 +25273,7 @@ var ts; } var result = []; result.push(moduleDeclaration.name.text); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 200) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 205) { moduleDeclaration = moduleDeclaration.body; result.push(moduleDeclaration.name.text); } @@ -23513,9 +25285,9 @@ var ts; return getNavigationBarItem(moduleName, ts.ScriptElementKind.moduleElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } function createFunctionItem(node) { - if (node.name && node.body && node.body.kind === 174) { + if ((node.name || node.flags & 256) && node.body && node.body.kind === 179) { var childItems = getItemsWorker(sortNodes(node.body.statements), createChildItem); - return getNavigationBarItem(node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); + return getNavigationBarItem((!node.name && node.flags & 256) ? "default" : node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } return undefined; } @@ -23531,13 +25303,10 @@ var ts; return getNavigationBarItem(rootName, ts.ScriptElementKind.moduleElement, ts.ScriptElementKindModifier.none, [getNodeSpan(node)], childItems); } function createClassItem(node) { - if (!node.name) { - return undefined; - } var childItems; if (node.members) { var constructor = ts.forEach(node.members, function (member) { - return member.kind === 133 && member; + return member.kind === 135 && member; }); var nodes = removeDynamicallyNamedProperties(node); if (constructor) { @@ -23545,7 +25314,8 @@ var ts; } childItems = getItemsWorker(sortNodes(nodes), createChildItem); } - return getNavigationBarItem(node.name.text, ts.ScriptElementKind.classElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); + var nodeName = !node.name && (node.flags & 256) ? "default" : node.name.text; + return getNavigationBarItem(nodeName, ts.ScriptElementKind.classElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } function createEnumItem(node) { var childItems = getItemsWorker(sortNodes(removeComputedProperties(node)), createChildItem); @@ -23557,19 +25327,19 @@ var ts; } } function removeComputedProperties(node) { - return ts.filter(node.members, function (member) { return member.name === undefined || member.name.kind !== 126; }); + return ts.filter(node.members, function (member) { return member.name === undefined || member.name.kind !== 127; }); } function removeDynamicallyNamedProperties(node) { return ts.filter(node.members, function (member) { return !ts.hasDynamicName(member); }); } function getInnermostModule(node) { - while (node.body.kind === 200) { + while (node.body.kind === 205) { node = node.body; } return node; } function getNodeSpan(node) { - return node.kind === 221 + return node.kind === 227 ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) : ts.createTextSpanFromBounds(node.getStart(), node.getEnd()); } @@ -23651,27 +25421,27 @@ var ts; var index = indexOfIgnoringCase(candidate, chunk.textLowerCase); if (index === 0) { if (chunk.text.length === candidate.length) { - return createPatternMatch(0, punctuationStripped, candidate === chunk.text); + return createPatternMatch(PatternMatchKind.exact, punctuationStripped, candidate === chunk.text); } else { - return createPatternMatch(1, punctuationStripped, startsWith(candidate, chunk.text)); + return createPatternMatch(PatternMatchKind.prefix, punctuationStripped, startsWith(candidate, chunk.text)); } } var isLowercase = chunk.isLowerCase; if (isLowercase) { if (index > 0) { var wordSpans = getWordSpans(candidate); - for (var _i = 0, _n = wordSpans.length; _i < _n; _i++) { + for (var _i = 0; _i < wordSpans.length; _i++) { var span = wordSpans[_i]; if (partStartsWith(candidate, span, chunk.text, true)) { - return createPatternMatch(2, punctuationStripped, partStartsWith(candidate, span, chunk.text, false)); + return createPatternMatch(PatternMatchKind.substring, punctuationStripped, partStartsWith(candidate, span, chunk.text, false)); } } } } else { if (candidate.indexOf(chunk.text) > 0) { - return createPatternMatch(2, punctuationStripped, true); + return createPatternMatch(PatternMatchKind.substring, punctuationStripped, true); } } if (!isLowercase) { @@ -23679,18 +25449,18 @@ var ts; var candidateParts = getWordSpans(candidate); var camelCaseWeight = tryCamelCaseMatch(candidate, candidateParts, chunk, false); if (camelCaseWeight !== undefined) { - return createPatternMatch(3, punctuationStripped, true, camelCaseWeight); + return createPatternMatch(PatternMatchKind.camelCase, punctuationStripped, true, camelCaseWeight); } camelCaseWeight = tryCamelCaseMatch(candidate, candidateParts, chunk, true); if (camelCaseWeight !== undefined) { - return createPatternMatch(3, punctuationStripped, false, camelCaseWeight); + return createPatternMatch(PatternMatchKind.camelCase, punctuationStripped, false, camelCaseWeight); } } } if (isLowercase) { if (chunk.text.length < candidate.length) { if (index > 0 && isUpperCaseLetter(candidate.charCodeAt(index))) { - return createPatternMatch(2, punctuationStripped, false); + return createPatternMatch(PatternMatchKind.substring, punctuationStripped, false); } } } @@ -23714,7 +25484,7 @@ var ts; } var subWordTextChunks = segment.subWordTextChunks; var matches = undefined; - for (var _i = 0, _n = subWordTextChunks.length; _i < _n; _i++) { + for (var _i = 0; _i < subWordTextChunks.length; _i++) { var subWordTextChunk = subWordTextChunks[_i]; var result = matchTextChunk(candidate, subWordTextChunk, true); if (!result) { @@ -23741,10 +25511,10 @@ var ts; } } else { - for (var _i = 0; _i < patternPartLength; _i++) { - var _ch1 = pattern.charCodeAt(patternPartStart + _i); - var _ch2 = candidate.charCodeAt(candidateSpan.start + _i); - if (_ch1 !== _ch2) { + for (var i = 0; i < patternPartLength; i++) { + var ch1 = pattern.charCodeAt(patternPartStart + i); + var ch2 = candidate.charCodeAt(candidateSpan.start + i); + if (ch1 !== ch2) { return false; } } @@ -23819,7 +25589,7 @@ var ts; return result1.kind - result2.kind; } function compareCamelCase(result1, result2) { - if (result1.kind === 3 && result2.kind === 3) { + if (result1.kind === PatternMatchKind.camelCase && result2.kind === PatternMatchKind.camelCase) { return result2.camelCaseWeight - result1.camelCaseWeight; } return 0; @@ -24031,6 +25801,7 @@ var ts; return transition; } })(ts || (ts = {})); +/// var ts; (function (ts) { var SignatureHelp; @@ -24055,7 +25826,7 @@ var ts; } return createSignatureHelpItems(candidates, resolvedSignature, argumentInfo); function getImmediatelyContainingArgumentInfo(node) { - if (node.parent.kind === 155 || node.parent.kind === 156) { + if (node.parent.kind === 157 || node.parent.kind === 158) { var callExpression = node.parent; if (node.kind === 24 || node.kind === 16) { @@ -24072,50 +25843,50 @@ var ts; } var listItemInfo = ts.findListItemInfo(node); if (listItemInfo) { - var _list = listItemInfo.list; - var _isTypeArgList = callExpression.typeArguments && callExpression.typeArguments.pos === _list.pos; - var argumentIndex = getArgumentIndex(_list, node); - var argumentCount = getArgumentCount(_list); + var list = listItemInfo.list; + var isTypeArgList = callExpression.typeArguments && callExpression.typeArguments.pos === list.pos; + var argumentIndex = getArgumentIndex(list, node); + var argumentCount = getArgumentCount(list); ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); return { - kind: _isTypeArgList ? 0 : 1, + kind: isTypeArgList ? 0 : 1, invocation: callExpression, - argumentsSpan: getApplicableSpanForArguments(_list), + argumentsSpan: getApplicableSpanForArguments(list), argumentIndex: argumentIndex, argumentCount: argumentCount }; } } - else if (node.kind === 10 && node.parent.kind === 157) { + else if (node.kind === 10 && node.parent.kind === 159) { if (ts.isInsideTemplateLiteral(node, position)) { return getArgumentListInfoForTemplate(node.parent, 0); } } - else if (node.kind === 11 && node.parent.parent.kind === 157) { + else if (node.kind === 11 && node.parent.parent.kind === 159) { var templateExpression = node.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 169); - var _argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; - return getArgumentListInfoForTemplate(tagExpression, _argumentIndex); + ts.Debug.assert(templateExpression.kind === 171); + var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; + return getArgumentListInfoForTemplate(tagExpression, argumentIndex); } - else if (node.parent.kind === 173 && node.parent.parent.parent.kind === 157) { + else if (node.parent.kind === 176 && node.parent.parent.parent.kind === 159) { var templateSpan = node.parent; - var _templateExpression = templateSpan.parent; - var _tagExpression = _templateExpression.parent; - ts.Debug.assert(_templateExpression.kind === 169); + var templateExpression = templateSpan.parent; + var tagExpression = templateExpression.parent; + ts.Debug.assert(templateExpression.kind === 171); if (node.kind === 13 && !ts.isInsideTemplateLiteral(node, position)) { return undefined; } - var spanIndex = _templateExpression.templateSpans.indexOf(templateSpan); - var _argumentIndex_1 = getArgumentIndexForTemplatePiece(spanIndex, node); - return getArgumentListInfoForTemplate(_tagExpression, _argumentIndex_1); + var spanIndex = templateExpression.templateSpans.indexOf(templateSpan); + var argumentIndex = getArgumentIndexForTemplatePiece(spanIndex, node); + return getArgumentListInfoForTemplate(tagExpression, argumentIndex); } return undefined; } function getArgumentIndex(argumentsList, node) { var argumentIndex = 0; var listChildren = argumentsList.getChildren(); - for (var _i = 0, _n = listChildren.length; _i < _n; _i++) { + for (var _i = 0; _i < listChildren.length; _i++) { var child = listChildren[_i]; if (child === node) { break; @@ -24166,7 +25937,7 @@ var ts; var template = taggedTemplate.template; var applicableSpanStart = template.getStart(); var applicableSpanEnd = template.getEnd(); - if (template.kind === 169) { + if (template.kind === 171) { var lastSpan = ts.lastOrUndefined(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, false); @@ -24175,16 +25946,16 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node) { - for (var n = node; n.kind !== 221; n = n.parent) { + for (var n = node; n.kind !== 227; n = n.parent) { if (ts.isFunctionBlock(n)) { return undefined; } if (n.pos < n.parent.pos || n.end > n.parent.end) { ts.Debug.fail("Node of kind " + n.kind + " is not a subspan of its parent of kind " + n.parent.kind); } - var _argumentInfo = getImmediatelyContainingArgumentInfo(n); - if (_argumentInfo) { - return _argumentInfo; + var argumentInfo_1 = getImmediatelyContainingArgumentInfo(n); + if (argumentInfo_1) { + return argumentInfo_1; } } return undefined; @@ -24347,6 +26118,129 @@ var ts; return start < end; } ts.startEndOverlapsWithStartEnd = startEndOverlapsWithStartEnd; + function positionBelongsToNode(candidate, position, sourceFile) { + return candidate.end > position || !isCompletedNode(candidate, sourceFile); + } + ts.positionBelongsToNode = positionBelongsToNode; + function isCompletedNode(n, sourceFile) { + if (ts.nodeIsMissing(n)) { + return false; + } + switch (n.kind) { + case 201: + case 202: + case 204: + case 154: + case 150: + case 145: + case 179: + case 206: + case 207: + return nodeEndsWith(n, 15, sourceFile); + case 223: + return isCompletedNode(n.block, sourceFile); + case 158: + if (!n.arguments) { + return true; + } + case 157: + case 161: + case 149: + return nodeEndsWith(n, 17, sourceFile); + case 142: + case 143: + return isCompletedNode(n.type, sourceFile); + case 135: + case 136: + case 137: + case 200: + case 162: + case 134: + case 133: + case 139: + case 138: + case 163: + if (n.body) { + return isCompletedNode(n.body, sourceFile); + } + if (n.type) { + return isCompletedNode(n.type, sourceFile); + } + return hasChildOfKind(n, 17, sourceFile); + case 205: + return n.body && isCompletedNode(n.body, sourceFile); + case 183: + if (n.elseStatement) { + return isCompletedNode(n.elseStatement, sourceFile); + } + return isCompletedNode(n.thenStatement, sourceFile); + case 182: + return isCompletedNode(n.expression, sourceFile); + case 153: + case 151: + case 156: + case 127: + case 147: + return nodeEndsWith(n, 19, sourceFile); + case 140: + if (n.type) { + return isCompletedNode(n.type, sourceFile); + } + return hasChildOfKind(n, 19, sourceFile); + case 220: + case 221: + return false; + case 186: + case 187: + case 188: + case 185: + return isCompletedNode(n.statement, sourceFile); + case 184: + var hasWhileKeyword = findChildOfKind(n, 100, sourceFile); + if (hasWhileKeyword) { + return nodeEndsWith(n, 17, sourceFile); + } + return isCompletedNode(n.statement, sourceFile); + case 144: + return isCompletedNode(n.exprName, sourceFile); + case 165: + case 164: + case 166: + case 172: + case 173: + var unaryWordExpression = n; + return isCompletedNode(unaryWordExpression.expression, sourceFile); + case 159: + return isCompletedNode(n.template, sourceFile); + case 171: + var lastSpan = ts.lastOrUndefined(n.templateSpans); + return isCompletedNode(lastSpan, sourceFile); + case 176: + return ts.nodeIsPresent(n.literal); + case 167: + return isCompletedNode(n.operand, sourceFile); + case 169: + return isCompletedNode(n.right, sourceFile); + case 170: + return isCompletedNode(n.whenFalse, sourceFile); + default: + return true; + } + } + ts.isCompletedNode = isCompletedNode; + function nodeEndsWith(n, expectedLastToken, sourceFile) { + var children = n.getChildren(sourceFile); + if (children.length) { + var last = children[children.length - 1]; + if (last.kind === expectedLastToken) { + return true; + } + else if (last.kind === 22 && children.length !== 1) { + return children[children.length - 2].kind === expectedLastToken; + } + } + return false; + } function findListItemInfo(node) { var list = findContainingList(node); if (!list) { @@ -24360,13 +26254,17 @@ var ts; }; } ts.findListItemInfo = findListItemInfo; + function hasChildOfKind(n, kind, sourceFile) { + return !!findChildOfKind(n, kind, sourceFile); + } + ts.hasChildOfKind = hasChildOfKind; function findChildOfKind(n, kind, sourceFile) { return ts.forEach(n.getChildren(sourceFile), function (c) { return c.kind === kind && c; }); } ts.findChildOfKind = findChildOfKind; function findContainingList(node) { var syntaxList = ts.forEach(node.parent.getChildren(), function (c) { - if (c.kind === 222 && c.pos <= node.pos && c.end >= node.end) { + if (c.kind === 228 && c.pos <= node.pos && c.end >= node.end) { return c; } }); @@ -24431,7 +26329,7 @@ var ts; return n; } var children = n.getChildren(); - for (var _i = 0, _n = children.length; _i < _n; _i++) { + for (var _i = 0; _i < children.length; _i++) { var child = children[_i]; var shouldDiveInChildNode = (child.pos <= previousToken.pos && child.end > previousToken.end) || (child.pos === previousToken.end); @@ -24472,10 +26370,10 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 221); + ts.Debug.assert(startNode !== undefined || n.kind === 227); if (children.length) { - var _candidate = findRightmostChildNodeWithTokens(children, children.length); - return _candidate && findRightmostToken(_candidate); + var candidate = findRightmostChildNodeWithTokens(children, children.length); + return candidate && findRightmostToken(candidate); } } function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) { @@ -24509,22 +26407,23 @@ var ts; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 139 || node.kind === 155) { + if (node.kind === 141 || node.kind === 157) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 196 || node.kind === 197) { + if (ts.isFunctionLike(node) || node.kind === 201 || node.kind === 202) { return node.typeParameters; } return undefined; } ts.getTypeArgumentOrTypeParameterList = getTypeArgumentOrTypeParameterList; function isToken(n) { - return n.kind >= 0 && n.kind <= 124; + return n.kind >= 0 && n.kind <= 125; } ts.isToken = isToken; function isWord(kind) { - return kind === 64 || ts.isKeyword(kind); + return kind === 65 || ts.isKeyword(kind); } + ts.isWord = isWord; function isPropertyName(kind) { return kind === 8 || kind === 7 || isWord(kind); } @@ -24533,7 +26432,7 @@ var ts; } ts.isComment = isComment; function isPunctuation(kind) { - return 14 <= kind && kind <= 63; + return 14 <= kind && kind <= 64; } ts.isPunctuation = isPunctuation; function isInsideTemplateLiteral(node, position) { @@ -24541,6 +26440,16 @@ var ts; && (node.getStart() < position && position < node.getEnd()) || (!!node.isUnterminated && position === node.getEnd()); } ts.isInsideTemplateLiteral = isInsideTemplateLiteral; + function isAccessibilityModifier(kind) { + switch (kind) { + case 109: + case 107: + case 108: + return true; + } + return false; + } + ts.isAccessibilityModifier = isAccessibilityModifier; function compareDataObjects(dst, src) { for (var e in dst) { if (typeof dst[e] === "object") { @@ -24561,7 +26470,7 @@ var ts; var ts; (function (ts) { function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 128; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 129; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -24572,12 +26481,12 @@ var ts; resetWriter(); return { displayParts: function () { return displayParts; }, - writeKeyword: function (text) { return writeKind(text, 5); }, - writeOperator: function (text) { return writeKind(text, 12); }, - writePunctuation: function (text) { return writeKind(text, 15); }, - writeSpace: function (text) { return writeKind(text, 16); }, - writeStringLiteral: function (text) { return writeKind(text, 8); }, - writeParameter: function (text) { return writeKind(text, 13); }, + writeKeyword: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.keyword); }, + writeOperator: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.operator); }, + writePunctuation: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.punctuation); }, + writeSpace: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.space); }, + writeStringLiteral: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.stringLiteral); }, + writeParameter: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.parameterName); }, writeSymbol: writeSymbol, writeLine: writeLine, increaseIndent: function () { indent++; }, @@ -24589,7 +26498,7 @@ var ts; if (lineStart) { var indentString = ts.getIndentString(indent); if (indentString) { - displayParts.push(displayPart(indentString, 16)); + displayParts.push(displayPart(indentString, ts.SymbolDisplayPartKind.space)); } lineStart = false; } @@ -24617,48 +26526,48 @@ var ts; function displayPartKind(symbol) { var flags = symbol.flags; if (flags & 3) { - return isFirstDeclarationOfSymbolParameter(symbol) ? 13 : 9; + return isFirstDeclarationOfSymbolParameter(symbol) ? ts.SymbolDisplayPartKind.parameterName : ts.SymbolDisplayPartKind.localName; } else if (flags & 4) { - return 14; + return ts.SymbolDisplayPartKind.propertyName; } else if (flags & 32768) { - return 14; + return ts.SymbolDisplayPartKind.propertyName; } else if (flags & 65536) { - return 14; + return ts.SymbolDisplayPartKind.propertyName; } else if (flags & 8) { - return 19; + return ts.SymbolDisplayPartKind.enumMemberName; } else if (flags & 16) { - return 20; + return ts.SymbolDisplayPartKind.functionName; } else if (flags & 32) { - return 1; + return ts.SymbolDisplayPartKind.className; } else if (flags & 64) { - return 4; + return ts.SymbolDisplayPartKind.interfaceName; } else if (flags & 384) { - return 2; + return ts.SymbolDisplayPartKind.enumName; } else if (flags & 1536) { - return 11; + return ts.SymbolDisplayPartKind.moduleName; } else if (flags & 8192) { - return 10; + return ts.SymbolDisplayPartKind.methodName; } else if (flags & 262144) { - return 18; + return ts.SymbolDisplayPartKind.typeParameterName; } else if (flags & 524288) { - return 0; + return ts.SymbolDisplayPartKind.aliasName; } else if (flags & 8388608) { - return 0; + return ts.SymbolDisplayPartKind.aliasName; } - return 17; + return ts.SymbolDisplayPartKind.text; } } ts.symbolPart = symbolPart; @@ -24670,27 +26579,34 @@ var ts; } ts.displayPart = displayPart; function spacePart() { - return displayPart(" ", 16); + return displayPart(" ", ts.SymbolDisplayPartKind.space); } ts.spacePart = spacePart; function keywordPart(kind) { - return displayPart(ts.tokenToString(kind), 5); + return displayPart(ts.tokenToString(kind), ts.SymbolDisplayPartKind.keyword); } ts.keywordPart = keywordPart; function punctuationPart(kind) { - return displayPart(ts.tokenToString(kind), 15); + return displayPart(ts.tokenToString(kind), ts.SymbolDisplayPartKind.punctuation); } ts.punctuationPart = punctuationPart; function operatorPart(kind) { - return displayPart(ts.tokenToString(kind), 12); + return displayPart(ts.tokenToString(kind), ts.SymbolDisplayPartKind.operator); } ts.operatorPart = operatorPart; + function textOrKeywordPart(text) { + var kind = ts.stringToToken(text); + return kind === undefined + ? textPart(text) + : keywordPart(kind); + } + ts.textOrKeywordPart = textOrKeywordPart; function textPart(text) { - return displayPart(text, 17); + return displayPart(text, ts.SymbolDisplayPartKind.text); } ts.textPart = textPart; function lineBreakPart() { - return displayPart("\n", 6); + return displayPart("\n", ts.SymbolDisplayPartKind.lineBreak); } ts.lineBreakPart = lineBreakPart; function mapToDisplayParts(writeDisplayParts) { @@ -24719,6 +26635,8 @@ var ts; } ts.signatureToDisplayParts = signatureToDisplayParts; })(ts || (ts = {})); +/// +/// var ts; (function (ts) { var formatting; @@ -24763,21 +26681,21 @@ var ts; var t; var pos = scanner.getStartPos(); while (pos < endPos) { - var _t = scanner.getToken(); - if (!ts.isTrivia(_t)) { + var t_2 = scanner.getToken(); + if (!ts.isTrivia(t_2)) { break; } scanner.scan(); - var _item = { + var item_4 = { pos: pos, end: scanner.getStartPos(), - kind: _t + kind: t_2 }; pos = scanner.getStartPos(); if (!leadingTrivia) { leadingTrivia = []; } - leadingTrivia.push(_item); + leadingTrivia.push(item_4); } savedPos = scanner.getStartPos(); } @@ -24785,8 +26703,8 @@ var ts; if (node) { switch (node.kind) { case 27: - case 59: case 60: + case 61: case 42: case 41: return true; @@ -24802,7 +26720,7 @@ var ts; container.kind === 13; } function startsWithSlashToken(t) { - return t === 36 || t === 56; + return t === 36 || t === 57; } function readTokenInfo(n) { if (!isOnToken()) { @@ -24881,8 +26799,8 @@ var ts; } function isOnToken() { var current = (lastTokenInfo && lastTokenInfo.token.kind) || scanner.getToken(); - var _startPos = (lastTokenInfo && lastTokenInfo.token.pos) || scanner.getStartPos(); - return _startPos < endPos && current !== 1 && !ts.isTrivia(current); + var startPos = (lastTokenInfo && lastTokenInfo.token.pos) || scanner.getStartPos(); + return startPos < endPos && current !== 1 && !ts.isTrivia(current); } function fixTokenKind(tokenInfo, container) { if (ts.isToken(container) && tokenInfo.token.kind !== container.kind) { @@ -24894,6 +26812,21 @@ var ts; formatting.getFormattingScanner = getFormattingScanner; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; @@ -24972,7 +26905,36 @@ var ts; formatting.FormattingContext = FormattingContext; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// /// +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; @@ -24994,6 +26956,35 @@ var ts; formatting.Rule = Rule; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// /// var ts; (function (ts) { @@ -25025,6 +27016,35 @@ var ts; formatting.RuleDescriptor = RuleDescriptor; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// /// var ts; (function (ts) { @@ -25053,6 +27073,21 @@ var ts; formatting.RuleOperation = RuleOperation; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; @@ -25072,7 +27107,7 @@ var ts; if (this.IsAny()) { return true; } - for (var _i = 0, _a = this.customContextChecks, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = this.customContextChecks; _i < _a.length; _i++) { var check = _a[_i]; if (!check(context)) { return false; @@ -25086,12 +27121,30 @@ var ts; formatting.RuleOperationContext = RuleOperationContext; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; (function (formatting) { var Rules = (function () { function Rules() { + /// + /// Common Rules + /// this.IgnoreBeforeComment = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.Comments), formatting.RuleOperation.create1(1)); this.IgnoreAfterLineComment = new formatting.Rule(formatting.RuleDescriptor.create3(2, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create1(1)); this.NoSpaceBeforeSemicolon = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 22), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); @@ -25102,8 +27155,8 @@ var ts; this.NoSpaceAfterQuestionMark = new formatting.Rule(formatting.RuleDescriptor.create3(50, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.SpaceAfterSemicolon = new formatting.Rule(formatting.RuleDescriptor.create3(22, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); this.SpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(15, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsAfterCodeBlockContext), 2)); - this.SpaceBetweenCloseBraceAndElse = new formatting.Rule(formatting.RuleDescriptor.create1(15, 75), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - this.SpaceBetweenCloseBraceAndWhile = new formatting.Rule(formatting.RuleDescriptor.create1(15, 99), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); + this.SpaceBetweenCloseBraceAndElse = new formatting.Rule(formatting.RuleDescriptor.create1(15, 76), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); + this.SpaceBetweenCloseBraceAndWhile = new formatting.Rule(formatting.RuleDescriptor.create1(15, 100), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); this.NoSpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(15, formatting.Shared.TokenRange.FromTokens([17, 19, 23, 22])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.NoSpaceBeforeDot = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.NoSpaceAfterDot = new formatting.Rule(formatting.RuleDescriptor.create3(20, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); @@ -25113,9 +27166,9 @@ var ts; this.NoSpaceAfterCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create3(19, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.FunctionOpenBraceLeftTokenRange = formatting.Shared.TokenRange.AnyIncludingMultilineComments; this.SpaceBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1); - this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([64, 3]); + this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([65, 3]); this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1); - this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([17, 3, 74, 95, 80, 75]); + this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([17, 3, 75, 96, 81, 76]); this.SpaceBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1); this.SpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(14, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2)); this.SpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2)); @@ -25134,25 +27187,25 @@ var ts; this.SpaceAfterSubtractWhenFollowedByUnaryMinus = new formatting.Rule(formatting.RuleDescriptor.create1(34, 34), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); this.SpaceAfterSubtractWhenFollowedByPredecrement = new formatting.Rule(formatting.RuleDescriptor.create1(34, 39), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); this.NoSpaceBeforeComma = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 23), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.SpaceAfterCertainKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([97, 93, 87, 73, 89, 96]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([104, 69]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2)); + this.SpaceAfterCertainKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([98, 94, 88, 74, 90, 97]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); + this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([105, 70]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2)); this.NoSpaceBeforeOpenParenInFuncCall = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionCallOrNewContext, Rules.IsPreviousTokenNotComma), 8)); - this.SpaceAfterFunctionInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create3(82, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); + this.SpaceAfterFunctionInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create3(83, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); this.NoSpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionDeclContext), 8)); - this.SpaceAfterVoidOperator = new formatting.Rule(formatting.RuleDescriptor.create3(98, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsVoidOpContext), 2)); - this.NoSpaceBetweenReturnAndSemicolon = new formatting.Rule(formatting.RuleDescriptor.create1(89, 22), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.SpaceBetweenStatements = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([17, 74, 75, 66]), 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([95, 80]), 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([115, 119]), 64), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); + this.SpaceAfterVoidOperator = new formatting.Rule(formatting.RuleDescriptor.create3(99, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsVoidOpContext), 2)); + 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.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(113, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([116, 117]), 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([68, 114, 76, 77, 78, 115, 102, 84, 103, 116, 106, 108, 119, 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([78, 102])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 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, 103, 85, 104, 117, 107, 109, 120, 110]), 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, 103])), 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)); - this.NoSpaceAfterEllipsis = new formatting.Rule(formatting.RuleDescriptor.create1(21, 64), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); + this.NoSpaceAfterEllipsis = new formatting.Rule(formatting.RuleDescriptor.create1(21, 65), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.NoSpaceAfterOptionalParameters = new formatting.Rule(formatting.RuleDescriptor.create3(50, formatting.Shared.TokenRange.FromTokens([17, 23])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8)); this.NoSpaceBeforeOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.TypeNames, 24), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); this.NoSpaceBetweenCloseParenAndAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create1(17, 24), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); @@ -25225,42 +27278,42 @@ var ts; this.NoSpaceBetweenParens = new formatting.Rule(formatting.RuleDescriptor.create1(16, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.NoSpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.NoSpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.SpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(82, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); - this.NoSpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(82, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 8)); + this.SpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(83, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); + this.NoSpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(83, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 8)); } Rules.prototype.getRuleName = function (rule) { var o = this; - for (var _name in o) { - if (o[_name] === rule) { - return _name; + for (var name_19 in o) { + if (o[name_19] === rule) { + return name_19; } } throw new Error("Unknown rule"); }; Rules.IsForContext = function (context) { - return context.contextNode.kind === 181; + return context.contextNode.kind === 186; }; Rules.IsNotForContext = function (context) { return !Rules.IsForContext(context); }; Rules.IsBinaryOpContext = function (context) { switch (context.contextNode.kind) { - case 167: - case 168: + case 169: + case 170: return true; - case 203: - case 193: - case 128: - case 220: - case 130: + case 208: + case 198: case 129: - return context.currentTokenSpan.kind === 52 || context.nextTokenSpan.kind === 52; - case 182: - return context.currentTokenSpan.kind === 85 || context.nextTokenSpan.kind === 85; - case 183: - return context.currentTokenSpan.kind === 124 || context.nextTokenSpan.kind === 124; - case 150: - return context.currentTokenSpan.kind === 52 || context.nextTokenSpan.kind === 52; + case 226: + 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 false; }; @@ -25268,9 +27321,25 @@ var ts; return !Rules.IsBinaryOpContext(context); }; Rules.IsConditionalOperatorContext = function (context) { - return context.contextNode.kind === 168; + return context.contextNode.kind === 170; }; Rules.IsSameLineTokenOrBeforeMultilineBlockContext = function (context) { + //// This check is mainly used inside SpaceBeforeOpenBraceInControl and SpaceBeforeOpenBraceInFunction. + //// + //// Ex: + //// if (1) { .... + //// * ) and { are on the same line so apply the rule. Here we don't care whether it's same or multi block context + //// + //// Ex: + //// if (1) + //// { ... } + //// * ) and { are on differnet lines. We only need to format if the block is multiline context. So in this case we don't format. + //// + //// Ex: + //// if (1) + //// { ... + //// } + //// * ) and { are on differnet lines. We only need to format if the block is multiline context. So in this case we format. return context.TokensAreOnSameLine() || Rules.IsBeforeMultilineBlockContext(context); }; Rules.IsBeforeMultilineBlockContext = function (context) { @@ -25293,26 +27362,26 @@ var ts; return true; } switch (node.kind) { - case 174: - case 202: - case 152: - case 201: + case 179: + case 207: + case 154: + case 206: return true; } return false; }; Rules.IsFunctionDeclContext = function (context) { switch (context.contextNode.kind) { - case 195: - case 132: - case 131: + case 200: case 134: - case 135: - case 136: - case 160: case 133: - case 161: - case 197: + case 136: + case 137: + case 138: + case 162: + case 135: + case 163: + case 202: return true; } return false; @@ -25322,53 +27391,53 @@ var ts; }; Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) { switch (node.kind) { - case 196: - case 197: - case 199: - case 143: - case 200: + case 201: + case 202: + case 204: + case 145: + case 205: return true; } return false; }; Rules.IsAfterCodeBlockContext = function (context) { switch (context.currentTokenParent.kind) { - case 196: - case 200: - case 199: - case 174: - case 217: case 201: - case 188: + case 205: + case 204: + case 179: + case 223: + case 206: + case 193: return true; } return false; }; Rules.IsControlDeclContext = function (context) { switch (context.contextNode.kind) { - case 178: - case 188: - case 181: - case 182: case 183: - case 180: - case 191: - case 179: + case 193: + case 186: case 187: - case 217: + case 188: + case 185: + case 196: + case 184: + case 192: + case 223: return true; default: return false; } }; Rules.IsObjectContext = function (context) { - return context.contextNode.kind === 152; + return context.contextNode.kind === 154; }; Rules.IsFunctionCallContext = function (context) { - return context.contextNode.kind === 155; + return context.contextNode.kind === 157; }; Rules.IsNewContext = function (context) { - return context.contextNode.kind === 156; + return context.contextNode.kind === 158; }; Rules.IsFunctionCallOrNewContext = function (context) { return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context); @@ -25380,35 +27449,35 @@ var ts; return context.TokensAreOnSameLine(); }; Rules.IsStartOfVariableDeclarationList = function (context) { - return context.currentTokenParent.kind === 194 && + return context.currentTokenParent.kind === 199 && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; }; Rules.IsNotFormatOnEnter = function (context) { return context.formattingRequestKind != 2; }; Rules.IsModuleDeclContext = function (context) { - return context.contextNode.kind === 200; + return context.contextNode.kind === 205; }; Rules.IsObjectTypeContext = function (context) { - return context.contextNode.kind === 143; + return context.contextNode.kind === 145; }; Rules.IsTypeArgumentOrParameter = function (token, parent) { if (token.kind !== 24 && token.kind !== 25) { return false; } switch (parent.kind) { + case 141: + case 201: + case 202: + case 200: + case 162: + case 163: + case 134: + case 133: + case 138: case 139: - case 196: - case 197: - case 195: - case 160: - case 161: - case 132: - case 131: - case 136: - case 137: - case 155: - case 156: + case 157: + case 158: return true; default: return false; @@ -25419,13 +27488,28 @@ var ts; Rules.IsTypeArgumentOrParameter(context.nextTokenSpan, context.nextTokenParent); }; Rules.IsVoidOpContext = function (context) { - return context.currentTokenSpan.kind === 98 && context.currentTokenParent.kind === 164; + return context.currentTokenSpan.kind === 99 && context.currentTokenParent.kind === 166; }; return Rules; })(); formatting.Rules = Rules; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; @@ -25441,7 +27525,7 @@ var ts; return result; }; RulesMap.prototype.Initialize = function (rules) { - this.mapRowLength = 124 + 1; + this.mapRowLength = 125 + 1; this.map = new Array(this.mapRowLength * this.mapRowLength); var rulesBucketConstructionStateList = new Array(this.map.length); this.FillRules(rules, rulesBucketConstructionStateList); @@ -25476,7 +27560,7 @@ var ts; var bucketIndex = this.GetRuleBucketIndex(context.currentTokenSpan.kind, context.nextTokenSpan.kind); var bucket = this.map[bucketIndex]; if (bucket != null) { - for (var _i = 0, _a = bucket.Rules(), _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = bucket.Rules(); _i < _a.length; _i++) { var rule = _a[_i]; if (rule.Operation.Context.InContext(context)) { return rule; @@ -25536,7 +27620,7 @@ var ts; var position; if (rule.Operation.Action == 1) { position = specificTokens ? - 0 : + RulesPosition.IgnoreRulesSpecific : RulesPosition.IgnoreRulesAny; } else if (!rule.Operation.Context.IsAny()) { @@ -25562,6 +27646,21 @@ var ts; formatting.RulesBucket = RulesBucket; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; @@ -25617,7 +27716,7 @@ var ts; } TokenAllAccess.prototype.GetTokens = function () { var result = []; - for (var token = 0; token <= 124; token++) { + for (var token = 0; token <= 125; token++) { result.push(token); } return result; @@ -25659,23 +27758,64 @@ var ts; }; TokenRange.Any = TokenRange.AllTokens(); TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([3])); - TokenRange.Keywords = TokenRange.FromRange(65, 124); - TokenRange.BinaryOperators = TokenRange.FromRange(24, 63); - TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([85, 86, 124]); + TokenRange.Keywords = TokenRange.FromRange(66, 125); + TokenRange.BinaryOperators = TokenRange.FromRange(24, 64); + TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([86, 87, 125]); TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([38, 39, 47, 46]); - TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([7, 64, 16, 18, 14, 92, 87]); - TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([64, 16, 92, 87]); - TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([64, 17, 19, 87]); - TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([64, 16, 92, 87]); - TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([64, 17, 19, 87]); + TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([7, 65, 16, 18, 14, 93, 88]); + TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([65, 16, 93, 88]); + TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([65, 17, 19, 88]); + 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([64, 118, 120, 112, 121, 98, 111]); + TokenRange.TypeNames = TokenRange.FromTokens([65, 119, 121, 113, 122, 99, 112]); return TokenRange; })(); Shared.TokenRange = TokenRange; })(Shared = formatting.Shared || (formatting.Shared = {})); })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; @@ -25761,6 +27901,10 @@ var ts; formatting.RulesProvider = RulesProvider; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); +/// +/// +/// +/// var ts; (function (ts) { var formatting; @@ -25802,13 +27946,13 @@ var ts; } formatting.formatSelection = formatSelection; function formatOutermostParent(position, expectedLastToken, sourceFile, options, rulesProvider, requestKind) { - var _parent = findOutermostParent(position, expectedLastToken, sourceFile); - if (!_parent) { + var parent = findOutermostParent(position, expectedLastToken, sourceFile); + if (!parent) { return []; } var span = { - pos: ts.getLineStartPositionForPosition(_parent.getStart(sourceFile), sourceFile), - end: _parent.end + pos: ts.getLineStartPositionForPosition(parent.getStart(sourceFile), sourceFile), + end: parent.end }; return formatSpan(span, sourceFile, options, rulesProvider, requestKind); } @@ -25830,17 +27974,17 @@ var ts; } function isListElement(parent, node) { switch (parent.kind) { - case 196: - case 197: - return ts.rangeContainsRange(parent.members, node); - case 200: - var body = parent.body; - return body && body.kind === 174 && ts.rangeContainsRange(body.statements, node); - case 221: - case 174: case 201: + case 202: + 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: return ts.rangeContainsRange(parent.statements, node); - case 217: + case 223: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -25945,10 +28089,10 @@ var ts; } } else { - var _startLine = sourceFile.getLineAndCharacterOfPosition(startPos).line; + var startLine = sourceFile.getLineAndCharacterOfPosition(startPos).line; var startLinePosition = ts.getLineStartPositionForPosition(startPos, sourceFile); var column = formatting.SmartIndenter.findFirstNonWhitespaceColumn(startLinePosition, startPos, sourceFile, options); - if (_startLine !== parentStartLine || startPos === column) { + if (startLine !== parentStartLine || startPos === column) { return column; } } @@ -25959,9 +28103,9 @@ var ts; if (indentation === -1) { if (isSomeBlock(node.kind)) { if (isSomeBlock(parent.kind) || - parent.kind === 221 || - parent.kind === 214 || - parent.kind === 215) { + parent.kind === 227 || + parent.kind === 220 || + parent.kind === 221) { indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); } else { @@ -25987,6 +28131,26 @@ var ts; delta: delta }; } + function getFirstNonDecoratorTokenOfNode(node) { + if (node.modifiers && node.modifiers.length) { + return node.modifiers[0].kind; + } + switch (node.kind) { + case 201: return 69; + case 202: return 104; + case 200: return 83; + case 204: return 204; + case 136: return 116; + case 137: return 120; + case 134: + if (node.asteriskToken) { + return 35; + } + case 132: + case 129: + return node.name.kind; + } + } function getDynamicIndentation(node, nodeStartLine, indentation, delta) { return { getIndentationForComment: function (kind) { @@ -25998,13 +28162,19 @@ var ts; return indentation; }, getIndentationForToken: function (line, kind) { + if (nodeStartLine !== line && node.decorators) { + if (kind === getFirstNonDecoratorTokenOfNode(node)) { + return indentation; + } + } switch (kind) { case 14: case 15: case 18: case 19: - case 75: - case 99: + case 76: + case 100: + case 52: return indentation; default: return nodeStartLine !== line ? indentation + delta : indentation; @@ -26065,19 +28235,19 @@ var ts; return inheritedIndentation; } while (formattingScanner.isOnToken()) { - var _tokenInfo = formattingScanner.readTokenInfo(node); - if (_tokenInfo.token.end > childStartPos) { + var tokenInfo = formattingScanner.readTokenInfo(node); + if (tokenInfo.token.end > childStartPos) { break; } - consumeTokenAndAdvanceScanner(_tokenInfo, node, parentDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); } if (!formattingScanner.isOnToken()) { return inheritedIndentation; } if (ts.isToken(child)) { - var _tokenInfo_1 = formattingScanner.readTokenInfo(child); - ts.Debug.assert(_tokenInfo_1.token.end === child.end); - consumeTokenAndAdvanceScanner(_tokenInfo_1, node, parentDynamicIndentation); + var tokenInfo = formattingScanner.readTokenInfo(child); + ts.Debug.assert(tokenInfo.token.end === child.end); + consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); return inheritedIndentation; } var childIndentation = computeIndentation(child, childStart.line, childIndentationAmount, node, parentDynamicIndentation, parentStartLine); @@ -26089,34 +28259,34 @@ var ts; var listStartToken = getOpenTokenForList(parent, nodes); var listEndToken = getCloseTokenForOpenToken(listStartToken); var listDynamicIndentation = parentDynamicIndentation; - var _startLine = parentStartLine; + var startLine = parentStartLine; if (listStartToken !== 0) { while (formattingScanner.isOnToken()) { - var _tokenInfo = formattingScanner.readTokenInfo(parent); - if (_tokenInfo.token.end > nodes.pos) { + var tokenInfo = formattingScanner.readTokenInfo(parent); + if (tokenInfo.token.end > nodes.pos) { break; } - else if (_tokenInfo.token.kind === listStartToken) { - _startLine = sourceFile.getLineAndCharacterOfPosition(_tokenInfo.token.pos).line; - var _indentation = computeIndentation(_tokenInfo.token, _startLine, -1, parent, parentDynamicIndentation, _startLine); - listDynamicIndentation = getDynamicIndentation(parent, parentStartLine, _indentation.indentation, _indentation.delta); - consumeTokenAndAdvanceScanner(_tokenInfo, parent, listDynamicIndentation); + else if (tokenInfo.token.kind === listStartToken) { + startLine = sourceFile.getLineAndCharacterOfPosition(tokenInfo.token.pos).line; + var indentation_1 = computeIndentation(tokenInfo.token, startLine, -1, parent, parentDynamicIndentation, startLine); + listDynamicIndentation = getDynamicIndentation(parent, parentStartLine, indentation_1.indentation, indentation_1.delta); + consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); } else { - consumeTokenAndAdvanceScanner(_tokenInfo, parent, parentDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, parent, parentDynamicIndentation); } } } var inheritedIndentation = -1; - for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + for (var _i = 0; _i < nodes.length; _i++) { var child = nodes[_i]; - inheritedIndentation = processChildNode(child, inheritedIndentation, node, listDynamicIndentation, _startLine, true); + inheritedIndentation = processChildNode(child, inheritedIndentation, node, listDynamicIndentation, startLine, true); } if (listEndToken !== 0) { if (formattingScanner.isOnToken()) { - var _tokenInfo_1 = formattingScanner.readTokenInfo(parent); - if (_tokenInfo_1.token.kind === listEndToken && ts.rangeContainsRange(parent, _tokenInfo_1.token)) { - consumeTokenAndAdvanceScanner(_tokenInfo_1, parent, listDynamicIndentation); + var tokenInfo = formattingScanner.readTokenInfo(parent); + if (tokenInfo.token.kind === listEndToken && ts.rangeContainsRange(parent, tokenInfo.token)) { + consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); } } } @@ -26153,7 +28323,7 @@ var ts; if (indentToken) { var indentNextTokenOrTrivia = true; if (currentTokenInfo.leadingTrivia) { - for (var _i = 0, _a = currentTokenInfo.leadingTrivia, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = currentTokenInfo.leadingTrivia; _i < _a.length; _i++) { var triviaItem = _a[_i]; if (!ts.rangeContainsRange(originalRange, triviaItem)) { continue; @@ -26167,8 +28337,8 @@ var ts; break; case 2: if (indentNextTokenOrTrivia) { - var _commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); - insertIndentation(triviaItem.pos, _commentIndentation, false); + var commentIndentation_1 = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); + insertIndentation(triviaItem.pos, commentIndentation_1, false); indentNextTokenOrTrivia = false; } break; @@ -26188,7 +28358,7 @@ var ts; } } function processTrivia(trivia, parent, contextNode, dynamicIndentation) { - for (var _i = 0, _n = trivia.length; _i < _n; _i++) { + for (var _i = 0; _i < trivia.length; _i++) { var triviaItem = trivia[_i]; if (ts.isComment(triviaItem.kind) && ts.rangeContainsRange(originalRange, triviaItem)) { var triviaItemStart = sourceFile.getLineAndCharacterOfPosition(triviaItem.pos); @@ -26260,10 +28430,10 @@ var ts; } } function indentMultilineComment(commentRange, indentation, firstLineIsIndented) { - var _startLine = sourceFile.getLineAndCharacterOfPosition(commentRange.pos).line; + var startLine = sourceFile.getLineAndCharacterOfPosition(commentRange.pos).line; var endLine = sourceFile.getLineAndCharacterOfPosition(commentRange.end).line; var parts; - if (_startLine === endLine) { + if (startLine === endLine) { if (!firstLineIsIndented) { insertIndentation(commentRange.pos, indentation, false); } @@ -26272,14 +28442,14 @@ var ts; else { parts = []; var startPos = commentRange.pos; - for (var line = _startLine; line < endLine; ++line) { + for (var line = startLine; line < endLine; ++line) { var endOfLine = ts.getEndLinePosition(line, sourceFile); parts.push({ pos: startPos, end: endOfLine }); startPos = ts.getStartPositionOfLine(line + 1, sourceFile); } parts.push({ pos: startPos, end: commentRange.end }); } - var startLinePos = ts.getStartPositionOfLine(_startLine, sourceFile); + var startLinePos = ts.getStartPositionOfLine(startLine, sourceFile); var nonWhitespaceColumnInFirstPart = formatting.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(startLinePos, parts[0].pos, sourceFile, options); if (indentation === nonWhitespaceColumnInFirstPart.column) { return; @@ -26287,21 +28457,21 @@ var ts; var startIndex = 0; if (firstLineIsIndented) { startIndex = 1; - _startLine++; + startLine++; } - var _delta = indentation - nonWhitespaceColumnInFirstPart.column; - for (var i = startIndex, len = parts.length; i < len; ++i, ++_startLine) { - var _startLinePos = ts.getStartPositionOfLine(_startLine, sourceFile); + var delta = indentation - nonWhitespaceColumnInFirstPart.column; + for (var i = startIndex, len = parts.length; i < len; ++i, ++startLine) { + var startLinePos_1 = ts.getStartPositionOfLine(startLine, sourceFile); var nonWhitespaceCharacterAndColumn = i === 0 ? nonWhitespaceColumnInFirstPart : formatting.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(parts[i].pos, parts[i].end, sourceFile, options); - var newIndentation = nonWhitespaceCharacterAndColumn.column + _delta; + var newIndentation = nonWhitespaceCharacterAndColumn.column + delta; if (newIndentation > 0) { var indentationString = getIndentationString(newIndentation, options); - recordReplace(_startLinePos, nonWhitespaceCharacterAndColumn.character, indentationString); + recordReplace(startLinePos_1, nonWhitespaceCharacterAndColumn.character, indentationString); } else { - recordDelete(_startLinePos, nonWhitespaceCharacterAndColumn.character); + recordDelete(startLinePos_1, nonWhitespaceCharacterAndColumn.character); } } } @@ -26368,20 +28538,20 @@ var ts; } function isSomeBlock(kind) { switch (kind) { - case 174: - case 201: + case 179: + case 206: return true; } return false; } function getOpenTokenForList(node, list) { switch (node.kind) { + case 135: + case 200: + case 162: + case 134: case 133: - case 195: - case 160: - case 132: - case 131: - case 161: + case 163: if (node.typeParameters === list) { return 24; } @@ -26389,8 +28559,8 @@ var ts; return 16; } break; - case 155: - case 156: + case 157: + case 158: if (node.typeArguments === list) { return 24; } @@ -26398,7 +28568,7 @@ var ts; return 16; } break; - case 139: + case 141: if (node.typeArguments === list) { return 24; } @@ -26414,9 +28584,15 @@ var ts; } return 0; } + var internedSizes; var internedTabsIndentation; var internedSpacesIndentation; function getIndentationString(indentation, options) { + var resetInternedStrings = !internedSizes || (internedSizes.tabSize !== options.TabSize || internedSizes.indentSize !== options.IndentSize); + if (resetInternedStrings) { + internedSizes = { tabSize: options.TabSize, indentSize: options.IndentSize }; + internedTabsIndentation = internedSpacesIndentation = undefined; + } if (!options.ConvertTabsToSpaces) { var tabs = Math.floor(indentation / options.TabSize); var spaces = indentation - tabs * options.TabSize; @@ -26459,6 +28635,7 @@ var ts; formatting.getIndentationString = getIndentationString; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); +/// var ts; (function (ts) { var formatting; @@ -26483,7 +28660,7 @@ var ts; return 0; } var lineAtPosition = sourceFile.getLineAndCharacterOfPosition(position).line; - if (precedingToken.kind === 23 && precedingToken.parent.kind !== 167) { + if (precedingToken.kind === 23 && precedingToken.parent.kind !== 169) { var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1) { return actualIndentation; @@ -26494,7 +28671,7 @@ var ts; var currentStart; var indentationDelta; while (current) { - if (positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode(current.kind, previous ? previous.kind : 0)) { + if (ts.positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode(current.kind, previous ? previous.kind : 0)) { currentStart = getStartLineAndCharacterForNode(current, sourceFile); if (nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile)) { indentationDelta = 0; @@ -26504,9 +28681,9 @@ var ts; } break; } - var _actualIndentation = getActualIndentationForListItem(current, sourceFile, options); - if (_actualIndentation !== -1) { - return _actualIndentation; + var actualIndentation = getActualIndentationForListItem(current, sourceFile, options); + if (actualIndentation !== -1) { + return actualIndentation; } previous = current; current = current.parent; @@ -26523,9 +28700,9 @@ var ts; } SmartIndenter.getIndentationForNode = getIndentationForNode; function getIndentationForNodeWorker(current, currentStart, ignoreActualIndentationRange, indentationDelta, sourceFile, options) { - var _parent = current.parent; + var parent = current.parent; var parentStart; - while (_parent) { + while (parent) { var useActualIndentation = true; if (ignoreActualIndentationRange) { var start = current.getStart(sourceFile); @@ -26537,21 +28714,21 @@ var ts; return actualIndentation + indentationDelta; } } - parentStart = getParentStart(_parent, current, sourceFile); + parentStart = getParentStart(parent, current, sourceFile); var parentAndChildShareLine = parentStart.line === currentStart.line || - childStartsOnTheSameLineWithElseInIfStatement(_parent, current, currentStart.line, sourceFile); + childStartsOnTheSameLineWithElseInIfStatement(parent, current, currentStart.line, sourceFile); if (useActualIndentation) { - var _actualIndentation = getActualIndentationForNode(current, _parent, currentStart, parentAndChildShareLine, sourceFile, options); - if (_actualIndentation !== -1) { - return _actualIndentation + indentationDelta; + var actualIndentation = getActualIndentationForNode(current, parent, currentStart, parentAndChildShareLine, sourceFile, options); + if (actualIndentation !== -1) { + return actualIndentation + indentationDelta; } } - if (shouldIndentChildNode(_parent.kind, current.kind) && !parentAndChildShareLine) { + if (shouldIndentChildNode(parent.kind, current.kind) && !parentAndChildShareLine) { indentationDelta += options.IndentSize; } - current = _parent; + current = parent; currentStart = parentStart; - _parent = current.parent; + parent = current.parent; } return indentationDelta; } @@ -26573,7 +28750,7 @@ var ts; } function getActualIndentationForNode(current, parent, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && - (parent.kind === 221 || !parentAndChildShareLine); + (parent.kind === 227 || !parentAndChildShareLine); if (!useActualIndentation) { return -1; } @@ -26596,12 +28773,9 @@ var ts; function getStartLineAndCharacterForNode(n, sourceFile) { return sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)); } - function positionBelongsToNode(candidate, position, sourceFile) { - return candidate.end > position || !isCompletedNode(candidate, sourceFile); - } function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 178 && parent.elseStatement === child) { - var elseKeyword = ts.findChildOfKind(parent, 75, sourceFile); + if (parent.kind === 183 && parent.elseStatement === child) { + var elseKeyword = ts.findChildOfKind(parent, 76, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; return elseKeywordStartLine === childStartLine; @@ -26612,23 +28786,23 @@ var ts; function getContainingList(node, sourceFile) { if (node.parent) { switch (node.parent.kind) { - case 139: + case 141: if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd())) { return node.parent.typeArguments; } break; - case 152: + case 154: return node.parent.properties; - case 151: + case 153: return node.parent.elements; - case 195: - case 160: - case 161: - case 132: - case 131: - case 136: - case 137: { + case 200: + case 162: + case 163: + case 134: + case 133: + case 138: + case 139: { var start = node.getStart(sourceFile); if (node.parent.typeParameters && ts.rangeContainsStartEnd(node.parent.typeParameters, start, node.getEnd())) { @@ -26639,15 +28813,15 @@ var ts; } break; } - case 156: - case 155: { - var _start = node.getStart(sourceFile); + case 158: + case 157: { + var start = node.getStart(sourceFile); if (node.parent.typeArguments && - ts.rangeContainsStartEnd(node.parent.typeArguments, _start, node.getEnd())) { + ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { return node.parent.typeArguments; } if (node.parent.arguments && - ts.rangeContainsStartEnd(node.parent.arguments, _start, node.getEnd())) { + ts.rangeContainsStartEnd(node.parent.arguments, start, node.getEnd())) { return node.parent.arguments; } break; @@ -26709,25 +28883,28 @@ var ts; SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; function nodeContentIsAlwaysIndented(kind) { switch (kind) { - case 196: - case 197: - case 199: - case 151: - case 174: case 201: - case 152: - case 143: case 202: - case 215: + case 204: + case 153: + case 179: + case 206: + 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 159: - case 155: - case 156: - case 175: - case 193: - case 209: - case 186: - case 168: + case 191: + case 170: + case 151: + case 150: return true; } return false; @@ -26737,106 +28914,46 @@ var ts; return true; } switch (parent) { - case 179: - case 180: - case 182: + case 184: + case 185: + case 187: + case 188: + case 186: case 183: - case 181: - case 178: - case 195: - case 160: - case 132: - case 131: - case 161: - case 133: + case 200: + case 162: case 134: + case 133: + case 138: + case 163: case 135: - return child !== 174; + case 136: + case 137: + return child !== 179; default: return false; } } SmartIndenter.shouldIndentChildNode = shouldIndentChildNode; - function nodeEndsWith(n, expectedLastToken, sourceFile) { - var children = n.getChildren(sourceFile); - if (children.length) { - var last = children[children.length - 1]; - if (last.kind === expectedLastToken) { - return true; - } - else if (last.kind === 22 && children.length !== 1) { - return children[children.length - 2].kind === expectedLastToken; - } - } - return false; - } - function isCompletedNode(n, sourceFile) { - if (n.getFullWidth() === 0) { - return false; - } - switch (n.kind) { - case 196: - case 197: - case 199: - case 152: - case 174: - case 201: - case 202: - return nodeEndsWith(n, 15, sourceFile); - case 217: - return isCompletedNode(n.block, sourceFile); - case 159: - case 136: - case 155: - case 137: - return nodeEndsWith(n, 17, sourceFile); - case 195: - case 160: - case 132: - case 131: - case 161: - return !n.body || isCompletedNode(n.body, sourceFile); - case 200: - return n.body && isCompletedNode(n.body, sourceFile); - case 178: - if (n.elseStatement) { - return isCompletedNode(n.elseStatement, sourceFile); - } - return isCompletedNode(n.thenStatement, sourceFile); - case 177: - return isCompletedNode(n.expression, sourceFile); - case 151: - return nodeEndsWith(n, 19, sourceFile); - case 214: - case 215: - return false; - case 181: - return isCompletedNode(n.statement, sourceFile); - case 182: - return isCompletedNode(n.statement, sourceFile); - case 183: - return isCompletedNode(n.statement, sourceFile); - case 180: - return isCompletedNode(n.statement, sourceFile); - case 179: - var hasWhileKeyword = ts.findChildOfKind(n, 99, sourceFile); - if (hasWhileKeyword) { - return nodeEndsWith(n, 17, sourceFile); - } - return isCompletedNode(n.statement, sourceFile); - default: - return true; - } - } })(SmartIndenter = formatting.SmartIndenter || (formatting.SmartIndenter = {})); })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); +/// var __extends = this.__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 ts; (function (ts) { ts.servicesVersion = "0.4"; @@ -26914,10 +29031,10 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(222, nodes.pos, nodes.end, 1024, this); + var list = createNode(228, nodes.pos, nodes.end, 1024, this); list._children = []; var pos = nodes.pos; - for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + for (var _i = 0; _i < nodes.length; _i++) { var node = nodes[_i]; if (pos < node.pos) { pos = this.addSyntheticNodes(list._children, pos, node.pos); @@ -26933,7 +29050,7 @@ var ts; NodeObject.prototype.createChildren = function (sourceFile) { var _this = this; var children; - if (this.kind >= 125) { + if (this.kind >= 126) { scanner.setText((sourceFile || this.getSourceFile()).text); children = []; var pos = this.pos; @@ -26976,9 +29093,9 @@ var ts; }; NodeObject.prototype.getFirstToken = function (sourceFile) { var children = this.getChildren(); - for (var _i = 0, _n = children.length; _i < _n; _i++) { + for (var _i = 0; _i < children.length; _i++) { var child = children[_i]; - if (child.kind < 125) { + if (child.kind < 126) { return child; } return child.getFirstToken(sourceFile); @@ -26988,7 +29105,7 @@ var ts; var children = this.getChildren(sourceFile); for (var i = children.length - 1; i >= 0; i--) { var child = children[i]; - if (child.kind < 125) { + if (child.kind < 126) { return child; } return child.getLastToken(sourceFile); @@ -27034,7 +29151,7 @@ var ts; ts.forEach(declarations, function (declaration, indexOfDeclaration) { if (ts.indexOf(declarations, declaration) === indexOfDeclaration) { var sourceFileOfDeclaration = ts.getSourceFileOfNode(declaration); - if (canUseParsedParamTagComments && declaration.kind === 128) { + if (canUseParsedParamTagComments && declaration.kind === 129) { ts.forEach(getJsDocCommentTextRange(declaration.parent, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedParamJsDocComment = getCleanedParamJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedParamJsDocComment) { @@ -27042,13 +29159,13 @@ var ts; } }); } - if (declaration.kind === 200 && declaration.body.kind === 200) { + if (declaration.kind === 205 && declaration.body.kind === 205) { return; } - while (declaration.kind === 200 && declaration.parent.kind === 200) { + while (declaration.kind === 205 && declaration.parent.kind === 205) { declaration = declaration.parent; } - ts.forEach(getJsDocCommentTextRange(declaration.kind === 193 ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { + ts.forEach(getJsDocCommentTextRange(declaration.kind === 198 ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedJsDocComment = getCleanedJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedJsDocComment) { jsDocCommentParts.push.apply(jsDocCommentParts, cleanedJsDocComment); @@ -27093,13 +29210,14 @@ var ts; return isName(pos, end, sourceFile, paramTag); } function pushDocCommentLineText(docComments, text, blankLineCount) { - while (blankLineCount--) + while (blankLineCount--) { docComments.push(ts.textPart("")); + } docComments.push(ts.textPart(text)); } function getCleanedJsDocComment(pos, end, sourceFile) { var spacesToRemoveAfterAsterisk; - var _docComments = []; + var docComments = []; var blankLineCount = 0; var isInParamTag = false; while (pos < end) { @@ -27134,14 +29252,14 @@ var ts; } pos = consumeLineBreaks(pos, end, sourceFile); if (docCommentTextOfLine) { - pushDocCommentLineText(_docComments, docCommentTextOfLine, blankLineCount); + pushDocCommentLineText(docComments, docCommentTextOfLine, blankLineCount); blankLineCount = 0; } - else if (!isInParamTag && _docComments.length) { + else if (!isInParamTag && docComments.length) { blankLineCount++; } } - return _docComments; + return docComments; } function getCleanedParamJsDocComment(pos, end, sourceFile) { var paramHelpStringMargin; @@ -27242,8 +29360,8 @@ var ts; } var consumedSpaces = pos - startOfLinePos; if (consumedSpaces < paramHelpStringMargin) { - var _ch = sourceFile.text.charCodeAt(pos); - if (_ch === 42) { + var ch = sourceFile.text.charCodeAt(pos); + if (ch === 42) { pos = consumeWhiteSpacesOnTheLine(pos + 1, end, sourceFile, paramHelpStringMargin - consumedSpaces - 1); } } @@ -27332,9 +29450,9 @@ var ts; var namedDeclarations = []; ts.forEachChild(sourceFile, function visit(node) { switch (node.kind) { - case 195: - case 132: - case 131: + case 200: + case 134: + case 133: var functionDeclaration = node; if (functionDeclaration.name && functionDeclaration.name.getFullWidth() > 0) { var lastDeclaration = namedDeclarations.length > 0 ? @@ -27351,64 +29469,64 @@ var ts; ts.forEachChild(node, visit); } break; - case 196: - case 197: - case 198: - case 199: - case 200: - case 203: - case 212: - case 208: + case 201: + case 202: case 203: + case 204: case 205: - case 206: - case 134: - case 135: - case 143: + case 208: + case 217: + case 213: + case 208: + case 210: + case 211: + case 136: + case 137: + case 145: if (node.name) { namedDeclarations.push(node); } - case 133: - case 175: - case 194: - case 148: - case 149: - case 201: + case 135: + case 180: + case 199: + case 150: + case 151: + case 206: ts.forEachChild(node, visit); break; - case 174: + case 179: if (ts.isFunctionBlock(node)) { ts.forEachChild(node, visit); } break; - case 128: + case 129: if (!(node.flags & 112)) { break; } - case 193: - case 150: + case 198: + case 152: if (ts.isBindingPattern(node.name)) { ts.forEachChild(node.name, visit); break; } - case 220: - case 130: - case 129: + case 226: + case 132: + case 131: namedDeclarations.push(node); break; - case 210: + case 215: if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 204: + case 209: var importClause = node.importClause; if (importClause) { if (importClause.name) { namedDeclarations.push(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 206) { + if (importClause.namedBindings.kind === 211) { namedDeclarations.push(importClause.namedBindings); } else { @@ -27547,14 +29665,14 @@ var ts; return false; } return ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 160) { + if (declaration.kind === 162) { return true; } - if (declaration.kind !== 193 && declaration.kind !== 195) { + if (declaration.kind !== 198 && declaration.kind !== 200) { return false; } - for (var _parent = declaration.parent; !ts.isFunctionBlock(_parent); _parent = _parent.parent) { - if (_parent.kind === 221 || _parent.kind === 201) { + for (var parent_7 = declaration.parent; !ts.isFunctionBlock(parent_7); parent_7 = parent_7.parent) { + if (parent_7.kind === 227 || parent_7.kind === 206) { return false; } } @@ -27595,7 +29713,7 @@ var ts; this.host = host; this.fileNameToEntry = {}; var rootFileNames = host.getScriptFileNames(); - for (var _i = 0, _n = rootFileNames.length; _i < _n; _i++) { + for (var _i = 0; _i < rootFileNames.length; _i++) { var fileName = rootFileNames[_i]; this.createEntry(fileName); } @@ -27656,17 +29774,17 @@ var ts; if (!scriptSnapshot) { throw new Error("Could not find file: '" + fileName + "'."); } - var _version = this.host.getScriptVersion(fileName); + var version = this.host.getScriptVersion(fileName); var sourceFile; if (this.currentFileName !== fileName) { - sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 2, _version, true); + sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 2, version, true); } - else if (this.currentFileVersion !== _version) { + else if (this.currentFileVersion !== version) { var editRange = scriptSnapshot.getChangeRange(this.currentFileScriptSnapshot); - sourceFile = updateLanguageServiceSourceFile(this.currentSourceFile, scriptSnapshot, _version, editRange); + sourceFile = updateLanguageServiceSourceFile(this.currentSourceFile, scriptSnapshot, version, editRange); } if (sourceFile) { - this.currentFileVersion = _version; + this.currentFileVersion = version; this.currentFileName = fileName; this.currentFileScriptSnapshot = scriptSnapshot; this.currentSourceFile = sourceFile; @@ -27679,6 +29797,37 @@ var ts; sourceFile.version = version; sourceFile.scriptSnapshot = scriptSnapshot; } + function transpile(input, compilerOptions, fileName, diagnostics) { + var options = compilerOptions ? ts.clone(compilerOptions) : getDefaultCompilerOptions(); + options.separateCompilation = true; + options.allowNonTsExtensions = true; + var inputFileName = fileName || "module.ts"; + var sourceFile = ts.createSourceFile(inputFileName, input, options.target); + if (diagnostics && sourceFile.parseDiagnostics) { + diagnostics.push.apply(diagnostics, sourceFile.parseDiagnostics); + } + var outputText; + var compilerHost = { + getSourceFile: function (fileName, target) { return fileName === inputFileName ? sourceFile : undefined; }, + writeFile: function (name, text, writeByteOrderMark) { + ts.Debug.assert(outputText === undefined, "Unexpected multiple outputs for the file: " + name); + outputText = text; + }, + getDefaultLibFileName: function () { return "lib.d.ts"; }, + useCaseSensitiveFileNames: function () { return false; }, + getCanonicalFileName: function (fileName) { return fileName; }, + getCurrentDirectory: function () { return ""; }, + getNewLine: function () { return "\r\n"; } + }; + var program = ts.createProgram([inputFileName], options, compilerHost); + if (diagnostics) { + diagnostics.push.apply(diagnostics, program.getGlobalDiagnostics()); + } + program.emit(); + ts.Debug.assert(outputText !== undefined, "Output generation failed"); + return outputText; + } + ts.transpile = transpile; function createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTarget, version, setNodeParents) { var sourceFile = ts.createSourceFile(fileName, scriptSnapshot.getText(0, scriptSnapshot.getLength()), scriptTarget, setNodeParents); setSourceFileFields(sourceFile, scriptSnapshot, version); @@ -27812,25 +29961,25 @@ var ts; scanner.setText(sourceText); var token = scanner.scan(); while (token !== 1) { - if (token === 84) { + if (token === 85) { token = scanner.scan(); if (token === 8) { recordModuleName(); continue; } else { - if (token === 64) { + if (token === 65) { token = scanner.scan(); - if (token === 123) { + if (token === 124) { token = scanner.scan(); if (token === 8) { recordModuleName(); continue; } } - else if (token === 52) { + else if (token === 53) { token = scanner.scan(); - if (token === 117) { + if (token === 118) { token = scanner.scan(); if (token === 16) { token = scanner.scan(); @@ -27855,7 +30004,7 @@ var ts; } if (token === 15) { token = scanner.scan(); - if (token === 123) { + if (token === 124) { token = scanner.scan(); if (token === 8) { recordModuleName(); @@ -27865,11 +30014,11 @@ var ts; } else if (token === 35) { token = scanner.scan(); - if (token === 101) { + if (token === 102) { token = scanner.scan(); - if (token === 64) { + if (token === 65) { token = scanner.scan(); - if (token === 123) { + if (token === 124) { token = scanner.scan(); if (token === 8) { recordModuleName(); @@ -27880,7 +30029,7 @@ var ts; } } } - else if (token === 77) { + else if (token === 78) { token = scanner.scan(); if (token === 14) { token = scanner.scan(); @@ -27889,7 +30038,7 @@ var ts; } if (token === 15) { token = scanner.scan(); - if (token === 123) { + if (token === 124) { token = scanner.scan(); if (token === 8) { recordModuleName(); @@ -27899,7 +30048,7 @@ var ts; } else if (token === 35) { token = scanner.scan(); - if (token === 123) { + if (token === 124) { token = scanner.scan(); if (token === 8) { recordModuleName(); @@ -27920,7 +30069,7 @@ var ts; ts.preProcessFile = preProcessFile; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 189 && referenceNode.label.text === labelName) { + if (referenceNode.kind === 194 && referenceNode.label.text === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -27928,17 +30077,17 @@ var ts; return undefined; } function isJumpStatementTarget(node) { - return node.kind === 64 && - (node.parent.kind === 185 || node.parent.kind === 184) && + return node.kind === 65 && + (node.parent.kind === 190 || node.parent.kind === 189) && node.parent.label === node; } function isLabelOfLabeledStatement(node) { - return node.kind === 64 && - node.parent.kind === 189 && + return node.kind === 65 && + node.parent.kind === 194 && node.parent.label === node; } function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 189; owner = owner.parent) { + for (var owner = node.parent; owner.kind === 194; owner = owner.parent) { if (owner.label.text === labelName) { return true; } @@ -27949,48 +30098,48 @@ var ts; return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node); } function isRightSideOfQualifiedName(node) { - return node.parent.kind === 125 && node.parent.right === node; + return node.parent.kind === 126 && node.parent.right === node; } function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 153 && node.parent.name === node; + return node && node.parent && node.parent.kind === 155 && node.parent.name === node; } function isCallExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 155 && node.parent.expression === node; + return node && node.parent && node.parent.kind === 157 && node.parent.expression === node; } function isNewExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 156 && node.parent.expression === node; + return node && node.parent && node.parent.kind === 158 && node.parent.expression === node; } function isNameOfModuleDeclaration(node) { - return node.parent.kind === 200 && node.parent.name === node; + return node.parent.kind === 205 && node.parent.name === node; } function isNameOfFunctionDeclaration(node) { - return node.kind === 64 && + return node.kind === 65 && ts.isFunctionLike(node.parent) && node.parent.name === node; } function isNameOfPropertyAssignment(node) { - return (node.kind === 64 || node.kind === 8 || node.kind === 7) && - (node.parent.kind === 218 || node.parent.kind === 219) && node.parent.name === node; + return (node.kind === 65 || node.kind === 8 || node.kind === 7) && + (node.parent.kind === 224 || node.parent.kind === 225) && node.parent.name === node; } function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { if (node.kind === 8 || node.kind === 7) { switch (node.parent.kind) { - case 130: - case 129: - case 218: - case 220: case 132: case 131: + case 224: + case 226: case 134: - case 135: - case 200: + case 133: + case 136: + case 137: + case 205: return node.parent.name === node; - case 154: + case 156: return node.parent.argumentExpression === node; } } @@ -28028,7 +30177,7 @@ var ts; } } var keywordCompletions = []; - for (var i = 65; i <= 124; i++) { + for (var i = 66; i <= 125; i++) { keywordCompletions.push({ name: ts.tokenToString(i), kind: ScriptElementKind.keyword, @@ -28042,17 +30191,17 @@ var ts; return undefined; } switch (node.kind) { - case 221: - case 132: - case 131: - case 195: - case 160: + case 227: case 134: - case 135: - case 196: - case 197: - case 199: + case 133: case 200: + case 162: + case 136: + case 137: + case 201: + case 202: + case 204: + case 205: return node; } } @@ -28060,38 +30209,38 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 200: return ScriptElementKind.moduleElement; - case 196: return ScriptElementKind.classElement; - case 197: return ScriptElementKind.interfaceElement; - case 198: return ScriptElementKind.typeElement; - case 199: return ScriptElementKind.enumElement; - case 193: + 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: return ts.isConst(node) ? ScriptElementKind.constElement : ts.isLet(node) ? ScriptElementKind.letElement : ScriptElementKind.variableElement; - case 195: return ScriptElementKind.functionElement; - case 134: return ScriptElementKind.memberGetAccessorElement; - case 135: return ScriptElementKind.memberSetAccessorElement; + case 200: return ScriptElementKind.functionElement; + case 136: return ScriptElementKind.memberGetAccessorElement; + case 137: return ScriptElementKind.memberSetAccessorElement; + case 134: + case 133: + return ScriptElementKind.memberFunctionElement; case 132: case 131: - return ScriptElementKind.memberFunctionElement; - case 130: - case 129: return ScriptElementKind.memberVariableElement; - case 138: return ScriptElementKind.indexSignatureElement; - case 137: return ScriptElementKind.constructSignatureElement; - case 136: return ScriptElementKind.callSignatureElement; - case 133: return ScriptElementKind.constructorImplementationElement; - case 127: return ScriptElementKind.typeParameterElement; - case 220: return ScriptElementKind.variableElement; - case 128: return (node.flags & 112) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; - case 203: + 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 205: - case 212: - case 206: + case 213: + case 210: + case 217: + case 211: return ScriptElementKind.alias; } return ScriptElementKind.unknown; @@ -28105,7 +30254,6 @@ var ts; var typeInfoResolver; var useCaseSensitivefileNames = false; var cancellationToken = new CancellationTokenObject(host.getCancellationToken && host.getCancellationToken()); - var activeCompletionSession; if (!ts.localizedDiagnosticMessages && host.getLocalizedDiagnosticMessages) { ts.localizedDiagnosticMessages = host.getLocalizedDiagnosticMessages(); } @@ -28152,7 +30300,7 @@ var ts; }); if (program) { var oldSourceFiles = program.getSourceFiles(); - for (var _i = 0, _n = oldSourceFiles.length; _i < _n; _i++) { + for (var _i = 0; _i < oldSourceFiles.length; _i++) { var oldSourceFile = oldSourceFiles[_i]; var fileName = oldSourceFile.fileName; if (!newProgram.getSourceFile(fileName) || changesInCompilationSettingsAffectSyntax) { @@ -28169,8 +30317,8 @@ var ts; return undefined; } if (!changesInCompilationSettingsAffectSyntax) { - var _oldSourceFile = program && program.getSourceFile(fileName); - if (_oldSourceFile) { + var oldSourceFile = program && program.getSourceFile(fileName); + if (oldSourceFile) { return documentRegistry.updateDocument(fileName, newSettings, hostFileInformation.scriptSnapshot, hostFileInformation.version); } } @@ -28187,9 +30335,9 @@ var ts; if (program.getSourceFiles().length !== rootFileNames.length) { return false; } - for (var _a = 0, _b = rootFileNames.length; _a < _b; _a++) { - var _fileName = rootFileNames[_a]; - if (!sourceFileUpToDate(program.getSourceFile(_fileName))) { + for (var _i = 0; _i < rootFileNames.length; _i++) { + var fileName = rootFileNames[_i]; + if (!sourceFileUpToDate(program.getSourceFile(fileName))) { return false; } } @@ -28224,35 +30372,48 @@ var ts; return semanticDiagnostics; } var declarationDiagnostics = program.getDeclarationDiagnostics(targetSourceFile); - return semanticDiagnostics.concat(declarationDiagnostics); + return ts.concatenate(semanticDiagnostics, declarationDiagnostics); } function getCompilerOptionsDiagnostics() { synchronizeHostData(); return program.getGlobalDiagnostics(); } - function getValidCompletionEntryDisplayName(symbol, target) { + function getCompletionEntryDisplayName(symbol, target, performCharacterChecks) { var displayName = symbol.getName(); - if (displayName && displayName.length > 0) { - var firstCharCode = displayName.charCodeAt(0); - if ((symbol.flags & 1536) && (firstCharCode === 39 || firstCharCode === 34)) { - return undefined; - } - if (displayName && displayName.length >= 2 && firstCharCode === displayName.charCodeAt(displayName.length - 1) && - (firstCharCode === 39 || firstCharCode === 34)) { - displayName = displayName.substring(1, displayName.length - 1); - } - var isValid = ts.isIdentifierStart(displayName.charCodeAt(0), target); - for (var _i = 1, n = displayName.length; isValid && _i < n; _i++) { - isValid = ts.isIdentifierPart(displayName.charCodeAt(_i), target); - } - if (isValid) { - return ts.unescapeIdentifier(displayName); + if (!displayName) { + return undefined; + } + if (displayName === "default") { + var localSymbol = ts.getLocalSymbolForExportDefault(symbol); + if (localSymbol && localSymbol.name) { + displayName = symbol.valueDeclaration.localSymbol.name; } } - return undefined; + var firstCharCode = displayName.charCodeAt(0); + if ((symbol.flags & 1536) && (firstCharCode === 39 || firstCharCode === 34)) { + return undefined; + } + if (displayName && displayName.length >= 2 && firstCharCode === displayName.charCodeAt(displayName.length - 1) && + (firstCharCode === 39 || firstCharCode === 34)) { + displayName = displayName.substring(1, displayName.length - 1); + } + if (!displayName) { + return undefined; + } + if (performCharacterChecks) { + if (!ts.isIdentifierStart(displayName.charCodeAt(0), target)) { + return undefined; + } + for (var i = 1, n = displayName.length; i < n; i++) { + if (!ts.isIdentifierPart(displayName.charCodeAt(i), target)) { + return undefined; + } + } + } + return ts.unescapeIdentifier(displayName); } function createCompletionEntry(symbol, typeChecker, location) { - var displayName = getValidCompletionEntryDisplayName(symbol, program.getCompilerOptions().target); + var displayName = getCompletionEntryDisplayName(symbol, program.getCompilerOptions().target, true); if (!displayName) { return undefined; } @@ -28262,63 +30423,53 @@ var ts; kindModifiers: getSymbolModifiers(symbol) }; } - function getCompletionsAtPosition(fileName, position) { - synchronizeHostData(); + function getCompletionData(fileName, position) { var syntacticStart = new Date().getTime(); var sourceFile = getValidSourceFile(fileName); var start = new Date().getTime(); var currentToken = ts.getTokenAtPosition(sourceFile, position); - log("getCompletionsAtPosition: Get current token: " + (new Date().getTime() - start)); + log("getCompletionData: Get current token: " + (new Date().getTime() - start)); start = new Date().getTime(); var insideComment = isInsideComment(sourceFile, currentToken, position); - log("getCompletionsAtPosition: Is inside comment: " + (new Date().getTime() - start)); + log("getCompletionData: Is inside comment: " + (new Date().getTime() - start)); if (insideComment) { log("Returning an empty list because completion was inside a comment."); return undefined; } start = new Date().getTime(); var previousToken = ts.findPrecedingToken(position, sourceFile); - log("getCompletionsAtPosition: Get previous token 1: " + (new Date().getTime() - start)); - if (previousToken && position <= previousToken.end && previousToken.kind === 64) { - var _start = new Date().getTime(); - previousToken = ts.findPrecedingToken(previousToken.pos, sourceFile); - log("getCompletionsAtPosition: Get previous token 2: " + (new Date().getTime() - _start)); + log("getCompletionData: Get previous token 1: " + (new Date().getTime() - start)); + var contextToken = previousToken; + if (contextToken && position <= contextToken.end && ts.isWord(contextToken.kind)) { + var start_1 = new Date().getTime(); + contextToken = ts.findPrecedingToken(contextToken.getFullStart(), sourceFile); + log("getCompletionData: Get previous token 2: " + (new Date().getTime() - start_1)); } - if (previousToken && isCompletionListBlocker(previousToken)) { + if (contextToken && isCompletionListBlocker(contextToken)) { log("Returning an empty list because completion was requested in an invalid position."); return undefined; } - var node; - var isRightOfDot; - if (previousToken && previousToken.kind === 20 && previousToken.parent.kind === 153) { - node = previousToken.parent.expression; + var node = currentToken; + var isRightOfDot = false; + if (contextToken && contextToken.kind === 20 && contextToken.parent.kind === 155) { + node = contextToken.parent.expression; isRightOfDot = true; } - else if (previousToken && previousToken.kind === 20 && previousToken.parent.kind === 125) { - node = previousToken.parent.left; + else if (contextToken && contextToken.kind === 20 && contextToken.parent.kind === 126) { + node = contextToken.parent.left; isRightOfDot = true; } - else { - node = currentToken; - isRightOfDot = false; - } - activeCompletionSession = { - fileName: fileName, - position: position, - entries: [], - symbols: {}, - typeChecker: typeInfoResolver - }; - log("getCompletionsAtPosition: Syntactic work: " + (new Date().getTime() - syntacticStart)); - var _location = ts.getTouchingPropertyName(sourceFile, position); + var location = ts.getTouchingPropertyName(sourceFile, position); + var target = program.getCompilerOptions().target; var semanticStart = new Date().getTime(); var isMemberCompletion; var isNewIdentifierLocation; + var symbols; if (isRightOfDot) { - var symbols = []; + symbols = []; isMemberCompletion = true; isNewIdentifierLocation = false; - if (node.kind === 64 || node.kind === 125 || node.kind === 153) { + if (node.kind === 65 || node.kind === 126 || node.kind === 155) { var symbol = typeInfoResolver.getSymbolAtLocation(node); if (symbol && symbol.flags & 8388608) { symbol = typeInfoResolver.getAliasedSymbol(symbol); @@ -28339,10 +30490,9 @@ var ts; } }); } - getCompletionEntriesFromSymbols(symbols, activeCompletionSession); } else { - var containingObjectLiteral = getContainingObjectLiteralApplicableForCompletion(previousToken); + var containingObjectLiteral = getContainingObjectLiteralApplicableForCompletion(contextToken); if (containingObjectLiteral) { isMemberCompletion = true; isNewIdentifierLocation = true; @@ -28352,65 +30502,54 @@ var ts; } var contextualTypeMembers = typeInfoResolver.getPropertiesOfType(contextualType); if (contextualTypeMembers && contextualTypeMembers.length > 0) { - var filteredMembers = filterContextualMembersList(contextualTypeMembers, containingObjectLiteral.properties); - getCompletionEntriesFromSymbols(filteredMembers, activeCompletionSession); + symbols = filterContextualMembersList(contextualTypeMembers, containingObjectLiteral.properties); } } - else if (ts.getAncestor(previousToken, 205)) { + else if (ts.getAncestor(contextToken, 210)) { isMemberCompletion = true; isNewIdentifierLocation = true; - if (showCompletionsInImportsClause(previousToken)) { - var importDeclaration = ts.getAncestor(previousToken, 204); + if (showCompletionsInImportsClause(contextToken)) { + var importDeclaration = ts.getAncestor(contextToken, 209); ts.Debug.assert(importDeclaration !== undefined); - var _exports = typeInfoResolver.getExportsOfExternalModule(importDeclaration); - var filteredExports = filterModuleExports(_exports, importDeclaration); - getCompletionEntriesFromSymbols(filteredExports, activeCompletionSession); + var exports_2 = typeInfoResolver.getExportsOfExternalModule(importDeclaration); + symbols = filterModuleExports(exports_2, importDeclaration); } } else { isMemberCompletion = false; - isNewIdentifierLocation = isNewIdentifierDefinitionLocation(previousToken); + isNewIdentifierLocation = isNewIdentifierDefinitionLocation(contextToken); + if (previousToken !== contextToken) { + ts.Debug.assert(!!previousToken, "Expected 'contextToken' to be defined when different from 'previousToken'."); + } + var adjustedPosition = previousToken !== contextToken ? + previousToken.getStart() : + position; + var scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile; var symbolMeanings = 793056 | 107455 | 1536 | 8388608; - var _symbols = typeInfoResolver.getSymbolsInScope(node, symbolMeanings); - getCompletionEntriesFromSymbols(_symbols, activeCompletionSession); + symbols = typeInfoResolver.getSymbolsInScope(scopeNode, symbolMeanings); } } - if (!isMemberCompletion) { - Array.prototype.push.apply(activeCompletionSession.entries, keywordCompletions); - } - log("getCompletionsAtPosition: Semantic work: " + (new Date().getTime() - semanticStart)); - return { - isMemberCompletion: isMemberCompletion, - isNewIdentifierLocation: isNewIdentifierLocation, - isBuilder: isNewIdentifierDefinitionLocation, - entries: activeCompletionSession.entries - }; - function getCompletionEntriesFromSymbols(symbols, session) { - var _start_1 = new Date().getTime(); - ts.forEach(symbols, function (symbol) { - var entry = createCompletionEntry(symbol, session.typeChecker, _location); - if (entry) { - var id = ts.escapeIdentifier(entry.name); - if (!ts.lookUp(session.symbols, id)) { - session.entries.push(entry); - session.symbols[id] = symbol; - } - } - }); - log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (new Date().getTime() - _start_1)); + log("getCompletionData: Semantic work: " + (new Date().getTime() - semanticStart)); + return { symbols: symbols, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, location: location }; + function getScopeNode(initialToken, position, sourceFile) { + var scope = initialToken; + while (scope && !ts.positionBelongsToNode(scope, position, sourceFile)) { + scope = scope.parent; + } + return scope; } function isCompletionListBlocker(previousToken) { - var _start_1 = new Date().getTime(); + var start = new Date().getTime(); var result = isInStringOrRegularExpressionOrTemplateLiteral(previousToken) || isIdentifierDefinitionLocation(previousToken) || isRightOfIllegalDot(previousToken); - log("getCompletionsAtPosition: isCompletionListBlocker: " + (new Date().getTime() - _start_1)); + log("getCompletionsAtPosition: isCompletionListBlocker: " + (new Date().getTime() - start)); return result; } function showCompletionsInImportsClause(node) { if (node) { if (node.kind === 14 || node.kind === 23) { - return node.parent.kind === 207; + return node.parent.kind === 212; } } return false; @@ -28420,35 +30559,35 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 23: - return containingNodeKind === 155 - || containingNodeKind === 133 - || containingNodeKind === 156 - || containingNodeKind === 151 - || containingNodeKind === 167; + return containingNodeKind === 157 + || containingNodeKind === 135 + || containingNodeKind === 158 + || containingNodeKind === 153 + || containingNodeKind === 169; case 16: - return containingNodeKind === 155 - || containingNodeKind === 133 - || containingNodeKind === 156 - || containingNodeKind === 159; + return containingNodeKind === 157 + || containingNodeKind === 135 + || containingNodeKind === 158 + || containingNodeKind === 161; case 18: - return containingNodeKind === 151; - case 116: + return containingNodeKind === 153; + case 117: return true; case 20: - return containingNodeKind === 200; + return containingNodeKind === 205; case 14: - return containingNodeKind === 196; - case 52: - return containingNodeKind === 193 - || containingNodeKind === 167; + return containingNodeKind === 201; + case 53: + return containingNodeKind === 198 + || containingNodeKind === 169; case 11: - return containingNodeKind === 169; + return containingNodeKind === 171; case 12: - return containingNodeKind === 173; - case 108: - case 106: + return containingNodeKind === 176; + case 109: case 107: - return containingNodeKind === 130; + case 108: + return containingNodeKind === 132; } switch (previousToken.getText()) { case "public": @@ -28463,9 +30602,9 @@ var ts; if (previousToken.kind === 8 || previousToken.kind === 9 || ts.isTemplateLiteralKind(previousToken.kind)) { - var _start_1 = previousToken.getStart(); + var start_2 = previousToken.getStart(); var end = previousToken.getEnd(); - if (_start_1 < position && position < end) { + if (start_2 < position && position < end) { return true; } else if (position === end) { @@ -28475,13 +30614,14 @@ var ts; return false; } function getContainingObjectLiteralApplicableForCompletion(previousToken) { + // The locations in an object literal expression that are applicable for completion are property name definition locations. if (previousToken) { - var _parent = previousToken.parent; + var parent_8 = previousToken.parent; switch (previousToken.kind) { case 14: case 23: - if (_parent && _parent.kind === 152) { - return _parent; + if (parent_8 && parent_8.kind === 154) { + return parent_8; } break; } @@ -28490,16 +30630,16 @@ var ts; } function isFunction(kind) { switch (kind) { - case 160: - case 161: - case 195: - case 132: - case 131: + case 162: + case 163: + case 200: case 134: - case 135: + case 133: case 136: case 137: case 138: + case 139: + case 140: return true; } return false; @@ -28509,58 +30649,58 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 23: - return containingNodeKind === 193 || - containingNodeKind === 194 || - containingNodeKind === 175 || + return containingNodeKind === 198 || containingNodeKind === 199 || + containingNodeKind === 180 || + containingNodeKind === 204 || isFunction(containingNodeKind) || - containingNodeKind === 196 || - containingNodeKind === 195 || - containingNodeKind === 197 || - containingNodeKind === 149 || - containingNodeKind === 148; + containingNodeKind === 201 || + containingNodeKind === 200 || + containingNodeKind === 202 || + containingNodeKind === 151 || + containingNodeKind === 150; case 20: - return containingNodeKind === 149; + return containingNodeKind === 151; case 18: - return containingNodeKind === 149; + return containingNodeKind === 151; case 16: - return containingNodeKind === 217 || + return containingNodeKind === 223 || isFunction(containingNodeKind); case 14: - return containingNodeKind === 199 || - containingNodeKind === 197 || - containingNodeKind === 143 || - containingNodeKind === 148; + return containingNodeKind === 204 || + containingNodeKind === 202 || + containingNodeKind === 145 || + containingNodeKind === 150; case 22: - return containingNodeKind === 129 && - (previousToken.parent.parent.kind === 197 || - previousToken.parent.parent.kind === 143); + return containingNodeKind === 131 && + (previousToken.parent.parent.kind === 202 || + previousToken.parent.parent.kind === 145); case 24: - return containingNodeKind === 196 || - containingNodeKind === 195 || - containingNodeKind === 197 || + return containingNodeKind === 201 || + containingNodeKind === 200 || + containingNodeKind === 202 || isFunction(containingNodeKind); - case 109: - return containingNodeKind === 130; - case 21: - return containingNodeKind === 128 || - containingNodeKind === 133 || - (previousToken.parent.parent.kind === 149); - case 108: - case 106: - case 107: - return containingNodeKind === 128; - case 68: - case 76: - case 103: - case 82: - case 97: - case 115: - case 119: - case 84: - case 104: - case 69: case 110: + return containingNodeKind === 132; + case 21: + return containingNodeKind === 129 || + containingNodeKind === 135 || + (previousToken.parent.parent.kind === 151); + case 109: + case 107: + case 108: + return containingNodeKind === 129; + case 69: + case 77: + case 104: + case 83: + case 98: + case 116: + case 120: + case 85: + case 105: + case 70: + case 111: return true; } switch (previousToken.getText()) { @@ -28591,10 +30731,10 @@ var ts; return exports; } if (importDeclaration.importClause.namedBindings && - importDeclaration.importClause.namedBindings.kind === 207) { + importDeclaration.importClause.namedBindings.kind === 212) { ts.forEach(importDeclaration.importClause.namedBindings.elements, function (el) { - var _name = el.propertyName || el.name; - exisingImports[_name.text] = true; + var name = el.propertyName || el.name; + exisingImports[name.text] = true; }); } if (ts.isEmpty(exisingImports)) { @@ -28608,7 +30748,7 @@ var ts; } var existingMemberNames = {}; ts.forEach(existingMembers, function (m) { - if (m.kind !== 218 && m.kind !== 219) { + if (m.kind !== 224 && m.kind !== 225) { return; } if (m.getStart() <= position && position <= m.getEnd()) { @@ -28616,44 +30756,78 @@ var ts; } existingMemberNames[m.name.text] = true; }); - var _filteredMembers = []; + var filteredMembers = []; ts.forEach(contextualMemberSymbols, function (s) { if (!existingMemberNames[s.name]) { - _filteredMembers.push(s); + filteredMembers.push(s); } }); - return _filteredMembers; + return filteredMembers; + } + } + function getCompletionsAtPosition(fileName, position) { + synchronizeHostData(); + var completionData = getCompletionData(fileName, position); + if (!completionData) { + return undefined; + } + var symbols = completionData.symbols, isMemberCompletion = completionData.isMemberCompletion, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location; + if (!symbols || symbols.length === 0) { + return undefined; + } + var entries = getCompletionEntriesFromSymbols(symbols); + if (!isMemberCompletion) { + ts.addRange(entries, keywordCompletions); + } + return { isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; + function getCompletionEntriesFromSymbols(symbols) { + var start = new Date().getTime(); + var entries = []; + var nameToSymbol = {}; + for (var _i = 0; _i < symbols.length; _i++) { + var symbol = symbols[_i]; + var entry = createCompletionEntry(symbol, typeInfoResolver, location); + if (entry) { + var id = ts.escapeIdentifier(entry.name); + if (!ts.lookUp(nameToSymbol, id)) { + entries.push(entry); + nameToSymbol[id] = symbol; + } + } + } + log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (new Date().getTime() - start)); + return entries; } } function getCompletionEntryDetails(fileName, position, entryName) { - var sourceFile = getValidSourceFile(fileName); - var session = activeCompletionSession; - if (!session || session.fileName !== fileName || session.position !== position) { - return undefined; + synchronizeHostData(); + var completionData = getCompletionData(fileName, position); + if (completionData) { + var symbols = completionData.symbols, location_2 = completionData.location; + var target = program.getCompilerOptions().target; + var symbol = ts.forEach(symbols, function (s) { return getCompletionEntryDisplayName(s, target, false) === entryName ? s : undefined; }); + if (symbol) { + var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location_2, typeInfoResolver, location_2, 7); + return { + name: entryName, + kind: displayPartsDocumentationsAndSymbolKind.symbolKind, + kindModifiers: getSymbolModifiers(symbol), + displayParts: displayPartsDocumentationsAndSymbolKind.displayParts, + documentation: displayPartsDocumentationsAndSymbolKind.documentation + }; + } } - var symbol = ts.lookUp(activeCompletionSession.symbols, ts.escapeIdentifier(entryName)); - if (symbol) { - var _location = ts.getTouchingPropertyName(sourceFile, position); - var completionEntry = createCompletionEntry(symbol, session.typeChecker, _location); - ts.Debug.assert(session.typeChecker.getTypeOfSymbolAtLocation(symbol, _location) !== undefined, "Could not find type for symbol"); - var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), _location, session.typeChecker, _location, 7); - return { - name: entryName, - kind: displayPartsDocumentationsAndSymbolKind.symbolKind, - kindModifiers: completionEntry.kindModifiers, - displayParts: displayPartsDocumentationsAndSymbolKind.displayParts, - documentation: displayPartsDocumentationsAndSymbolKind.documentation - }; - } - else { + var keywordCompletion = ts.forEach(keywordCompletions, function (c) { return c.name === entryName; }); + if (keywordCompletion) { return { name: entryName, kind: ScriptElementKind.keyword, kindModifiers: ScriptElementKindModifier.none, - displayParts: [ts.displayPart(entryName, 5)], + displayParts: [ts.displayPart(entryName, SymbolDisplayPartKind.keyword)], documentation: undefined }; } + return undefined; } function getSymbolKind(symbol, typeResolver, location) { var flags = symbol.getFlags(); @@ -28767,14 +30941,14 @@ var ts; var signature; type = typeResolver.getTypeOfSymbolAtLocation(symbol, location); if (type) { - if (location.parent && location.parent.kind === 153) { + if (location.parent && location.parent.kind === 155) { var right = location.parent.name; if (right === location || (right && right.getFullWidth() === 0)) { location = location.parent; } } var callExpression; - if (location.kind === 155 || location.kind === 156) { + if (location.kind === 157 || location.kind === 158) { callExpression = location; } else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { @@ -28786,7 +30960,7 @@ var ts; if (!signature && candidateSignatures.length) { signature = candidateSignatures[0]; } - var useConstructSignatures = callExpression.kind === 156 || callExpression.expression.kind === 90; + var useConstructSignatures = callExpression.kind === 158 || callExpression.expression.kind === 91; var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target || signature)) { signature = allSignatures.length ? allSignatures[0] : undefined; @@ -28798,12 +30972,10 @@ var ts; } else if (symbolFlags & 8388608) { symbolKind = ScriptElementKind.alias; - displayParts.push(ts.punctuationPart(16)); - displayParts.push(ts.textPart(symbolKind)); - displayParts.push(ts.punctuationPart(17)); + pushTypePart(symbolKind); displayParts.push(ts.spacePart()); if (useConstructSignatures) { - displayParts.push(ts.keywordPart(87)); + displayParts.push(ts.keywordPart(88)); displayParts.push(ts.spacePart()); } addFullSymbolName(symbol); @@ -28821,7 +30993,7 @@ var ts; displayParts.push(ts.punctuationPart(51)); displayParts.push(ts.spacePart()); if (useConstructSignatures) { - displayParts.push(ts.keywordPart(87)); + displayParts.push(ts.keywordPart(88)); displayParts.push(ts.spacePart()); } if (!(type.flags & 32768)) { @@ -28836,64 +31008,64 @@ var ts; } } else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304)) || - (location.kind === 113 && location.parent.kind === 133)) { + (location.kind === 114 && location.parent.kind === 135)) { var functionDeclaration = location.parent; - var _allSignatures = functionDeclaration.kind === 133 ? type.getConstructSignatures() : type.getCallSignatures(); + var allSignatures = functionDeclaration.kind === 135 ? type.getConstructSignatures() : type.getCallSignatures(); if (!typeResolver.isImplementationOfOverload(functionDeclaration)) { signature = typeResolver.getSignatureFromDeclaration(functionDeclaration); } else { - signature = _allSignatures[0]; + signature = allSignatures[0]; } - if (functionDeclaration.kind === 133) { + if (functionDeclaration.kind === 135) { symbolKind = ScriptElementKind.constructorImplementationElement; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { - addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 136 && + addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 138 && !(type.symbol.flags & 2048 || type.symbol.flags & 4096) ? type.symbol : symbol, symbolKind); } - addSignatureDisplayParts(signature, _allSignatures); + addSignatureDisplayParts(signature, allSignatures); hasAddedSymbolInfo = true; } } } if (symbolFlags & 32 && !hasAddedSymbolInfo) { - displayParts.push(ts.keywordPart(68)); + displayParts.push(ts.keywordPart(69)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); } if ((symbolFlags & 64) && (semanticMeaning & 2)) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(103)); + displayParts.push(ts.keywordPart(104)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); } if (symbolFlags & 524288) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(122)); + displayParts.push(ts.keywordPart(123)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(52)); + displayParts.push(ts.operatorPart(53)); displayParts.push(ts.spacePart()); displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeResolver, typeResolver.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration)); } if (symbolFlags & 384) { addNewLineIfDisplayPartsExist(); if (ts.forEach(symbol.declarations, ts.isConstEnumDeclaration)) { - displayParts.push(ts.keywordPart(69)); + displayParts.push(ts.keywordPart(70)); displayParts.push(ts.spacePart()); } - displayParts.push(ts.keywordPart(76)); + displayParts.push(ts.keywordPart(77)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } if (symbolFlags & 1536) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(116)); + displayParts.push(ts.keywordPart(117)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } @@ -28905,60 +31077,60 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(85)); + displayParts.push(ts.keywordPart(86)); displayParts.push(ts.spacePart()); if (symbol.parent) { addFullSymbolName(symbol.parent, enclosingDeclaration); writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration); } else { - var signatureDeclaration = ts.getDeclarationOfKind(symbol, 127).parent; - var _signature = typeResolver.getSignatureFromDeclaration(signatureDeclaration); - if (signatureDeclaration.kind === 137) { - displayParts.push(ts.keywordPart(87)); + var signatureDeclaration = ts.getDeclarationOfKind(symbol, 128).parent; + var signature = typeResolver.getSignatureFromDeclaration(signatureDeclaration); + if (signatureDeclaration.kind === 139) { + displayParts.push(ts.keywordPart(88)); displayParts.push(ts.spacePart()); } - else if (signatureDeclaration.kind !== 136 && signatureDeclaration.name) { + else if (signatureDeclaration.kind !== 138 && signatureDeclaration.name) { addFullSymbolName(signatureDeclaration.symbol); } - displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeResolver, _signature, sourceFile, 32)); + displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeResolver, signature, sourceFile, 32)); } } if (symbolFlags & 8) { addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 220) { + if (declaration.kind === 226) { var constantValue = typeResolver.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(52)); + displayParts.push(ts.operatorPart(53)); displayParts.push(ts.spacePart()); - displayParts.push(ts.displayPart(constantValue.toString(), 7)); + displayParts.push(ts.displayPart(constantValue.toString(), SymbolDisplayPartKind.numericLiteral)); } } } if (symbolFlags & 8388608) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(84)); + displayParts.push(ts.keywordPart(85)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 203) { + if (declaration.kind === 208) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(52)); + displayParts.push(ts.operatorPart(53)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(117)); + displayParts.push(ts.keywordPart(118)); displayParts.push(ts.punctuationPart(16)); - displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), 8)); + displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), SymbolDisplayPartKind.stringLiteral)); displayParts.push(ts.punctuationPart(17)); } else { var internalAliasSymbol = typeResolver.getSymbolAtLocation(importEqualsDeclaration.moduleReference); if (internalAliasSymbol) { displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(52)); + displayParts.push(ts.operatorPart(53)); displayParts.push(ts.spacePart()); addFullSymbolName(internalAliasSymbol, enclosingDeclaration); } @@ -28992,8 +31164,8 @@ var ts; symbolFlags & 131072 || symbolFlags & 98304 || symbolKind === ScriptElementKind.memberFunctionElement) { - var _allSignatures_1 = type.getCallSignatures(); - addSignatureDisplayParts(_allSignatures_1[0], _allSignatures_1); + var allSignatures = type.getCallSignatures(); + addSignatureDisplayParts(allSignatures[0], allSignatures); } } } @@ -29017,20 +31189,34 @@ var ts; function addPrefixForAnyFunctionOrVar(symbol, symbolKind) { addNewLineIfDisplayPartsExist(); if (symbolKind) { - displayParts.push(ts.punctuationPart(16)); - displayParts.push(ts.textPart(symbolKind)); - displayParts.push(ts.punctuationPart(17)); + pushTypePart(symbolKind); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } } + function pushTypePart(symbolKind) { + switch (symbolKind) { + case ScriptElementKind.variableElement: + case ScriptElementKind.functionElement: + case ScriptElementKind.letElement: + case ScriptElementKind.constElement: + case ScriptElementKind.constructorImplementationElement: + displayParts.push(ts.textOrKeywordPart(symbolKind)); + return; + default: + displayParts.push(ts.punctuationPart(16)); + displayParts.push(ts.textOrKeywordPart(symbolKind)); + displayParts.push(ts.punctuationPart(17)); + return; + } + } function addSignatureDisplayParts(signature, allSignatures, flags) { displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeResolver, signature, enclosingDeclaration, flags | 32)); if (allSignatures.length > 1) { displayParts.push(ts.spacePart()); displayParts.push(ts.punctuationPart(16)); displayParts.push(ts.operatorPart(33)); - displayParts.push(ts.displayPart((allSignatures.length - 1).toString(), 7)); + displayParts.push(ts.displayPart((allSignatures.length - 1).toString(), SymbolDisplayPartKind.numericLiteral)); displayParts.push(ts.spacePart()); displayParts.push(ts.textPart(allSignatures.length === 2 ? "overload" : "overloads")); displayParts.push(ts.punctuationPart(17)); @@ -29038,10 +31224,10 @@ var ts; documentation = signature.getDocumentationComment(); } function writeTypeParametersOfSymbol(symbol, enclosingDeclaration) { - var _typeParameterParts = ts.mapToDisplayParts(function (writer) { + var typeParameterParts = ts.mapToDisplayParts(function (writer) { typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration); }); - displayParts.push.apply(displayParts, _typeParameterParts); + displayParts.push.apply(displayParts, typeParameterParts); } } function getQuickInfoAtPosition(fileName, position) { @@ -29054,11 +31240,11 @@ var ts; var symbol = typeInfoResolver.getSymbolAtLocation(node); if (!symbol) { switch (node.kind) { - case 64: - case 153: - case 125: - case 92: - case 90: + case 65: + case 155: + case 126: + case 93: + case 91: var type = typeInfoResolver.getTypeAtLocation(node); if (type) { return { @@ -29081,6 +31267,16 @@ var ts; documentation: displayPartsDocumentationsAndKind.documentation }; } + function createDefinitionInfo(node, symbolKind, symbolName, containerName) { + return { + fileName: node.getSourceFile().fileName, + textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()), + kind: symbolKind, + name: symbolName, + containerKind: undefined, + containerName: containerName + }; + } function getDefinitionAtPosition(fileName, position) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); @@ -29091,7 +31287,7 @@ var ts; if (isJumpStatementTarget(node)) { var labelName = node.text; var label = getTargetLabel(node.parent, node.text); - return label ? [getDefinitionInfo(label, ScriptElementKind.label, labelName, undefined)] : undefined; + return label ? [createDefinitionInfo(label, ScriptElementKind.label, labelName, undefined)] : undefined; } var comment = ts.forEach(sourceFile.referencedFiles, function (r) { return (r.pos <= position && position < r.end) ? r : undefined; }); if (comment) { @@ -29114,22 +31310,22 @@ var ts; } if (symbol.flags & 8388608) { var declaration = symbol.declarations[0]; - if (node.kind === 64 && node.parent === declaration) { + if (node.kind === 65 && node.parent === declaration) { symbol = typeInfoResolver.getAliasedSymbol(symbol); } } - var result = []; - if (node.parent.kind === 219) { + if (node.parent.kind === 225) { var shorthandSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); + if (!shorthandSymbol) { + return []; + } var shorthandDeclarations = shorthandSymbol.getDeclarations(); var shorthandSymbolKind = getSymbolKind(shorthandSymbol, typeInfoResolver, node); var shorthandSymbolName = typeInfoResolver.symbolToString(shorthandSymbol); var shorthandContainerName = typeInfoResolver.symbolToString(symbol.parent, node); - ts.forEach(shorthandDeclarations, function (declaration) { - result.push(getDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName)); - }); - return result; + return ts.map(shorthandDeclarations, function (declaration) { return createDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName); }); } + var result = []; var declarations = symbol.getDeclarations(); var symbolName = typeInfoResolver.symbolToString(symbol); var symbolKind = getSymbolKind(symbol, typeInfoResolver, node); @@ -29138,46 +31334,15 @@ var ts; if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { ts.forEach(declarations, function (declaration) { - result.push(getDefinitionInfo(declaration, symbolKind, symbolName, containerName)); + result.push(createDefinitionInfo(declaration, symbolKind, symbolName, containerName)); }); } return result; - function getDefinitionInfo(node, symbolKind, symbolName, containerName) { - return { - fileName: node.getSourceFile().fileName, - textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()), - kind: symbolKind, - name: symbolName, - containerKind: undefined, - containerName: containerName - }; - } - function tryAddSignature(signatureDeclarations, selectConstructors, symbolKind, symbolName, containerName, result) { - var _declarations = []; - var definition; - ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 133) || - (!selectConstructors && (d.kind === 195 || d.kind === 132 || d.kind === 131))) { - _declarations.push(d); - if (d.body) - definition = d; - } - }); - if (definition) { - result.push(getDefinitionInfo(definition, symbolKind, symbolName, containerName)); - return true; - } - else if (_declarations.length) { - result.push(getDefinitionInfo(_declarations[_declarations.length - 1], symbolKind, symbolName, containerName)); - return true; - } - return false; - } function tryAddConstructSignature(symbol, location, symbolKind, symbolName, containerName, result) { - if (isNewExpressionTarget(location) || location.kind === 113) { + if (isNewExpressionTarget(location) || location.kind === 114) { if (symbol.flags & 32) { var classDeclaration = symbol.getDeclarations()[0]; - ts.Debug.assert(classDeclaration && classDeclaration.kind === 196); + ts.Debug.assert(classDeclaration && classDeclaration.kind === 201); return tryAddSignature(classDeclaration.members, true, symbolKind, symbolName, containerName, result); } } @@ -29189,116 +31354,148 @@ var ts; } return false; } + 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 (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; + } } function getOccurrencesAtPosition(fileName, position) { + var results = getOccurrencesAtPositionCore(fileName, position); + if (results) { + var sourceFile = getCanonicalFileName(ts.normalizeSlashes(fileName)); + results.forEach(function (value) { + var targetFile = getCanonicalFileName(ts.normalizeSlashes(value.fileName)); + ts.Debug.assert(sourceFile == targetFile, "Unexpected file in results. Found results in " + targetFile + " expected only results in " + sourceFile + "."); + }); + } + return results; + } + function getOccurrencesAtPositionCore(fileName, position) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); var node = ts.getTouchingWord(sourceFile, position); if (!node) { return undefined; } - if (node.kind === 64 || node.kind === 92 || node.kind === 90 || + if (node.kind === 65 || node.kind === 93 || node.kind === 91 || isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { - return getReferencesForNode(node, [sourceFile], true, false, false); + return convertReferences(getReferencesForNode(node, [sourceFile], true, false, false)); } switch (node.kind) { - case 83: - case 75: - if (hasKind(node.parent, 178)) { + case 84: + case 76: + if (hasKind(node.parent, 183)) { return getIfElseOccurrences(node.parent); } break; - case 89: - if (hasKind(node.parent, 186)) { + case 90: + if (hasKind(node.parent, 191)) { return getReturnOccurrences(node.parent); } break; - case 93: - if (hasKind(node.parent, 190)) { + case 94: + if (hasKind(node.parent, 195)) { return getThrowOccurrences(node.parent); } break; - case 67: - if (hasKind(parent(parent(node)), 191)) { + case 68: + if (hasKind(parent(parent(node)), 196)) { return getTryCatchFinallyOccurrences(node.parent.parent); } break; - case 95: - case 80: - if (hasKind(parent(node), 191)) { + case 96: + case 81: + if (hasKind(parent(node), 196)) { return getTryCatchFinallyOccurrences(node.parent); } break; - case 91: - if (hasKind(node.parent, 188)) { + case 92: + if (hasKind(node.parent, 193)) { return getSwitchCaseDefaultOccurrences(node.parent); } break; - case 66: - case 72: - if (hasKind(parent(parent(parent(node))), 188)) { + case 67: + case 73: + if (hasKind(parent(parent(parent(node))), 193)) { return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); } break; - case 65: - case 70: - if (hasKind(node.parent, 185) || hasKind(node.parent, 184)) { + case 66: + case 71: + if (hasKind(node.parent, 190) || hasKind(node.parent, 189)) { return getBreakOrContinueStatementOccurences(node.parent); } break; - case 81: - if (hasKind(node.parent, 181) || - hasKind(node.parent, 182) || - hasKind(node.parent, 183)) { + case 82: + if (hasKind(node.parent, 186) || + hasKind(node.parent, 187) || + hasKind(node.parent, 188)) { return getLoopBreakContinueOccurrences(node.parent); } break; - case 99: - case 74: - if (hasKind(node.parent, 180) || hasKind(node.parent, 179)) { + case 100: + case 75: + if (hasKind(node.parent, 185) || hasKind(node.parent, 184)) { return getLoopBreakContinueOccurrences(node.parent); } break; - case 113: - if (hasKind(node.parent, 133)) { + case 114: + if (hasKind(node.parent, 135)) { return getConstructorOccurrences(node.parent); } break; - case 115: - case 119: - if (hasKind(node.parent, 134) || hasKind(node.parent, 135)) { + case 116: + case 120: + if (hasKind(node.parent, 136) || hasKind(node.parent, 137)) { return getGetAndSetOccurrences(node.parent); } default: if (ts.isModifier(node.kind) && node.parent && - (ts.isDeclaration(node.parent) || node.parent.kind === 175)) { + (ts.isDeclaration(node.parent) || node.parent.kind === 180)) { return getModifierOccurrences(node.kind, node.parent); } } return undefined; function getIfElseOccurrences(ifStatement) { var keywords = []; - while (hasKind(ifStatement.parent, 178) && ifStatement.parent.elseStatement === ifStatement) { + while (hasKind(ifStatement.parent, 183) && ifStatement.parent.elseStatement === ifStatement) { ifStatement = ifStatement.parent; } while (ifStatement) { var children = ifStatement.getChildren(); - pushKeywordIf(keywords, children[0], 83); - for (var _i = children.length - 1; _i >= 0; _i--) { - if (pushKeywordIf(keywords, children[_i], 75)) { + pushKeywordIf(keywords, children[0], 84); + for (var i = children.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, children[i], 76)) { break; } } - if (!hasKind(ifStatement.elseStatement, 178)) { + if (!hasKind(ifStatement.elseStatement, 183)) { break; } ifStatement = ifStatement.elseStatement; } var result = []; - for (var _i_1 = 0; _i_1 < keywords.length; _i_1++) { - if (keywords[_i_1].kind === 75 && _i_1 < keywords.length - 1) { - var elseKeyword = keywords[_i_1]; - var ifKeyword = keywords[_i_1 + 1]; + for (var i = 0; i < keywords.length; i++) { + if (keywords[i].kind === 76 && i < keywords.length - 1) { + var elseKeyword = keywords[i]; + var ifKeyword = keywords[i + 1]; var shouldHighlightNextKeyword = true; for (var j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { if (!ts.isWhiteSpace(sourceFile.text.charCodeAt(j))) { @@ -29312,25 +31509,25 @@ var ts; textSpan: ts.createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), isWriteAccess: false }); - _i_1++; + i++; continue; } } - result.push(getReferenceEntryFromNode(keywords[_i_1])); + result.push(getReferenceEntryFromNode(keywords[i])); } return result; } function getReturnOccurrences(returnStatement) { var func = ts.getContainingFunction(returnStatement); - if (!(func && hasKind(func.body, 174))) { + if (!(func && hasKind(func.body, 179))) { return undefined; } var keywords = []; ts.forEachReturnStatement(func.body, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 89); + pushKeywordIf(keywords, returnStatement.getFirstToken(), 90); }); ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 93); + pushKeywordIf(keywords, throwStatement.getFirstToken(), 94); }); return ts.map(keywords, getReferenceEntryFromNode); } @@ -29341,11 +31538,11 @@ var ts; } var keywords = []; ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 93); + pushKeywordIf(keywords, throwStatement.getFirstToken(), 94); }); if (ts.isFunctionBlock(owner)) { ts.forEachReturnStatement(owner, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 89); + pushKeywordIf(keywords, returnStatement.getFirstToken(), 90); }); } return ts.map(keywords, getReferenceEntryFromNode); @@ -29355,10 +31552,10 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 190) { + if (node.kind === 195) { statementAccumulator.push(node); } - else if (node.kind === 191) { + else if (node.kind === 196) { var tryStatement = node; if (tryStatement.catchClause) { aggregate(tryStatement.catchClause); @@ -29379,39 +31576,39 @@ var ts; function getThrowStatementOwner(throwStatement) { var child = throwStatement; while (child.parent) { - var _parent = child.parent; - if (ts.isFunctionBlock(_parent) || _parent.kind === 221) { - return _parent; + var parent_9 = child.parent; + if (ts.isFunctionBlock(parent_9) || parent_9.kind === 227) { + return parent_9; } - if (_parent.kind === 191) { - var tryStatement = _parent; + if (parent_9.kind === 196) { + var tryStatement = parent_9; if (tryStatement.tryBlock === child && tryStatement.catchClause) { return child; } } - child = _parent; + child = parent_9; } return undefined; } function getTryCatchFinallyOccurrences(tryStatement) { var keywords = []; - pushKeywordIf(keywords, tryStatement.getFirstToken(), 95); + pushKeywordIf(keywords, tryStatement.getFirstToken(), 96); if (tryStatement.catchClause) { - pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 67); + pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 68); } if (tryStatement.finallyBlock) { - var finallyKeyword = ts.findChildOfKind(tryStatement, 80, sourceFile); - pushKeywordIf(keywords, finallyKeyword, 80); + var finallyKeyword = ts.findChildOfKind(tryStatement, 81, sourceFile); + pushKeywordIf(keywords, finallyKeyword, 81); } return ts.map(keywords, getReferenceEntryFromNode); } function getLoopBreakContinueOccurrences(loopNode) { var keywords = []; - if (pushKeywordIf(keywords, loopNode.getFirstToken(), 81, 99, 74)) { - if (loopNode.kind === 179) { + if (pushKeywordIf(keywords, loopNode.getFirstToken(), 82, 100, 75)) { + if (loopNode.kind === 184) { var loopTokens = loopNode.getChildren(); - for (var _i = loopTokens.length - 1; _i >= 0; _i--) { - if (pushKeywordIf(keywords, loopTokens[_i], 99)) { + for (var i = loopTokens.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, loopTokens[i], 100)) { break; } } @@ -29420,20 +31617,20 @@ var ts; var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); ts.forEach(breaksAndContinues, function (statement) { if (ownsBreakOrContinueStatement(loopNode, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 65, 70); + pushKeywordIf(keywords, statement.getFirstToken(), 66, 71); } }); return ts.map(keywords, getReferenceEntryFromNode); } function getSwitchCaseDefaultOccurrences(switchStatement) { var keywords = []; - pushKeywordIf(keywords, switchStatement.getFirstToken(), 91); + pushKeywordIf(keywords, switchStatement.getFirstToken(), 92); ts.forEach(switchStatement.caseBlock.clauses, function (clause) { - pushKeywordIf(keywords, clause.getFirstToken(), 66, 72); + pushKeywordIf(keywords, clause.getFirstToken(), 67, 73); var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); ts.forEach(breaksAndContinues, function (statement) { if (ownsBreakOrContinueStatement(switchStatement, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 65); + pushKeywordIf(keywords, statement.getFirstToken(), 66); } }); }); @@ -29443,13 +31640,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 181: - case 182: - case 183: - case 179: - case 180: - return getLoopBreakContinueOccurrences(owner); + case 186: + case 187: case 188: + case 184: + case 185: + return getLoopBreakContinueOccurrences(owner); + case 193: return getSwitchCaseDefaultOccurrences(owner); } } @@ -29460,7 +31657,7 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 185 || node.kind === 184) { + if (node.kind === 190 || node.kind === 189) { statementAccumulator.push(node); } else if (!ts.isFunctionLike(node)) { @@ -29474,23 +31671,23 @@ var ts; return actualOwner && actualOwner === owner; } function getBreakOrContinueOwner(statement) { - for (var _node = statement.parent; _node; _node = _node.parent) { - switch (_node.kind) { - case 188: - if (statement.kind === 184) { + for (var node_1 = statement.parent; node_1; node_1 = node_1.parent) { + switch (node_1.kind) { + case 193: + if (statement.kind === 189) { continue; } - case 181: - case 182: - case 183: - case 180: - case 179: - if (!statement.label || isLabeledBy(_node, statement.label.text)) { - return _node; + case 186: + case 187: + case 188: + case 185: + case 184: + if (!statement.label || isLabeledBy(node_1, statement.label.text)) { + return node_1; } break; default: - if (ts.isFunctionLike(_node)) { + if (ts.isFunctionLike(node_1)) { return undefined; } break; @@ -29503,38 +31700,38 @@ var ts; var keywords = []; ts.forEach(declarations, function (declaration) { ts.forEach(declaration.getChildren(), function (token) { - return pushKeywordIf(keywords, token, 113); + return pushKeywordIf(keywords, token, 114); }); }); return ts.map(keywords, getReferenceEntryFromNode); } function getGetAndSetOccurrences(accessorDeclaration) { var keywords = []; - tryPushAccessorKeyword(accessorDeclaration.symbol, 134); - tryPushAccessorKeyword(accessorDeclaration.symbol, 135); + tryPushAccessorKeyword(accessorDeclaration.symbol, 136); + tryPushAccessorKeyword(accessorDeclaration.symbol, 137); return ts.map(keywords, getReferenceEntryFromNode); function tryPushAccessorKeyword(accessorSymbol, accessorKind) { var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); if (accessor) { - ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 115, 119); }); + ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 116, 120); }); } } } function getModifierOccurrences(modifier, declaration) { var container = declaration.parent; - if (declaration.flags & 112) { - if (!(container.kind === 196 || - (declaration.kind === 128 && hasKind(container, 133)))) { + if (ts.isAccessibilityModifier(modifier)) { + if (!(container.kind === 201 || + (declaration.kind === 129 && hasKind(container, 135)))) { return undefined; } } - else if (declaration.flags & 128) { - if (container.kind !== 196) { + else if (modifier === 110) { + if (container.kind !== 201) { return undefined; } } - else if (declaration.flags & (1 | 2)) { - if (!(container.kind === 201 || container.kind === 221)) { + else if (modifier === 78 || modifier === 115) { + if (!(container.kind === 206 || container.kind === 227)) { return undefined; } } @@ -29545,18 +31742,18 @@ var ts; var modifierFlag = getFlagFromModifier(modifier); var nodes; switch (container.kind) { - case 201: - case 221: + case 206: + case 227: nodes = container.statements; break; - case 133: + case 135: nodes = container.parameters.concat(container.parent.members); break; - case 196: + case 201: nodes = container.members; if (modifierFlag & 112) { var constructor = ts.forEach(container.members, function (member) { - return member.kind === 133 && member; + return member.kind === 135 && member; }); if (constructor) { nodes = nodes.concat(constructor.parameters); @@ -29574,17 +31771,17 @@ var ts; return ts.map(keywords, getReferenceEntryFromNode); function getFlagFromModifier(modifier) { switch (modifier) { - case 108: - return 16; - case 106: - return 32; - case 107: - return 64; case 109: + return 16; + case 107: + return 32; + case 108: + return 64; + case 110: return 128; - case 77: + case 78: return 1; - case 114: + case 115: return 2; default: ts.Debug.fail(); @@ -29609,46 +31806,63 @@ var ts; return false; } } + function convertReferences(referenceSymbols) { + if (!referenceSymbols) { + return undefined; + } + var referenceEntries = []; + for (var _i = 0; _i < referenceSymbols.length; _i++) { + var referenceSymbol = referenceSymbols[_i]; + ts.addRange(referenceEntries, referenceSymbol.references); + } + return referenceEntries; + } function findRenameLocations(fileName, position, findInStrings, findInComments) { - return findReferences(fileName, position, findInStrings, findInComments); + var referencedSymbols = findReferencedSymbols(fileName, position, findInStrings, findInComments); + return convertReferences(referencedSymbols); } function getReferencesAtPosition(fileName, position) { - return findReferences(fileName, position, false, false); + var referencedSymbols = findReferencedSymbols(fileName, position, false, false); + return convertReferences(referencedSymbols); } - function findReferences(fileName, position, findInStrings, findInComments) { + function findReferences(fileName, position) { + var referencedSymbols = findReferencedSymbols(fileName, position, false, false); + return ts.filter(referencedSymbols, function (rs) { return !!rs.definition; }); + } + function findReferencedSymbols(fileName, position, findInStrings, findInComments) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); var node = ts.getTouchingPropertyName(sourceFile, position); if (!node) { return undefined; } - if (node.kind !== 64 && + if (node.kind !== 65 && !isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && !isNameOfExternalModuleImportOrDeclaration(node)) { return undefined; } - ts.Debug.assert(node.kind === 64 || node.kind === 7 || node.kind === 8); + ts.Debug.assert(node.kind === 65 || node.kind === 7 || node.kind === 8); return getReferencesForNode(node, program.getSourceFiles(), false, findInStrings, findInComments); } function getReferencesForNode(node, sourceFiles, searchOnlyInCurrentFile, findInStrings, findInComments) { if (isLabelName(node)) { if (isJumpStatementTarget(node)) { var labelDefinition = getTargetLabel(node.parent, node.text); - return labelDefinition ? getLabelReferencesInNode(labelDefinition.parent, labelDefinition) : [getReferenceEntryFromNode(node)]; + return labelDefinition ? getLabelReferencesInNode(labelDefinition.parent, labelDefinition) : undefined; } else { return getLabelReferencesInNode(node.parent, node); } } - if (node.kind === 92) { + if (node.kind === 93) { return getReferencesForThisKeyword(node, sourceFiles); } - if (node.kind === 90) { + if (node.kind === 91) { return getReferencesForSuperKeyword(node); } var symbol = typeInfoResolver.getSymbolAtLocation(node); if (!symbol) { - return [getReferenceEntryFromNode(node)]; + return undefined; } var declarations = symbol.declarations; if (!declarations || !declarations.length) { @@ -29658,15 +31872,16 @@ var ts; var searchMeaning = getIntersectingMeaningFromDeclarations(getMeaningFromLocation(node), declarations); var declaredName = getDeclaredName(symbol, node); var scope = getSymbolScope(symbol); + var symbolToIndex = []; if (scope) { result = []; - getReferencesInNode(scope, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result); + getReferencesInNode(scope, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); } else { if (searchOnlyInCurrentFile) { ts.Debug.assert(sourceFiles.length === 1); result = []; - getReferencesInNode(sourceFiles[0], symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result); + getReferencesInNode(sourceFiles[0], symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); } else { var internedName = getInternedName(symbol, node, declarations); @@ -29675,48 +31890,64 @@ var ts; var nameTable = getNameTable(sourceFile); if (ts.lookUp(nameTable, internedName)) { result = result || []; - getReferencesInNode(sourceFile, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result); + getReferencesInNode(sourceFile, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); } }); } } return result; + function getDefinition(symbol) { + var info = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, node.getSourceFile(), getContainerNode(node), typeInfoResolver, node); + var name = ts.map(info.displayParts, function (p) { return p.text; }).join(""); + var declarations = symbol.declarations; + if (!declarations || declarations.length === 0) { + return undefined; + } + return { + containerKind: "", + containerName: "", + name: name, + kind: info.symbolKind, + fileName: declarations[0].getSourceFile().fileName, + textSpan: ts.createTextSpan(declarations[0].getStart(), 0) + }; + } function isImportOrExportSpecifierName(location) { return location.parent && - (location.parent.kind === 208 || location.parent.kind === 212) && + (location.parent.kind === 213 || location.parent.kind === 217) && location.parent.propertyName === location; } function isImportOrExportSpecifierImportSymbol(symbol) { return (symbol.flags & 8388608) && ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 208 || declaration.kind === 212; + return declaration.kind === 213 || declaration.kind === 217; }); } function getDeclaredName(symbol, location) { - var functionExpression = ts.forEach(symbol.declarations, function (d) { return d.kind === 160 ? d : undefined; }); - var _name; + var functionExpression = ts.forEach(symbol.declarations, function (d) { return d.kind === 162 ? d : undefined; }); + var name; if (functionExpression && functionExpression.name) { - _name = functionExpression.name.text; + name = functionExpression.name.text; } if (isImportOrExportSpecifierName(location)) { return location.getText(); } - _name = typeInfoResolver.symbolToString(symbol); - return stripQuotes(_name); + name = typeInfoResolver.symbolToString(symbol); + return stripQuotes(name); } function getInternedName(symbol, location, declarations) { if (isImportOrExportSpecifierName(location)) { return location.getText(); } - var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 160 ? d : undefined; }); - var _name = functionExpression && functionExpression.name + var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 162 ? d : undefined; }); + var name = functionExpression && functionExpression.name ? functionExpression.name.text : symbol.name; - return stripQuotes(_name); + return stripQuotes(name); } function stripQuotes(name) { - var _length = name.length; - if (_length >= 2 && name.charCodeAt(0) === 34 && name.charCodeAt(_length - 1) === 34) { - return name.substring(1, _length - 1); + var length = name.length; + if (length >= 2 && name.charCodeAt(0) === 34 && name.charCodeAt(length - 1) === 34) { + return name.substring(1, length - 1); } ; return name; @@ -29725,7 +31956,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, 196); + return ts.getAncestor(privateDeclaration, 201); } } if (symbol.flags & 8388608) { @@ -29734,25 +31965,25 @@ var ts; if (symbol.parent || (symbol.flags & 268435456)) { return undefined; } - var _scope = undefined; - var _declarations = symbol.getDeclarations(); - if (_declarations) { - for (var _i = 0, _n = _declarations.length; _i < _n; _i++) { - var declaration = _declarations[_i]; + var scope = undefined; + var declarations = symbol.getDeclarations(); + if (declarations) { + for (var _i = 0; _i < declarations.length; _i++) { + var declaration = declarations[_i]; var container = getContainerNode(declaration); if (!container) { return undefined; } - if (_scope && _scope !== container) { + if (scope && scope !== container) { return undefined; } - if (container.kind === 221 && !ts.isExternalModule(container)) { + if (container.kind === 227 && !ts.isExternalModule(container)) { return undefined; } - _scope = container; + scope = container; } } - return _scope; + return scope; } function getPossibleSymbolReferencePositions(sourceFile, symbolName, start, end) { var positions = []; @@ -29777,27 +32008,35 @@ var ts; return positions; } function getLabelReferencesInNode(container, targetLabel) { - var _result = []; + var references = []; var sourceFile = container.getSourceFile(); var labelName = targetLabel.text; var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, labelName, container.getStart(), container.getEnd()); ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); - var _node = ts.getTouchingWord(sourceFile, position); - if (!_node || _node.getWidth() !== labelName.length) { + var node = ts.getTouchingWord(sourceFile, position); + if (!node || node.getWidth() !== labelName.length) { return; } - if (_node === targetLabel || - (isJumpStatementTarget(_node) && getTargetLabel(_node, labelName) === targetLabel)) { - _result.push(getReferenceEntryFromNode(_node)); + if (node === targetLabel || + (isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel)) { + references.push(getReferenceEntryFromNode(node)); } }); - return _result; + var definition = { + containerKind: "", + containerName: "", + fileName: targetLabel.getSourceFile().fileName, + kind: ScriptElementKind.label, + name: labelName, + textSpan: ts.createTextSpanFromBounds(targetLabel.getStart(), targetLabel.getEnd()) + }; + return [{ definition: definition, references: references }]; } function isValidReferencePosition(node, searchSymbolName) { if (node) { switch (node.kind) { - case 64: + case 65: return node.getWidth() === searchSymbolName.length; case 8: if (isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || @@ -29814,7 +32053,7 @@ var ts; } return false; } - function getReferencesInNode(container, searchSymbol, searchText, searchLocation, searchMeaning, findInStrings, findInComments, result) { + function getReferencesInNode(container, searchSymbol, searchText, searchLocation, searchMeaning, findInStrings, findInComments, result, symbolToIndex) { var sourceFile = container.getSourceFile(); var tripleSlashDirectivePrefixRegex = /^\/\/\/\s*= 0) { - result.push(getReferenceEntryFromNode(referenceSymbolDeclaration.name)); + var referencedSymbol = getReferencedSymbol(shorthandValueSymbol); + referencedSymbol.references.push(getReferenceEntryFromNode(referenceSymbolDeclaration.name)); } } }); } + return; + function getReferencedSymbol(symbol) { + var symbolId = ts.getSymbolId(symbol); + var index = symbolToIndex[symbolId]; + if (index === undefined) { + index = result.length; + symbolToIndex[symbolId] = index; + result.push({ + definition: getDefinition(symbol), + references: [] + }); + } + return result[index]; + } function isInString(position) { var token = ts.getTokenAtPosition(sourceFile, position); return token && token.kind === 8 && position > token.getStart(); @@ -29877,105 +32136,116 @@ var ts; } var staticFlag = 128; switch (searchSpaceNode.kind) { - case 130: - case 129: case 132: case 131: - case 133: case 134: + case 133: case 135: + case 136: + case 137: staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; break; default: return undefined; } - var _result = []; + var references = []; var sourceFile = searchSpaceNode.getSourceFile(); var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "super", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); - var _node = ts.getTouchingWord(sourceFile, position); - if (!_node || _node.kind !== 90) { + var node = ts.getTouchingWord(sourceFile, position); + if (!node || node.kind !== 91) { return; } - var container = ts.getSuperContainer(_node, false); + var container = ts.getSuperContainer(node, false); if (container && (128 & container.flags) === staticFlag && container.parent.symbol === searchSpaceNode.symbol) { - _result.push(getReferenceEntryFromNode(_node)); + references.push(getReferenceEntryFromNode(node)); } }); - return _result; + var definition = getDefinition(searchSpaceNode.symbol); + return [{ definition: definition, references: references }]; } function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles) { var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, false); var staticFlag = 128; switch (searchSpaceNode.kind) { - case 132: - case 131: + case 134: + case 133: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } - case 130: - case 129: - case 133: - case 134: + case 132: + case 131: case 135: + case 136: + case 137: staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; break; - case 221: + case 227: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } - case 195: - case 160: + case 200: + case 162: break; default: return undefined; } - var _result = []; + var references = []; var possiblePositions; - if (searchSpaceNode.kind === 221) { + if (searchSpaceNode.kind === 227) { ts.forEach(sourceFiles, function (sourceFile) { possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); - getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, _result); + getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references); }); } else { var sourceFile = searchSpaceNode.getSourceFile(); possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); - getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, _result); + getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, references); } - return _result; + return [{ + definition: { + containerKind: "", + containerName: "", + fileName: node.getSourceFile().fileName, + kind: ScriptElementKind.variableElement, + name: "this", + textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()) + }, + references: references + }]; function getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, result) { ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); - var _node = ts.getTouchingWord(sourceFile, position); - if (!_node || _node.kind !== 92) { + var node = ts.getTouchingWord(sourceFile, position); + if (!node || node.kind !== 93) { return; } - var container = ts.getThisContainer(_node, false); + var container = ts.getThisContainer(node, false); switch (searchSpaceNode.kind) { - case 160: - case 195: + case 162: + case 200: if (searchSpaceNode.symbol === container.symbol) { - result.push(getReferenceEntryFromNode(_node)); + result.push(getReferenceEntryFromNode(node)); } break; - case 132: - case 131: + case 134: + case 133: if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { - result.push(getReferenceEntryFromNode(_node)); + result.push(getReferenceEntryFromNode(node)); } break; - case 196: + case 201: if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (container.flags & 128) === staticFlag) { - result.push(getReferenceEntryFromNode(_node)); + result.push(getReferenceEntryFromNode(node)); } break; - case 221: - if (container.kind === 221 && !ts.isExternalModule(container)) { - result.push(getReferenceEntryFromNode(_node)); + case 227: + if (container.kind === 227 && !ts.isExternalModule(container)) { + result.push(getReferenceEntryFromNode(node)); } break; } @@ -29983,37 +32253,37 @@ var ts; } } function populateSearchSymbolSet(symbol, location) { - var _result = [symbol]; + var result = [symbol]; if (isImportOrExportSpecifierImportSymbol(symbol)) { - _result.push(typeInfoResolver.getAliasedSymbol(symbol)); + result.push(typeInfoResolver.getAliasedSymbol(symbol)); } if (isNameOfPropertyAssignment(location)) { ts.forEach(getPropertySymbolsFromContextualType(location), function (contextualSymbol) { - _result.push.apply(_result, typeInfoResolver.getRootSymbols(contextualSymbol)); + result.push.apply(result, typeInfoResolver.getRootSymbols(contextualSymbol)); }); var shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(location.parent); if (shorthandValueSymbol) { - _result.push(shorthandValueSymbol); + result.push(shorthandValueSymbol); } } ts.forEach(typeInfoResolver.getRootSymbols(symbol), function (rootSymbol) { if (rootSymbol !== symbol) { - _result.push(rootSymbol); + result.push(rootSymbol); } if (rootSymbol.parent && rootSymbol.parent.flags & (32 | 64)) { - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), _result); + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result); } }); - return _result; + return result; } function getPropertySymbolsFromBaseTypes(symbol, propertyName, result) { if (symbol && symbol.flags & (32 | 64)) { ts.forEach(symbol.getDeclarations(), function (declaration) { - if (declaration.kind === 196) { - getPropertySymbolFromTypeReference(ts.getClassBaseTypeNode(declaration)); - ts.forEach(ts.getClassImplementedTypeNodes(declaration), getPropertySymbolFromTypeReference); + if (declaration.kind === 201) { + getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); + ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); } - else if (declaration.kind === 197) { + else if (declaration.kind === 202) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); } }); @@ -30032,57 +32302,59 @@ var ts; } } } - function isRelatableToSearchSet(searchSymbols, referenceSymbol, referenceLocation) { + function getRelatedSymbol(searchSymbols, referenceSymbol, referenceLocation) { if (searchSymbols.indexOf(referenceSymbol) >= 0) { - return true; + return referenceSymbol; } - if (isImportOrExportSpecifierImportSymbol(referenceSymbol) && - searchSymbols.indexOf(typeInfoResolver.getAliasedSymbol(referenceSymbol)) >= 0) { - return true; + if (isImportOrExportSpecifierImportSymbol(referenceSymbol)) { + var aliasedSymbol = typeInfoResolver.getAliasedSymbol(referenceSymbol); + if (searchSymbols.indexOf(aliasedSymbol) >= 0) { + return aliasedSymbol; + } } if (isNameOfPropertyAssignment(referenceLocation)) { return ts.forEach(getPropertySymbolsFromContextualType(referenceLocation), function (contextualSymbol) { - return ts.forEach(typeInfoResolver.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0; }); + return ts.forEach(typeInfoResolver.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); }); } return ts.forEach(typeInfoResolver.getRootSymbols(referenceSymbol), function (rootSymbol) { if (searchSymbols.indexOf(rootSymbol) >= 0) { - return true; + return rootSymbol; } if (rootSymbol.parent && rootSymbol.parent.flags & (32 | 64)) { - var _result = []; - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), _result); - return ts.forEach(_result, function (s) { return searchSymbols.indexOf(s) >= 0; }); + var result_2 = []; + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result_2); + return ts.forEach(result_2, function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); } - return false; + return undefined; }); } function getPropertySymbolsFromContextualType(node) { if (isNameOfPropertyAssignment(node)) { var objectLiteral = node.parent.parent; var contextualType = typeInfoResolver.getContextualType(objectLiteral); - var _name = node.text; + var name_20 = node.text; if (contextualType) { if (contextualType.flags & 16384) { - var unionProperty = contextualType.getProperty(_name); + var unionProperty = contextualType.getProperty(name_20); if (unionProperty) { return [unionProperty]; } else { - var _result = []; + var result_3 = []; ts.forEach(contextualType.types, function (t) { - var _symbol = t.getProperty(_name); - if (_symbol) { - _result.push(_symbol); + var symbol = t.getProperty(name_20); + if (symbol) { + result_3.push(symbol); } }); - return _result; + return result_3; } } else { - var _symbol = contextualType.getProperty(_name); - if (_symbol) { - return [_symbol]; + var symbol_1 = contextualType.getProperty(name_20); + if (symbol_1) { + return [symbol_1]; } } } @@ -30094,7 +32366,7 @@ var ts; var lastIterationMeaning; do { lastIterationMeaning = meaning; - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; var declarationMeaning = getMeaningFromDeclaration(declaration); if (declarationMeaning & meaning) { @@ -30120,17 +32392,17 @@ var ts; }; } function isWriteAccess(node) { - if (node.kind === 64 && ts.isDeclarationName(node)) { + if (node.kind === 65 && ts.isDeclarationName(node)) { return true; } - var _parent = node.parent; - if (_parent) { - if (_parent.kind === 166 || _parent.kind === 165) { + var parent = node.parent; + if (parent) { + if (parent.kind === 168 || parent.kind === 167) { return true; } - else if (_parent.kind === 167 && _parent.left === node) { - var operator = _parent.operatorToken.kind; - return 52 <= operator && operator <= 63; + else if (parent.kind === 169 && parent.left === node) { + var operator = parent.operatorToken.kind; + return 53 <= operator && operator <= 64; } } return false; @@ -30140,7 +32412,7 @@ var ts; return ts.NavigateTo.getNavigateToItems(program, cancellationToken, searchValue, maxResultCount); } function containErrors(diagnostics) { - return ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === 1; }); + return ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; }); } function getEmitOutput(fileName) { synchronizeHostData(); @@ -30161,33 +32433,33 @@ var ts; } function getMeaningFromDeclaration(node) { switch (node.kind) { - case 128: - case 193: - case 150: - case 130: case 129: - case 218: - case 219: - case 220: + case 198: + case 152: case 132: case 131: - case 133: + case 224: + case 225: + case 226: case 134: + case 133: case 135: - case 195: - case 160: - case 161: - case 217: - return 1; - case 127: - case 197: - case 198: - case 143: - return 2; - case 196: - case 199: - return 1 | 2; + 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 201: + case 204: + return 1 | 2; + case 205: if (node.name.kind === 8) { return 4 | 1; } @@ -30197,52 +32469,72 @@ var ts; else { return 4; } - case 207: + case 212: + case 213: case 208: - case 203: - case 204: case 209: - case 210: + case 214: + case 215: return 1 | 2 | 4; - case 221: + case 227: return 4 | 1; } return 1 | 2 | 4; ts.Debug.fail("Unknown declaration type"); } function isTypeReference(node) { - if (isRightSideOfQualifiedName(node)) { + if (ts.isRightSideOfQualifiedNameOrPropertyAccess(node)) { node = node.parent; } - return node.parent.kind === 139; + return node.parent.kind === 141 || node.parent.kind === 177; } function isNamespaceReference(node) { + return isQualifiedNameNamespaceReference(node) || isPropertyAccessNamespaceReference(node); + } + function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 125) { - while (root.parent && root.parent.kind === 125) + if (root.parent.kind === 155) { + while (root.parent && root.parent.kind === 155) { root = root.parent; + } + isLastClause = root.name === node; + } + if (!isLastClause && root.parent.kind === 177 && root.parent.parent.kind === 222) { + var decl = root.parent.parent.parent; + return (decl.kind === 201 && root.parent.parent.token === 103) || + (decl.kind === 202 && 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) { + root = root.parent; + } isLastClause = root.right === node; } - return root.parent.kind === 139 && !isLastClause; + return root.parent.kind === 141 && !isLastClause; } function isInRightSideOfImport(node) { - while (node.parent.kind === 125) { + while (node.parent.kind === 126) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; } function getMeaningFromRightHandSideOfImportEquals(node) { - ts.Debug.assert(node.kind === 64); - if (node.parent.kind === 125 && + ts.Debug.assert(node.kind === 65); + if (node.parent.kind === 126 && node.parent.right === node && - node.parent.parent.kind === 203) { + node.parent.parent.kind === 208) { return 1 | 2 | 4; } return 4; } function getMeaningFromLocation(node) { - if (node.parent.kind === 209) { + if (node.parent.kind === 214) { return 1 | 2 | 4; } else if (isInRightSideOfImport(node)) { @@ -30276,15 +32568,15 @@ var ts; return; } switch (node.kind) { - case 153: - case 125: + case 155: + case 126: case 8: - case 79: - case 94: - case 88: - case 90: - case 92: - case 64: + case 80: + case 95: + case 89: + case 91: + case 93: + case 65: break; default: return; @@ -30295,7 +32587,7 @@ var ts; nodeForStartPos = nodeForStartPos.parent; } else if (isNameOfModuleDeclaration(nodeForStartPos)) { - if (nodeForStartPos.parent.parent.kind === 200 && + if (nodeForStartPos.parent.parent.kind === 205 && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { nodeForStartPos = nodeForStartPos.parent.parent.name; } @@ -30351,13 +32643,13 @@ var ts; return undefined; function hasValueSideModule(symbol) { return ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 200 && ts.getModuleInstanceState(declaration) == 1; + return declaration.kind === 205 && ts.getModuleInstanceState(declaration) == 1; }); } } function processNode(node) { if (node && ts.textSpanIntersectsWith(span, node.getStart(), node.getWidth())) { - if (node.kind === 64 && node.getWidth() > 0) { + if (node.kind === 65 && node.getWidth() > 0) { var symbol = typeInfoResolver.getSymbolAtLocation(node); if (symbol) { var type = classifySymbol(symbol, getMeaningFromLocation(node)); @@ -30468,17 +32760,17 @@ var ts; } if (ts.isPunctuation(tokenKind)) { if (token) { - if (tokenKind === 52) { - if (token.parent.kind === 193 || - token.parent.kind === 130 || - token.parent.kind === 128) { + if (tokenKind === 53) { + if (token.parent.kind === 198 || + token.parent.kind === 132 || + token.parent.kind === 129) { return ClassificationTypeNames.operator; } } - if (token.parent.kind === 167 || - token.parent.kind === 165 || - token.parent.kind === 166 || - token.parent.kind === 168) { + if (token.parent.kind === 169 || + token.parent.kind === 167 || + token.parent.kind === 168 || + token.parent.kind === 170) { return ClassificationTypeNames.operator; } } @@ -30496,30 +32788,30 @@ var ts; else if (ts.isTemplateLiteralKind(tokenKind)) { return ClassificationTypeNames.stringLiteral; } - else if (tokenKind === 64) { + else if (tokenKind === 65) { if (token) { switch (token.parent.kind) { - case 196: + case 201: if (token.parent.name === token) { return ClassificationTypeNames.className; } return; - case 127: + case 128: if (token.parent.name === token) { return ClassificationTypeNames.typeParameterName; } return; - case 197: + case 202: if (token.parent.name === token) { return ClassificationTypeNames.interfaceName; } return; - case 199: + case 204: if (token.parent.name === token) { return ClassificationTypeNames.enumName; } return; - case 200: + case 205: if (token.parent.name === token) { return ClassificationTypeNames.moduleName; } @@ -30532,7 +32824,7 @@ var ts; function processElement(element) { if (ts.textSpanIntersectsWith(span, element.getFullStart(), element.getFullWidth())) { var children = element.getChildren(); - for (var _i = 0, _n = children.length; _i < _n; _i++) { + for (var _i = 0; _i < children.length; _i++) { var child = children[_i]; if (ts.isToken(child)) { classifyToken(child); @@ -30557,7 +32849,7 @@ var ts; if (matchKind) { var parentElement = token.parent; var childNodes = parentElement.getChildren(sourceFile); - for (var _i = 0, _n = childNodes.length; _i < _n; _i++) { + for (var _i = 0; _i < childNodes.length; _i++) { var current = childNodes[_i]; if (current.kind === matchKind) { var range1 = ts.createTextSpan(token.getStart(sourceFile), token.getWidth(sourceFile)); @@ -30638,9 +32930,9 @@ var ts; continue; } var descriptor = undefined; - for (var _i = 0, n = descriptors.length; _i < n; _i++) { - if (matchArray[_i + firstDescriptorCaptureIndex]) { - descriptor = descriptors[_i]; + for (var i = 0, n = descriptors.length; i < n; i++) { + if (matchArray[i + firstDescriptorCaptureIndex]) { + descriptor = descriptors[i]; } } ts.Debug.assert(descriptor !== undefined); @@ -30660,15 +32952,17 @@ var ts; return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); } function getTodoCommentsRegExp() { + // NOTE: ?: means 'non-capture group'. It allows us to have groups without having to + // filter them out later in the final result array. var singleLineCommentStart = /(?:\/\/+\s*)/.source; var multiLineCommentStart = /(?:\/\*+\s*)/.source; var anyNumberOfSpacesAndAsterixesAtStartOfLine = /(?:^(?:\s|\*)*)/.source; - var _preamble = "(" + anyNumberOfSpacesAndAsterixesAtStartOfLine + "|" + singleLineCommentStart + "|" + multiLineCommentStart + ")"; + var preamble = "(" + anyNumberOfSpacesAndAsterixesAtStartOfLine + "|" + singleLineCommentStart + "|" + multiLineCommentStart + ")"; var literals = "(?:" + ts.map(descriptors, function (d) { return "(" + escapeRegExp(d.text) + ")"; }).join("|") + ")"; var endOfLineOrEndOfComment = /(?:$|\*\/)/.source; var messageRemainder = /(?:.*?)/.source; var messagePortion = "(" + literals + messageRemainder + ")"; - var regExpString = _preamble + messagePortion + endOfLineOrEndOfComment; + var regExpString = preamble + messagePortion + endOfLineOrEndOfComment; return new RegExp(regExpString, "gim"); } function isLetterOrDigit(char) { @@ -30681,17 +32975,17 @@ var ts; synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); var node = ts.getTouchingWord(sourceFile, position); - if (node && node.kind === 64) { + if (node && node.kind === 65) { var symbol = typeInfoResolver.getSymbolAtLocation(node); if (symbol) { var declarations = symbol.getDeclarations(); if (declarations && declarations.length > 0) { var defaultLibFileName = host.getDefaultLibFileName(host.getCompilationSettings()); if (defaultLibFileName) { - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + for (var _i = 0; _i < declarations.length; _i++) { var current = declarations[_i]; - var _sourceFile = current.getSourceFile(); - if (_sourceFile && getCanonicalFileName(ts.normalizePath(_sourceFile.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) { + var sourceFile_1 = current.getSourceFile(); + if (sourceFile_1 && getCanonicalFileName(ts.normalizePath(sourceFile_1.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) { return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library.key)); } } @@ -30738,6 +33032,7 @@ var ts; getQuickInfoAtPosition: getQuickInfoAtPosition, getDefinitionAtPosition: getDefinitionAtPosition, getReferencesAtPosition: getReferencesAtPosition, + findReferences: findReferences, getOccurrencesAtPosition: getOccurrencesAtPosition, getNameOrDottedNameSpan: getNameOrDottedNameSpan, getBreakpointStatementAtPosition: getBreakpointStatementAtPosition, @@ -30771,13 +33066,13 @@ var ts; sourceFile.nameTable = nameTable; function walk(node) { switch (node.kind) { - case 64: + case 65: nameTable[node.text] = node.text; break; case 8: case 7: if (ts.isDeclarationName(node) || - node.parent.kind === 213 || + node.parent.kind === 219 || isArgumentOfElementAccessExpression(node)) { nameTable[node.text] = node.text; } @@ -30790,40 +33085,31 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 154 && + node.parent.kind === 156 && node.parent.argumentExpression === node; } function createClassifier() { - var _scanner = ts.createScanner(2, false); + var scanner = ts.createScanner(2, false); var noRegexTable = []; - noRegexTable[64] = true; + noRegexTable[65] = true; noRegexTable[8] = true; noRegexTable[7] = true; noRegexTable[9] = true; - noRegexTable[92] = true; + noRegexTable[93] = true; noRegexTable[38] = true; noRegexTable[39] = true; noRegexTable[17] = true; noRegexTable[19] = true; noRegexTable[15] = true; - noRegexTable[94] = true; - noRegexTable[79] = true; + noRegexTable[95] = true; + noRegexTable[80] = true; var templateStack = []; - function isAccessibilityModifier(kind) { - switch (kind) { - case 108: - case 106: - case 107: - return true; - } - return false; - } function canFollow(keyword1, keyword2) { - if (isAccessibilityModifier(keyword1)) { - if (keyword2 === 115 || - keyword2 === 119 || - keyword2 === 113 || - keyword2 === 109) { + if (ts.isAccessibilityModifier(keyword1)) { + if (keyword2 === 116 || + keyword2 === 120 || + keyword2 === 114 || + keyword2 === 110) { return true; } return false; @@ -30861,40 +33147,40 @@ var ts; templateStack.push(11); break; } - _scanner.setText(text); + scanner.setText(text); var result = { finalLexState: 0, entries: [] }; var angleBracketStack = 0; do { - token = _scanner.scan(); + token = scanner.scan(); if (!ts.isTrivia(token)) { - if ((token === 36 || token === 56) && !noRegexTable[lastNonTriviaToken]) { - if (_scanner.reScanSlashToken() === 9) { + if ((token === 36 || token === 57) && !noRegexTable[lastNonTriviaToken]) { + if (scanner.reScanSlashToken() === 9) { token = 9; } } else if (lastNonTriviaToken === 20 && isKeyword(token)) { - token = 64; + token = 65; } else if (isKeyword(lastNonTriviaToken) && isKeyword(token) && !canFollow(lastNonTriviaToken, token)) { - token = 64; + token = 65; } - else if (lastNonTriviaToken === 64 && + else if (lastNonTriviaToken === 65 && token === 24) { angleBracketStack++; } else if (token === 25 && angleBracketStack > 0) { angleBracketStack--; } - else if (token === 111 || - token === 120 || - token === 118 || - token === 112 || - token === 121) { + else if (token === 112 || + token === 121 || + token === 119 || + token === 113 || + token === 122) { if (angleBracketStack > 0 && !syntacticClassifierAbsent) { - token = 64; + token = 65; } } else if (token === 11) { @@ -30909,7 +33195,7 @@ var ts; if (templateStack.length > 0) { var lastTemplateStackToken = ts.lastOrUndefined(templateStack); if (lastTemplateStackToken === 11) { - token = _scanner.reScanTemplateToken(); + token = scanner.reScanTemplateToken(); if (token === 13) { templateStack.pop(); } @@ -30929,13 +33215,13 @@ var ts; } while (token !== 1); return result; function processToken() { - var start = _scanner.getTokenPos(); - var end = _scanner.getTextPos(); + var start = scanner.getTokenPos(); + var end = scanner.getTextPos(); addResult(end - start, classFromKind(token)); if (end >= text.length) { if (token === 8) { - var tokenText = _scanner.getTokenText(); - if (_scanner.isUnterminated()) { + var tokenText = scanner.getTokenText(); + if (scanner.isUnterminated()) { var lastCharIndex = tokenText.length - 1; var numBackslashes = 0; while (tokenText.charCodeAt(lastCharIndex - numBackslashes) === 92) { @@ -30950,12 +33236,12 @@ var ts; } } else if (token === 3) { - if (_scanner.isUnterminated()) { + if (scanner.isUnterminated()) { result.finalLexState = 1; } } else if (ts.isTemplateLiteralKind(token)) { - if (_scanner.isUnterminated()) { + if (scanner.isUnterminated()) { if (token === 13) { result.finalLexState = 5; } @@ -30995,8 +33281,8 @@ var ts; case 25: case 26: case 27: + case 87: case 86: - case 85: case 28: case 29: case 30: @@ -31006,18 +33292,18 @@ var ts; case 44: case 48: case 49: - case 62: - case 61: case 63: - case 58: + case 62: + case 64: case 59: case 60: - case 53: + case 61: case 54: case 55: case 56: case 57: - case 52: + case 58: + case 53: case 23: return true; default: @@ -31038,38 +33324,38 @@ var ts; } } function isKeyword(token) { - return token >= 65 && token <= 124; + return token >= 66 && token <= 125; } function classFromKind(token) { if (isKeyword(token)) { - return 1; + return TokenClass.Keyword; } else if (isBinaryExpressionOperatorToken(token) || isPrefixUnaryExpressionOperatorToken(token)) { - return 2; + return TokenClass.Operator; } - else if (token >= 14 && token <= 63) { - return 0; + else if (token >= 14 && token <= 64) { + return TokenClass.Punctuation; } switch (token) { case 7: - return 6; + return TokenClass.NumberLiteral; case 8: - return 7; + return TokenClass.StringLiteral; case 9: - return 8; + return TokenClass.RegExpLiteral; case 6: case 3: case 2: - return 3; + return TokenClass.Comment; case 5: case 4: - return 4; - case 64: + return TokenClass.Whitespace; + case 65: default: if (ts.isTemplateLiteralKind(token)) { - return 7; + return TokenClass.StringLiteral; } - return 5; + return TokenClass.Identifier; } } return { getClassificationsForLine: getClassificationsForLine }; @@ -31087,7 +33373,7 @@ var ts; getNodeConstructor: function (kind) { function Node() { } - var proto = kind === 221 ? new SourceFileObject() : new NodeObject(); + var proto = kind === 227 ? new SourceFileObject() : new NodeObject(); proto.kind = kind; proto.pos = 0; proto.end = 0; @@ -31103,11 +33389,836 @@ var ts; } initializeServices(); })(ts || (ts = {})); +/// +/// +/// +/// +/// +var ts; +(function (ts) { + var server; + (function (server) { + var spaceCache = []; + function generateSpaces(n) { + if (!spaceCache[n]) { + var strBuilder = ""; + for (var i = 0; i < n; i++) { + strBuilder += " "; + } + spaceCache[n] = strBuilder; + } + return spaceCache[n]; + } + server.generateSpaces = generateSpaces; + function compareNumber(a, b) { + if (a < b) { + return -1; + } + else if (a == b) { + return 0; + } + else + return 1; + } + function compareFileStart(a, b) { + if (a.file < b.file) { + return -1; + } + else if (a.file == b.file) { + var n = compareNumber(a.start.line, b.start.line); + if (n == 0) { + return compareNumber(a.start.offset, b.start.offset); + } + else + return n; + } + else { + return 1; + } + } + function formatDiag(fileName, project, diag) { + return { + start: project.compilerService.host.positionToLineOffset(fileName, diag.start), + end: project.compilerService.host.positionToLineOffset(fileName, diag.start + diag.length), + text: ts.flattenDiagnosticMessageText(diag.messageText, "\n") + }; + } + function allEditsBeforePos(edits, pos) { + for (var i = 0, len = edits.length; i < len; i++) { + if (ts.textSpanEnd(edits[i].span) >= pos) { + return false; + } + } + return true; + } + var CommandNames; + (function (CommandNames) { + CommandNames.Change = "change"; + CommandNames.Close = "close"; + CommandNames.Completions = "completions"; + CommandNames.CompletionDetails = "completionEntryDetails"; + CommandNames.SignatureHelp = "signatureHelp"; + CommandNames.Configure = "configure"; + CommandNames.Definition = "definition"; + CommandNames.Format = "format"; + CommandNames.Formatonkey = "formatonkey"; + CommandNames.Geterr = "geterr"; + CommandNames.NavBar = "navbar"; + CommandNames.Navto = "navto"; + CommandNames.Open = "open"; + CommandNames.Quickinfo = "quickinfo"; + CommandNames.References = "references"; + CommandNames.Reload = "reload"; + CommandNames.Rename = "rename"; + CommandNames.Saveto = "saveto"; + CommandNames.Brace = "brace"; + CommandNames.Unknown = "unknown"; + })(CommandNames = server.CommandNames || (server.CommandNames = {})); + var Errors; + (function (Errors) { + Errors.NoProject = new Error("No Project."); + })(Errors || (Errors = {})); + var Session = (function () { + function Session(host, logger) { + var _this = this; + this.host = host; + this.logger = logger; + this.pendingOperation = false; + this.fileHash = {}; + this.nextFileId = 1; + this.changeSeq = 0; + this.projectService = + new server.ProjectService(host, logger, function (eventName, project, fileName) { + _this.handleEvent(eventName, project, fileName); + }); + } + Session.prototype.handleEvent = function (eventName, project, fileName) { + var _this = this; + if (eventName == "context") { + this.projectService.log("got context event, updating diagnostics for" + fileName, "Info"); + this.updateErrorCheck([{ fileName: fileName, project: project }], this.changeSeq, function (n) { return n == _this.changeSeq; }, 100); + } + }; + Session.prototype.logError = function (err, cmd) { + var typedErr = err; + var msg = "Exception on executing command " + cmd; + if (typedErr.message) { + msg += ":\n" + typedErr.message; + if (typedErr.stack) { + msg += "\n" + typedErr.stack; + } + } + this.projectService.log(msg); + }; + Session.prototype.sendLineToClient = function (line) { + this.host.write(line + this.host.newLine); + }; + Session.prototype.send = function (msg) { + var json = JSON.stringify(msg); + if (this.logger.isVerbose()) { + this.logger.info(msg.type + ": " + json); + } + this.sendLineToClient('Content-Length: ' + (1 + Buffer.byteLength(json, 'utf8')) + + '\r\n\r\n' + json); + }; + Session.prototype.event = function (info, eventName) { + var ev = { + seq: 0, + type: "event", + event: eventName, + body: info + }; + this.send(ev); + }; + Session.prototype.response = function (info, cmdName, reqSeq, errorMsg) { + if (reqSeq === void 0) { reqSeq = 0; } + var res = { + seq: 0, + type: "response", + command: cmdName, + request_seq: reqSeq, + success: !errorMsg + }; + if (!errorMsg) { + res.body = info; + } + else { + res.message = errorMsg; + } + this.send(res); + }; + Session.prototype.output = function (body, commandName, requestSequence, errorMessage) { + if (requestSequence === void 0) { requestSequence = 0; } + this.response(body, commandName, requestSequence, errorMessage); + }; + Session.prototype.semanticCheck = function (file, project) { + try { + var diags = project.compilerService.languageService.getSemanticDiagnostics(file); + if (diags) { + var bakedDiags = diags.map(function (diag) { return formatDiag(file, project, diag); }); + this.event({ file: file, diagnostics: bakedDiags }, "semanticDiag"); + } + } + catch (err) { + this.logError(err, "semantic check"); + } + }; + Session.prototype.syntacticCheck = function (file, project) { + try { + var diags = project.compilerService.languageService.getSyntacticDiagnostics(file); + if (diags) { + var bakedDiags = diags.map(function (diag) { return formatDiag(file, project, diag); }); + this.event({ file: file, diagnostics: bakedDiags }, "syntaxDiag"); + } + } + catch (err) { + this.logError(err, "syntactic check"); + } + }; + Session.prototype.errorCheck = function (file, project) { + this.syntacticCheck(file, project); + this.semanticCheck(file, project); + }; + Session.prototype.updateProjectStructure = function (seq, matchSeq, ms) { + var _this = this; + if (ms === void 0) { ms = 1500; } + setTimeout(function () { + if (matchSeq(seq)) { + _this.projectService.updateProjectStructure(); + } + }, ms); + }; + Session.prototype.updateErrorCheck = function (checkList, seq, matchSeq, ms, followMs) { + var _this = this; + if (ms === void 0) { ms = 1500; } + if (followMs === void 0) { followMs = 200; } + if (followMs > ms) { + followMs = ms; + } + if (this.errorTimer) { + clearTimeout(this.errorTimer); + } + if (this.immediateId) { + clearImmediate(this.immediateId); + this.immediateId = undefined; + } + var index = 0; + var checkOne = function () { + if (matchSeq(seq)) { + var checkSpec = checkList[index++]; + if (checkSpec.project.getSourceFileFromName(checkSpec.fileName, true)) { + _this.syntacticCheck(checkSpec.fileName, checkSpec.project); + _this.immediateId = setImmediate(function () { + _this.semanticCheck(checkSpec.fileName, checkSpec.project); + _this.immediateId = undefined; + if (checkList.length > index) { + _this.errorTimer = setTimeout(checkOne, followMs); + } + else { + _this.errorTimer = undefined; + } + }); + } + } + }; + if ((checkList.length > index) && (matchSeq(seq))) { + this.errorTimer = setTimeout(checkOne, ms); + } + }; + Session.prototype.getDefinition = 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.getDefinitionAtPosition(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.getRenameLocations = function (line, offset, fileName, findInComments, findInStrings) { + 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 renameInfo = compilerService.languageService.getRenameInfo(file, position); + if (!renameInfo) { + return undefined; + } + if (!renameInfo.canRename) { + return { + info: renameInfo, + locs: [] + }; + } + var renameLocations = compilerService.languageService.findRenameLocations(file, position, findInStrings, findInComments); + if (!renameLocations) { + return undefined; + } + var bakedRenameLocs = renameLocations.map(function (location) { return ({ + file: location.fileName, + start: compilerService.host.positionToLineOffset(location.fileName, location.textSpan.start), + end: compilerService.host.positionToLineOffset(location.fileName, ts.textSpanEnd(location.textSpan)) + }); }).sort(function (a, b) { + if (a.file < b.file) { + return -1; + } + else if (a.file > b.file) { + return 1; + } + else { + if (a.start.line < b.start.line) { + return 1; + } + else if (a.start.line > b.start.line) { + return -1; + } + else { + return b.start.offset - a.start.offset; + } + } + }).reduce(function (accum, cur) { + var curFileAccum; + if (accum.length > 0) { + curFileAccum = accum[accum.length - 1]; + if (curFileAccum.file != cur.file) { + curFileAccum = undefined; + } + } + if (!curFileAccum) { + curFileAccum = { file: cur.file, locs: [] }; + accum.push(curFileAccum); + } + curFileAccum.locs.push({ start: cur.start, end: cur.end }); + return accum; + }, []); + return { info: renameInfo, locs: bakedRenameLocs }; + }; + Session.prototype.getReferences = 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 references = compilerService.languageService.getReferencesAtPosition(file, position); + if (!references) { + return undefined; + } + var nameInfo = compilerService.languageService.getQuickInfoAtPosition(file, position); + if (!nameInfo) { + return undefined; + } + var displayString = ts.displayPartsToString(nameInfo.displayParts); + var nameSpan = nameInfo.textSpan; + var nameColStart = compilerService.host.positionToLineOffset(file, nameSpan.start).offset; + var nameText = compilerService.host.getScriptSnapshot(file).getText(nameSpan.start, ts.textSpanEnd(nameSpan)); + var bakedRefs = references.map(function (ref) { + var start = compilerService.host.positionToLineOffset(ref.fileName, ref.textSpan.start); + var refLineSpan = compilerService.host.lineToTextSpan(ref.fileName, start.line - 1); + var snap = compilerService.host.getScriptSnapshot(ref.fileName); + var lineText = snap.getText(refLineSpan.start, ts.textSpanEnd(refLineSpan)).replace(/\r|\n/g, ""); + return { + file: ref.fileName, + start: start, + lineText: lineText, + end: compilerService.host.positionToLineOffset(ref.fileName, ts.textSpanEnd(ref.textSpan)), + isWriteAccess: ref.isWriteAccess + }; + }).sort(compareFileStart); + return { + refs: bakedRefs, + symbolName: nameText, + symbolStartOffset: nameColStart, + symbolDisplayString: displayString + }; + }; + Session.prototype.openClientFile = function (fileName) { + var file = ts.normalizePath(fileName); + this.projectService.openClientFile(file); + }; + Session.prototype.getQuickInfo = 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 quickInfo = compilerService.languageService.getQuickInfoAtPosition(file, position); + if (!quickInfo) { + return undefined; + } + var displayString = ts.displayPartsToString(quickInfo.displayParts); + var docString = ts.displayPartsToString(quickInfo.documentation); + return { + kind: quickInfo.kind, + kindModifiers: quickInfo.kindModifiers, + start: compilerService.host.positionToLineOffset(file, quickInfo.textSpan.start), + end: compilerService.host.positionToLineOffset(file, ts.textSpanEnd(quickInfo.textSpan)), + displayString: displayString, + documentation: docString + }; + }; + Session.prototype.getFormattingEditsForRange = function (line, offset, endLine, endOffset, fileName) { + var file = ts.normalizePath(fileName); + var project = this.projectService.getProjectForFile(file); + if (!project) { + throw Errors.NoProject; + } + var compilerService = project.compilerService; + var startPosition = compilerService.host.lineOffsetToPosition(file, line, offset); + var endPosition = compilerService.host.lineOffsetToPosition(file, endLine, endOffset); + var edits = compilerService.languageService.getFormattingEditsForRange(file, startPosition, endPosition, this.projectService.getFormatCodeOptions(file)); + if (!edits) { + return undefined; + } + return edits.map(function (edit) { + return { + start: compilerService.host.positionToLineOffset(file, edit.span.start), + end: compilerService.host.positionToLineOffset(file, ts.textSpanEnd(edit.span)), + newText: edit.newText ? edit.newText : "" + }; + }); + }; + Session.prototype.getFormattingEditsAfterKeystroke = function (line, offset, key, 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 formatOptions = this.projectService.getFormatCodeOptions(file); + var edits = compilerService.languageService.getFormattingEditsAfterKeystroke(file, position, key, formatOptions); + if ((key == "\n") && ((!edits) || (edits.length == 0) || allEditsBeforePos(edits, position))) { + var scriptInfo = compilerService.host.getScriptInfo(file); + if (scriptInfo) { + var lineInfo = scriptInfo.getLineInfo(line); + if (lineInfo && (lineInfo.leaf) && (lineInfo.leaf.text)) { + var lineText = lineInfo.leaf.text; + if (lineText.search("\\S") < 0) { + var editorOptions = { + IndentSize: formatOptions.IndentSize, + TabSize: formatOptions.TabSize, + NewLineCharacter: "\n", + ConvertTabsToSpaces: true + }; + var indentPosition = compilerService.languageService.getIndentationAtPosition(file, position, editorOptions); + for (var i = 0, len = lineText.length; i < len; i++) { + if (lineText.charAt(i) == " ") { + indentPosition--; + } + else { + break; + } + } + if (indentPosition > 0) { + var spaces = generateSpaces(indentPosition); + edits.push({ span: ts.createTextSpanFromBounds(position, position), newText: spaces }); + } + else if (indentPosition < 0) { + edits.push({ + span: ts.createTextSpanFromBounds(position, position - indentPosition), + newText: "" + }); + } + } + } + } + } + if (!edits) { + return undefined; + } + return edits.map(function (edit) { + return { + start: compilerService.host.positionToLineOffset(file, edit.span.start), + end: compilerService.host.positionToLineOffset(file, ts.textSpanEnd(edit.span)), + newText: edit.newText ? edit.newText : "" + }; + }); + }; + Session.prototype.getCompletions = function (line, offset, prefix, fileName) { + if (!prefix) { + prefix = ""; + } + 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 completions = compilerService.languageService.getCompletionsAtPosition(file, position); + if (!completions) { + return undefined; + } + return completions.entries.reduce(function (result, entry) { + if (completions.isMemberCompletion || (entry.name.toLowerCase().indexOf(prefix.toLowerCase()) == 0)) { + result.push(entry); + } + return result; + }, []).sort(function (a, b) { return a.name.localeCompare(b.name); }); + }; + Session.prototype.getCompletionEntryDetails = function (line, offset, entryNames, 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); + return entryNames.reduce(function (accum, entryName) { + var details = compilerService.languageService.getCompletionEntryDetails(file, position, entryName); + if (details) { + accum.push(details); + } + return accum; + }, []); + }; + Session.prototype.getSignatureHelpItems = 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 helpItems = compilerService.languageService.getSignatureHelpItems(file, position); + if (!helpItems) { + return undefined; + } + var span = helpItems.applicableSpan; + var result = { + items: helpItems.items, + applicableSpan: { + start: compilerService.host.positionToLineOffset(file, span.start), + end: compilerService.host.positionToLineOffset(file, span.start + span.length) + }, + selectedItemIndex: helpItems.selectedItemIndex, + argumentIndex: helpItems.argumentIndex, + argumentCount: helpItems.argumentCount + }; + return result; + }; + Session.prototype.getDiagnostics = function (delay, fileNames) { + var _this = this; + var checkList = fileNames.reduce(function (accum, fileName) { + fileName = ts.normalizePath(fileName); + var project = _this.projectService.getProjectForFile(fileName); + if (project) { + accum.push({ fileName: fileName, project: project }); + } + return accum; + }, []); + if (checkList.length > 0) { + this.updateErrorCheck(checkList, this.changeSeq, function (n) { return n == _this.changeSeq; }, delay); + } + }; + Session.prototype.change = function (line, offset, endLine, endOffset, insertString, fileName) { + var _this = this; + var file = ts.normalizePath(fileName); + var project = this.projectService.getProjectForFile(file); + if (project) { + var compilerService = project.compilerService; + var start = compilerService.host.lineOffsetToPosition(file, line, offset); + var end = compilerService.host.lineOffsetToPosition(file, endLine, endOffset); + if (start >= 0) { + compilerService.host.editScript(file, start, end, insertString); + this.changeSeq++; + } + this.updateProjectStructure(this.changeSeq, function (n) { return n == _this.changeSeq; }); + } + }; + Session.prototype.reload = function (fileName, tempFileName, reqSeq) { + var _this = this; + if (reqSeq === void 0) { reqSeq = 0; } + var file = ts.normalizePath(fileName); + var tmpfile = ts.normalizePath(tempFileName); + var project = this.projectService.getProjectForFile(file); + if (project) { + this.changeSeq++; + project.compilerService.host.reloadScript(file, tmpfile, function () { + _this.output(undefined, CommandNames.Reload, reqSeq); + }); + } + }; + Session.prototype.saveToTmp = function (fileName, tempFileName) { + var file = ts.normalizePath(fileName); + var tmpfile = ts.normalizePath(tempFileName); + var project = this.projectService.getProjectForFile(file); + if (project) { + project.compilerService.host.saveTo(file, tmpfile); + } + }; + Session.prototype.closeClientFile = function (fileName) { + var file = ts.normalizePath(fileName); + this.projectService.closeClientFile(file); + }; + Session.prototype.decorateNavigationBarItem = function (project, fileName, items) { + var _this = this; + if (!items) { + return undefined; + } + var compilerService = project.compilerService; + return items.map(function (item) { return ({ + text: item.text, + kind: item.kind, + kindModifiers: item.kindModifiers, + spans: item.spans.map(function (span) { return ({ + start: compilerService.host.positionToLineOffset(fileName, span.start), + end: compilerService.host.positionToLineOffset(fileName, ts.textSpanEnd(span)) + }); }), + childItems: _this.decorateNavigationBarItem(project, fileName, item.childItems) + }); }); + }; + Session.prototype.getNavigationBarItems = function (fileName) { + var file = ts.normalizePath(fileName); + var project = this.projectService.getProjectForFile(file); + if (!project) { + throw Errors.NoProject; + } + var compilerService = project.compilerService; + var items = compilerService.languageService.getNavigationBarItems(file); + if (!items) { + return undefined; + } + return this.decorateNavigationBarItem(project, fileName, items); + }; + Session.prototype.getNavigateToItems = function (searchValue, fileName, maxResultCount) { + var file = ts.normalizePath(fileName); + var project = this.projectService.getProjectForFile(file); + if (!project) { + throw Errors.NoProject; + } + var compilerService = project.compilerService; + var navItems = compilerService.languageService.getNavigateToItems(searchValue, maxResultCount); + if (!navItems) { + return undefined; + } + return navItems.map(function (navItem) { + var start = compilerService.host.positionToLineOffset(navItem.fileName, navItem.textSpan.start); + var end = compilerService.host.positionToLineOffset(navItem.fileName, ts.textSpanEnd(navItem.textSpan)); + var bakedItem = { + name: navItem.name, + kind: navItem.kind, + file: navItem.fileName, + start: start, + end: end + }; + if (navItem.kindModifiers && (navItem.kindModifiers != "")) { + bakedItem.kindModifiers = navItem.kindModifiers; + } + if (navItem.matchKind != 'none') { + bakedItem.matchKind = navItem.matchKind; + } + if (navItem.containerName && (navItem.containerName.length > 0)) { + bakedItem.containerName = navItem.containerName; + } + if (navItem.containerKind && (navItem.containerKind.length > 0)) { + bakedItem.containerKind = navItem.containerKind; + } + return bakedItem; + }); + }; + Session.prototype.getBraceMatching = 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 spans = compilerService.languageService.getBraceMatchingAtPosition(file, position); + if (!spans) { + return undefined; + } + return spans.map(function (span) { return ({ + start: compilerService.host.positionToLineOffset(file, span.start), + end: compilerService.host.positionToLineOffset(file, span.start + span.length) + }); }); + }; + Session.prototype.onMessage = function (message) { + if (this.logger.isVerbose()) { + this.logger.info("request: " + message); + var start = process.hrtime(); + } + try { + var request = JSON.parse(message); + var response; + var errorMessage; + var responseRequired = true; + switch (request.command) { + case CommandNames.Definition: { + var defArgs = request.arguments; + response = this.getDefinition(defArgs.line, defArgs.offset, defArgs.file); + break; + } + case CommandNames.References: { + var refArgs = request.arguments; + response = this.getReferences(refArgs.line, refArgs.offset, refArgs.file); + break; + } + case CommandNames.Rename: { + var renameArgs = request.arguments; + response = this.getRenameLocations(renameArgs.line, renameArgs.offset, renameArgs.file, renameArgs.findInComments, renameArgs.findInStrings); + break; + } + case CommandNames.Open: { + var openArgs = request.arguments; + this.openClientFile(openArgs.file); + responseRequired = false; + break; + } + case CommandNames.Quickinfo: { + var quickinfoArgs = request.arguments; + response = this.getQuickInfo(quickinfoArgs.line, quickinfoArgs.offset, quickinfoArgs.file); + break; + } + case CommandNames.Format: { + var formatArgs = request.arguments; + response = this.getFormattingEditsForRange(formatArgs.line, formatArgs.offset, formatArgs.endLine, formatArgs.endOffset, formatArgs.file); + break; + } + case CommandNames.Formatonkey: { + var formatOnKeyArgs = request.arguments; + response = this.getFormattingEditsAfterKeystroke(formatOnKeyArgs.line, formatOnKeyArgs.offset, formatOnKeyArgs.key, formatOnKeyArgs.file); + break; + } + case CommandNames.Completions: { + var completionsArgs = request.arguments; + response = this.getCompletions(completionsArgs.line, completionsArgs.offset, completionsArgs.prefix, completionsArgs.file); + break; + } + case CommandNames.CompletionDetails: { + var completionDetailsArgs = request.arguments; + response = + this.getCompletionEntryDetails(completionDetailsArgs.line, completionDetailsArgs.offset, completionDetailsArgs.entryNames, completionDetailsArgs.file); + break; + } + case CommandNames.SignatureHelp: { + var signatureHelpArgs = request.arguments; + response = this.getSignatureHelpItems(signatureHelpArgs.line, signatureHelpArgs.offset, signatureHelpArgs.file); + break; + } + case CommandNames.Geterr: { + var geterrArgs = request.arguments; + response = this.getDiagnostics(geterrArgs.delay, geterrArgs.files); + responseRequired = false; + break; + } + case CommandNames.Change: { + var changeArgs = request.arguments; + this.change(changeArgs.line, changeArgs.offset, changeArgs.endLine, changeArgs.endOffset, changeArgs.insertString, changeArgs.file); + responseRequired = false; + break; + } + case CommandNames.Configure: { + var configureArgs = request.arguments; + this.projectService.setHostConfiguration(configureArgs); + this.output(undefined, CommandNames.Configure, request.seq); + responseRequired = false; + break; + } + case CommandNames.Reload: { + var reloadArgs = request.arguments; + this.reload(reloadArgs.file, reloadArgs.tmpfile, request.seq); + responseRequired = false; + break; + } + case CommandNames.Saveto: { + var savetoArgs = request.arguments; + this.saveToTmp(savetoArgs.file, savetoArgs.tmpfile); + responseRequired = false; + break; + } + case CommandNames.Close: { + var closeArgs = request.arguments; + this.closeClientFile(closeArgs.file); + responseRequired = false; + break; + } + case CommandNames.Navto: { + var navtoArgs = request.arguments; + response = this.getNavigateToItems(navtoArgs.searchValue, navtoArgs.file, navtoArgs.maxResultCount); + break; + } + case CommandNames.Brace: { + var braceArguments = request.arguments; + response = this.getBraceMatching(braceArguments.line, braceArguments.offset, braceArguments.file); + break; + } + case CommandNames.NavBar: { + var navBarArgs = request.arguments; + response = this.getNavigationBarItems(navBarArgs.file); + break; + } + default: { + this.projectService.log("Unrecognized JSON command: " + message); + this.output(undefined, CommandNames.Unknown, request.seq, "Unrecognized JSON command: " + request.command); + break; + } + } + if (this.logger.isVerbose()) { + var elapsed = process.hrtime(start); + var seconds = elapsed[0]; + var nanoseconds = elapsed[1]; + var elapsedMs = ((1e9 * seconds) + nanoseconds) / 1000000.0; + var leader = "Elapsed time (in milliseconds)"; + if (!responseRequired) { + leader = "Async elapsed time (in milliseconds)"; + } + this.logger.msg(leader + ": " + elapsedMs.toFixed(4).toString(), "Perf"); + } + if (response) { + this.output(response, request.command, request.seq); + } + else if (responseRequired) { + this.output(undefined, request.command, request.seq, "No content available."); + } + } + catch (err) { + if (err instanceof ts.OperationCanceledException) { + } + this.logError(err, message); + this.output(undefined, request ? request.command : CommandNames.Unknown, request ? request.seq : 0, "Error processing request. " + err.message); + } + }; + return Session; + })(); + server.Session = Session; + })(server = ts.server || (ts.server = {})); +})(ts || (ts = {})); +/// +/// +/// +/// +/// var ts; (function (ts) { var server; (function (server) { var lineCollectionCapacity = 4; + function mergeFormatOptions(formatCodeOptions, formatOptions) { + var hasOwnProperty = Object.prototype.hasOwnProperty; + Object.keys(formatOptions).forEach(function (key) { + var codeKey = key.charAt(0).toUpperCase() + key.substring(1); + if (hasOwnProperty.call(formatCodeOptions, codeKey)) { + formatCodeOptions[codeKey] = formatOptions[key]; + } + }); + } var ScriptInfo = (function () { function ScriptInfo(host, fileName, content, isOpen) { if (isOpen === void 0) { isOpen = false; } @@ -31116,8 +34227,14 @@ var ts; this.content = content; this.isOpen = isOpen; this.children = []; + this.formatCodeOptions = ts.clone(CompilerService.defaultFormatCodeOptions); this.svc = ScriptVersionCache.fromString(content); } + ScriptInfo.prototype.setFormatOptions = function (formatOptions) { + if (formatOptions) { + mergeFormatOptions(this.formatCodeOptions, formatOptions); + } + }; ScriptInfo.prototype.close = function () { this.isOpen = false; }; @@ -31258,21 +34375,21 @@ var ts; } else { var nextLineInfo = index.lineNumberToInfo(line + 2); - len = nextLineInfo.col - lineInfo.col; + len = nextLineInfo.offset - lineInfo.offset; } - return ts.createTextSpan(lineInfo.col, len); + return ts.createTextSpan(lineInfo.offset, len); }; - LSHost.prototype.lineColToPosition = function (filename, line, col) { + LSHost.prototype.lineOffsetToPosition = function (filename, line, offset) { var script = this.filenameToScript[filename]; var index = script.snap().index; var lineInfo = index.lineNumberToInfo(line); - return (lineInfo.col + col - 1); + return (lineInfo.offset + offset - 1); }; - LSHost.prototype.positionToLineCol = function (filename, position) { + LSHost.prototype.positionToLineOffset = function (filename, position) { var script = this.filenameToScript[filename]; var index = script.snap().index; - var lineCol = index.charOffsetToLineNumberAndPos(position); - return { line: lineCol.line, col: lineCol.col + 1 }; + var lineOffset = index.charOffsetToLineNumberAndPos(position); + return { line: lineOffset.line, offset: lineOffset.offset + 1 }; }; return LSHost; })(); @@ -31301,12 +34418,21 @@ var ts; } } var Project = (function () { - function Project(projectService) { + function Project(projectService, projectOptions) { this.projectService = projectService; + this.projectOptions = projectOptions; this.filenameToSourceFile = {}; this.updateGraphSeq = 0; - this.compilerService = new CompilerService(this); + this.openRefCount = 0; + this.compilerService = new CompilerService(this, projectOptions && projectOptions.compilerOptions); } + Project.prototype.addOpenRef = function () { + this.openRefCount++; + }; + Project.prototype.deleteOpenRef = function () { + this.openRefCount--; + return this.openRefCount; + }; Project.prototype.openReferencedFile = function (filename) { return this.projectService.openFile(filename, false); }; @@ -31321,6 +34447,9 @@ var ts; } } }; + Project.prototype.isRoot = function (info) { + return this.compilerService.host.roots.some(function (root) { return root === info; }); + }; Project.prototype.removeReferencedFile = function (info) { this.compilerService.host.removeReferencedFile(info); this.updateGraph(); @@ -31378,9 +34507,27 @@ var ts; this.eventHandler = eventHandler; this.filenameToScriptInfo = {}; this.openFileRoots = []; - this.openFilesReferenced = []; this.inferredProjects = []; + this.configuredProjects = []; + this.openFilesReferenced = []; + this.openFileRootsConfigured = []; + this.addDefaultHostConfiguration(); } + ProjectService.prototype.addDefaultHostConfiguration = function () { + this.hostConfiguration = { + formatCodeOptions: ts.clone(CompilerService.defaultFormatCodeOptions), + hostInfo: "Unknown host" + }; + }; + ProjectService.prototype.getFormatCodeOptions = function (file) { + if (file) { + var info = this.filenameToScriptInfo[file]; + if (info) { + return info.formatCodeOptions; + } + } + return this.hostConfiguration.formatCodeOptions; + }; ProjectService.prototype.watchedFileChanged = function (fileName) { var info = this.filenameToScriptInfo[fileName]; if (!info) { @@ -31399,6 +34546,25 @@ var ts; if (type === void 0) { type = "Err"; } this.psLogger.msg(msg, type); }; + ProjectService.prototype.setHostConfiguration = function (args) { + if (args.file) { + var info = this.filenameToScriptInfo[args.file]; + if (info) { + info.setFormatOptions(args.formatOptions); + this.log("Host configuration update for file " + args.file); + } + } + else { + if (args.hostInfo !== undefined) { + this.hostConfiguration.hostInfo = args.hostInfo; + this.log("Host information " + args.hostInfo, "Info"); + } + if (args.formatOptions) { + mergeFormatOptions(this.hostConfiguration.formatCodeOptions, args.formatOptions); + this.log("Format host information updated", "Info"); + } + } + }; ProjectService.prototype.closeLog = function () { this.psLogger.close(); }; @@ -31436,35 +34602,61 @@ var ts; } this.printProjects(); }; + ProjectService.prototype.updateConfiguredProjectList = function () { + var configuredProjects = []; + for (var i = 0, len = this.configuredProjects.length; i < len; i++) { + if (this.configuredProjects[i].openRefCount > 0) { + configuredProjects.push(this.configuredProjects[i]); + } + } + this.configuredProjects = configuredProjects; + }; + ProjectService.prototype.setConfiguredProjectRoot = function (info) { + for (var i = 0, len = this.configuredProjects.length; i < len; i++) { + var configuredProject = this.configuredProjects[i]; + if (configuredProject.isRoot(info)) { + info.defaultProject = configuredProject; + configuredProject.addOpenRef(); + return true; + } + } + return false; + }; ProjectService.prototype.addOpenFile = function (info) { - this.findReferencingProjects(info); - if (info.defaultProject) { - this.openFilesReferenced.push(info); + if (this.setConfiguredProjectRoot(info)) { + this.openFileRootsConfigured.push(info); } else { - info.defaultProject = this.createInferredProject(info); - var openFileRoots = []; - for (var i = 0, len = this.openFileRoots.length; i < len; i++) { - var r = this.openFileRoots[i]; - if (info.defaultProject.getSourceFile(r)) { - this.inferredProjects = - copyListRemovingItem(r.defaultProject, this.inferredProjects); - this.openFilesReferenced.push(r); - r.defaultProject = info.defaultProject; + this.findReferencingProjects(info); + if (info.defaultProject) { + this.openFilesReferenced.push(info); + } + else { + info.defaultProject = this.createInferredProject(info); + var openFileRoots = []; + for (var i = 0, len = this.openFileRoots.length; i < len; i++) { + var r = this.openFileRoots[i]; + if (info.defaultProject.getSourceFile(r)) { + this.inferredProjects = + copyListRemovingItem(r.defaultProject, this.inferredProjects); + this.openFilesReferenced.push(r); + r.defaultProject = info.defaultProject; + } + else { + openFileRoots.push(r); + } } - else { - openFileRoots.push(r); - } + this.openFileRoots = openFileRoots; + this.openFileRoots.push(info); } - this.openFileRoots = openFileRoots; - this.openFileRoots.push(info); } + this.updateConfiguredProjectList(); }; ProjectService.prototype.closeOpenFile = function (info) { var openFileRoots = []; var removedProject; for (var i = 0, len = this.openFileRoots.length; i < len; i++) { - if (info == this.openFileRoots[i]) { + if (info === this.openFileRoots[i]) { removedProject = info.defaultProject; } else { @@ -31472,8 +34664,27 @@ var ts; } } this.openFileRoots = openFileRoots; + if (!removedProject) { + var openFileRootsConfigured = []; + for (var i = 0, len = this.openFileRootsConfigured.length; i < len; i++) { + if (info === this.openFileRootsConfigured[i]) { + if (info.defaultProject.deleteOpenRef() === 0) { + removedProject = info.defaultProject; + } + } + else { + openFileRootsConfigured.push(this.openFileRootsConfigured[i]); + } + } + this.openFileRootsConfigured = openFileRootsConfigured; + } if (removedProject) { - this.inferredProjects = copyListRemovingItem(removedProject, this.inferredProjects); + if (removedProject.isConfiguredProject()) { + this.configuredProjects = copyListRemovingItem(removedProject, this.configuredProjects); + } + else { + this.inferredProjects = copyListRemovingItem(removedProject, this.inferredProjects); + } var openFilesReferenced = []; var orphanFiles = []; for (var i = 0, len = this.openFilesReferenced.length; i < len; i++) { @@ -31500,14 +34711,22 @@ var ts; var referencingProjects = []; info.defaultProject = undefined; for (var i = 0, len = this.inferredProjects.length; i < len; i++) { - this.inferredProjects[i].updateGraph(); - if (this.inferredProjects[i] != excludedProject) { - if (this.inferredProjects[i].getSourceFile(info)) { - info.defaultProject = this.inferredProjects[i]; - referencingProjects.push(this.inferredProjects[i]); + var inferredProject = this.inferredProjects[i]; + inferredProject.updateGraph(); + if (inferredProject != excludedProject) { + if (inferredProject.getSourceFile(info)) { + info.defaultProject = inferredProject; + referencingProjects.push(inferredProject); } } } + for (var i = 0, len = this.configuredProjects.length; i < len; i++) { + var configuredProject = this.configuredProjects[i]; + configuredProject.updateGraph(); + if (configuredProject.getSourceFile(info)) { + info.defaultProject = configuredProject; + } + } return referencingProjects; }; ProjectService.prototype.updateProjectStructure = function () { @@ -31553,7 +34772,6 @@ var ts; }; ProjectService.prototype.openFile = function (fileName, openedByClient) { var _this = this; - if (openedByClient === void 0) { openedByClient = false; } fileName = ts.normalizePath(fileName); var info = ts.lookUp(this.filenameToScriptInfo, fileName); if (!info) { @@ -31567,6 +34785,7 @@ var ts; } } if (content !== undefined) { + var indentSize; info = new ScriptInfo(this.host, fileName, content, openedByClient); this.filenameToScriptInfo[fileName] = info; if (!info.isOpen) { @@ -31581,8 +34800,44 @@ var ts; } return info; }; - ProjectService.prototype.openClientFile = function (filename) { - var info = this.openFile(filename, true); + ProjectService.prototype.findConfigFile = function (searchPath) { + while (true) { + var fileName = ts.combinePaths(searchPath, "tsconfig.json"); + if (ts.sys.fileExists(fileName)) { + return fileName; + } + var parentPath = ts.getDirectoryPath(searchPath); + if (parentPath === searchPath) { + break; + } + searchPath = parentPath; + } + return undefined; + }; + ProjectService.prototype.openClientFile = function (fileName) { + var searchPath = ts.normalizePath(ts.getDirectoryPath(fileName)); + this.log("Search path: " + searchPath, "Info"); + var configFileName = this.findConfigFile(searchPath); + if (configFileName) { + this.log("Config file name: " + configFileName, "Info"); + } + else { + this.log("no config file"); + } + if (configFileName) { + configFileName = getAbsolutePath(configFileName, searchPath); + } + if (configFileName && (!this.configProjectIsActive(configFileName))) { + var configResult = this.openConfigFile(configFileName, fileName); + if (!configResult.success) { + this.log("Error opening config file " + configFileName + " " + configResult.errorMsg); + } + else { + this.log("Opened configuration file " + configFileName, "Info"); + this.configuredProjects.push(configResult.project); + } + } + var info = this.openFile(fileName, true); this.addOpenFile(info); this.printProjects(); return info; @@ -31595,18 +34850,6 @@ var ts; } this.printProjects(); }; - ProjectService.prototype.getProjectsReferencingFile = function (filename) { - var scriptInfo = ts.lookUp(this.filenameToScriptInfo, filename); - if (scriptInfo) { - var projects = []; - for (var i = 0, len = this.inferredProjects.length; i < len; i++) { - if (this.inferredProjects[i].getSourceFile(scriptInfo)) { - projects.push(this.inferredProjects[i]); - } - } - return projects; - } - }; ProjectService.prototype.getProjectForFile = function (filename) { var scriptInfo = ts.lookUp(this.filenameToScriptInfo, filename); if (scriptInfo) { @@ -31618,9 +34861,9 @@ var ts; if (scriptInfo) { this.psLogger.startGroup(); this.psLogger.info("Projects for " + filename); - var projects = this.getProjectsReferencingFile(filename); + var projects = this.findReferencingProjects(scriptInfo); for (var i = 0, len = projects.length; i < len; i++) { - this.psLogger.info("Inferred Project " + i.toString()); + this.psLogger.info("Project " + i.toString()); } this.psLogger.endGroup(); } @@ -31637,17 +34880,40 @@ var ts; this.psLogger.info(project.filesToString()); this.psLogger.info("-----------------------------------------------"); } - this.psLogger.info("Open file roots: "); + for (var i = 0, len = this.configuredProjects.length; i < len; i++) { + var project = this.configuredProjects[i]; + project.updateGraph(); + this.psLogger.info("Project (configured) " + (i + this.inferredProjects.length).toString()); + this.psLogger.info(project.filesToString()); + this.psLogger.info("-----------------------------------------------"); + } + this.psLogger.info("Open file roots of inferred projects: "); for (var i = 0, len = this.openFileRoots.length; i < len; i++) { this.psLogger.info(this.openFileRoots[i].fileName); } - this.psLogger.info("Open files referenced: "); + this.psLogger.info("Open files referenced by inferred or configured projects: "); for (var i = 0, len = this.openFilesReferenced.length; i < len; i++) { - this.psLogger.info(this.openFilesReferenced[i].fileName); + var fileInfo = this.openFilesReferenced[i].fileName; + if (this.openFilesReferenced[i].defaultProject.isConfiguredProject()) { + fileInfo += " (configured)"; + } + this.psLogger.info(fileInfo); + } + this.psLogger.info("Open file roots of configured projects: "); + for (var i = 0, len = this.openFileRootsConfigured.length; i < len; i++) { + this.psLogger.info(this.openFileRootsConfigured[i].fileName); } this.psLogger.endGroup(); }; - ProjectService.prototype.openConfigFile = function (configFilename) { + ProjectService.prototype.configProjectIsActive = function (fileName) { + for (var i = 0, len = this.configuredProjects.length; i < len; i++) { + if (this.configuredProjects[i].projectFilename == fileName) { + return true; + } + } + return false; + }; + ProjectService.prototype.openConfigFile = function (configFilename, clientFileName) { configFilename = ts.normalizePath(configFilename); var dirPath = ts.getDirectoryPath(configFilename); var rawConfig = ts.readConfigFile(configFilename); @@ -31655,32 +34921,27 @@ var ts; return { errorMsg: "tsconfig syntax error" }; } else { - var parsedCommandLine = ts.parseConfigFile(rawConfig); - if (parsedCommandLine.errors) { + var parsedCommandLine = ts.parseConfigFile(rawConfig, dirPath); + if (parsedCommandLine.errors && (parsedCommandLine.errors.length > 0)) { return { errorMsg: "tsconfig option errors" }; } else if (parsedCommandLine.fileNames) { - var proj = this.createProject(configFilename); + var 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]; - var normRootFilename = ts.normalizePath(rootFilename); - normRootFilename = getAbsolutePath(normRootFilename, dirPath); - if (this.host.fileExists(normRootFilename)) { - var info = this.openFile(normRootFilename); + if (ts.sys.fileExists(rootFilename)) { + var info = this.openFile(rootFilename, clientFileName == rootFilename); proj.addRoot(info); } else { return { errorMsg: "specified file " + rootFilename + " not found" }; } } - var projectOptions = { - files: parsedCommandLine.fileNames, - compilerOptions: parsedCommandLine.options - }; - if (rawConfig.formatCodeOptions) { - projectOptions.formatCodeOptions = rawConfig.formatCodeOptions; - } - proj.setProjectOptions(projectOptions); + proj.finishGraph(); return { success: true, project: proj }; } else { @@ -31688,23 +34949,25 @@ var ts; } } }; - ProjectService.prototype.createProject = function (projectFilename) { - var eproj = new Project(this); - eproj.projectFilename = projectFilename; - return eproj; + ProjectService.prototype.createProject = function (projectFilename, projectOptions) { + var project = new Project(this, projectOptions); + project.projectFilename = projectFilename; + return project; }; return ProjectService; })(); server.ProjectService = ProjectService; var CompilerService = (function () { - function CompilerService(project) { + function CompilerService(project, opt) { this.project = project; - this.settings = ts.getDefaultCompilerOptions(); this.documentRegistry = ts.createDocumentRegistry(); - this.formatCodeOptions = CompilerService.defaultFormatCodeOptions; this.host = new LSHost(project.projectService.host, project); - this.settings.target = 1; - this.host.setCompilationSettings(this.settings); + if (opt) { + this.setCompilerOptions(opt); + } + else { + this.setCompilerOptions(ts.getDefaultCompilerOptions()); + } this.languageService = ts.createLanguageService(this.host, this.documentRegistry); this.classifier = ts.createClassifier(); } @@ -31756,7 +35019,7 @@ var ts; _super.call(this); this.lineIndex = new LineIndex(); this.endBranch = []; - this.state = 2; + this.state = CharRangeSection.Entire; this.initialText = ""; this.trailingText = ""; this.suppressTrailingText = false; @@ -31842,15 +35105,15 @@ var ts; }; EditWalker.prototype.post = function (relativeStart, relativeLength, lineCollection, parent, nodeType) { if (lineCollection == this.lineCollectionAtBranch) { - this.state = 4; + this.state = CharRangeSection.End; } this.stack.length--; return undefined; }; EditWalker.prototype.pre = function (relativeStart, relativeLength, lineCollection, parent, nodeType) { var currentNode = this.stack[this.stack.length - 1]; - if ((this.state == 2) && (nodeType == 1)) { - this.state = 1; + if ((this.state == CharRangeSection.Entire) && (nodeType == CharRangeSection.Start)) { + this.state = CharRangeSection.Start; this.branchNode = currentNode; this.lineCollectionAtBranch = lineCollection; } @@ -31863,14 +35126,14 @@ var ts; return new LineNode(); } switch (nodeType) { - case 0: + case CharRangeSection.PreStart: this.goSubtree = false; - if (this.state != 4) { + if (this.state != CharRangeSection.End) { currentNode.add(lineCollection); } break; - case 1: - if (this.state == 4) { + case CharRangeSection.Start: + if (this.state == CharRangeSection.End) { this.goSubtree = false; } else { @@ -31879,8 +35142,8 @@ var ts; this.startPath[this.startPath.length] = child; } break; - case 2: - if (this.state != 4) { + case CharRangeSection.Entire: + if (this.state != CharRangeSection.End) { child = fresh(lineCollection); currentNode.add(child); this.startPath[this.startPath.length] = child; @@ -31893,11 +35156,11 @@ var ts; } } break; - case 3: + case CharRangeSection.Mid: this.goSubtree = false; break; - case 4: - if (this.state != 4) { + case CharRangeSection.End: + if (this.state != CharRangeSection.End) { this.goSubtree = false; } else { @@ -31908,9 +35171,9 @@ var ts; } } break; - case 5: + case CharRangeSection.PostEnd: this.goSubtree = false; - if (this.state != 1) { + if (this.state != CharRangeSection.Start) { currentNode.add(lineCollection); } break; @@ -31921,10 +35184,10 @@ var ts; return lineCollection; }; EditWalker.prototype.leaf = function (relativeStart, relativeLength, ll) { - if (this.state == 1) { + if (this.state == CharRangeSection.Start) { this.initialText = ll.text.substring(0, relativeStart); } - else if (this.state == 2) { + else if (this.state == CharRangeSection.Entire) { this.initialText = ll.text.substring(0, relativeStart); this.trailingText = ll.text.substring(relativeStart + relativeLength); } @@ -32074,7 +35337,7 @@ var ts; LineIndexSnapshot.prototype.getLineMapper = function () { var _this = this; return (function (line) { - return _this.index.lineNumberToInfo(line).col; + return _this.index.lineNumberToInfo(line).offset; }); }; LineIndexSnapshot.prototype.getTextChangeRangeSinceVersion = function (scriptVersion) { @@ -32108,7 +35371,7 @@ var ts; else { return { line: lineNumber, - col: this.root.charCount() + offset: this.root.charCount() }; } }; @@ -32187,7 +35450,7 @@ var ts; else if (deleteLength > 0) { var e = pos + deleteLength; var lineInfo = this.charOffsetToLineNumberAndPos(e); - if ((lineInfo && (lineInfo.col == 0))) { + if ((lineInfo && (lineInfo.offset == 0))) { deleteLength += lineInfo.text.length; if (newText) { newText = newText + lineInfo.text; @@ -32304,25 +35567,25 @@ var ts; var childCharCount = child.charCount(); var adjustedStart = rangeStart; while (adjustedStart >= childCharCount) { - this.skipChild(adjustedStart, rangeLength, childIndex, walkFns, 0); + this.skipChild(adjustedStart, rangeLength, childIndex, walkFns, CharRangeSection.PreStart); adjustedStart -= childCharCount; child = this.children[++childIndex]; childCharCount = child.charCount(); } if ((adjustedStart + rangeLength) <= childCharCount) { - if (this.execWalk(adjustedStart, rangeLength, walkFns, childIndex, 2)) { + if (this.execWalk(adjustedStart, rangeLength, walkFns, childIndex, CharRangeSection.Entire)) { return; } } else { - if (this.execWalk(adjustedStart, childCharCount - adjustedStart, walkFns, childIndex, 1)) { + if (this.execWalk(adjustedStart, childCharCount - adjustedStart, walkFns, childIndex, CharRangeSection.Start)) { return; } var adjustedLength = rangeLength - (childCharCount - adjustedStart); child = this.children[++childIndex]; childCharCount = child.charCount(); while (adjustedLength > childCharCount) { - if (this.execWalk(0, childCharCount, walkFns, childIndex, 3)) { + if (this.execWalk(0, childCharCount, walkFns, childIndex, CharRangeSection.Mid)) { return; } adjustedLength -= childCharCount; @@ -32330,7 +35593,7 @@ var ts; childCharCount = child.charCount(); } if (adjustedLength > 0) { - if (this.execWalk(0, adjustedLength, walkFns, childIndex, 4)) { + if (this.execWalk(0, adjustedLength, walkFns, childIndex, CharRangeSection.End)) { return; } } @@ -32339,7 +35602,7 @@ var ts; var clen = this.children.length; if (childIndex < (clen - 1)) { for (var ej = childIndex + 1; ej < clen; ej++) { - this.skipChild(0, 0, ej, walkFns, 5); + this.skipChild(0, 0, ej, walkFns, CharRangeSection.PostEnd); } } } @@ -32349,14 +35612,14 @@ var ts; if (!childInfo.child) { return { line: lineNumber, - col: charOffset + offset: charOffset }; } else if (childInfo.childIndex < this.children.length) { if (childInfo.child.isLeaf()) { return { line: childInfo.lineNumber, - col: childInfo.charOffset, + offset: childInfo.charOffset, text: (childInfo.child).text, leaf: (childInfo.child) }; @@ -32368,7 +35631,7 @@ var ts; } else { var lineInfo = this.lineNumberToInfo(this.lineCount(), 0); - return { line: this.lineCount(), col: lineInfo.leaf.charCount() }; + return { line: this.lineCount(), offset: lineInfo.leaf.charCount() }; } }; LineNode.prototype.lineNumberToInfo = function (lineNumber, charOffset) { @@ -32376,13 +35639,13 @@ var ts; if (!childInfo.child) { return { line: lineNumber, - col: charOffset + offset: charOffset }; } else if (childInfo.child.isLeaf()) { return { line: lineNumber, - col: childInfo.charOffset, + offset: childInfo.charOffset, text: (childInfo.child).text, leaf: (childInfo.child) }; @@ -32551,769 +35814,8 @@ var ts; })(); })(server = ts.server || (ts.server = {})); })(ts || (ts = {})); -var ts; -(function (ts) { - var server; - (function (server) { - var spaceCache = [" ", " ", " ", " "]; - function generateSpaces(n) { - if (!spaceCache[n]) { - var strBuilder = ""; - for (var i = 0; i < n; i++) { - strBuilder += " "; - } - spaceCache[n] = strBuilder; - } - return spaceCache[n]; - } - function compareNumber(a, b) { - if (a < b) { - return -1; - } - else if (a == b) { - return 0; - } - else - return 1; - } - function compareFileStart(a, b) { - if (a.file < b.file) { - return -1; - } - else if (a.file == b.file) { - var n = compareNumber(a.start.line, b.start.line); - if (n == 0) { - return compareNumber(a.start.col, b.start.col); - } - else - return n; - } - else { - return 1; - } - } - function formatDiag(fileName, project, diag) { - return { - start: project.compilerService.host.positionToLineCol(fileName, diag.start), - end: project.compilerService.host.positionToLineCol(fileName, diag.start + diag.length), - text: ts.flattenDiagnosticMessageText(diag.messageText, "\n") - }; - } - function allEditsBeforePos(edits, pos) { - for (var i = 0, len = edits.length; i < len; i++) { - if (ts.textSpanEnd(edits[i].span) >= pos) { - return false; - } - } - return true; - } - var CommandNames; - (function (CommandNames) { - CommandNames.Change = "change"; - CommandNames.Close = "close"; - CommandNames.Completions = "completions"; - CommandNames.CompletionDetails = "completionEntryDetails"; - CommandNames.Definition = "definition"; - CommandNames.Format = "format"; - CommandNames.Formatonkey = "formatonkey"; - CommandNames.Geterr = "geterr"; - CommandNames.NavBar = "navbar"; - CommandNames.Navto = "navto"; - CommandNames.Open = "open"; - CommandNames.Quickinfo = "quickinfo"; - CommandNames.References = "references"; - CommandNames.Reload = "reload"; - CommandNames.Rename = "rename"; - CommandNames.Saveto = "saveto"; - CommandNames.Brace = "brace"; - CommandNames.Unknown = "unknown"; - })(CommandNames = server.CommandNames || (server.CommandNames = {})); - var Errors; - (function (Errors) { - Errors.NoProject = new Error("No Project."); - })(Errors || (Errors = {})); - var Session = (function () { - function Session(host, logger) { - var _this = this; - this.host = host; - this.logger = logger; - this.pendingOperation = false; - this.fileHash = {}; - this.nextFileId = 1; - this.changeSeq = 0; - this.projectService = - new server.ProjectService(host, logger, function (eventName, project, fileName) { - _this.handleEvent(eventName, project, fileName); - }); - } - Session.prototype.handleEvent = function (eventName, project, fileName) { - var _this = this; - if (eventName == "context") { - this.projectService.log("got context event, updating diagnostics for" + fileName, "Info"); - this.updateErrorCheck([{ fileName: fileName, project: project }], this.changeSeq, function (n) { return n == _this.changeSeq; }, 100); - } - }; - Session.prototype.logError = function (err, cmd) { - var typedErr = err; - var msg = "Exception on executing command " + cmd; - if (typedErr.message) { - msg += ":\n" + typedErr.message; - if (typedErr.stack) { - msg += "\n" + typedErr.stack; - } - } - this.projectService.log(msg); - }; - Session.prototype.sendLineToClient = function (line) { - this.host.write(line + this.host.newLine); - }; - Session.prototype.send = function (msg) { - var json = JSON.stringify(msg); - if (this.logger.isVerbose()) { - this.logger.info(msg.type + ": " + json); - } - this.sendLineToClient('Content-Length: ' + (1 + Buffer.byteLength(json, 'utf8')) + - '\r\n\r\n' + json); - }; - Session.prototype.event = function (info, eventName) { - var ev = { - seq: 0, - type: "event", - event: eventName, - body: info - }; - this.send(ev); - }; - Session.prototype.response = function (info, cmdName, reqSeq, errorMsg) { - if (reqSeq === void 0) { reqSeq = 0; } - var res = { - seq: 0, - type: "response", - command: cmdName, - request_seq: reqSeq, - success: !errorMsg - }; - if (!errorMsg) { - res.body = info; - } - else { - res.message = errorMsg; - } - this.send(res); - }; - Session.prototype.output = function (body, commandName, requestSequence, errorMessage) { - if (requestSequence === void 0) { requestSequence = 0; } - this.response(body, commandName, requestSequence, errorMessage); - }; - Session.prototype.semanticCheck = function (file, project) { - try { - var diags = project.compilerService.languageService.getSemanticDiagnostics(file); - if (diags) { - var bakedDiags = diags.map(function (diag) { return formatDiag(file, project, diag); }); - this.event({ file: file, diagnostics: bakedDiags }, "semanticDiag"); - } - } - catch (err) { - this.logError(err, "semantic check"); - } - }; - Session.prototype.syntacticCheck = function (file, project) { - try { - var diags = project.compilerService.languageService.getSyntacticDiagnostics(file); - if (diags) { - var bakedDiags = diags.map(function (diag) { return formatDiag(file, project, diag); }); - this.event({ file: file, diagnostics: bakedDiags }, "syntaxDiag"); - } - } - catch (err) { - this.logError(err, "syntactic check"); - } - }; - Session.prototype.errorCheck = function (file, project) { - this.syntacticCheck(file, project); - this.semanticCheck(file, project); - }; - Session.prototype.updateProjectStructure = function (seq, matchSeq, ms) { - var _this = this; - if (ms === void 0) { ms = 1500; } - setTimeout(function () { - if (matchSeq(seq)) { - _this.projectService.updateProjectStructure(); - } - }, ms); - }; - Session.prototype.updateErrorCheck = function (checkList, seq, matchSeq, ms, followMs) { - var _this = this; - if (ms === void 0) { ms = 1500; } - if (followMs === void 0) { followMs = 200; } - if (followMs > ms) { - followMs = ms; - } - if (this.errorTimer) { - clearTimeout(this.errorTimer); - } - if (this.immediateId) { - clearImmediate(this.immediateId); - this.immediateId = undefined; - } - var index = 0; - var checkOne = function () { - if (matchSeq(seq)) { - var checkSpec = checkList[index++]; - if (checkSpec.project.getSourceFileFromName(checkSpec.fileName, true)) { - _this.syntacticCheck(checkSpec.fileName, checkSpec.project); - _this.immediateId = setImmediate(function () { - _this.semanticCheck(checkSpec.fileName, checkSpec.project); - _this.immediateId = undefined; - if (checkList.length > index) { - _this.errorTimer = setTimeout(checkOne, followMs); - } - else { - _this.errorTimer = undefined; - } - }); - } - } - }; - if ((checkList.length > index) && (matchSeq(seq))) { - this.errorTimer = setTimeout(checkOne, ms); - } - }; - Session.prototype.getDefinition = function (line, col, 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.lineColToPosition(file, line, col); - var definitions = compilerService.languageService.getDefinitionAtPosition(file, position); - if (!definitions) { - return undefined; - } - return definitions.map(function (def) { return ({ - file: def.fileName, - start: compilerService.host.positionToLineCol(def.fileName, def.textSpan.start), - end: compilerService.host.positionToLineCol(def.fileName, ts.textSpanEnd(def.textSpan)) - }); }); - }; - Session.prototype.getRenameLocations = function (line, col, fileName, findInComments, findInStrings) { - var file = ts.normalizePath(fileName); - var project = this.projectService.getProjectForFile(file); - if (!project) { - throw Errors.NoProject; - } - var compilerService = project.compilerService; - var position = compilerService.host.lineColToPosition(file, line, col); - var renameInfo = compilerService.languageService.getRenameInfo(file, position); - if (!renameInfo) { - return undefined; - } - if (!renameInfo.canRename) { - return { - info: renameInfo, - locs: [] - }; - } - var renameLocations = compilerService.languageService.findRenameLocations(file, position, findInStrings, findInComments); - if (!renameLocations) { - return undefined; - } - var bakedRenameLocs = renameLocations.map(function (location) { return ({ - file: location.fileName, - start: compilerService.host.positionToLineCol(location.fileName, location.textSpan.start), - end: compilerService.host.positionToLineCol(location.fileName, ts.textSpanEnd(location.textSpan)) - }); }).sort(function (a, b) { - if (a.file < b.file) { - return -1; - } - else if (a.file > b.file) { - return 1; - } - else { - if (a.start.line < b.start.line) { - return 1; - } - else if (a.start.line > b.start.line) { - return -1; - } - else { - return b.start.col - a.start.col; - } - } - }).reduce(function (accum, cur) { - var curFileAccum; - if (accum.length > 0) { - curFileAccum = accum[accum.length - 1]; - if (curFileAccum.file != cur.file) { - curFileAccum = undefined; - } - } - if (!curFileAccum) { - curFileAccum = { file: cur.file, locs: [] }; - accum.push(curFileAccum); - } - curFileAccum.locs.push({ start: cur.start, end: cur.end }); - return accum; - }, []); - return { info: renameInfo, locs: bakedRenameLocs }; - }; - Session.prototype.getReferences = function (line, col, 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.lineColToPosition(file, line, col); - var references = compilerService.languageService.getReferencesAtPosition(file, position); - if (!references) { - return undefined; - } - var nameInfo = compilerService.languageService.getQuickInfoAtPosition(file, position); - if (!nameInfo) { - return undefined; - } - var displayString = ts.displayPartsToString(nameInfo.displayParts); - var nameSpan = nameInfo.textSpan; - var nameColStart = compilerService.host.positionToLineCol(file, nameSpan.start).col; - var nameText = compilerService.host.getScriptSnapshot(file).getText(nameSpan.start, ts.textSpanEnd(nameSpan)); - var bakedRefs = references.map(function (ref) { - var start = compilerService.host.positionToLineCol(ref.fileName, ref.textSpan.start); - var refLineSpan = compilerService.host.lineToTextSpan(ref.fileName, start.line - 1); - var snap = compilerService.host.getScriptSnapshot(ref.fileName); - var lineText = snap.getText(refLineSpan.start, ts.textSpanEnd(refLineSpan)).replace(/\r|\n/g, ""); - return { - file: ref.fileName, - start: start, - lineText: lineText, - end: compilerService.host.positionToLineCol(ref.fileName, ts.textSpanEnd(ref.textSpan)), - isWriteAccess: ref.isWriteAccess - }; - }).sort(compareFileStart); - return { - refs: bakedRefs, - symbolName: nameText, - symbolStartCol: nameColStart, - symbolDisplayString: displayString - }; - }; - Session.prototype.openClientFile = function (fileName) { - var file = ts.normalizePath(fileName); - this.projectService.openClientFile(file); - }; - Session.prototype.getQuickInfo = function (line, col, 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.lineColToPosition(file, line, col); - var quickInfo = compilerService.languageService.getQuickInfoAtPosition(file, position); - if (!quickInfo) { - return undefined; - } - var displayString = ts.displayPartsToString(quickInfo.displayParts); - var docString = ts.displayPartsToString(quickInfo.documentation); - return { - kind: quickInfo.kind, - kindModifiers: quickInfo.kindModifiers, - start: compilerService.host.positionToLineCol(file, quickInfo.textSpan.start), - end: compilerService.host.positionToLineCol(file, ts.textSpanEnd(quickInfo.textSpan)), - displayString: displayString, - documentation: docString - }; - }; - Session.prototype.getFormattingEditsForRange = function (line, col, endLine, endCol, fileName) { - var file = ts.normalizePath(fileName); - var project = this.projectService.getProjectForFile(file); - if (!project) { - throw Errors.NoProject; - } - var compilerService = project.compilerService; - var startPosition = compilerService.host.lineColToPosition(file, line, col); - var endPosition = compilerService.host.lineColToPosition(file, endLine, endCol); - var edits = compilerService.languageService.getFormattingEditsForRange(file, startPosition, endPosition, compilerService.formatCodeOptions); - if (!edits) { - return undefined; - } - return edits.map(function (edit) { - return { - start: compilerService.host.positionToLineCol(file, edit.span.start), - end: compilerService.host.positionToLineCol(file, ts.textSpanEnd(edit.span)), - newText: edit.newText ? edit.newText : "" - }; - }); - }; - Session.prototype.getFormattingEditsAfterKeystroke = function (line, col, key, 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.lineColToPosition(file, line, col); - var edits = compilerService.languageService.getFormattingEditsAfterKeystroke(file, position, key, compilerService.formatCodeOptions); - if ((key == "\n") && ((!edits) || (edits.length == 0) || allEditsBeforePos(edits, position))) { - var scriptInfo = compilerService.host.getScriptInfo(file); - if (scriptInfo) { - var lineInfo = scriptInfo.getLineInfo(line); - if (lineInfo && (lineInfo.leaf) && (lineInfo.leaf.text)) { - var lineText = lineInfo.leaf.text; - if (lineText.search("\\S") < 0) { - var editorOptions = { - IndentSize: 4, - TabSize: 4, - NewLineCharacter: "\n", - ConvertTabsToSpaces: true - }; - var indentPosition = compilerService.languageService.getIndentationAtPosition(file, position, editorOptions); - for (var i = 0, len = lineText.length; i < len; i++) { - if (lineText.charAt(i) == " ") { - indentPosition--; - } - else { - break; - } - } - if (indentPosition > 0) { - var spaces = generateSpaces(indentPosition); - edits.push({ span: ts.createTextSpanFromBounds(position, position), newText: spaces }); - } - else if (indentPosition < 0) { - edits.push({ - span: ts.createTextSpanFromBounds(position, position - indentPosition), - newText: "" - }); - } - } - } - } - } - if (!edits) { - return undefined; - } - return edits.map(function (edit) { - return { - start: compilerService.host.positionToLineCol(file, edit.span.start), - end: compilerService.host.positionToLineCol(file, ts.textSpanEnd(edit.span)), - newText: edit.newText ? edit.newText : "" - }; - }); - }; - Session.prototype.getCompletions = function (line, col, prefix, fileName) { - if (!prefix) { - prefix = ""; - } - var file = ts.normalizePath(fileName); - var project = this.projectService.getProjectForFile(file); - if (!project) { - throw Errors.NoProject; - } - var compilerService = project.compilerService; - var position = compilerService.host.lineColToPosition(file, line, col); - var completions = compilerService.languageService.getCompletionsAtPosition(file, position); - if (!completions) { - return undefined; - } - return completions.entries.reduce(function (result, entry) { - if (completions.isMemberCompletion || entry.name.indexOf(prefix) == 0) { - result.push(entry); - } - return result; - }, []); - }; - Session.prototype.getCompletionEntryDetails = function (line, col, entryNames, 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.lineColToPosition(file, line, col); - return entryNames.reduce(function (accum, entryName) { - var details = compilerService.languageService.getCompletionEntryDetails(file, position, entryName); - if (details) { - accum.push(details); - } - return accum; - }, []); - }; - Session.prototype.getDiagnostics = function (delay, fileNames) { - var _this = this; - var checkList = fileNames.reduce(function (accum, fileName) { - fileName = ts.normalizePath(fileName); - var project = _this.projectService.getProjectForFile(fileName); - if (project) { - accum.push({ fileName: fileName, project: project }); - } - return accum; - }, []); - if (checkList.length > 0) { - this.updateErrorCheck(checkList, this.changeSeq, function (n) { return n == _this.changeSeq; }, delay); - } - }; - Session.prototype.change = function (line, col, endLine, endCol, insertString, fileName) { - var _this = this; - var file = ts.normalizePath(fileName); - var project = this.projectService.getProjectForFile(file); - if (project) { - var compilerService = project.compilerService; - var start = compilerService.host.lineColToPosition(file, line, col); - var end = compilerService.host.lineColToPosition(file, endLine, endCol); - if (start >= 0) { - compilerService.host.editScript(file, start, end, insertString); - this.changeSeq++; - } - this.updateProjectStructure(this.changeSeq, function (n) { return n == _this.changeSeq; }); - } - }; - Session.prototype.reload = function (fileName, tempFileName, reqSeq) { - var _this = this; - if (reqSeq === void 0) { reqSeq = 0; } - var file = ts.normalizePath(fileName); - var tmpfile = ts.normalizePath(tempFileName); - var project = this.projectService.getProjectForFile(file); - if (project) { - this.changeSeq++; - project.compilerService.host.reloadScript(file, tmpfile, function () { - _this.output(undefined, CommandNames.Reload, reqSeq); - }); - } - }; - Session.prototype.saveToTmp = function (fileName, tempFileName) { - var file = ts.normalizePath(fileName); - var tmpfile = ts.normalizePath(tempFileName); - var project = this.projectService.getProjectForFile(file); - if (project) { - project.compilerService.host.saveTo(file, tmpfile); - } - }; - Session.prototype.closeClientFile = function (fileName) { - var file = ts.normalizePath(fileName); - this.projectService.closeClientFile(file); - }; - Session.prototype.decorateNavigationBarItem = function (project, fileName, items) { - var _this = this; - if (!items) { - return undefined; - } - var compilerService = project.compilerService; - return items.map(function (item) { return ({ - text: item.text, - kind: item.kind, - kindModifiers: item.kindModifiers, - spans: item.spans.map(function (span) { return ({ - start: compilerService.host.positionToLineCol(fileName, span.start), - end: compilerService.host.positionToLineCol(fileName, ts.textSpanEnd(span)) - }); }), - childItems: _this.decorateNavigationBarItem(project, fileName, item.childItems) - }); }); - }; - Session.prototype.getNavigationBarItems = function (fileName) { - var file = ts.normalizePath(fileName); - var project = this.projectService.getProjectForFile(file); - if (!project) { - throw Errors.NoProject; - } - var compilerService = project.compilerService; - var items = compilerService.languageService.getNavigationBarItems(file); - if (!items) { - return undefined; - } - return this.decorateNavigationBarItem(project, fileName, items); - }; - Session.prototype.getNavigateToItems = function (searchValue, fileName, maxResultCount) { - var file = ts.normalizePath(fileName); - var project = this.projectService.getProjectForFile(file); - if (!project) { - throw Errors.NoProject; - } - var compilerService = project.compilerService; - var navItems = compilerService.languageService.getNavigateToItems(searchValue, maxResultCount); - if (!navItems) { - return undefined; - } - return navItems.map(function (navItem) { - var start = compilerService.host.positionToLineCol(navItem.fileName, navItem.textSpan.start); - var end = compilerService.host.positionToLineCol(navItem.fileName, ts.textSpanEnd(navItem.textSpan)); - var bakedItem = { - name: navItem.name, - kind: navItem.kind, - file: navItem.fileName, - start: start, - end: end - }; - if (navItem.kindModifiers && (navItem.kindModifiers != "")) { - bakedItem.kindModifiers = navItem.kindModifiers; - } - if (navItem.matchKind != 'none') { - bakedItem.matchKind = navItem.matchKind; - } - if (navItem.containerName && (navItem.containerName.length > 0)) { - bakedItem.containerName = navItem.containerName; - } - if (navItem.containerKind && (navItem.containerKind.length > 0)) { - bakedItem.containerKind = navItem.containerKind; - } - return bakedItem; - }); - }; - Session.prototype.getBraceMatching = function (line, col, 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.lineColToPosition(file, line, col); - var spans = compilerService.languageService.getBraceMatchingAtPosition(file, position); - if (!spans) { - return undefined; - } - return spans.map(function (span) { return ({ - start: compilerService.host.positionToLineCol(file, span.start), - end: compilerService.host.positionToLineCol(file, span.start + span.length) - }); }); - }; - Session.prototype.onMessage = function (message) { - if (this.logger.isVerbose()) { - this.logger.info("request: " + message); - var start = process.hrtime(); - } - try { - var request = JSON.parse(message); - var response; - var errorMessage; - var responseRequired = true; - switch (request.command) { - case CommandNames.Definition: { - var defArgs = request.arguments; - response = this.getDefinition(defArgs.line, defArgs.col, defArgs.file); - break; - } - case CommandNames.References: { - var refArgs = request.arguments; - response = this.getReferences(refArgs.line, refArgs.col, refArgs.file); - break; - } - case CommandNames.Rename: { - var renameArgs = request.arguments; - response = this.getRenameLocations(renameArgs.line, renameArgs.col, renameArgs.file, renameArgs.findInComments, renameArgs.findInStrings); - break; - } - case CommandNames.Open: { - var openArgs = request.arguments; - this.openClientFile(openArgs.file); - responseRequired = false; - break; - } - case CommandNames.Quickinfo: { - var quickinfoArgs = request.arguments; - response = this.getQuickInfo(quickinfoArgs.line, quickinfoArgs.col, quickinfoArgs.file); - break; - } - case CommandNames.Format: { - var formatArgs = request.arguments; - response = this.getFormattingEditsForRange(formatArgs.line, formatArgs.col, formatArgs.endLine, formatArgs.endCol, formatArgs.file); - break; - } - case CommandNames.Formatonkey: { - var formatOnKeyArgs = request.arguments; - response = this.getFormattingEditsAfterKeystroke(formatOnKeyArgs.line, formatOnKeyArgs.col, formatOnKeyArgs.key, formatOnKeyArgs.file); - break; - } - case CommandNames.Completions: { - var completionsArgs = request.arguments; - response = this.getCompletions(request.arguments.line, request.arguments.col, completionsArgs.prefix, request.arguments.file); - break; - } - case CommandNames.CompletionDetails: { - var completionDetailsArgs = request.arguments; - response = this.getCompletionEntryDetails(request.arguments.line, request.arguments.col, completionDetailsArgs.entryNames, request.arguments.file); - break; - } - case CommandNames.Geterr: { - var geterrArgs = request.arguments; - response = this.getDiagnostics(geterrArgs.delay, geterrArgs.files); - responseRequired = false; - break; - } - case CommandNames.Change: { - var changeArgs = request.arguments; - this.change(changeArgs.line, changeArgs.col, changeArgs.endLine, changeArgs.endCol, changeArgs.insertString, changeArgs.file); - responseRequired = false; - break; - } - case CommandNames.Reload: { - var reloadArgs = request.arguments; - this.reload(reloadArgs.file, reloadArgs.tmpfile, request.seq); - break; - } - case CommandNames.Saveto: { - var savetoArgs = request.arguments; - this.saveToTmp(savetoArgs.file, savetoArgs.tmpfile); - responseRequired = false; - break; - } - case CommandNames.Close: { - var closeArgs = request.arguments; - this.closeClientFile(closeArgs.file); - responseRequired = false; - break; - } - case CommandNames.Navto: { - var navtoArgs = request.arguments; - response = this.getNavigateToItems(navtoArgs.searchValue, navtoArgs.file, navtoArgs.maxResultCount); - break; - } - case CommandNames.Brace: { - var braceArguments = request.arguments; - response = this.getBraceMatching(braceArguments.line, braceArguments.col, braceArguments.file); - break; - } - case CommandNames.NavBar: { - var navBarArgs = request.arguments; - response = this.getNavigationBarItems(navBarArgs.file); - break; - } - default: { - this.projectService.log("Unrecognized JSON command: " + message); - this.output(undefined, CommandNames.Unknown, request.seq, "Unrecognized JSON command: " + request.command); - break; - } - } - if (this.logger.isVerbose()) { - var elapsed = process.hrtime(start); - var seconds = elapsed[0]; - var nanoseconds = elapsed[1]; - var elapsedMs = ((1e9 * seconds) + nanoseconds) / 1000000.0; - var leader = "Elapsed time (in milliseconds)"; - if (!responseRequired) { - leader = "Async elapsed time (in milliseconds)"; - } - this.logger.msg(leader + ": " + elapsedMs.toFixed(4).toString(), "Perf"); - } - if (response) { - this.output(response, request.command, request.seq); - } - else if (responseRequired) { - this.output(undefined, request.command, request.seq, "No content available."); - } - } - catch (err) { - if (err instanceof ts.OperationCanceledException) { - } - this.logError(err, message); - this.output(undefined, request ? request.command : CommandNames.Unknown, request ? request.seq : 0, "Error processing request. " + err.message); - } - }; - return Session; - })(); - server.Session = Session; - })(server = ts.server || (ts.server = {})); -})(ts || (ts = {})); +/// +/// var ts; (function (ts) { var server; diff --git a/bin/typescript.d.ts b/bin/typescript.d.ts index 8f71dc4ee08..e817dfb54ae 100644 --- a/bin/typescript.d.ts +++ b/bin/typescript.d.ts @@ -74,192 +74,198 @@ declare module "typescript" { BarBarToken = 49, QuestionToken = 50, ColonToken = 51, - EqualsToken = 52, - PlusEqualsToken = 53, - MinusEqualsToken = 54, - AsteriskEqualsToken = 55, - SlashEqualsToken = 56, - PercentEqualsToken = 57, - LessThanLessThanEqualsToken = 58, - GreaterThanGreaterThanEqualsToken = 59, - GreaterThanGreaterThanGreaterThanEqualsToken = 60, - AmpersandEqualsToken = 61, - BarEqualsToken = 62, - CaretEqualsToken = 63, - Identifier = 64, - BreakKeyword = 65, - CaseKeyword = 66, - CatchKeyword = 67, - ClassKeyword = 68, - ConstKeyword = 69, - ContinueKeyword = 70, - DebuggerKeyword = 71, - DefaultKeyword = 72, - DeleteKeyword = 73, - DoKeyword = 74, - ElseKeyword = 75, - EnumKeyword = 76, - ExportKeyword = 77, - ExtendsKeyword = 78, - FalseKeyword = 79, - FinallyKeyword = 80, - ForKeyword = 81, - FunctionKeyword = 82, - IfKeyword = 83, - ImportKeyword = 84, - InKeyword = 85, - InstanceOfKeyword = 86, - NewKeyword = 87, - NullKeyword = 88, - ReturnKeyword = 89, - SuperKeyword = 90, - SwitchKeyword = 91, - ThisKeyword = 92, - ThrowKeyword = 93, - TrueKeyword = 94, - TryKeyword = 95, - TypeOfKeyword = 96, - VarKeyword = 97, - VoidKeyword = 98, - WhileKeyword = 99, - WithKeyword = 100, - AsKeyword = 101, - ImplementsKeyword = 102, - InterfaceKeyword = 103, - LetKeyword = 104, - PackageKeyword = 105, - PrivateKeyword = 106, - ProtectedKeyword = 107, - PublicKeyword = 108, - StaticKeyword = 109, - YieldKeyword = 110, - AnyKeyword = 111, - BooleanKeyword = 112, - ConstructorKeyword = 113, - DeclareKeyword = 114, - GetKeyword = 115, - ModuleKeyword = 116, - RequireKeyword = 117, - NumberKeyword = 118, - SetKeyword = 119, - StringKeyword = 120, - SymbolKeyword = 121, - TypeKeyword = 122, - FromKeyword = 123, - OfKeyword = 124, - QualifiedName = 125, - ComputedPropertyName = 126, - TypeParameter = 127, - Parameter = 128, - PropertySignature = 129, - PropertyDeclaration = 130, - MethodSignature = 131, - MethodDeclaration = 132, - Constructor = 133, - GetAccessor = 134, - SetAccessor = 135, - CallSignature = 136, - ConstructSignature = 137, - IndexSignature = 138, - TypeReference = 139, - FunctionType = 140, - ConstructorType = 141, - TypeQuery = 142, - TypeLiteral = 143, - ArrayType = 144, - TupleType = 145, - UnionType = 146, - ParenthesizedType = 147, - ObjectBindingPattern = 148, - ArrayBindingPattern = 149, - BindingElement = 150, - ArrayLiteralExpression = 151, - ObjectLiteralExpression = 152, - PropertyAccessExpression = 153, - ElementAccessExpression = 154, - CallExpression = 155, - NewExpression = 156, - TaggedTemplateExpression = 157, - TypeAssertionExpression = 158, - ParenthesizedExpression = 159, - FunctionExpression = 160, - ArrowFunction = 161, - DeleteExpression = 162, - TypeOfExpression = 163, - VoidExpression = 164, - PrefixUnaryExpression = 165, - PostfixUnaryExpression = 166, - BinaryExpression = 167, - ConditionalExpression = 168, - TemplateExpression = 169, - YieldExpression = 170, - SpreadElementExpression = 171, - OmittedExpression = 172, - TemplateSpan = 173, - Block = 174, - VariableStatement = 175, - EmptyStatement = 176, - ExpressionStatement = 177, - IfStatement = 178, - DoStatement = 179, - WhileStatement = 180, - ForStatement = 181, - ForInStatement = 182, - ForOfStatement = 183, - ContinueStatement = 184, - BreakStatement = 185, - ReturnStatement = 186, - WithStatement = 187, - SwitchStatement = 188, - LabeledStatement = 189, - ThrowStatement = 190, - TryStatement = 191, - DebuggerStatement = 192, - VariableDeclaration = 193, - VariableDeclarationList = 194, - FunctionDeclaration = 195, - ClassDeclaration = 196, - InterfaceDeclaration = 197, - TypeAliasDeclaration = 198, - EnumDeclaration = 199, - ModuleDeclaration = 200, - ModuleBlock = 201, - CaseBlock = 202, - ImportEqualsDeclaration = 203, - ImportDeclaration = 204, - ImportClause = 205, - NamespaceImport = 206, - NamedImports = 207, - ImportSpecifier = 208, - ExportAssignment = 209, - ExportDeclaration = 210, - NamedExports = 211, - ExportSpecifier = 212, - ExternalModuleReference = 213, - CaseClause = 214, - DefaultClause = 215, - HeritageClause = 216, - CatchClause = 217, - PropertyAssignment = 218, - ShorthandPropertyAssignment = 219, - EnumMember = 220, - SourceFile = 221, - SyntaxList = 222, - Count = 223, - FirstAssignment = 52, - LastAssignment = 63, - FirstReservedWord = 65, - LastReservedWord = 100, - FirstKeyword = 65, - LastKeyword = 124, - FirstFutureReservedWord = 102, - LastFutureReservedWord = 110, - FirstTypeNode = 139, - LastTypeNode = 147, + AtToken = 52, + EqualsToken = 53, + PlusEqualsToken = 54, + MinusEqualsToken = 55, + AsteriskEqualsToken = 56, + SlashEqualsToken = 57, + PercentEqualsToken = 58, + LessThanLessThanEqualsToken = 59, + GreaterThanGreaterThanEqualsToken = 60, + GreaterThanGreaterThanGreaterThanEqualsToken = 61, + AmpersandEqualsToken = 62, + BarEqualsToken = 63, + CaretEqualsToken = 64, + Identifier = 65, + BreakKeyword = 66, + CaseKeyword = 67, + CatchKeyword = 68, + ClassKeyword = 69, + ConstKeyword = 70, + ContinueKeyword = 71, + DebuggerKeyword = 72, + DefaultKeyword = 73, + DeleteKeyword = 74, + DoKeyword = 75, + ElseKeyword = 76, + EnumKeyword = 77, + ExportKeyword = 78, + ExtendsKeyword = 79, + FalseKeyword = 80, + FinallyKeyword = 81, + ForKeyword = 82, + FunctionKeyword = 83, + IfKeyword = 84, + ImportKeyword = 85, + InKeyword = 86, + InstanceOfKeyword = 87, + NewKeyword = 88, + NullKeyword = 89, + ReturnKeyword = 90, + SuperKeyword = 91, + SwitchKeyword = 92, + ThisKeyword = 93, + ThrowKeyword = 94, + TrueKeyword = 95, + TryKeyword = 96, + TypeOfKeyword = 97, + VarKeyword = 98, + VoidKeyword = 99, + WhileKeyword = 100, + WithKeyword = 101, + AsKeyword = 102, + ImplementsKeyword = 103, + InterfaceKeyword = 104, + LetKeyword = 105, + PackageKeyword = 106, + PrivateKeyword = 107, + ProtectedKeyword = 108, + PublicKeyword = 109, + StaticKeyword = 110, + YieldKeyword = 111, + AnyKeyword = 112, + BooleanKeyword = 113, + ConstructorKeyword = 114, + 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, + FirstAssignment = 53, + LastAssignment = 64, + FirstReservedWord = 66, + LastReservedWord = 101, + FirstKeyword = 66, + LastKeyword = 125, + FirstFutureReservedWord = 103, + LastFutureReservedWord = 111, + FirstTypeNode = 141, + LastTypeNode = 149, FirstPunctuation = 14, - LastPunctuation = 63, + LastPunctuation = 64, FirstToken = 0, - LastToken = 124, + LastToken = 125, FirstTriviaToken = 2, LastTriviaToken = 6, FirstLiteralToken = 7, @@ -267,8 +273,8 @@ declare module "typescript" { FirstTemplateToken = 10, LastTemplateToken = 13, FirstBinaryOperator = 24, - LastBinaryOperator = 63, - FirstNode = 125, + LastBinaryOperator = 64, + FirstNode = 126, } const enum NodeFlags { Export = 1, @@ -284,6 +290,7 @@ declare module "typescript" { Let = 4096, Const = 8192, OctalLiteral = 16384, + ExportContext = 32768, Modifier = 499, AccessibilityModifier = 112, BlockScoped = 12288, @@ -293,10 +300,11 @@ declare module "typescript" { DisallowIn = 2, Yield = 4, GeneratorParameter = 8, - ThisNodeHasError = 16, - ParserGeneratedFlags = 31, - ThisNodeOrAnySubNodesHasError = 32, - HasAggregatedChildData = 64, + Decorator = 16, + ThisNodeHasError = 32, + ParserGeneratedFlags = 63, + ThisNodeOrAnySubNodesHasError = 64, + HasAggregatedChildData = 128, } const enum RelationComparisonResult { Succeeded = 1, @@ -307,6 +315,7 @@ declare module "typescript" { kind: SyntaxKind; flags: NodeFlags; parserContextFlags?: ParserContextFlags; + decorators?: NodeArray; modifiers?: ModifiersArray; id?: number; parent?: Node; @@ -337,6 +346,9 @@ declare module "typescript" { interface ComputedPropertyName extends Node { expression: Expression; } + interface Decorator extends Node { + expression: LeftHandSideExpression; + } interface TypeParameterDeclaration extends Declaration { name: Identifier; constraint?: TypeNode; @@ -423,6 +435,9 @@ declare module "typescript" { interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { body?: Block; } + interface SemicolonClassElement extends ClassElement { + _semicolonClassElementBrand: any; + } interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { _accessorDeclarationBrand: any; body: Block; @@ -516,6 +531,9 @@ declare module "typescript" { name?: Identifier; body: Block | Expression; } + interface ArrowFunction extends Expression, FunctionLikeDeclaration { + equalsGreaterThanToken: Node; + } interface LiteralExpression extends PrimaryExpression { text: string; isUnterminated?: boolean; @@ -558,6 +576,10 @@ declare module "typescript" { typeArguments?: NodeArray; arguments: NodeArray; } + interface HeritageClauseElement extends Node { + expression: LeftHandSideExpression; + typeArguments?: NodeArray; + } interface NewExpression extends CallExpression, PrimaryExpression { } interface TaggedTemplateExpression extends MemberExpression { @@ -652,12 +674,16 @@ declare module "typescript" { interface ModuleElement extends Node { _moduleElementBrand: any; } - interface ClassDeclaration extends Declaration, ModuleElement { + interface ClassLikeDeclaration extends Declaration { name?: Identifier; typeParameters?: NodeArray; heritageClauses?: NodeArray; members: NodeArray; } + interface ClassDeclaration extends ClassLikeDeclaration, Statement { + } + interface ClassExpression extends ClassLikeDeclaration, PrimaryExpression { + } interface ClassElement extends Declaration { _classElementBrand: any; } @@ -669,7 +695,7 @@ declare module "typescript" { } interface HeritageClause extends Node { token: SyntaxKind; - types?: NodeArray; + types?: NodeArray; } interface TypeAliasDeclaration extends Declaration, ModuleElement { name: Identifier; @@ -725,7 +751,8 @@ declare module "typescript" { type ExportSpecifier = ImportOrExportSpecifier; interface ExportAssignment extends Declaration, ModuleElement { isExportEquals?: boolean; - expression: Expression; + expression?: Expression; + type?: TypeNode; } interface FileReference extends TextRange { fileName: string; @@ -760,14 +787,14 @@ declare module "typescript" { interface Program extends ScriptReferenceHost { getSourceFiles(): SourceFile[]; /** - * Emits the javascript and declaration files. If targetSourceFile is not specified, then - * the javascript and declaration files will be produced for all the files in this program. - * If targetSourceFile is specified, then only the javascript and declaration for that + * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then + * the JavaScript and declaration files will be produced for all the files in this program. + * If targetSourceFile is specified, then only the JavaScript and declaration for that * specific file will be generated. * * If writeFile is not specified then the writeFile callback from the compiler host will be - * used for writing the javascript and declaration files. Otherwise, the writeFile parameter - * will be invoked when writing the javascript and declaration files. + * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter + * will be invoked when writing the JavaScript and declaration files. */ emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback): EmitResult; getSyntacticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; @@ -886,9 +913,10 @@ declare module "typescript" { NotAccessible = 1, CannotBeNamed = 2, } + type AnyImportSyntax = ImportDeclaration | ImportEqualsDeclaration; interface SymbolVisibilityResult { accessibility: SymbolAccessibility; - aliasesToMakeVisible?: ImportEqualsDeclaration[]; + aliasesToMakeVisible?: AnyImportSyntax[]; errorSymbolName?: string; errorNode?: Node; } @@ -896,20 +924,22 @@ declare module "typescript" { errorModuleName?: string; } interface EmitResolver { - getGeneratedNameForNode(node: Node): string; - getExpressionNameSubstitution(node: Identifier): string; - hasExportDefaultValue(node: SourceFile): boolean; - isReferencedAliasDeclaration(node: Node): boolean; + hasGlobalName(name: string): boolean; + getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string; + isValueAliasDeclaration(node: Node): boolean; + isReferencedAliasDeclaration(node: Node, checkChildren?: boolean): boolean; isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; getNodeCheckFlags(node: Node): NodeCheckFlags; isDeclarationVisible(node: Declaration): boolean; + collectLinkedAliases(node: Identifier): Node[]; isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; + writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult; - isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult; + isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult; getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; - isUnknownIdentifier(location: Node, name: string): boolean; + resolvesToSomeValue(location: Node, name: string): boolean; getBlockScopedVariableId(node: Identifier): number; } const enum SymbolFlags { @@ -1016,6 +1046,7 @@ declare module "typescript" { ContextChecked = 64, EnumValuesComputed = 128, BlockScopedBindingInLoop = 256, + EmitDecorate = 512, } interface NodeLinks { resolvedType?: Type; @@ -1135,17 +1166,6 @@ declare module "typescript" { interface TypeMapper { (t: Type): Type; } - interface TypeInferences { - primary: Type[]; - secondary: Type[]; - } - interface InferenceContext { - typeParameters: TypeParameter[]; - inferUnionTypes: boolean; - inferences: TypeInferences[]; - inferredTypes: Type[]; - failedTypeParameterIndex?: number; - } interface DiagnosticMessage { key: string; category: DiagnosticCategory; @@ -1173,7 +1193,6 @@ declare module "typescript" { interface CompilerOptions { allowNonTsExtensions?: boolean; charset?: string; - codepage?: number; declaration?: boolean; diagnostics?: boolean; emitBOM?: boolean; @@ -1187,7 +1206,6 @@ declare module "typescript" { noErrorTruncation?: boolean; noImplicitAny?: boolean; noLib?: boolean; - noLibCheck?: boolean; noResolve?: boolean; out?: string; outDir?: string; @@ -1200,6 +1218,7 @@ declare module "typescript" { target?: ScriptTarget; version?: boolean; watch?: boolean; + separateCompilation?: boolean; [option: string]: string | number | boolean; } const enum ModuleKind { @@ -1442,11 +1461,26 @@ declare module "typescript" { declare module "typescript" { /** The version of the TypeScript compiler release */ let version: string; - function createCompilerHost(options: CompilerOptions): CompilerHost; + function findConfigFile(searchPath: string): string; + function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; function getPreEmitDiagnostics(program: Program): Diagnostic[]; function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; } +declare module "typescript" { + /** + * Read tsconfig.json file + * @param fileName The path to the config file + */ + function readConfigFile(fileName: string): any; + /** + * 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; +} declare module "typescript" { /** The version of the language service API */ let servicesVersion: string; @@ -1556,6 +1590,7 @@ declare module "typescript" { getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; + findReferences(fileName: string, position: number): ReferencedSymbol[]; getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[]; getNavigationBarItems(fileName: string): NavigationBarItem[]; getOutliningSpans(fileName: string): OutliningSpan[]; @@ -1642,6 +1677,10 @@ declare module "typescript" { containerKind: string; containerName: string; } + interface ReferencedSymbol { + definition: DefinitionInfo; + references: ReferenceEntry[]; + } enum SymbolDisplayPartKind { aliasName = 0, className = 1, @@ -1935,6 +1974,7 @@ declare module "typescript" { isCancellationRequested(): boolean; throwIfCancellationRequested(): void; } + function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[]): string; function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile; let disableIncrementalParsing: boolean; function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; diff --git a/bin/typescript.js b/bin/typescript.js index 9e939631006..0ea54239508 100644 --- a/bin/typescript.js +++ b/bin/typescript.js @@ -68,192 +68,198 @@ var ts; SyntaxKind[SyntaxKind["BarBarToken"] = 49] = "BarBarToken"; SyntaxKind[SyntaxKind["QuestionToken"] = 50] = "QuestionToken"; SyntaxKind[SyntaxKind["ColonToken"] = 51] = "ColonToken"; - SyntaxKind[SyntaxKind["EqualsToken"] = 52] = "EqualsToken"; - SyntaxKind[SyntaxKind["PlusEqualsToken"] = 53] = "PlusEqualsToken"; - SyntaxKind[SyntaxKind["MinusEqualsToken"] = 54] = "MinusEqualsToken"; - SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 55] = "AsteriskEqualsToken"; - SyntaxKind[SyntaxKind["SlashEqualsToken"] = 56] = "SlashEqualsToken"; - SyntaxKind[SyntaxKind["PercentEqualsToken"] = 57] = "PercentEqualsToken"; - SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 58] = "LessThanLessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 59] = "GreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 60] = "GreaterThanGreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 61] = "AmpersandEqualsToken"; - SyntaxKind[SyntaxKind["BarEqualsToken"] = 62] = "BarEqualsToken"; - SyntaxKind[SyntaxKind["CaretEqualsToken"] = 63] = "CaretEqualsToken"; - SyntaxKind[SyntaxKind["Identifier"] = 64] = "Identifier"; - SyntaxKind[SyntaxKind["BreakKeyword"] = 65] = "BreakKeyword"; - SyntaxKind[SyntaxKind["CaseKeyword"] = 66] = "CaseKeyword"; - SyntaxKind[SyntaxKind["CatchKeyword"] = 67] = "CatchKeyword"; - SyntaxKind[SyntaxKind["ClassKeyword"] = 68] = "ClassKeyword"; - SyntaxKind[SyntaxKind["ConstKeyword"] = 69] = "ConstKeyword"; - SyntaxKind[SyntaxKind["ContinueKeyword"] = 70] = "ContinueKeyword"; - SyntaxKind[SyntaxKind["DebuggerKeyword"] = 71] = "DebuggerKeyword"; - SyntaxKind[SyntaxKind["DefaultKeyword"] = 72] = "DefaultKeyword"; - SyntaxKind[SyntaxKind["DeleteKeyword"] = 73] = "DeleteKeyword"; - SyntaxKind[SyntaxKind["DoKeyword"] = 74] = "DoKeyword"; - SyntaxKind[SyntaxKind["ElseKeyword"] = 75] = "ElseKeyword"; - SyntaxKind[SyntaxKind["EnumKeyword"] = 76] = "EnumKeyword"; - SyntaxKind[SyntaxKind["ExportKeyword"] = 77] = "ExportKeyword"; - SyntaxKind[SyntaxKind["ExtendsKeyword"] = 78] = "ExtendsKeyword"; - SyntaxKind[SyntaxKind["FalseKeyword"] = 79] = "FalseKeyword"; - SyntaxKind[SyntaxKind["FinallyKeyword"] = 80] = "FinallyKeyword"; - SyntaxKind[SyntaxKind["ForKeyword"] = 81] = "ForKeyword"; - SyntaxKind[SyntaxKind["FunctionKeyword"] = 82] = "FunctionKeyword"; - SyntaxKind[SyntaxKind["IfKeyword"] = 83] = "IfKeyword"; - SyntaxKind[SyntaxKind["ImportKeyword"] = 84] = "ImportKeyword"; - SyntaxKind[SyntaxKind["InKeyword"] = 85] = "InKeyword"; - SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 86] = "InstanceOfKeyword"; - SyntaxKind[SyntaxKind["NewKeyword"] = 87] = "NewKeyword"; - SyntaxKind[SyntaxKind["NullKeyword"] = 88] = "NullKeyword"; - SyntaxKind[SyntaxKind["ReturnKeyword"] = 89] = "ReturnKeyword"; - SyntaxKind[SyntaxKind["SuperKeyword"] = 90] = "SuperKeyword"; - SyntaxKind[SyntaxKind["SwitchKeyword"] = 91] = "SwitchKeyword"; - SyntaxKind[SyntaxKind["ThisKeyword"] = 92] = "ThisKeyword"; - SyntaxKind[SyntaxKind["ThrowKeyword"] = 93] = "ThrowKeyword"; - SyntaxKind[SyntaxKind["TrueKeyword"] = 94] = "TrueKeyword"; - SyntaxKind[SyntaxKind["TryKeyword"] = 95] = "TryKeyword"; - SyntaxKind[SyntaxKind["TypeOfKeyword"] = 96] = "TypeOfKeyword"; - SyntaxKind[SyntaxKind["VarKeyword"] = 97] = "VarKeyword"; - SyntaxKind[SyntaxKind["VoidKeyword"] = 98] = "VoidKeyword"; - SyntaxKind[SyntaxKind["WhileKeyword"] = 99] = "WhileKeyword"; - SyntaxKind[SyntaxKind["WithKeyword"] = 100] = "WithKeyword"; - SyntaxKind[SyntaxKind["AsKeyword"] = 101] = "AsKeyword"; - SyntaxKind[SyntaxKind["ImplementsKeyword"] = 102] = "ImplementsKeyword"; - SyntaxKind[SyntaxKind["InterfaceKeyword"] = 103] = "InterfaceKeyword"; - SyntaxKind[SyntaxKind["LetKeyword"] = 104] = "LetKeyword"; - SyntaxKind[SyntaxKind["PackageKeyword"] = 105] = "PackageKeyword"; - SyntaxKind[SyntaxKind["PrivateKeyword"] = 106] = "PrivateKeyword"; - SyntaxKind[SyntaxKind["ProtectedKeyword"] = 107] = "ProtectedKeyword"; - SyntaxKind[SyntaxKind["PublicKeyword"] = 108] = "PublicKeyword"; - SyntaxKind[SyntaxKind["StaticKeyword"] = 109] = "StaticKeyword"; - SyntaxKind[SyntaxKind["YieldKeyword"] = 110] = "YieldKeyword"; - SyntaxKind[SyntaxKind["AnyKeyword"] = 111] = "AnyKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 112] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 113] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 114] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 115] = "GetKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 116] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 117] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 118] = "NumberKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 119] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 120] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 121] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 122] = "TypeKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 123] = "FromKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 124] = "OfKeyword"; - SyntaxKind[SyntaxKind["QualifiedName"] = 125] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 126] = "ComputedPropertyName"; - SyntaxKind[SyntaxKind["TypeParameter"] = 127] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 128] = "Parameter"; - SyntaxKind[SyntaxKind["PropertySignature"] = 129] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 130] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 131] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 132] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 133] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 134] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 135] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 136] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 137] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 138] = "IndexSignature"; - SyntaxKind[SyntaxKind["TypeReference"] = 139] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 140] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 141] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 142] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 143] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 144] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 145] = "TupleType"; - SyntaxKind[SyntaxKind["UnionType"] = 146] = "UnionType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 147] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 148] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 149] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 150] = "BindingElement"; - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 151] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 152] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 153] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 154] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 155] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 156] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 157] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 158] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 159] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 160] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 161] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 162] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 163] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 164] = "VoidExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 165] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 166] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 167] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 168] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 169] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 170] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElementExpression"] = 171] = "SpreadElementExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 172] = "OmittedExpression"; - SyntaxKind[SyntaxKind["TemplateSpan"] = 173] = "TemplateSpan"; - SyntaxKind[SyntaxKind["Block"] = 174] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 175] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 176] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 177] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 178] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 179] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 180] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 181] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 182] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 183] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 184] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 185] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 186] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 187] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 188] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 189] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 190] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 191] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 192] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 193] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 194] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 195] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 196] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 197] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 198] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 199] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 200] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 201] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 202] = "CaseBlock"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 203] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 204] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 205] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 206] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 207] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 208] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 209] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 210] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 211] = "NamedExports"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 212] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 213] = "ExternalModuleReference"; - SyntaxKind[SyntaxKind["CaseClause"] = 214] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 215] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 216] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 217] = "CatchClause"; - SyntaxKind[SyntaxKind["PropertyAssignment"] = 218] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 219] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["EnumMember"] = 220] = "EnumMember"; - SyntaxKind[SyntaxKind["SourceFile"] = 221] = "SourceFile"; - SyntaxKind[SyntaxKind["SyntaxList"] = 222] = "SyntaxList"; - SyntaxKind[SyntaxKind["Count"] = 223] = "Count"; - SyntaxKind[SyntaxKind["FirstAssignment"] = 52] = "FirstAssignment"; - SyntaxKind[SyntaxKind["LastAssignment"] = 63] = "LastAssignment"; - SyntaxKind[SyntaxKind["FirstReservedWord"] = 65] = "FirstReservedWord"; - SyntaxKind[SyntaxKind["LastReservedWord"] = 100] = "LastReservedWord"; - SyntaxKind[SyntaxKind["FirstKeyword"] = 65] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 124] = "LastKeyword"; - SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 102] = "FirstFutureReservedWord"; - SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 110] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 139] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 147] = "LastTypeNode"; + SyntaxKind[SyntaxKind["AtToken"] = 52] = "AtToken"; + SyntaxKind[SyntaxKind["EqualsToken"] = 53] = "EqualsToken"; + SyntaxKind[SyntaxKind["PlusEqualsToken"] = 54] = "PlusEqualsToken"; + SyntaxKind[SyntaxKind["MinusEqualsToken"] = 55] = "MinusEqualsToken"; + SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 56] = "AsteriskEqualsToken"; + SyntaxKind[SyntaxKind["SlashEqualsToken"] = 57] = "SlashEqualsToken"; + SyntaxKind[SyntaxKind["PercentEqualsToken"] = 58] = "PercentEqualsToken"; + SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 59] = "LessThanLessThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 60] = "GreaterThanGreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 61] = "GreaterThanGreaterThanGreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 62] = "AmpersandEqualsToken"; + SyntaxKind[SyntaxKind["BarEqualsToken"] = 63] = "BarEqualsToken"; + SyntaxKind[SyntaxKind["CaretEqualsToken"] = 64] = "CaretEqualsToken"; + SyntaxKind[SyntaxKind["Identifier"] = 65] = "Identifier"; + SyntaxKind[SyntaxKind["BreakKeyword"] = 66] = "BreakKeyword"; + SyntaxKind[SyntaxKind["CaseKeyword"] = 67] = "CaseKeyword"; + SyntaxKind[SyntaxKind["CatchKeyword"] = 68] = "CatchKeyword"; + SyntaxKind[SyntaxKind["ClassKeyword"] = 69] = "ClassKeyword"; + SyntaxKind[SyntaxKind["ConstKeyword"] = 70] = "ConstKeyword"; + SyntaxKind[SyntaxKind["ContinueKeyword"] = 71] = "ContinueKeyword"; + SyntaxKind[SyntaxKind["DebuggerKeyword"] = 72] = "DebuggerKeyword"; + SyntaxKind[SyntaxKind["DefaultKeyword"] = 73] = "DefaultKeyword"; + SyntaxKind[SyntaxKind["DeleteKeyword"] = 74] = "DeleteKeyword"; + SyntaxKind[SyntaxKind["DoKeyword"] = 75] = "DoKeyword"; + SyntaxKind[SyntaxKind["ElseKeyword"] = 76] = "ElseKeyword"; + SyntaxKind[SyntaxKind["EnumKeyword"] = 77] = "EnumKeyword"; + SyntaxKind[SyntaxKind["ExportKeyword"] = 78] = "ExportKeyword"; + SyntaxKind[SyntaxKind["ExtendsKeyword"] = 79] = "ExtendsKeyword"; + SyntaxKind[SyntaxKind["FalseKeyword"] = 80] = "FalseKeyword"; + SyntaxKind[SyntaxKind["FinallyKeyword"] = 81] = "FinallyKeyword"; + SyntaxKind[SyntaxKind["ForKeyword"] = 82] = "ForKeyword"; + SyntaxKind[SyntaxKind["FunctionKeyword"] = 83] = "FunctionKeyword"; + SyntaxKind[SyntaxKind["IfKeyword"] = 84] = "IfKeyword"; + SyntaxKind[SyntaxKind["ImportKeyword"] = 85] = "ImportKeyword"; + SyntaxKind[SyntaxKind["InKeyword"] = 86] = "InKeyword"; + SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 87] = "InstanceOfKeyword"; + SyntaxKind[SyntaxKind["NewKeyword"] = 88] = "NewKeyword"; + SyntaxKind[SyntaxKind["NullKeyword"] = 89] = "NullKeyword"; + SyntaxKind[SyntaxKind["ReturnKeyword"] = 90] = "ReturnKeyword"; + SyntaxKind[SyntaxKind["SuperKeyword"] = 91] = "SuperKeyword"; + SyntaxKind[SyntaxKind["SwitchKeyword"] = 92] = "SwitchKeyword"; + SyntaxKind[SyntaxKind["ThisKeyword"] = 93] = "ThisKeyword"; + SyntaxKind[SyntaxKind["ThrowKeyword"] = 94] = "ThrowKeyword"; + SyntaxKind[SyntaxKind["TrueKeyword"] = 95] = "TrueKeyword"; + SyntaxKind[SyntaxKind["TryKeyword"] = 96] = "TryKeyword"; + SyntaxKind[SyntaxKind["TypeOfKeyword"] = 97] = "TypeOfKeyword"; + SyntaxKind[SyntaxKind["VarKeyword"] = 98] = "VarKeyword"; + SyntaxKind[SyntaxKind["VoidKeyword"] = 99] = "VoidKeyword"; + SyntaxKind[SyntaxKind["WhileKeyword"] = 100] = "WhileKeyword"; + SyntaxKind[SyntaxKind["WithKeyword"] = 101] = "WithKeyword"; + SyntaxKind[SyntaxKind["AsKeyword"] = 102] = "AsKeyword"; + SyntaxKind[SyntaxKind["ImplementsKeyword"] = 103] = "ImplementsKeyword"; + SyntaxKind[SyntaxKind["InterfaceKeyword"] = 104] = "InterfaceKeyword"; + SyntaxKind[SyntaxKind["LetKeyword"] = 105] = "LetKeyword"; + SyntaxKind[SyntaxKind["PackageKeyword"] = 106] = "PackageKeyword"; + SyntaxKind[SyntaxKind["PrivateKeyword"] = 107] = "PrivateKeyword"; + SyntaxKind[SyntaxKind["ProtectedKeyword"] = 108] = "ProtectedKeyword"; + SyntaxKind[SyntaxKind["PublicKeyword"] = 109] = "PublicKeyword"; + SyntaxKind[SyntaxKind["StaticKeyword"] = 110] = "StaticKeyword"; + SyntaxKind[SyntaxKind["YieldKeyword"] = 111] = "YieldKeyword"; + SyntaxKind[SyntaxKind["AnyKeyword"] = 112] = "AnyKeyword"; + SyntaxKind[SyntaxKind["BooleanKeyword"] = 113] = "BooleanKeyword"; + SyntaxKind[SyntaxKind["ConstructorKeyword"] = 114] = "ConstructorKeyword"; + 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["QualifiedName"] = 126] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 127] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["TypeParameter"] = 128] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 129] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 130] = "Decorator"; + 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["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["ObjectBindingPattern"] = 150] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 151] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 152] = "BindingElement"; + 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["TemplateSpan"] = 176] = "TemplateSpan"; + SyntaxKind[SyntaxKind["HeritageClauseElement"] = 177] = "HeritageClauseElement"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 178] = "SemicolonClassElement"; + 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["ExternalModuleReference"] = 219] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["CaseClause"] = 220] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 221] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 222] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 223] = "CatchClause"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 224] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 225] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["EnumMember"] = 226] = "EnumMember"; + SyntaxKind[SyntaxKind["SourceFile"] = 227] = "SourceFile"; + SyntaxKind[SyntaxKind["SyntaxList"] = 228] = "SyntaxList"; + SyntaxKind[SyntaxKind["Count"] = 229] = "Count"; + 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["FirstFutureReservedWord"] = 103] = "FirstFutureReservedWord"; + SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 111] = "LastFutureReservedWord"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 141] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 149] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 14] = "FirstPunctuation"; - SyntaxKind[SyntaxKind["LastPunctuation"] = 63] = "LastPunctuation"; + SyntaxKind[SyntaxKind["LastPunctuation"] = 64] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 124] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 125] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 6] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 7] = "FirstLiteralToken"; @@ -261,8 +267,8 @@ var ts; SyntaxKind[SyntaxKind["FirstTemplateToken"] = 10] = "FirstTemplateToken"; SyntaxKind[SyntaxKind["LastTemplateToken"] = 13] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 24] = "FirstBinaryOperator"; - SyntaxKind[SyntaxKind["LastBinaryOperator"] = 63] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstNode"] = 125] = "FirstNode"; + SyntaxKind[SyntaxKind["LastBinaryOperator"] = 64] = "LastBinaryOperator"; + SyntaxKind[SyntaxKind["FirstNode"] = 126] = "FirstNode"; })(ts.SyntaxKind || (ts.SyntaxKind = {})); var SyntaxKind = ts.SyntaxKind; (function (NodeFlags) { @@ -279,6 +285,7 @@ var ts; NodeFlags[NodeFlags["Let"] = 4096] = "Let"; NodeFlags[NodeFlags["Const"] = 8192] = "Const"; NodeFlags[NodeFlags["OctalLiteral"] = 16384] = "OctalLiteral"; + NodeFlags[NodeFlags["ExportContext"] = 32768] = "ExportContext"; NodeFlags[NodeFlags["Modifier"] = 499] = "Modifier"; NodeFlags[NodeFlags["AccessibilityModifier"] = 112] = "AccessibilityModifier"; NodeFlags[NodeFlags["BlockScoped"] = 12288] = "BlockScoped"; @@ -289,10 +296,11 @@ var ts; ParserContextFlags[ParserContextFlags["DisallowIn"] = 2] = "DisallowIn"; ParserContextFlags[ParserContextFlags["Yield"] = 4] = "Yield"; ParserContextFlags[ParserContextFlags["GeneratorParameter"] = 8] = "GeneratorParameter"; - ParserContextFlags[ParserContextFlags["ThisNodeHasError"] = 16] = "ThisNodeHasError"; - ParserContextFlags[ParserContextFlags["ParserGeneratedFlags"] = 31] = "ParserGeneratedFlags"; - ParserContextFlags[ParserContextFlags["ThisNodeOrAnySubNodesHasError"] = 32] = "ThisNodeOrAnySubNodesHasError"; - ParserContextFlags[ParserContextFlags["HasAggregatedChildData"] = 64] = "HasAggregatedChildData"; + ParserContextFlags[ParserContextFlags["Decorator"] = 16] = "Decorator"; + ParserContextFlags[ParserContextFlags["ThisNodeHasError"] = 32] = "ThisNodeHasError"; + ParserContextFlags[ParserContextFlags["ParserGeneratedFlags"] = 63] = "ParserGeneratedFlags"; + ParserContextFlags[ParserContextFlags["ThisNodeOrAnySubNodesHasError"] = 64] = "ThisNodeOrAnySubNodesHasError"; + ParserContextFlags[ParserContextFlags["HasAggregatedChildData"] = 128] = "HasAggregatedChildData"; })(ts.ParserContextFlags || (ts.ParserContextFlags = {})); var ParserContextFlags = ts.ParserContextFlags; (function (RelationComparisonResult) { @@ -408,6 +416,7 @@ var ts; NodeCheckFlags[NodeCheckFlags["ContextChecked"] = 64] = "ContextChecked"; NodeCheckFlags[NodeCheckFlags["EnumValuesComputed"] = 128] = "EnumValuesComputed"; NodeCheckFlags[NodeCheckFlags["BlockScopedBindingInLoop"] = 256] = "BlockScopedBindingInLoop"; + NodeCheckFlags[NodeCheckFlags["EmitDecorate"] = 512] = "EmitDecorate"; })(ts.NodeCheckFlags || (ts.NodeCheckFlags = {})); var NodeCheckFlags = ts.NodeCheckFlags; (function (TypeFlags) { @@ -597,6 +606,7 @@ var ts; })(ts.CharacterCodes || (ts.CharacterCodes = {})); var CharacterCodes = ts.CharacterCodes; })(ts || (ts = {})); +/// var ts; (function (ts) { (function (Ternary) { @@ -625,7 +635,7 @@ var ts; ts.forEach = forEach; function contains(array, value) { if (array) { - for (var _i = 0, _n = array.length; _i < _n; _i++) { + for (var _i = 0; _i < array.length; _i++) { var v = array[_i]; if (v === value) { return true; @@ -649,7 +659,7 @@ var ts; function countWhere(array, predicate) { var count = 0; if (array) { - for (var _i = 0, _n = array.length; _i < _n; _i++) { + for (var _i = 0; _i < array.length; _i++) { var v = array[_i]; if (predicate(v)) { count++; @@ -663,10 +673,10 @@ var ts; var result; if (array) { result = []; - for (var _i = 0, _n = array.length; _i < _n; _i++) { - var _item = array[_i]; - if (f(_item)) { - result.push(_item); + for (var _i = 0; _i < array.length; _i++) { + var item_1 = array[_i]; + if (f(item_1)) { + result.push(item_1); } } } @@ -677,7 +687,7 @@ var ts; var result; if (array) { result = []; - for (var _i = 0, _n = array.length; _i < _n; _i++) { + for (var _i = 0; _i < array.length; _i++) { var v = array[_i]; result.push(f(v)); } @@ -697,10 +707,10 @@ var ts; var result; if (array) { result = []; - for (var _i = 0, _n = array.length; _i < _n; _i++) { - var _item = array[_i]; - if (!contains(result, _item)) { - result.push(_item); + for (var _i = 0; _i < array.length; _i++) { + var item_2 = array[_i]; + if (!contains(result, item_2)) { + result.push(item_2); } } } @@ -709,7 +719,7 @@ var ts; ts.deduplicate = deduplicate; function sum(array, prop) { var result = 0; - for (var _i = 0, _n = array.length; _i < _n; _i++) { + for (var _i = 0; _i < array.length; _i++) { var v = array[_i]; result += v[prop]; } @@ -717,9 +727,11 @@ var ts; } ts.sum = sum; function addRange(to, from) { - for (var _i = 0, _n = from.length; _i < _n; _i++) { - var v = from[_i]; - to.push(v); + if (to && from) { + for (var _i = 0; _i < from.length; _i++) { + var v = from[_i]; + to.push(v); + } } } ts.addRange = addRange; @@ -749,6 +761,35 @@ var ts; return ~low; } ts.binarySearch = binarySearch; + function reduceLeft(array, f, initial) { + if (array) { + var count = array.length; + if (count > 0) { + var pos = 0; + var result = arguments.length <= 2 ? array[pos++] : initial; + while (pos < count) { + result = f(result, array[pos++]); + } + return result; + } + } + return initial; + } + ts.reduceLeft = reduceLeft; + function reduceRight(array, f, initial) { + if (array) { + var pos = array.length - 1; + if (pos >= 0) { + var result = arguments.length <= 2 ? array[pos--] : initial; + while (pos >= 0) { + result = f(result, array[pos--]); + } + return result; + } + } + return initial; + } + ts.reduceRight = reduceRight; var hasOwnProperty = Object.prototype.hasOwnProperty; function hasProperty(map, key) { return hasOwnProperty.call(map, key); @@ -780,9 +821,9 @@ var ts; for (var id in first) { result[id] = first[id]; } - for (var _id in second) { - if (!hasProperty(result, _id)) { - result[_id] = second[_id]; + for (var id in second) { + if (!hasProperty(result, id)) { + result[id] = second[id]; } } return result; @@ -810,14 +851,6 @@ var ts; return hasProperty(map, key) ? map[key] : undefined; } ts.lookUp = lookUp; - function mapToArray(map) { - var result = []; - for (var id in map) { - result.push(map[id]); - } - return result; - } - ts.mapToArray = mapToArray; function copyMap(source, target) { for (var p in source) { target[p] = source[p]; @@ -984,7 +1017,7 @@ var ts; function getNormalizedParts(normalizedSlashedPath, rootLength) { var parts = normalizedSlashedPath.substr(rootLength).split(ts.directorySeparator); var normalized = []; - for (var _i = 0, _n = parts.length; _i < _n; _i++) { + for (var _i = 0; _i < parts.length; _i++) { var part = parts[_i]; if (part !== ".") { if (part === ".." && normalized.length > 0 && normalized[normalized.length - 1] !== "..") { @@ -1043,6 +1076,9 @@ var ts; } ts.getNormalizedPathFromPathComponents = getNormalizedPathFromPathComponents; function getNormalizedPathComponentsOfUrl(url) { + // Get root length of http://www.website.com/folder1/foler2/ + // In this example the root is: http://www.website.com/ + // normalized path components should be ["http://www.website.com/", "folder1", "folder2"] var urlLength = url.length; var rootLength = url.indexOf("://") + "://".length; while (rootLength < urlLength) { @@ -1126,7 +1162,7 @@ var ts; ts.fileExtensionIs = fileExtensionIs; var supportedExtensions = [".d.ts", ".ts", ".js"]; function removeFileExtension(path) { - for (var _i = 0, _n = supportedExtensions.length; _i < _n; _i++) { + for (var _i = 0; _i < supportedExtensions.length; _i++) { var ext = supportedExtensions[_i]; if (fileExtensionIs(path, ext)) { return path.substr(0, path.length - ext.length); @@ -1212,6 +1248,7 @@ var ts; Debug.fail = fail; })(Debug = ts.Debug || (ts.Debug = {})); })(ts || (ts = {})); +/// var ts; (function (ts) { ts.sys = (function () { @@ -1285,14 +1322,14 @@ var ts; function visitDirectory(path) { var folder = fso.GetFolder(path || "."); var files = getNames(folder.files); - for (var _i = 0, _n = files.length; _i < _n; _i++) { - var _name = files[_i]; - if (!extension || ts.fileExtensionIs(_name, extension)) { - result.push(ts.combinePaths(path, _name)); + for (var _i = 0; _i < files.length; _i++) { + var name_1 = files[_i]; + if (!extension || ts.fileExtensionIs(name_1, extension)) { + result.push(ts.combinePaths(path, name_1)); } } var subfolders = getNames(folder.subfolders); - for (var _a = 0, _b = subfolders.length; _a < _b; _a++) { + for (var _a = 0; _a < subfolders.length; _a++) { var current = subfolders[_a]; visitDirectory(ts.combinePaths(path, current)); } @@ -1379,7 +1416,7 @@ var ts; function visitDirectory(path) { var files = _fs.readdirSync(path || ".").sort(); var directories = []; - for (var _i = 0, _n = files.length; _i < _n; _i++) { + for (var _i = 0; _i < files.length; _i++) { var current = files[_i]; var name = ts.combinePaths(path, current); var stat = _fs.lstatSync(name); @@ -1392,9 +1429,9 @@ var ts; directories.push(name); } } - for (var _a = 0, _b = directories.length; _a < _b; _a++) { - var _current = directories[_a]; - visitDirectory(_current); + for (var _a = 0; _a < directories.length; _a++) { + var current = directories[_a]; + visitDirectory(current); } } } @@ -1463,559 +1500,585 @@ var ts; } })(); })(ts || (ts = {})); +/// var ts; (function (ts) { ts.Diagnostics = { - Unterminated_string_literal: { code: 1002, category: 1, key: "Unterminated string literal." }, - Identifier_expected: { code: 1003, category: 1, key: "Identifier expected." }, - _0_expected: { code: 1005, category: 1, key: "'{0}' expected." }, - A_file_cannot_have_a_reference_to_itself: { code: 1006, category: 1, key: "A file cannot have a reference to itself." }, - Trailing_comma_not_allowed: { code: 1009, category: 1, key: "Trailing comma not allowed." }, - Asterisk_Slash_expected: { code: 1010, category: 1, key: "'*/' expected." }, - Unexpected_token: { code: 1012, category: 1, key: "Unexpected token." }, - A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: 1, key: "A rest parameter must be last in a parameter list." }, - Parameter_cannot_have_question_mark_and_initializer: { code: 1015, category: 1, key: "Parameter cannot have question mark and initializer." }, - A_required_parameter_cannot_follow_an_optional_parameter: { code: 1016, category: 1, key: "A required parameter cannot follow an optional parameter." }, - An_index_signature_cannot_have_a_rest_parameter: { code: 1017, category: 1, key: "An index signature cannot have a rest parameter." }, - An_index_signature_parameter_cannot_have_an_accessibility_modifier: { code: 1018, category: 1, key: "An index signature parameter cannot have an accessibility modifier." }, - An_index_signature_parameter_cannot_have_a_question_mark: { code: 1019, category: 1, key: "An index signature parameter cannot have a question mark." }, - An_index_signature_parameter_cannot_have_an_initializer: { code: 1020, category: 1, key: "An index signature parameter cannot have an initializer." }, - An_index_signature_must_have_a_type_annotation: { code: 1021, category: 1, key: "An index signature must have a type annotation." }, - An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: 1, key: "An index signature parameter must have a type annotation." }, - An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: 1, key: "An index signature parameter type must be 'string' or 'number'." }, - A_class_or_interface_declaration_can_only_have_one_extends_clause: { code: 1024, category: 1, key: "A class or interface declaration can only have one 'extends' clause." }, - An_extends_clause_must_precede_an_implements_clause: { code: 1025, category: 1, key: "An 'extends' clause must precede an 'implements' clause." }, - A_class_can_only_extend_a_single_class: { code: 1026, category: 1, key: "A class can only extend a single class." }, - A_class_declaration_can_only_have_one_implements_clause: { code: 1027, category: 1, key: "A class declaration can only have one 'implements' clause." }, - Accessibility_modifier_already_seen: { code: 1028, category: 1, key: "Accessibility modifier already seen." }, - _0_modifier_must_precede_1_modifier: { code: 1029, category: 1, key: "'{0}' modifier must precede '{1}' modifier." }, - _0_modifier_already_seen: { code: 1030, category: 1, key: "'{0}' modifier already seen." }, - _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: 1, key: "'{0}' modifier cannot appear on a class element." }, - An_interface_declaration_cannot_have_an_implements_clause: { code: 1032, category: 1, key: "An interface declaration cannot have an 'implements' clause." }, - super_must_be_followed_by_an_argument_list_or_member_access: { code: 1034, category: 1, key: "'super' must be followed by an argument list or member access." }, - Only_ambient_modules_can_use_quoted_names: { code: 1035, category: 1, key: "Only ambient modules can use quoted names." }, - Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: 1, key: "Statements are not allowed in ambient contexts." }, - A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { code: 1038, category: 1, key: "A 'declare' modifier cannot be used in an already ambient context." }, - Initializers_are_not_allowed_in_ambient_contexts: { code: 1039, category: 1, key: "Initializers are not allowed in ambient contexts." }, - _0_modifier_cannot_appear_on_a_module_element: { code: 1044, category: 1, key: "'{0}' modifier cannot appear on a module element." }, - A_declare_modifier_cannot_be_used_with_an_interface_declaration: { code: 1045, category: 1, key: "A 'declare' modifier cannot be used with an interface declaration." }, - A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { code: 1046, category: 1, key: "A 'declare' modifier is required for a top level declaration in a .d.ts file." }, - A_rest_parameter_cannot_be_optional: { code: 1047, category: 1, key: "A rest parameter cannot be optional." }, - A_rest_parameter_cannot_have_an_initializer: { code: 1048, category: 1, key: "A rest parameter cannot have an initializer." }, - A_set_accessor_must_have_exactly_one_parameter: { code: 1049, category: 1, key: "A 'set' accessor must have exactly one parameter." }, - A_set_accessor_cannot_have_an_optional_parameter: { code: 1051, category: 1, key: "A 'set' accessor cannot have an optional parameter." }, - A_set_accessor_parameter_cannot_have_an_initializer: { code: 1052, category: 1, key: "A 'set' accessor parameter cannot have an initializer." }, - A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: 1, key: "A 'set' accessor cannot have rest parameter." }, - A_get_accessor_cannot_have_parameters: { code: 1054, category: 1, key: "A 'get' accessor cannot have parameters." }, - Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: 1, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, - Enum_member_must_have_initializer: { code: 1061, category: 1, key: "Enum member must have initializer." }, - An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: 1, key: "An export assignment cannot be used in an internal module." }, - Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: 1, key: "Ambient enum elements can only have integer literal initializers." }, - Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: 1, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, - A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: 1, key: "A 'declare' modifier cannot be used with an import declaration." }, - Invalid_reference_directive_syntax: { code: 1084, category: 1, key: "Invalid 'reference' directive syntax." }, - Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: 1, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, - An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: 1, key: "An accessor cannot be declared in an ambient context." }, - _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: 1, key: "'{0}' modifier cannot appear on a constructor declaration." }, - _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: 1, key: "'{0}' modifier cannot appear on a parameter." }, - Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { code: 1091, category: 1, key: "Only a single variable declaration is allowed in a 'for...in' statement." }, - Type_parameters_cannot_appear_on_a_constructor_declaration: { code: 1092, category: 1, key: "Type parameters cannot appear on a constructor declaration." }, - Type_annotation_cannot_appear_on_a_constructor_declaration: { code: 1093, category: 1, key: "Type annotation cannot appear on a constructor declaration." }, - An_accessor_cannot_have_type_parameters: { code: 1094, category: 1, key: "An accessor cannot have type parameters." }, - A_set_accessor_cannot_have_a_return_type_annotation: { code: 1095, category: 1, key: "A 'set' accessor cannot have a return type annotation." }, - An_index_signature_must_have_exactly_one_parameter: { code: 1096, category: 1, key: "An index signature must have exactly one parameter." }, - _0_list_cannot_be_empty: { code: 1097, category: 1, key: "'{0}' list cannot be empty." }, - Type_parameter_list_cannot_be_empty: { code: 1098, category: 1, key: "Type parameter list cannot be empty." }, - Type_argument_list_cannot_be_empty: { code: 1099, category: 1, key: "Type argument list cannot be empty." }, - Invalid_use_of_0_in_strict_mode: { code: 1100, category: 1, key: "Invalid use of '{0}' in strict mode." }, - with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: 1, key: "'with' statements are not allowed in strict mode." }, - delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: 1, key: "'delete' cannot be called on an identifier in strict mode." }, - A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: 1, key: "A 'continue' statement can only be used within an enclosing iteration statement." }, - A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: 1, key: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, - Jump_target_cannot_cross_function_boundary: { code: 1107, category: 1, key: "Jump target cannot cross function boundary." }, - A_return_statement_can_only_be_used_within_a_function_body: { code: 1108, category: 1, key: "A 'return' statement can only be used within a function body." }, - Expression_expected: { code: 1109, category: 1, key: "Expression expected." }, - Type_expected: { code: 1110, category: 1, key: "Type expected." }, - A_class_member_cannot_be_declared_optional: { code: 1112, category: 1, key: "A class member cannot be declared optional." }, - A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: 1, key: "A 'default' clause cannot appear more than once in a 'switch' statement." }, - Duplicate_label_0: { code: 1114, category: 1, key: "Duplicate label '{0}'" }, - A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: 1, key: "A 'continue' statement can only jump to a label of an enclosing iteration statement." }, - A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: 1, key: "A 'break' statement can only jump to a label of an enclosing statement." }, - An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: 1, key: "An object literal cannot have multiple properties with the same name in strict mode." }, - An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: { code: 1118, category: 1, key: "An object literal cannot have multiple get/set accessors with the same name." }, - An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { code: 1119, category: 1, key: "An object literal cannot have property and accessor with the same name." }, - An_export_assignment_cannot_have_modifiers: { code: 1120, category: 1, key: "An export assignment cannot have modifiers." }, - Octal_literals_are_not_allowed_in_strict_mode: { code: 1121, category: 1, key: "Octal literals are not allowed in strict mode." }, - A_tuple_type_element_list_cannot_be_empty: { code: 1122, category: 1, key: "A tuple type element list cannot be empty." }, - Variable_declaration_list_cannot_be_empty: { code: 1123, category: 1, key: "Variable declaration list cannot be empty." }, - Digit_expected: { code: 1124, category: 1, key: "Digit expected." }, - Hexadecimal_digit_expected: { code: 1125, category: 1, key: "Hexadecimal digit expected." }, - Unexpected_end_of_text: { code: 1126, category: 1, key: "Unexpected end of text." }, - Invalid_character: { code: 1127, category: 1, key: "Invalid character." }, - Declaration_or_statement_expected: { code: 1128, category: 1, key: "Declaration or statement expected." }, - Statement_expected: { code: 1129, category: 1, key: "Statement expected." }, - case_or_default_expected: { code: 1130, category: 1, key: "'case' or 'default' expected." }, - Property_or_signature_expected: { code: 1131, category: 1, key: "Property or signature expected." }, - Enum_member_expected: { code: 1132, category: 1, key: "Enum member expected." }, - Type_reference_expected: { code: 1133, category: 1, key: "Type reference expected." }, - Variable_declaration_expected: { code: 1134, category: 1, key: "Variable declaration expected." }, - Argument_expression_expected: { code: 1135, category: 1, key: "Argument expression expected." }, - Property_assignment_expected: { code: 1136, category: 1, key: "Property assignment expected." }, - Expression_or_comma_expected: { code: 1137, category: 1, key: "Expression or comma expected." }, - Parameter_declaration_expected: { code: 1138, category: 1, key: "Parameter declaration expected." }, - Type_parameter_declaration_expected: { code: 1139, category: 1, key: "Type parameter declaration expected." }, - Type_argument_expected: { code: 1140, category: 1, key: "Type argument expected." }, - String_literal_expected: { code: 1141, category: 1, key: "String literal expected." }, - Line_break_not_permitted_here: { code: 1142, category: 1, key: "Line break not permitted here." }, - or_expected: { code: 1144, category: 1, key: "'{' or ';' expected." }, - Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: 1, key: "Modifiers not permitted on index signature members." }, - Declaration_expected: { code: 1146, category: 1, key: "Declaration expected." }, - Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: 1, 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: 1, key: "Cannot compile external modules unless the '--module' flag is provided." }, - File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: 1, 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: 1, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, - var_let_or_const_expected: { code: 1152, category: 1, key: "'var', 'let' or 'const' expected." }, - let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1153, category: 1, key: "'let' declarations are only available when targeting ECMAScript 6 and higher." }, - const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1154, category: 1, key: "'const' declarations are only available when targeting ECMAScript 6 and higher." }, - const_declarations_must_be_initialized: { code: 1155, category: 1, key: "'const' declarations must be initialized" }, - const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: 1, key: "'const' declarations can only be declared inside a block." }, - let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: 1, key: "'let' declarations can only be declared inside a block." }, - Unterminated_template_literal: { code: 1160, category: 1, key: "Unterminated template literal." }, - Unterminated_regular_expression_literal: { code: 1161, category: 1, key: "Unterminated regular expression literal." }, - An_object_member_cannot_be_declared_optional: { code: 1162, category: 1, key: "An object member cannot be declared optional." }, - yield_expression_must_be_contained_within_a_generator_declaration: { code: 1163, category: 1, key: "'yield' expression must be contained_within a generator declaration." }, - Computed_property_names_are_not_allowed_in_enums: { code: 1164, category: 1, key: "Computed property names are not allowed in enums." }, - A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_symbol: { code: 1165, category: 1, key: "A computed property name in an ambient context must directly refer to a built-in symbol." }, - A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol: { code: 1166, category: 1, key: "A computed property name in a class property declaration must directly refer to a built-in symbol." }, - Computed_property_names_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1167, category: 1, key: "Computed property names are only available when targeting ECMAScript 6 and higher." }, - A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol: { code: 1168, category: 1, key: "A computed property name in a method overload must directly refer to a built-in symbol." }, - A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol: { code: 1169, category: 1, key: "A computed property name in an interface must directly refer to a built-in symbol." }, - A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol: { code: 1170, category: 1, key: "A computed property name in a type literal must directly refer to a built-in symbol." }, - A_comma_expression_is_not_allowed_in_a_computed_property_name: { code: 1171, category: 1, key: "A comma expression is not allowed in a computed property name." }, - extends_clause_already_seen: { code: 1172, category: 1, key: "'extends' clause already seen." }, - extends_clause_must_precede_implements_clause: { code: 1173, category: 1, key: "'extends' clause must precede 'implements' clause." }, - Classes_can_only_extend_a_single_class: { code: 1174, category: 1, key: "Classes can only extend a single class." }, - implements_clause_already_seen: { code: 1175, category: 1, key: "'implements' clause already seen." }, - Interface_declaration_cannot_have_implements_clause: { code: 1176, category: 1, key: "Interface declaration cannot have 'implements' clause." }, - Binary_digit_expected: { code: 1177, category: 1, key: "Binary digit expected." }, - Octal_digit_expected: { code: 1178, category: 1, key: "Octal digit expected." }, - Unexpected_token_expected: { code: 1179, category: 1, key: "Unexpected token. '{' expected." }, - Property_destructuring_pattern_expected: { code: 1180, category: 1, key: "Property destructuring pattern expected." }, - Array_element_destructuring_pattern_expected: { code: 1181, category: 1, key: "Array element destructuring pattern expected." }, - A_destructuring_declaration_must_have_an_initializer: { code: 1182, category: 1, key: "A destructuring declaration must have an initializer." }, - Destructuring_declarations_are_not_allowed_in_ambient_contexts: { code: 1183, category: 1, key: "Destructuring declarations are not allowed in ambient contexts." }, - An_implementation_cannot_be_declared_in_ambient_contexts: { code: 1184, category: 1, key: "An implementation cannot be declared in ambient contexts." }, - Modifiers_cannot_appear_here: { code: 1184, category: 1, key: "Modifiers cannot appear here." }, - Merge_conflict_marker_encountered: { code: 1185, category: 1, key: "Merge conflict marker encountered." }, - A_rest_element_cannot_have_an_initializer: { code: 1186, category: 1, key: "A rest element cannot have an initializer." }, - A_parameter_property_may_not_be_a_binding_pattern: { code: 1187, category: 1, key: "A parameter property may not be a binding pattern." }, - Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement: { code: 1188, category: 1, key: "Only a single variable declaration is allowed in a 'for...of' statement." }, - The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer: { code: 1189, category: 1, 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: 1, key: "The variable declaration of a 'for...of' statement cannot have an initializer." }, - An_import_declaration_cannot_have_modifiers: { code: 1191, category: 1, key: "An import declaration cannot have modifiers." }, - External_module_0_has_no_default_export_or_export_assignment: { code: 1192, category: 1, key: "External module '{0}' has no default export or export assignment." }, - An_export_declaration_cannot_have_modifiers: { code: 1193, category: 1, key: "An export declaration cannot have modifiers." }, - Export_declarations_are_not_permitted_in_an_internal_module: { code: 1194, category: 1, key: "Export declarations are not permitted in an internal module." }, - Catch_clause_variable_name_must_be_an_identifier: { code: 1195, category: 1, key: "Catch clause variable name must be an identifier." }, - Catch_clause_variable_cannot_have_a_type_annotation: { code: 1196, category: 1, key: "Catch clause variable cannot have a type annotation." }, - Catch_clause_variable_cannot_have_an_initializer: { code: 1197, category: 1, key: "Catch clause variable cannot have an initializer." }, - An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: { code: 1198, category: 1, key: "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive." }, - Unterminated_Unicode_escape_sequence: { code: 1199, category: 1, key: "Unterminated Unicode escape sequence." }, - Duplicate_identifier_0: { code: 2300, category: 1, key: "Duplicate identifier '{0}'." }, - Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: 1, 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: 1, key: "Static members cannot reference class type parameters." }, - Circular_definition_of_import_alias_0: { code: 2303, category: 1, key: "Circular definition of import alias '{0}'." }, - Cannot_find_name_0: { code: 2304, category: 1, key: "Cannot find name '{0}'." }, - Module_0_has_no_exported_member_1: { code: 2305, category: 1, key: "Module '{0}' has no exported member '{1}'." }, - File_0_is_not_an_external_module: { code: 2306, category: 1, key: "File '{0}' is not an external module." }, - Cannot_find_external_module_0: { code: 2307, category: 1, key: "Cannot find external module '{0}'." }, - A_module_cannot_have_more_than_one_export_assignment: { code: 2308, category: 1, 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: 1, 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: 1, key: "Type '{0}' recursively references itself as a base type." }, - A_class_may_only_extend_another_class: { code: 2311, category: 1, key: "A class may only extend another class." }, - An_interface_may_only_extend_a_class_or_another_interface: { code: 2312, category: 1, key: "An interface may only extend a class or another interface." }, - Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2313, category: 1, key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, - Generic_type_0_requires_1_type_argument_s: { code: 2314, category: 1, key: "Generic type '{0}' requires {1} type argument(s)." }, - Type_0_is_not_generic: { code: 2315, category: 1, key: "Type '{0}' is not generic." }, - Global_type_0_must_be_a_class_or_interface_type: { code: 2316, category: 1, key: "Global type '{0}' must be a class or interface type." }, - Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: 1, key: "Global type '{0}' must have {1} type parameter(s)." }, - Cannot_find_global_type_0: { code: 2318, category: 1, key: "Cannot find global type '{0}'." }, - Named_property_0_of_types_1_and_2_are_not_identical: { code: 2319, category: 1, key: "Named property '{0}' of types '{1}' and '{2}' are not identical." }, - Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: 1, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." }, - Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: 1, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, - Type_0_is_not_assignable_to_type_1: { code: 2322, category: 1, key: "Type '{0}' is not assignable to type '{1}'." }, - Property_0_is_missing_in_type_1: { code: 2324, category: 1, key: "Property '{0}' is missing in type '{1}'." }, - Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: 1, key: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, - Types_of_property_0_are_incompatible: { code: 2326, category: 1, key: "Types of property '{0}' are incompatible." }, - Property_0_is_optional_in_type_1_but_required_in_type_2: { code: 2327, category: 1, key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." }, - Types_of_parameters_0_and_1_are_incompatible: { code: 2328, category: 1, key: "Types of parameters '{0}' and '{1}' are incompatible." }, - Index_signature_is_missing_in_type_0: { code: 2329, category: 1, key: "Index signature is missing in type '{0}'." }, - Index_signatures_are_incompatible: { code: 2330, category: 1, key: "Index signatures are incompatible." }, - this_cannot_be_referenced_in_a_module_body: { code: 2331, category: 1, key: "'this' cannot be referenced in a module body." }, - this_cannot_be_referenced_in_current_location: { code: 2332, category: 1, key: "'this' cannot be referenced in current location." }, - this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: 1, key: "'this' cannot be referenced in constructor arguments." }, - this_cannot_be_referenced_in_a_static_property_initializer: { code: 2334, category: 1, key: "'this' cannot be referenced in a static property initializer." }, - super_can_only_be_referenced_in_a_derived_class: { code: 2335, category: 1, key: "'super' can only be referenced in a derived class." }, - super_cannot_be_referenced_in_constructor_arguments: { code: 2336, category: 1, key: "'super' cannot be referenced in constructor arguments." }, - Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: 2337, category: 1, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, - super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2338, category: 1, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, - Property_0_does_not_exist_on_type_1: { code: 2339, category: 1, key: "Property '{0}' does not exist on type '{1}'." }, - Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: 1, key: "Only public and protected methods of the base class are accessible via the 'super' keyword" }, - Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: 1, key: "Property '{0}' is private and only accessible within class '{1}'." }, - An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: { code: 2342, category: 1, key: "An index expression argument must be of type 'string', 'number', 'symbol, or 'any'." }, - Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: 1, key: "Type '{0}' does not satisfy the constraint '{1}'." }, - Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: 1, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, - Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: 1, key: "Supplied parameters do not match any signature of call target." }, - Untyped_function_calls_may_not_accept_type_arguments: { code: 2347, category: 1, key: "Untyped function calls may not accept type arguments." }, - Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { code: 2348, category: 1, key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" }, - Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { code: 2349, category: 1, key: "Cannot invoke an expression whose type lacks a call signature." }, - Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: 1, key: "Only a void function can be called with the 'new' keyword." }, - Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: 1, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, - Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: 1, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, - No_best_common_type_exists_among_return_expressions: { code: 2354, category: 1, key: "No best common type exists among return expressions." }, - A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: 1, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, - An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: 1, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, - The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2357, category: 1, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, - The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: 1, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, - The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: 1, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, - The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: { code: 2360, category: 1, key: "The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'." }, - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: 1, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, - The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: 1, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: 1, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - Invalid_left_hand_side_of_assignment_expression: { code: 2364, category: 1, key: "Invalid left-hand side of assignment expression." }, - Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: 1, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, - Type_parameter_name_cannot_be_0: { code: 2368, category: 1, key: "Type parameter name cannot be '{0}'" }, - A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: 1, key: "A parameter property is only allowed in a constructor implementation." }, - A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: 1, key: "A rest parameter must be of an array type." }, - A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: 1, key: "A parameter initializer is only allowed in a function or constructor implementation." }, - Parameter_0_cannot_be_referenced_in_its_initializer: { code: 2372, category: 1, key: "Parameter '{0}' cannot be referenced in its initializer." }, - Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { code: 2373, category: 1, key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." }, - Duplicate_string_index_signature: { code: 2374, category: 1, key: "Duplicate string index signature." }, - Duplicate_number_index_signature: { code: 2375, category: 1, key: "Duplicate number index signature." }, - A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: 2376, category: 1, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, - Constructors_for_derived_classes_must_contain_a_super_call: { code: 2377, category: 1, key: "Constructors for derived classes must contain a 'super' call." }, - A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2378, category: 1, key: "A 'get' accessor must return a value or consist of a single 'throw' statement." }, - Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2379, category: 1, key: "Getter and setter accessors do not agree in visibility." }, - get_and_set_accessor_must_have_the_same_type: { code: 2380, category: 1, key: "'get' and 'set' accessor must have the same type." }, - A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2381, category: 1, key: "A signature with an implementation cannot use a string literal type." }, - Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 2382, category: 1, key: "Specialized overload signature is not assignable to any non-specialized signature." }, - Overload_signatures_must_all_be_exported_or_not_exported: { code: 2383, category: 1, key: "Overload signatures must all be exported or not exported." }, - Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2384, category: 1, key: "Overload signatures must all be ambient or non-ambient." }, - Overload_signatures_must_all_be_public_private_or_protected: { code: 2385, category: 1, key: "Overload signatures must all be public, private or protected." }, - Overload_signatures_must_all_be_optional_or_required: { code: 2386, category: 1, key: "Overload signatures must all be optional or required." }, - Function_overload_must_be_static: { code: 2387, category: 1, key: "Function overload must be static." }, - Function_overload_must_not_be_static: { code: 2388, category: 1, key: "Function overload must not be static." }, - Function_implementation_name_must_be_0: { code: 2389, category: 1, key: "Function implementation name must be '{0}'." }, - Constructor_implementation_is_missing: { code: 2390, category: 1, key: "Constructor implementation is missing." }, - Function_implementation_is_missing_or_not_immediately_following_the_declaration: { code: 2391, category: 1, key: "Function implementation is missing or not immediately following the declaration." }, - Multiple_constructor_implementations_are_not_allowed: { code: 2392, category: 1, key: "Multiple constructor implementations are not allowed." }, - Duplicate_function_implementation: { code: 2393, category: 1, key: "Duplicate function implementation." }, - Overload_signature_is_not_compatible_with_function_implementation: { code: 2394, category: 1, key: "Overload signature is not compatible with function implementation." }, - Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2395, category: 1, key: "Individual declarations in merged declaration {0} must be all exported or all local." }, - Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2396, category: 1, key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, - Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2399, category: 1, key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, - Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2400, category: 1, key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, - Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2401, category: 1, key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, - Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { code: 2402, category: 1, key: "Expression resolves to '_super' that compiler uses to capture base class reference." }, - Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { code: 2403, category: 1, key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." }, - The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { code: 2404, category: 1, key: "The left-hand side of a 'for...in' statement cannot use a type annotation." }, - The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { code: 2405, category: 1, key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." }, - Invalid_left_hand_side_in_for_in_statement: { code: 2406, category: 1, key: "Invalid left-hand side in 'for...in' statement." }, - The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: 1, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, - Setters_cannot_return_a_value: { code: 2408, category: 1, key: "Setters cannot return a value." }, - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: 1, key: "Return type of constructor signature must be assignable to the instance type of the class" }, - All_symbols_within_a_with_block_will_be_resolved_to_any: { code: 2410, category: 1, key: "All symbols within a 'with' block will be resolved to 'any'." }, - Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: 1, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, - Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: 1, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, - Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: 1, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, - Class_name_cannot_be_0: { code: 2414, category: 1, key: "Class name cannot be '{0}'" }, - Class_0_incorrectly_extends_base_class_1: { code: 2415, category: 1, key: "Class '{0}' incorrectly extends base class '{1}'." }, - Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: 1, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, - Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: 1, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, - Class_0_incorrectly_implements_interface_1: { code: 2420, category: 1, key: "Class '{0}' incorrectly implements interface '{1}'." }, - A_class_may_only_implement_another_class_or_interface: { code: 2422, category: 1, key: "A class may only implement another class or interface." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: 1, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: 1, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, - Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: 1, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, - Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: 1, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, - Interface_name_cannot_be_0: { code: 2427, category: 1, key: "Interface name cannot be '{0}'" }, - All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: 1, key: "All declarations of an interface must have identical type parameters." }, - Interface_0_incorrectly_extends_interface_1: { code: 2430, category: 1, key: "Interface '{0}' incorrectly extends interface '{1}'." }, - Enum_name_cannot_be_0: { code: 2431, category: 1, 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: 1, 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: 1, 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: 1, 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: 1, key: "Ambient external modules cannot be nested in other modules." }, - Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: 1, key: "Ambient external module declaration cannot specify relative module name." }, - Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: 1, key: "Module '{0}' is hidden by a local declaration with the same name" }, - Import_name_cannot_be_0: { code: 2438, category: 1, 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: 1, key: "Import or export declaration in an ambient external module declaration cannot reference external module through relative external module name." }, - Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: 1, 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: 1, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module." }, - Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: 1, 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: 1, 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: 1, key: "Property '{0}' is protected in type '{1}' but public in type '{2}'." }, - Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { code: 2445, category: 1, key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." }, - Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: 1, key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, - The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: 1, key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, - Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: 1, key: "Block-scoped variable '{0}' used before its declaration." }, - The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant: { code: 2449, category: 1, key: "The operand of an increment or decrement operator cannot be a constant." }, - Left_hand_side_of_assignment_expression_cannot_be_a_constant: { code: 2450, category: 1, key: "Left-hand side of assignment expression cannot be a constant." }, - Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: 1, key: "Cannot redeclare block-scoped variable '{0}'." }, - An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: 1, key: "An enum member cannot have a numeric name." }, - The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: 1, key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, - Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: 1, key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, - Type_alias_0_circularly_references_itself: { code: 2456, category: 1, key: "Type alias '{0}' circularly references itself." }, - Type_alias_name_cannot_be_0: { code: 2457, category: 1, key: "Type alias name cannot be '{0}'" }, - An_AMD_module_cannot_have_multiple_name_assignments: { code: 2458, category: 1, key: "An AMD module cannot have multiple name assignments." }, - Type_0_has_no_property_1_and_no_string_index_signature: { code: 2459, category: 1, key: "Type '{0}' has no property '{1}' and no string index signature." }, - Type_0_has_no_property_1: { code: 2460, category: 1, key: "Type '{0}' has no property '{1}'." }, - Type_0_is_not_an_array_type: { code: 2461, category: 1, key: "Type '{0}' is not an array type." }, - A_rest_element_must_be_last_in_an_array_destructuring_pattern: { code: 2462, category: 1, key: "A rest element must be last in an array destructuring pattern" }, - A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: { code: 2463, category: 1, key: "A binding pattern parameter cannot be optional in an implementation signature." }, - A_computed_property_name_must_be_of_type_string_number_symbol_or_any: { code: 2464, category: 1, key: "A computed property name must be of type 'string', 'number', 'symbol', or 'any'." }, - this_cannot_be_referenced_in_a_computed_property_name: { code: 2465, category: 1, key: "'this' cannot be referenced in a computed property name." }, - super_cannot_be_referenced_in_a_computed_property_name: { code: 2466, category: 1, key: "'super' cannot be referenced in a computed property name." }, - A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: { code: 2467, category: 1, key: "A computed property name cannot reference a type parameter from its containing type." }, - Cannot_find_global_value_0: { code: 2468, category: 1, key: "Cannot find global value '{0}'." }, - The_0_operator_cannot_be_applied_to_type_symbol: { code: 2469, category: 1, key: "The '{0}' operator cannot be applied to type 'symbol'." }, - Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object: { code: 2470, category: 1, key: "'Symbol' reference does not refer to the global Symbol constructor object." }, - A_computed_property_name_of_the_form_0_must_be_of_type_symbol: { code: 2471, category: 1, key: "A computed property name of the form '{0}' must be of type 'symbol'." }, - Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_6_and_higher: { code: 2472, category: 1, key: "Spread operator in 'new' expressions is only available when targeting ECMAScript 6 and higher." }, - Enum_declarations_must_all_be_const_or_non_const: { code: 2473, category: 1, key: "Enum declarations must all be const or non-const." }, - In_const_enum_declarations_member_initializer_must_be_constant_expression: { code: 2474, category: 1, key: "In 'const' enum declarations member initializer must be constant expression." }, - const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: { code: 2475, category: 1, key: "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment." }, - A_const_enum_member_can_only_be_accessed_using_a_string_literal: { code: 2476, category: 1, key: "A const enum member can only be accessed using a string literal." }, - const_enum_member_initializer_was_evaluated_to_a_non_finite_value: { code: 2477, category: 1, key: "'const' enum member initializer was evaluated to a non-finite value." }, - const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: { code: 2478, category: 1, key: "'const' enum member initializer was evaluated to disallowed value 'NaN'." }, - Property_0_does_not_exist_on_const_enum_1: { code: 2479, category: 1, key: "Property '{0}' does not exist on 'const' enum '{1}'." }, - let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { code: 2480, category: 1, key: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." }, - Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { code: 2481, category: 1, key: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." }, - The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: { code: 2483, category: 1, key: "The left-hand side of a 'for...of' statement cannot use a type annotation." }, - Export_declaration_conflicts_with_exported_declaration_of_0: { code: 2484, category: 1, key: "Export declaration conflicts with exported declaration of '{0}'" }, - The_left_hand_side_of_a_for_of_statement_cannot_be_a_previously_defined_constant: { code: 2485, category: 1, key: "The left-hand side of a 'for...of' statement cannot be a previously defined constant." }, - The_left_hand_side_of_a_for_in_statement_cannot_be_a_previously_defined_constant: { code: 2486, category: 1, key: "The left-hand side of a 'for...in' statement cannot be a previously defined constant." }, - Invalid_left_hand_side_in_for_of_statement: { code: 2487, category: 1, key: "Invalid left-hand side in 'for...of' statement." }, - The_right_hand_side_of_a_for_of_statement_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2488, category: 1, key: "The right-hand side of a 'for...of' statement must have a '[Symbol.iterator]()' method that returns an iterator." }, - The_iterator_returned_by_the_right_hand_side_of_a_for_of_statement_must_have_a_next_method: { code: 2489, category: 1, key: "The iterator returned by the right-hand side of a 'for...of' statement must have a 'next()' method." }, - The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: { code: 2490, category: 1, key: "The type returned by the 'next()' method of an iterator must have a 'value' property." }, - The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: { code: 2491, category: 1, key: "The left-hand side of a 'for...in' statement cannot be a destructuring pattern." }, - Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: 1, key: "Cannot redeclare identifier '{0}' in catch clause" }, - Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: { code: 2493, category: 1, key: "Tuple type '{0}' with length '{1}' cannot be assigned to tuple with length '{2}'." }, - Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: { code: 2494, category: 1, 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: 2461, category: 1, key: "Type '{0}' is not an array type or a string type." }, - Import_declaration_0_is_using_private_name_1: { code: 4000, category: 1, 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: 1, 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: 1, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4006, category: 1, key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4008, category: 1, key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4010, category: 1, key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4012, category: 1, key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: 1, key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: 1, key: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, - Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: 1, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: 1, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: 1, key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, - Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: 1, key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, - Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: 1, key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, - Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: 1, key: "Exported variable '{0}' has or is using private name '{1}'." }, - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4026, category: 1, key: "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4027, category: 1, key: "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4028, category: 1, key: "Public static property '{0}' of exported class has or is using private name '{1}'." }, - Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4029, category: 1, key: "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4030, category: 1, key: "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Public_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4031, category: 1, key: "Public property '{0}' of exported class has or is using private name '{1}'." }, - Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4032, category: 1, key: "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, - Property_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4033, category: 1, key: "Property '{0}' of exported interface has or is using private name '{1}'." }, - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4034, category: 1, key: "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4035, category: 1, key: "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4036, category: 1, key: "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4037, category: 1, key: "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4038, category: 1, key: "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4039, category: 1, key: "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4040, category: 1, key: "Return type of public static property getter from exported class has or is using private name '{0}'." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4041, category: 1, key: "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4042, category: 1, key: "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4043, category: 1, key: "Return type of public property getter from exported class has or is using private name '{0}'." }, - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4044, category: 1, key: "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4045, category: 1, key: "Return type of constructor signature from exported interface has or is using private name '{0}'." }, - Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4046, category: 1, key: "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4047, category: 1, key: "Return type of call signature from exported interface has or is using private name '{0}'." }, - Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4048, category: 1, key: "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4049, category: 1, key: "Return type of index signature from exported interface has or is using private name '{0}'." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4050, category: 1, key: "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4051, category: 1, key: "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: { code: 4052, category: 1, key: "Return type of public static method from exported class has or is using private name '{0}'." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4053, category: 1, key: "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4054, category: 1, key: "Return type of public method from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: { code: 4055, category: 1, key: "Return type of public method from exported class has or is using private name '{0}'." }, - Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4056, category: 1, key: "Return type of method from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: { code: 4057, category: 1, key: "Return type of method from exported interface has or is using private name '{0}'." }, - Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4058, category: 1, key: "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: { code: 4059, category: 1, key: "Return type of exported function has or is using name '{0}' from private module '{1}'." }, - Return_type_of_exported_function_has_or_is_using_private_name_0: { code: 4060, category: 1, key: "Return type of exported function has or is using private name '{0}'." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4061, category: 1, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4062, category: 1, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: { code: 4063, category: 1, key: "Parameter '{0}' of constructor from exported class has or is using private name '{1}'." }, - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4064, category: 1, key: "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4065, category: 1, key: "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4066, category: 1, key: "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4067, category: 1, key: "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4068, category: 1, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4069, category: 1, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4070, category: 1, key: "Parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4071, category: 1, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4072, category: 1, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4073, category: 1, key: "Parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4074, category: 1, key: "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4075, category: 1, key: "Parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: 1, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: 1, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: 1, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, - Exported_type_alias_0_has_or_is_using_private_name_1: { code: 4081, category: 1, key: "Exported type alias '{0}' has or is using private name '{1}'." }, - Loop_contains_block_scoped_variable_0_referenced_by_a_function_in_the_loop_This_is_only_supported_in_ECMAScript_6_or_higher: { code: 4091, category: 1, key: "Loop contains block-scoped variable '{0}' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher." }, - The_current_host_does_not_support_the_0_option: { code: 5001, category: 1, key: "The current host does not support the '{0}' option." }, - Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: 1, key: "Cannot find the common subdirectory path for the input files." }, - Cannot_read_file_0_Colon_1: { code: 5012, category: 1, key: "Cannot read file '{0}': {1}" }, - Unsupported_file_encoding: { code: 5013, category: 1, key: "Unsupported file encoding." }, - Unknown_compiler_option_0: { code: 5023, category: 1, key: "Unknown compiler option '{0}'." }, - Compiler_option_0_requires_a_value_of_type_1: { code: 5024, category: 1, key: "Compiler option '{0}' requires a value of type {1}." }, - Could_not_write_file_0_Colon_1: { code: 5033, category: 1, key: "Could not write file '{0}': {1}" }, - Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5038, category: 1, key: "Option 'mapRoot' cannot be specified without specifying 'sourcemap' option." }, - Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5039, category: 1, key: "Option 'sourceRoot' cannot be specified without specifying 'sourcemap' option." }, - Option_noEmit_cannot_be_specified_with_option_out_or_outDir: { code: 5040, category: 1, key: "Option 'noEmit' cannot be specified with option 'out' or 'outDir'." }, - Option_noEmit_cannot_be_specified_with_option_declaration: { code: 5041, category: 1, key: "Option 'noEmit' cannot be specified with option 'declaration'." }, - Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { code: 5042, category: 1, key: "Option 'project' cannot be mixed with source files on a command line." }, - Concatenate_and_emit_output_to_single_file: { code: 6001, category: 2, key: "Concatenate and emit output to single file." }, - Generates_corresponding_d_ts_file: { code: 6002, category: 2, key: "Generates corresponding '.d.ts' file." }, - Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: 2, key: "Specifies the location where debugger should locate map files instead of generated locations." }, - Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { code: 6004, category: 2, key: "Specifies the location where debugger should locate TypeScript files instead of source locations." }, - Watch_input_files: { code: 6005, category: 2, key: "Watch input files." }, - Redirect_output_structure_to_the_directory: { code: 6006, category: 2, key: "Redirect output structure to the directory." }, - Do_not_erase_const_enum_declarations_in_generated_code: { code: 6007, category: 2, key: "Do not erase const enum declarations in generated code." }, - Do_not_emit_outputs_if_any_type_checking_errors_were_reported: { code: 6008, category: 2, key: "Do not emit outputs if any type checking errors were reported." }, - Do_not_emit_comments_to_output: { code: 6009, category: 2, key: "Do not emit comments to output." }, - Do_not_emit_outputs: { code: 6010, category: 2, key: "Do not emit outputs." }, - Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: 2, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" }, - Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: 2, key: "Specify module code generation: 'commonjs' or 'amd'" }, - Print_this_message: { code: 6017, category: 2, key: "Print this message." }, - Print_the_compiler_s_version: { code: 6019, category: 2, key: "Print the compiler's version." }, - Compile_the_project_in_the_given_directory: { code: 6020, category: 2, key: "Compile the project in the given directory." }, - Syntax_Colon_0: { code: 6023, category: 2, key: "Syntax: {0}" }, - options: { code: 6024, category: 2, key: "options" }, - file: { code: 6025, category: 2, key: "file" }, - Examples_Colon_0: { code: 6026, category: 2, key: "Examples: {0}" }, - Options_Colon: { code: 6027, category: 2, key: "Options:" }, - Version_0: { code: 6029, category: 2, key: "Version {0}" }, - Insert_command_line_options_and_files_from_a_file: { code: 6030, category: 2, key: "Insert command line options and files from a file." }, - File_change_detected_Starting_incremental_compilation: { code: 6032, category: 2, key: "File change detected. Starting incremental compilation..." }, - KIND: { code: 6034, category: 2, key: "KIND" }, - FILE: { code: 6035, category: 2, key: "FILE" }, - VERSION: { code: 6036, category: 2, key: "VERSION" }, - LOCATION: { code: 6037, category: 2, key: "LOCATION" }, - DIRECTORY: { code: 6038, category: 2, key: "DIRECTORY" }, - Compilation_complete_Watching_for_file_changes: { code: 6042, category: 2, key: "Compilation complete. Watching for file changes." }, - Generates_corresponding_map_file: { code: 6043, category: 2, key: "Generates corresponding '.map' file." }, - Compiler_option_0_expects_an_argument: { code: 6044, category: 1, key: "Compiler option '{0}' expects an argument." }, - Unterminated_quoted_string_in_response_file_0: { code: 6045, category: 1, key: "Unterminated quoted string in response file '{0}'." }, - Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: 1, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, - Argument_for_target_option_must_be_es3_es5_or_es6: { code: 6047, category: 1, 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: 1, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, - Unsupported_locale_0: { code: 6049, category: 1, key: "Unsupported locale '{0}'." }, - Unable_to_open_file_0: { code: 6050, category: 1, key: "Unable to open file '{0}'." }, - Corrupted_locale_file_0: { code: 6051, category: 1, key: "Corrupted locale file {0}." }, - Raise_error_on_expressions_and_declarations_with_an_implied_any_type: { code: 6052, category: 2, key: "Raise error on expressions and declarations with an implied 'any' type." }, - File_0_not_found: { code: 6053, category: 1, key: "File '{0}' not found." }, - File_0_must_have_extension_ts_or_d_ts: { code: 6054, category: 1, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, - Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: { code: 6055, category: 2, key: "Suppress noImplicitAny errors for indexing objects lacking index signatures." }, - Do_not_emit_declarations_for_code_that_has_an_internal_annotation: { code: 6056, category: 2, key: "Do not emit declarations for code that has an '@internal' annotation." }, - Preserve_new_lines_when_emitting_code: { code: 6057, category: 2, key: "Preserve new-lines when emitting code." }, - Variable_0_implicitly_has_an_1_type: { code: 7005, category: 1, key: "Variable '{0}' implicitly has an '{1}' type." }, - Parameter_0_implicitly_has_an_1_type: { code: 7006, category: 1, key: "Parameter '{0}' implicitly has an '{1}' type." }, - Member_0_implicitly_has_an_1_type: { code: 7008, category: 1, key: "Member '{0}' implicitly has an '{1}' type." }, - new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: { code: 7009, category: 1, key: "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type." }, - _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: 1, key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, - Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: 1, key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, - Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: 1, key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: 1, key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, - Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: 1, key: "Index signature of object type implicitly has an 'any' type." }, - Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: 1, key: "Object literal's property '{0}' implicitly has an '{1}' type." }, - Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: 1, 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: 1, 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: 1, 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: 1, 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: 1, 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: 1, 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." }, - You_cannot_rename_this_element: { code: 8000, category: 1, key: "You cannot rename this element." }, - You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: { code: 8001, category: 1, key: "You cannot rename elements that are defined in the standard TypeScript library." }, - yield_expressions_are_not_currently_supported: { code: 9000, category: 1, key: "'yield' expressions are not currently supported." }, - Generators_are_not_currently_supported: { code: 9001, category: 1, key: "Generators are not currently supported." }, - The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression: { code: 9002, category: 1, key: "The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression." } + Unterminated_string_literal: { code: 1002, category: ts.DiagnosticCategory.Error, key: "Unterminated string literal." }, + Identifier_expected: { code: 1003, category: ts.DiagnosticCategory.Error, key: "Identifier expected." }, + _0_expected: { code: 1005, category: ts.DiagnosticCategory.Error, key: "'{0}' expected." }, + A_file_cannot_have_a_reference_to_itself: { code: 1006, category: ts.DiagnosticCategory.Error, key: "A file cannot have a reference to itself." }, + Trailing_comma_not_allowed: { code: 1009, category: ts.DiagnosticCategory.Error, key: "Trailing comma not allowed." }, + Asterisk_Slash_expected: { code: 1010, category: ts.DiagnosticCategory.Error, key: "'*/' expected." }, + Unexpected_token: { code: 1012, category: ts.DiagnosticCategory.Error, key: "Unexpected token." }, + A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: ts.DiagnosticCategory.Error, key: "A rest parameter must be last in a parameter list." }, + Parameter_cannot_have_question_mark_and_initializer: { code: 1015, category: ts.DiagnosticCategory.Error, key: "Parameter cannot have question mark and initializer." }, + A_required_parameter_cannot_follow_an_optional_parameter: { code: 1016, category: ts.DiagnosticCategory.Error, key: "A required parameter cannot follow an optional parameter." }, + An_index_signature_cannot_have_a_rest_parameter: { code: 1017, category: ts.DiagnosticCategory.Error, key: "An index signature cannot have a rest parameter." }, + An_index_signature_parameter_cannot_have_an_accessibility_modifier: { code: 1018, category: ts.DiagnosticCategory.Error, key: "An index signature parameter cannot have an accessibility modifier." }, + An_index_signature_parameter_cannot_have_a_question_mark: { code: 1019, category: ts.DiagnosticCategory.Error, key: "An index signature parameter cannot have a question mark." }, + An_index_signature_parameter_cannot_have_an_initializer: { code: 1020, category: ts.DiagnosticCategory.Error, key: "An index signature parameter cannot have an initializer." }, + An_index_signature_must_have_a_type_annotation: { code: 1021, category: ts.DiagnosticCategory.Error, key: "An index signature must have a type annotation." }, + An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: ts.DiagnosticCategory.Error, key: "An index signature parameter must have a type annotation." }, + An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: ts.DiagnosticCategory.Error, key: "An index signature parameter type must be 'string' or 'number'." }, + A_class_or_interface_declaration_can_only_have_one_extends_clause: { code: 1024, category: ts.DiagnosticCategory.Error, key: "A class or interface declaration can only have one 'extends' clause." }, + An_extends_clause_must_precede_an_implements_clause: { code: 1025, category: ts.DiagnosticCategory.Error, key: "An 'extends' clause must precede an 'implements' clause." }, + A_class_can_only_extend_a_single_class: { code: 1026, category: ts.DiagnosticCategory.Error, key: "A class can only extend a single class." }, + A_class_declaration_can_only_have_one_implements_clause: { code: 1027, category: ts.DiagnosticCategory.Error, key: "A class declaration can only have one 'implements' clause." }, + Accessibility_modifier_already_seen: { code: 1028, category: ts.DiagnosticCategory.Error, key: "Accessibility modifier already seen." }, + _0_modifier_must_precede_1_modifier: { code: 1029, category: ts.DiagnosticCategory.Error, key: "'{0}' modifier must precede '{1}' modifier." }, + _0_modifier_already_seen: { code: 1030, category: ts.DiagnosticCategory.Error, key: "'{0}' modifier already seen." }, + _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: ts.DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a class element." }, + An_interface_declaration_cannot_have_an_implements_clause: { code: 1032, category: ts.DiagnosticCategory.Error, key: "An interface declaration cannot have an 'implements' clause." }, + super_must_be_followed_by_an_argument_list_or_member_access: { code: 1034, category: ts.DiagnosticCategory.Error, key: "'super' must be followed by an argument list or member access." }, + Only_ambient_modules_can_use_quoted_names: { code: 1035, category: ts.DiagnosticCategory.Error, key: "Only ambient modules can use quoted names." }, + Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: ts.DiagnosticCategory.Error, key: "Statements are not allowed in ambient contexts." }, + A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { code: 1038, category: ts.DiagnosticCategory.Error, key: "A 'declare' modifier cannot be used in an already ambient context." }, + Initializers_are_not_allowed_in_ambient_contexts: { code: 1039, category: ts.DiagnosticCategory.Error, key: "Initializers are not allowed in ambient contexts." }, + _0_modifier_cannot_appear_on_a_module_element: { code: 1044, category: ts.DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a module element." }, + A_declare_modifier_cannot_be_used_with_an_interface_declaration: { code: 1045, category: ts.DiagnosticCategory.Error, key: "A 'declare' modifier cannot be used with an interface declaration." }, + A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { code: 1046, category: ts.DiagnosticCategory.Error, key: "A 'declare' modifier is required for a top level declaration in a .d.ts file." }, + A_rest_parameter_cannot_be_optional: { code: 1047, category: ts.DiagnosticCategory.Error, key: "A rest parameter cannot be optional." }, + A_rest_parameter_cannot_have_an_initializer: { code: 1048, category: ts.DiagnosticCategory.Error, key: "A rest parameter cannot have an initializer." }, + A_set_accessor_must_have_exactly_one_parameter: { code: 1049, category: ts.DiagnosticCategory.Error, key: "A 'set' accessor must have exactly one parameter." }, + A_set_accessor_cannot_have_an_optional_parameter: { code: 1051, category: ts.DiagnosticCategory.Error, key: "A 'set' accessor cannot have an optional parameter." }, + A_set_accessor_parameter_cannot_have_an_initializer: { code: 1052, category: ts.DiagnosticCategory.Error, key: "A 'set' accessor parameter cannot have an initializer." }, + A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: ts.DiagnosticCategory.Error, key: "A 'set' accessor cannot have rest parameter." }, + 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." }, + 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." }, + Invalid_reference_directive_syntax: { code: 1084, category: ts.DiagnosticCategory.Error, key: "Invalid 'reference' directive syntax." }, + Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: ts.DiagnosticCategory.Error, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, + An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: ts.DiagnosticCategory.Error, key: "An accessor cannot be declared in an ambient context." }, + _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: ts.DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a constructor declaration." }, + _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: ts.DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a parameter." }, + Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { code: 1091, category: ts.DiagnosticCategory.Error, key: "Only a single variable declaration is allowed in a 'for...in' statement." }, + Type_parameters_cannot_appear_on_a_constructor_declaration: { code: 1092, category: ts.DiagnosticCategory.Error, key: "Type parameters cannot appear on a constructor declaration." }, + Type_annotation_cannot_appear_on_a_constructor_declaration: { code: 1093, category: ts.DiagnosticCategory.Error, key: "Type annotation cannot appear on a constructor declaration." }, + An_accessor_cannot_have_type_parameters: { code: 1094, category: ts.DiagnosticCategory.Error, key: "An accessor cannot have type parameters." }, + A_set_accessor_cannot_have_a_return_type_annotation: { code: 1095, category: ts.DiagnosticCategory.Error, key: "A 'set' accessor cannot have a return type annotation." }, + An_index_signature_must_have_exactly_one_parameter: { code: 1096, category: ts.DiagnosticCategory.Error, key: "An index signature must have exactly one parameter." }, + _0_list_cannot_be_empty: { code: 1097, category: ts.DiagnosticCategory.Error, key: "'{0}' list cannot be empty." }, + Type_parameter_list_cannot_be_empty: { code: 1098, category: ts.DiagnosticCategory.Error, key: "Type parameter list cannot be empty." }, + Type_argument_list_cannot_be_empty: { code: 1099, category: ts.DiagnosticCategory.Error, key: "Type argument list cannot be empty." }, + Invalid_use_of_0_in_strict_mode: { code: 1100, category: ts.DiagnosticCategory.Error, key: "Invalid use of '{0}' in strict mode." }, + with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: ts.DiagnosticCategory.Error, key: "'with' statements are not allowed in strict mode." }, + delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: ts.DiagnosticCategory.Error, key: "'delete' cannot be called on an identifier in strict mode." }, + A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: ts.DiagnosticCategory.Error, key: "A 'continue' statement can only be used within an enclosing iteration statement." }, + A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: ts.DiagnosticCategory.Error, key: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, + Jump_target_cannot_cross_function_boundary: { code: 1107, category: ts.DiagnosticCategory.Error, key: "Jump target cannot cross function boundary." }, + A_return_statement_can_only_be_used_within_a_function_body: { code: 1108, category: ts.DiagnosticCategory.Error, key: "A 'return' statement can only be used within a function body." }, + Expression_expected: { code: 1109, category: ts.DiagnosticCategory.Error, key: "Expression expected." }, + Type_expected: { code: 1110, category: ts.DiagnosticCategory.Error, key: "Type expected." }, + A_class_member_cannot_be_declared_optional: { code: 1112, category: ts.DiagnosticCategory.Error, key: "A class member cannot be declared optional." }, + A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: ts.DiagnosticCategory.Error, key: "A 'default' clause cannot appear more than once in a 'switch' statement." }, + Duplicate_label_0: { code: 1114, category: ts.DiagnosticCategory.Error, key: "Duplicate label '{0}'" }, + A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: ts.DiagnosticCategory.Error, key: "A 'continue' statement can only jump to a label of an enclosing iteration statement." }, + A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: ts.DiagnosticCategory.Error, key: "A 'break' statement can only jump to a label of an enclosing statement." }, + An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: ts.DiagnosticCategory.Error, key: "An object literal cannot have multiple properties with the same name in strict mode." }, + An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: { code: 1118, category: ts.DiagnosticCategory.Error, key: "An object literal cannot have multiple get/set accessors with the same name." }, + An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { code: 1119, category: ts.DiagnosticCategory.Error, key: "An object literal cannot have property and accessor with the same name." }, + An_export_assignment_cannot_have_modifiers: { code: 1120, category: ts.DiagnosticCategory.Error, key: "An export assignment cannot have modifiers." }, + Octal_literals_are_not_allowed_in_strict_mode: { code: 1121, category: ts.DiagnosticCategory.Error, key: "Octal literals are not allowed in strict mode." }, + A_tuple_type_element_list_cannot_be_empty: { code: 1122, category: ts.DiagnosticCategory.Error, key: "A tuple type element list cannot be empty." }, + Variable_declaration_list_cannot_be_empty: { code: 1123, category: ts.DiagnosticCategory.Error, key: "Variable declaration list cannot be empty." }, + Digit_expected: { code: 1124, category: ts.DiagnosticCategory.Error, key: "Digit expected." }, + Hexadecimal_digit_expected: { code: 1125, category: ts.DiagnosticCategory.Error, key: "Hexadecimal digit expected." }, + Unexpected_end_of_text: { code: 1126, category: ts.DiagnosticCategory.Error, key: "Unexpected end of text." }, + Invalid_character: { code: 1127, category: ts.DiagnosticCategory.Error, key: "Invalid character." }, + Declaration_or_statement_expected: { code: 1128, category: ts.DiagnosticCategory.Error, key: "Declaration or statement expected." }, + Statement_expected: { code: 1129, category: ts.DiagnosticCategory.Error, key: "Statement expected." }, + case_or_default_expected: { code: 1130, category: ts.DiagnosticCategory.Error, key: "'case' or 'default' expected." }, + Property_or_signature_expected: { code: 1131, category: ts.DiagnosticCategory.Error, key: "Property or signature expected." }, + Enum_member_expected: { code: 1132, category: ts.DiagnosticCategory.Error, key: "Enum member expected." }, + Type_reference_expected: { code: 1133, category: ts.DiagnosticCategory.Error, key: "Type reference expected." }, + Variable_declaration_expected: { code: 1134, category: ts.DiagnosticCategory.Error, key: "Variable declaration expected." }, + Argument_expression_expected: { code: 1135, category: ts.DiagnosticCategory.Error, key: "Argument expression expected." }, + Property_assignment_expected: { code: 1136, category: ts.DiagnosticCategory.Error, key: "Property assignment expected." }, + Expression_or_comma_expected: { code: 1137, category: ts.DiagnosticCategory.Error, key: "Expression or comma expected." }, + Parameter_declaration_expected: { code: 1138, category: ts.DiagnosticCategory.Error, key: "Parameter declaration expected." }, + Type_parameter_declaration_expected: { code: 1139, category: ts.DiagnosticCategory.Error, key: "Type parameter declaration expected." }, + Type_argument_expected: { code: 1140, category: ts.DiagnosticCategory.Error, key: "Type argument expected." }, + String_literal_expected: { code: 1141, category: ts.DiagnosticCategory.Error, key: "String literal expected." }, + Line_break_not_permitted_here: { code: 1142, category: ts.DiagnosticCategory.Error, key: "Line break not permitted here." }, + 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." }, + 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." }, + let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1153, category: ts.DiagnosticCategory.Error, key: "'let' declarations are only available when targeting ECMAScript 6 and higher." }, + const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1154, category: ts.DiagnosticCategory.Error, key: "'const' declarations are only available when targeting ECMAScript 6 and higher." }, + const_declarations_must_be_initialized: { code: 1155, category: ts.DiagnosticCategory.Error, key: "'const' declarations must be initialized" }, + const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: ts.DiagnosticCategory.Error, key: "'const' declarations can only be declared inside a block." }, + let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: ts.DiagnosticCategory.Error, key: "'let' declarations can only be declared inside a block." }, + Unterminated_template_literal: { code: 1160, category: ts.DiagnosticCategory.Error, key: "Unterminated template literal." }, + Unterminated_regular_expression_literal: { code: 1161, category: ts.DiagnosticCategory.Error, key: "Unterminated regular expression literal." }, + An_object_member_cannot_be_declared_optional: { code: 1162, category: ts.DiagnosticCategory.Error, key: "An object member cannot be declared optional." }, + yield_expression_must_be_contained_within_a_generator_declaration: { code: 1163, category: ts.DiagnosticCategory.Error, key: "'yield' expression must be contained_within a generator declaration." }, + Computed_property_names_are_not_allowed_in_enums: { code: 1164, category: ts.DiagnosticCategory.Error, key: "Computed property names are not allowed in enums." }, + A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_symbol: { code: 1165, category: ts.DiagnosticCategory.Error, key: "A computed property name in an ambient context must directly refer to a built-in symbol." }, + A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol: { code: 1166, category: ts.DiagnosticCategory.Error, key: "A computed property name in a class property declaration must directly refer to a built-in symbol." }, + Computed_property_names_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1167, category: ts.DiagnosticCategory.Error, key: "Computed property names are only available when targeting ECMAScript 6 and higher." }, + A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol: { code: 1168, category: ts.DiagnosticCategory.Error, key: "A computed property name in a method overload must directly refer to a built-in symbol." }, + A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol: { code: 1169, category: ts.DiagnosticCategory.Error, key: "A computed property name in an interface must directly refer to a built-in symbol." }, + A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol: { code: 1170, category: ts.DiagnosticCategory.Error, key: "A computed property name in a type literal must directly refer to a built-in symbol." }, + A_comma_expression_is_not_allowed_in_a_computed_property_name: { code: 1171, category: ts.DiagnosticCategory.Error, key: "A comma expression is not allowed in a computed property name." }, + extends_clause_already_seen: { code: 1172, category: ts.DiagnosticCategory.Error, key: "'extends' clause already seen." }, + extends_clause_must_precede_implements_clause: { code: 1173, category: ts.DiagnosticCategory.Error, key: "'extends' clause must precede 'implements' clause." }, + Classes_can_only_extend_a_single_class: { code: 1174, category: ts.DiagnosticCategory.Error, key: "Classes can only extend a single class." }, + implements_clause_already_seen: { code: 1175, category: ts.DiagnosticCategory.Error, key: "'implements' clause already seen." }, + Interface_declaration_cannot_have_implements_clause: { code: 1176, category: ts.DiagnosticCategory.Error, key: "Interface declaration cannot have 'implements' clause." }, + Binary_digit_expected: { code: 1177, category: ts.DiagnosticCategory.Error, key: "Binary digit expected." }, + Octal_digit_expected: { code: 1178, category: ts.DiagnosticCategory.Error, key: "Octal digit expected." }, + Unexpected_token_expected: { code: 1179, category: ts.DiagnosticCategory.Error, key: "Unexpected token. '{' expected." }, + Property_destructuring_pattern_expected: { code: 1180, category: ts.DiagnosticCategory.Error, key: "Property destructuring pattern expected." }, + Array_element_destructuring_pattern_expected: { code: 1181, category: ts.DiagnosticCategory.Error, key: "Array element destructuring pattern expected." }, + A_destructuring_declaration_must_have_an_initializer: { code: 1182, category: ts.DiagnosticCategory.Error, key: "A destructuring declaration must have an initializer." }, + Destructuring_declarations_are_not_allowed_in_ambient_contexts: { code: 1183, category: ts.DiagnosticCategory.Error, key: "Destructuring declarations are not allowed in ambient contexts." }, + An_implementation_cannot_be_declared_in_ambient_contexts: { code: 1184, category: ts.DiagnosticCategory.Error, key: "An implementation cannot be declared in ambient contexts." }, + Modifiers_cannot_appear_here: { code: 1184, category: ts.DiagnosticCategory.Error, key: "Modifiers cannot appear here." }, + Merge_conflict_marker_encountered: { code: 1185, category: ts.DiagnosticCategory.Error, key: "Merge conflict marker encountered." }, + A_rest_element_cannot_have_an_initializer: { code: 1186, category: ts.DiagnosticCategory.Error, key: "A rest element cannot have an initializer." }, + A_parameter_property_may_not_be_a_binding_pattern: { code: 1187, category: ts.DiagnosticCategory.Error, key: "A parameter property may not be a binding pattern." }, + Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement: { code: 1188, category: ts.DiagnosticCategory.Error, key: "Only a single variable declaration is allowed in a 'for...of' statement." }, + 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." }, + 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." }, + 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." }, + An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: { code: 1198, category: ts.DiagnosticCategory.Error, key: "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive." }, + Unterminated_Unicode_escape_sequence: { code: 1199, category: ts.DiagnosticCategory.Error, key: "Unterminated Unicode escape sequence." }, + Line_terminator_not_permitted_before_arrow: { code: 1200, category: ts.DiagnosticCategory.Error, key: "Line terminator not permitted before arrow." }, + A_type_annotation_on_an_export_statement_is_only_allowed_in_an_ambient_external_module_declaration: { code: 1201, category: ts.DiagnosticCategory.Error, key: "A type annotation on an export statement is only allowed in an ambient external module declaration." }, + 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." }, + 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." }, + 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." }, + 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}'." }, + 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." }, + A_class_may_only_extend_another_class: { code: 2311, category: ts.DiagnosticCategory.Error, key: "A class may only extend another class." }, + An_interface_may_only_extend_a_class_or_another_interface: { code: 2312, category: ts.DiagnosticCategory.Error, key: "An interface may only extend a class or another interface." }, + Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2313, category: ts.DiagnosticCategory.Error, key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, + Generic_type_0_requires_1_type_argument_s: { code: 2314, category: ts.DiagnosticCategory.Error, key: "Generic type '{0}' requires {1} type argument(s)." }, + Type_0_is_not_generic: { code: 2315, category: ts.DiagnosticCategory.Error, key: "Type '{0}' is not generic." }, + Global_type_0_must_be_a_class_or_interface_type: { code: 2316, category: ts.DiagnosticCategory.Error, key: "Global type '{0}' must be a class or interface type." }, + Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: ts.DiagnosticCategory.Error, key: "Global type '{0}' must have {1} type parameter(s)." }, + Cannot_find_global_type_0: { code: 2318, category: ts.DiagnosticCategory.Error, key: "Cannot find global type '{0}'." }, + Named_property_0_of_types_1_and_2_are_not_identical: { code: 2319, category: ts.DiagnosticCategory.Error, key: "Named property '{0}' of types '{1}' and '{2}' are not identical." }, + Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: ts.DiagnosticCategory.Error, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." }, + Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: ts.DiagnosticCategory.Error, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, + Type_0_is_not_assignable_to_type_1: { code: 2322, category: ts.DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}'." }, + Property_0_is_missing_in_type_1: { code: 2324, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is missing in type '{1}'." }, + Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, + Types_of_property_0_are_incompatible: { code: 2326, category: ts.DiagnosticCategory.Error, key: "Types of property '{0}' are incompatible." }, + Property_0_is_optional_in_type_1_but_required_in_type_2: { code: 2327, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." }, + 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_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." }, + super_can_only_be_referenced_in_a_derived_class: { code: 2335, category: ts.DiagnosticCategory.Error, key: "'super' can only be referenced in a derived class." }, + super_cannot_be_referenced_in_constructor_arguments: { code: 2336, category: ts.DiagnosticCategory.Error, key: "'super' cannot be referenced in constructor arguments." }, + Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: 2337, category: ts.DiagnosticCategory.Error, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, + super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2338, category: ts.DiagnosticCategory.Error, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, + Property_0_does_not_exist_on_type_1: { code: 2339, category: ts.DiagnosticCategory.Error, key: "Property '{0}' does not exist on type '{1}'." }, + Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: ts.DiagnosticCategory.Error, key: "Only public and protected methods of the base class are accessible via the 'super' keyword" }, + Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is private and only accessible within class '{1}'." }, + An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: { code: 2342, category: ts.DiagnosticCategory.Error, key: "An index expression argument must be of type 'string', 'number', 'symbol, or 'any'." }, + Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: ts.DiagnosticCategory.Error, key: "Type '{0}' does not satisfy the constraint '{1}'." }, + Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: ts.DiagnosticCategory.Error, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, + Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: ts.DiagnosticCategory.Error, key: "Supplied parameters do not match any signature of call target." }, + Untyped_function_calls_may_not_accept_type_arguments: { code: 2347, category: ts.DiagnosticCategory.Error, key: "Untyped function calls may not accept type arguments." }, + Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { code: 2348, category: ts.DiagnosticCategory.Error, key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" }, + Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { code: 2349, category: ts.DiagnosticCategory.Error, key: "Cannot invoke an expression whose type lacks a call signature." }, + Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: ts.DiagnosticCategory.Error, key: "Only a void function can be called with the 'new' keyword." }, + Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: ts.DiagnosticCategory.Error, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, + Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: ts.DiagnosticCategory.Error, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, + No_best_common_type_exists_among_return_expressions: { code: 2354, category: ts.DiagnosticCategory.Error, key: "No best common type exists among return expressions." }, + A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: ts.DiagnosticCategory.Error, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, + An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: ts.DiagnosticCategory.Error, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, + The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2357, category: ts.DiagnosticCategory.Error, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, + The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: ts.DiagnosticCategory.Error, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, + The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: ts.DiagnosticCategory.Error, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, + The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: { code: 2360, category: ts.DiagnosticCategory.Error, key: "The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'." }, + The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: ts.DiagnosticCategory.Error, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, + The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: ts.DiagnosticCategory.Error, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, + The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: ts.DiagnosticCategory.Error, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, + Invalid_left_hand_side_of_assignment_expression: { code: 2364, category: ts.DiagnosticCategory.Error, key: "Invalid left-hand side of assignment expression." }, + Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: ts.DiagnosticCategory.Error, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, + Type_parameter_name_cannot_be_0: { code: 2368, category: ts.DiagnosticCategory.Error, key: "Type parameter name cannot be '{0}'" }, + A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: ts.DiagnosticCategory.Error, key: "A parameter property is only allowed in a constructor implementation." }, + A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: ts.DiagnosticCategory.Error, key: "A rest parameter must be of an array type." }, + A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: ts.DiagnosticCategory.Error, key: "A parameter initializer is only allowed in a function or constructor implementation." }, + Parameter_0_cannot_be_referenced_in_its_initializer: { code: 2372, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' cannot be referenced in its initializer." }, + Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { code: 2373, category: ts.DiagnosticCategory.Error, key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." }, + Duplicate_string_index_signature: { code: 2374, category: ts.DiagnosticCategory.Error, key: "Duplicate string index signature." }, + Duplicate_number_index_signature: { code: 2375, category: ts.DiagnosticCategory.Error, key: "Duplicate number index signature." }, + A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: 2376, category: ts.DiagnosticCategory.Error, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, + Constructors_for_derived_classes_must_contain_a_super_call: { code: 2377, category: ts.DiagnosticCategory.Error, key: "Constructors for derived classes must contain a 'super' call." }, + A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2378, category: ts.DiagnosticCategory.Error, key: "A 'get' accessor must return a value or consist of a single 'throw' statement." }, + Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2379, category: ts.DiagnosticCategory.Error, key: "Getter and setter accessors do not agree in visibility." }, + get_and_set_accessor_must_have_the_same_type: { code: 2380, category: ts.DiagnosticCategory.Error, key: "'get' and 'set' accessor must have the same type." }, + A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2381, category: ts.DiagnosticCategory.Error, key: "A signature with an implementation cannot use a string literal type." }, + Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 2382, category: ts.DiagnosticCategory.Error, key: "Specialized overload signature is not assignable to any non-specialized signature." }, + Overload_signatures_must_all_be_exported_or_not_exported: { code: 2383, category: ts.DiagnosticCategory.Error, key: "Overload signatures must all be exported or not exported." }, + Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2384, category: ts.DiagnosticCategory.Error, key: "Overload signatures must all be ambient or non-ambient." }, + Overload_signatures_must_all_be_public_private_or_protected: { code: 2385, category: ts.DiagnosticCategory.Error, key: "Overload signatures must all be public, private or protected." }, + Overload_signatures_must_all_be_optional_or_required: { code: 2386, category: ts.DiagnosticCategory.Error, key: "Overload signatures must all be optional or required." }, + Function_overload_must_be_static: { code: 2387, category: ts.DiagnosticCategory.Error, key: "Function overload must be static." }, + Function_overload_must_not_be_static: { code: 2388, category: ts.DiagnosticCategory.Error, key: "Function overload must not be static." }, + Function_implementation_name_must_be_0: { code: 2389, category: ts.DiagnosticCategory.Error, key: "Function implementation name must be '{0}'." }, + Constructor_implementation_is_missing: { code: 2390, category: ts.DiagnosticCategory.Error, key: "Constructor implementation is missing." }, + Function_implementation_is_missing_or_not_immediately_following_the_declaration: { code: 2391, category: ts.DiagnosticCategory.Error, key: "Function implementation is missing or not immediately following the declaration." }, + Multiple_constructor_implementations_are_not_allowed: { code: 2392, category: ts.DiagnosticCategory.Error, key: "Multiple constructor implementations are not allowed." }, + Duplicate_function_implementation: { code: 2393, category: ts.DiagnosticCategory.Error, key: "Duplicate function implementation." }, + Overload_signature_is_not_compatible_with_function_implementation: { code: 2394, category: ts.DiagnosticCategory.Error, key: "Overload signature is not compatible with function implementation." }, + Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2395, category: ts.DiagnosticCategory.Error, key: "Individual declarations in merged declaration {0} must be all exported or all local." }, + Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2396, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, + Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2399, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, + Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2400, category: ts.DiagnosticCategory.Error, key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, + Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2401, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, + Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { code: 2402, category: ts.DiagnosticCategory.Error, key: "Expression resolves to '_super' that compiler uses to capture base class reference." }, + Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { code: 2403, category: ts.DiagnosticCategory.Error, key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." }, + The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { code: 2404, category: ts.DiagnosticCategory.Error, key: "The left-hand side of a 'for...in' statement cannot use a type annotation." }, + The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { code: 2405, category: ts.DiagnosticCategory.Error, key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." }, + Invalid_left_hand_side_in_for_in_statement: { code: 2406, category: ts.DiagnosticCategory.Error, key: "Invalid left-hand side in 'for...in' statement." }, + The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: ts.DiagnosticCategory.Error, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, + Setters_cannot_return_a_value: { code: 2408, category: ts.DiagnosticCategory.Error, key: "Setters cannot return a value." }, + Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: ts.DiagnosticCategory.Error, key: "Return type of constructor signature must be assignable to the instance type of the class" }, + All_symbols_within_a_with_block_will_be_resolved_to_any: { code: 2410, category: ts.DiagnosticCategory.Error, key: "All symbols within a 'with' block will be resolved to 'any'." }, + Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: ts.DiagnosticCategory.Error, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, + Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: ts.DiagnosticCategory.Error, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, + Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: ts.DiagnosticCategory.Error, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, + Class_name_cannot_be_0: { code: 2414, category: ts.DiagnosticCategory.Error, key: "Class name cannot be '{0}'" }, + Class_0_incorrectly_extends_base_class_1: { code: 2415, category: ts.DiagnosticCategory.Error, key: "Class '{0}' incorrectly extends base class '{1}'." }, + Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: ts.DiagnosticCategory.Error, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, + Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: ts.DiagnosticCategory.Error, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, + Class_0_incorrectly_implements_interface_1: { code: 2420, category: ts.DiagnosticCategory.Error, key: "Class '{0}' incorrectly implements interface '{1}'." }, + A_class_may_only_implement_another_class_or_interface: { code: 2422, category: ts.DiagnosticCategory.Error, key: "A class may only implement another class or interface." }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: ts.DiagnosticCategory.Error, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: ts.DiagnosticCategory.Error, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, + Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: ts.DiagnosticCategory.Error, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, + Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: ts.DiagnosticCategory.Error, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, + Interface_name_cannot_be_0: { code: 2427, category: ts.DiagnosticCategory.Error, key: "Interface name cannot be '{0}'" }, + All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: ts.DiagnosticCategory.Error, key: "All declarations of an interface must have identical type parameters." }, + 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." }, + 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_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." }, + 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}'." }, + Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { code: 2445, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." }, + Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, + The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: ts.DiagnosticCategory.Error, key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, + Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: ts.DiagnosticCategory.Error, key: "Block-scoped variable '{0}' used before its declaration." }, + The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant: { code: 2449, category: ts.DiagnosticCategory.Error, key: "The operand of an increment or decrement operator cannot be a constant." }, + Left_hand_side_of_assignment_expression_cannot_be_a_constant: { code: 2450, category: ts.DiagnosticCategory.Error, key: "Left-hand side of assignment expression cannot be a constant." }, + Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: ts.DiagnosticCategory.Error, key: "Cannot redeclare block-scoped variable '{0}'." }, + An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: ts.DiagnosticCategory.Error, key: "An enum member cannot have a numeric name." }, + The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: ts.DiagnosticCategory.Error, key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, + Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: ts.DiagnosticCategory.Error, key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, + Type_alias_0_circularly_references_itself: { code: 2456, category: ts.DiagnosticCategory.Error, key: "Type alias '{0}' circularly references itself." }, + Type_alias_name_cannot_be_0: { code: 2457, category: ts.DiagnosticCategory.Error, key: "Type alias name cannot be '{0}'" }, + An_AMD_module_cannot_have_multiple_name_assignments: { code: 2458, category: ts.DiagnosticCategory.Error, key: "An AMD module cannot have multiple name assignments." }, + Type_0_has_no_property_1_and_no_string_index_signature: { code: 2459, category: ts.DiagnosticCategory.Error, key: "Type '{0}' has no property '{1}' and no string index signature." }, + Type_0_has_no_property_1: { code: 2460, category: ts.DiagnosticCategory.Error, key: "Type '{0}' has no property '{1}'." }, + Type_0_is_not_an_array_type: { code: 2461, category: ts.DiagnosticCategory.Error, key: "Type '{0}' is not an array type." }, + A_rest_element_must_be_last_in_an_array_destructuring_pattern: { code: 2462, category: ts.DiagnosticCategory.Error, key: "A rest element must be last in an array destructuring pattern" }, + A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: { code: 2463, category: ts.DiagnosticCategory.Error, key: "A binding pattern parameter cannot be optional in an implementation signature." }, + A_computed_property_name_must_be_of_type_string_number_symbol_or_any: { code: 2464, category: ts.DiagnosticCategory.Error, key: "A computed property name must be of type 'string', 'number', 'symbol', or 'any'." }, + this_cannot_be_referenced_in_a_computed_property_name: { code: 2465, category: ts.DiagnosticCategory.Error, key: "'this' cannot be referenced in a computed property name." }, + super_cannot_be_referenced_in_a_computed_property_name: { code: 2466, category: ts.DiagnosticCategory.Error, key: "'super' cannot be referenced in a computed property name." }, + A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: { code: 2467, category: ts.DiagnosticCategory.Error, key: "A computed property name cannot reference a type parameter from its containing type." }, + Cannot_find_global_value_0: { code: 2468, category: ts.DiagnosticCategory.Error, key: "Cannot find global value '{0}'." }, + The_0_operator_cannot_be_applied_to_type_symbol: { code: 2469, category: ts.DiagnosticCategory.Error, key: "The '{0}' operator cannot be applied to type 'symbol'." }, + Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object: { code: 2470, category: ts.DiagnosticCategory.Error, key: "'Symbol' reference does not refer to the global Symbol constructor object." }, + A_computed_property_name_of_the_form_0_must_be_of_type_symbol: { code: 2471, category: ts.DiagnosticCategory.Error, key: "A computed property name of the form '{0}' must be of type 'symbol'." }, + Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_6_and_higher: { code: 2472, category: ts.DiagnosticCategory.Error, key: "Spread operator in 'new' expressions is only available when targeting ECMAScript 6 and higher." }, + Enum_declarations_must_all_be_const_or_non_const: { code: 2473, category: ts.DiagnosticCategory.Error, key: "Enum declarations must all be const or non-const." }, + In_const_enum_declarations_member_initializer_must_be_constant_expression: { code: 2474, category: ts.DiagnosticCategory.Error, key: "In 'const' enum declarations member initializer must be constant expression." }, + const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: { code: 2475, category: ts.DiagnosticCategory.Error, key: "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment." }, + A_const_enum_member_can_only_be_accessed_using_a_string_literal: { code: 2476, category: ts.DiagnosticCategory.Error, key: "A const enum member can only be accessed using a string literal." }, + const_enum_member_initializer_was_evaluated_to_a_non_finite_value: { code: 2477, category: ts.DiagnosticCategory.Error, key: "'const' enum member initializer was evaluated to a non-finite value." }, + const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: { code: 2478, category: ts.DiagnosticCategory.Error, key: "'const' enum member initializer was evaluated to disallowed value 'NaN'." }, + Property_0_does_not_exist_on_const_enum_1: { code: 2479, category: ts.DiagnosticCategory.Error, key: "Property '{0}' does not exist on 'const' enum '{1}'." }, + let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { code: 2480, category: ts.DiagnosticCategory.Error, key: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." }, + Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { code: 2481, category: ts.DiagnosticCategory.Error, key: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." }, + The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: { code: 2483, category: ts.DiagnosticCategory.Error, key: "The left-hand side of a 'for...of' statement cannot use a type annotation." }, + Export_declaration_conflicts_with_exported_declaration_of_0: { code: 2484, category: ts.DiagnosticCategory.Error, key: "Export declaration conflicts with exported declaration of '{0}'" }, + The_left_hand_side_of_a_for_of_statement_cannot_be_a_previously_defined_constant: { code: 2485, category: ts.DiagnosticCategory.Error, key: "The left-hand side of a 'for...of' statement cannot be a previously defined constant." }, + The_left_hand_side_of_a_for_in_statement_cannot_be_a_previously_defined_constant: { code: 2486, category: ts.DiagnosticCategory.Error, key: "The left-hand side of a 'for...in' statement cannot be a previously defined constant." }, + Invalid_left_hand_side_in_for_of_statement: { code: 2487, category: ts.DiagnosticCategory.Error, key: "Invalid left-hand side in 'for...of' statement." }, + The_right_hand_side_of_a_for_of_statement_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2488, category: ts.DiagnosticCategory.Error, key: "The right-hand side of a 'for...of' statement must have a '[Symbol.iterator]()' method that returns an iterator." }, + The_iterator_returned_by_the_right_hand_side_of_a_for_of_statement_must_have_a_next_method: { code: 2489, category: ts.DiagnosticCategory.Error, key: "The iterator returned by the right-hand side of a 'for...of' statement must have a 'next()' method." }, + The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: { code: 2490, category: ts.DiagnosticCategory.Error, key: "The type returned by the 'next()' method of an iterator must have a 'value' property." }, + The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: { code: 2491, category: ts.DiagnosticCategory.Error, key: "The left-hand side of a 'for...in' statement cannot be a destructuring pattern." }, + Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: ts.DiagnosticCategory.Error, key: "Cannot redeclare identifier '{0}' in catch clause" }, + Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: { code: 2493, category: ts.DiagnosticCategory.Error, key: "Tuple type '{0}' with length '{1}' cannot be assigned to tuple with length '{2}'." }, + 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_Consider_using_a_standard_function_expression: { code: 2496, category: ts.DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an arrow function. 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 *'." }, + 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." }, + 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}'." }, + Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4006, category: ts.DiagnosticCategory.Error, key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4008, category: ts.DiagnosticCategory.Error, key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4010, category: ts.DiagnosticCategory.Error, key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, + Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4012, category: ts.DiagnosticCategory.Error, key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." }, + Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: ts.DiagnosticCategory.Error, key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: ts.DiagnosticCategory.Error, key: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, + Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: ts.DiagnosticCategory.Error, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, + Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: ts.DiagnosticCategory.Error, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, + Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: ts.DiagnosticCategory.Error, key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, + Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: ts.DiagnosticCategory.Error, key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, + Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: ts.DiagnosticCategory.Error, key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, + Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: ts.DiagnosticCategory.Error, key: "Exported variable '{0}' has or is using private name '{1}'." }, + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4026, category: ts.DiagnosticCategory.Error, key: "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4027, category: ts.DiagnosticCategory.Error, key: "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, + Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4028, category: ts.DiagnosticCategory.Error, key: "Public static property '{0}' of exported class has or is using private name '{1}'." }, + Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4029, category: ts.DiagnosticCategory.Error, key: "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4030, category: ts.DiagnosticCategory.Error, key: "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, + Public_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4031, category: ts.DiagnosticCategory.Error, key: "Public property '{0}' of exported class has or is using private name '{1}'." }, + Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4032, category: ts.DiagnosticCategory.Error, key: "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, + Property_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4033, category: ts.DiagnosticCategory.Error, key: "Property '{0}' of exported interface has or is using private name '{1}'." }, + Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4034, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4035, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'." }, + Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4036, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4037, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'." }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4038, category: ts.DiagnosticCategory.Error, key: "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4039, category: ts.DiagnosticCategory.Error, key: "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4040, category: ts.DiagnosticCategory.Error, key: "Return type of public static property getter from exported class has or is using private name '{0}'." }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4041, category: ts.DiagnosticCategory.Error, key: "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4042, category: ts.DiagnosticCategory.Error, key: "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4043, category: ts.DiagnosticCategory.Error, key: "Return type of public property getter from exported class has or is using private name '{0}'." }, + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4044, category: ts.DiagnosticCategory.Error, key: "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4045, category: ts.DiagnosticCategory.Error, key: "Return type of constructor signature from exported interface has or is using private name '{0}'." }, + Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4046, category: ts.DiagnosticCategory.Error, key: "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4047, category: ts.DiagnosticCategory.Error, key: "Return type of call signature from exported interface has or is using private name '{0}'." }, + Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4048, category: ts.DiagnosticCategory.Error, key: "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4049, category: ts.DiagnosticCategory.Error, key: "Return type of index signature from exported interface has or is using private name '{0}'." }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4050, category: ts.DiagnosticCategory.Error, key: "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4051, category: ts.DiagnosticCategory.Error, key: "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: { code: 4052, category: ts.DiagnosticCategory.Error, key: "Return type of public static method from exported class has or is using private name '{0}'." }, + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4053, category: ts.DiagnosticCategory.Error, key: "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4054, category: ts.DiagnosticCategory.Error, key: "Return type of public method from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: { code: 4055, category: ts.DiagnosticCategory.Error, key: "Return type of public method from exported class has or is using private name '{0}'." }, + Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4056, category: ts.DiagnosticCategory.Error, key: "Return type of method from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: { code: 4057, category: ts.DiagnosticCategory.Error, key: "Return type of method from exported interface has or is using private name '{0}'." }, + Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4058, category: ts.DiagnosticCategory.Error, key: "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: { code: 4059, category: ts.DiagnosticCategory.Error, key: "Return type of exported function has or is using name '{0}' from private module '{1}'." }, + Return_type_of_exported_function_has_or_is_using_private_name_0: { code: 4060, category: ts.DiagnosticCategory.Error, key: "Return type of exported function has or is using private name '{0}'." }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4061, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4062, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: { code: 4063, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of constructor from exported class has or is using private name '{1}'." }, + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4064, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4065, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4066, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4067, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4068, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4069, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4070, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4071, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4072, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4073, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public method from exported class has or is using private name '{1}'." }, + Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4074, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4075, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of method from exported interface has or is using private name '{1}'." }, + Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, + Exported_type_alias_0_has_or_is_using_private_name_1: { code: 4081, category: ts.DiagnosticCategory.Error, key: "Exported type alias '{0}' has or is using private name '{1}'." }, + Default_export_of_the_module_has_or_is_using_private_name_0: { code: 4082, category: ts.DiagnosticCategory.Error, key: "Default export of the module has or is using private name '{0}'." }, + Loop_contains_block_scoped_variable_0_referenced_by_a_function_in_the_loop_This_is_only_supported_in_ECMAScript_6_or_higher: { code: 4091, category: ts.DiagnosticCategory.Error, key: "Loop contains block-scoped variable '{0}' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher." }, + The_current_host_does_not_support_the_0_option: { code: 5001, category: ts.DiagnosticCategory.Error, key: "The current host does not support the '{0}' option." }, + 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." }, + 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}" }, + Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5038, category: ts.DiagnosticCategory.Error, key: "Option 'mapRoot' cannot be specified without specifying 'sourcemap' option." }, + Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5039, category: ts.DiagnosticCategory.Error, key: "Option 'sourceRoot' cannot be specified without specifying 'sourcemap' option." }, + Option_noEmit_cannot_be_specified_with_option_out_or_outDir: { code: 5040, category: ts.DiagnosticCategory.Error, key: "Option 'noEmit' cannot be specified with option 'out' or 'outDir'." }, + Option_noEmit_cannot_be_specified_with_option_declaration: { code: 5041, category: ts.DiagnosticCategory.Error, key: "Option 'noEmit' cannot be specified with option 'declaration'." }, + Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { code: 5042, category: ts.DiagnosticCategory.Error, key: "Option 'project' cannot be mixed with source files on a command line." }, + Option_sourceMap_cannot_be_specified_with_option_separateCompilation: { code: 5043, category: ts.DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'separateCompilation'." }, + Option_declaration_cannot_be_specified_with_option_separateCompilation: { code: 5044, category: ts.DiagnosticCategory.Error, key: "Option 'declaration' cannot be specified with option 'separateCompilation'." }, + 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." }, + 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." }, + Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { code: 6004, category: ts.DiagnosticCategory.Message, key: "Specifies the location where debugger should locate TypeScript files instead of source locations." }, + Watch_input_files: { code: 6005, category: ts.DiagnosticCategory.Message, key: "Watch input files." }, + Redirect_output_structure_to_the_directory: { code: 6006, category: ts.DiagnosticCategory.Message, key: "Redirect output structure to the directory." }, + Do_not_erase_const_enum_declarations_in_generated_code: { code: 6007, category: ts.DiagnosticCategory.Message, key: "Do not erase const enum declarations in generated code." }, + Do_not_emit_outputs_if_any_type_checking_errors_were_reported: { code: 6008, category: ts.DiagnosticCategory.Message, key: "Do not emit outputs if any type checking errors were reported." }, + 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'" }, + 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." }, + Syntax_Colon_0: { code: 6023, category: ts.DiagnosticCategory.Message, key: "Syntax: {0}" }, + options: { code: 6024, category: ts.DiagnosticCategory.Message, key: "options" }, + file: { code: 6025, category: ts.DiagnosticCategory.Message, key: "file" }, + Examples_Colon_0: { code: 6026, category: ts.DiagnosticCategory.Message, key: "Examples: {0}" }, + Options_Colon: { code: 6027, category: ts.DiagnosticCategory.Message, key: "Options:" }, + Version_0: { code: 6029, category: ts.DiagnosticCategory.Message, key: "Version {0}" }, + Insert_command_line_options_and_files_from_a_file: { code: 6030, category: ts.DiagnosticCategory.Message, key: "Insert command line options and files from a file." }, + File_change_detected_Starting_incremental_compilation: { code: 6032, category: ts.DiagnosticCategory.Message, key: "File change detected. Starting incremental compilation..." }, + KIND: { code: 6034, category: ts.DiagnosticCategory.Message, key: "KIND" }, + FILE: { code: 6035, category: ts.DiagnosticCategory.Message, key: "FILE" }, + VERSION: { code: 6036, category: ts.DiagnosticCategory.Message, key: "VERSION" }, + LOCATION: { code: 6037, category: ts.DiagnosticCategory.Message, key: "LOCATION" }, + DIRECTORY: { code: 6038, category: ts.DiagnosticCategory.Message, key: "DIRECTORY" }, + Compilation_complete_Watching_for_file_changes: { code: 6042, category: ts.DiagnosticCategory.Message, key: "Compilation complete. Watching for file changes." }, + 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'." }, + 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}'." }, + Corrupted_locale_file_0: { code: 6051, category: ts.DiagnosticCategory.Error, key: "Corrupted locale file {0}." }, + Raise_error_on_expressions_and_declarations_with_an_implied_any_type: { code: 6052, category: ts.DiagnosticCategory.Message, key: "Raise error on expressions and declarations with an implied 'any' type." }, + File_0_not_found: { code: 6053, category: ts.DiagnosticCategory.Error, key: "File '{0}' not found." }, + File_0_must_have_extension_ts_or_d_ts: { code: 6054, category: ts.DiagnosticCategory.Error, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, + Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: { code: 6055, category: ts.DiagnosticCategory.Message, key: "Suppress noImplicitAny errors for indexing objects lacking index signatures." }, + Do_not_emit_declarations_for_code_that_has_an_internal_annotation: { code: 6056, category: ts.DiagnosticCategory.Message, key: "Do not emit declarations for code that has an '@internal' annotation." }, + Preserve_new_lines_when_emitting_code: { code: 6057, category: ts.DiagnosticCategory.Message, key: "Preserve new-lines when emitting code." }, + 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." }, + new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: { code: 7009, category: ts.DiagnosticCategory.Error, key: "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type." }, + _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: ts.DiagnosticCategory.Error, key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, + Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: ts.DiagnosticCategory.Error, key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, + Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: ts.DiagnosticCategory.Error, key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, + Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: ts.DiagnosticCategory.Error, key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, + Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: ts.DiagnosticCategory.Error, key: "Index signature of object type implicitly has an 'any' type." }, + 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." }, + You_cannot_rename_this_element: { code: 8000, category: ts.DiagnosticCategory.Error, key: "You cannot rename this element." }, + You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: { code: 8001, category: ts.DiagnosticCategory.Error, key: "You cannot rename elements that are defined in the standard TypeScript library." }, + yield_expressions_are_not_currently_supported: { code: 9000, category: ts.DiagnosticCategory.Error, key: "'yield' expressions are not currently supported." }, + Generators_are_not_currently_supported: { code: 9001, category: ts.DiagnosticCategory.Error, key: "Generators are not currently supported." }, + Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clauses: { code: 9002, category: ts.DiagnosticCategory.Error, key: "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses." }, + class_expressions_are_not_currently_supported: { code: 9003, category: ts.DiagnosticCategory.Error, key: "'class' expressions are not currently supported." }, + class_declarations_are_only_supported_directly_inside_a_module_or_as_a_top_level_declaration: { code: 9004, category: ts.DiagnosticCategory.Error, key: "'class' declarations are only supported directly inside a module or as a top level declaration." } }; })(ts || (ts = {})); +/// +/// var ts; (function (ts) { var textToToken = { - "any": 111, - "as": 101, - "boolean": 112, - "break": 65, - "case": 66, - "catch": 67, - "class": 68, - "continue": 70, - "const": 69, - "constructor": 113, - "debugger": 71, - "declare": 114, - "default": 72, - "delete": 73, - "do": 74, - "else": 75, - "enum": 76, - "export": 77, - "extends": 78, - "false": 79, - "finally": 80, - "for": 81, - "from": 123, - "function": 82, - "get": 115, - "if": 83, - "implements": 102, - "import": 84, - "in": 85, - "instanceof": 86, - "interface": 103, - "let": 104, - "module": 116, - "new": 87, - "null": 88, - "number": 118, - "package": 105, - "private": 106, - "protected": 107, - "public": 108, - "require": 117, - "return": 89, - "set": 119, - "static": 109, - "string": 120, - "super": 90, - "switch": 91, - "symbol": 121, - "this": 92, - "throw": 93, - "true": 94, - "try": 95, - "type": 122, - "typeof": 96, - "var": 97, - "void": 98, - "while": 99, - "with": 100, - "yield": 110, - "of": 124, + "any": 112, + "as": 102, + "boolean": 113, + "break": 66, + "case": 67, + "catch": 68, + "class": 69, + "continue": 71, + "const": 70, + "constructor": 114, + "debugger": 72, + "declare": 115, + "default": 73, + "delete": 74, + "do": 75, + "else": 76, + "enum": 77, + "export": 78, + "extends": 79, + "false": 80, + "finally": 81, + "for": 82, + "from": 124, + "function": 83, + "get": 116, + "if": 84, + "implements": 103, + "import": 85, + "in": 86, + "instanceof": 87, + "interface": 104, + "let": 105, + "module": 117, + "new": 88, + "null": 89, + "number": 119, + "package": 106, + "private": 107, + "protected": 108, + "public": 109, + "require": 118, + "return": 90, + "set": 120, + "static": 110, + "string": 121, + "super": 91, + "switch": 92, + "symbol": 122, + "this": 93, + "throw": 94, + "true": 95, + "try": 96, + "type": 123, + "typeof": 97, + "var": 98, + "void": 99, + "while": 100, + "with": 101, + "yield": 111, + "of": 125, "{": 14, "}": 15, "(": 16, @@ -2054,18 +2117,19 @@ var ts; "||": 49, "?": 50, ":": 51, - "=": 52, - "+=": 53, - "-=": 54, - "*=": 55, - "/=": 56, - "%=": 57, - "<<=": 58, - ">>=": 59, - ">>>=": 60, - "&=": 61, - "|=": 62, - "^=": 63 + "=": 53, + "+=": 54, + "-=": 55, + "*=": 56, + "/=": 57, + "%=": 58, + "<<=": 59, + ">>=": 60, + ">>>=": 61, + "&=": 62, + "|=": 63, + "^=": 64, + "@": 52 }; var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; @@ -2106,9 +2170,9 @@ var ts; } function makeReverseMap(source) { var result = []; - for (var _name in source) { - if (source.hasOwnProperty(_name)) { - result[source[_name]] = _name; + for (var name_2 in source) { + if (source.hasOwnProperty(name_2)) { + result[source[name_2]] = name_2; } } return result; @@ -2118,6 +2182,10 @@ var ts; return tokenStrings[t]; } ts.tokenToString = tokenToString; + function stringToToken(s) { + return textToToken[s]; + } + ts.stringToToken = stringToToken; function computeLineStarts(text) { var result = new Array(); var pos = 0; @@ -2175,13 +2243,35 @@ var ts; ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition; var hasOwnProperty = Object.prototype.hasOwnProperty; function isWhiteSpace(ch) { - return ch === 32 || ch === 9 || ch === 11 || ch === 12 || - ch === 160 || ch === 5760 || ch >= 8192 && ch <= 8203 || - ch === 8239 || ch === 8287 || ch === 12288 || ch === 65279; + return ch === 32 || + ch === 9 || + ch === 11 || + ch === 12 || + ch === 160 || + ch === 133 || + ch === 5760 || + ch >= 8192 && ch <= 8203 || + ch === 8239 || + ch === 8287 || + ch === 12288 || + ch === 65279; } ts.isWhiteSpace = isWhiteSpace; function isLineBreak(ch) { - return ch === 10 || ch === 13 || ch === 8232 || ch === 8233 || ch === 133; + // ES5 7.3: + // The ECMAScript line terminator characters are listed in Table 3. + // Table 3 � Line Terminator Characters + // Code Unit Value Name Formal Name + // \u000A Line Feed + // \u000D Carriage Return + // \u2028 Line separator + // \u2029 Paragraph separator + // Only the characters in Table 3 are treated as line terminators. Other new line or line + // breaking characters are treated as white space but not as line terminators. + return ch === 10 || + ch === 13 || + ch === 8232 || + ch === 8233; } ts.isLineBreak = isLineBreak; function isDigit(ch) { @@ -2284,8 +2374,8 @@ var ts; else { ts.Debug.assert(ch === 61); while (pos < len) { - var _ch = text.charCodeAt(pos); - if (_ch === 62 && isConflictMarkerTrivia(text, pos)) { + var ch_1 = text.charCodeAt(pos); + if (ch_1 === 62 && isConflictMarkerTrivia(text, pos)) { break; } pos++; @@ -2300,8 +2390,9 @@ var ts; var ch = text.charCodeAt(pos); switch (ch) { case 13: - if (text.charCodeAt(pos + 1) === 10) + if (text.charCodeAt(pos + 1) === 10) { pos++; + } case 10: pos++; if (trailing) { @@ -2343,8 +2434,9 @@ var ts; } } if (collecting) { - if (!result) + if (!result) { result = []; + } result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine }); } continue; @@ -2683,14 +2775,14 @@ var ts; return result; } function getIdentifierToken() { - var _len = tokenValue.length; - if (_len >= 2 && _len <= 11) { + var len = tokenValue.length; + if (len >= 2 && len <= 11) { var ch = tokenValue.charCodeAt(0); if (ch >= 97 && ch <= 122 && hasOwnProperty.call(textToToken, tokenValue)) { return token = textToToken[tokenValue]; } } - return token = 64; + return token = 65; } function scanBinaryOrOctalDigits(base) { ts.Debug.assert(base !== 2 || base !== 8, "Expected either base 2 or base 8"); @@ -2769,7 +2861,7 @@ var ts; return token = scanTemplateAndSetTokenValue(); case 37: if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 57; + return pos += 2, token = 58; } return pos++, token = 37; case 38: @@ -2777,7 +2869,7 @@ var ts; return pos += 2, token = 48; } if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 61; + return pos += 2, token = 62; } return pos++, token = 43; case 40: @@ -2786,7 +2878,7 @@ var ts; return pos++, token = 17; case 42: if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 55; + return pos += 2, token = 56; } return pos++, token = 35; case 43: @@ -2794,7 +2886,7 @@ var ts; return pos += 2, token = 38; } if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 53; + return pos += 2, token = 54; } return pos++, token = 33; case 44: @@ -2804,7 +2896,7 @@ var ts; return pos += 2, token = 39; } if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 54; + return pos += 2, token = 55; } return pos++, token = 34; case 46: @@ -2836,13 +2928,13 @@ var ts; pos += 2; var commentClosed = false; while (pos < len) { - var _ch = text.charCodeAt(pos); - if (_ch === 42 && text.charCodeAt(pos + 1) === 47) { + var ch_2 = text.charCodeAt(pos); + if (ch_2 === 42 && text.charCodeAt(pos + 1) === 47) { pos += 2; commentClosed = true; break; } - if (isLineBreak(_ch)) { + if (isLineBreak(ch_2)) { precedingLineBreak = true; } pos++; @@ -2859,7 +2951,7 @@ var ts; } } if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 56; + return pos += 2, token = 57; } return pos++, token = 36; case 48: @@ -2875,22 +2967,22 @@ var ts; } else if (pos + 2 < len && (text.charCodeAt(pos + 1) === 66 || text.charCodeAt(pos + 1) === 98)) { pos += 2; - var _value = scanBinaryOrOctalDigits(2); - if (_value < 0) { + var value = scanBinaryOrOctalDigits(2); + if (value < 0) { error(ts.Diagnostics.Binary_digit_expected); - _value = 0; + value = 0; } - tokenValue = "" + _value; + tokenValue = "" + value; return token = 7; } else if (pos + 2 < len && (text.charCodeAt(pos + 1) === 79 || text.charCodeAt(pos + 1) === 111)) { pos += 2; - var _value_1 = scanBinaryOrOctalDigits(8); - if (_value_1 < 0) { + var value = scanBinaryOrOctalDigits(8); + if (value < 0) { error(ts.Diagnostics.Octal_digit_expected); - _value_1 = 0; + value = 0; } - tokenValue = "" + _value_1; + tokenValue = "" + value; return token = 7; } if (pos + 1 < len && isOctalDigit(text.charCodeAt(pos + 1))) { @@ -2924,7 +3016,7 @@ var ts; } if (text.charCodeAt(pos + 1) === 60) { if (text.charCodeAt(pos + 2) === 61) { - return pos += 3, token = 58; + return pos += 3, token = 59; } return pos += 2, token = 40; } @@ -2951,7 +3043,7 @@ var ts; if (text.charCodeAt(pos + 1) === 62) { return pos += 2, token = 32; } - return pos++, token = 52; + return pos++, token = 53; case 62: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); @@ -2971,7 +3063,7 @@ var ts; return pos++, token = 19; case 94: if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 63; + return pos += 2, token = 64; } return pos++, token = 45; case 123: @@ -2981,13 +3073,15 @@ var ts; return pos += 2, token = 49; } if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 62; + return pos += 2, token = 63; } return pos++, token = 44; case 125: return pos++, token = 15; case 126: return pos++, token = 47; + case 64: + return pos++, token = 52; case 92: var cookedChar = peekUnicodeEscape(); if (cookedChar >= 0 && isIdentifierStart(cookedChar)) { @@ -3027,12 +3121,12 @@ var ts; if (text.charCodeAt(pos) === 62) { if (text.charCodeAt(pos + 1) === 62) { if (text.charCodeAt(pos + 2) === 61) { - return pos += 3, token = 60; + return pos += 3, token = 61; } return pos += 2, token = 42; } if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 59; + return pos += 2, token = 60; } return pos++, token = 41; } @@ -3043,7 +3137,7 @@ var ts; return token; } function reScanSlashToken() { - if (token === 36 || token === 56) { + if (token === 36 || token === 57) { var p = tokenPos + 1; var inEscape = false; var inCharacterClass = false; @@ -3137,8 +3231,8 @@ var ts; getTokenValue: function () { return tokenValue; }, hasExtendedUnicodeEscape: function () { return hasExtendedUnicodeEscape; }, hasPrecedingLineBreak: function () { return precedingLineBreak; }, - isIdentifier: function () { return token === 64 || token > 100; }, - isReservedWord: function () { return token >= 65 && token <= 100; }, + isIdentifier: function () { return token === 65 || token > 101; }, + isReservedWord: function () { return token >= 66 && token <= 101; }, isUnterminated: function () { return tokenIsUnterminated; }, reScanGreaterToken: reScanGreaterToken, reScanSlashToken: reScanSlashToken, @@ -3152,11 +3246,524 @@ var ts; } ts.createScanner = createScanner; })(ts || (ts = {})); +/// +var ts; +(function (ts) { + ts.bindTime = 0; + (function (ModuleInstanceState) { + ModuleInstanceState[ModuleInstanceState["NonInstantiated"] = 0] = "NonInstantiated"; + ModuleInstanceState[ModuleInstanceState["Instantiated"] = 1] = "Instantiated"; + ModuleInstanceState[ModuleInstanceState["ConstEnumOnly"] = 2] = "ConstEnumOnly"; + })(ts.ModuleInstanceState || (ts.ModuleInstanceState = {})); + var ModuleInstanceState = ts.ModuleInstanceState; + function getModuleInstanceState(node) { + if (node.kind === 202 || node.kind === 203) { + return 0; + } + else if (ts.isConstEnumDeclaration(node)) { + return 2; + } + else if ((node.kind === 209 || node.kind === 208) && !(node.flags & 1)) { + return 0; + } + else if (node.kind === 206) { + var state = 0; + ts.forEachChild(node, function (n) { + switch (getModuleInstanceState(n)) { + case 0: + return false; + case 2: + state = 2; + return false; + case 1: + state = 1; + return true; + } + }); + return state; + } + else if (node.kind === 205) { + return getModuleInstanceState(node.body); + } + else { + return 1; + } + } + ts.getModuleInstanceState = getModuleInstanceState; + function bindSourceFile(file) { + var start = new Date().getTime(); + bindSourceFileWorker(file); + ts.bindTime += new Date().getTime() - start; + } + ts.bindSourceFile = bindSourceFile; + function bindSourceFileWorker(file) { + var parent; + var container; + var blockScopeContainer; + var lastContainer; + var symbolCount = 0; + var Symbol = ts.objectAllocator.getSymbolConstructor(); + if (!file.locals) { + file.locals = {}; + container = file; + setBlockScopeContainer(file, false); + bind(file); + file.symbolCount = symbolCount; + } + function createSymbol(flags, name) { + symbolCount++; + return new Symbol(flags, name); + } + function setBlockScopeContainer(node, cleanLocals) { + blockScopeContainer = node; + if (cleanLocals) { + blockScopeContainer.locals = undefined; + } + } + function addDeclarationToSymbol(symbol, node, symbolKind) { + symbol.flags |= symbolKind; + if (!symbol.declarations) + symbol.declarations = []; + symbol.declarations.push(node); + if (symbolKind & 1952 && !symbol.exports) + symbol.exports = {}; + if (symbolKind & 6240 && !symbol.members) + symbol.members = {}; + node.symbol = symbol; + if (symbolKind & 107455 && !symbol.valueDeclaration) + symbol.valueDeclaration = node; + } + function getDeclarationName(node) { + if (node.name) { + if (node.kind === 205 && node.name.kind === 8) { + return '"' + node.name.text + '"'; + } + if (node.name.kind === 127) { + var nameExpression = node.name.expression; + ts.Debug.assert(ts.isWellKnownSymbolSyntactically(nameExpression)); + return ts.getPropertyNameForKnownSymbolName(nameExpression.name.text); + } + return node.name.text; + } + switch (node.kind) { + case 143: + case 135: + return "__constructor"; + case 142: + case 138: + return "__call"; + case 139: + return "__new"; + case 140: + return "__index"; + case 215: + return "__export"; + case 214: + return node.isExportEquals ? "export=" : "default"; + case 200: + case 201: + return node.flags & 256 ? "default" : undefined; + } + } + function getDisplayName(node) { + return node.name ? ts.declarationNameToString(node.name) : getDeclarationName(node); + } + function declareSymbol(symbols, parent, node, includes, excludes) { + ts.Debug.assert(!ts.hasDynamicName(node)); + var name = node.flags & 256 && parent ? "default" : getDeclarationName(node); + var symbol; + if (name !== undefined) { + symbol = ts.hasProperty(symbols, name) ? symbols[name] : (symbols[name] = createSymbol(0, name)); + if (symbol.flags & excludes) { + if (node.name) { + node.name.parent = node; + } + var message = symbol.flags & 2 + ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 + : ts.Diagnostics.Duplicate_identifier_0; + ts.forEach(symbol.declarations, function (declaration) { + file.bindDiagnostics.push(ts.createDiagnosticForNode(declaration.name || declaration, message, getDisplayName(declaration))); + }); + file.bindDiagnostics.push(ts.createDiagnosticForNode(node.name || node, message, getDisplayName(node))); + symbol = createSymbol(0, name); + } + } + else { + symbol = createSymbol(0, "__missing"); + } + addDeclarationToSymbol(symbol, node, includes); + symbol.parent = parent; + if ((node.kind === 201 || node.kind === 174) && symbol.exports) { + var prototypeSymbol = createSymbol(4 | 134217728, "prototype"); + if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { + if (node.name) { + node.name.parent = node; + } + file.bindDiagnostics.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); + } + symbol.exports[prototypeSymbol.name] = prototypeSymbol; + prototypeSymbol.parent = symbol; + } + return symbol; + } + function declareModuleMember(node, symbolKind, symbolExcludes) { + var hasExportModifier = ts.getCombinedNodeFlags(node) & 1; + if (symbolKind & 8388608) { + if (node.kind === 217 || (node.kind === 208 && hasExportModifier)) { + declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); + } + else { + declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); + } + } + else { + if (hasExportModifier || container.flags & 32768) { + var exportKind = (symbolKind & 107455 ? 1048576 : 0) | + (symbolKind & 793056 ? 2097152 : 0) | + (symbolKind & 1536 ? 4194304 : 0); + var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); + local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); + node.localSymbol = local; + } + else { + declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); + } + } + } + function bindChildren(node, symbolKind, isBlockScopeContainer) { + if (symbolKind & 255504) { + node.locals = {}; + } + var saveParent = parent; + var saveContainer = container; + var savedBlockScopeContainer = blockScopeContainer; + parent = node; + if (symbolKind & 262128) { + container = node; + if (lastContainer) { + lastContainer.nextContainer = container; + } + lastContainer = container; + } + if (isBlockScopeContainer) { + setBlockScopeContainer(node, (symbolKind & 255504) === 0 && node.kind !== 227); + } + ts.forEachChild(node, bind); + container = saveContainer; + parent = saveParent; + blockScopeContainer = savedBlockScopeContainer; + } + function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) { + switch (container.kind) { + case 205: + declareModuleMember(node, symbolKind, symbolExcludes); + break; + case 227: + if (ts.isExternalModule(container)) { + declareModuleMember(node, symbolKind, symbolExcludes); + break; + } + case 142: + case 143: + case 138: + case 139: + case 140: + case 134: + case 133: + case 135: + case 136: + case 137: + case 200: + case 162: + case 163: + declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); + break; + case 174: + case 201: + if (node.flags & 128) { + declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); + break; + } + case 145: + case 154: + case 202: + declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes); + break; + case 204: + declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); + break; + } + bindChildren(node, symbolKind, isBlockScopeContainer); + } + function isAmbientContext(node) { + while (node) { + if (node.flags & 2) + return true; + node = node.parent; + } + return false; + } + function hasExportDeclarations(node) { + var body = node.kind === 227 ? node : node.body; + if (body.kind === 227 || body.kind === 206) { + for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { + var stat = _a[_i]; + if (stat.kind === 215 || stat.kind === 214) { + return true; + } + } + } + return false; + } + function setExportContextFlag(node) { + if (isAmbientContext(node) && !hasExportDeclarations(node)) { + node.flags |= 32768; + } + else { + node.flags &= ~32768; + } + } + function bindModuleDeclaration(node) { + setExportContextFlag(node); + if (node.name.kind === 8) { + bindDeclaration(node, 512, 106639, true); + } + else { + var state = getModuleInstanceState(node); + if (state === 0) { + bindDeclaration(node, 1024, 0, true); + } + else { + bindDeclaration(node, 512, 106639, true); + var currentModuleIsConstEnumOnly = state === 2; + if (node.symbol.constEnumOnlyModule === undefined) { + node.symbol.constEnumOnlyModule = currentModuleIsConstEnumOnly; + } + else { + node.symbol.constEnumOnlyModule = node.symbol.constEnumOnlyModule && currentModuleIsConstEnumOnly; + } + } + } + } + function bindFunctionOrConstructorType(node) { + // For a given function symbol "<...>(...) => T" we want to generate a symbol identical + // to the one we would get for: { <...>(...): T } + // + // We do that by making an anonymous type literal symbol, and then setting the function + // symbol as its sole member. To the rest of the system, this symbol will be indistinguishable + // from an actual type literal symbol you would have gotten had you used the long form. + var symbol = createSymbol(131072, getDeclarationName(node)); + addDeclarationToSymbol(symbol, node, 131072); + bindChildren(node, 131072, false); + var typeLiteralSymbol = createSymbol(2048, "__type"); + addDeclarationToSymbol(typeLiteralSymbol, node, 2048); + typeLiteralSymbol.members = {}; + typeLiteralSymbol.members[node.kind === 142 ? "__call" : "__new"] = symbol; + } + function bindAnonymousDeclaration(node, symbolKind, name, isBlockScopeContainer) { + var symbol = createSymbol(symbolKind, name); + addDeclarationToSymbol(symbol, node, symbolKind); + bindChildren(node, symbolKind, isBlockScopeContainer); + } + function bindCatchVariableDeclaration(node) { + bindChildren(node, 0, true); + } + function bindBlockScopedVariableDeclaration(node) { + switch (blockScopeContainer.kind) { + case 205: + declareModuleMember(node, 2, 107455); + break; + case 227: + if (ts.isExternalModule(container)) { + declareModuleMember(node, 2, 107455); + break; + } + default: + if (!blockScopeContainer.locals) { + blockScopeContainer.locals = {}; + } + declareSymbol(blockScopeContainer.locals, undefined, node, 2, 107455); + } + bindChildren(node, 2, false); + } + function getDestructuringParameterName(node) { + return "__" + ts.indexOf(node.parent.parameters, node); + } + function bind(node) { + node.parent = parent; + switch (node.kind) { + case 128: + bindDeclaration(node, 262144, 530912, false); + break; + case 129: + bindParameter(node); + break; + case 198: + case 152: + if (ts.isBindingPattern(node.name)) { + bindChildren(node, 0, false); + } + else if (ts.isBlockOrCatchScoped(node)) { + bindBlockScopedVariableDeclaration(node); + } + else { + bindDeclaration(node, 1, 107454, false); + } + break; + case 132: + case 131: + bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 107455, false); + break; + case 224: + case 225: + bindPropertyOrMethodOrAccessor(node, 4, 107455, false); + break; + case 226: + bindPropertyOrMethodOrAccessor(node, 8, 107455, false); + break; + case 138: + case 139: + case 140: + bindDeclaration(node, 131072, 0, false); + break; + case 134: + case 133: + bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 107455 : 99263, true); + break; + case 200: + bindDeclaration(node, 16, 106927, true); + break; + case 135: + bindDeclaration(node, 16384, 0, true); + break; + case 136: + bindPropertyOrMethodOrAccessor(node, 32768, 41919, true); + break; + case 137: + bindPropertyOrMethodOrAccessor(node, 65536, 74687, true); + break; + case 142: + case 143: + bindFunctionOrConstructorType(node); + break; + case 145: + bindAnonymousDeclaration(node, 2048, "__type", false); + break; + case 154: + bindAnonymousDeclaration(node, 4096, "__object", false); + break; + case 162: + case 163: + bindAnonymousDeclaration(node, 16, "__function", true); + break; + case 174: + bindAnonymousDeclaration(node, 32, "__class", false); + break; + case 223: + bindCatchVariableDeclaration(node); + break; + case 201: + bindDeclaration(node, 32, 899583, false); + break; + case 202: + bindDeclaration(node, 64, 792992, false); + break; + case 203: + bindDeclaration(node, 524288, 793056, false); + break; + case 204: + if (ts.isConst(node)) { + bindDeclaration(node, 128, 899967, false); + } + else { + bindDeclaration(node, 256, 899327, false); + } + break; + case 205: + bindModuleDeclaration(node); + break; + case 208: + case 211: + case 213: + case 217: + bindDeclaration(node, 8388608, 8388608, false); + break; + case 210: + if (node.name) { + bindDeclaration(node, 8388608, 8388608, false); + } + else { + bindChildren(node, 0, false); + } + break; + case 215: + if (!node.exportClause) { + declareSymbol(container.symbol.exports, container.symbol, node, 1073741824, 0); + } + bindChildren(node, 0, false); + break; + case 214: + if (node.expression && node.expression.kind === 65) { + declareSymbol(container.symbol.exports, container.symbol, node, 8388608, 107455 | 8388608); + } + else { + declareSymbol(container.symbol.exports, container.symbol, node, 4, 107455 | 8388608); + } + bindChildren(node, 0, false); + break; + case 227: + setExportContextFlag(node); + if (ts.isExternalModule(node)) { + bindAnonymousDeclaration(node, 512, '"' + ts.removeFileExtension(node.fileName) + '"', true); + break; + } + case 179: + bindChildren(node, 0, !ts.isFunctionLike(node.parent)); + break; + case 223: + case 186: + case 187: + case 188: + case 207: + bindChildren(node, 0, true); + break; + default: + var saveParent = parent; + parent = node; + ts.forEachChild(node, bind); + parent = saveParent; + } + } + function bindParameter(node) { + if (ts.isBindingPattern(node.name)) { + bindAnonymousDeclaration(node, 1, getDestructuringParameterName(node), false); + } + else { + bindDeclaration(node, 1, 107455, false); + } + if (node.flags & 112 && + node.parent.kind === 135 && + (node.parent.parent.kind === 201 || node.parent.parent.kind === 174)) { + var classDeclaration = node.parent.parent; + declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4, 107455); + } + } + function bindPropertyOrMethodOrAccessor(node, symbolKind, symbolExcludes, isBlockScopeContainer) { + if (ts.hasDynamicName(node)) { + bindAnonymousDeclaration(node, symbolKind, "__computed", isBlockScopeContainer); + } + else { + bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer); + } + } + } +})(ts || (ts = {})); +/// var ts; (function (ts) { function getDeclarationOfKind(symbol, kind) { var declarations = symbol.declarations; - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; if (declaration.kind === kind) { return declaration; @@ -3200,21 +3807,21 @@ var ts; ts.getFullWidth = getFullWidth; function containsParseError(node) { aggregateChildData(node); - return (node.parserContextFlags & 32) !== 0; + return (node.parserContextFlags & 64) !== 0; } ts.containsParseError = containsParseError; function aggregateChildData(node) { - if (!(node.parserContextFlags & 64)) { - var thisNodeOrAnySubNodesHasError = ((node.parserContextFlags & 16) !== 0) || + if (!(node.parserContextFlags & 128)) { + var thisNodeOrAnySubNodesHasError = ((node.parserContextFlags & 32) !== 0) || ts.forEachChild(node, containsParseError); if (thisNodeOrAnySubNodesHasError) { - node.parserContextFlags |= 32; + node.parserContextFlags |= 64; } - node.parserContextFlags |= 64; + node.parserContextFlags |= 128; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 221) { + while (node && node.kind !== 227) { node = node.parent; } return node; @@ -3296,15 +3903,15 @@ var ts; return current; } switch (current.kind) { - case 221: - case 202: - case 217: - case 200: - case 181: - case 182: - case 183: + case 227: + case 207: + case 223: + case 205: + case 186: + case 187: + case 188: return current; - case 174: + case 179: if (!isFunctionLike(current.parent)) { return current; } @@ -3315,9 +3922,9 @@ var ts; ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; function isCatchClauseVariableDeclaration(declaration) { return declaration && - declaration.kind === 193 && + declaration.kind === 198 && declaration.parent && - declaration.parent.kind === 217; + declaration.parent.kind === 223; } ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration; function declarationNameToString(name) { @@ -3354,15 +3961,22 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 193: - case 150: - case 196: - case 197: + case 227: + var pos_1 = ts.skipTrivia(sourceFile.text, 0, false); + if (pos_1 === sourceFile.text.length) { + return createTextSpan(0, 0); + } + return getSpanOfTokenAtPosition(sourceFile, pos_1); + case 198: + case 152: + case 201: + case 174: + case 202: + case 205: + case 204: + case 226: case 200: - case 199: - case 220: - case 195: - case 160: + case 162: errorNode = node.name; break; } @@ -3384,11 +3998,11 @@ var ts; } ts.isDeclarationFile = isDeclarationFile; function isConstEnumDeclaration(node) { - return node.kind === 199 && isConst(node); + return node.kind === 204 && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 150 || isBindingPattern(node))) { + while (node && (node.kind === 152 || isBindingPattern(node))) { node = node.parent; } return node; @@ -3396,14 +4010,14 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 193) { + if (node.kind === 198) { node = node.parent; } - if (node && node.kind === 194) { + if (node && node.kind === 199) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 175) { + if (node && node.kind === 180) { flags |= node.flags; } return flags; @@ -3418,12 +4032,11 @@ var ts; } ts.isLet = isLet; function isPrologueDirective(node) { - return node.kind === 177 && node.expression.kind === 8; + return node.kind === 182 && node.expression.kind === 8; } ts.isPrologueDirective = isPrologueDirective; function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { - sourceFileOfNode = sourceFileOfNode || getSourceFileOfNode(node); - if (node.kind === 128 || node.kind === 127) { + if (node.kind === 129 || node.kind === 128) { return ts.concatenate(ts.getTrailingCommentRanges(sourceFileOfNode.text, node.pos), ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos)); } else { @@ -3445,23 +4058,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 186: + case 191: return visitor(node); - case 202: - case 174: - case 178: + case 207: case 179: - case 180: - case 181: - case 182: case 183: + case 184: + case 185: + case 186: case 187: case 188: - case 214: - case 215: - case 189: - case 191: - case 217: + case 192: + case 193: + case 220: + case 221: + case 194: + case 196: + case 223: return ts.forEachChild(node, traverse); } } @@ -3470,14 +4083,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 150: - case 220: - case 128: - case 218: - case 130: + case 152: + case 226: case 129: - case 219: - case 193: + case 224: + case 132: + case 131: + case 225: + case 198: return true; } } @@ -3487,22 +4100,22 @@ var ts; function isFunctionLike(node) { if (node) { switch (node.kind) { - case 133: - case 160: - case 195: - case 161: - case 132: - case 131: - case 134: case 135: + case 162: + case 200: + case 163: + case 134: + case 133: case 136: case 137: case 138: + case 139: case 140: - case 141: - case 160: - case 161: - case 195: + case 142: + case 143: + case 162: + case 163: + case 200: return true; } } @@ -3510,11 +4123,11 @@ var ts; } ts.isFunctionLike = isFunctionLike; function isFunctionBlock(node) { - return node && node.kind === 174 && isFunctionLike(node.parent); + return node && node.kind === 179 && isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 132 && node.parent.kind === 152; + return node && node.kind === 134 && node.parent.kind === 154; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function getContainingFunction(node) { @@ -3533,28 +4146,28 @@ var ts; return undefined; } switch (node.kind) { - case 126: - if (node.parent.parent.kind === 196) { + case 127: + if (node.parent.parent.kind === 201) { return node; } node = node.parent; break; - case 161: + case 163: if (!includeArrowFunctions) { continue; } - case 195: - case 160: case 200: - case 130: - case 129: + case 162: + case 205: case 132: case 131: - case 133: case 134: + case 133: case 135: - case 199: - case 221: + case 136: + case 137: + case 204: + case 227: return node; } } @@ -3566,47 +4179,104 @@ var ts; if (!node) return node; switch (node.kind) { - case 126: - if (node.parent.parent.kind === 196) { + case 127: + if (node.parent.parent.kind === 201) { return node; } node = node.parent; break; - case 195: - case 160: - case 161: + case 200: + case 162: + case 163: if (!includeFunctions) { continue; } - case 130: - case 129: case 132: case 131: - case 133: case 134: + case 133: case 135: + case 136: + case 137: return node; } } } ts.getSuperContainer = getSuperContainer; function getInvokedExpression(node) { - if (node.kind === 157) { + if (node.kind === 159) { return node.tag; } return node.expression; } ts.getInvokedExpression = getInvokedExpression; + function nodeCanBeDecorated(node) { + switch (node.kind) { + case 201: + return true; + case 132: + return node.parent.kind === 201; + case 129: + return node.parent.body && node.parent.parent.kind === 201; + case 136: + case 137: + case 134: + return node.body && node.parent.kind === 201; + } + return false; + } + ts.nodeCanBeDecorated = nodeCanBeDecorated; + function nodeIsDecorated(node) { + switch (node.kind) { + case 201: + if (node.decorators) { + return true; + } + return false; + case 132: + case 129: + if (node.decorators) { + return true; + } + return false; + case 136: + if (node.body && node.decorators) { + return true; + } + return false; + case 134: + case 137: + if (node.body && node.decorators) { + return true; + } + return false; + } + return false; + } + ts.nodeIsDecorated = nodeIsDecorated; + function childIsDecorated(node) { + switch (node.kind) { + case 201: + return ts.forEach(node.members, nodeOrChildIsDecorated); + case 134: + case 137: + return ts.forEach(node.parameters, nodeIsDecorated); + } + return false; + } + ts.childIsDecorated = childIsDecorated; + function nodeOrChildIsDecorated(node) { + return nodeIsDecorated(node) || childIsDecorated(node); + } + ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function isExpression(node) { switch (node.kind) { - case 92: - case 90: - case 88: - case 94: - case 79: + case 93: + case 91: + case 89: + case 95: + case 80: case 9: - case 151: - case 152: case 153: case 154: case 155: @@ -3616,68 +4286,71 @@ var ts; case 159: case 160: case 161: - case 164: case 162: + case 174: case 163: - case 165: case 166: + case 164: + case 165: case 167: case 168: - case 171: case 169: + case 170: + case 173: + case 171: case 10: - case 172: + case 175: return true; - case 125: - while (node.parent.kind === 125) { + case 126: + while (node.parent.kind === 126) { node = node.parent; } - return node.parent.kind === 142; - case 64: - if (node.parent.kind === 142) { + return node.parent.kind === 144; + case 65: + if (node.parent.kind === 144) { return true; } case 7: case 8: - var _parent = node.parent; - switch (_parent.kind) { - case 193: - case 128: - case 130: + var parent_1 = node.parent; + switch (parent_1.kind) { + case 198: case 129: - case 220: - case 218: - case 150: - return _parent.initializer === node; - case 177: - case 178: - case 179: - case 180: - case 186: - case 187: - case 188: - case 214: - case 190: - case 188: - return _parent.expression === node; - case 181: - var forStatement = _parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 194) || - forStatement.condition === node || - forStatement.iterator === node; + case 132: + case 131: + case 226: + case 224: + case 152: + return parent_1.initializer === node; case 182: case 183: - var forInStatement = _parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 194) || + case 184: + case 185: + case 191: + case 192: + case 193: + case 220: + case 195: + case 193: + 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: + case 188: + var forInStatement = parent_1; + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 199) || forInStatement.expression === node; - case 158: - return node === _parent.expression; - case 173: - return node === _parent.expression; - case 126: - return node === _parent.expression; + case 160: + return node === parent_1.expression; + case 176: + return node === parent_1.expression; + case 127: + return node === parent_1.expression; default: - if (isExpression(_parent)) { + if (isExpression(parent_1)) { return true; } } @@ -3692,7 +4365,7 @@ var ts; } ts.isInstantiatedModule = isInstantiatedModule; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 203 && node.moduleReference.kind === 213; + return node.kind === 208 && node.moduleReference.kind === 219; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -3701,41 +4374,41 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 203 && node.moduleReference.kind !== 213; + return node.kind === 208 && node.moduleReference.kind !== 219; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function getExternalModuleName(node) { - if (node.kind === 204) { + if (node.kind === 209) { return node.moduleSpecifier; } - if (node.kind === 203) { + if (node.kind === 208) { var reference = node.moduleReference; - if (reference.kind === 213) { + if (reference.kind === 219) { return reference.expression; } } - if (node.kind === 210) { + if (node.kind === 215) { return node.moduleSpecifier; } } ts.getExternalModuleName = getExternalModuleName; function hasDotDotDotToken(node) { - return node && node.kind === 128 && node.dotDotDotToken !== undefined; + return node && node.kind === 129 && node.dotDotDotToken !== undefined; } ts.hasDotDotDotToken = hasDotDotDotToken; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 128: + case 129: return node.questionToken !== undefined; + case 134: + case 133: + return node.questionToken !== undefined; + case 225: + case 224: case 132: case 131: return node.questionToken !== undefined; - case 219: - case 218: - case 130: - case 129: - return node.questionToken !== undefined; } } return false; @@ -3758,7 +4431,7 @@ var ts; } ts.isTemplateLiteralKind = isTemplateLiteralKind; function isBindingPattern(node) { - return !!node && (node.kind === 149 || node.kind === 148); + return !!node && (node.kind === 151 || node.kind === 150); } ts.isBindingPattern = isBindingPattern; function isInAmbientContext(node) { @@ -3773,33 +4446,33 @@ var ts; ts.isInAmbientContext = isInAmbientContext; function isDeclaration(node) { switch (node.kind) { - case 161: - case 150: - case 196: - case 133: - case 199: - case 220: - case 212: - case 195: - case 160: - case 134: - case 205: - case 203: + 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 197: + case 213: + case 202: + case 134: + case 133: + case 205: + case 211: + case 129: + case 224: case 132: case 131: - case 200: - case 206: + case 137: + case 225: + case 203: case 128: - case 218: - case 130: - case 129: - case 135: - case 219: case 198: - case 127: - case 193: return true; } return false; @@ -3807,65 +4480,88 @@ var ts; ts.isDeclaration = isDeclaration; function isStatement(n) { switch (n.kind) { - case 185: - case 184: - case 192: - case 179: - case 177: - case 176: - case 182: - case 183: - case 181: - case 178: + case 190: case 189: - case 186: - case 188: - case 93: - case 191: - case 175: - case 180: + case 197: + case 184: + case 182: + case 181: case 187: - case 209: + case 188: + case 186: + case 183: + case 194: + case 191: + case 193: + case 94: + case 196: + case 180: + case 185: + case 192: + case 214: return true; default: return false; } } ts.isStatement = isStatement; + function isClassElement(n) { + switch (n.kind) { + case 135: + case 132: + case 134: + case 136: + case 137: + case 140: + return true; + default: + return false; + } + } + ts.isClassElement = isClassElement; function isDeclarationName(name) { - if (name.kind !== 64 && name.kind !== 8 && name.kind !== 7) { + if (name.kind !== 65 && name.kind !== 8 && name.kind !== 7) { return false; } - var _parent = name.parent; - if (_parent.kind === 208 || _parent.kind === 212) { - if (_parent.propertyName) { + var parent = name.parent; + if (parent.kind === 213 || parent.kind === 217) { + if (parent.propertyName) { return true; } } - if (isDeclaration(_parent)) { - return _parent.name === name; + if (isDeclaration(parent)) { + return parent.name === name; } return false; } ts.isDeclarationName = isDeclarationName; - function getClassBaseTypeNode(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 78); + 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; + } + ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; + function getClassExtendsHeritageClauseElement(node) { + var heritageClause = getHeritageClause(node.heritageClauses, 79); return heritageClause && heritageClause.types.length > 0 ? heritageClause.types[0] : undefined; } - ts.getClassBaseTypeNode = getClassBaseTypeNode; - function getClassImplementedTypeNodes(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 102); + ts.getClassExtendsHeritageClauseElement = getClassExtendsHeritageClauseElement; + function getClassImplementsHeritageClauseElements(node) { + var heritageClause = getHeritageClause(node.heritageClauses, 103); return heritageClause ? heritageClause.types : undefined; } - ts.getClassImplementedTypeNodes = getClassImplementedTypeNodes; + ts.getClassImplementsHeritageClauseElements = getClassImplementsHeritageClauseElements; function getInterfaceBaseTypeNodes(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 78); + var heritageClause = getHeritageClause(node.heritageClauses, 79); return heritageClause ? heritageClause.types : undefined; } ts.getInterfaceBaseTypeNodes = getInterfaceBaseTypeNodes; function getHeritageClause(clauses, kind) { if (clauses) { - for (var _i = 0, _n = clauses.length; _i < _n; _i++) { + for (var _i = 0; _i < clauses.length; _i++) { var clause = clauses[_i]; if (clause.token === kind) { return clause; @@ -3928,7 +4624,7 @@ var ts; } ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; function isKeyword(token) { - return 65 <= token && token <= 124; + return 66 <= token && token <= 125; } ts.isKeyword = isKeyword; function isTrivia(token) { @@ -3937,19 +4633,19 @@ var ts; ts.isTrivia = isTrivia; function hasDynamicName(declaration) { return declaration.name && - declaration.name.kind === 126 && + declaration.name.kind === 127 && !isWellKnownSymbolSyntactically(declaration.name.expression); } ts.hasDynamicName = hasDynamicName; function isWellKnownSymbolSyntactically(node) { - return node.kind === 153 && isESSymbolIdentifier(node.expression); + return node.kind === 155 && isESSymbolIdentifier(node.expression); } ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically; function getPropertyNameForPropertyNameNode(name) { - if (name.kind === 64 || name.kind === 8 || name.kind === 7) { + if (name.kind === 65 || name.kind === 8 || name.kind === 7) { return name.text; } - if (name.kind === 126) { + if (name.kind === 127) { var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { var rightHandSideName = nameExpression.name.text; @@ -3964,19 +4660,19 @@ var ts; } ts.getPropertyNameForKnownSymbolName = getPropertyNameForKnownSymbolName; function isESSymbolIdentifier(node) { - return node.kind === 64 && node.text === "Symbol"; + return node.kind === 65 && node.text === "Symbol"; } ts.isESSymbolIdentifier = isESSymbolIdentifier; function isModifier(token) { switch (token) { - case 108: - case 106: - case 107: case 109: - case 77: - case 114: - case 69: - case 72: + case 107: + case 108: + case 110: + case 78: + case 115: + case 70: + case 73: return true; } return false; @@ -4092,7 +4788,7 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function nodeStartsNewLexicalEnvironment(n) { - return isFunctionLike(n) || n.kind === 200 || n.kind === 221; + return isFunctionLike(n) || n.kind === 205 || n.kind === 227; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(node) { @@ -4107,26 +4803,6 @@ var ts; return node; } ts.createSynthesizedNode = createSynthesizedNode; - function generateUniqueName(baseName, isExistingName) { - if (baseName.charCodeAt(0) !== 95) { - baseName = "_" + baseName; - if (!isExistingName(baseName)) { - return baseName; - } - } - if (baseName.charCodeAt(baseName.length - 1) !== 95) { - baseName += "_"; - } - var i = 1; - while (true) { - var _name = baseName + i; - if (!isExistingName(_name)) { - return _name; - } - i++; - } - } - ts.generateUniqueName = generateUniqueName; function createDiagnosticCollection() { var nonFileDiagnostics = []; var fileDiagnostics = {}; @@ -4227,10 +4903,291 @@ var ts; s; } ts.escapeNonAsciiCharacters = escapeNonAsciiCharacters; + var indentStrings = ["", " "]; + function getIndentString(level) { + if (indentStrings[level] === undefined) { + indentStrings[level] = getIndentString(level - 1) + indentStrings[1]; + } + return indentStrings[level]; + } + ts.getIndentString = getIndentString; + function getIndentSize() { + return indentStrings[1].length; + } + ts.getIndentSize = getIndentSize; + function createTextWriter(newLine) { + var output = ""; + var indent = 0; + var lineStart = true; + var lineCount = 0; + var linePos = 0; + function write(s) { + if (s && s.length) { + if (lineStart) { + output += getIndentString(indent); + lineStart = false; + } + output += s; + } + } + function rawWrite(s) { + if (s !== undefined) { + if (lineStart) { + lineStart = false; + } + output += s; + } + } + function writeLiteral(s) { + if (s && s.length) { + write(s); + var lineStartsOfS = ts.computeLineStarts(s); + if (lineStartsOfS.length > 1) { + lineCount = lineCount + lineStartsOfS.length - 1; + linePos = output.length - s.length + lineStartsOfS[lineStartsOfS.length - 1]; + } + } + } + function writeLine() { + if (!lineStart) { + output += newLine; + lineCount++; + linePos = output.length; + lineStart = true; + } + } + function writeTextOfNode(sourceFile, node) { + write(getSourceTextOfNodeFromSourceFile(sourceFile, node)); + } + return { + write: write, + rawWrite: rawWrite, + writeTextOfNode: writeTextOfNode, + writeLiteral: writeLiteral, + writeLine: writeLine, + increaseIndent: function () { return indent++; }, + decreaseIndent: function () { return indent--; }, + getIndent: function () { return indent; }, + getTextPos: function () { return output.length; }, + getLine: function () { return lineCount + 1; }, + getColumn: function () { return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; }, + getText: function () { return output; } + }; + } + ts.createTextWriter = createTextWriter; + function getOwnEmitOutputFilePath(sourceFile, host, extension) { + var compilerOptions = host.getCompilerOptions(); + var emitOutputFilePathWithoutExtension; + if (compilerOptions.outDir) { + emitOutputFilePathWithoutExtension = ts.removeFileExtension(getSourceFilePathInNewDir(sourceFile, host, compilerOptions.outDir)); + } + else { + emitOutputFilePathWithoutExtension = ts.removeFileExtension(sourceFile.fileName); + } + return emitOutputFilePathWithoutExtension + extension; + } + ts.getOwnEmitOutputFilePath = getOwnEmitOutputFilePath; + function getSourceFilePathInNewDir(sourceFile, host, newDirPath) { + var sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.fileName, host.getCurrentDirectory()); + sourceFilePath = sourceFilePath.replace(host.getCommonSourceDirectory(), ""); + return ts.combinePaths(newDirPath, sourceFilePath); + } + ts.getSourceFilePathInNewDir = getSourceFilePathInNewDir; + function writeFile(host, diagnostics, fileName, data, writeByteOrderMark) { + host.writeFile(fileName, data, writeByteOrderMark, function (hostErrorMessage) { + diagnostics.push(ts.createCompilerDiagnostic(ts.Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage)); + }); + } + ts.writeFile = writeFile; + function getLineOfLocalPosition(currentSourceFile, pos) { + return ts.getLineAndCharacterOfPosition(currentSourceFile, pos).line; + } + ts.getLineOfLocalPosition = getLineOfLocalPosition; + function getFirstConstructorWithBody(node) { + return ts.forEach(node.members, function (member) { + if (member.kind === 135 && nodeIsPresent(member.body)) { + return member; + } + }); + } + ts.getFirstConstructorWithBody = getFirstConstructorWithBody; + function shouldEmitToOwnFile(sourceFile, compilerOptions) { + if (!isDeclarationFile(sourceFile)) { + if ((isExternalModule(sourceFile) || !compilerOptions.out) && !ts.fileExtensionIs(sourceFile.fileName, ".js")) { + return true; + } + return false; + } + return false; + } + ts.shouldEmitToOwnFile = shouldEmitToOwnFile; + function getAllAccessorDeclarations(declarations, accessor) { + var firstAccessor; + var secondAccessor; + var getAccessor; + var setAccessor; + if (hasDynamicName(accessor)) { + firstAccessor = accessor; + if (accessor.kind === 136) { + getAccessor = accessor; + } + else if (accessor.kind === 137) { + setAccessor = accessor; + } + else { + ts.Debug.fail("Accessor has wrong kind"); + } + } + else { + ts.forEach(declarations, function (member) { + if ((member.kind === 136 || member.kind === 137) + && (member.flags & 128) === (accessor.flags & 128)) { + var memberName = getPropertyNameForPropertyNameNode(member.name); + var accessorName = getPropertyNameForPropertyNameNode(accessor.name); + if (memberName === accessorName) { + if (!firstAccessor) { + firstAccessor = member; + } + else if (!secondAccessor) { + secondAccessor = member; + } + if (member.kind === 136 && !getAccessor) { + getAccessor = member; + } + if (member.kind === 137 && !setAccessor) { + setAccessor = member; + } + } + } + }); + } + return { + firstAccessor: firstAccessor, + secondAccessor: secondAccessor, + getAccessor: getAccessor, + setAccessor: setAccessor + }; + } + ts.getAllAccessorDeclarations = getAllAccessorDeclarations; + function emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments) { + if (leadingComments && leadingComments.length && node.pos !== leadingComments[0].pos && + getLineOfLocalPosition(currentSourceFile, node.pos) !== getLineOfLocalPosition(currentSourceFile, leadingComments[0].pos)) { + writer.writeLine(); + } + } + ts.emitNewLineBeforeLeadingComments = emitNewLineBeforeLeadingComments; + function emitComments(currentSourceFile, writer, comments, trailingSeparator, newLine, writeComment) { + var emitLeadingSpace = !trailingSeparator; + ts.forEach(comments, function (comment) { + if (emitLeadingSpace) { + writer.write(" "); + emitLeadingSpace = false; + } + writeComment(currentSourceFile, writer, comment, newLine); + if (comment.hasTrailingNewLine) { + writer.writeLine(); + } + else if (trailingSeparator) { + writer.write(" "); + } + else { + emitLeadingSpace = true; + } + }); + } + ts.emitComments = emitComments; + function writeCommentRange(currentSourceFile, writer, comment, newLine) { + if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42) { + var firstCommentLineAndCharacter = ts.getLineAndCharacterOfPosition(currentSourceFile, comment.pos); + var lineCount = ts.getLineStarts(currentSourceFile).length; + var firstCommentLineIndent; + for (var pos = comment.pos, currentLine = firstCommentLineAndCharacter.line; pos < comment.end; currentLine++) { + var nextLineStart = (currentLine + 1) === lineCount + ? currentSourceFile.text.length + 1 + : getStartPositionOfLine(currentLine + 1, currentSourceFile); + if (pos !== comment.pos) { + if (firstCommentLineIndent === undefined) { + firstCommentLineIndent = calculateIndent(getStartPositionOfLine(firstCommentLineAndCharacter.line, currentSourceFile), comment.pos); + } + var currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); + var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(pos, nextLineStart); + if (spacesToEmit > 0) { + var numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); + var indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); + writer.rawWrite(indentSizeSpaceString); + while (numberOfSingleSpacesToEmit) { + writer.rawWrite(" "); + numberOfSingleSpacesToEmit--; + } + } + else { + writer.rawWrite(""); + } + } + writeTrimmedCurrentLine(pos, nextLineStart); + pos = nextLineStart; + } + } + else { + writer.write(currentSourceFile.text.substring(comment.pos, comment.end)); + } + function writeTrimmedCurrentLine(pos, nextLineStart) { + var end = Math.min(comment.end, nextLineStart - 1); + var currentLineText = currentSourceFile.text.substring(pos, end).replace(/^\s+|\s+$/g, ''); + if (currentLineText) { + writer.write(currentLineText); + if (end !== comment.end) { + writer.writeLine(); + } + } + else { + writer.writeLiteral(newLine); + } + } + function calculateIndent(pos, end) { + var currentLineIndent = 0; + for (; pos < end && ts.isWhiteSpace(currentSourceFile.text.charCodeAt(pos)); pos++) { + if (currentSourceFile.text.charCodeAt(pos) === 9) { + currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); + } + else { + currentLineIndent++; + } + } + return currentLineIndent; + } + } + ts.writeCommentRange = writeCommentRange; + function isSupportedHeritageClauseElement(node) { + return isSupportedHeritageClauseElementExpression(node.expression); + } + ts.isSupportedHeritageClauseElement = isSupportedHeritageClauseElement; + function isSupportedHeritageClauseElementExpression(node) { + if (node.kind === 65) { + return true; + } + else if (node.kind === 155) { + return isSupportedHeritageClauseElementExpression(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); + } + ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; + function getLocalSymbolForExportDefault(symbol) { + return symbol && symbol.valueDeclaration && (symbol.valueDeclaration.flags & 256) ? symbol.valueDeclaration.localSymbol : undefined; + } + ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; })(ts || (ts = {})); +/// +/// var ts; (function (ts) { - var nodeConstructors = new Array(223); + var nodeConstructors = new Array(229); ts.parseTime = 0; function getNodeConstructor(kind) { return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); @@ -4252,7 +5209,7 @@ var ts; } function visitEachNode(cbNode, nodes) { if (nodes) { - for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + for (var _i = 0; _i < nodes.length; _i++) { var node = nodes[_i]; var result = cbNode(node); if (result) { @@ -4268,249 +5225,272 @@ var ts; var visitNodes = cbNodeArray ? visitNodeArray : visitEachNode; var cbNodes = cbNodeArray || cbNode; switch (node.kind) { - case 125: + case 126: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 127: + case 128: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.expression); - case 128: - case 130: case 129: - case 218: - case 219: - case 193: - case 150: - return visitNodes(cbNodes, node.modifiers) || + case 132: + case 131: + case 224: + case 225: + case 198: + case 152: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 140: - case 141: - case 136: - case 137: + case 142: + case 143: case 138: - return visitNodes(cbNodes, node.modifiers) || + case 139: + case 140: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 132: - case 131: - case 133: case 134: + case 133: case 135: - case 160: - case 195: - case 161: - return visitNodes(cbNodes, node.modifiers) || + case 136: + case 137: + case 162: + case 200: + case 163: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type) || + visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 139: + case 141: return visitNode(cbNode, node.typeName) || visitNodes(cbNodes, node.typeArguments); - case 142: - return visitNode(cbNode, node.exprName); - case 143: - return visitNodes(cbNodes, node.members); case 144: - return visitNode(cbNode, node.elementType); + return visitNode(cbNode, node.exprName); case 145: - return visitNodes(cbNodes, node.elementTypes); + return visitNodes(cbNodes, node.members); case 146: - return visitNodes(cbNodes, node.types); + return visitNode(cbNode, node.elementType); case 147: - return visitNode(cbNode, node.type); + return visitNodes(cbNodes, node.elementTypes); case 148: + return visitNodes(cbNodes, node.types); case 149: - return visitNodes(cbNodes, node.elements); + return visitNode(cbNode, node.type); + case 150: case 151: return visitNodes(cbNodes, node.elements); - case 152: - return visitNodes(cbNodes, node.properties); case 153: + return visitNodes(cbNodes, node.elements); + case 154: + return visitNodes(cbNodes, node.properties); + case 155: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.dotToken) || visitNode(cbNode, node.name); - case 154: + case 156: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 155: - case 156: + case 157: + case 158: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments) || visitNodes(cbNodes, node.arguments); - case 157: + case 159: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 158: + case 160: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 159: - return visitNode(cbNode, node.expression); - case 162: - return visitNode(cbNode, node.expression); - case 163: + case 161: return visitNode(cbNode, node.expression); case 164: 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 170: + case 172: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 166: + case 168: return visitNode(cbNode, node.operand); - case 167: + case 169: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 168: + case 170: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 171: + case 173: return visitNode(cbNode, node.expression); - case 174: - case 201: + case 179: + case 206: return visitNodes(cbNodes, node.statements); - case 221: + case 227: return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 175: - return visitNodes(cbNodes, node.modifiers) || + case 180: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 194: + case 199: return visitNodes(cbNodes, node.declarations); - case 177: + case 182: return visitNode(cbNode, node.expression); - case 178: + case 183: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 179: + case 184: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 180: + case 185: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 181: + case 186: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.iterator) || visitNode(cbNode, node.statement); - case 182: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); - case 183: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); - case 184: - case 185: - return visitNode(cbNode, node.label); - case 186: - return visitNode(cbNode, node.expression); case 187: - return visitNode(cbNode, node.expression) || + return visitNode(cbNode, node.initializer) || + visitNode(cbNode, node.expression) || 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) || + visitNode(cbNode, node.statement); + case 193: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 202: + case 207: return visitNodes(cbNodes, node.clauses); - case 214: + case 220: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.statements); - case 215: + case 221: return visitNodes(cbNodes, node.statements); - case 189: + case 194: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 190: + case 195: return visitNode(cbNode, node.expression); - case 191: + case 196: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 217: + case 223: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 196: - return visitNodes(cbNodes, node.modifiers) || + case 130: + 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 197: - return visitNodes(cbNodes, node.modifiers) || + case 202: + 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 198: - return visitNodes(cbNodes, node.modifiers) || + case 203: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.type); - case 199: - return visitNodes(cbNodes, node.modifiers) || + case 204: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.members); - case 220: + case 226: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 200: - return visitNodes(cbNodes, node.modifiers) || + case 205: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 203: - return visitNodes(cbNodes, node.modifiers) || + case 208: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 204: - return visitNodes(cbNodes, node.modifiers) || + case 209: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 205: + case 210: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 206: - return visitNode(cbNode, node.name); - case 207: case 211: + return visitNode(cbNode, node.name); + case 212: + case 216: return visitNodes(cbNodes, node.elements); - case 210: - return visitNodes(cbNodes, node.modifiers) || + case 215: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 208: - case 212: + case 213: + case 217: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 209: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.expression); - case 169: + case 214: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.expression) || + visitNode(cbNode, node.type); + case 171: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); - case 173: + case 176: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 126: + case 127: return visitNode(cbNode, node.expression); - case 216: + case 222: return visitNodes(cbNodes, node.types); - case 213: + case 177: + return visitNode(cbNode, node.expression) || + visitNodes(cbNodes, node.typeArguments); + case 219: return visitNode(cbNode, node.expression); + case 218: + return visitNodes(cbNodes, node.decorators); } } ts.forEachChild = forEachChild; @@ -4524,7 +5504,7 @@ var ts; ParsingContext[ParsingContext["TypeMembers"] = 5] = "TypeMembers"; ParsingContext[ParsingContext["ClassMembers"] = 6] = "ClassMembers"; ParsingContext[ParsingContext["EnumMembers"] = 7] = "EnumMembers"; - ParsingContext[ParsingContext["TypeReferences"] = 8] = "TypeReferences"; + ParsingContext[ParsingContext["HeritageClauseElement"] = 8] = "HeritageClauseElement"; ParsingContext[ParsingContext["VariableDeclarations"] = 9] = "VariableDeclarations"; ParsingContext[ParsingContext["ObjectBindingElements"] = 10] = "ObjectBindingElements"; ParsingContext[ParsingContext["ArrayBindingElements"] = 11] = "ArrayBindingElements"; @@ -4555,7 +5535,7 @@ var ts; case 5: return ts.Diagnostics.Property_or_signature_expected; case 6: return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; case 7: return ts.Diagnostics.Enum_member_expected; - case 8: return ts.Diagnostics.Type_reference_expected; + case 8: return ts.Diagnostics.Expression_expected; case 9: return ts.Diagnostics.Variable_declaration_expected; case 10: return ts.Diagnostics.Property_destructuring_pattern_expected; case 11: return ts.Diagnostics.Array_element_destructuring_pattern_expected; @@ -4573,29 +5553,33 @@ var ts; ; function modifierToFlag(token) { switch (token) { - case 109: return 128; - case 108: return 16; - case 107: return 64; - case 106: return 32; - case 77: return 1; - case 114: return 2; - case 69: return 8192; - case 72: return 256; + case 110: return 128; + case 109: return 16; + case 108: return 64; + case 107: return 32; + case 78: return 1; + case 115: return 2; + case 70: return 8192; + case 73: return 256; } return 0; } ts.modifierToFlag = modifierToFlag; function fixupParentReferences(sourceFile) { - var _parent = sourceFile; + // normally parent references are set during binding. However, for clients that only need + // a syntax tree, and no semantic features, then the binding process is an unnecessary + // overhead. This functions allows us to set all the parents, without all the expense of + // binding. + var parent = sourceFile; forEachChild(sourceFile, visitNode); return; function visitNode(n) { - if (n.parent !== _parent) { - n.parent = _parent; - var saveParent = _parent; - _parent = n; + if (n.parent !== parent) { + n.parent = parent; + var saveParent = parent; + parent = n; forEachChild(n, visitNode); - _parent = saveParent; + parent = saveParent; } } } @@ -4603,7 +5587,7 @@ var ts; switch (node.kind) { case 8: case 7: - case 64: + case 65: return true; } return false; @@ -4633,7 +5617,7 @@ var ts; array._children = undefined; array.pos += delta; array.end += delta; - for (var _i = 0, _n = array.length; _i < _n; _i++) { + for (var _i = 0; _i < array.length; _i++) { var node = array[_i]; visitNode(node); } @@ -4697,7 +5681,7 @@ var ts; array.intersectsChange = true; array._children = undefined; adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); - for (var _i = 0, _n = array.length; _i < _n; _i++) { + for (var _i = 0; _i < array.length; _i++) { var node = array[_i]; visitNode(node); } @@ -4813,7 +5797,7 @@ var ts; } ts.updateSourceFile = updateSourceFile; function isEvalOrArgumentsIdentifier(node) { - return node.kind === 64 && + return node.kind === 65 && (node.text === "eval" || node.text === "arguments"); } ts.isEvalOrArgumentsIdentifier = isEvalOrArgumentsIdentifier; @@ -4895,12 +5879,13 @@ var ts; ts.createSourceFile = createSourceFile; function parseSourceFile(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes) { if (setParentNodes === void 0) { setParentNodes = false; } + var disallowInAndDecoratorContext = 2 | 16; var parsingContext = 0; var identifiers = {}; var identifierCount = 0; var nodeCount = 0; var token; - var sourceFile = createNode(221, 0); + var sourceFile = createNode(227, 0); sourceFile.pos = 0; sourceFile.end = sourceText.length; sourceFile.text = sourceText; @@ -4946,6 +5931,19 @@ var ts; function setGeneratorParameterContext(val) { setContextFlag(val, 8); } + function setDecoratorContext(val) { + setContextFlag(val, 16); + } + function doOutsideOfContext(flags, func) { + var currentContextFlags = contextFlags & flags; + if (currentContextFlags) { + setContextFlag(false, currentContextFlags); + var result = func(); + setContextFlag(true, currentContextFlags); + return result; + } + return func(); + } function allowInAnd(func) { if (contextFlags & 2) { setDisallowInContext(false); @@ -4982,6 +5980,15 @@ var ts; } return func(); } + function doInDecoratorContext(func) { + if (contextFlags & 16) { + return func(); + } + setDecoratorContext(true); + var result = func(); + setDecoratorContext(false); + return result; + } function inYieldContext() { return (contextFlags & 4) !== 0; } @@ -4994,10 +6001,13 @@ var ts; function inDisallowInContext() { return (contextFlags & 2) !== 0; } + function inDecoratorContext() { + return (contextFlags & 16) !== 0; + } function parseErrorAtCurrentToken(message, arg0) { var start = scanner.getTokenPos(); - var _length = scanner.getTextPos() - start; - parseErrorAtPosition(start, _length, message, arg0); + var length = scanner.getTextPos() - start; + parseErrorAtPosition(start, length, message, arg0); } function parseErrorAtPosition(start, length, message, arg0) { var lastError = ts.lastOrUndefined(sourceFile.parseDiagnostics); @@ -5054,13 +6064,13 @@ var ts; return speculationHelper(callback, false); } function isIdentifier() { - if (token === 64) { + if (token === 65) { return true; } - if (token === 110 && inYieldContext()) { + if (token === 111 && inYieldContext()) { return false; } - return inStrictModeContext() ? token > 110 : token > 100; + return inStrictModeContext() ? token > 111 : token > 101; } function parseExpected(kind, diagnosticMessage) { if (token === kind) { @@ -5131,7 +6141,7 @@ var ts; } if (parseErrorBeforeNextFinishedNode) { parseErrorBeforeNextFinishedNode = false; - node.parserContextFlags |= 16; + node.parserContextFlags |= 32; } return node; } @@ -5153,12 +6163,12 @@ var ts; function createIdentifier(isIdentifier, diagnosticMessage) { identifierCount++; if (isIdentifier) { - var node = createNode(64); + var node = createNode(65); node.text = internIdentifier(scanner.getTokenValue()); nextToken(); return finishNode(node); } - return createMissingNode(64, false, diagnosticMessage || ts.Diagnostics.Identifier_expected); + return createMissingNode(65, false, diagnosticMessage || ts.Diagnostics.Identifier_expected); } function parseIdentifier(diagnosticMessage) { return createIdentifier(isIdentifier(), diagnosticMessage); @@ -5181,7 +6191,7 @@ var ts; return parseIdentifierName(); } function parseComputedPropertyName() { - var node = createNode(126); + var node = createNode(127); parseExpected(18); var yieldContext = inYieldContext(); if (inGeneratorParameterContext()) { @@ -5205,17 +6215,17 @@ var ts; return ts.isModifier(token) && tryParse(nextTokenCanFollowContextualModifier); } function nextTokenCanFollowContextualModifier() { - if (token === 69) { - return nextToken() === 76; + if (token === 70) { + return nextToken() === 77; } - if (token === 77) { + if (token === 78) { nextToken(); - if (token === 72) { + if (token === 73) { return lookAhead(nextTokenIsClassOrFunction); } return token !== 35 && token !== 14 && canFollowModifier(); } - if (token === 72) { + if (token === 73) { return nextTokenIsClassOrFunction(); } nextToken(); @@ -5229,7 +6239,7 @@ var ts; } function nextTokenIsClassOrFunction() { nextToken(); - return token === 68 || token === 82; + return token === 69 || token === 83; } function isListElement(parsingContext, inErrorRecovery) { var node = currentNode(parsingContext); @@ -5244,11 +6254,11 @@ var ts; case 4: return isStartOfStatement(inErrorRecovery); case 3: - return token === 66 || token === 72; + return token === 67 || token === 73; case 5: return isStartOfTypeMember(); case 6: - return lookAhead(isClassMemberStart); + return lookAhead(isClassMemberStart) || (token === 22 && !inErrorRecovery); case 7: return token === 18 || isLiteralPropertyName(); case 13: @@ -5256,7 +6266,15 @@ var ts; case 10: return isLiteralPropertyName(); case 8: - return isIdentifier() && !isNotHeritageClauseTypeName(); + if (token === 14) { + return lookAhead(isValidHeritageClauseObjectLiteral); + } + if (!inErrorRecovery) { + return isStartOfLeftHandSideExpression() && !isHeritageClauseExtendsOrImplementsKeyword(); + } + else { + return isIdentifier() && !isHeritageClauseExtendsOrImplementsKeyword(); + } case 9: return isIdentifierOrPattern(); case 11: @@ -5278,17 +6296,29 @@ var ts; } ts.Debug.fail("Non-exhaustive case in 'isListElement'."); } + function isValidHeritageClauseObjectLiteral() { + ts.Debug.assert(token === 14); + if (nextToken() === 15) { + var next = nextToken(); + return next === 23 || next === 14 || next === 79 || next === 103; + } + return true; + } function nextTokenIsIdentifier() { nextToken(); return isIdentifier(); } - function isNotHeritageClauseTypeName() { - if (token === 102 || - token === 78) { - return lookAhead(nextTokenIsIdentifier); + function isHeritageClauseExtendsOrImplementsKeyword() { + if (token === 103 || + token === 79) { + return lookAhead(nextTokenIsStartOfExpression); } return false; } + function nextTokenIsStartOfExpression() { + nextToken(); + return isStartOfExpression(); + } function isListTerminator(kind) { if (token === 1) { return true; @@ -5305,13 +6335,13 @@ var ts; case 20: return token === 15; case 4: - return token === 15 || token === 66 || token === 72; + return token === 15 || token === 67 || token === 73; case 8: - return token === 14 || token === 78 || token === 102; + return token === 14 || token === 79 || token === 103; case 9: return isVariableDeclaratorListTerminator(); case 16: - return token === 25 || token === 16 || token === 14 || token === 78 || token === 102; + return token === 25 || token === 16 || token === 14 || token === 79 || token === 103; case 12: return token === 17 || token === 22; case 14: @@ -5404,7 +6434,7 @@ var ts; if (ts.containsParseError(node)) { return undefined; } - var nodeContextFlags = node.parserContextFlags & 31; + var nodeContextFlags = node.parserContextFlags & 63; if (nodeContextFlags !== contextFlags) { return undefined; } @@ -5438,26 +6468,26 @@ var ts; case 15: return isReusableParameter(node); case 19: - case 8: case 16: case 18: case 17: case 12: case 13: + case 8: } return false; } function isReusableModuleElement(node) { if (node) { switch (node.kind) { - case 204: - case 203: - case 210: case 209: - case 196: - case 197: - case 200: - case 199: + case 208: + case 215: + case 214: + case 201: + case 202: + case 205: + case 204: return true; } return isReusableStatement(node); @@ -5467,12 +6497,13 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 133: - case 138: - case 132: - case 134: case 135: - case 130: + case 140: + case 134: + case 136: + case 137: + case 132: + case 178: return true; } } @@ -5481,8 +6512,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 214: - case 215: + case 220: + case 221: return true; } } @@ -5491,56 +6522,56 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 195: - case 175: - case 174: - case 178: - case 177: - case 190: - case 186: - case 188: - case 185: - case 184: - case 182: - case 183: - case 181: + case 200: case 180: - case 187: - case 176: - case 191: - case 189: case 179: + case 183: + case 182: + case 195: + case 191: + case 193: + case 190: + case 189: + case 187: + case 188: + case 186: + case 185: case 192: + case 181: + case 196: + case 194: + case 184: + case 197: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 220; + return node.kind === 226; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 137: + case 139: + case 133: + case 140: case 131: case 138: - case 129: - case 136: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 193) { + if (node.kind !== 198) { return false; } var variableDeclarator = node; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 128) { + if (node.kind !== 129) { return false; } var parameter = node; @@ -5609,7 +6640,7 @@ var ts; function parseEntityName(allowReservedWords, diagnosticMessage) { var entity = parseIdentifier(diagnosticMessage); while (parseOptional(20)) { - var node = createNode(125, entity.pos); + var node = createNode(126, entity.pos); node.left = entity; node.right = parseRightSideOfDot(allowReservedWords); entity = finishNode(node); @@ -5620,13 +6651,13 @@ var ts; if (scanner.hasPrecedingLineBreak() && scanner.isReservedWord()) { var matchesPattern = lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); if (matchesPattern) { - return createMissingNode(64, true, ts.Diagnostics.Identifier_expected); + return createMissingNode(65, true, ts.Diagnostics.Identifier_expected); } } return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(169); + var template = createNode(171); template.head = parseLiteralNode(); ts.Debug.assert(template.head.kind === 11, "Template head has wrong token kind"); var templateSpans = []; @@ -5639,7 +6670,7 @@ var ts; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(173); + var span = createNode(176); span.expression = allowInAnd(parseExpression); var literal; if (token === 15) { @@ -5673,7 +6704,7 @@ var ts; return node; } function parseTypeReference() { - var node = createNode(139); + var node = createNode(141); node.typeName = parseEntityName(false, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && token === 24) { node.typeArguments = parseBracketedList(17, parseType, 24, 25); @@ -5681,15 +6712,15 @@ var ts; return finishNode(node); } function parseTypeQuery() { - var node = createNode(142); - parseExpected(96); + var node = createNode(144); + parseExpected(97); node.exprName = parseEntityName(true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(127); + var node = createNode(128); node.name = parseIdentifier(); - if (parseOptional(78)) { + if (parseOptional(79)) { if (isStartOfType() || !isStartOfExpression()) { node.constraint = parseType(); } @@ -5713,7 +6744,7 @@ var ts; return undefined; } function isStartOfParameter() { - return token === 21 || isIdentifierOrPattern() || ts.isModifier(token); + return token === 21 || isIdentifierOrPattern() || ts.isModifier(token) || token === 52; } function setModifiers(node, modifiers) { if (modifiers) { @@ -5722,7 +6753,8 @@ var ts; } } function parseParameter() { - var node = createNode(128); + var node = createNode(129); + node.decorators = parseDecorators(); setModifiers(node, parseModifiers()); node.dotDotDotToken = parseOptionalToken(21); node.name = inGeneratorParameterContext() ? doInYieldContext(parseIdentifierOrPattern) : parseIdentifierOrPattern(); @@ -5773,8 +6805,8 @@ var ts; } function parseSignatureMember(kind) { var node = createNode(kind); - if (kind === 137) { - parseExpected(87); + if (kind === 139) { + parseExpected(88); } fillSignature(51, false, false, node); parseTypeMemberSemicolon(); @@ -5812,9 +6844,9 @@ var ts; nextToken(); return token === 51 || token === 23 || token === 19; } - function parseIndexSignatureDeclaration(modifiers) { - var fullStart = modifiers ? modifiers.pos : scanner.getStartPos(); - var node = createNode(138, fullStart); + function parseIndexSignatureDeclaration(fullStart, decorators, modifiers) { + var node = createNode(140, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); node.parameters = parseBracketedList(15, parseParameter, 18, 19); node.type = parseTypeAnnotation(); @@ -5823,19 +6855,19 @@ var ts; } function parsePropertyOrMethodSignature() { var fullStart = scanner.getStartPos(); - var _name = parsePropertyName(); + var name = parsePropertyName(); var questionToken = parseOptionalToken(50); if (token === 16 || token === 24) { - var method = createNode(131, fullStart); - method.name = _name; + var method = createNode(133, fullStart); + method.name = name; method.questionToken = questionToken; fillSignature(51, false, false, method); parseTypeMemberSemicolon(); return finishNode(method); } else { - var property = createNode(129, fullStart); - property.name = _name; + var property = createNode(131, fullStart); + property.name = name; property.questionToken = questionToken; property.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -5876,14 +6908,14 @@ var ts; switch (token) { case 16: case 24: - return parseSignatureMember(136); + return parseSignatureMember(138); case 18: return isIndexSignature() - ? parseIndexSignatureDeclaration(undefined) + ? parseIndexSignatureDeclaration(scanner.getStartPos(), undefined, undefined) : parsePropertyOrMethodSignature(); - case 87: + case 88: if (lookAhead(isStartOfConstructSignature)) { - return parseSignatureMember(137); + return parseSignatureMember(139); } case 8: case 7: @@ -5901,9 +6933,11 @@ var ts; } } function parseIndexSignatureWithModifiers() { + var fullStart = scanner.getStartPos(); + var decorators = parseDecorators(); var modifiers = parseModifiers(); return isIndexSignature() - ? parseIndexSignatureDeclaration(modifiers) + ? parseIndexSignatureDeclaration(fullStart, decorators, modifiers) : undefined; } function isStartOfConstructSignature() { @@ -5911,7 +6945,7 @@ var ts; return token === 16 || token === 24; } function parseTypeLiteral() { - var node = createNode(143); + var node = createNode(145); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -5927,12 +6961,12 @@ var ts; return members; } function parseTupleType() { - var node = createNode(145); + var node = createNode(147); node.elementTypes = parseBracketedList(18, parseType, 18, 19); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(147); + var node = createNode(149); parseExpected(16); node.type = parseType(); parseExpected(17); @@ -5940,8 +6974,8 @@ var ts; } function parseFunctionOrConstructorType(kind) { var node = createNode(kind); - if (kind === 141) { - parseExpected(87); + if (kind === 143) { + parseExpected(88); } fillSignature(32, false, false, node); return finishNode(node); @@ -5952,16 +6986,16 @@ var ts; } function parseNonArrayType() { switch (token) { - case 111: - case 120: - case 118: case 112: case 121: + case 119: + case 113: + case 122: var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReference(); - case 98: + case 99: return parseTokenNode(); - case 96: + case 97: return parseTypeQuery(); case 14: return parseTypeLiteral(); @@ -5975,17 +7009,17 @@ var ts; } function isStartOfType() { switch (token) { - case 111: - case 120: - case 118: case 112: case 121: - case 98: - case 96: + case 119: + case 113: + case 122: + case 99: + case 97: case 14: case 18: case 24: - case 87: + case 88: return true; case 16: return lookAhead(isStartOfParenthesizedOrFunctionType); @@ -6001,7 +7035,7 @@ var ts; var type = parseNonArrayType(); while (!scanner.hasPrecedingLineBreak() && parseOptional(18)) { parseExpected(19); - var node = createNode(144, type.pos); + var node = createNode(146, type.pos); node.elementType = type; type = finishNode(node); } @@ -6016,7 +7050,7 @@ var ts; types.push(parseArrayTypeOrHigher()); } types.end = getNodeEnd(); - var node = createNode(146, type.pos); + var node = createNode(148, type.pos); node.types = types; type = finishNode(node); } @@ -6036,7 +7070,7 @@ var ts; if (isIdentifier() || ts.isModifier(token)) { nextToken(); if (token === 51 || token === 23 || - token === 50 || token === 52 || + token === 50 || token === 53 || isIdentifier() || ts.isModifier(token)) { return true; } @@ -6061,23 +7095,23 @@ var ts; } function parseTypeWorker() { if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(140); + return parseFunctionOrConstructorType(142); } - if (token === 87) { - return parseFunctionOrConstructorType(141); + if (token === 88) { + return parseFunctionOrConstructorType(143); } return parseUnionTypeOrHigher(); } function parseTypeAnnotation() { return parseOptional(51) ? parseType() : undefined; } - function isStartOfExpression() { + function isStartOfLeftHandSideExpression() { switch (token) { - case 92: - case 90: - case 88: - case 94: - case 79: + case 93: + case 91: + case 89: + case 95: + case 80: case 7: case 8: case 10: @@ -6085,22 +7119,33 @@ var ts; case 16: case 18: case 14: - case 82: - case 87: + case 83: + case 69: + case 88: case 36: - case 56: + case 57: + case 65: + return true; + default: + return isIdentifier(); + } + } + function isStartOfExpression() { + if (isStartOfLeftHandSideExpression()) { + return true; + } + switch (token) { case 33: case 34: case 47: case 46: - case 73: - case 96: - case 98: + case 74: + case 97: + case 99: case 38: case 39: case 24: - case 64: - case 110: + case 111: return true; default: if (isBinaryOperator()) { @@ -6110,26 +7155,49 @@ var ts; } } function isStartOfExpressionStatement() { - return token !== 14 && token !== 82 && isStartOfExpression(); + return token !== 14 && + token !== 83 && + token !== 69 && + token !== 52 && + isStartOfExpression(); } function parseExpression() { + // Expression[in]: + // AssignmentExpression[in] + // Expression[in] , AssignmentExpression[in] + var saveDecoratorContext = inDecoratorContext(); + if (saveDecoratorContext) { + setDecoratorContext(false); + } var expr = parseAssignmentExpressionOrHigher(); var operatorToken; while ((operatorToken = parseOptionalToken(23))) { expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher()); } + if (saveDecoratorContext) { + setDecoratorContext(true); + } return expr; } function parseInitializer(inParameter) { - if (token !== 52) { + if (token !== 53) { if (scanner.hasPrecedingLineBreak() || (inParameter && token === 14) || !isStartOfExpression()) { return undefined; } } - parseExpected(52); + parseExpected(53); return parseAssignmentExpressionOrHigher(); } function parseAssignmentExpressionOrHigher() { + // AssignmentExpression[in,yield]: + // 1) ConditionalExpression[?in,?yield] + // 2) LeftHandSideExpression = AssignmentExpression[?in,?yield] + // 3) LeftHandSideExpression AssignmentOperator AssignmentExpression[?in,?yield] + // 4) ArrowFunctionExpression[?in,?yield] + // 5) [+Yield] YieldExpression[?In] + // + // Note: for ease of implementation we treat productions '2' and '3' as the same thing. + // (i.e. they're both BinaryExpressions with an assignment operator in it). if (isYieldExpression()) { return parseYieldExpression(); } @@ -6138,7 +7206,7 @@ var ts; return arrowExpression; } var expr = parseBinaryExpressionOrHigher(0); - if (expr.kind === 64 && token === 32) { + if (expr.kind === 65 && token === 32) { return parseSimpleArrowFunctionExpression(expr); } if (isLeftHandSideExpression(expr) && isAssignmentOperator(reScanGreaterToken())) { @@ -6147,7 +7215,7 @@ var ts; return parseConditionalExpressionRest(expr); } function isYieldExpression() { - if (token === 110) { + if (token === 111) { if (inYieldContext()) { return true; } @@ -6168,7 +7236,7 @@ var ts; (isIdentifier() || token === 14 || token === 18); } function parseYieldExpression() { - var node = createNode(170); + var node = createNode(172); nextToken(); if (!scanner.hasPrecedingLineBreak() && (token === 35 || isStartOfExpression())) { @@ -6182,14 +7250,14 @@ var ts; } function parseSimpleArrowFunctionExpression(identifier) { ts.Debug.assert(token === 32, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); - var node = createNode(161, identifier.pos); - var parameter = createNode(128, identifier.pos); + var node = createNode(163, identifier.pos); + var parameter = createNode(129, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = [parameter]; node.parameters.pos = parameter.pos; node.parameters.end = parameter.end; - parseExpected(32); + node.equalsGreaterThanToken = parseExpectedToken(32, false, ts.Diagnostics._0_expected, "=>"); node.body = parseArrowFunctionExpressionBody(); return finishNode(node); } @@ -6204,12 +7272,11 @@ var ts; if (!arrowFunction) { return undefined; } - if (parseExpected(32) || token === 14) { - arrowFunction.body = parseArrowFunctionExpressionBody(); - } - else { - arrowFunction.body = parseIdentifier(); - } + var lastToken = token; + arrowFunction.equalsGreaterThanToken = parseExpectedToken(32, false, ts.Diagnostics._0_expected, "=>"); + arrowFunction.body = (lastToken === 32 || lastToken === 14) + ? parseArrowFunctionExpressionBody() + : parseIdentifier(); return finishNode(arrowFunction); } function isParenthesizedArrowFunctionExpression() { @@ -6259,7 +7326,7 @@ var ts; return parseParenthesizedArrowFunctionExpressionHead(false); } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNode(161); + var node = createNode(163); fillSignature(51, false, !allowAmbiguity, node); if (!node.parameters) { return undefined; @@ -6273,7 +7340,10 @@ var ts; if (token === 14) { return parseFunctionBlock(false, false); } - if (isStartOfStatement(true) && !isStartOfExpressionStatement() && token !== 82) { + if (isStartOfStatement(true) && + !isStartOfExpressionStatement() && + token !== 83 && + token !== 69) { return parseFunctionBlock(false, true); } return parseAssignmentExpressionOrHigher(); @@ -6283,10 +7353,10 @@ var ts; if (!questionToken) { return leftOperand; } - var node = createNode(168, leftOperand.pos); + var node = createNode(170, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; - node.whenTrue = allowInAnd(parseAssignmentExpressionOrHigher); + node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); node.colonToken = parseExpectedToken(51, false, ts.Diagnostics._0_expected, ts.tokenToString(51)); node.whenFalse = parseAssignmentExpressionOrHigher(); return finishNode(node); @@ -6296,7 +7366,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 85 || t === 124; + return t === 86 || t === 125; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -6305,7 +7375,7 @@ var ts; if (newPrecedence <= precedence) { break; } - if (token === 85 && inDisallowInContext()) { + if (token === 86 && inDisallowInContext()) { break; } leftOperand = makeBinaryExpression(leftOperand, parseTokenNode(), parseBinaryExpressionOrHigher(newPrecedence)); @@ -6313,7 +7383,7 @@ var ts; return leftOperand; } function isBinaryOperator() { - if (inDisallowInContext() && token === 85) { + if (inDisallowInContext() && token === 86) { return false; } return getBinaryOperatorPrecedence() > 0; @@ -6339,8 +7409,8 @@ var ts; case 25: case 26: case 27: + case 87: case 86: - case 85: return 7; case 40: case 41: @@ -6357,33 +7427,33 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(167, left.pos); + var node = createNode(169, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(165); + var node = createNode(167); node.operator = token; nextToken(); node.operand = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(162); + var node = createNode(164); nextToken(); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(163); + var node = createNode(165); nextToken(); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(164); + var node = createNode(166); nextToken(); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); @@ -6397,11 +7467,11 @@ var ts; case 38: case 39: return parsePrefixUnaryExpression(); - case 73: + case 74: return parseDeleteExpression(); - case 96: + case 97: return parseTypeOfExpression(); - case 98: + case 99: return parseVoidExpression(); case 24: return parseTypeAssertion(); @@ -6413,7 +7483,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(isLeftHandSideExpression(expression)); if ((token === 38 || token === 39) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(166, expression.pos); + var node = createNode(168, expression.pos); node.operand = expression; node.operator = token; nextToken(); @@ -6422,7 +7492,7 @@ var ts; return expression; } function parseLeftHandSideExpressionOrHigher() { - var expression = token === 90 + var expression = token === 91 ? parseSuperExpression() : parseMemberExpressionOrHigher(); return parseCallExpressionRest(expression); @@ -6436,14 +7506,14 @@ var ts; if (token === 16 || token === 20) { return expression; } - var node = createNode(153, expression.pos); + var node = createNode(155, 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(158); + var node = createNode(160); parseExpected(24); node.type = parseType(); parseExpected(25); @@ -6454,15 +7524,15 @@ var ts; while (true) { var dotToken = parseOptionalToken(20); if (dotToken) { - var propertyAccess = createNode(153, expression.pos); + var propertyAccess = createNode(155, expression.pos); propertyAccess.expression = expression; propertyAccess.dotToken = dotToken; propertyAccess.name = parseRightSideOfDot(true); expression = finishNode(propertyAccess); continue; } - if (parseOptional(18)) { - var indexedAccess = createNode(154, expression.pos); + if (!inDecoratorContext() && parseOptional(18)) { + var indexedAccess = createNode(156, expression.pos); indexedAccess.expression = expression; if (token !== 19) { indexedAccess.argumentExpression = allowInAnd(parseExpression); @@ -6476,7 +7546,7 @@ var ts; continue; } if (token === 10 || token === 11) { - var tagExpression = createNode(157, expression.pos); + var tagExpression = createNode(159, expression.pos); tagExpression.tag = expression; tagExpression.template = token === 10 ? parseLiteralNode() @@ -6495,7 +7565,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(155, expression.pos); + var callExpr = createNode(157, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -6503,10 +7573,10 @@ var ts; continue; } else if (token === 16) { - var _callExpr = createNode(155, expression.pos); - _callExpr.expression = expression; - _callExpr.arguments = parseArgumentList(); - expression = finishNode(_callExpr); + var callExpr = createNode(157, expression.pos); + callExpr.expression = expression; + callExpr.arguments = parseArgumentList(); + expression = finishNode(callExpr); continue; } return expression; @@ -6538,7 +7608,6 @@ var ts; case 19: case 51: case 22: - case 23: case 50: case 28: case 30: @@ -6552,6 +7621,8 @@ var ts; case 15: case 1: return true; + case 23: + case 14: default: return false; } @@ -6562,11 +7633,11 @@ var ts; case 8: case 10: return parseLiteralNode(); - case 92: - case 90: - case 88: - case 94: - case 79: + case 93: + case 91: + case 89: + case 95: + case 80: return parseTokenNode(); case 16: return parseParenthesizedExpression(); @@ -6574,12 +7645,14 @@ var ts; return parseArrayLiteralExpression(); case 14: return parseObjectLiteralExpression(); - case 82: + case 69: + return parseClassExpression(); + case 83: return parseFunctionExpression(); - case 87: + case 88: return parseNewExpression(); case 36: - case 56: + case 57: if (reScanSlashToken() === 9) { return parseLiteralNode(); } @@ -6590,28 +7663,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNode(159); + var node = createNode(161); parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); return finishNode(node); } function parseSpreadElement() { - var node = createNode(171); + var node = createNode(173); parseExpected(21); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token === 21 ? parseSpreadElement() : - token === 23 ? createNode(172) : + token === 23 ? createNode(175) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { - return allowInAnd(parseArgumentOrArrayLiteralElement); + return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(151); + var node = createNode(153); parseExpected(18); if (scanner.hasPrecedingLineBreak()) node.flags |= 512; @@ -6619,19 +7692,20 @@ var ts; parseExpected(19); return finishNode(node); } - function tryParseAccessorDeclaration(fullStart, modifiers) { - if (parseContextualModifier(115)) { - return parseAccessorDeclaration(134, fullStart, modifiers); + function tryParseAccessorDeclaration(fullStart, decorators, modifiers) { + if (parseContextualModifier(116)) { + return parseAccessorDeclaration(136, fullStart, decorators, modifiers); } - else if (parseContextualModifier(119)) { - return parseAccessorDeclaration(135, fullStart, modifiers); + else if (parseContextualModifier(120)) { + return parseAccessorDeclaration(137, fullStart, decorators, modifiers); } return undefined; } function parseObjectLiteralElement() { var fullStart = scanner.getStartPos(); + var decorators = parseDecorators(); var modifiers = parseModifiers(); - var accessor = tryParseAccessorDeclaration(fullStart, modifiers); + var accessor = tryParseAccessorDeclaration(fullStart, decorators, modifiers); if (accessor) { return accessor; } @@ -6641,16 +7715,16 @@ var ts; var propertyName = parsePropertyName(); var questionToken = parseOptionalToken(50); if (asteriskToken || token === 16 || token === 24) { - return parseMethodDeclaration(fullStart, modifiers, asteriskToken, propertyName, questionToken); + return parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, propertyName, questionToken); } if ((token === 23 || token === 15) && tokenIsIdentifier) { - var shorthandDeclaration = createNode(219, fullStart); + var shorthandDeclaration = createNode(225, fullStart); shorthandDeclaration.name = propertyName; shorthandDeclaration.questionToken = questionToken; return finishNode(shorthandDeclaration); } else { - var propertyAssignment = createNode(218, fullStart); + var propertyAssignment = createNode(224, fullStart); propertyAssignment.name = propertyName; propertyAssignment.questionToken = questionToken; parseExpected(51); @@ -6659,7 +7733,7 @@ var ts; } } function parseObjectLiteralExpression() { - var node = createNode(152); + var node = createNode(154); parseExpected(14); if (scanner.hasPrecedingLineBreak()) { node.flags |= 512; @@ -6669,20 +7743,27 @@ var ts; return finishNode(node); } function parseFunctionExpression() { - var node = createNode(160); - parseExpected(82); + var saveDecoratorContext = inDecoratorContext(); + if (saveDecoratorContext) { + setDecoratorContext(false); + } + var node = createNode(162); + parseExpected(83); node.asteriskToken = parseOptionalToken(35); node.name = node.asteriskToken ? doInYieldContext(parseOptionalIdentifier) : parseOptionalIdentifier(); fillSignature(51, !!node.asteriskToken, false, node); node.body = parseFunctionBlock(!!node.asteriskToken, false); + if (saveDecoratorContext) { + setDecoratorContext(true); + } return finishNode(node); } function parseOptionalIdentifier() { return isIdentifier() ? parseIdentifier() : undefined; } function parseNewExpression() { - var node = createNode(156); - parseExpected(87); + var node = createNode(158); + parseExpected(88); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); if (node.typeArguments || token === 16) { @@ -6691,7 +7772,7 @@ var ts; return finishNode(node); } function parseBlock(ignoreMissingOpenBrace, checkForStrictMode, diagnosticMessage) { - var node = createNode(174); + var node = createNode(179); if (parseExpected(14, diagnosticMessage) || ignoreMissingOpenBrace) { node.statements = parseList(2, checkForStrictMode, parseStatement); parseExpected(15); @@ -6704,30 +7785,37 @@ var ts; function parseFunctionBlock(allowYield, ignoreMissingOpenBrace, diagnosticMessage) { var savedYieldContext = inYieldContext(); setYieldContext(allowYield); + var saveDecoratorContext = inDecoratorContext(); + if (saveDecoratorContext) { + setDecoratorContext(false); + } var block = parseBlock(ignoreMissingOpenBrace, true, diagnosticMessage); + if (saveDecoratorContext) { + setDecoratorContext(true); + } setYieldContext(savedYieldContext); return block; } function parseEmptyStatement() { - var node = createNode(176); + var node = createNode(181); parseExpected(22); return finishNode(node); } function parseIfStatement() { - var node = createNode(178); - parseExpected(83); + var node = createNode(183); + parseExpected(84); parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); node.thenStatement = parseStatement(); - node.elseStatement = parseOptional(75) ? parseStatement() : undefined; + node.elseStatement = parseOptional(76) ? parseStatement() : undefined; return finishNode(node); } function parseDoStatement() { - var node = createNode(179); - parseExpected(74); + var node = createNode(184); + parseExpected(75); node.statement = parseStatement(); - parseExpected(99); + parseExpected(100); parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); @@ -6735,8 +7823,8 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(180); - parseExpected(99); + var node = createNode(185); + parseExpected(100); parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); @@ -6745,11 +7833,11 @@ var ts; } function parseForOrForInOrForOfStatement() { var pos = getNodePos(); - parseExpected(81); + parseExpected(82); parseExpected(16); var initializer = undefined; if (token !== 22) { - if (token === 97 || token === 104 || token === 69) { + if (token === 98 || token === 105 || token === 70) { initializer = parseVariableDeclarationList(true); } else { @@ -6757,22 +7845,22 @@ var ts; } } var forOrForInOrForOfStatement; - if (parseOptional(85)) { - var forInStatement = createNode(182, pos); + if (parseOptional(86)) { + var forInStatement = createNode(187, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(17); forOrForInOrForOfStatement = forInStatement; } - else if (parseOptional(124)) { - var forOfStatement = createNode(183, pos); + else if (parseOptional(125)) { + var forOfStatement = createNode(188, pos); forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(17); forOrForInOrForOfStatement = forOfStatement; } else { - var forStatement = createNode(181, pos); + var forStatement = createNode(186, pos); forStatement.initializer = initializer; parseExpected(22); if (token !== 22 && token !== 17) { @@ -6790,7 +7878,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 185 ? 65 : 70); + parseExpected(kind === 190 ? 66 : 71); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -6798,8 +7886,8 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(186); - parseExpected(89); + var node = createNode(191); + parseExpected(90); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); } @@ -6807,8 +7895,8 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(187); - parseExpected(100); + var node = createNode(192); + parseExpected(101); parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); @@ -6816,30 +7904,30 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(214); - parseExpected(66); + var node = createNode(220); + parseExpected(67); node.expression = allowInAnd(parseExpression); parseExpected(51); node.statements = parseList(4, false, parseStatement); return finishNode(node); } function parseDefaultClause() { - var node = createNode(215); - parseExpected(72); + var node = createNode(221); + parseExpected(73); parseExpected(51); node.statements = parseList(4, false, parseStatement); return finishNode(node); } function parseCaseOrDefaultClause() { - return token === 66 ? parseCaseClause() : parseDefaultClause(); + return token === 67 ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(188); - parseExpected(91); + var node = createNode(193); + parseExpected(92); parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); - var caseBlock = createNode(202, scanner.getStartPos()); + var caseBlock = createNode(207, scanner.getStartPos()); parseExpected(14); caseBlock.clauses = parseList(3, false, parseCaseOrDefaultClause); parseExpected(15); @@ -6847,26 +7935,28 @@ var ts; return finishNode(node); } function parseThrowStatement() { - var node = createNode(190); - parseExpected(93); + // ThrowStatement[Yield] : + // throw [no LineTerminator here]Expression[In, ?Yield]; + var node = createNode(195); + parseExpected(94); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); return finishNode(node); } function parseTryStatement() { - var node = createNode(191); - parseExpected(95); + var node = createNode(196); + parseExpected(96); node.tryBlock = parseBlock(false, false); - node.catchClause = token === 67 ? parseCatchClause() : undefined; - if (!node.catchClause || token === 80) { - parseExpected(80); + node.catchClause = token === 68 ? parseCatchClause() : undefined; + if (!node.catchClause || token === 81) { + parseExpected(81); node.finallyBlock = parseBlock(false, false); } return finishNode(node); } function parseCatchClause() { - var result = createNode(217); - parseExpected(67); + var result = createNode(223); + parseExpected(68); if (parseExpected(16)) { result.variableDeclaration = parseVariableDeclaration(); } @@ -6875,22 +7965,22 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(192); - parseExpected(71); + var node = createNode(197); + parseExpected(72); parseSemicolon(); return finishNode(node); } function parseExpressionOrLabeledStatement() { var fullStart = scanner.getStartPos(); var expression = allowInAnd(parseExpression); - if (expression.kind === 64 && parseOptional(51)) { - var labeledStatement = createNode(189, fullStart); + if (expression.kind === 65 && parseOptional(51)) { + var labeledStatement = createNode(194, fullStart); labeledStatement.label = expression; labeledStatement.statement = parseStatement(); return finishNode(labeledStatement); } else { - var expressionStatement = createNode(177, fullStart); + var expressionStatement = createNode(182, fullStart); expressionStatement.expression = expression; parseSemicolon(); return finishNode(expressionStatement); @@ -6898,7 +7988,7 @@ var ts; } function isStartOfStatement(inErrorRecovery) { if (ts.isModifier(token)) { - var result = lookAhead(parseVariableStatementOrFunctionDeclarationWithModifiers); + var result = lookAhead(parseVariableStatementOrFunctionDeclarationOrClassDeclarationWithDecoratorsOrModifiers); if (result) { return true; } @@ -6907,39 +7997,39 @@ var ts; case 22: return !inErrorRecovery; case 14: - case 97: - case 104: - case 82: + case 98: + case 105: case 83: - case 74: - case 99: - case 81: - case 70: - case 65: - case 89: - case 100: - case 91: - case 93: - case 95: - case 71: - case 67: - case 80: - return true; case 69: + case 84: + case 75: + case 100: + case 82: + case 71: + case 66: + case 90: + case 101: + case 92: + case 94: + case 96: + case 72: + case 68: + case 81: + return true; + case 70: var isConstEnum = lookAhead(nextTokenIsEnumKeyword); return !isConstEnum; - case 103: - case 68: - case 116: - case 76: - case 122: + case 104: + case 117: + case 77: + case 123: if (isDeclarationStart()) { return false; } - case 108: - case 106: - case 107: case 109: + case 107: + case 108: + case 110: if (lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine)) { return false; } @@ -6949,7 +8039,7 @@ var ts; } function nextTokenIsEnumKeyword() { nextToken(); - return token === 76; + return token === 77; } function nextTokenIsIdentifierOrKeywordOnSameLine() { nextToken(); @@ -6959,46 +8049,48 @@ var ts; switch (token) { case 14: return parseBlock(false, false); - case 97: + case 98: + case 70: + return parseVariableStatement(scanner.getStartPos(), undefined, undefined); + case 83: + return parseFunctionDeclaration(scanner.getStartPos(), undefined, undefined); case 69: - return parseVariableStatement(scanner.getStartPos(), undefined); - case 82: - return parseFunctionDeclaration(scanner.getStartPos(), undefined); + return parseClassDeclaration(scanner.getStartPos(), undefined, undefined); case 22: return parseEmptyStatement(); - case 83: + case 84: return parseIfStatement(); - case 74: + case 75: return parseDoStatement(); - case 99: - return parseWhileStatement(); - case 81: - return parseForOrForInOrForOfStatement(); - case 70: - return parseBreakOrContinueStatement(184); - case 65: - return parseBreakOrContinueStatement(185); - case 89: - return parseReturnStatement(); case 100: - return parseWithStatement(); - case 91: - return parseSwitchStatement(); - case 93: - return parseThrowStatement(); - case 95: - case 67: - case 80: - return parseTryStatement(); + return parseWhileStatement(); + case 82: + return parseForOrForInOrForOfStatement(); case 71: + return parseBreakOrContinueStatement(189); + case 66: + return parseBreakOrContinueStatement(190); + case 90: + return parseReturnStatement(); + case 101: + return parseWithStatement(); + case 92: + return parseSwitchStatement(); + case 94: + return parseThrowStatement(); + case 96: + case 68: + case 81: + return parseTryStatement(); + case 72: return parseDebuggerStatement(); - case 104: + case 105: if (isLetDeclaration()) { - return parseVariableStatement(scanner.getStartPos(), undefined); + return parseVariableStatement(scanner.getStartPos(), undefined, undefined); } default: - if (ts.isModifier(token)) { - var result = tryParse(parseVariableStatementOrFunctionDeclarationWithModifiers); + if (ts.isModifier(token) || token === 52) { + var result = tryParse(parseVariableStatementOrFunctionDeclarationOrClassDeclarationWithDecoratorsOrModifiers); if (result) { return result; } @@ -7006,25 +8098,28 @@ var ts; return parseExpressionOrLabeledStatement(); } } - function parseVariableStatementOrFunctionDeclarationWithModifiers() { + function parseVariableStatementOrFunctionDeclarationOrClassDeclarationWithDecoratorsOrModifiers() { var start = scanner.getStartPos(); + var decorators = parseDecorators(); var modifiers = parseModifiers(); switch (token) { - case 69: + case 70: var nextTokenIsEnum = lookAhead(nextTokenIsEnumKeyword); if (nextTokenIsEnum) { return undefined; } - return parseVariableStatement(start, modifiers); - case 104: + return parseVariableStatement(start, decorators, modifiers); + case 105: if (!isLetDeclaration()) { return undefined; } - return parseVariableStatement(start, modifiers); - case 97: - return parseVariableStatement(start, modifiers); - case 82: - return parseFunctionDeclaration(start, modifiers); + return parseVariableStatement(start, decorators, modifiers); + case 98: + return parseVariableStatement(start, decorators, modifiers); + case 83: + return parseFunctionDeclaration(start, decorators, modifiers); + case 69: + return parseClassDeclaration(start, decorators, modifiers); } return undefined; } @@ -7037,18 +8132,18 @@ var ts; } function parseArrayBindingElement() { if (token === 23) { - return createNode(172); + return createNode(175); } - var node = createNode(150); + var node = createNode(152); node.dotDotDotToken = parseOptionalToken(21); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(false); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(150); + var node = createNode(152); var id = parsePropertyName(); - if (id.kind === 64 && token !== 51) { + if (id.kind === 65 && token !== 51) { node.name = id; } else { @@ -7060,14 +8155,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(148); + var node = createNode(150); parseExpected(14); node.elements = parseDelimitedList(10, parseObjectBindingElement); parseExpected(15); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(149); + var node = createNode(151); parseExpected(18); node.elements = parseDelimitedList(11, parseArrayBindingElement); parseExpected(19); @@ -7086,7 +8181,7 @@ var ts; return parseIdentifier(); } function parseVariableDeclaration() { - var node = createNode(193); + var node = createNode(198); node.name = parseIdentifierOrPattern(); node.type = parseTypeAnnotation(); if (!isInOrOfKeyword(token)) { @@ -7095,21 +8190,21 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(194); + var node = createNode(199); switch (token) { - case 97: + case 98: break; - case 104: + case 105: node.flags |= 4096; break; - case 69: + case 70: node.flags |= 8192; break; default: ts.Debug.fail(); } nextToken(); - if (token === 124 && lookAhead(canFollowContextualOfKeyword)) { + if (token === 125 && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -7123,33 +8218,37 @@ var ts; function canFollowContextualOfKeyword() { return nextTokenIsIdentifier() && nextToken() === 17; } - function parseVariableStatement(fullStart, modifiers) { - var node = createNode(175, fullStart); + function parseVariableStatement(fullStart, decorators, modifiers) { + var node = createNode(180, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); node.declarationList = parseVariableDeclarationList(false); parseSemicolon(); return finishNode(node); } - function parseFunctionDeclaration(fullStart, modifiers) { - var node = createNode(195, fullStart); + function parseFunctionDeclaration(fullStart, decorators, modifiers) { + var node = createNode(200, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(82); + parseExpected(83); node.asteriskToken = parseOptionalToken(35); node.name = node.flags & 256 ? parseOptionalIdentifier() : parseIdentifier(); fillSignature(51, !!node.asteriskToken, false, node); node.body = parseFunctionBlockOrSemicolon(!!node.asteriskToken, ts.Diagnostics.or_expected); return finishNode(node); } - function parseConstructorDeclaration(pos, modifiers) { - var node = createNode(133, pos); + function parseConstructorDeclaration(pos, decorators, modifiers) { + var node = createNode(135, pos); + node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(113); + parseExpected(114); fillSignature(51, false, false, node); node.body = parseFunctionBlockOrSemicolon(false, ts.Diagnostics.or_expected); return finishNode(node); } - function parseMethodDeclaration(fullStart, modifiers, asteriskToken, name, questionToken, diagnosticMessage) { - var method = createNode(132, fullStart); + function parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, diagnosticMessage) { + var method = createNode(134, fullStart); + method.decorators = decorators; setModifiers(method, modifiers); method.asteriskToken = asteriskToken; method.name = name; @@ -7158,29 +8257,34 @@ var ts; method.body = parseFunctionBlockOrSemicolon(!!asteriskToken, diagnosticMessage); return finishNode(method); } - function parsePropertyOrMethodDeclaration(fullStart, modifiers) { + function parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken) { + var property = createNode(132, fullStart); + property.decorators = decorators; + setModifiers(property, modifiers); + property.name = name; + property.questionToken = questionToken; + property.type = parseTypeAnnotation(); + property.initializer = allowInAnd(parseNonParameterInitializer); + parseSemicolon(); + return finishNode(property); + } + function parsePropertyOrMethodDeclaration(fullStart, decorators, modifiers) { var asteriskToken = parseOptionalToken(35); - var _name = parsePropertyName(); + var name = parsePropertyName(); var questionToken = parseOptionalToken(50); if (asteriskToken || token === 16 || token === 24) { - return parseMethodDeclaration(fullStart, modifiers, asteriskToken, _name, questionToken, ts.Diagnostics.or_expected); + return parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, ts.Diagnostics.or_expected); } else { - var property = createNode(130, fullStart); - setModifiers(property, modifiers); - property.name = _name; - property.questionToken = questionToken; - property.type = parseTypeAnnotation(); - property.initializer = allowInAnd(parseNonParameterInitializer); - parseSemicolon(); - return finishNode(property); + return parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken); } } function parseNonParameterInitializer() { return parseInitializer(false); } - function parseAccessorDeclaration(kind, fullStart, modifiers) { + function parseAccessorDeclaration(kind, fullStart, decorators, modifiers) { var node = createNode(kind, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); node.name = parsePropertyName(); fillSignature(51, false, false, node); @@ -7189,6 +8293,9 @@ var ts; } function isClassMemberStart() { var idToken; + if (token === 52) { + return true; + } while (ts.isModifier(token)) { idToken = token; nextToken(); @@ -7204,14 +8311,14 @@ var ts; return true; } if (idToken !== undefined) { - if (!ts.isKeyword(idToken) || idToken === 119 || idToken === 115) { + if (!ts.isKeyword(idToken) || idToken === 120 || idToken === 116) { return true; } switch (token) { case 16: case 24: case 51: - case 52: + case 53: case 50: return true; default: @@ -7220,6 +8327,26 @@ var ts; } return false; } + function parseDecorators() { + var decorators; + while (true) { + var decoratorStart = getNodePos(); + if (!parseOptional(52)) { + break; + } + if (!decorators) { + decorators = []; + decorators.pos = scanner.getStartPos(); + } + var decorator = createNode(130, decoratorStart); + decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); + decorators.push(finishNode(decorator)); + } + if (decorators) { + decorators.end = getNodeEnd(); + } + return decorators; + } function parseModifiers() { var flags = 0; var modifiers; @@ -7243,31 +8370,52 @@ var ts; return modifiers; } function parseClassElement() { + if (token === 22) { + var result = createNode(178); + nextToken(); + return finishNode(result); + } var fullStart = getNodePos(); + var decorators = parseDecorators(); var modifiers = parseModifiers(); - var accessor = tryParseAccessorDeclaration(fullStart, modifiers); + var accessor = tryParseAccessorDeclaration(fullStart, decorators, modifiers); if (accessor) { return accessor; } - if (token === 113) { - return parseConstructorDeclaration(fullStart, modifiers); + if (token === 114) { + return parseConstructorDeclaration(fullStart, decorators, modifiers); } if (isIndexSignature()) { - return parseIndexSignatureDeclaration(modifiers); + return parseIndexSignatureDeclaration(fullStart, decorators, modifiers); } if (isIdentifierOrKeyword() || token === 8 || token === 7 || token === 35 || token === 18) { - return parsePropertyOrMethodDeclaration(fullStart, modifiers); + return parsePropertyOrMethodDeclaration(fullStart, decorators, modifiers); + } + if (decorators) { + var name_3 = createMissingNode(65, true, ts.Diagnostics.Declaration_expected); + return parsePropertyDeclaration(fullStart, decorators, modifiers, name_3, undefined); } ts.Debug.fail("Should not have attempted to parse class member declaration."); } - function parseClassDeclaration(fullStart, modifiers) { - var node = createNode(196, fullStart); + function parseClassExpression() { + return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 174); + } + function parseClassDeclaration(fullStart, decorators, modifiers) { + return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 201); + } + function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) { + var savedStrictModeContext = inStrictModeContext(); + if (languageVersion >= 2) { + setStrictModeContext(true); + } + var node = createNode(kind, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(68); + parseExpected(69); node.name = node.flags & 256 ? parseOptionalIdentifier() : parseIdentifier(); node.typeParameters = parseTypeParameters(); node.heritageClauses = parseHeritageClauses(true); @@ -7280,9 +8428,14 @@ var ts; else { node.members = createMissingList(); } - return finishNode(node); + var finishedNode = finishNode(node); + setStrictModeContext(savedStrictModeContext); + return finishedNode; } function parseHeritageClauses(isClassHeritageClause) { + // ClassTail[Yield,GeneratorParameter] : See 14.5 + // [~GeneratorParameter]ClassHeritage[?Yield]opt { ClassBody[?Yield]opt } + // [+GeneratorParameter] ClassHeritageopt { ClassBodyopt } if (isHeritageClause()) { return isClassHeritageClause && inGeneratorParameterContext() ? doOutsideOfYieldContext(parseHeritageClausesWorker) @@ -7294,51 +8447,62 @@ var ts; return parseList(19, false, parseHeritageClause); } function parseHeritageClause() { - if (token === 78 || token === 102) { - var node = createNode(216); + if (token === 79 || token === 103) { + var node = createNode(222); node.token = token; nextToken(); - node.types = parseDelimitedList(8, parseTypeReference); + node.types = parseDelimitedList(8, parseHeritageClauseElement); return finishNode(node); } return undefined; } + function parseHeritageClauseElement() { + var node = createNode(177); + node.expression = parseLeftHandSideExpressionOrHigher(); + if (token === 24) { + node.typeArguments = parseBracketedList(17, parseType, 24, 25); + } + return finishNode(node); + } function isHeritageClause() { - return token === 78 || token === 102; + return token === 79 || token === 103; } function parseClassMembers() { return parseList(6, false, parseClassElement); } - function parseInterfaceDeclaration(fullStart, modifiers) { - var node = createNode(197, fullStart); + function parseInterfaceDeclaration(fullStart, decorators, modifiers) { + var node = createNode(202, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(103); + parseExpected(104); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); node.heritageClauses = parseHeritageClauses(false); node.members = parseObjectTypeMembers(); return finishNode(node); } - function parseTypeAliasDeclaration(fullStart, modifiers) { - var node = createNode(198, fullStart); + function parseTypeAliasDeclaration(fullStart, decorators, modifiers) { + var node = createNode(203, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(122); + parseExpected(123); node.name = parseIdentifier(); - parseExpected(52); + parseExpected(53); node.type = parseType(); parseSemicolon(); return finishNode(node); } function parseEnumMember() { - var node = createNode(220, scanner.getStartPos()); + var node = createNode(226, scanner.getStartPos()); node.name = parsePropertyName(); node.initializer = allowInAnd(parseNonParameterInitializer); return finishNode(node); } - function parseEnumDeclaration(fullStart, modifiers) { - var node = createNode(199, fullStart); + function parseEnumDeclaration(fullStart, decorators, modifiers) { + var node = createNode(204, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(76); + parseExpected(77); node.name = parseIdentifier(); if (parseExpected(14)) { node.members = parseDelimitedList(7, parseEnumMember); @@ -7350,7 +8514,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(201, scanner.getStartPos()); + var node = createNode(206, scanner.getStartPos()); if (parseExpected(14)) { node.statements = parseList(1, false, parseModuleElement); parseExpected(15); @@ -7360,31 +8524,33 @@ var ts; } return finishNode(node); } - function parseInternalModuleTail(fullStart, modifiers, flags) { - var node = createNode(200, fullStart); + function parseInternalModuleTail(fullStart, decorators, modifiers, flags) { + var node = createNode(205, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); node.flags |= flags; node.name = parseIdentifier(); node.body = parseOptional(20) - ? parseInternalModuleTail(getNodePos(), undefined, 1) + ? parseInternalModuleTail(getNodePos(), undefined, undefined, 1) : parseModuleBlock(); return finishNode(node); } - function parseAmbientExternalModuleDeclaration(fullStart, modifiers) { - var node = createNode(200, fullStart); + function parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) { + var node = createNode(205, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); node.name = parseLiteralNode(true); node.body = parseModuleBlock(); return finishNode(node); } - function parseModuleDeclaration(fullStart, modifiers) { - parseExpected(116); + function parseModuleDeclaration(fullStart, decorators, modifiers) { + parseExpected(117); return token === 8 - ? parseAmbientExternalModuleDeclaration(fullStart, modifiers) - : parseInternalModuleTail(fullStart, modifiers, modifiers ? modifiers.flags : 0); + ? parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) + : parseInternalModuleTail(fullStart, decorators, modifiers, modifiers ? modifiers.flags : 0); } function isExternalModuleReference() { - return token === 117 && + return token === 118 && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -7393,44 +8559,52 @@ var ts; function nextTokenIsCommaOrFromKeyword() { nextToken(); return token === 23 || - token === 123; + token === 124; } - function parseImportDeclarationOrImportEqualsDeclaration(fullStart, modifiers) { - parseExpected(84); + function parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers) { + parseExpected(85); var afterImportPos = scanner.getStartPos(); var identifier; if (isIdentifier()) { identifier = parseIdentifier(); - if (token !== 23 && token !== 123) { - var importEqualsDeclaration = createNode(203, fullStart); + if (token !== 23 && token !== 124) { + var importEqualsDeclaration = createNode(208, fullStart); + importEqualsDeclaration.decorators = decorators; setModifiers(importEqualsDeclaration, modifiers); importEqualsDeclaration.name = identifier; - parseExpected(52); + parseExpected(53); importEqualsDeclaration.moduleReference = parseModuleReference(); parseSemicolon(); return finishNode(importEqualsDeclaration); } } - var importDeclaration = createNode(204, fullStart); + var importDeclaration = createNode(209, fullStart); + importDeclaration.decorators = decorators; setModifiers(importDeclaration, modifiers); if (identifier || token === 35 || token === 14) { importDeclaration.importClause = parseImportClause(identifier, afterImportPos); - parseExpected(123); + parseExpected(124); } importDeclaration.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); return finishNode(importDeclaration); } function parseImportClause(identifier, fullStart) { - var importClause = createNode(205, fullStart); + //ImportClause: + // ImportedDefaultBinding + // NameSpaceImport + // NamedImports + // ImportedDefaultBinding, NameSpaceImport + // ImportedDefaultBinding, NamedImports + var importClause = createNode(210, fullStart); if (identifier) { importClause.name = identifier; } if (!importClause.name || parseOptional(23)) { - importClause.namedBindings = token === 35 ? parseNamespaceImport() : parseNamedImportsOrExports(207); + importClause.namedBindings = token === 35 ? parseNamespaceImport() : parseNamedImportsOrExports(212); } return finishNode(importClause); } @@ -7440,8 +8614,8 @@ var ts; : parseEntityName(false); } function parseExternalModuleReference() { - var node = createNode(213); - parseExpected(117); + var node = createNode(219); + parseExpected(118); parseExpected(16); node.expression = parseModuleSpecifier(); parseExpected(17); @@ -7455,107 +8629,116 @@ var ts; return result; } function parseNamespaceImport() { - var namespaceImport = createNode(206); + var namespaceImport = createNode(211); parseExpected(35); - parseExpected(101); + parseExpected(102); namespaceImport.name = parseIdentifier(); return finishNode(namespaceImport); } function parseNamedImportsOrExports(kind) { var node = createNode(kind); - node.elements = parseBracketedList(20, kind === 207 ? parseImportSpecifier : parseExportSpecifier, 14, 15); + node.elements = parseBracketedList(20, kind === 212 ? parseImportSpecifier : parseExportSpecifier, 14, 15); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(212); + return parseImportOrExportSpecifier(217); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(208); + return parseImportOrExportSpecifier(213); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); - var isFirstIdentifierNameNotAnIdentifier = ts.isKeyword(token) && !isIdentifier(); - var start = scanner.getTokenPos(); + var checkIdentifierIsKeyword = ts.isKeyword(token) && !isIdentifier(); + var checkIdentifierStart = scanner.getTokenPos(); + var checkIdentifierEnd = scanner.getTextPos(); var identifierName = parseIdentifierName(); - if (token === 101) { + if (token === 102) { node.propertyName = identifierName; - parseExpected(101); - if (isIdentifier()) { - node.name = parseIdentifierName(); - } - else { - parseErrorAtCurrentToken(ts.Diagnostics.Identifier_expected); - } + parseExpected(102); + checkIdentifierIsKeyword = ts.isKeyword(token) && !isIdentifier(); + checkIdentifierStart = scanner.getTokenPos(); + checkIdentifierEnd = scanner.getTextPos(); + node.name = parseIdentifierName(); } else { node.name = identifierName; - if (isFirstIdentifierNameNotAnIdentifier) { - parseErrorAtPosition(start, identifierName.end - start, ts.Diagnostics.Identifier_expected); - } + } + if (kind === 213 && checkIdentifierIsKeyword) { + parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } - function parseExportDeclaration(fullStart, modifiers) { - var node = createNode(210, fullStart); + function parseExportDeclaration(fullStart, decorators, modifiers) { + var node = createNode(215, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); if (parseOptional(35)) { - parseExpected(123); + parseExpected(124); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(211); - if (parseOptional(123)) { + node.exportClause = parseNamedImportsOrExports(216); + if (parseOptional(124)) { node.moduleSpecifier = parseModuleSpecifier(); } } parseSemicolon(); return finishNode(node); } - function parseExportAssignment(fullStart, modifiers) { - var node = createNode(209, fullStart); + function parseExportAssignment(fullStart, decorators, modifiers) { + var node = createNode(214, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); - if (parseOptional(52)) { + if (parseOptional(53)) { node.isExportEquals = true; + node.expression = parseAssignmentExpressionOrHigher(); } else { - parseExpected(72); + parseExpected(73); + if (parseOptional(51)) { + node.type = parseType(); + } + else { + node.expression = parseAssignmentExpressionOrHigher(); + } } - node.expression = parseAssignmentExpressionOrHigher(); parseSemicolon(); return finishNode(node); } function isLetDeclaration() { return inStrictModeContext() || lookAhead(nextTokenIsIdentifierOrStartOfDestructuringOnTheSameLine); } - function isDeclarationStart() { + function isDeclarationStart(followsModifier) { switch (token) { - case 97: - case 69: - case 82: + case 98: + case 70: + case 83: return true; - case 104: + case 105: return isLetDeclaration(); - case 68: - case 103: - case 76: - case 122: - return lookAhead(nextTokenIsIdentifierOrKeyword); - case 84: - return lookAhead(nextTokenCanFollowImportKeyword); - case 116: - return lookAhead(nextTokenIsIdentifierOrKeywordOrStringLiteral); + case 69: + case 104: case 77: + case 123: + return lookAhead(nextTokenIsIdentifierOrKeyword); + case 85: + return lookAhead(nextTokenCanFollowImportKeyword); + case 117: + return lookAhead(nextTokenIsIdentifierOrKeywordOrStringLiteral); + case 78: return lookAhead(nextTokenCanFollowExportKeyword); - case 114: - case 108: - case 106: - case 107: + case 115: case 109: + case 107: + case 108: + case 110: return lookAhead(nextTokenIsDeclarationStart); + case 52: + return !followsModifier; } } function isIdentifierOrKeyword() { - return token >= 64; + return token >= 65; } function nextTokenIsIdentifierOrKeyword() { nextToken(); @@ -7572,48 +8755,56 @@ var ts; } function nextTokenCanFollowExportKeyword() { nextToken(); - return token === 52 || token === 35 || - token === 14 || token === 72 || isDeclarationStart(); + return token === 53 || token === 35 || + token === 14 || token === 73 || isDeclarationStart(true); } function nextTokenIsDeclarationStart() { nextToken(); - return isDeclarationStart(); + return isDeclarationStart(true); } function nextTokenIsAsKeyword() { - return nextToken() === 101; + return nextToken() === 102; } function parseDeclaration() { var fullStart = getNodePos(); + var decorators = parseDecorators(); var modifiers = parseModifiers(); - if (token === 77) { + if (token === 78) { nextToken(); - if (token === 72 || token === 52) { - return parseExportAssignment(fullStart, modifiers); + if (token === 73 || token === 53) { + return parseExportAssignment(fullStart, decorators, modifiers); } if (token === 35 || token === 14) { - return parseExportDeclaration(fullStart, modifiers); + return parseExportDeclaration(fullStart, decorators, modifiers); } } switch (token) { - case 97: - case 104: + case 98: + case 105: + case 70: + return parseVariableStatement(fullStart, decorators, modifiers); + case 83: + return parseFunctionDeclaration(fullStart, decorators, modifiers); case 69: - return parseVariableStatement(fullStart, modifiers); - case 82: - return parseFunctionDeclaration(fullStart, modifiers); - case 68: - return parseClassDeclaration(fullStart, modifiers); - case 103: - return parseInterfaceDeclaration(fullStart, modifiers); - case 122: - return parseTypeAliasDeclaration(fullStart, modifiers); - case 76: - return parseEnumDeclaration(fullStart, modifiers); - case 116: - return parseModuleDeclaration(fullStart, modifiers); - case 84: - return parseImportDeclarationOrImportEqualsDeclaration(fullStart, modifiers); + return parseClassDeclaration(fullStart, decorators, modifiers); + case 104: + return parseInterfaceDeclaration(fullStart, decorators, modifiers); + case 123: + return parseTypeAliasDeclaration(fullStart, decorators, modifiers); + case 77: + return parseEnumDeclaration(fullStart, decorators, modifiers); + case 117: + return parseModuleDeclaration(fullStart, decorators, modifiers); + case 85: + return parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers); default: + if (decorators) { + var node = createMissingNode(218, true, ts.Diagnostics.Declaration_expected); + node.pos = fullStart; + node.decorators = decorators; + setModifiers(node, modifiers); + return finishNode(node); + } ts.Debug.fail("Mismatch between isDeclarationStart and parseDeclaration"); } } @@ -7688,10 +8879,10 @@ var ts; function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { return node.flags & 1 - || node.kind === 203 && node.moduleReference.kind === 213 - || node.kind === 204 + || node.kind === 208 && node.moduleReference.kind === 219 || node.kind === 209 - || node.kind === 210 + || node.kind === 214 + || node.kind === 215 ? node : undefined; }); @@ -7700,26 +8891,27 @@ var ts; function isLeftHandSideExpression(expr) { if (expr) { switch (expr.kind) { - case 153: - case 154: - case 156: case 155: + case 156: + case 158: case 157: - case 151: case 159: - case 152: - case 160: - case 64: + case 153: + case 161: + case 154: + case 174: + case 162: + case 65: case 9: case 7: case 8: case 10: - case 169: - case 79: - case 88: - case 92: - case 94: - case 90: + case 171: + case 80: + case 89: + case 93: + case 95: + case 91: return true; } } @@ -7727,494 +8919,30 @@ var ts; } ts.isLeftHandSideExpression = isLeftHandSideExpression; function isAssignmentOperator(token) { - return token >= 52 && token <= 63; + return token >= 53 && token <= 64; } ts.isAssignmentOperator = isAssignmentOperator; })(ts || (ts = {})); -var ts; -(function (ts) { - ts.bindTime = 0; - (function (ModuleInstanceState) { - ModuleInstanceState[ModuleInstanceState["NonInstantiated"] = 0] = "NonInstantiated"; - ModuleInstanceState[ModuleInstanceState["Instantiated"] = 1] = "Instantiated"; - ModuleInstanceState[ModuleInstanceState["ConstEnumOnly"] = 2] = "ConstEnumOnly"; - })(ts.ModuleInstanceState || (ts.ModuleInstanceState = {})); - var ModuleInstanceState = ts.ModuleInstanceState; - function getModuleInstanceState(node) { - if (node.kind === 197 || node.kind === 198) { - return 0; - } - else if (ts.isConstEnumDeclaration(node)) { - return 2; - } - else if ((node.kind === 204 || node.kind === 203) && !(node.flags & 1)) { - return 0; - } - else if (node.kind === 201) { - var state = 0; - ts.forEachChild(node, function (n) { - switch (getModuleInstanceState(n)) { - case 0: - return false; - case 2: - state = 2; - return false; - case 1: - state = 1; - return true; - } - }); - return state; - } - else if (node.kind === 200) { - return getModuleInstanceState(node.body); - } - else { - return 1; - } - } - ts.getModuleInstanceState = getModuleInstanceState; - function bindSourceFile(file) { - var start = new Date().getTime(); - bindSourceFileWorker(file); - ts.bindTime += new Date().getTime() - start; - } - ts.bindSourceFile = bindSourceFile; - function bindSourceFileWorker(file) { - var _parent; - var container; - var blockScopeContainer; - var lastContainer; - var symbolCount = 0; - var Symbol = ts.objectAllocator.getSymbolConstructor(); - if (!file.locals) { - file.locals = {}; - container = file; - setBlockScopeContainer(file, false); - bind(file); - file.symbolCount = symbolCount; - } - function createSymbol(flags, name) { - symbolCount++; - return new Symbol(flags, name); - } - function setBlockScopeContainer(node, cleanLocals) { - blockScopeContainer = node; - if (cleanLocals) { - blockScopeContainer.locals = undefined; - } - } - function addDeclarationToSymbol(symbol, node, symbolKind) { - symbol.flags |= symbolKind; - if (!symbol.declarations) - symbol.declarations = []; - symbol.declarations.push(node); - if (symbolKind & 1952 && !symbol.exports) - symbol.exports = {}; - if (symbolKind & 6240 && !symbol.members) - symbol.members = {}; - node.symbol = symbol; - if (symbolKind & 107455 && !symbol.valueDeclaration) - symbol.valueDeclaration = node; - } - function getDeclarationName(node) { - if (node.name) { - if (node.kind === 200 && node.name.kind === 8) { - return '"' + node.name.text + '"'; - } - if (node.name.kind === 126) { - var nameExpression = node.name.expression; - ts.Debug.assert(ts.isWellKnownSymbolSyntactically(nameExpression)); - return ts.getPropertyNameForKnownSymbolName(nameExpression.name.text); - } - return node.name.text; - } - switch (node.kind) { - case 141: - case 133: - return "__constructor"; - case 140: - case 136: - return "__call"; - case 137: - return "__new"; - case 138: - return "__index"; - case 210: - return "__export"; - case 209: - return "default"; - case 195: - case 196: - return node.flags & 256 ? "default" : undefined; - } - } - function getDisplayName(node) { - return node.name ? ts.declarationNameToString(node.name) : getDeclarationName(node); - } - function declareSymbol(symbols, parent, node, includes, excludes) { - ts.Debug.assert(!ts.hasDynamicName(node)); - var _name = node.flags & 256 && parent ? "default" : getDeclarationName(node); - var symbol; - if (_name !== undefined) { - symbol = ts.hasProperty(symbols, _name) ? symbols[_name] : (symbols[_name] = createSymbol(0, _name)); - if (symbol.flags & excludes) { - if (node.name) { - node.name.parent = node; - } - var message = symbol.flags & 2 - ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 - : ts.Diagnostics.Duplicate_identifier_0; - ts.forEach(symbol.declarations, function (declaration) { - file.bindDiagnostics.push(ts.createDiagnosticForNode(declaration.name || declaration, message, getDisplayName(declaration))); - }); - file.bindDiagnostics.push(ts.createDiagnosticForNode(node.name || node, message, getDisplayName(node))); - symbol = createSymbol(0, _name); - } - } - else { - symbol = createSymbol(0, "__missing"); - } - addDeclarationToSymbol(symbol, node, includes); - symbol.parent = parent; - if (node.kind === 196 && symbol.exports) { - var prototypeSymbol = createSymbol(4 | 134217728, "prototype"); - if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { - if (node.name) { - node.name.parent = node; - } - file.bindDiagnostics.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); - } - symbol.exports[prototypeSymbol.name] = prototypeSymbol; - prototypeSymbol.parent = symbol; - } - return symbol; - } - function isAmbientContext(node) { - while (node) { - if (node.flags & 2) - return true; - node = node.parent; - } - return false; - } - function declareModuleMember(node, symbolKind, symbolExcludes) { - var hasExportModifier = ts.getCombinedNodeFlags(node) & 1; - if (symbolKind & 8388608) { - if (node.kind === 212 || (node.kind === 203 && hasExportModifier)) { - declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); - } - else { - declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); - } - } - else { - if (hasExportModifier || isAmbientContext(container)) { - var exportKind = (symbolKind & 107455 ? 1048576 : 0) | - (symbolKind & 793056 ? 2097152 : 0) | - (symbolKind & 1536 ? 4194304 : 0); - var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); - local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); - node.localSymbol = local; - } - else { - declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); - } - } - } - function bindChildren(node, symbolKind, isBlockScopeContainer) { - if (symbolKind & 255504) { - node.locals = {}; - } - var saveParent = _parent; - var saveContainer = container; - var savedBlockScopeContainer = blockScopeContainer; - _parent = node; - if (symbolKind & 262128) { - container = node; - if (lastContainer) { - lastContainer.nextContainer = container; - } - lastContainer = container; - } - if (isBlockScopeContainer) { - setBlockScopeContainer(node, (symbolKind & 255504) === 0 && node.kind !== 221); - } - ts.forEachChild(node, bind); - container = saveContainer; - _parent = saveParent; - blockScopeContainer = savedBlockScopeContainer; - } - function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) { - switch (container.kind) { - case 200: - declareModuleMember(node, symbolKind, symbolExcludes); - break; - case 221: - if (ts.isExternalModule(container)) { - declareModuleMember(node, symbolKind, symbolExcludes); - break; - } - case 140: - case 141: - case 136: - case 137: - case 138: - case 132: - case 131: - case 133: - case 134: - case 135: - case 195: - case 160: - case 161: - declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); - break; - case 196: - if (node.flags & 128) { - declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); - break; - } - case 143: - case 152: - case 197: - declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes); - break; - case 199: - declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); - break; - } - bindChildren(node, symbolKind, isBlockScopeContainer); - } - function bindModuleDeclaration(node) { - if (node.name.kind === 8) { - bindDeclaration(node, 512, 106639, true); - } - else { - var state = getModuleInstanceState(node); - if (state === 0) { - bindDeclaration(node, 1024, 0, true); - } - else { - bindDeclaration(node, 512, 106639, true); - if (state === 2) { - node.symbol.constEnumOnlyModule = true; - } - else if (node.symbol.constEnumOnlyModule) { - node.symbol.constEnumOnlyModule = false; - } - } - } - } - function bindFunctionOrConstructorType(node) { - var symbol = createSymbol(131072, getDeclarationName(node)); - addDeclarationToSymbol(symbol, node, 131072); - bindChildren(node, 131072, false); - var typeLiteralSymbol = createSymbol(2048, "__type"); - addDeclarationToSymbol(typeLiteralSymbol, node, 2048); - typeLiteralSymbol.members = {}; - typeLiteralSymbol.members[node.kind === 140 ? "__call" : "__new"] = symbol; - } - function bindAnonymousDeclaration(node, symbolKind, name, isBlockScopeContainer) { - var symbol = createSymbol(symbolKind, name); - addDeclarationToSymbol(symbol, node, symbolKind); - bindChildren(node, symbolKind, isBlockScopeContainer); - } - function bindCatchVariableDeclaration(node) { - bindChildren(node, 0, true); - } - function bindBlockScopedVariableDeclaration(node) { - switch (blockScopeContainer.kind) { - case 200: - declareModuleMember(node, 2, 107455); - break; - case 221: - if (ts.isExternalModule(container)) { - declareModuleMember(node, 2, 107455); - break; - } - default: - if (!blockScopeContainer.locals) { - blockScopeContainer.locals = {}; - } - declareSymbol(blockScopeContainer.locals, undefined, node, 2, 107455); - } - bindChildren(node, 2, false); - } - function getDestructuringParameterName(node) { - return "__" + ts.indexOf(node.parent.parameters, node); - } - function bind(node) { - node.parent = _parent; - switch (node.kind) { - case 127: - bindDeclaration(node, 262144, 530912, false); - break; - case 128: - bindParameter(node); - break; - case 193: - case 150: - if (ts.isBindingPattern(node.name)) { - bindChildren(node, 0, false); - } - else if (ts.isBlockOrCatchScoped(node)) { - bindBlockScopedVariableDeclaration(node); - } - else { - bindDeclaration(node, 1, 107454, false); - } - break; - case 130: - case 129: - bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 107455, false); - break; - case 218: - case 219: - bindPropertyOrMethodOrAccessor(node, 4, 107455, false); - break; - case 220: - bindPropertyOrMethodOrAccessor(node, 8, 107455, false); - break; - case 136: - case 137: - case 138: - bindDeclaration(node, 131072, 0, false); - break; - case 132: - case 131: - bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 107455 : 99263, true); - break; - case 195: - bindDeclaration(node, 16, 106927, true); - break; - case 133: - bindDeclaration(node, 16384, 0, true); - break; - case 134: - bindPropertyOrMethodOrAccessor(node, 32768, 41919, true); - break; - case 135: - bindPropertyOrMethodOrAccessor(node, 65536, 74687, true); - break; - case 140: - case 141: - bindFunctionOrConstructorType(node); - break; - case 143: - bindAnonymousDeclaration(node, 2048, "__type", false); - break; - case 152: - bindAnonymousDeclaration(node, 4096, "__object", false); - break; - case 160: - case 161: - bindAnonymousDeclaration(node, 16, "__function", true); - break; - case 217: - bindCatchVariableDeclaration(node); - break; - case 196: - bindDeclaration(node, 32, 899583, false); - break; - case 197: - bindDeclaration(node, 64, 792992, false); - break; - case 198: - bindDeclaration(node, 524288, 793056, false); - break; - case 199: - if (ts.isConst(node)) { - bindDeclaration(node, 128, 899967, false); - } - else { - bindDeclaration(node, 256, 899327, false); - } - break; - case 200: - bindModuleDeclaration(node); - break; - case 203: - case 206: - case 208: - case 212: - bindDeclaration(node, 8388608, 8388608, false); - break; - case 205: - if (node.name) { - bindDeclaration(node, 8388608, 8388608, false); - } - else { - bindChildren(node, 0, false); - } - break; - case 210: - if (!node.exportClause) { - declareSymbol(container.symbol.exports, container.symbol, node, 1073741824, 0); - } - bindChildren(node, 0, false); - break; - case 209: - if (node.expression.kind === 64) { - declareSymbol(container.symbol.exports, container.symbol, node, 8388608, 8388608); - } - else { - declareSymbol(container.symbol.exports, container.symbol, node, 4, 107455); - } - bindChildren(node, 0, false); - break; - case 221: - if (ts.isExternalModule(node)) { - bindAnonymousDeclaration(node, 512, '"' + ts.removeFileExtension(node.fileName) + '"', true); - break; - } - case 174: - bindChildren(node, 0, !ts.isFunctionLike(node.parent)); - break; - case 217: - case 181: - case 182: - case 183: - case 202: - bindChildren(node, 0, true); - break; - default: - var saveParent = _parent; - _parent = node; - ts.forEachChild(node, bind); - _parent = saveParent; - } - } - function bindParameter(node) { - if (ts.isBindingPattern(node.name)) { - bindAnonymousDeclaration(node, 1, getDestructuringParameterName(node), false); - } - else { - bindDeclaration(node, 1, 107455, false); - } - if (node.flags & 112 && - node.parent.kind === 133 && - node.parent.parent.kind === 196) { - var classDeclaration = node.parent.parent; - declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4, 107455); - } - } - function bindPropertyOrMethodOrAccessor(node, symbolKind, symbolExcludes, isBlockScopeContainer) { - if (ts.hasDynamicName(node)) { - bindAnonymousDeclaration(node, symbolKind, "__computed", isBlockScopeContainer); - } - else { - bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer); - } - } - } -})(ts || (ts = {})); +/// var ts; (function (ts) { var nextSymbolId = 1; var nextNodeId = 1; var nextMergeId = 1; + function getNodeId(node) { + if (!node.id) + node.id = nextNodeId++; + return node.id; + } + ts.getNodeId = getNodeId; ts.checkTime = 0; + function getSymbolId(symbol) { + if (!symbol.id) { + symbol.id = nextSymbolId++; + } + return symbol.id; + } + ts.getSymbolId = getSymbolId; function createTypeChecker(host, produceDiagnostics) { var Symbol = ts.objectAllocator.getSymbolConstructor(); var Type = ts.objectAllocator.getTypeConstructor(); @@ -8278,7 +9006,6 @@ var ts; 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); - var inferenceFailureType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anySignature = createSignature(undefined, undefined, emptyArray, anyType, 0, false, false); var unknownSignature = createSignature(undefined, undefined, emptyArray, unknownType, 0, false, false); var globals = {}; @@ -8295,10 +9022,16 @@ var ts; var globalESSymbolType; var globalIterableType; var anyArrayType; + var globalTypedPropertyDescriptorType; + var globalClassDecoratorType; + var globalParameterDecoratorType; + var globalPropertyDecoratorType; + var globalMethodDecoratorType; var tupleTypes = {}; var unionTypes = {}; var stringLiteralTypes = {}; var emitExtends = false; + var emitDecorate = false; var mergedSymbols = []; var symbolLinks = []; var nodeLinks = []; @@ -8453,20 +9186,18 @@ var ts; function getSymbolLinks(symbol) { if (symbol.flags & 67108864) return symbol; - if (!symbol.id) - symbol.id = nextSymbolId++; - return symbolLinks[symbol.id] || (symbolLinks[symbol.id] = {}); + var id = getSymbolId(symbol); + return symbolLinks[id] || (symbolLinks[id] = {}); } function getNodeLinks(node) { - if (!node.id) - node.id = nextNodeId++; - return nodeLinks[node.id] || (nodeLinks[node.id] = {}); + var nodeId = getNodeId(node); + return nodeLinks[nodeId] || (nodeLinks[nodeId] = {}); } function getSourceFile(node) { - return ts.getAncestor(node, 221); + return ts.getAncestor(node, 227); } function isGlobalSourceFile(node) { - return node.kind === 221 && !ts.isExternalModule(node); + return node.kind === 227 && !ts.isExternalModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { @@ -8500,6 +9231,7 @@ var ts; var lastLocation; var propertyWithInvalidInitializer; var errorLocation = location; + var grandparent; loop: while (location) { if (location.locals && !isGlobalSourceFile(location)) { if (result = getSymbol(location.locals, name, meaning)) { @@ -8507,25 +9239,33 @@ var ts; } } switch (location.kind) { - case 221: + case 227: if (!ts.isExternalModule(location)) break; - case 200: + case 205: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8914931)) { - if (!(result.flags & 8388608 && getDeclarationOfAliasSymbol(result).kind === 212)) { + if (result.flags & meaning || !(result.flags & 8388608 && getDeclarationOfAliasSymbol(result).kind === 217)) { + break loop; + } + result = undefined; + } + else if (location.kind === 227) { + result = getSymbol(getSymbolOfNode(location).exports, "default", meaning & 8914931); + var localSymbol = ts.getLocalSymbolForExportDefault(result); + if (result && (result.flags & meaning) && localSymbol && localSymbol.name === name) { break loop; } result = undefined; } break; - case 199: + case 204: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8)) { break loop; } break; - case 130: - case 129: - if (location.parent.kind === 196 && !(location.flags & 128)) { + case 132: + case 131: + if (location.parent.kind === 201 && !(location.flags & 128)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { if (getSymbol(ctor.locals, name, meaning & 107455)) { @@ -8534,8 +9274,8 @@ var ts; } } break; - case 196: - case 197: + case 201: + case 202: 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); @@ -8544,38 +9284,53 @@ var ts; break loop; } break; - case 126: - var grandparent = location.parent.parent; - if (grandparent.kind === 196 || grandparent.kind === 197) { + case 127: + grandparent = location.parent.parent; + if (grandparent.kind === 201 || grandparent.kind === 202) { 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 132: - case 131: - case 133: case 134: + case 133: case 135: - case 195: - case 161: + case 136: + case 137: + case 200: + case 163: if (name === "arguments") { result = argumentsSymbol; break loop; } break; - case 160: + case 162: if (name === "arguments") { result = argumentsSymbol; break loop; } - var id = location.name; - if (id && name === id.text) { + var functionName = location.name; + if (functionName && name === functionName.text) { result = location.symbol; break loop; } break; + case 174: + var className = location.name; + if (className && name === className.text) { + result = location.symbol; + break loop; + } + break; + case 130: + if (location.parent && location.parent.kind === 129) { + location = location.parent; + } + if (location.parent && ts.isClassElement(location.parent)) { + location = location.parent; + } + break; } lastLocation = location; location = location.parent; @@ -8607,14 +9362,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, 193); + var variableDeclaration = ts.getAncestor(declaration, 198); var container = ts.getEnclosingBlockScopeContainer(variableDeclaration); - if (variableDeclaration.parent.parent.kind === 175 || - variableDeclaration.parent.parent.kind === 181) { + if (variableDeclaration.parent.parent.kind === 180 || + variableDeclaration.parent.parent.kind === 186) { isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, variableDeclaration, container); } - else if (variableDeclaration.parent.parent.kind === 183 || - variableDeclaration.parent.parent.kind === 182) { + else if (variableDeclaration.parent.parent.kind === 188 || + variableDeclaration.parent.parent.kind === 187) { var expression = variableDeclaration.parent.parent.expression; isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, expression, container); } @@ -8634,49 +9389,94 @@ var ts; } return false; } - function isAliasSymbolDeclaration(node) { - return node.kind === 203 || - node.kind === 205 && !!node.name || - node.kind === 206 || - node.kind === 208 || - node.kind === 212 || - node.kind === 209; + function getAnyImportSyntax(node) { + if (ts.isAliasSymbolDeclaration(node)) { + if (node.kind === 208) { + return node; + } + while (node && node.kind !== 209) { + node = node.parent; + } + return node; + } } function getDeclarationOfAliasSymbol(symbol) { - return ts.forEach(symbol.declarations, function (d) { return isAliasSymbolDeclaration(d) ? d : undefined; }); + return ts.forEach(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; }); } function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 213) { - var moduleSymbol = resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)); - var exportAssignmentSymbol = moduleSymbol && getResolvedExportAssignmentSymbol(moduleSymbol); - return exportAssignmentSymbol || moduleSymbol; + if (node.moduleReference.kind === 219) { + return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, node); } function getTargetOfImportClause(node) { var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); if (moduleSymbol) { - var exportAssignmentSymbol = getResolvedExportAssignmentSymbol(moduleSymbol); - if (!exportAssignmentSymbol) { - error(node.name, ts.Diagnostics.External_module_0_has_no_default_export_or_export_assignment, symbolToString(moduleSymbol)); + var exportDefaultSymbol = resolveSymbol(moduleSymbol.exports["default"]); + if (!exportDefaultSymbol) { + error(node.name, ts.Diagnostics.External_module_0_has_no_default_export, symbolToString(moduleSymbol)); } - return exportAssignmentSymbol; + return exportDefaultSymbol; } } function getTargetOfNamespaceImport(node) { - return resolveExternalModuleName(node, node.parent.parent.moduleSpecifier); + var moduleSpecifier = node.parent.parent.moduleSpecifier; + return resolveESModuleSymbol(resolveExternalModuleName(node, moduleSpecifier), moduleSpecifier); + } + function getMemberOfModuleVariable(moduleSymbol, name) { + if (moduleSymbol.flags & 3) { + var typeAnnotation = moduleSymbol.valueDeclaration.type; + if (typeAnnotation) { + return getPropertyOfType(getTypeFromTypeNodeOrHeritageClauseElement(typeAnnotation), name); + } + } + } + function combineValueAndTypeSymbols(valueSymbol, typeSymbol) { + if (valueSymbol.flags & (793056 | 1536)) { + return valueSymbol; + } + var result = createSymbol(valueSymbol.flags | typeSymbol.flags, valueSymbol.name); + result.declarations = ts.concatenate(valueSymbol.declarations, typeSymbol.declarations); + result.parent = valueSymbol.parent || typeSymbol.parent; + if (valueSymbol.valueDeclaration) + result.valueDeclaration = valueSymbol.valueDeclaration; + if (typeSymbol.members) + result.members = typeSymbol.members; + if (valueSymbol.exports) + result.exports = valueSymbol.exports; + return result; + } + function getExportOfModule(symbol, name) { + if (symbol.flags & 1536) { + var exports = getExportsOfSymbol(symbol); + if (ts.hasProperty(exports, name)) { + return resolveSymbol(exports[name]); + } + } + } + function getPropertyOfVariable(symbol, name) { + if (symbol.flags & 3) { + var typeAnnotation = symbol.valueDeclaration.type; + if (typeAnnotation) { + return resolveSymbol(getPropertyOfType(getTypeFromTypeNodeOrHeritageClauseElement(typeAnnotation), name)); + } + } } function getExternalModuleMember(node, specifier) { var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); - if (moduleSymbol) { - var _name = specifier.propertyName || specifier.name; - if (_name.text) { - var symbol = getSymbol(getExportsOfSymbol(moduleSymbol), _name.text, 107455 | 793056 | 1536); + var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier); + if (targetSymbol) { + var name_4 = specifier.propertyName || specifier.name; + if (name_4.text) { + var symbolFromModule = getExportOfModule(targetSymbol, name_4.text); + var symbolFromVariable = getPropertyOfVariable(targetSymbol, name_4.text); + var symbol = symbolFromModule && symbolFromVariable ? + combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) : + symbolFromModule || symbolFromVariable; if (!symbol) { - error(_name, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(_name)); - return; + error(name_4, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name_4)); } - return symbol.flags & (107455 | 793056 | 1536) ? symbol : resolveAlias(symbol); + return symbol; } } } @@ -8689,31 +9489,34 @@ var ts; resolveEntityName(node.propertyName || node.name, 107455 | 793056 | 1536); } function getTargetOfExportAssignment(node) { - return resolveEntityName(node.expression, 107455 | 793056 | 1536); + return node.expression && resolveEntityName(node.expression, 107455 | 793056 | 1536); } - function getTargetOfImportDeclaration(node) { + function getTargetOfAliasDeclaration(node) { switch (node.kind) { - case 203: - return getTargetOfImportEqualsDeclaration(node); - case 205: - return getTargetOfImportClause(node); - case 206: - return getTargetOfNamespaceImport(node); case 208: + return getTargetOfImportEqualsDeclaration(node); + case 210: + return getTargetOfImportClause(node); + case 211: + return getTargetOfNamespaceImport(node); + case 213: return getTargetOfImportSpecifier(node); - case 212: + case 217: return getTargetOfExportSpecifier(node); - case 209: + case 214: return getTargetOfExportAssignment(node); } } + function resolveSymbol(symbol) { + return symbol && symbol.flags & 8388608 && !(symbol.flags & (107455 | 793056 | 1536)) ? resolveAlias(symbol) : symbol; + } function resolveAlias(symbol) { ts.Debug.assert((symbol.flags & 8388608) !== 0, "Should only get Alias here."); var links = getSymbolLinks(symbol); if (!links.target) { links.target = resolvingSymbol; var node = getDeclarationOfAliasSymbol(symbol); - var target = getTargetOfImportDeclaration(node); + var target = getTargetOfAliasDeclaration(node); if (links.target === resolvingSymbol) { links.target = target || unknownSymbol; } @@ -8729,8 +9532,12 @@ var ts; function markExportAsReferenced(node) { var symbol = getSymbolOfNode(node); var target = resolveAlias(symbol); - if (target && target !== unknownSymbol && target.flags & 107455 && !isConstEnumOrConstEnumOnlyModule(target)) { - markAliasSymbolAsReferenced(symbol); + if (target) { + var markAlias = (target === unknownSymbol && compilerOptions.separateCompilation) || + (target !== unknownSymbol && (target.flags & 107455) && !isConstEnumOrConstEnumOnlyModule(target)); + if (markAlias) { + markAliasSymbolAsReferenced(symbol); + } } } function markAliasSymbolAsReferenced(symbol) { @@ -8738,10 +9545,10 @@ var ts; if (!links.referenced) { links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); - if (node.kind === 209) { + if (node.kind === 214 && node.expression) { checkExpressionCached(node.expression); } - else if (node.kind === 212) { + else if (node.kind === 217) { checkExpressionCached(node.propertyName || node.name); } else if (ts.isInternalModuleImportEqualsDeclaration(node)) { @@ -8751,17 +9558,17 @@ var ts; } function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 203); + importDeclaration = ts.getAncestor(entityName, 208); ts.Debug.assert(importDeclaration !== undefined); } - if (entityName.kind === 64 && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { + if (entityName.kind === 65 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 64 || entityName.parent.kind === 125) { + if (entityName.kind === 65 || entityName.parent.kind === 126) { return resolveEntityName(entityName, 1536); } else { - ts.Debug.assert(entityName.parent.kind === 203); + ts.Debug.assert(entityName.parent.kind === 208); return resolveEntityName(entityName, 107455 | 793056 | 1536); } } @@ -8769,28 +9576,32 @@ var ts; return symbol.parent ? getFullyQualifiedName(symbol.parent) + "." + symbolToString(symbol) : symbolToString(symbol); } function resolveEntityName(name, meaning) { - if (ts.getFullWidth(name) === 0) { + if (ts.nodeIsMissing(name)) { return undefined; } var symbol; - if (name.kind === 64) { + if (name.kind === 65) { symbol = resolveName(name, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, name); if (!symbol) { return undefined; } } - else if (name.kind === 125) { - var namespace = resolveEntityName(name.left, 1536); - if (!namespace || namespace === unknownSymbol || ts.getFullWidth(name.right) === 0) { + 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; + var namespace = resolveEntityName(left, 1536); + if (!namespace || namespace === unknownSymbol || ts.nodeIsMissing(right)) { return undefined; } - var right = name.right; symbol = getSymbol(getExportsOfSymbol(namespace), right.text, meaning); if (!symbol) { error(right, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), ts.declarationNameToString(right)); return undefined; } } + else { + ts.Debug.fail("Unknown entity name kind."); + } ts.Debug.assert((symbol.flags & 16777216) === 0, "Should never get an instantiated symbol here."); return symbol.flags & meaning ? symbol : resolveAlias(symbol); } @@ -8835,22 +9646,22 @@ var ts; } error(moduleReferenceLiteral, ts.Diagnostics.Cannot_find_external_module_0, moduleName); } - function getExportAssignmentSymbol(moduleSymbol) { - return moduleSymbol.exports["default"]; + function resolveExternalModuleSymbol(moduleSymbol) { + return moduleSymbol && resolveSymbol(moduleSymbol.exports["export="]) || moduleSymbol; } - function getResolvedExportAssignmentSymbol(moduleSymbol) { - var symbol = getExportAssignmentSymbol(moduleSymbol); - if (symbol) { - if (symbol.flags & (107455 | 793056 | 1536)) { - return symbol; - } - if (symbol.flags & 8388608) { - return resolveAlias(symbol); - } + 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)); + symbol = undefined; } + return symbol; + } + function getExportAssignmentSymbol(moduleSymbol) { + return moduleSymbol.exports["export="]; } function getExportsOfSymbol(symbol) { - return symbol.flags & 1536 ? getExportsOfModule(symbol) : symbol.exports; + return symbol.flags & 1536 ? getExportsOfModule(symbol) : symbol.exports || emptySymbols; } function getExportsOfModule(moduleSymbol) { var links = getSymbolLinks(moduleSymbol); @@ -8864,20 +9675,12 @@ var ts; } } function getExportsForModule(moduleSymbol) { - if (compilerOptions.target < 2) { - var defaultSymbol = getExportAssignmentSymbol(moduleSymbol); - if (defaultSymbol) { - return { - "default": defaultSymbol - }; - } - } var result; var visitedSymbols = []; visit(moduleSymbol); return result || moduleSymbol.exports; function visit(symbol) { - if (!ts.contains(visitedSymbols, symbol)) { + if (symbol.flags & 1952 && !ts.contains(visitedSymbols, symbol)) { visitedSymbols.push(symbol); if (symbol !== moduleSymbol) { if (!result) { @@ -8887,9 +9690,10 @@ var ts; } var exportStars = symbol.exports["__export"]; if (exportStars) { - ts.forEach(exportStars.declarations, function (node) { + for (var _i = 0, _a = exportStars.declarations; _i < _a.length; _i++) { + var node = _a[_i]; visit(resolveExternalModuleName(node, node.moduleSpecifier)); - }); + } } } } @@ -8923,9 +9727,9 @@ var ts; } function findConstructorDeclaration(node) { var members = node.members; - for (var _i = 0, _n = members.length; _i < _n; _i++) { + for (var _i = 0; _i < members.length; _i++) { var member = members[_i]; - if (member.kind === 133 && ts.nodeIsPresent(member.body)) { + if (member.kind === 135 && ts.nodeIsPresent(member.body)) { return member; } } @@ -8983,25 +9787,25 @@ var ts; } function forEachSymbolTableInScope(enclosingDeclaration, callback) { var result; - for (var _location = enclosingDeclaration; _location; _location = _location.parent) { - if (_location.locals && !isGlobalSourceFile(_location)) { - if (result = callback(_location.locals)) { + for (var location_1 = enclosingDeclaration; location_1; location_1 = location_1.parent) { + if (location_1.locals && !isGlobalSourceFile(location_1)) { + if (result = callback(location_1.locals)) { return result; } } - switch (_location.kind) { - case 221: - if (!ts.isExternalModule(_location)) { + switch (location_1.kind) { + case 227: + if (!ts.isExternalModule(location_1)) { break; } - case 200: - if (result = callback(getSymbolOfNode(_location).exports)) { + case 205: + if (result = callback(getSymbolOfNode(location_1).exports)) { return result; } break; - case 196: - case 197: - if (result = callback(getSymbolOfNode(_location).members)) { + case 201: + case 202: + if (result = callback(getSymbolOfNode(location_1).members)) { return result; } break; @@ -9031,7 +9835,7 @@ var ts; return [symbol]; } return ts.forEachValue(symbols, function (symbolFromSymbolTable) { - if (symbolFromSymbolTable.flags & 8388608) { + if (symbolFromSymbolTable.flags & 8388608 && symbolFromSymbolTable.name !== "export=") { if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); @@ -9115,8 +9919,8 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 200 && declaration.name.kind === 8) || - (declaration.kind === 221 && ts.isExternalModule(declaration)); + return (declaration.kind === 205 && declaration.name.kind === 8) || + (declaration.kind === 227 && ts.isExternalModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -9126,17 +9930,18 @@ var ts; return { accessibility: 0, aliasesToMakeVisible: aliasesToMakeVisible }; function getIsDeclarationVisible(declaration) { if (!isDeclarationVisible(declaration)) { - if (declaration.kind === 203 && - !(declaration.flags & 1) && - isDeclarationVisible(declaration.parent)) { + var anyImportSyntax = getAnyImportSyntax(declaration); + if (anyImportSyntax && + !(anyImportSyntax.flags & 1) && + isDeclarationVisible(anyImportSyntax.parent)) { getNodeLinks(declaration).isVisible = true; if (aliasesToMakeVisible) { - if (!ts.contains(aliasesToMakeVisible, declaration)) { - aliasesToMakeVisible.push(declaration); + if (!ts.contains(aliasesToMakeVisible, anyImportSyntax)) { + aliasesToMakeVisible.push(anyImportSyntax); } } else { - aliasesToMakeVisible = [declaration]; + aliasesToMakeVisible = [anyImportSyntax]; } return true; } @@ -9147,11 +9952,11 @@ var ts; } function isEntityNameVisible(entityName, enclosingDeclaration) { var meaning; - if (entityName.parent.kind === 142) { + if (entityName.parent.kind === 144) { meaning = 107455 | 1048576; } - else if (entityName.kind === 125 || - entityName.parent.kind === 203) { + else if (entityName.kind === 126 || entityName.kind === 155 || + entityName.parent.kind === 208) { meaning = 1536; } else { @@ -9195,10 +10000,10 @@ var ts; function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048) { var node = type.symbol.declarations[0].parent; - while (node.kind === 147) { + while (node.kind === 149) { node = node.parent; } - if (node.kind === 198) { + if (node.kind === 203) { return getSymbolOfNode(node); } } @@ -9242,7 +10047,7 @@ var ts; walkSymbol(getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol), getQualifiedLeftMeaning(meaning)); } if (accessibleSymbolChain) { - for (var _i = 0, _n = accessibleSymbolChain.length; _i < _n; _i++) { + for (var _i = 0; _i < accessibleSymbolChain.length; _i++) { var accessibleSymbol = accessibleSymbolChain[_i]; appendParentTypeArgumentsAndSymbolName(accessibleSymbol); } @@ -9352,7 +10157,7 @@ var ts; buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, 793056, 0, flags); } else { - writeKeyword(writer, 111); + writeKeyword(writer, 112); } } else { @@ -9370,7 +10175,7 @@ var ts; var isNonLocalFunctionSymbol = !!(type.symbol.flags & 16) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { - return declaration.parent.kind === 221 || declaration.parent.kind === 201; + return declaration.parent.kind === 227 || declaration.parent.kind === 206; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return !!(flags & 2) || @@ -9380,7 +10185,7 @@ var ts; } } function writeTypeofSymbol(type, typeFormatFlags) { - writeKeyword(writer, 96); + writeKeyword(writer, 97); writeSpace(writer); buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 107455, 0, typeFormatFlags); } @@ -9414,7 +10219,7 @@ var ts; if (flags & 64) { writePunctuation(writer, 16); } - writeKeyword(writer, 87); + writeKeyword(writer, 88); writeSpace(writer); buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8, typeStack); if (flags & 64) { @@ -9426,17 +10231,17 @@ var ts; writePunctuation(writer, 14); writer.writeLine(); writer.increaseIndent(); - for (var _i = 0, _a = resolved.callSignatures, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = resolved.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); writePunctuation(writer, 22); writer.writeLine(); } - for (var _b = 0, _c = resolved.constructSignatures, _d = _c.length; _b < _d; _b++) { - var _signature = _c[_b]; - writeKeyword(writer, 87); + for (var _b = 0, _c = resolved.constructSignatures; _b < _c.length; _b++) { + var signature = _c[_b]; + writeKeyword(writer, 88); writeSpace(writer); - buildSignatureDisplay(_signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); + buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); writePunctuation(writer, 22); writer.writeLine(); } @@ -9445,7 +10250,7 @@ var ts; writer.writeParameter(getIndexerParameterName(resolved, 0, "x")); writePunctuation(writer, 51); writeSpace(writer); - writeKeyword(writer, 120); + writeKeyword(writer, 121); writePunctuation(writer, 19); writePunctuation(writer, 51); writeSpace(writer); @@ -9458,7 +10263,7 @@ var ts; writer.writeParameter(getIndexerParameterName(resolved, 1, "x")); writePunctuation(writer, 51); writeSpace(writer); - writeKeyword(writer, 118); + writeKeyword(writer, 119); writePunctuation(writer, 19); writePunctuation(writer, 51); writeSpace(writer); @@ -9466,18 +10271,18 @@ var ts; writePunctuation(writer, 22); writer.writeLine(); } - for (var _e = 0, _f = resolved.properties, _g = _f.length; _e < _g; _e++) { - var p = _f[_e]; + for (var _d = 0, _e = resolved.properties; _d < _e.length; _d++) { + var p = _e[_d]; var t = getTypeOfSymbol(p); if (p.flags & (16 | 8192) && !getPropertiesOfObjectType(t).length) { var signatures = getSignaturesOfType(t, 0); - for (var _h = 0, _j = signatures.length; _h < _j; _h++) { - var _signature_1 = signatures[_h]; + for (var _f = 0; _f < signatures.length; _f++) { + var signature = signatures[_f]; buildSymbolDisplay(p, writer); if (p.flags & 536870912) { writePunctuation(writer, 50); } - buildSignatureDisplay(_signature_1, writer, enclosingDeclaration, globalFlagsToPass, typeStack); + buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); writePunctuation(writer, 22); writer.writeLine(); } @@ -9509,7 +10314,7 @@ var ts; var constraint = getConstraintOfTypeParameter(tp); if (constraint) { writeSpace(writer); - writeKeyword(writer, 78); + writeKeyword(writer, 79); writeSpace(writer); buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, typeStack); } @@ -9602,12 +10407,12 @@ var ts; function isDeclarationVisible(node) { function getContainingExternalModule(node) { for (; node; node = node.parent) { - if (node.kind === 200) { + if (node.kind === 205) { if (node.name.kind === 8) { return node; } } - else if (node.kind === 221) { + else if (node.kind === 227) { return ts.isExternalModule(node) ? node : undefined; } } @@ -9650,48 +10455,59 @@ var ts; } function determineIfDeclarationIsVisible() { switch (node.kind) { - case 193: - case 150: - case 200: - case 196: - case 197: + case 152: + return isDeclarationVisible(node.parent.parent); case 198: - case 195: - case 199: - case 203: - var _parent = getDeclarationContainer(node); - if (!(ts.getCombinedNodeFlags(node) & 1) && - !(node.kind !== 203 && _parent.kind !== 221 && ts.isInAmbientContext(_parent))) { - return isGlobalSourceFile(_parent) || isUsedInExportAssignment(node); + if (ts.isBindingPattern(node.name) && + !node.name.elements.length) { + return false; } - return isDeclarationVisible(_parent); - case 130: - case 129: - case 134: - case 135: + case 205: + case 201: + case 202: + case 203: + case 200: + case 204: + case 208: + var parent_2 = getDeclarationContainer(node); + if (!(ts.getCombinedNodeFlags(node) & 1) && + !(node.kind !== 208 && parent_2.kind !== 227 && ts.isInAmbientContext(parent_2))) { + return isGlobalSourceFile(parent_2); + } + return isDeclarationVisible(parent_2); case 132: case 131: + case 136: + case 137: + case 134: + case 133: if (node.flags & (32 | 64)) { return false; } - case 133: - case 137: - case 136: - case 138: - case 128: - case 201: - case 140: - case 141: - case 143: + case 135: case 139: - case 144: + case 138: + case 140: + case 129: + case 206: + case 142: + case 143: case 145: + case 141: case 146: case 147: + case 148: + case 149: return isDeclarationVisible(node.parent); - case 127: - case 221: + case 210: + case 211: + case 213: + return false; + case 128: + case 227: return true; + case 214: + return false; default: ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); } @@ -9704,15 +10520,44 @@ var ts; return links.isVisible; } } + function collectLinkedAliases(node) { + var exportSymbol; + if (node.parent && node.parent.kind === 214) { + exportSymbol = resolveName(node.parent, node.text, 107455 | 793056 | 1536, ts.Diagnostics.Cannot_find_name_0, node); + } + else if (node.parent.kind === 217) { + exportSymbol = getTargetOfExportSpecifier(node.parent); + } + var result = []; + if (exportSymbol) { + buildVisibleNodeList(exportSymbol.declarations); + } + return result; + function buildVisibleNodeList(declarations) { + ts.forEach(declarations, function (declaration) { + getNodeLinks(declaration).isVisible = true; + var resultNode = getAnyImportSyntax(declaration) || declaration; + if (!ts.contains(result, resultNode)) { + result.push(resultNode); + } + if (ts.isInternalModuleImportEqualsDeclaration(declaration)) { + var internalModuleReference = declaration.moduleReference; + var firstIdentifier = getFirstIdentifier(internalModuleReference); + var importSymbol = resolveName(declaration, firstIdentifier.text, 107455 | 793056 | 1536, ts.Diagnostics.Cannot_find_name_0, firstIdentifier); + buildVisibleNodeList(importSymbol.declarations); + } + }); + } + } function getRootDeclaration(node) { - while (node.kind === 150) { + while (node.kind === 152) { node = node.parent.parent; } return node; } function getDeclarationContainer(node) { node = getRootDeclaration(node); - return node.kind === 193 ? node.parent.parent.parent : node.parent; + return node.kind === 198 ? node.parent.parent.parent : node.parent; } function getTypeOfPrototypeProperty(prototype) { var classType = getDeclaredTypeOfSymbol(prototype.parent); @@ -9735,13 +10580,13 @@ var ts; return parentType; } var type; - if (pattern.kind === 148) { - var _name = declaration.propertyName || declaration.name; - type = getTypeOfPropertyOfType(parentType, _name.text) || - isNumericLiteralName(_name.text) && getIndexTypeOfType(parentType, 1) || + if (pattern.kind === 150) { + var name_5 = declaration.propertyName || declaration.name; + type = getTypeOfPropertyOfType(parentType, name_5.text) || + isNumericLiteralName(name_5.text) && getIndexTypeOfType(parentType, 1) || getIndexTypeOfType(parentType, 0); if (!type) { - error(_name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(_name)); + error(name_5, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name_5)); return unknownType; } } @@ -9770,22 +10615,22 @@ var ts; return type; } function getTypeForVariableLikeDeclaration(declaration) { - if (declaration.parent.parent.kind === 182) { + if (declaration.parent.parent.kind === 187) { return anyType; } - if (declaration.parent.parent.kind === 183) { + if (declaration.parent.parent.kind === 188) { return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType; } if (ts.isBindingPattern(declaration.parent)) { return getTypeForBindingElement(declaration); } if (declaration.type) { - return getTypeFromTypeNode(declaration.type); + return getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); } - if (declaration.kind === 128) { + if (declaration.kind === 129) { var func = declaration.parent; - if (func.kind === 135 && !ts.hasDynamicName(func)) { - var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 134); + if (func.kind === 137 && !ts.hasDynamicName(func)) { + var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 136); if (getter) { return getReturnTypeOfSignature(getSignatureFromDeclaration(getter)); } @@ -9798,7 +10643,7 @@ var ts; if (declaration.initializer) { return checkExpressionCached(declaration.initializer); } - if (declaration.kind === 219) { + if (declaration.kind === 225) { return checkIdentifier(declaration.name); } return undefined; @@ -9816,8 +10661,8 @@ var ts; var members = {}; ts.forEach(pattern.elements, function (e) { var flags = 4 | 67108864 | (e.initializer ? 536870912 : 0); - var _name = e.propertyName || e.name; - var symbol = createSymbol(flags, _name.text); + var name = e.propertyName || e.name; + var symbol = createSymbol(flags, name.text); symbol.type = getTypeFromBindingElement(e); members[symbol.name] = symbol; }); @@ -9827,7 +10672,7 @@ var ts; var hasSpreadElement = false; var elementTypes = []; ts.forEach(pattern.elements, function (e) { - elementTypes.push(e.kind === 172 || e.dotDotDotToken ? anyType : getTypeFromBindingElement(e)); + elementTypes.push(e.kind === 175 || e.dotDotDotToken ? anyType : getTypeFromBindingElement(e)); if (e.dotDotDotToken) { hasSpreadElement = true; } @@ -9835,7 +10680,7 @@ var ts; return !elementTypes.length ? anyArrayType : hasSpreadElement ? createArrayType(getUnionType(elementTypes)) : createTupleType(elementTypes); } function getTypeFromBindingPattern(pattern) { - return pattern.kind === 148 + return pattern.kind === 150 ? getTypeFromObjectBindingPattern(pattern) : getTypeFromArrayBindingPattern(pattern); } @@ -9845,7 +10690,7 @@ var ts; if (reportErrors) { reportErrorsFromWidening(declaration, type); } - return declaration.kind !== 218 ? getWidenedType(type) : type; + return declaration.kind !== 224 ? getWidenedType(type) : type; } if (ts.isBindingPattern(declaration.name)) { return getTypeFromBindingPattern(declaration.name); @@ -9853,7 +10698,7 @@ var ts; type = declaration.dotDotDotToken ? anyArrayType : anyType; if (reportErrors && compilerOptions.noImplicitAny) { var root = getRootDeclaration(declaration); - if (!isPrivateWithinAmbient(root) && !(root.kind === 128 && isPrivateWithinAmbient(root.parent))) { + if (!isPrivateWithinAmbient(root) && !(root.kind === 129 && isPrivateWithinAmbient(root.parent))) { reportImplicitAnyError(declaration, type); } } @@ -9866,11 +10711,20 @@ var ts; return links.type = getTypeOfPrototypeProperty(symbol); } var declaration = symbol.valueDeclaration; - if (declaration.parent.kind === 217) { + if (declaration.parent.kind === 223) { return links.type = anyType; } - if (declaration.kind === 209) { - return links.type = checkExpression(declaration.expression); + if (declaration.kind === 214) { + var exportAssignment = declaration; + if (exportAssignment.expression) { + return links.type = checkExpression(exportAssignment.expression); + } + else if (exportAssignment.type) { + return links.type = getTypeFromTypeNodeOrHeritageClauseElement(exportAssignment.type); + } + else { + return links.type = anyType; + } } links.type = resolvingType; var type = getWidenedTypeForVariableLikeDeclaration(declaration, true); @@ -9894,12 +10748,12 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 134) { - return accessor.type && getTypeFromTypeNode(accessor.type); + if (accessor.kind === 136) { + return accessor.type && getTypeFromTypeNodeOrHeritageClauseElement(accessor.type); } else { var setterTypeAnnotation = getSetAccessorTypeAnnotationNode(accessor); - return setterTypeAnnotation && getTypeFromTypeNode(setterTypeAnnotation); + return setterTypeAnnotation && getTypeFromTypeNodeOrHeritageClauseElement(setterTypeAnnotation); } } return undefined; @@ -9913,8 +10767,8 @@ var ts; links = links || getSymbolLinks(symbol); if (!links.type) { links.type = resolvingType; - var getter = ts.getDeclarationOfKind(symbol, 134); - var setter = ts.getDeclarationOfKind(symbol, 135); + var getter = ts.getDeclarationOfKind(symbol, 136); + var setter = ts.getDeclarationOfKind(symbol, 137); var type; var getterReturnType = getAnnotatedAccessorType(getter); if (getterReturnType) { @@ -9944,8 +10798,8 @@ var ts; else if (links.type === resolvingType) { links.type = anyType; if (compilerOptions.noImplicitAny) { - var _getter = ts.getDeclarationOfKind(symbol, 134); - 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)); + 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)); } } } @@ -10011,7 +10865,7 @@ var ts; function getTypeParametersOfClassOrInterface(symbol) { var result; ts.forEach(symbol.declarations, function (node) { - if (node.kind === 197 || node.kind === 196) { + if (node.kind === 202 || node.kind === 201) { var declaration = node; if (declaration.typeParameters && declaration.typeParameters.length) { ts.forEach(declaration.typeParameters, function (node) { @@ -10042,10 +10896,10 @@ var ts; type.typeArguments = type.typeParameters; } type.baseTypes = []; - var declaration = ts.getDeclarationOfKind(symbol, 196); - var baseTypeNode = ts.getClassBaseTypeNode(declaration); + var declaration = ts.getDeclarationOfKind(symbol, 201); + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(declaration); if (baseTypeNode) { - var baseType = getTypeFromTypeReferenceNode(baseTypeNode); + var baseType = getTypeFromHeritageClauseElement(baseTypeNode); if (baseType !== unknownType) { if (getTargetType(baseType).flags & 1024) { if (type !== baseType && !hasBaseType(baseType, type)) { @@ -10083,9 +10937,9 @@ var ts; } type.baseTypes = []; ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 197 && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 202 && ts.getInterfaceBaseTypeNodes(declaration)) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), function (node) { - var baseType = getTypeFromTypeReferenceNode(node); + var baseType = getTypeFromHeritageClauseElement(node); if (baseType !== unknownType) { if (getTargetType(baseType).flags & (1024 | 2048)) { if (type !== baseType && !hasBaseType(baseType, type)) { @@ -10114,16 +10968,16 @@ var ts; var links = getSymbolLinks(symbol); if (!links.declaredType) { links.declaredType = resolvingType; - var declaration = ts.getDeclarationOfKind(symbol, 198); - var type = getTypeFromTypeNode(declaration.type); + var declaration = ts.getDeclarationOfKind(symbol, 203); + var type = getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); if (links.declaredType === resolvingType) { links.declaredType = type; } } else if (links.declaredType === resolvingType) { links.declaredType = unknownType; - var _declaration = ts.getDeclarationOfKind(symbol, 198); - error(_declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); + var declaration = ts.getDeclarationOfKind(symbol, 203); + error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); } return links.declaredType; } @@ -10141,7 +10995,7 @@ var ts; if (!links.declaredType) { var type = createType(512); type.symbol = symbol; - if (!ts.getDeclarationOfKind(symbol, 127).constraint) { + if (!ts.getDeclarationOfKind(symbol, 128).constraint) { type.constraint = noConstraintType; } links.declaredType = type; @@ -10179,7 +11033,7 @@ var ts; } function createSymbolTable(symbols) { var result = {}; - for (var _i = 0, _n = symbols.length; _i < _n; _i++) { + for (var _i = 0; _i < symbols.length; _i++) { var symbol = symbols[_i]; result[symbol.name] = symbol; } @@ -10187,14 +11041,14 @@ var ts; } function createInstantiatedSymbolTable(symbols, mapper) { var result = {}; - for (var _i = 0, _n = symbols.length; _i < _n; _i++) { + for (var _i = 0; _i < symbols.length; _i++) { var symbol = symbols[_i]; result[symbol.name] = instantiateSymbol(symbol, mapper); } return result; } function addInheritedMembers(symbols, baseSymbols) { - for (var _i = 0, _n = baseSymbols.length; _i < _n; _i++) { + for (var _i = 0; _i < baseSymbols.length; _i++) { var s = baseSymbols[_i]; if (!ts.hasProperty(symbols, s.name)) { symbols[s.name] = s; @@ -10203,7 +11057,7 @@ var ts; } function addInheritedSignatures(signatures, baseSignatures) { if (baseSignatures) { - for (var _i = 0, _n = baseSignatures.length; _i < _n; _i++) { + for (var _i = 0; _i < baseSignatures.length; _i++) { var signature = baseSignatures[_i]; signatures.push(signature); } @@ -10302,14 +11156,14 @@ var ts; function getUnionSignatures(types, kind) { var signatureLists = ts.map(types, function (t) { return getSignaturesOfType(t, kind); }); var signatures = signatureLists[0]; - for (var _i = 0, _n = signatures.length; _i < _n; _i++) { + for (var _i = 0; _i < signatures.length; _i++) { var signature = signatures[_i]; if (signature.typeParameters) { return emptyArray; } } - for (var _i_1 = 1; _i_1 < signatureLists.length; _i_1++) { - if (!signatureListsIdentical(signatures, signatureLists[_i_1])) { + for (var i_1 = 1; i_1 < signatureLists.length; i_1++) { + if (!signatureListsIdentical(signatures, signatureLists[i_1])) { return emptyArray; } } @@ -10323,7 +11177,7 @@ var ts; } function getUnionIndexType(types, kind) { var indexTypes = []; - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var type = types[_i]; var indexType = getIndexTypeOfType(type, kind); if (!indexType) { @@ -10459,7 +11313,7 @@ var ts; function createUnionProperty(unionType, name) { var types = unionType.types; var props; - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var current = types[_i]; var type = getApparentType(current); if (type !== unknownType) { @@ -10477,12 +11331,12 @@ var ts; } var propTypes = []; var declarations = []; - for (var _a = 0, _b = props.length; _a < _b; _a++) { - var _prop = props[_a]; - if (_prop.declarations) { - declarations.push.apply(declarations, _prop.declarations); + for (var _a = 0; _a < props.length; _a++) { + var prop = props[_a]; + if (prop.declarations) { + declarations.push.apply(declarations, prop.declarations); } - propTypes.push(getTypeOfSymbol(_prop)); + propTypes.push(getTypeOfSymbol(prop)); } var result = createSymbol(4 | 67108864 | 268435456, name); result.unionType = unionType; @@ -10519,9 +11373,9 @@ var ts; } } if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { - var _symbol = getPropertyOfObjectType(globalFunctionType, name); - if (_symbol) - return _symbol; + var symbol = getPropertyOfObjectType(globalFunctionType, name); + if (symbol) + return symbol; } return getPropertyOfObjectType(globalObjectType, name); } @@ -10554,20 +11408,29 @@ var ts; }); return result; } + function symbolsToArray(symbols) { + var result = []; + for (var id in symbols) { + if (!isReservedMemberName(id)) { + result.push(symbols[id]); + } + } + return result; + } function getExportsOfExternalModule(node) { if (!node.moduleSpecifier) { return emptyArray; } var module = resolveExternalModuleName(node, node.moduleSpecifier); - if (!module || !module.exports) { + if (!module) { return emptyArray; } - return ts.mapToArray(getExportsOfModule(module)); + return symbolsToArray(getExportsOfModule(module)); } function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { - var classType = declaration.kind === 133 ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; + var classType = declaration.kind === 135 ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; var typeParameters = classType ? classType.typeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; var parameters = []; @@ -10593,11 +11456,11 @@ var ts; returnType = classType; } else if (declaration.type) { - returnType = getTypeFromTypeNode(declaration.type); + returnType = getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); } else { - if (declaration.kind === 134 && !ts.hasDynamicName(declaration)) { - var setter = ts.getDeclarationOfKind(declaration.symbol, 135); + if (declaration.kind === 136 && !ts.hasDynamicName(declaration)) { + var setter = ts.getDeclarationOfKind(declaration.symbol, 137); returnType = getAnnotatedAccessorType(setter); } if (!returnType && ts.nodeIsMissing(declaration.body)) { @@ -10615,19 +11478,19 @@ var ts; for (var i = 0, len = symbol.declarations.length; i < len; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 140: - case 141: - case 195: - case 132: - case 131: + case 142: + case 143: + case 200: + case 134: case 133: + case 135: + case 138: + case 139: + case 140: case 136: case 137: - case 138: - case 134: - case 135: - case 160: - case 161: + case 162: + case 163: if (i > 0 && node.body) { var previous = symbol.declarations[i - 1]; if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { @@ -10697,7 +11560,7 @@ var ts; } function getOrCreateTypeFromSignature(signature) { if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 133 || signature.declaration.kind === 137; + var isConstructor = signature.declaration.kind === 135 || signature.declaration.kind === 139; var type = createObjectType(32768 | 65536); type.members = emptySymbols; type.properties = emptyArray; @@ -10711,11 +11574,11 @@ var ts; return symbol.members["__index"]; } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 ? 118 : 120; + var syntaxKind = kind === 1 ? 119 : 121; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { var len = indexSymbol.declarations.length; - for (var _i = 0, _a = indexSymbol.declarations, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; var node = decl; if (node.parameters.length === 1) { @@ -10731,7 +11594,7 @@ var ts; function getIndexTypeOfSymbol(symbol, kind) { var declaration = getIndexDeclarationOfSymbol(symbol, kind); return declaration - ? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType + ? declaration.type ? getTypeFromTypeNodeOrHeritageClauseElement(declaration.type) : anyType : undefined; } function getConstraintOfTypeParameter(type) { @@ -10741,7 +11604,7 @@ var ts; type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNode(ts.getDeclarationOfKind(type.symbol, 127).constraint); + type.constraint = getTypeFromTypeNodeOrHeritageClauseElement(ts.getDeclarationOfKind(type.symbol, 128).constraint); } } return type.constraint === noConstraintType ? undefined : type.constraint; @@ -10765,7 +11628,7 @@ var ts; } function getWideningFlagsOfTypes(types) { var result = 0; - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var type = types[_i]; result |= type.flags; } @@ -10791,13 +11654,13 @@ var ts; while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) { currentNode = currentNode.parent; } - links.isIllegalTypeReferenceInConstraint = currentNode.kind === 127; + links.isIllegalTypeReferenceInConstraint = currentNode.kind === 128; return links.isIllegalTypeReferenceInConstraint; } function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter) { var typeParameterSymbol; function check(n) { - if (n.kind === 139 && n.typeName.kind === 64) { + if (n.kind === 141 && n.typeName.kind === 65) { var links = getNodeLinks(n); if (links.isIllegalTypeReferenceInConstraint === undefined) { var symbol = resolveName(typeParameter, n.typeName.text, 793056, undefined, undefined); @@ -10816,31 +11679,42 @@ var ts; check(typeParameter.constraint); } } - function getTypeFromTypeReferenceNode(node) { + function getTypeFromTypeReference(node) { + return getTypeFromTypeReferenceOrHeritageClauseElement(node); + } + function getTypeFromHeritageClauseElement(node) { + return getTypeFromTypeReferenceOrHeritageClauseElement(node); + } + function getTypeFromTypeReferenceOrHeritageClauseElement(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - var symbol = resolveEntityName(node.typeName, 793056); var type; - if (symbol) { - if ((symbol.flags & 262144) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { - type = unknownType; - } - else { - type = getDeclaredTypeOfSymbol(symbol); - if (type.flags & (1024 | 2048) && type.flags & 4096) { - var typeParameters = type.typeParameters; - if (node.typeArguments && node.typeArguments.length === typeParameters.length) { - type = createTypeReference(type, ts.map(node.typeArguments, getTypeFromTypeNode)); - } - else { - error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, undefined, 1), typeParameters.length); - type = undefined; - } + if (node.kind !== 177 || ts.isSupportedHeritageClauseElement(node)) { + var typeNameOrExpression = node.kind === 141 + ? node.typeName + : node.expression; + var symbol = resolveEntityName(typeNameOrExpression, 793056); + if (symbol) { + if ((symbol.flags & 262144) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { + type = unknownType; } else { - if (node.typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); - type = undefined; + type = getDeclaredTypeOfSymbol(symbol); + if (type.flags & (1024 | 2048) && type.flags & 4096) { + var typeParameters = type.typeParameters; + if (node.typeArguments && node.typeArguments.length === typeParameters.length) { + type = createTypeReference(type, ts.map(node.typeArguments, getTypeFromTypeNodeOrHeritageClauseElement)); + } + else { + error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, undefined, 1), typeParameters.length); + type = undefined; + } + } + else { + if (node.typeArguments) { + error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); + type = undefined; + } } } } @@ -10859,12 +11733,12 @@ var ts; function getTypeOfGlobalSymbol(symbol, arity) { function getTypeDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; switch (declaration.kind) { - case 196: - case 197: - case 199: + case 201: + case 202: + case 204: return declaration; } } @@ -10906,7 +11780,7 @@ var ts; function getTypeFromArrayTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = createArrayType(getTypeFromTypeNode(node.elementType)); + links.resolvedType = createArrayType(getTypeFromTypeNodeOrHeritageClauseElement(node.elementType)); } return links.resolvedType; } @@ -10922,7 +11796,7 @@ var ts; function getTypeFromTupleTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = createTupleType(ts.map(node.elementTypes, getTypeFromTypeNode)); + links.resolvedType = createTupleType(ts.map(node.elementTypes, getTypeFromTypeNodeOrHeritageClauseElement)); } return links.resolvedType; } @@ -10942,13 +11816,13 @@ var ts; } } function addTypesToSortedSet(sortedTypes, types) { - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var type = types[_i]; addTypeToSortedSet(sortedTypes, type); } } function isSubtypeOfAny(candidate, types) { - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var type = types[_i]; if (candidate !== type && isTypeSubtypeOf(candidate, type)) { return true; @@ -10966,7 +11840,7 @@ var ts; } } function containsAnyType(types) { - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var type = types[_i]; if (type.flags & 1) { return true; @@ -11013,7 +11887,7 @@ var ts; function getTypeFromUnionTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNode), true); + links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNodeOrHeritageClauseElement), true); } return links.resolvedType; } @@ -11039,40 +11913,42 @@ var ts; } return links.resolvedType; } - function getTypeFromTypeNode(node) { + function getTypeFromTypeNodeOrHeritageClauseElement(node) { switch (node.kind) { - case 111: - return anyType; - case 120: - return stringType; - case 118: - return numberType; case 112: - return booleanType; + return anyType; case 121: + return stringType; + case 119: + return numberType; + case 113: + return booleanType; + case 122: return esSymbolType; - case 98: + case 99: return voidType; case 8: return getTypeFromStringLiteral(node); - case 139: - return getTypeFromTypeReferenceNode(node); - case 142: - return getTypeFromTypeQueryNode(node); - case 144: - return getTypeFromArrayTypeNode(node); - case 145: - return getTypeFromTupleTypeNode(node); - case 146: - return getTypeFromUnionTypeNode(node); - case 147: - return getTypeFromTypeNode(node.type); - case 140: 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 getTypeFromTypeNodeOrHeritageClauseElement(node.type); + case 142: case 143: + case 145: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 64: - case 125: + case 65: + case 126: var symbol = getSymbolInfo(node); return symbol && getDeclaredTypeOfSymbol(symbol); default: @@ -11082,7 +11958,7 @@ var ts; function instantiateList(items, mapper, instantiator) { if (items && items.length) { var result = []; - for (var _i = 0, _n = items.length; _i < _n; _i++) { + for (var _i = 0; _i < items.length; _i++) { var v = items[_i]; result.push(instantiator(v, mapper)); } @@ -11122,7 +11998,7 @@ var ts; case 2: return createBinaryTypeEraser(sources[0], sources[1]); } return function (t) { - for (var _i = 0, _n = sources.length; _i < _n; _i++) { + for (var _i = 0; _i < sources.length; _i++) { var source = sources[_i]; if (t === source) { return anyType; @@ -11135,6 +12011,7 @@ var ts; return function (t) { for (var i = 0; i < context.typeParameters.length; i++) { if (t === context.typeParameters[i]) { + context.inferences[i].isFixed = true; return getInferredType(context, i); } } @@ -11222,27 +12099,27 @@ var ts; return type; } function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 132 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 160: - case 161: + case 162: + case 163: return isContextSensitiveFunctionLikeDeclaration(node); - case 152: + case 154: return ts.forEach(node.properties, isContextSensitive); - case 151: + case 153: return ts.forEach(node.elements, isContextSensitive); - case 168: + case 170: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 167: + case 169: return node.operatorToken.kind === 49 && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 218: + case 224: return isContextSensitive(node.initializer); - case 132: - case 131: + case 134: + case 133: return isContextSensitiveFunctionLikeDeclaration(node); - case 159: + case 161: return isContextSensitive(node.expression); } return false; @@ -11298,6 +12175,7 @@ var ts; var expandingFlags; var depth = 0; var overflow = false; + var elaborateErrors = false; ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); var result = isRelatedTo(source, target, errorNode !== undefined, headMessage); if (overflow) { @@ -11306,7 +12184,8 @@ var ts; else if (errorInfo) { if (errorInfo.next === undefined) { errorInfo = undefined; - isRelatedTo(source, target, errorNode !== undefined, headMessage, true); + elaborateErrors = true; + isRelatedTo(source, target, errorNode !== undefined, headMessage); } if (containingMessageChain) { errorInfo = ts.concatenateDiagnosticMessageChains(containingMessageChain, errorInfo); @@ -11317,9 +12196,8 @@ var ts; function reportError(message, arg0, arg1, arg2) { errorInfo = ts.chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2); } - function isRelatedTo(source, target, reportErrors, headMessage, elaborateErrors) { - if (elaborateErrors === void 0) { elaborateErrors = false; } - var _result; + function isRelatedTo(source, target, reportErrors, headMessage) { + var result; if (source === target) return -1; if (relation !== identityRelation) { @@ -11343,54 +12221,54 @@ var ts; if (source.flags & 16384 || target.flags & 16384) { if (relation === identityRelation) { if (source.flags & 16384 && target.flags & 16384) { - if (_result = unionTypeRelatedToUnionType(source, target)) { - if (_result &= unionTypeRelatedToUnionType(target, source)) { - return _result; + if (result = unionTypeRelatedToUnionType(source, target)) { + if (result &= unionTypeRelatedToUnionType(target, source)) { + return result; } } } else if (source.flags & 16384) { - if (_result = unionTypeRelatedToType(source, target, reportErrors)) { - return _result; + if (result = unionTypeRelatedToType(source, target, reportErrors)) { + return result; } } else { - if (_result = unionTypeRelatedToType(target, source, reportErrors)) { - return _result; + if (result = unionTypeRelatedToType(target, source, reportErrors)) { + return result; } } } else { if (source.flags & 16384) { - if (_result = unionTypeRelatedToType(source, target, reportErrors)) { - return _result; + if (result = unionTypeRelatedToType(source, target, reportErrors)) { + return result; } } else { - if (_result = typeRelatedToUnionType(source, target, reportErrors)) { - return _result; + if (result = typeRelatedToUnionType(source, target, reportErrors)) { + return result; } } } } else if (source.flags & 512 && target.flags & 512) { - if (_result = typeParameterRelatedTo(source, target, reportErrors)) { - return _result; + if (result = typeParameterRelatedTo(source, target, reportErrors)) { + return result; } } else { var saveErrorInfo = errorInfo; if (source.flags & 4096 && target.flags & 4096 && source.target === target.target) { - if (_result = typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { - return _result; + if (result = typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { + return result; } } var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; var sourceOrApparentType = relation === identityRelation ? source : getApparentType(source); if (sourceOrApparentType.flags & 48128 && target.flags & 48128 && - (_result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors, elaborateErrors))) { + (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors))) { errorInfo = saveErrorInfo; - return _result; + return result; } } if (reportErrors) { @@ -11406,17 +12284,17 @@ var ts; return 0; } function unionTypeRelatedToUnionType(source, target) { - var _result = -1; + var result = -1; var sourceTypes = source.types; - for (var _i = 0, _n = sourceTypes.length; _i < _n; _i++) { + for (var _i = 0; _i < sourceTypes.length; _i++) { var sourceType = sourceTypes[_i]; var related = typeRelatedToUnionType(sourceType, target, false); if (!related) { return 0; } - _result &= related; + result &= related; } - return _result; + return result; } function typeRelatedToUnionType(source, target, reportErrors) { var targetTypes = target.types; @@ -11429,28 +12307,28 @@ var ts; return 0; } function unionTypeRelatedToType(source, target, reportErrors) { - var _result = -1; + var result = -1; var sourceTypes = source.types; - for (var _i = 0, _n = sourceTypes.length; _i < _n; _i++) { + for (var _i = 0; _i < sourceTypes.length; _i++) { var sourceType = sourceTypes[_i]; var related = isRelatedTo(sourceType, target, reportErrors); if (!related) { return 0; } - _result &= related; + result &= related; } - return _result; + return result; } function typesRelatedTo(sources, targets, reportErrors) { - var _result = -1; + var result = -1; for (var i = 0, len = sources.length; i < len; i++) { var related = isRelatedTo(sources[i], targets[i], reportErrors); if (!related) { return 0; } - _result &= related; + result &= related; } - return _result; + return result; } function typeParameterRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { @@ -11477,8 +12355,7 @@ var ts; return 0; } } - function objectTypeRelatedTo(source, target, reportErrors, elaborateErrors) { - if (elaborateErrors === void 0) { elaborateErrors = false; } + function objectTypeRelatedTo(source, target, reportErrors) { if (overflow) { return 0; } @@ -11516,20 +12393,20 @@ var ts; expandingFlags |= 1; if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack)) expandingFlags |= 2; - var _result; + var result; if (expandingFlags === 3) { - _result = 1; + result = 1; } else { - _result = propertiesRelatedTo(source, target, reportErrors); - if (_result) { - _result &= signaturesRelatedTo(source, target, 0, reportErrors); - if (_result) { - _result &= signaturesRelatedTo(source, target, 1, reportErrors); - if (_result) { - _result &= stringIndexTypesRelatedTo(source, target, reportErrors); - if (_result) { - _result &= numberIndexTypesRelatedTo(source, target, reportErrors); + result = propertiesRelatedTo(source, target, reportErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 0, reportErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 1, reportErrors); + if (result) { + result &= stringIndexTypesRelatedTo(source, target, reportErrors); + if (result) { + result &= numberIndexTypesRelatedTo(source, target, reportErrors); } } } @@ -11537,23 +12414,23 @@ var ts; } expandingFlags = saveExpandingFlags; depth--; - if (_result) { + if (result) { var maybeCache = maybeStack[depth]; - var destinationCache = (_result === -1 || depth === 0) ? relation : maybeStack[depth - 1]; + var destinationCache = (result === -1 || depth === 0) ? relation : maybeStack[depth - 1]; ts.copyMap(maybeCache, destinationCache); } else { relation[id] = reportErrors ? 3 : 2; } - return _result; + return result; } function isDeeplyNestedGeneric(type, stack) { if (type.flags & 4096 && depth >= 10) { - var _target = type.target; + var target_1 = type.target; var count = 0; for (var i = 0; i < depth; i++) { var t = stack[i]; - if (t.flags & 4096 && t.target === _target) { + if (t.flags & 4096 && t.target === target_1) { count++; if (count >= 10) return true; @@ -11566,10 +12443,10 @@ var ts; if (relation === identityRelation) { return propertiesIdenticalTo(source, target); } - var _result = -1; + var result = -1; var properties = getPropertiesOfObjectType(target); var requireOptionalProperties = relation === subtypeRelation && !(source.flags & 131072); - for (var _i = 0, _n = properties.length; _i < _n; _i++) { + for (var _i = 0; _i < properties.length; _i++) { var targetProp = properties[_i]; var sourceProp = getPropertyOfType(source, targetProp.name); if (sourceProp !== targetProp) { @@ -11621,7 +12498,7 @@ var ts; } return 0; } - _result &= related; + result &= related; if (sourceProp.flags & 536870912 && !(targetProp.flags & 536870912)) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); @@ -11631,7 +12508,7 @@ var ts; } } } - return _result; + return result; } function propertiesIdenticalTo(source, target) { var sourceProperties = getPropertiesOfObjectType(source); @@ -11639,8 +12516,8 @@ var ts; if (sourceProperties.length !== targetProperties.length) { return 0; } - var _result = -1; - for (var _i = 0, _n = sourceProperties.length; _i < _n; _i++) { + var result = -1; + for (var _i = 0; _i < sourceProperties.length; _i++) { var sourceProp = sourceProperties[_i]; var targetProp = getPropertyOfObjectType(target, sourceProp.name); if (!targetProp) { @@ -11650,9 +12527,9 @@ var ts; if (!related) { return 0; } - _result &= related; + result &= related; } - return _result; + return result; } function signaturesRelatedTo(source, target, kind, reportErrors) { if (relation === identityRelation) { @@ -11663,18 +12540,18 @@ var ts; } var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); - var _result = -1; + var result = -1; var saveErrorInfo = errorInfo; - outer: for (var _i = 0, _n = targetSignatures.length; _i < _n; _i++) { + outer: for (var _i = 0; _i < targetSignatures.length; _i++) { var t = targetSignatures[_i]; if (!t.hasStringLiterals || target.flags & 65536) { var localErrors = reportErrors; - for (var _a = 0, _b = sourceSignatures.length; _a < _b; _a++) { + for (var _a = 0; _a < sourceSignatures.length; _a++) { var s = sourceSignatures[_a]; if (!s.hasStringLiterals || source.flags & 65536) { var related = signatureRelatedTo(s, t, localErrors); if (related) { - _result &= related; + result &= related; errorInfo = saveErrorInfo; continue outer; } @@ -11684,7 +12561,7 @@ var ts; return 0; } } - return _result; + return result; } function signatureRelatedTo(source, target, reportErrors) { if (source === target) { @@ -11714,14 +12591,14 @@ var ts; } source = getErasedSignature(source); target = getErasedSignature(target); - var _result = -1; + var result = -1; for (var i = 0; i < checkCount; i++) { - var _s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); - var _t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); + var s_1 = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); + var t_1 = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); var saveErrorInfo = errorInfo; - var related = isRelatedTo(_s, _t, reportErrors); + var related = isRelatedTo(s_1, t_1, reportErrors); if (!related) { - related = isRelatedTo(_t, _s, false); + related = isRelatedTo(t_1, s_1, false); if (!related) { if (reportErrors) { reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); @@ -11730,13 +12607,13 @@ var ts; } errorInfo = saveErrorInfo; } - _result &= related; + result &= related; } var t = getReturnTypeOfSignature(target); if (t === voidType) - return _result; + return result; var s = getReturnTypeOfSignature(source); - return _result & isRelatedTo(s, t, reportErrors); + return result & isRelatedTo(s, t, reportErrors); } function signaturesIdenticalTo(source, target, kind) { var sourceSignatures = getSignaturesOfType(source, kind); @@ -11744,15 +12621,15 @@ var ts; if (sourceSignatures.length !== targetSignatures.length) { return 0; } - var _result = -1; + var result = -1; for (var i = 0, len = sourceSignatures.length; i < len; ++i) { var related = compareSignatures(sourceSignatures[i], targetSignatures[i], true, isRelatedTo); if (!related) { return 0; } - _result &= related; + result &= related; } - return _result; + return result; } function stringIndexTypesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { @@ -11872,14 +12749,14 @@ var ts; } source = getErasedSignature(source); target = getErasedSignature(target); - for (var _i = 0, _len = source.parameters.length; _i < _len; _i++) { - var s = source.hasRestParameter && _i === _len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[_i]); - var t = target.hasRestParameter && _i === _len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[_i]); - var _related = compareTypes(s, t); - if (!_related) { + for (var i = 0, len = source.parameters.length; i < len; i++) { + var s = source.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); + var t = target.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]); + var related = compareTypes(s, t); + if (!related) { return 0; } - result &= _related; + result &= related; } if (compareReturnTypes) { result &= compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); @@ -11887,7 +12764,7 @@ var ts; return result; } function isSupertypeOfEach(candidate, types) { - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var type = types[_i]; if (candidate !== type && !isTypeSubtypeOf(type, candidate)) return false; @@ -11912,6 +12789,7 @@ var ts; downfallType = types[j]; } } + ts.Debug.assert(!!downfallType, "If there is no common supertype, each type should have a downfallType"); if (score > bestSupertypeScore) { bestSupertype = types[i]; bestSupertypeDownfallType = downfallType; @@ -11992,17 +12870,17 @@ var ts; return reportWideningErrorsInType(type.typeArguments[0]); } if (type.flags & 131072) { - var _errorReported = false; + var errorReported = false; ts.forEach(getPropertiesOfObjectType(type), function (p) { var t = getTypeOfSymbol(p); if (t.flags & 262144) { if (!reportWideningErrorsInType(t)) { error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, p.name, typeToString(getWidenedType(t))); } - _errorReported = true; + errorReported = true; } }); - return _errorReported; + return errorReported; } return false; } @@ -12010,22 +12888,22 @@ var ts; var typeAsString = typeToString(getWidenedType(type)); var diagnostic; switch (declaration.kind) { - case 130: - case 129: + case 132: + case 131: diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 128: + case 129: diagnostic = declaration.dotDotDotToken ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; - case 195: - case 132: - case 131: + case 200: case 134: - case 135: - case 160: - case 161: + case 133: + case 136: + case 137: + case 162: + case 163: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; @@ -12072,14 +12950,13 @@ var ts; } function createInferenceContext(typeParameters, inferUnionTypes) { var inferences = []; - for (var _i = 0, _n = typeParameters.length; _i < _n; _i++) { + for (var _i = 0; _i < typeParameters.length; _i++) { var unused = typeParameters[_i]; - inferences.push({ primary: undefined, secondary: undefined }); + inferences.push({ primary: undefined, secondary: undefined, isFixed: false }); } return { typeParameters: typeParameters, inferUnionTypes: inferUnionTypes, - inferenceCount: 0, inferences: inferences, inferredTypes: new Array(typeParameters.length) }; @@ -12100,11 +12977,11 @@ var ts; } function isWithinDepthLimit(type, stack) { if (depth >= 5) { - var _target = type.target; + var target_2 = type.target; var count = 0; for (var i = 0; i < depth; i++) { var t = stack[i]; - if (t.flags & 4096 && t.target === _target) { + if (t.flags & 4096 && t.target === target_2) { count++; } } @@ -12121,28 +12998,31 @@ var ts; for (var i = 0; i < typeParameters.length; i++) { if (target === typeParameters[i]) { var inferences = context.inferences[i]; - var candidates = inferiority ? - inferences.secondary || (inferences.secondary = []) : - inferences.primary || (inferences.primary = []); - if (!ts.contains(candidates, source)) - candidates.push(source); - break; + if (!inferences.isFixed) { + var candidates = inferiority ? + inferences.secondary || (inferences.secondary = []) : + inferences.primary || (inferences.primary = []); + if (!ts.contains(candidates, source)) { + candidates.push(source); + } + } + return; } } } else if (source.flags & 4096 && target.flags & 4096 && source.target === target.target) { var sourceTypes = source.typeArguments; var targetTypes = target.typeArguments; - for (var _i = 0; _i < sourceTypes.length; _i++) { - inferFromTypes(sourceTypes[_i], targetTypes[_i]); + for (var i = 0; i < sourceTypes.length; i++) { + inferFromTypes(sourceTypes[i], targetTypes[i]); } } else if (target.flags & 16384) { - var _targetTypes = target.types; + var targetTypes = target.types; var typeParameterCount = 0; var typeParameter; - for (var _a = 0, _n = _targetTypes.length; _a < _n; _a++) { - var t = _targetTypes[_a]; + for (var _i = 0; _i < targetTypes.length; _i++) { + var t = targetTypes[_i]; if (t.flags & 512 && ts.contains(context.typeParameters, t)) { typeParameter = t; typeParameterCount++; @@ -12158,9 +13038,9 @@ var ts; } } else if (source.flags & 16384) { - var _sourceTypes = source.types; - for (var _b = 0, _c = _sourceTypes.length; _b < _c; _b++) { - var sourceType = _sourceTypes[_b]; + var sourceTypes = source.types; + for (var _a = 0; _a < sourceTypes.length; _a++) { + var sourceType = sourceTypes[_a]; inferFromTypes(sourceType, target); } } @@ -12186,7 +13066,7 @@ var ts; } function inferFromProperties(source, target) { var properties = getPropertiesOfObjectType(target); - for (var _i = 0, _n = properties.length; _i < _n; _i++) { + for (var _i = 0; _i < properties.length; _i++) { var targetProp = properties[_i]; var sourceProp = getPropertyOfObjectType(source, targetProp.name); if (sourceProp) { @@ -12224,19 +13104,25 @@ var ts; } function getInferredType(context, index) { var inferredType = context.inferredTypes[index]; + var inferenceSucceeded; if (!inferredType) { var inferences = getInferenceCandidates(context, index); if (inferences.length) { var unionOrSuperType = context.inferUnionTypes ? getUnionType(inferences) : getCommonSupertype(inferences); - inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : inferenceFailureType; + inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : unknownType; + inferenceSucceeded = !!unionOrSuperType; } else { inferredType = emptyObjectType; + inferenceSucceeded = true; } - if (inferredType !== inferenceFailureType) { + if (inferenceSucceeded) { var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); inferredType = constraint && !isTypeAssignableTo(inferredType, constraint) ? constraint : inferredType; } + else if (context.failedTypeParameterIndex === undefined || context.failedTypeParameterIndex > index) { + context.failedTypeParameterIndex = index; + } context.inferredTypes[index] = inferredType; } return inferredType; @@ -12253,17 +13139,17 @@ var ts; function getResolvedSymbol(node) { var links = getNodeLinks(node); if (!links.resolvedSymbol) { - links.resolvedSymbol = (ts.getFullWidth(node) > 0 && resolveName(node, node.text, 107455 | 1048576, ts.Diagnostics.Cannot_find_name_0, node)) || unknownSymbol; + links.resolvedSymbol = (!ts.nodeIsMissing(node) && resolveName(node, node.text, 107455 | 1048576, ts.Diagnostics.Cannot_find_name_0, node)) || unknownSymbol; } return links.resolvedSymbol; } function isInTypeQuery(node) { while (node) { switch (node.kind) { - case 142: + case 144: return true; - case 64: - case 125: + case 65: + case 126: node = node.parent; continue; default: @@ -12303,12 +13189,12 @@ var ts; } return links.assignmentChecks[symbol.id] = isAssignedIn(node); function isAssignedInBinaryExpression(node) { - if (node.operatorToken.kind >= 52 && node.operatorToken.kind <= 63) { + if (node.operatorToken.kind >= 53 && node.operatorToken.kind <= 64) { var n = node.left; - while (n.kind === 159) { + while (n.kind === 161) { n = n.expression; } - if (n.kind === 64 && getResolvedSymbol(n) === symbol) { + if (n.kind === 65 && getResolvedSymbol(n) === symbol) { return true; } } @@ -12322,46 +13208,46 @@ var ts; } function isAssignedIn(node) { switch (node.kind) { - case 167: + case 169: return isAssignedInBinaryExpression(node); - case 193: - case 150: - return isAssignedInVariableDeclaration(node); - case 148: - case 149: - case 151: + case 198: case 152: + return isAssignedInVariableDeclaration(node); + case 150: + case 151: case 153: case 154: case 155: case 156: + case 157: case 158: - case 159: - case 165: - case 162: - case 163: + case 160: + case 161: + case 167: case 164: + case 165: case 166: case 168: - case 171: - case 174: - case 175: - case 177: - case 178: + case 170: + case 173: case 179: case 180: - case 181: case 182: case 183: + case 184: + case 185: case 186: case 187: case 188: - case 214: - case 215: - case 189: - case 190: case 191: - case 217: + case 192: + case 193: + case 220: + case 221: + case 194: + case 195: + case 196: + case 223: return ts.forEachChild(node, isAssignedIn); } return false; @@ -12369,10 +13255,10 @@ var ts; } function resolveLocation(node) { var containerNodes = []; - for (var _parent = node.parent; _parent; _parent = _parent.parent) { - if ((ts.isExpression(_parent) || ts.isObjectLiteralMethod(node)) && - isContextSensitive(_parent)) { - containerNodes.unshift(_parent); + for (var parent_3 = node.parent; parent_3; parent_3 = parent_3.parent) { + if ((ts.isExpression(parent_3) || ts.isObjectLiteralMethod(node)) && + isContextSensitive(parent_3)) { + containerNodes.unshift(parent_3); } } ts.forEach(containerNodes, function (node) { getTypeOfNode(node); }); @@ -12397,17 +13283,17 @@ var ts; node = node.parent; var narrowedType = type; switch (node.kind) { - case 178: + case 183: if (child !== node.expression) { narrowedType = narrowType(type, node.expression, child === node.thenStatement); } break; - case 168: + case 170: if (child !== node.condition) { narrowedType = narrowType(type, node.condition, child === node.whenTrue); } break; - case 167: + case 169: if (child === node.right) { if (node.operatorToken.kind === 48) { narrowedType = narrowType(type, node.left, true); @@ -12417,14 +13303,14 @@ var ts; } } break; - case 221: + case 227: + case 205: case 200: - case 195: - case 132: - case 131: case 134: - case 135: case 133: + case 136: + case 137: + case 135: break loop; } if (narrowedType !== type) { @@ -12437,12 +13323,12 @@ var ts; } return type; function narrowTypeByEquality(type, expr, assumeTrue) { - if (expr.left.kind !== 163 || expr.right.kind !== 8) { + if (expr.left.kind !== 165 || expr.right.kind !== 8) { return type; } var left = expr.left; var right = expr.right; - if (left.expression.kind !== 64 || getResolvedSymbol(left.expression) !== symbol) { + if (left.expression.kind !== 65 || getResolvedSymbol(left.expression) !== symbol) { return type; } var typeInfo = primitiveTypeInfo[right.text]; @@ -12488,7 +13374,7 @@ var ts; } } function narrowTypeByInstanceof(type, expr, assumeTrue) { - if (type.flags & 1 || !assumeTrue || expr.left.kind !== 64 || getResolvedSymbol(expr.left) !== symbol) { + if (type.flags & 1 || !assumeTrue || expr.left.kind !== 65 || getResolvedSymbol(expr.left) !== symbol) { return type; } var rightType = checkExpression(expr.right); @@ -12510,9 +13396,9 @@ var ts; } function narrowType(type, expr, assumeTrue) { switch (expr.kind) { - case 159: + case 161: return narrowType(type, expr.expression, assumeTrue); - case 167: + case 169: var operator = expr.operatorToken.kind; if (operator === 30 || operator === 31) { return narrowTypeByEquality(type, expr, assumeTrue); @@ -12523,11 +13409,11 @@ var ts; else if (operator === 49) { return narrowTypeByOr(type, expr, assumeTrue); } - else if (operator === 86) { + else if (operator === 87) { return narrowTypeByInstanceof(type, expr, assumeTrue); } break; - case 165: + case 167: if (expr.operator === 46) { return narrowType(type, expr.operand, !assumeTrue); } @@ -12538,7 +13424,7 @@ var ts; } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); - if (symbol === argumentsSymbol && ts.getContainingFunction(node).kind === 161) { + if (symbol === argumentsSymbol && ts.getContainingFunction(node).kind === 163) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression); } if (symbol.flags & 8388608 && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { @@ -12562,15 +13448,15 @@ var ts; function checkBlockScopedBindingCapturedInLoop(node, symbol) { if (languageVersion >= 2 || (symbol.flags & 2) === 0 || - symbol.valueDeclaration.parent.kind === 217) { + symbol.valueDeclaration.parent.kind === 223) { return; } var container = symbol.valueDeclaration; - while (container.kind !== 194) { + while (container.kind !== 199) { container = container.parent; } container = container.parent; - if (container.kind === 175) { + if (container.kind === 180) { container = container.parent; } var inFunction = isInsideFunction(node.parent, container); @@ -12587,9 +13473,9 @@ var ts; } } function captureLexicalThis(node, container) { - var classNode = container.parent && container.parent.kind === 196 ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 201 ? container.parent : undefined; getNodeLinks(node).flags |= 2; - if (container.kind === 130 || container.kind === 133) { + if (container.kind === 132 || container.kind === 135) { getNodeLinks(classNode).flags |= 4; } else { @@ -12599,36 +13485,36 @@ var ts; function checkThisExpression(node) { var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; - if (container.kind === 161) { + if (container.kind === 163) { container = ts.getThisContainer(container, false); needToCaptureLexicalThis = (languageVersion < 2); } switch (container.kind) { - case 200: + case 205: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_body); break; - case 199: + case 204: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); break; - case 133: + case 135: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; - case 130: - case 129: + case 132: + case 131: if (container.flags & 128) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } break; - case 126: + case 127: 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 === 196 ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 201 ? container.parent : undefined; if (classNode) { var symbol = getSymbolOfNode(classNode); return container.flags & 128 ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); @@ -12637,17 +13523,17 @@ var ts; } function isInConstructorArgumentInitializer(node, constructorDecl) { for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 128) { + if (n.kind === 129) { return true; } } return false; } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 155 && node.parent.expression === node; - var enclosingClass = ts.getAncestor(node, 196); + var isCallExpression = node.parent.kind === 157 && node.parent.expression === node; + var enclosingClass = ts.getAncestor(node, 201); var baseClass; - if (enclosingClass && ts.getClassBaseTypeNode(enclosingClass)) { + if (enclosingClass && ts.getClassExtendsHeritageClauseElement(enclosingClass)) { var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); baseClass = classType.baseTypes.length && classType.baseTypes[0]; } @@ -12660,31 +13546,31 @@ var ts; var canUseSuperExpression = false; var needToCaptureLexicalThis; if (isCallExpression) { - canUseSuperExpression = container.kind === 133; + canUseSuperExpression = container.kind === 135; } else { needToCaptureLexicalThis = false; - while (container && container.kind === 161) { + while (container && container.kind === 163) { container = ts.getSuperContainer(container, true); needToCaptureLexicalThis = true; } - if (container && container.parent && container.parent.kind === 196) { + if (container && container.parent && container.parent.kind === 201) { if (container.flags & 128) { canUseSuperExpression = - container.kind === 132 || - container.kind === 131 || - container.kind === 134 || - container.kind === 135; + container.kind === 134 || + container.kind === 133 || + container.kind === 136 || + container.kind === 137; } else { canUseSuperExpression = - container.kind === 132 || + container.kind === 134 || + container.kind === 133 || + container.kind === 136 || + container.kind === 137 || + container.kind === 132 || container.kind === 131 || - container.kind === 134 || - container.kind === 135 || - container.kind === 130 || - container.kind === 129 || - container.kind === 133; + container.kind === 135; } } } @@ -12698,7 +13584,7 @@ var ts; getNodeLinks(node).flags |= 16; returnType = baseClass; } - if (container.kind === 133 && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 135 && isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); returnType = unknownType; } @@ -12708,7 +13594,7 @@ var ts; return returnType; } } - if (container.kind === 126) { + if (container.kind === 127) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { @@ -12744,9 +13630,9 @@ var ts; var declaration = node.parent; if (node === declaration.initializer) { if (declaration.type) { - return getTypeFromTypeNode(declaration.type); + return getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); } - if (declaration.kind === 128) { + if (declaration.kind === 129) { var type = getContextuallyTypedParameterType(declaration); if (type) { return type; @@ -12761,7 +13647,7 @@ var ts; function getContextualTypeForReturnExpression(node) { var func = ts.getContainingFunction(node); if (func) { - if (func.type || func.kind === 133 || func.kind === 134 && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(func.symbol, 135))) { + if (func.type || func.kind === 135 || func.kind === 136 && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(func.symbol, 137))) { return getReturnTypeOfSignature(getSignatureFromDeclaration(func)); } var signature = getContextualSignatureForFunctionLikeDeclaration(func); @@ -12781,7 +13667,7 @@ var ts; return undefined; } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 157) { + if (template.parent.kind === 159) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -12789,7 +13675,7 @@ var ts; function getContextualTypeForBinaryOperand(node) { var binaryExpression = node.parent; var operator = binaryExpression.operatorToken.kind; - if (operator >= 52 && operator <= 63) { + if (operator >= 53 && operator <= 64) { if (node === binaryExpression.right) { return checkExpression(binaryExpression.left); } @@ -12810,7 +13696,7 @@ var ts; var types = type.types; var mappedType; var mappedTypes; - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var current = types[_i]; var t = mapper(current); if (t) { @@ -12887,35 +13773,35 @@ var ts; if (node.contextualType) { return node.contextualType; } - var _parent = node.parent; - switch (_parent.kind) { - case 193: - case 128: - case 130: + var parent = node.parent; + switch (parent.kind) { + case 198: case 129: - case 150: + case 132: + case 131: + case 152: return getContextualTypeForInitializerExpression(node); - case 161: - case 186: + case 163: + case 191: return getContextualTypeForReturnExpression(node); - case 155: - case 156: - return getContextualTypeForArgument(_parent, node); + case 157: case 158: - return getTypeFromTypeNode(_parent.type); - case 167: + return getContextualTypeForArgument(parent, node); + case 160: + return getTypeFromTypeNodeOrHeritageClauseElement(parent.type); + case 169: return getContextualTypeForBinaryOperand(node); - case 218: - return getContextualTypeForObjectLiteralElement(_parent); - case 151: + case 224: + return getContextualTypeForObjectLiteralElement(parent); + case 153: return getContextualTypeForElementExpression(node); - case 168: + case 170: return getContextualTypeForConditionalOperand(node); - case 173: - ts.Debug.assert(_parent.parent.kind === 169); - return getContextualTypeForSubstitutionExpression(_parent.parent, node); - case 159: - return getContextualType(_parent); + case 176: + ts.Debug.assert(parent.parent.kind === 171); + return getContextualTypeForSubstitutionExpression(parent.parent, node); + case 161: + return getContextualType(parent); } return undefined; } @@ -12929,13 +13815,13 @@ var ts; } } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 160 || node.kind === 161; + return node.kind === 162 || node.kind === 163; } function getContextualSignatureForFunctionLikeDeclaration(node) { return isFunctionExpressionOrArrowFunction(node) ? getContextualSignature(node) : undefined; } function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 132 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); var type = ts.isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node) : getContextualType(node); @@ -12947,7 +13833,7 @@ var ts; } var signatureList; var types = type.types; - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var current = types[_i]; if (signatureList && getSignaturesOfObjectOrUnionType(current, 0).length > 1) { @@ -12978,15 +13864,15 @@ var ts; return mapper && mapper !== identityMapper; } function isAssignmentTarget(node) { - var _parent = node.parent; - if (_parent.kind === 167 && _parent.operatorToken.kind === 52 && _parent.left === node) { + var parent = node.parent; + if (parent.kind === 169 && parent.operatorToken.kind === 53 && parent.left === node) { return true; } - if (_parent.kind === 218) { - return isAssignmentTarget(_parent.parent); + if (parent.kind === 224) { + return isAssignmentTarget(parent.parent); } - if (_parent.kind === 151) { - return isAssignmentTarget(_parent); + if (parent.kind === 153) { + return isAssignmentTarget(parent); } return false; } @@ -13007,7 +13893,7 @@ var ts; var elementTypes = []; ts.forEach(elements, function (e) { var type = checkExpression(e, contextualMapper); - if (e.kind === 171) { + if (e.kind === 173) { elementTypes.push(getIndexTypeOfType(type, 1) || anyType); hasSpreadElement = true; } @@ -13024,7 +13910,7 @@ var ts; return createArrayType(getUnionType(elementTypes)); } function isNumericName(name) { - return name.kind === 126 ? isNumericComputedName(name) : isNumericLiteralName(name.text); + return name.kind === 127 ? isNumericComputedName(name) : isNumericLiteralName(name.text); } function isNumericComputedName(name) { return allConstituentTypesHaveKind(checkComputedPropertyName(name), 1 | 132); @@ -13051,22 +13937,22 @@ var ts; var propertiesArray = []; var contextualType = getContextualType(node); var typeFlags; - for (var _i = 0, _a = node.properties, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var memberDecl = _a[_i]; var member = memberDecl.symbol; - if (memberDecl.kind === 218 || - memberDecl.kind === 219 || + if (memberDecl.kind === 224 || + memberDecl.kind === 225 || ts.isObjectLiteralMethod(memberDecl)) { var type = void 0; - if (memberDecl.kind === 218) { + if (memberDecl.kind === 224) { type = checkPropertyAssignment(memberDecl, contextualMapper); } - else if (memberDecl.kind === 132) { + else if (memberDecl.kind === 134) { type = checkObjectLiteralMethod(memberDecl, contextualMapper); } else { - ts.Debug.assert(memberDecl.kind === 219); - type = memberDecl.name.kind === 126 + ts.Debug.assert(memberDecl.kind === 225); + type = memberDecl.name.kind === 127 ? unknownType : checkExpression(memberDecl.name, contextualMapper); } @@ -13082,7 +13968,7 @@ var ts; member = prop; } else { - ts.Debug.assert(memberDecl.kind === 134 || memberDecl.kind === 135); + ts.Debug.assert(memberDecl.kind === 136 || memberDecl.kind === 137); checkAccessorDeclaration(memberDecl); } if (!ts.hasDynamicName(memberDecl)) { @@ -13101,21 +13987,21 @@ var ts; for (var i = 0; i < propertiesArray.length; i++) { var propertyDecl = node.properties[i]; if (kind === 0 || isNumericName(propertyDecl.name)) { - var _type = getTypeOfSymbol(propertiesArray[i]); - if (!ts.contains(propTypes, _type)) { - propTypes.push(_type); + var type = getTypeOfSymbol(propertiesArray[i]); + if (!ts.contains(propTypes, type)) { + propTypes.push(type); } } } - var _result = propTypes.length ? getUnionType(propTypes) : undefinedType; - typeFlags |= _result.flags; - return _result; + var result_1 = propTypes.length ? getUnionType(propTypes) : undefinedType; + typeFlags |= result_1.flags; + return result_1; } return undefined; } } function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 130; + return s.valueDeclaration ? s.valueDeclaration.kind : 132; } function getDeclarationFlagsFromSymbol(s) { return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : s.flags & 134217728 ? 16 | 128 : 0; @@ -13125,7 +14011,7 @@ var ts; if (!(flags & (32 | 64))) { return; } - var enclosingClassDeclaration = ts.getAncestor(node, 196); + var enclosingClassDeclaration = ts.getAncestor(node, 201); var enclosingClass = enclosingClassDeclaration ? getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClassDeclaration)) : undefined; var declaringClass = getDeclaredTypeOfSymbol(prop.parent); if (flags & 32) { @@ -13134,7 +14020,7 @@ var ts; } return; } - if (left.kind === 90) { + if (left.kind === 91) { return; } if (!enclosingClass || !hasBaseType(enclosingClass, declaringClass)) { @@ -13172,7 +14058,7 @@ var ts; } getNodeLinks(node).resolvedSymbol = prop; if (prop.parent && prop.parent.flags & 32) { - if (left.kind === 90 && getDeclarationKindFromSymbol(prop) !== 132) { + if (left.kind === 91 && getDeclarationKindFromSymbol(prop) !== 134) { error(right, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); } else { @@ -13184,14 +14070,14 @@ var ts; return anyType; } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 153 + var left = node.kind === 155 ? 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 === 90 && getDeclarationKindFromSymbol(prop) !== 132) { + if (left.kind === 91 && getDeclarationKindFromSymbol(prop) !== 134) { return false; } else { @@ -13206,15 +14092,15 @@ var ts; function checkIndexedAccess(node) { if (!node.argumentExpression) { var sourceFile = getSourceFile(node); - if (node.parent.kind === 156 && node.parent.expression === node) { + if (node.parent.kind === 158 && 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); } else { - var _start = node.end - "]".length; - var _end = node.end; - grammarErrorAtPos(sourceFile, _start, _end - _start, ts.Diagnostics.Expression_expected); + var start = node.end - "]".length; + var end = node.end; + grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Expression_expected); } } var objectType = getApparentType(checkExpression(node.expression)); @@ -13229,15 +14115,15 @@ var ts; return unknownType; } if (node.argumentExpression) { - var _name = getPropertyNameForIndexedAccess(node.argumentExpression, indexType); - if (_name !== undefined) { - var prop = getPropertyOfType(objectType, _name); + var name_6 = getPropertyNameForIndexedAccess(node.argumentExpression, indexType); + if (name_6 !== undefined) { + var prop = getPropertyOfType(objectType, name_6); if (prop) { getNodeLinks(node).resolvedSymbol = prop; return getTypeOfSymbol(prop); } else if (isConstEnum) { - error(node.argumentExpression, ts.Diagnostics.Property_0_does_not_exist_on_const_enum_1, _name, symbolToString(objectType.symbol)); + error(node.argumentExpression, ts.Diagnostics.Property_0_does_not_exist_on_const_enum_1, name_6, symbolToString(objectType.symbol)); return unknownType; } } @@ -13302,7 +14188,7 @@ var ts; return true; } function resolveUntypedCall(node) { - if (node.kind === 157) { + if (node.kind === 159) { checkExpression(node.template); } else { @@ -13324,22 +14210,22 @@ var ts; var specializedIndex = -1; var spliceIndex; ts.Debug.assert(!result.length); - for (var _i = 0, _n = signatures.length; _i < _n; _i++) { + for (var _i = 0; _i < signatures.length; _i++) { var signature = signatures[_i]; var symbol = signature.declaration && getSymbolOfNode(signature.declaration); - var _parent = signature.declaration && signature.declaration.parent; + var parent_4 = signature.declaration && signature.declaration.parent; if (!lastSymbol || symbol === lastSymbol) { - if (lastParent && _parent === lastParent) { + if (lastParent && parent_4 === lastParent) { index++; } else { - lastParent = _parent; + lastParent = parent_4; index = cutoffIndex; } } else { index = cutoffIndex = result.length; - lastParent = _parent; + lastParent = parent_4; } lastSymbol = symbol; if (signature.hasStringLiterals) { @@ -13355,7 +14241,7 @@ var ts; } function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { - if (args[i].kind === 171) { + if (args[i].kind === 173) { return i; } } @@ -13365,15 +14251,15 @@ var ts; var adjustedArgCount; var typeArguments; var callIsIncomplete; - if (node.kind === 157) { + if (node.kind === 159) { var tagExpression = node; adjustedArgCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === 169) { + if (tagExpression.template.kind === 171) { var templateExpression = tagExpression.template; var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans); ts.Debug.assert(lastSpan !== undefined); - callIsIncomplete = ts.getFullWidth(lastSpan.literal) === 0 || !!lastSpan.literal.isUnterminated; + callIsIncomplete = ts.nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated; } else { var templateLiteral = tagExpression.template; @@ -13384,7 +14270,7 @@ var ts; else { var callExpression = node; if (!callExpression.arguments) { - ts.Debug.assert(callExpression.kind === 156); + ts.Debug.assert(callExpression.kind === 158); return signature.minArgumentCount === 0; } adjustedArgCount = callExpression.arguments.hasTrailingComma ? args.length + 1 : args.length; @@ -13423,16 +14309,23 @@ var ts; }); return getSignatureInstantiation(signature, getInferredTypes(context)); } - function inferTypeArguments(signature, args, excludeArgument) { + function inferTypeArguments(signature, args, excludeArgument, context) { var typeParameters = signature.typeParameters; - var context = createInferenceContext(typeParameters, false); var inferenceMapper = createInferenceMapper(context); + for (var i = 0; i < typeParameters.length; i++) { + if (!context.inferences[i].isFixed) { + context.inferredTypes[i] = undefined; + } + } + if (context.failedTypeParameterIndex !== undefined && !context.inferences[context.failedTypeParameterIndex].isFixed) { + context.failedTypeParameterIndex = undefined; + } for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg.kind !== 172) { - var paramType = getTypeAtPosition(signature, arg.kind === 171 ? -1 : i); + if (arg.kind !== 175) { + var paramType = getTypeAtPosition(signature, arg.kind === 173 ? -1 : i); var argType = void 0; - if (i === 0 && args[i].parent.kind === 157) { + if (i === 0 && args[i].parent.kind === 159) { argType = globalTemplateStringsArrayType; } else { @@ -13443,29 +14336,22 @@ var ts; } } if (excludeArgument) { - for (var _i = 0; _i < args.length; _i++) { - if (excludeArgument[_i] === false) { - var _arg = args[_i]; - var _paramType = getTypeAtPosition(signature, _arg.kind === 171 ? -1 : _i); - inferTypes(context, checkExpressionWithContextualType(_arg, _paramType, inferenceMapper), _paramType); + for (var i = 0; i < args.length; i++) { + if (excludeArgument[i] === false) { + var arg = args[i]; + var paramType = getTypeAtPosition(signature, arg.kind === 173 ? -1 : i); + inferTypes(context, checkExpressionWithContextualType(arg, paramType, inferenceMapper), paramType); } } } - var inferredTypes = getInferredTypes(context); - context.failedTypeParameterIndex = ts.indexOf(inferredTypes, inferenceFailureType); - for (var _i_1 = 0; _i_1 < inferredTypes.length; _i_1++) { - if (inferredTypes[_i_1] === inferenceFailureType) { - inferredTypes[_i_1] = unknownType; - } - } - return context; + getInferredTypes(context); } function checkTypeArguments(signature, typeArguments, typeArgumentResultTypes, reportErrors) { var typeParameters = signature.typeParameters; var typeArgumentsAreAssignable = true; for (var i = 0; i < typeParameters.length; i++) { var typeArgNode = typeArguments[i]; - var typeArgument = getTypeFromTypeNode(typeArgNode); + var typeArgument = getTypeFromTypeNodeOrHeritageClauseElement(typeArgNode); typeArgumentResultTypes[i] = typeArgument; if (typeArgumentsAreAssignable) { var constraint = getConstraintOfTypeParameter(typeParameters[i]); @@ -13479,9 +14365,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 !== 172) { - var paramType = getTypeAtPosition(signature, arg.kind === 171 ? -1 : i); - var argType = i === 0 && node.kind === 157 ? globalTemplateStringsArrayType : + if (arg.kind !== 175) { + var paramType = getTypeAtPosition(signature, arg.kind === 173 ? -1 : i); + var argType = i === 0 && node.kind === 159 ? globalTemplateStringsArrayType : arg.kind === 8 && !reportErrors ? getStringLiteralType(arg) : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); if (!checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1)) { @@ -13493,10 +14379,10 @@ var ts; } function getEffectiveCallArguments(node) { var args; - if (node.kind === 157) { + if (node.kind === 159) { var template = node.template; args = [template]; - if (template.kind === 169) { + if (template.kind === 171) { ts.forEach(template.templateSpans, function (span) { args.push(span.expression); }); @@ -13508,9 +14394,9 @@ var ts; return args; } function getEffectiveTypeArguments(callExpression) { - if (callExpression.expression.kind === 90) { - var containingClass = ts.getAncestor(callExpression, 196); - var baseClassTypeNode = containingClass && ts.getClassBaseTypeNode(containingClass); + if (callExpression.expression.kind === 91) { + var containingClass = ts.getAncestor(callExpression, 201); + var baseClassTypeNode = containingClass && ts.getClassExtendsHeritageClauseElement(containingClass); return baseClassTypeNode && baseClassTypeNode.typeArguments; } else { @@ -13518,11 +14404,11 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray) { - var isTaggedTemplate = node.kind === 157; + var isTaggedTemplate = node.kind === 159; var typeArguments; if (!isTaggedTemplate) { typeArguments = getEffectiveTypeArguments(node); - if (node.expression.kind !== 90) { + if (node.expression.kind !== 91) { ts.forEach(typeArguments, checkSourceElement); } } @@ -13577,7 +14463,7 @@ var ts; error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); } if (!produceDiagnostics) { - for (var _i = 0, _n = candidates.length; _i < _n; _i++) { + for (var _i = 0; _i < candidates.length; _i++) { var candidate = candidates[_i]; if (hasCorrectArity(node, args, candidate)) { return candidate; @@ -13586,56 +14472,57 @@ var ts; } return resolveErrorCall(node); function chooseOverload(candidates, relation) { - for (var _a = 0, _b = candidates.length; _a < _b; _a++) { - var current = candidates[_a]; - if (!hasCorrectArity(node, args, current)) { + for (var _i = 0; _i < candidates.length; _i++) { + var originalCandidate = candidates[_i]; + if (!hasCorrectArity(node, args, originalCandidate)) { continue; } - var originalCandidate = current; - var inferenceResult = void 0; - var _candidate = void 0; + var candidate = void 0; var typeArgumentsAreValid = void 0; + var inferenceContext = originalCandidate.typeParameters + ? createInferenceContext(originalCandidate.typeParameters, false) + : undefined; while (true) { - _candidate = originalCandidate; - if (_candidate.typeParameters) { + candidate = originalCandidate; + if (candidate.typeParameters) { var typeArgumentTypes = void 0; if (typeArguments) { - typeArgumentTypes = new Array(_candidate.typeParameters.length); - typeArgumentsAreValid = checkTypeArguments(_candidate, typeArguments, typeArgumentTypes, false); + typeArgumentTypes = new Array(candidate.typeParameters.length); + typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, false); } else { - inferenceResult = inferTypeArguments(_candidate, args, excludeArgument); - typeArgumentsAreValid = inferenceResult.failedTypeParameterIndex < 0; - typeArgumentTypes = inferenceResult.inferredTypes; + inferTypeArguments(candidate, args, excludeArgument, inferenceContext); + typeArgumentsAreValid = inferenceContext.failedTypeParameterIndex === undefined; + typeArgumentTypes = inferenceContext.inferredTypes; } if (!typeArgumentsAreValid) { break; } - _candidate = getSignatureInstantiation(_candidate, typeArgumentTypes); + candidate = getSignatureInstantiation(candidate, typeArgumentTypes); } - if (!checkApplicableSignature(node, args, _candidate, relation, excludeArgument, false)) { + if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, false)) { break; } var index = excludeArgument ? ts.indexOf(excludeArgument, true) : -1; if (index < 0) { - return _candidate; + return candidate; } excludeArgument[index] = false; } if (originalCandidate.typeParameters) { - var instantiatedCandidate = _candidate; + var instantiatedCandidate = candidate; if (typeArgumentsAreValid) { candidateForArgumentError = instantiatedCandidate; } else { candidateForTypeArgumentError = originalCandidate; if (!typeArguments) { - resultOfFailedInference = inferenceResult; + resultOfFailedInference = inferenceContext; } } } else { - ts.Debug.assert(originalCandidate === _candidate); + ts.Debug.assert(originalCandidate === candidate); candidateForArgumentError = originalCandidate; } } @@ -13643,7 +14530,7 @@ var ts; } } function resolveCallExpression(node, candidatesOutArray) { - if (node.expression.kind === 90) { + if (node.expression.kind === 91) { var superType = checkSuperExpression(node.expression); if (superType !== unknownType) { return resolveCall(node, getSignaturesOfType(superType, 1), candidatesOutArray); @@ -13727,13 +14614,13 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - if (node.kind === 155) { + if (node.kind === 157) { links.resolvedSignature = resolveCallExpression(node, candidatesOutArray); } - else if (node.kind === 156) { + else if (node.kind === 158) { links.resolvedSignature = resolveNewExpression(node, candidatesOutArray); } - else if (node.kind === 157) { + else if (node.kind === 159) { links.resolvedSignature = resolveTaggedTemplateExpression(node, candidatesOutArray); } else { @@ -13745,15 +14632,15 @@ var ts; function checkCallExpression(node) { checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node, node.arguments); var signature = getResolvedSignature(node); - if (node.expression.kind === 90) { + if (node.expression.kind === 91) { return voidType; } - if (node.kind === 156) { + if (node.kind === 158) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 133 && - declaration.kind !== 137 && - declaration.kind !== 141) { + declaration.kind !== 135 && + declaration.kind !== 139 && + declaration.kind !== 143) { if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } @@ -13767,7 +14654,7 @@ var ts; } function checkTypeAssertion(node) { var exprType = checkExpression(node.expression); - var targetType = getTypeFromTypeNode(node.type); + var targetType = getTypeFromTypeNodeOrHeritageClauseElement(node.type); if (produceDiagnostics && targetType !== unknownType) { var widenedType = getWidenedType(exprType); if (!(isTypeAssignableTo(targetType, widenedType))) { @@ -13794,9 +14681,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 _links = getSymbolLinks(_parameter); - _links.type = instantiateType(getTypeOfSymbol(context.parameters[context.parameters.length - 1]), mapper); + var parameter = signature.parameters[signature.parameters.length - 1]; + var links = getSymbolLinks(parameter); + links.type = instantiateType(getTypeOfSymbol(context.parameters[context.parameters.length - 1]), mapper); } } function getReturnTypeFromBody(func, contextualMapper) { @@ -13805,7 +14692,7 @@ var ts; return unknownType; } var type; - if (func.body.kind !== 174) { + if (func.body.kind !== 179) { type = checkExpressionCached(func.body, contextualMapper); } else { @@ -13843,7 +14730,7 @@ var ts; }); } function bodyContainsSingleThrowStatement(body) { - return (body.statements.length === 1) && (body.statements[0].kind === 190); + return (body.statements.length === 1) && (body.statements[0].kind === 195); } function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func, returnType) { if (!produceDiagnostics) { @@ -13852,7 +14739,7 @@ var ts; if (returnType === voidType || returnType === anyType) { return; } - if (ts.nodeIsMissing(func.body) || func.body.kind !== 174) { + if (ts.nodeIsMissing(func.body) || func.body.kind !== 179) { return; } var bodyBlock = func.body; @@ -13865,9 +14752,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 !== 132 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 160) { + if (!hasGrammarError && node.kind === 162) { checkGrammarFunctionName(node.name) || checkGrammarForGenerator(node); } if (contextualMapper === identityMapper && isContextSensitive(node)) { @@ -13895,25 +14782,25 @@ var ts; checkSignatureDeclaration(node); } } - if (produceDiagnostics && node.kind !== 132 && node.kind !== 131) { + if (produceDiagnostics && node.kind !== 134 && node.kind !== 133) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); } return type; } function checkFunctionExpressionOrObjectLiteralMethodBody(node) { - ts.Debug.assert(node.kind !== 132 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); if (node.type) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); + checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type)); } if (node.body) { - if (node.body.kind === 174) { + if (node.body.kind === 179) { checkSourceElement(node.body); } else { var exprType = checkExpression(node.body); if (node.type) { - checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, undefined); + checkTypeAssignableTo(exprType, getTypeFromTypeNodeOrHeritageClauseElement(node.type), node.body, undefined); } checkFunctionExpressionBodies(node.body); } @@ -13933,17 +14820,17 @@ var ts; } function isReferenceOrErrorExpression(n) { switch (n.kind) { - case 64: { + case 65: { var symbol = findSymbol(n); return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3) !== 0; } - case 153: { - var _symbol = findSymbol(n); - return !_symbol || _symbol === unknownSymbol || (_symbol.flags & ~8) !== 0; + case 155: { + var symbol = findSymbol(n); + return !symbol || symbol === unknownSymbol || (symbol.flags & ~8) !== 0; } - case 154: + case 156: return true; - case 159: + case 161: return isReferenceOrErrorExpression(n.expression); default: return false; @@ -13951,22 +14838,22 @@ var ts; } function isConstVariableReference(n) { switch (n.kind) { - case 64: - case 153: { + case 65: + case 155: { var symbol = findSymbol(n); return symbol && (symbol.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 8192) !== 0; } - case 154: { + case 156: { var index = n.argumentExpression; - var _symbol = findSymbol(n.expression); - if (_symbol && index && index.kind === 8) { - var _name = index.text; - var prop = getPropertyOfType(getTypeOfSymbol(_symbol), _name); + var symbol = findSymbol(n.expression); + if (symbol && index && index.kind === 8) { + var name_7 = index.text; + var prop = getPropertyOfType(getTypeOfSymbol(symbol), name_7); return prop && (prop.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(prop) & 8192) !== 0; } return false; } - case 159: + case 161: return isConstVariableReference(n.expression); default: return false; @@ -13983,7 +14870,7 @@ var ts; return true; } function checkDeleteExpression(node) { - if (node.parserContextFlags & 1 && node.expression.kind === 64) { + if (node.parserContextFlags & 1 && node.expression.kind === 65) { grammarErrorOnNode(node.expression, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode); } var operandType = checkExpression(node.expression); @@ -14037,7 +14924,7 @@ var ts; } if (type.flags & 16384) { var types = type.types; - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var current = types[_i]; if (current.flags & kind) { return true; @@ -14053,7 +14940,7 @@ var ts; } if (type.flags & 16384) { var types = type.types; - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var current = types[_i]; if (!(current.flags & kind)) { return false; @@ -14089,19 +14976,19 @@ var ts; } function checkObjectLiteralAssignment(node, sourceType, contextualMapper) { var properties = node.properties; - for (var _i = 0, _n = properties.length; _i < _n; _i++) { + for (var _i = 0; _i < properties.length; _i++) { var p = properties[_i]; - if (p.kind === 218 || p.kind === 219) { - var _name = p.name; + if (p.kind === 224 || p.kind === 225) { + var name_8 = p.name; var type = sourceType.flags & 1 ? sourceType : - getTypeOfPropertyOfType(sourceType, _name.text) || - isNumericLiteralName(_name.text) && getIndexTypeOfType(sourceType, 1) || + getTypeOfPropertyOfType(sourceType, name_8.text) || + isNumericLiteralName(name_8.text) && getIndexTypeOfType(sourceType, 1) || getIndexTypeOfType(sourceType, 0); if (type) { - checkDestructuringAssignment(p.initializer || _name, type); + checkDestructuringAssignment(p.initializer || name_8, type); } else { - error(_name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(sourceType), ts.declarationNameToString(_name)); + error(name_8, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(sourceType), ts.declarationNameToString(name_8)); } } else { @@ -14118,8 +15005,8 @@ var ts; var elements = node.elements; for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 172) { - if (e.kind !== 171) { + if (e.kind !== 175) { + if (e.kind !== 173) { var propName = "" + i; var type = sourceType.flags & 1 ? sourceType : isTupleLikeType(sourceType) ? getTypeOfPropertyOfType(sourceType, propName) : @@ -14149,14 +15036,14 @@ var ts; return sourceType; } function checkDestructuringAssignment(target, sourceType, contextualMapper) { - if (target.kind === 167 && target.operatorToken.kind === 52) { + if (target.kind === 169 && target.operatorToken.kind === 53) { checkBinaryExpression(target, contextualMapper); target = target.left; } - if (target.kind === 152) { + if (target.kind === 154) { return checkObjectLiteralAssignment(target, sourceType, contextualMapper); } - if (target.kind === 151) { + if (target.kind === 153) { return checkArrayLiteralAssignment(target, sourceType, contextualMapper); } return checkReferenceAssignment(target, sourceType, contextualMapper); @@ -14173,32 +15060,32 @@ var ts; checkGrammarEvalOrArgumentsInStrictMode(node, node.left); } var operator = node.operatorToken.kind; - if (operator === 52 && (node.left.kind === 152 || node.left.kind === 151)) { + if (operator === 53 && (node.left.kind === 154 || node.left.kind === 153)) { return checkDestructuringAssignment(node.left, checkExpression(node.right, contextualMapper), contextualMapper); } var leftType = checkExpression(node.left, contextualMapper); var rightType = checkExpression(node.right, contextualMapper); switch (operator) { case 35: - case 55: - case 36: case 56: - case 37: + case 36: case 57: - case 34: - case 54: - case 40: + case 37: case 58: - case 41: + case 34: + case 55: + case 40: case 59: - case 42: + case 41: case 60: - case 44: - case 62: - case 45: - case 63: - case 43: + case 42: case 61: + case 44: + case 63: + case 45: + case 64: + case 43: + case 62: if (leftType.flags & (32 | 64)) leftType = rightType; if (rightType.flags & (32 | 64)) @@ -14218,7 +15105,7 @@ var ts; } return numberType; case 33: - case 53: + case 54: if (leftType.flags & (32 | 64)) leftType = rightType; if (rightType.flags & (32 | 64)) @@ -14242,7 +15129,7 @@ var ts; reportOperatorError(); return anyType; } - if (operator === 53) { + if (operator === 54) { checkAssignmentOperator(resultType); } return resultType; @@ -14261,15 +15148,15 @@ var ts; reportOperatorError(); } return booleanType; - case 86: + case 87: return checkInstanceOfExpression(node, leftType, rightType); - case 85: + case 86: return checkInExpression(node, leftType, rightType); case 48: return rightType; case 49: return getUnionType([leftType, rightType]); - case 52: + case 53: checkAssignmentOperator(rightType); return rightType; case 23: @@ -14288,20 +15175,20 @@ var ts; function getSuggestedBooleanOperator(operator) { switch (operator) { case 44: - case 62: + case 63: return 49; case 45: - case 63: + case 64: return 31; case 43: - case 61: + case 62: return 48; default: return undefined; } } function checkAssignmentOperator(valueType) { - if (produceDiagnostics && operator >= 52 && operator <= 63) { + if (produceDiagnostics && operator >= 53 && operator <= 64) { var ok = checkReferenceExpression(node.left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression, ts.Diagnostics.Left_hand_side_of_assignment_expression_cannot_be_a_constant); if (ok) { checkTypeAssignableTo(valueType, leftType, node.left, undefined); @@ -14347,14 +15234,14 @@ var ts; return links.resolvedType; } function checkPropertyAssignment(node, contextualMapper) { - if (node.name.kind === 126) { + if (node.name.kind === 127) { checkComputedPropertyName(node.name); } return checkExpression(node.initializer, contextualMapper); } function checkObjectLiteralMethod(node, contextualMapper) { checkGrammarMethod(node); - if (node.name.kind === 126) { + if (node.name.kind === 127) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); @@ -14380,7 +15267,7 @@ var ts; } function checkExpressionOrQualifiedName(node, contextualMapper) { var type; - if (node.kind == 125) { + if (node.kind == 126) { type = checkQualifiedName(node); } else { @@ -14388,9 +15275,9 @@ var ts; type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); } if (isConstEnumObjectType(type)) { - var ok = (node.parent.kind === 153 && node.parent.expression === node) || - (node.parent.kind === 154 && node.parent.expression === node) || - ((node.kind === 64 || node.kind === 125) && isInRightSideOfImportOrExportAssignment(node)); + 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)); 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); } @@ -14403,65 +15290,67 @@ var ts; } function checkExpressionWorker(node, contextualMapper) { switch (node.kind) { - case 64: + case 65: return checkIdentifier(node); - case 92: + case 93: return checkThisExpression(node); - case 90: + case 91: return checkSuperExpression(node); - case 88: + case 89: return nullType; - case 94: - case 79: + case 95: + case 80: return booleanType; case 7: return checkNumericLiteral(node); - case 169: + case 171: return checkTemplateExpression(node); case 8: case 10: return stringType; case 9: return globalRegExpType; - case 151: - return checkArrayLiteral(node, contextualMapper); - case 152: - return checkObjectLiteral(node, contextualMapper); case 153: - return checkPropertyAccessExpression(node); + return checkArrayLiteral(node, contextualMapper); case 154: - return checkIndexedAccess(node); + return checkObjectLiteral(node, contextualMapper); case 155: + return checkPropertyAccessExpression(node); case 156: - return checkCallExpression(node); + return checkIndexedAccess(node); case 157: - return checkTaggedTemplateExpression(node); case 158: - return checkTypeAssertion(node); + return checkCallExpression(node); case 159: - return checkExpression(node.expression, contextualMapper); + return checkTaggedTemplateExpression(node); case 160: + return checkTypeAssertion(node); case 161: - return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - case 163: - return checkTypeOfExpression(node); + return checkExpression(node.expression, contextualMapper); + case 174: + return checkClassExpression(node); case 162: - return checkDeleteExpression(node); - case 164: - return checkVoidExpression(node); + case 163: + return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); case 165: - return checkPrefixUnaryExpression(node); + return checkTypeOfExpression(node); + case 164: + return checkDeleteExpression(node); case 166: - return checkPostfixUnaryExpression(node); + return checkVoidExpression(node); case 167: - return checkBinaryExpression(node, contextualMapper); + return checkPrefixUnaryExpression(node); case 168: - return checkConditionalExpression(node, contextualMapper); - case 171: - return checkSpreadElementExpression(node, contextualMapper); - case 172: - return undefinedType; + return checkPostfixUnaryExpression(node); + case 169: + return checkBinaryExpression(node, contextualMapper); case 170: + return checkConditionalExpression(node, contextualMapper); + case 173: + return checkSpreadElementExpression(node, contextualMapper); + case 175: + return undefinedType; + case 172: checkYieldExpression(node); return unknownType; } @@ -14478,12 +15367,18 @@ var ts; } } function checkParameter(node) { - checkGrammarModifiers(node) || checkGrammarEvalOrArgumentsInStrictMode(node, node.name); + // Grammar checking + // It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs as the + // Identifier in a PropertySetParameterList of a PropertyAssignment that is contained in strict code + // or if its FunctionBody is strict code(11.1.5). + // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a + // strict mode FunctionLikeDeclaration or FunctionExpression(13.1) + checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarEvalOrArgumentsInStrictMode(node, node.name); checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (node.flags & 112) { func = ts.getContainingFunction(node); - if (!(func.kind === 133 && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 135 && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -14497,12 +15392,12 @@ var ts; } } function checkSignatureDeclaration(node) { - if (node.kind === 138) { + if (node.kind === 140) { checkGrammarIndexSignature(node); } - else if (node.kind === 140 || node.kind === 195 || node.kind === 141 || - node.kind === 136 || node.kind === 133 || - node.kind === 137) { + else if (node.kind === 142 || node.kind === 200 || node.kind === 143 || + node.kind === 138 || node.kind === 135 || + node.kind === 139) { checkGrammarFunctionLikeDeclaration(node); } checkTypeParameters(node.typeParameters); @@ -14514,10 +15409,10 @@ var ts; checkCollisionWithArgumentsInGeneratedCode(node); if (compilerOptions.noImplicitAny && !node.type) { switch (node.kind) { - case 137: + case 139: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 136: + case 138: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -14526,7 +15421,7 @@ var ts; checkSpecializedSignatureDeclaration(node); } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 197) { + if (node.kind === 202) { var nodeSymbol = getSymbolOfNode(node); if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -14536,12 +15431,12 @@ var ts; if (indexSymbol) { var seenNumericIndexer = false; var seenStringIndexer = false; - for (var _i = 0, _a = indexSymbol.declarations, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 120: + case 121: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -14549,7 +15444,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 118: + case 119: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -14563,7 +15458,7 @@ var ts; } } function checkPropertyDeclaration(node) { - checkGrammarModifiers(node) || checkGrammarProperty(node) || checkGrammarComputedPropertyName(node.name); + checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarProperty(node) || checkGrammarComputedPropertyName(node.name); checkVariableLikeDeclaration(node); } function checkMethodDeclaration(node) { @@ -14586,40 +15481,40 @@ var ts; return; } function isSuperCallExpression(n) { - return n.kind === 155 && n.expression.kind === 90; + return n.kind === 157 && n.expression.kind === 91; } function containsSuperCall(n) { if (isSuperCallExpression(n)) { return true; } switch (n.kind) { - case 160: - case 195: - case 161: - case 152: return false; + case 162: + case 200: + case 163: + case 154: return false; default: return ts.forEachChild(n, containsSuperCall); } } function markThisReferencesAsErrors(n) { - if (n.kind === 92) { + if (n.kind === 93) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 160 && n.kind !== 195) { + else if (n.kind !== 162 && n.kind !== 200) { ts.forEachChild(n, markThisReferencesAsErrors); } } function isInstancePropertyWithInitializer(n) { - return n.kind === 130 && + return n.kind === 132 && !(n.flags & 128) && !!n.initializer; } - if (ts.getClassBaseTypeNode(node.parent)) { + if (ts.getClassExtendsHeritageClauseElement(node.parent)) { if (containsSuperCall(node.body)) { var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || 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 !== 177 || !isSuperCallExpression(statements[0].expression)) { + if (!statements.length || statements[0].kind !== 182 || !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 { @@ -14635,13 +15530,13 @@ var ts; function checkAccessorDeclaration(node) { if (produceDiagnostics) { checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name); - if (node.kind === 134) { + if (node.kind === 136) { 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 === 134 ? 135 : 134; + var otherKind = node.kind === 136 ? 137 : 136; var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { if (((node.flags & 112) !== (otherAccessor.flags & 112))) { @@ -14660,9 +15555,18 @@ var ts; } checkFunctionLikeDeclaration(node); } - function checkTypeReference(node) { + function checkMissingDeclaration(node) { + checkDecorators(node); + } + function checkTypeReferenceNode(node) { + return checkTypeReferenceOrHeritageClauseElement(node); + } + function checkHeritageClauseElement(node) { + return checkTypeReferenceOrHeritageClauseElement(node); + } + function checkTypeReferenceOrHeritageClauseElement(node) { checkGrammarTypeArguments(node, node.typeArguments); - var type = getTypeFromTypeReferenceNode(node); + var type = getTypeFromTypeReferenceOrHeritageClauseElement(node); if (type !== unknownType && node.typeArguments) { var len = node.typeArguments.length; for (var i = 0; i < len; i++) { @@ -14715,9 +15619,9 @@ var ts; return; } var signaturesToCheck; - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 197) { - ts.Debug.assert(signatureDeclarationNode.kind === 136 || signatureDeclarationNode.kind === 137); - var signatureKind = signatureDeclarationNode.kind === 136 ? 0 : 1; + 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; var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); var containingType = getDeclaredTypeOfSymbol(containingSymbol); signaturesToCheck = getSignaturesOfType(containingType, signatureKind); @@ -14725,7 +15629,7 @@ var ts; else { signaturesToCheck = getSignaturesOfSymbol(getSymbolOfNode(signatureDeclarationNode)); } - for (var _i = 0, _n = signaturesToCheck.length; _i < _n; _i++) { + for (var _i = 0; _i < signaturesToCheck.length; _i++) { var otherSignature = signaturesToCheck[_i]; if (!otherSignature.hasStringLiterals && isSignatureAssignableTo(signature, otherSignature)) { return; @@ -14735,7 +15639,7 @@ var ts; } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = ts.getCombinedNodeFlags(n); - if (n.parent.kind !== 197 && ts.isInAmbientContext(n)) { + if (n.parent.kind !== 202 && ts.isInAmbientContext(n)) { if (!(flags & 2)) { flags |= 1; } @@ -14792,7 +15696,7 @@ var ts; var declarations = symbol.declarations; var isConstructor = (symbol.flags & 16384) !== 0; function reportImplementationExpectedError(node) { - if (node.name && ts.getFullWidth(node.name) === 0) { + if (node.name && ts.nodeIsMissing(node.name)) { return; } var seen = false; @@ -14806,16 +15710,16 @@ var ts; }); if (subsequentNode) { if (subsequentNode.kind === node.kind) { - var _errorNode = subsequentNode.name || subsequentNode; + var errorNode_1 = subsequentNode.name || subsequentNode; if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - ts.Debug.assert(node.kind === 132 || node.kind === 131); + ts.Debug.assert(node.kind === 134 || node.kind === 133); 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, diagnostic); + error(errorNode_1, diagnostic); return; } else if (ts.nodeIsPresent(subsequentNode.body)) { - error(_errorNode, ts.Diagnostics.Function_implementation_name_must_be_0, ts.declarationNameToString(node.name)); + error(errorNode_1, ts.Diagnostics.Function_implementation_name_must_be_0, ts.declarationNameToString(node.name)); return; } } @@ -14831,15 +15735,15 @@ var ts; var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & 1536; var duplicateFunctionDeclaration = false; var multipleConstructorImplementation = false; - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + for (var _i = 0; _i < declarations.length; _i++) { var current = declarations[_i]; var node = current; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 197 || node.parent.kind === 143 || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 202 || node.parent.kind === 145 || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = undefined; } - if (node.kind === 195 || node.kind === 132 || node.kind === 131 || node.kind === 133) { + if (node.kind === 200 || node.kind === 134 || node.kind === 133 || node.kind === 135) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -14890,7 +15794,7 @@ var ts; var signatures = getSignaturesOfSymbol(symbol); var bodySignature = getSignatureFromDeclaration(bodyDeclaration); if (!bodySignature.hasStringLiterals) { - for (var _a = 0, _b = signatures.length; _a < _b; _a++) { + for (var _a = 0; _a < signatures.length; _a++) { var signature = signatures[_a]; if (!signature.hasStringLiterals && !isSignatureAssignableTo(bodySignature, signature)) { error(signature.declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation); @@ -14936,16 +15840,16 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 197: + case 202: return 2097152; - case 200: + case 205: return d.name.kind === 8 || ts.getModuleInstanceState(d) !== 0 ? 4194304 | 1048576 : 4194304; - case 196: - case 199: + case 201: + case 204: return 2097152 | 1048576; - case 203: + case 208: var result = 0; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result |= getDeclarationSpaces(d); }); @@ -14955,6 +15859,49 @@ var ts; } } } + function checkDecorator(node) { + var expression = node.expression; + var exprType = checkExpression(expression); + switch (node.parent.kind) { + case 201: + var classSymbol = getSymbolOfNode(node.parent); + var classConstructorType = getTypeOfSymbol(classSymbol); + var classDecoratorType = instantiateSingleCallFunctionType(globalClassDecoratorType, [classConstructorType]); + checkTypeAssignableTo(exprType, classDecoratorType, node); + break; + case 132: + checkTypeAssignableTo(exprType, globalPropertyDecoratorType, node); + break; + case 134: + case 136: + case 137: + var methodType = getTypeOfNode(node.parent); + var methodDecoratorType = instantiateSingleCallFunctionType(globalMethodDecoratorType, [methodType]); + checkTypeAssignableTo(exprType, methodDecoratorType, node); + break; + case 129: + checkTypeAssignableTo(exprType, globalParameterDecoratorType, node); + break; + } + } + function checkDecorators(node) { + if (!node.decorators) { + return; + } + switch (node.kind) { + case 201: + case 134: + case 136: + case 137: + case 132: + case 129: + emitDecorate = true; + break; + default: + return; + } + ts.forEach(node.decorators, checkDecorator); + } function checkFunctionDeclaration(node) { if (produceDiagnostics) { checkFunctionLikeDeclaration(node) || @@ -14967,8 +15914,9 @@ var ts; } } function checkFunctionLikeDeclaration(node) { + checkDecorators(node); checkSignatureDeclaration(node); - if (node.name && node.name.kind === 126) { + if (node.name && node.name.kind === 127) { checkComputedPropertyName(node.name); } if (!ts.hasDynamicName(node)) { @@ -14986,18 +15934,18 @@ var ts; } checkSourceElement(node.body); if (node.type && !isAccessor(node.kind)) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); + checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type)); } if (compilerOptions.noImplicitAny && ts.nodeIsMissing(node.body) && !node.type && !isPrivateWithinAmbient(node)) { reportImplicitAnyError(node, anyType); } } function checkBlock(node) { - if (node.kind === 174) { + if (node.kind === 179) { checkGrammarStatementInAmbientContext(node); } ts.forEach(node.statements, checkSourceElement); - if (ts.isFunctionBlock(node) || node.kind === 201) { + if (ts.isFunctionBlock(node) || node.kind === 206) { checkFunctionExpressionBodies(node); } } @@ -15015,19 +15963,19 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 130 || - node.kind === 129 || - node.kind === 132 || + if (node.kind === 132 || node.kind === 131 || node.kind === 134 || - node.kind === 135) { + node.kind === 133 || + node.kind === 136 || + node.kind === 137) { return false; } if (ts.isInAmbientContext(node)) { return false; } var root = getRootDeclaration(node); - if (root.kind === 128 && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 129 && ts.nodeIsMissing(root.parent.body)) { return false; } return true; @@ -15041,8 +15989,8 @@ var ts; var current = node; while (current) { if (getNodeCheckFlags(current) & 4) { - var _isDeclaration = node.kind !== 64; - if (_isDeclaration) { + var isDeclaration_1 = node.kind !== 65; + if (isDeclaration_1) { error(node.name, ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference); } else { @@ -15057,13 +16005,13 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "_super")) { return; } - var enclosingClass = ts.getAncestor(node, 196); + var enclosingClass = ts.getAncestor(node, 201); if (!enclosingClass || ts.isInAmbientContext(enclosingClass)) { return; } - if (ts.getClassBaseTypeNode(enclosingClass)) { - var _isDeclaration = node.kind !== 64; - if (_isDeclaration) { + if (ts.getClassExtendsHeritageClauseElement(enclosingClass)) { + var isDeclaration_2 = node.kind !== 65; + if (isDeclaration_2) { error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); } else { @@ -15075,56 +16023,65 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { return; } - if (node.kind === 200 && ts.getModuleInstanceState(node) !== 1) { + if (node.kind === 205 && ts.getModuleInstanceState(node) !== 1) { return; } - var _parent = getDeclarationContainer(node); - if (_parent.kind === 221 && ts.isExternalModule(_parent)) { + 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)); } } function checkVarDeclaredNamesNotShadowed(node) { - if (node.initializer && (ts.getCombinedNodeFlags(node) & 12288) === 0) { - var symbol = getSymbolOfNode(node); - if (symbol.flags & 1) { - var localDeclarationSymbol = resolveName(node, node.name.text, 3, undefined, undefined); - if (localDeclarationSymbol && - localDeclarationSymbol !== symbol && - localDeclarationSymbol.flags & 2) { - if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 12288) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 194); - var container = varDeclList.parent.kind === 175 && - varDeclList.parent.parent; - var namesShareScope = container && - (container.kind === 174 && ts.isFunctionLike(container.parent) || - (container.kind === 201 && container.kind === 200) || - container.kind === 221); - if (!namesShareScope) { - var _name = symbolToString(localDeclarationSymbol); - error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, _name, _name); - } + // - ScriptBody : StatementList + // It is a Syntax Error if any element of the LexicallyDeclaredNames of StatementList + // also occurs in the VarDeclaredNames of StatementList. + if ((ts.getCombinedNodeFlags(node) & 12288) !== 0 || isParameterDeclaration(node)) { + return; + } + if (node.kind === 198 && !node.initializer) { + return; + } + var symbol = getSymbolOfNode(node); + if (symbol.flags & 1) { + var localDeclarationSymbol = resolveName(node, node.name.text, 3, undefined, undefined); + if (localDeclarationSymbol && + 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 + ? varDeclList.parent.parent + : undefined; + var namesShareScope = container && + (container.kind === 179 && ts.isFunctionLike(container.parent) || + container.kind === 206 || + container.kind === 205 || + container.kind === 227); + 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); } } } } } function isParameterDeclaration(node) { - while (node.kind === 150) { + while (node.kind === 152) { node = node.parent.parent; } - return node.kind === 128; + return node.kind === 129; } function checkParameterInitializer(node) { - if (getRootDeclaration(node).kind !== 128) { + if (getRootDeclaration(node).kind !== 129) { return; } var func = ts.getContainingFunction(node); visit(node.initializer); function visit(n) { - if (n.kind === 64) { + if (n.kind === 65) { var referencedSymbol = getNodeLinks(n).resolvedSymbol; if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(func.locals, referencedSymbol.name, 107455) === referencedSymbol) { - if (referencedSymbol.valueDeclaration.kind === 128) { + if (referencedSymbol.valueDeclaration.kind === 129) { if (referencedSymbol.valueDeclaration === node) { error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.declarationNameToString(node.name)); return; @@ -15142,8 +16099,9 @@ var ts; } } function checkVariableLikeDeclaration(node) { + checkDecorators(node); checkSourceElement(node.type); - if (node.name.kind === 126) { + if (node.name.kind === 127) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); @@ -15152,7 +16110,7 @@ var ts; if (ts.isBindingPattern(node.name)) { ts.forEach(node.name.elements, checkSourceElement); } - if (node.initializer && getRootDeclaration(node).kind === 128 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && getRootDeclaration(node).kind === 129 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } @@ -15180,9 +16138,9 @@ var ts; checkTypeAssignableTo(checkExpressionCached(node.initializer), declarationType, node, undefined); } } - if (node.kind !== 130 && node.kind !== 129) { + if (node.kind !== 132 && node.kind !== 131) { checkExportsOnMergedDeclarations(node); - if (node.kind === 193 || node.kind === 150) { + if (node.kind === 198 || node.kind === 152) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); @@ -15199,7 +16157,7 @@ var ts; return checkVariableLikeDeclaration(node); } function checkVariableStatement(node) { - checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || checkGrammarModifiers(node) || checkGrammarVariableDeclarationList(node.declarationList) || checkGrammarForDisallowedLetOrConstStatement(node); + checkGrammarDecorators(node) || checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || checkGrammarModifiers(node) || checkGrammarVariableDeclarationList(node.declarationList) || checkGrammarForDisallowedLetOrConstStatement(node); ts.forEach(node.declarationList.declarations, checkSourceElement); } function checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) { @@ -15211,7 +16169,7 @@ var ts; } function inBlockOrObjectLiteralExpression(node) { while (node) { - if (node.kind === 174 || node.kind === 152) { + if (node.kind === 179 || node.kind === 154) { return true; } node = node.parent; @@ -15239,12 +16197,12 @@ var ts; } function checkForStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind == 194) { + if (node.initializer && node.initializer.kind == 199) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 194) { + if (node.initializer.kind === 199) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -15259,13 +16217,13 @@ var ts; } function checkForOfStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.initializer.kind === 194) { + if (node.initializer.kind === 199) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression); - if (varExpr.kind === 151 || varExpr.kind === 152) { + if (varExpr.kind === 153 || varExpr.kind === 154) { checkDestructuringAssignment(varExpr, iteratedType || unknownType); } else { @@ -15280,7 +16238,7 @@ var ts; } function checkForInStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.initializer.kind === 194) { + if (node.initializer.kind === 199) { 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); @@ -15290,7 +16248,7 @@ var ts; else { var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 151 || varExpr.kind === 152) { + if (varExpr.kind === 153 || varExpr.kind === 154) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!allConstituentTypesHaveKind(leftType, 1 | 258)) { @@ -15330,6 +16288,31 @@ var ts; } return iteratedType; function getIteratedType(iterable, expressionForError) { + // We want to treat type as an iterable, and get the type it is an iterable of. The iterable + // must have the following structure (annotated with the names of the variables below): + // + // { // iterable + // [Symbol.iterator]: { // iteratorFunction + // (): { // iterator + // next: { // iteratorNextFunction + // (): { // iteratorNextResult + // value: T // iteratorNextValue + // } + // } + // } + // } + // } + // + // T is the type we are after. At every level that involves analyzing return types + // of signatures, we union the return types of all the signatures. + // + // Another thing to note is that at any step of this process, we could run into a dead end, + // meaning either the property is missing, or we run into the anyType. If either of these things + // happens, we return undefined to signal that we could not find the iterated type. If a property + // is missing, and the previous step did not result in 'any', then we also give an error if the + // caller requested it. Then the caller can decide what to do in the case where there is no iterated + // type. This is different from returning anyType, because that would signify that we have matched the + // whole pattern and that T (above) is 'any'. if (allConstituentTypesHaveKind(iterable, 1)) { return undefined; } @@ -15409,7 +16392,7 @@ var ts; checkGrammarStatementInAmbientContext(node) || checkGrammarBreakOrContinueStatement(node); } function isGetAccessorWithAnnotatatedSetAccessor(node) { - return !!(node.kind === 134 && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 135))); + return !!(node.kind === 136 && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 137))); } function checkReturnStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { @@ -15423,11 +16406,11 @@ var ts; if (func) { var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func)); var exprType = checkExpressionCached(node.expression); - if (func.kind === 135) { + if (func.kind === 137) { error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); } else { - if (func.kind === 133) { + if (func.kind === 135) { if (!isTypeAssignableTo(exprType, returnType)) { error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -15454,7 +16437,7 @@ var ts; var hasDuplicateDefaultClause = false; var expressionType = checkExpression(node.expression); ts.forEach(node.caseBlock.clauses, function (clause) { - if (clause.kind === 215 && !hasDuplicateDefaultClause) { + if (clause.kind === 221 && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -15466,7 +16449,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 214) { + if (produceDiagnostics && clause.kind === 220) { var caseClause = clause; var caseType = checkExpression(caseClause.expression); if (!isTypeAssignableTo(expressionType, caseType)) { @@ -15483,7 +16466,7 @@ var ts; if (ts.isFunctionLike(current)) { break; } - if (current.kind === 189 && current.label.text === node.label.text) { + if (current.kind === 194 && 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; @@ -15509,7 +16492,7 @@ var ts; var catchClause = node.catchClause; if (catchClause) { if (catchClause.variableDeclaration) { - if (catchClause.variableDeclaration.name.kind !== 64) { + if (catchClause.variableDeclaration.name.kind !== 65) { grammarErrorOnFirstToken(catchClause.variableDeclaration.name, ts.Diagnostics.Catch_clause_variable_name_must_be_an_identifier); } else if (catchClause.variableDeclaration.type) { @@ -15547,9 +16530,9 @@ var ts; checkIndexConstraintForProperty(prop, propType, type, declaredStringIndexer, stringIndexType, 0); checkIndexConstraintForProperty(prop, propType, type, declaredNumberIndexer, numberIndexType, 1); }); - if (type.flags & 1024 && type.symbol.valueDeclaration.kind === 196) { + if (type.flags & 1024 && type.symbol.valueDeclaration.kind === 201) { var classDeclaration = type.symbol.valueDeclaration; - for (var _i = 0, _a = classDeclaration.members, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = classDeclaration.members; _i < _a.length; _i++) { var member = _a[_i]; if (!(member.flags & 128) && ts.hasDynamicName(member)) { var propType = getTypeOfSymbol(member.symbol); @@ -15577,22 +16560,22 @@ var ts; if (indexKind === 1 && !isNumericName(prop.valueDeclaration.name)) { return; } - var _errorNode; - if (prop.valueDeclaration.name.kind === 126 || prop.parent === containingType.symbol) { - _errorNode = prop.valueDeclaration; + var errorNode; + if (prop.valueDeclaration.name.kind === 127 || prop.parent === containingType.symbol) { + errorNode = prop.valueDeclaration; } else if (indexDeclaration) { - _errorNode = indexDeclaration; + errorNode = indexDeclaration; } else if (containingType.flags & 2048) { var someBaseClassHasBothPropertyAndIndexer = ts.forEach(containingType.baseTypes, function (base) { return getPropertyOfObjectType(base, prop.name) && getIndexTypeOfType(base, indexKind); }); - _errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : containingType.symbol.declarations[0]; + errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : containingType.symbol.declarations[0]; } - if (_errorNode && !isTypeAssignableTo(propertyType, indexType)) { + if (errorNode && !isTypeAssignableTo(propertyType, indexType)) { var errorMessage = indexKind === 0 ? ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_string_index_type_2 : ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2; - error(_errorNode, errorMessage, symbolToString(prop), typeToString(propertyType), typeToString(indexType)); + error(errorNode, errorMessage, symbolToString(prop), typeToString(propertyType), typeToString(indexType)); } } } @@ -15622,8 +16605,17 @@ var ts; } } } + function checkClassExpression(node) { + grammarErrorOnNode(node, ts.Diagnostics.class_expressions_are_not_currently_supported); + ts.forEach(node.members, checkSourceElement); + return unknownType; + } function checkClassDeclaration(node) { + if (node.parent.kind !== 206 && node.parent.kind !== 227) { + grammarErrorOnNode(node, ts.Diagnostics.class_declarations_are_only_supported_directly_inside_a_module_or_as_a_top_level_declaration); + } checkGrammarClassDeclarationHeritageClauses(node); + checkDecorators(node); if (node.name) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Class_name_cannot_be_0); checkCollisionWithCapturedThisVariable(node, node.name); @@ -15634,10 +16626,13 @@ var ts; var symbol = getSymbolOfNode(node); var type = getDeclaredTypeOfSymbol(symbol); var staticType = getTypeOfSymbol(symbol); - var baseTypeNode = ts.getClassBaseTypeNode(node); + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { + if (!ts.isSupportedHeritageClauseElement(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); - checkTypeReference(baseTypeNode); + checkHeritageClauseElement(baseTypeNode); } if (type.baseTypes.length) { if (produceDiagnostics) { @@ -15645,19 +16640,24 @@ var ts; checkTypeAssignableTo(type, baseType, node.name || node, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); var staticBaseType = getTypeOfSymbol(baseType.symbol); checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name || node, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); - if (baseType.symbol !== resolveEntityName(baseTypeNode.typeName, 107455)) { + if (baseType.symbol !== resolveEntityName(baseTypeNode.expression, 107455)) { error(baseTypeNode, ts.Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType)); } checkKindsOfPropertyMemberOverrides(type, baseType); } - checkExpressionOrQualifiedName(baseTypeNode.typeName); } - var implementedTypeNodes = ts.getClassImplementedTypeNodes(node); + if (type.baseTypes.length || (baseTypeNode && compilerOptions.separateCompilation)) { + checkExpressionOrQualifiedName(baseTypeNode.expression); + } + var implementedTypeNodes = ts.getClassImplementsHeritageClauseElements(node); if (implementedTypeNodes) { ts.forEach(implementedTypeNodes, function (typeRefNode) { - checkTypeReference(typeRefNode); + if (!ts.isSupportedHeritageClauseElement(typeRefNode)) { + error(typeRefNode.expression, ts.Diagnostics.A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments); + } + checkHeritageClauseElement(typeRefNode); if (produceDiagnostics) { - var t = getTypeFromTypeReferenceNode(typeRefNode); + var t = getTypeFromHeritageClauseElement(typeRefNode); if (t !== unknownType) { var declaredType = (t.flags & 4096) ? t.target : t; if (declaredType.flags & (1024 | 2048)) { @@ -15680,8 +16680,21 @@ var ts; return s.flags & 16777216 ? getSymbolLinks(s).target : s; } function checkKindsOfPropertyMemberOverrides(type, baseType) { + // TypeScript 1.0 spec (April 2014): 8.2.3 + // A derived class inherits all members from its base class it doesn't override. + // Inheritance means that a derived class implicitly contains all non - overridden members of the base class. + // Both public and private property members are inherited, but only public property members can be overridden. + // A property member in a derived class is said to override a property member in a base class + // when the derived class property member has the same name and kind(instance or static) + // as the base class property member. + // The type of an overriding property member must be assignable(section 3.8.4) + // to the type of the overridden property member, or otherwise a compile - time error occurs. + // Base class instance member functions can be overridden by derived class instance member functions, + // but not by other kinds of members. + // Base class instance member variables and accessors can be overridden by + // derived class instance member variables and accessors, but not by other kinds of members. var baseProperties = getPropertiesOfObjectType(baseType); - for (var _i = 0, _n = baseProperties.length; _i < _n; _i++) { + for (var _i = 0; _i < baseProperties.length; _i++) { var baseProperty = baseProperties[_i]; var base = getTargetSymbol(baseProperty); if (base.flags & 134217728) { @@ -15724,7 +16737,7 @@ var ts; } } function isAccessor(kind) { - return kind === 134 || kind === 135; + return kind === 136 || kind === 137; } function areTypeParametersIdentical(list1, list2) { if (!list1 && !list2) { @@ -15745,7 +16758,7 @@ var ts; if (!tp1.constraint || !tp2.constraint) { return false; } - if (!isTypeIdenticalTo(getTypeFromTypeNode(tp1.constraint), getTypeFromTypeNode(tp2.constraint))) { + if (!isTypeIdenticalTo(getTypeFromTypeNodeOrHeritageClauseElement(tp1.constraint), getTypeFromTypeNodeOrHeritageClauseElement(tp2.constraint))) { return false; } } @@ -15758,10 +16771,10 @@ var ts; var seen = {}; ts.forEach(type.declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; }); var ok = true; - for (var _i = 0, _a = type.baseTypes, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = type.baseTypes; _i < _a.length; _i++) { var base = _a[_i]; var properties = getPropertiesOfObjectType(base); - for (var _b = 0, _c = properties.length; _b < _c; _b++) { + for (var _b = 0; _b < properties.length; _b++) { var prop = properties[_b]; if (!ts.hasProperty(seen, prop.name)) { seen[prop.name] = { prop: prop, containingType: base }; @@ -15783,13 +16796,13 @@ var ts; return ok; } function checkInterfaceDeclaration(node) { - checkGrammarModifiers(node) || checkGrammarInterfaceDeclaration(node); + checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarInterfaceDeclaration(node); checkTypeParameters(node.typeParameters); if (produceDiagnostics) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 197); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 202); 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); @@ -15805,32 +16818,37 @@ var ts; } } } - ts.forEach(ts.getInterfaceBaseTypeNodes(node), checkTypeReference); + ts.forEach(ts.getInterfaceBaseTypeNodes(node), function (heritageElement) { + if (!ts.isSupportedHeritageClauseElement(heritageElement)) { + error(heritageElement.expression, ts.Diagnostics.An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments); + } + checkHeritageClauseElement(heritageElement); + }); ts.forEach(node.members, checkSourceElement); if (produceDiagnostics) { checkTypeForDuplicateIndexSignatures(node); } } function checkTypeAliasDeclaration(node) { - checkGrammarModifiers(node); + checkGrammarDecorators(node) || checkGrammarModifiers(node); checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_alias_name_cannot_be_0); checkSourceElement(node.type); } function computeEnumMemberValues(node) { - var _nodeLinks = getNodeLinks(node); - if (!(_nodeLinks.flags & 128)) { + var nodeLinks = getNodeLinks(node); + if (!(nodeLinks.flags & 128)) { var enumSymbol = getSymbolOfNode(node); var enumType = getDeclaredTypeOfSymbol(enumSymbol); var autoValue = 0; var ambient = ts.isInAmbientContext(node); var enumIsConst = ts.isConst(node); ts.forEach(node.members, function (member) { - if (member.name.kind !== 126 && isNumericLiteralName(member.name.text)) { + if (member.name.kind !== 127 && isNumericLiteralName(member.name.text)) { error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name); } var initializer = member.initializer; if (initializer) { - autoValue = getConstantValueForEnumMemberInitializer(initializer, enumIsConst); + autoValue = getConstantValueForEnumMemberInitializer(initializer); if (autoValue === undefined) { if (enumIsConst) { error(initializer, ts.Diagnostics.In_const_enum_declarations_member_initializer_must_be_constant_expression); @@ -15855,13 +16873,13 @@ var ts; getNodeLinks(member).enumMemberValue = autoValue++; } }); - _nodeLinks.flags |= 128; + nodeLinks.flags |= 128; } - function getConstantValueForEnumMemberInitializer(initializer, enumIsConst) { + function getConstantValueForEnumMemberInitializer(initializer) { return evalConstant(initializer); function evalConstant(e) { switch (e.kind) { - case 165: + case 167: var value = evalConstant(e.operand); if (value === undefined) { return undefined; @@ -15869,13 +16887,10 @@ var ts; switch (e.operator) { case 33: return value; case 34: return -value; - case 47: return enumIsConst ? ~value : undefined; + case 47: return ~value; } return undefined; - case 167: - if (!enumIsConst) { - return undefined; - } + case 169: var left = evalConstant(e.left); if (left === undefined) { return undefined; @@ -15900,43 +16915,54 @@ var ts; return undefined; case 7: return +e.text; - case 159: - return enumIsConst ? evalConstant(e.expression) : undefined; - case 64: - case 154: - case 153: - if (!enumIsConst) { - return undefined; - } + case 161: + return evalConstant(e.expression); + case 65: + case 156: + case 155: var member = initializer.parent; var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); - var _enumType; + var enumType; var propertyName; - if (e.kind === 64) { - _enumType = currentType; + if (e.kind === 65) { + enumType = currentType; propertyName = e.text; } else { - if (e.kind === 154) { + var expression; + if (e.kind === 156) { if (e.argumentExpression === undefined || e.argumentExpression.kind !== 8) { return undefined; } - _enumType = getTypeOfNode(e.expression); + expression = e.expression; propertyName = e.argumentExpression.text; } else { - _enumType = getTypeOfNode(e.expression); + expression = e.expression; propertyName = e.name.text; } - if (_enumType !== currentType) { + var current = expression; + while (current) { + if (current.kind === 65) { + break; + } + else if (current.kind === 155) { + current = current.expression; + } + else { + return undefined; + } + } + enumType = checkExpression(expression); + if (!(enumType.symbol && (enumType.symbol.flags & 384))) { return undefined; } } if (propertyName === undefined) { return undefined; } - var property = getPropertyOfObjectType(_enumType, propertyName); + var property = getPropertyOfObjectType(enumType, propertyName); if (!property || !(property.flags & 8)) { return undefined; } @@ -15956,17 +16982,20 @@ var ts; if (!produceDiagnostics) { return; } - checkGrammarModifiers(node) || checkGrammarEnumDeclaration(node); + checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarEnumDeclaration(node); checkTypeNameIsReserved(node.name, ts.Diagnostics.Enum_name_cannot_be_0); checkCollisionWithCapturedThisVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); computeEnumMemberValues(node); + var enumIsConst = ts.isConst(node); + if (compilerOptions.separateCompilation && enumIsConst && ts.isInAmbientContext(node)) { + error(node.name, ts.Diagnostics.Ambient_const_enums_are_not_allowed_when_the_separateCompilation_flag_is_provided); + } var enumSymbol = getSymbolOfNode(node); var firstDeclaration = ts.getDeclarationOfKind(enumSymbol, node.kind); if (node === firstDeclaration) { if (enumSymbol.declarations.length > 1) { - var enumIsConst = ts.isConst(node); ts.forEach(enumSymbol.declarations, function (decl) { if (ts.isConstEnumDeclaration(decl) !== enumIsConst) { error(decl.name, ts.Diagnostics.Enum_declarations_must_all_be_const_or_non_const); @@ -15975,7 +17004,7 @@ var ts; } var seenEnumMissingInitialInitializer = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 199) { + if (declaration.kind !== 204) { return false; } var enumDeclaration = declaration; @@ -15996,9 +17025,9 @@ var ts; } function getFirstNonAmbientClassOrFunctionDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; - if ((declaration.kind === 196 || (declaration.kind === 195 && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { + if ((declaration.kind === 201 || (declaration.kind === 200 && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { return declaration; } } @@ -16006,7 +17035,7 @@ var ts; } function checkModuleDeclaration(node) { if (produceDiagnostics) { - if (!checkGrammarModifiers(node)) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node)) { if (!ts.isInAmbientContext(node) && node.name.kind === 8) { grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names); } @@ -16018,7 +17047,7 @@ var ts; if (symbol.flags & 512 && symbol.declarations.length > 1 && !ts.isInAmbientContext(node) - && ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums)) { + && ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation)) { var classOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (classOrFunc) { if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(classOrFunc)) { @@ -16041,20 +17070,29 @@ var ts; checkSourceElement(node.body); } function getFirstIdentifier(node) { - while (node.kind === 125) { - node = node.left; + while (true) { + if (node.kind === 126) { + node = node.left; + } + else if (node.kind === 155) { + node = node.expression; + } + else { + break; + } } + ts.Debug.assert(node.kind === 65); return node; } function checkExternalImportOrExportDeclaration(node) { var moduleName = ts.getExternalModuleName(node); - if (ts.getFullWidth(moduleName) !== 0 && moduleName.kind !== 8) { + if (!ts.nodeIsMissing(moduleName) && moduleName.kind !== 8) { error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 201 && node.parent.parent.name.kind === 8; - if (node.parent.kind !== 221 && !inAmbientExternalModule) { - error(moduleName, node.kind === 210 ? + 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); return false; @@ -16073,7 +17111,7 @@ var ts; (symbol.flags & 793056 ? 793056 : 0) | (symbol.flags & 1536 ? 1536 : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 212 ? + var message = node.kind === 217 ? 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)); @@ -16086,7 +17124,7 @@ var ts; checkAliasSymbol(node); } function checkImportDeclaration(node) { - if (!checkGrammarModifiers(node) && (node.flags & 499)) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_import_declaration_cannot_have_modifiers); } if (checkExternalImportOrExportDeclaration(node)) { @@ -16096,7 +17134,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 206) { + if (importClause.namedBindings.kind === 211) { checkImportBinding(importClause.namedBindings); } else { @@ -16107,7 +17145,7 @@ var ts; } } function checkImportEqualsDeclaration(node) { - checkGrammarModifiers(node); + checkGrammarDecorators(node) || checkGrammarModifiers(node); if (ts.isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) { checkImportBinding(node); if (node.flags & 1) { @@ -16127,15 +17165,30 @@ var ts; } } } + else { + if (languageVersion >= 2) { + grammarErrorOnNode(node, ts.Diagnostics.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); + } + } } } function checkExportDeclaration(node) { - if (!checkGrammarModifiers(node) && (node.flags & 499)) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_declaration_cannot_have_modifiers); } 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); + } + } + 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)); + } } } } @@ -16146,67 +17199,58 @@ var ts; } } function checkExportAssignment(node) { - var container = node.parent.kind === 221 ? node.parent : node.parent.parent; - if (container.kind === 200 && container.name.kind === 64) { + 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); return; } - if (!checkGrammarModifiers(node) && (node.flags & 499)) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_assignment_cannot_have_modifiers); } - if (node.expression.kind === 64) { - markExportAsReferenced(node); + if (node.expression) { + if (node.expression.kind === 65) { + markExportAsReferenced(node); + } + else { + checkExpressionCached(node.expression); + } } - else { - checkExpressionCached(node.expression); + if (node.type) { + checkSourceElement(node.type); + if (!ts.isInAmbientContext(node)) { + grammarErrorOnFirstToken(node.type, ts.Diagnostics.A_type_annotation_on_an_export_statement_is_only_allowed_in_an_ambient_external_module_declaration); + } } 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); + } } function getModuleStatements(node) { - if (node.kind === 221) { + if (node.kind === 227) { return node.statements; } - if (node.kind === 200 && node.body.kind === 201) { + if (node.kind === 205 && node.body.kind === 206) { return node.body.statements; } return emptyArray; } function hasExportedMembers(moduleSymbol) { - var declarations = moduleSymbol.declarations; - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { - var current = declarations[_i]; - var statements = getModuleStatements(current); - for (var _a = 0, _b = statements.length; _a < _b; _a++) { - var node = statements[_a]; - if (node.kind === 210) { - var exportClause = node.exportClause; - if (!exportClause) { - return true; - } - var specifiers = exportClause.elements; - for (var _c = 0, _d = specifiers.length; _c < _d; _c++) { - var specifier = specifiers[_c]; - if (!(specifier.propertyName && specifier.name && specifier.name.text === "default")) { - return true; - } - } - } - else if (node.kind !== 209 && node.flags & 1 && !(node.flags & 256)) { - return true; - } + for (var id in moduleSymbol.exports) { + if (id !== "export=") { + return true; } } + return false; } function checkExternalModuleExports(node) { var moduleSymbol = getSymbolOfNode(node); var links = getSymbolLinks(moduleSymbol); if (!links.exportsChecked) { - var defaultSymbol = getExportAssignmentSymbol(moduleSymbol); - if (defaultSymbol) { - if (hasExportedMembers(moduleSymbol)) { - var declaration = getDeclarationOfAliasSymbol(defaultSymbol) || defaultSymbol.valueDeclaration; - error(declaration, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); - } + var exportEqualsSymbol = moduleSymbol.exports["export="]; + if (exportEqualsSymbol && hasExportedMembers(moduleSymbol)) { + var declaration = getDeclarationOfAliasSymbol(exportEqualsSymbol) || exportEqualsSymbol.valueDeclaration; + error(declaration, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); } links.exportsChecked = true; } @@ -16215,185 +17259,187 @@ var ts; if (!node) return; switch (node.kind) { - case 127: - return checkTypeParameter(node); case 128: - return checkParameter(node); - case 130: + return checkTypeParameter(node); case 129: - return checkPropertyDeclaration(node); - case 140: - case 141: - case 136: - case 137: - return checkSignatureDeclaration(node); - case 138: - return checkSignatureDeclaration(node); + return checkParameter(node); case 132: case 131: - return checkMethodDeclaration(node); - case 133: - return checkConstructorDeclaration(node); - case 134: - case 135: - return checkAccessorDeclaration(node); - case 139: - return checkTypeReference(node); + return checkPropertyDeclaration(node); case 142: - return checkTypeQuery(node); case 143: - return checkTypeLiteral(node); + case 138: + 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 checkTypeReferenceNode(node); case 144: - return checkArrayType(node); + return checkTypeQuery(node); case 145: - return checkTupleType(node); + return checkTypeLiteral(node); case 146: - return checkUnionType(node); + return checkArrayType(node); case 147: + return checkTupleType(node); + case 148: + return checkUnionType(node); + case 149: return checkSourceElement(node.type); - case 195: - return checkFunctionDeclaration(node); - case 174: - case 201: - return checkBlock(node); - case 175: - return checkVariableStatement(node); - case 177: - return checkExpressionStatement(node); - case 178: - return checkIfStatement(node); - case 179: - return checkDoStatement(node); - case 180: - return checkWhileStatement(node); - case 181: - return checkForStatement(node); - case 182: - return checkForInStatement(node); - case 183: - return checkForOfStatement(node); - case 184: - case 185: - return checkBreakOrContinueStatement(node); - case 186: - return checkReturnStatement(node); - case 187: - return checkWithStatement(node); - case 188: - return checkSwitchStatement(node); - case 189: - return checkLabeledStatement(node); - case 190: - return checkThrowStatement(node); - case 191: - return checkTryStatement(node); - case 193: - return checkVariableDeclaration(node); - case 150: - return checkBindingElement(node); - case 196: - return checkClassDeclaration(node); - case 197: - return checkInterfaceDeclaration(node); - case 198: - return checkTypeAliasDeclaration(node); - case 199: - return checkEnumDeclaration(node); case 200: - return checkModuleDeclaration(node); - case 204: - return checkImportDeclaration(node); - case 203: - return checkImportEqualsDeclaration(node); - case 210: - return checkExportDeclaration(node); - case 209: - return checkExportAssignment(node); - case 176: - checkGrammarStatementInAmbientContext(node); - return; + 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); + case 181: checkGrammarStatementInAmbientContext(node); return; + case 197: + checkGrammarStatementInAmbientContext(node); + return; + case 218: + return checkMissingDeclaration(node); } } function checkFunctionExpressionBodies(node) { switch (node.kind) { - case 160: - case 161: + case 162: + case 163: ts.forEach(node.parameters, checkFunctionExpressionBodies); checkFunctionExpressionOrObjectLiteralMethodBody(node); break; - case 132: - case 131: + case 134: + case 133: ts.forEach(node.parameters, checkFunctionExpressionBodies); if (ts.isObjectLiteralMethod(node)) { checkFunctionExpressionOrObjectLiteralMethodBody(node); } break; - case 133: - case 134: case 135: - case 195: + case 136: + case 137: + case 200: ts.forEach(node.parameters, checkFunctionExpressionBodies); break; - case 187: + case 192: checkFunctionExpressionBodies(node.expression); break; - case 128: - case 130: case 129: - case 148: - case 149: + case 132: + case 131: case 150: case 151: case 152: - case 218: case 153: case 154: + case 224: case 155: case 156: case 157: - case 169: - case 173: case 158: case 159: - case 163: - case 164: - case 162: + case 171: + case 176: + case 160: + case 161: case 165: case 166: + case 164: case 167: case 168: - case 171: - case 174: - case 201: - case 175: - case 177: - case 178: + case 169: + case 170: + case 173: case 179: + case 206: case 180: - case 181: case 182: case 183: case 184: case 185: case 186: + case 187: case 188: - case 202: - case 214: - case 215: case 189: case 190: case 191: - case 217: case 193: - case 194: - case 196: - case 199: + case 207: case 220: - case 209: case 221: + case 194: + case 195: + case 196: + case 223: + case 198: + case 199: + case 201: + case 204: + case 226: + case 214: + case 227: ts.forEachChild(node, checkFunctionExpressionBodies); break; } @@ -16421,6 +17467,9 @@ var ts; if (emitExtends) { links.flags |= 8; } + if (emitDecorate) { + links.flags |= 512; + } links.flags |= 1; } } @@ -16445,7 +17494,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 187 && node.parent.statement === node) { + if (node.parent.kind === 192 && node.parent.statement === node) { return true; } node = node.parent; @@ -16456,6 +17505,44 @@ var ts; function getSymbolsInScope(location, meaning) { var symbols = {}; var memberFlags = 0; + if (isInsideWithStatementBody(location)) { + return []; + } + populateSymbols(); + return symbolsToArray(symbols); + function populateSymbols() { + while (location) { + if (location.locals && !isGlobalSourceFile(location)) { + copySymbols(location.locals, meaning); + } + switch (location.kind) { + case 227: + if (!ts.isExternalModule(location)) { + break; + } + case 205: + copySymbols(getSymbolOfNode(location).exports, meaning & 8914931); + break; + case 204: + copySymbols(getSymbolOfNode(location).exports, meaning & 8); + break; + case 201: + case 202: + if (!(memberFlags & 128)) { + copySymbols(getSymbolOfNode(location).members, meaning & 793056); + } + break; + case 162: + if (location.name) { + copySymbol(location.symbol, meaning); + } + break; + } + memberFlags = location.flags; + location = location.parent; + } + copySymbols(globals, meaning); + } function copySymbol(symbol, meaning) { if (symbol.flags & meaning) { var id = symbol.name; @@ -16481,22 +17568,22 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 221: + case 227: if (!ts.isExternalModule(location)) break; - case 200: + case 205: copySymbols(getSymbolOfNode(location).exports, meaning & 8914931); break; - case 199: + case 204: copySymbols(getSymbolOfNode(location).exports, meaning & 8); break; - case 196: - case 197: + case 201: + case 202: if (!(memberFlags & 128)) { copySymbols(getSymbolOfNode(location).members, meaning & 793056); } break; - case 160: + case 162: if (location.name) { copySymbol(location.symbol, meaning); } @@ -16506,97 +17593,113 @@ var ts; location = location.parent; } copySymbols(globals, meaning); - return ts.mapToArray(symbols); + return symbolsToArray(symbols); } function isTypeDeclarationName(name) { - return name.kind == 64 && + return name.kind == 65 && isTypeDeclaration(name.parent) && name.parent.name === name; } function isTypeDeclaration(node) { switch (node.kind) { - case 127: - case 196: - case 197: - case 198: - case 199: + case 128: + case 201: + case 202: + case 203: + case 204: return true; } } function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 125) + while (node.parent && node.parent.kind === 126) { node = node.parent; - return node.parent && node.parent.kind === 139; + } + return node.parent && node.parent.kind === 141; } - function isTypeNode(node) { - if (139 <= node.kind && node.kind <= 147) { + function isHeritageClauseElementIdentifier(entityName) { + var node = entityName; + while (node.parent && node.parent.kind === 155) { + node = node.parent; + } + return node.parent && node.parent.kind === 177; + } + function isTypeNodeOrHeritageClauseElement(node) { + if (141 <= node.kind && node.kind <= 149) { return true; } switch (node.kind) { - case 111: - case 118: - case 120: case 112: + case 119: case 121: + case 113: + case 122: return true; - case 98: - return node.parent.kind !== 164; + case 99: + return node.parent.kind !== 166; case 8: - return node.parent.kind === 128; - case 64: - if (node.parent.kind === 125 && node.parent.right === node) { + return node.parent.kind === 129; + case 177: + return true; + case 65: + if (node.parent.kind === 126 && node.parent.right === node) { node = node.parent; } - case 125: - ts.Debug.assert(node.kind === 64 || node.kind === 125, "'node' was expected to be a qualified name or identifier in 'isTypeNode'."); - var _parent = node.parent; - if (_parent.kind === 142) { + else if (node.parent.kind === 155 && 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'."); + var parent_5 = node.parent; + if (parent_5.kind === 144) { return false; } - if (139 <= _parent.kind && _parent.kind <= 147) { + if (141 <= parent_5.kind && parent_5.kind <= 149) { return true; } - switch (_parent.kind) { - case 127: - return node === _parent.constraint; - case 130: - case 129: + switch (parent_5.kind) { + case 177: + return true; case 128: - case 193: - return node === _parent.type; - case 195: - case 160: - case 161: - case 133: + return node === parent_5.constraint; case 132: case 131: - case 134: + case 129: + case 198: + return node === parent_5.type; + case 200: + case 162: + case 163: case 135: - return node === _parent.type; + case 134: + case 133: case 136: case 137: + return node === parent_5.type; case 138: - return node === _parent.type; - case 158: - return node === _parent.type; - case 155: - case 156: - return _parent.typeArguments && ts.indexOf(_parent.typeArguments, node) >= 0; + case 139: + case 140: + return node === parent_5.type; + case 160: + return node === parent_5.type; case 157: + case 158: + return parent_5.typeArguments && ts.indexOf(parent_5.typeArguments, node) >= 0; + case 159: return false; } } return false; } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 125) { + while (nodeOnRightSide.parent.kind === 126) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 203) { + if (nodeOnRightSide.parent.kind === 208) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 209) { + if (nodeOnRightSide.parent.kind === 214) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -16604,52 +17707,53 @@ var ts; function isInRightSideOfImportOrExportAssignment(node) { return getLeftSideOfImportEqualsOrExportAssignment(node) !== undefined; } - function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 125 && node.parent.right === node) || - (node.parent.kind === 153 && node.parent.name === node); - } function getSymbolOfEntityNameOrPropertyAccessExpression(entityName) { if (ts.isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 209) { + if (entityName.parent.kind === 214) { return resolveEntityName(entityName, 107455 | 793056 | 1536 | 8388608); } - if (entityName.kind !== 153) { + if (entityName.kind !== 155) { if (isInRightSideOfImportOrExportAssignment(entityName)) { return getSymbolOfPartOfRightHandSideOfImportEquals(entityName); } } - if (isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { + if (ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (ts.isExpression(entityName)) { - if (ts.getFullWidth(entityName) === 0) { + if (isHeritageClauseElementIdentifier(entityName)) { + var meaning = entityName.parent.kind === 177 ? 793056 : 1536; + meaning |= 8388608; + return resolveEntityName(entityName, meaning); + } + else if (ts.isExpression(entityName)) { + if (ts.nodeIsMissing(entityName)) { return undefined; } - if (entityName.kind === 64) { + if (entityName.kind === 65) { var meaning = 107455 | 8388608; return resolveEntityName(entityName, meaning); } - else if (entityName.kind === 153) { + else if (entityName.kind === 155) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccessExpression(entityName); } return getNodeLinks(entityName).resolvedSymbol; } - else if (entityName.kind === 125) { - var _symbol = getNodeLinks(entityName).resolvedSymbol; - if (!_symbol) { + else if (entityName.kind === 126) { + var symbol = getNodeLinks(entityName).resolvedSymbol; + if (!symbol) { checkQualifiedName(entityName); } return getNodeLinks(entityName).resolvedSymbol; } } else if (isTypeReferenceIdentifier(entityName)) { - var _meaning = entityName.parent.kind === 139 ? 793056 : 1536; - _meaning |= 8388608; - return resolveEntityName(entityName, _meaning); + var meaning = entityName.parent.kind === 141 ? 793056 : 1536; + meaning |= 8388608; + return resolveEntityName(entityName, meaning); } return undefined; } @@ -16660,23 +17764,23 @@ var ts; if (ts.isDeclarationName(node)) { return getSymbolOfNode(node.parent); } - if (node.kind === 64 && isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 209 + if (node.kind === 65 && isInRightSideOfImportOrExportAssignment(node)) { + return node.parent.kind === 214 ? getSymbolOfEntityNameOrPropertyAccessExpression(node) : getSymbolOfPartOfRightHandSideOfImportEquals(node); } switch (node.kind) { - case 64: - case 153: - case 125: + case 65: + case 155: + case 126: return getSymbolOfEntityNameOrPropertyAccessExpression(node); - case 92: - case 90: + case 93: + case 91: var type = checkExpression(node); return type.symbol; - case 113: + case 114: var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 133) { + if (constructorDeclaration && constructorDeclaration.kind === 135) { return constructorDeclaration.parent.symbol; } return undefined; @@ -16684,12 +17788,12 @@ var ts; var moduleName; if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 204 || node.parent.kind === 210) && + ((node.parent.kind === 209 || node.parent.kind === 215) && node.parent.moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } case 7: - if (node.parent.kind == 154 && node.parent.argumentExpression === node) { + if (node.parent.kind == 156 && node.parent.argumentExpression === node) { var objectType = checkExpression(node.parent.expression); if (objectType === unknownType) return undefined; @@ -16703,7 +17807,7 @@ var ts; return undefined; } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 219) { + if (location && location.kind === 225) { return resolveEntityName(location.name, 107455); } return undefined; @@ -16712,37 +17816,37 @@ var ts; if (isInsideWithStatementBody(node)) { return unknownType; } + if (isTypeNodeOrHeritageClauseElement(node)) { + return getTypeFromTypeNodeOrHeritageClauseElement(node); + } if (ts.isExpression(node)) { return getTypeOfExpression(node); } - if (isTypeNode(node)) { - return getTypeFromTypeNode(node); - } if (isTypeDeclaration(node)) { var symbol = getSymbolOfNode(node); return getDeclaredTypeOfSymbol(symbol); } if (isTypeDeclarationName(node)) { - var _symbol = getSymbolInfo(node); - return _symbol && getDeclaredTypeOfSymbol(_symbol); + var symbol = getSymbolInfo(node); + return symbol && getDeclaredTypeOfSymbol(symbol); } if (ts.isDeclaration(node)) { - var _symbol_1 = getSymbolOfNode(node); - return getTypeOfSymbol(_symbol_1); + var symbol = getSymbolOfNode(node); + return getTypeOfSymbol(symbol); } if (ts.isDeclarationName(node)) { - var _symbol_2 = getSymbolInfo(node); - return _symbol_2 && getTypeOfSymbol(_symbol_2); + var symbol = getSymbolInfo(node); + return symbol && getTypeOfSymbol(symbol); } if (isInRightSideOfImportOrExportAssignment(node)) { - var _symbol_3 = getSymbolInfo(node); - var declaredType = _symbol_3 && getDeclaredTypeOfSymbol(_symbol_3); - return declaredType !== unknownType ? declaredType : getTypeOfSymbol(_symbol_3); + var symbol = getSymbolInfo(node); + var declaredType = symbol && getDeclaredTypeOfSymbol(symbol); + return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); } return unknownType; } function getTypeOfExpression(expr) { - if (isRightSideOfQualifiedNameOrPropertyAccess(expr)) { + if (ts.isRightSideOfQualifiedNameOrPropertyAccess(expr)) { expr = expr.parent; } return checkExpression(expr); @@ -16762,9 +17866,9 @@ var ts; function getRootSymbols(symbol) { if (symbol.flags & 268435456) { var symbols = []; - var _name = symbol.name; + var name_10 = symbol.name; ts.forEach(getSymbolLinks(symbol).unionType.types, function (t) { - symbols.push(getPropertyOfType(t, _name)); + symbols.push(getPropertyOfType(t, name_10)); }); return symbols; } @@ -16777,179 +17881,99 @@ var ts; return [symbol]; } function isExternalModuleSymbol(symbol) { - return symbol.flags & 512 && symbol.declarations.length === 1 && symbol.declarations[0].kind === 221; + return symbol.flags & 512 && symbol.declarations.length === 1 && symbol.declarations[0].kind === 227; } - function isNodeDescendentOf(node, ancestor) { - while (node) { - if (node === ancestor) - return true; - node = node.parent; + function getAliasNameSubstitution(symbol, getGeneratedNameForNode) { + if (languageVersion >= 2) { + return undefined; } - return false; - } - function isUniqueLocalName(name, container) { - for (var node = container; isNodeDescendentOf(node, container); node = node.nextContainer) { - if (node.locals && ts.hasProperty(node.locals, name)) { - if (node.locals[name].flags & (107455 | 1048576 | 8388608)) { - return false; - } + var node = getDeclarationOfAliasSymbol(symbol); + if (node) { + if (node.kind === 210) { + return getGeneratedNameForNode(node.parent) + ".default"; } - } - return true; - } - function getGeneratedNamesForSourceFile(sourceFile) { - var links = getNodeLinks(sourceFile); - var generatedNames = links.generatedNames; - if (!generatedNames) { - generatedNames = links.generatedNames = {}; - generateNames(sourceFile); - } - return generatedNames; - function generateNames(node) { - switch (node.kind) { - case 195: - case 196: - generateNameForFunctionOrClassDeclaration(node); - break; - case 200: - generateNameForModuleOrEnum(node); - generateNames(node.body); - break; - case 199: - generateNameForModuleOrEnum(node); - break; - case 204: - generateNameForImportDeclaration(node); - break; - case 210: - generateNameForExportDeclaration(node); - break; - case 209: - generateNameForExportAssignment(node); - break; - case 221: - case 201: - ts.forEach(node.statements, generateNames); - break; - } - } - function isExistingName(name) { - return ts.hasProperty(globals, name) || ts.hasProperty(sourceFile.identifiers, name) || ts.hasProperty(generatedNames, name); - } - function makeUniqueName(baseName) { - var _name = ts.generateUniqueName(baseName, isExistingName); - return generatedNames[_name] = _name; - } - function assignGeneratedName(node, name) { - getNodeLinks(node).generatedName = ts.unescapeIdentifier(name); - } - function generateNameForFunctionOrClassDeclaration(node) { - if (!node.name) { - assignGeneratedName(node, makeUniqueName("default")); - } - } - function generateNameForModuleOrEnum(node) { - if (node.name.kind === 64) { - var _name = node.name.text; - assignGeneratedName(node, isUniqueLocalName(_name, node) ? _name : makeUniqueName(_name)); - } - } - function generateNameForImportOrExportDeclaration(node) { - var expr = ts.getExternalModuleName(node); - var baseName = expr.kind === 8 ? - ts.escapeIdentifier(ts.makeIdentifierFromModuleName(expr.text)) : "module"; - assignGeneratedName(node, makeUniqueName(baseName)); - } - function generateNameForImportDeclaration(node) { - if (node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 207) { - generateNameForImportOrExportDeclaration(node); - } - } - function generateNameForExportDeclaration(node) { - if (node.moduleSpecifier) { - generateNameForImportOrExportDeclaration(node); - } - } - function generateNameForExportAssignment(node) { - if (node.expression.kind !== 64) { - assignGeneratedName(node, makeUniqueName("default")); + if (node.kind === 213) { + var moduleName = getGeneratedNameForNode(node.parent.parent.parent); + var propertyName = node.propertyName || node.name; + return moduleName + "." + ts.unescapeIdentifier(propertyName.text); } } } - function getGeneratedNameForNode(node) { - var links = getNodeLinks(node); - if (!links.generatedName) { - getGeneratedNamesForSourceFile(getSourceFile(node)); - } - return links.generatedName; - } - function getLocalNameOfContainer(container) { - return getGeneratedNameForNode(container); - } - function getLocalNameForImportDeclaration(node) { - return getGeneratedNameForNode(node); - } - function getAliasNameSubstitution(symbol) { - var declaration = getDeclarationOfAliasSymbol(symbol); - if (declaration && declaration.kind === 208) { - var moduleName = getGeneratedNameForNode(declaration.parent.parent.parent); - var propertyName = declaration.propertyName || declaration.name; - return moduleName + "." + ts.unescapeIdentifier(propertyName.text); - } - } - function getExportNameSubstitution(symbol, location) { + function getExportNameSubstitution(symbol, location, getGeneratedNameForNode) { if (isExternalModuleSymbol(symbol.parent)) { + if (languageVersion >= 2) { + return undefined; + } return "exports." + ts.unescapeIdentifier(symbol.name); } var node = location; var containerSymbol = getParentOfSymbol(symbol); while (node) { - if ((node.kind === 200 || node.kind === 199) && getSymbolOfNode(node) === containerSymbol) { + if ((node.kind === 205 || node.kind === 204) && getSymbolOfNode(node) === containerSymbol) { return getGeneratedNameForNode(node) + "." + ts.unescapeIdentifier(symbol.name); } node = node.parent; } } - function getExpressionNameSubstitution(node) { - var symbol = getNodeLinks(node).resolvedSymbol; + function getExpressionNameSubstitution(node, getGeneratedNameForNode) { + var symbol = getNodeLinks(node).resolvedSymbol || (ts.isDeclarationName(node) ? getSymbolOfNode(node.parent) : undefined); if (symbol) { if (symbol.parent) { - return getExportNameSubstitution(symbol, node.parent); + return getExportNameSubstitution(symbol, node.parent, getGeneratedNameForNode); } var exportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); if (symbol !== exportSymbol && !(exportSymbol.flags & 944)) { - return getExportNameSubstitution(exportSymbol, node.parent); + return getExportNameSubstitution(exportSymbol, node.parent, getGeneratedNameForNode); } if (symbol.flags & 8388608) { - return getAliasNameSubstitution(symbol); + return getAliasNameSubstitution(symbol, getGeneratedNameForNode); } } } - function hasExportDefaultValue(node) { - var symbol = getResolvedExportAssignmentSymbol(getSymbolOfNode(node)); - return symbol && symbol !== unknownSymbol && symbolIsValue(symbol) && !isConstEnumSymbol(symbol); + function isValueAliasDeclaration(node) { + switch (node.kind) { + case 208: + case 210: + case 211: + case 213: + case 217: + return isAliasResolvedToValue(getSymbolOfNode(node)); + case 215: + var exportClause = node.exportClause; + return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); + case 214: + return node.expression && node.expression.kind === 65 ? isAliasResolvedToValue(getSymbolOfNode(node)) : true; + } + return false; } function isTopLevelValueImportEqualsWithEntityName(node) { - if (node.parent.kind !== 221 || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node.parent.kind !== 227 || !ts.isInternalModuleImportEqualsDeclaration(node)) { return false; } - return isAliasResolvedToValue(getSymbolOfNode(node)); + var isValue = isAliasResolvedToValue(getSymbolOfNode(node)); + return isValue && node.moduleReference && !ts.nodeIsMissing(node.moduleReference); } function isAliasResolvedToValue(symbol) { var target = resolveAlias(symbol); - return target !== unknownSymbol && target.flags & 107455 && !isConstEnumOrConstEnumOnlyModule(target); + if (target === unknownSymbol && compilerOptions.separateCompilation) { + return true; + } + return target !== unknownSymbol && target && target.flags & 107455 && !isConstEnumOrConstEnumOnlyModule(target); } function isConstEnumOrConstEnumOnlyModule(s) { return isConstEnumSymbol(s) || s.constEnumOnlyModule; } - function isReferencedAliasDeclaration(node) { - if (isAliasSymbolDeclaration(node)) { + function isReferencedAliasDeclaration(node, checkChildren) { + if (ts.isAliasSymbolDeclaration(node)) { var symbol = getSymbolOfNode(node); if (getSymbolLinks(symbol).referenced) { return true; } } - return ts.forEachChild(node, isReferencedAliasDeclaration); + if (checkChildren) { + return ts.forEachChild(node, function (node) { return isReferencedAliasDeclaration(node, checkChildren); }); + } + return false; } function isImplementationOfOverload(node) { if (ts.nodeIsPresent(node.body)) { @@ -16968,15 +17992,13 @@ var ts; return getNodeLinks(node).enumMemberValue; } function getConstantValue(node) { - if (node.kind === 220) { + if (node.kind === 226) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; if (symbol && (symbol.flags & 8)) { - var declaration = symbol.valueDeclaration; - var constantValue; - if (declaration.kind === 220) { - return getEnumMemberValue(declaration); + if (ts.isConstEnumDeclaration(symbol.valueDeclaration.parent)) { + return getEnumMemberValue(symbol.valueDeclaration); } } return undefined; @@ -16992,42 +18014,48 @@ var ts; var signature = getSignatureFromDeclaration(signatureDeclaration); getSymbolDisplayBuilder().buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags); } - function isUnknownIdentifier(location, name) { - ts.Debug.assert(!ts.nodeIsSynthesized(location), "isUnknownIdentifier called with a synthesized location"); - return !resolveName(location, name, 107455, undefined, undefined) && - !ts.hasProperty(getGeneratedNamesForSourceFile(getSourceFile(location)), name); + function writeTypeOfExpression(expr, enclosingDeclaration, flags, writer) { + var type = getTypeOfExpression(expr); + getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); + } + function hasGlobalName(name) { + return ts.hasProperty(globals, name); + } + function resolvesToSomeValue(location, name) { + ts.Debug.assert(!ts.nodeIsSynthesized(location), "resolvesToSomeValue called with a synthesized location"); + return !!resolveName(location, name, 107455, undefined, undefined); } function getBlockScopedVariableId(n) { ts.Debug.assert(!ts.nodeIsSynthesized(n)); - if (n.parent.kind === 153 && - n.parent.name === n) { - return undefined; - } - if (n.parent.kind === 150 && - n.parent.propertyName === n) { - return undefined; - } - var declarationSymbol = (n.parent.kind === 193 && n.parent.name === n) || - n.parent.kind === 150 - ? getSymbolOfNode(n.parent) - : undefined; - var symbol = declarationSymbol || + var isVariableDeclarationOrBindingElement = n.parent.kind === 152 || (n.parent.kind === 198 && 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 !== 217; + symbol.valueDeclaration.parent.kind !== 223; if (isLetOrConst) { getSymbolLinks(symbol); return symbol.id; } return undefined; } + function instantiateSingleCallFunctionType(functionType, typeArguments) { + if (functionType === unknownType) { + return unknownType; + } + var signature = getSingleCallSignature(functionType); + if (!signature) { + return unknownType; + } + var instantiatedSignature = getSignatureInstantiation(signature, typeArguments); + return getOrCreateTypeFromSignature(instantiatedSignature); + } function createResolver() { return { - getGeneratedNameForNode: getGeneratedNameForNode, getExpressionNameSubstitution: getExpressionNameSubstitution, - hasExportDefaultValue: hasExportDefaultValue, + isValueAliasDeclaration: isValueAliasDeclaration, + hasGlobalName: hasGlobalName, isReferencedAliasDeclaration: isReferencedAliasDeclaration, getNodeCheckFlags: getNodeCheckFlags, isTopLevelValueImportEqualsWithEntityName: isTopLevelValueImportEqualsWithEntityName, @@ -17035,10 +18063,12 @@ var ts; isImplementationOfOverload: isImplementationOfOverload, writeTypeOfDeclaration: writeTypeOfDeclaration, writeReturnTypeOfSignatureDeclaration: writeReturnTypeOfSignatureDeclaration, + writeTypeOfExpression: writeTypeOfExpression, isSymbolAccessible: isSymbolAccessible, isEntityNameVisible: isEntityNameVisible, getConstantValue: getConstantValue, - isUnknownIdentifier: isUnknownIdentifier, + resolvesToSomeValue: resolvesToSomeValue, + collectLinkedAliases: collectLinkedAliases, getBlockScopedVariableId: getBlockScopedVariableId }; } @@ -17063,6 +18093,11 @@ var ts; globalNumberType = getGlobalType("Number"); globalBooleanType = getGlobalType("Boolean"); globalRegExpType = getGlobalType("RegExp"); + globalTypedPropertyDescriptorType = getTypeOfGlobalSymbol(getGlobalTypeSymbol("TypedPropertyDescriptor"), 1); + globalClassDecoratorType = getGlobalType("ClassDecorator"); + globalPropertyDecoratorType = getGlobalType("PropertyDecorator"); + globalMethodDecoratorType = getGlobalType("MethodDecorator"); + globalParameterDecoratorType = getGlobalType("ParameterDecorator"); if (languageVersion >= 2) { globalTemplateStringsArrayType = getGlobalType("TemplateStringsArray"); globalESSymbolType = getGlobalType("Symbol"); @@ -17076,28 +18111,46 @@ var ts; } anyArrayType = createArrayType(anyType); } + function checkGrammarDecorators(node) { + if (!node.decorators) { + return false; + } + if (!ts.nodeCanBeDecorated(node)) { + return grammarErrorOnNode(node, ts.Diagnostics.Decorators_are_not_valid_here); + } + else if (languageVersion < 1) { + return grammarErrorOnNode(node, ts.Diagnostics.Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher); + } + else if (node.kind === 136 || node.kind === 137) { + var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); + if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { + return grammarErrorOnNode(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); + } + } + return false; + } function checkGrammarModifiers(node) { switch (node.kind) { - case 134: + case 136: + case 137: case 135: - case 133: - case 130: - case 129: case 132: case 131: - case 138: - case 196: - case 197: - case 200: - case 199: - case 175: - case 195: - case 198: + case 134: + case 133: + case 140: + case 201: + case 202: + case 205: case 204: + case 180: + case 200: case 203: - case 210: case 209: - case 128: + case 208: + case 215: + case 214: + case 129: break; default: return false; @@ -17107,17 +18160,17 @@ var ts; } var lastStatic, lastPrivate, lastProtected, lastDeclare; var flags = 0; - for (var _i = 0, _a = node.modifiers, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; switch (modifier.kind) { + case 109: case 108: case 107: - case 106: var text = void 0; - if (modifier.kind === 108) { + if (modifier.kind === 109) { text = "public"; } - else if (modifier.kind === 107) { + else if (modifier.kind === 108) { text = "protected"; lastProtected = modifier; } @@ -17131,50 +18184,50 @@ var ts; else if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); } - else if (node.parent.kind === 201 || node.parent.kind === 221) { + else if (node.parent.kind === 206 || node.parent.kind === 227) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); } flags |= ts.modifierToFlag(modifier.kind); break; - case 109: + case 110: if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static"); } - else if (node.parent.kind === 201 || node.parent.kind === 221) { + else if (node.parent.kind === 206 || node.parent.kind === 227) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); } - else if (node.kind === 128) { + else if (node.kind === 129) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } flags |= 128; lastStatic = modifier; break; - case 77: + case 78: if (flags & 1) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "export"); } else if (flags & 2) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); } - else if (node.parent.kind === 196) { + else if (node.parent.kind === 201) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 128) { + else if (node.kind === 129) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1; break; - case 114: + case 115: if (flags & 2) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); } - else if (node.parent.kind === 196) { + else if (node.parent.kind === 201) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 128) { + else if (node.kind === 129) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 201) { + else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 206) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 2; @@ -17182,7 +18235,7 @@ var ts; break; } } - if (node.kind === 133) { + if (node.kind === 135) { if (flags & 128) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -17193,13 +18246,13 @@ var ts; return grammarErrorOnNode(lastPrivate, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); } } - else if ((node.kind === 204 || node.kind === 203) && flags & 2) { + else if ((node.kind === 209 || node.kind === 208) && flags & 2) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 197 && flags & 2) { + else if (node.kind === 202 && flags & 2) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); } - else if (node.kind === 128 && (flags & 112) && ts.isBindingPattern(node.name)) { + else if (node.kind === 129 && (flags & 112) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_a_binding_pattern); } } @@ -17211,15 +18264,14 @@ var ts; return grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Trailing_comma_not_allowed); } } - function checkGrammarTypeParameterList(node, typeParameters) { + function checkGrammarTypeParameterList(node, typeParameters, file) { if (checkGrammarForDisallowedTrailingComma(typeParameters)) { return true; } if (typeParameters && typeParameters.length === 0) { var start = typeParameters.pos - "<".length; - var sourceFile = ts.getSourceFileOfNode(node); - var end = ts.skipTrivia(sourceFile.text, typeParameters.end) + ">".length; - return grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Type_parameter_list_cannot_be_empty); + var end = ts.skipTrivia(file.text, typeParameters.end) + ">".length; + return grammarErrorAtPos(file, start, end - start, ts.Diagnostics.Type_parameter_list_cannot_be_empty); } } function checkGrammarParameterList(parameters) { @@ -17255,7 +18307,20 @@ var ts; } } function checkGrammarFunctionLikeDeclaration(node) { - return checkGrammarModifiers(node) || checkGrammarTypeParameterList(node, node.typeParameters) || checkGrammarParameterList(node.parameters); + var file = ts.getSourceFileOfNode(node); + return checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarTypeParameterList(node, node.typeParameters, file) || + checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file); + } + function checkGrammarArrowFunction(node, file) { + if (node.kind === 163) { + var arrowFunction = node; + var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; + var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; + if (startLine !== endLine) { + return grammarErrorOnNode(arrowFunction.equalsGreaterThanToken, ts.Diagnostics.Line_terminator_not_permitted_before_arrow); + } + } + return false; } function checkGrammarIndexSignatureParameters(node) { var parameter = node.parameters[0]; @@ -17282,7 +18347,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 !== 120 && parameter.type.kind !== 118) { + if (parameter.type.kind !== 121 && parameter.type.kind !== 119) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); } if (!node.type) { @@ -17295,7 +18360,7 @@ var ts; } } function checkGrammarIndexSignature(node) { - checkGrammarModifiers(node) || checkGrammarIndexSignatureParameters(node) || checkGrammarForIndexSignatureModifier(node); + return checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarIndexSignatureParameters(node) || checkGrammarForIndexSignatureModifier(node); } function checkGrammarForAtLeastOneTypeArgument(node, typeArguments) { if (typeArguments && typeArguments.length === 0) { @@ -17312,9 +18377,9 @@ var ts; function checkGrammarForOmittedArgument(node, arguments) { if (arguments) { var sourceFile = ts.getSourceFileOfNode(node); - for (var _i = 0, _n = arguments.length; _i < _n; _i++) { + for (var _i = 0; _i < arguments.length; _i++) { var arg = arguments[_i]; - if (arg.kind === 172) { + if (arg.kind === 175) { return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -17338,10 +18403,10 @@ var ts; function checkGrammarClassDeclarationHeritageClauses(node) { var seenExtendsClause = false; var seenImplementsClause = false; - if (!checkGrammarModifiers(node) && node.heritageClauses) { - for (var _i = 0, _a = node.heritageClauses, _n = _a.length; _i < _n; _i++) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && node.heritageClauses) { + for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) { var heritageClause = _a[_i]; - if (heritageClause.token === 78) { + if (heritageClause.token === 79) { if (seenExtendsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen); } @@ -17354,7 +18419,7 @@ var ts; seenExtendsClause = true; } else { - ts.Debug.assert(heritageClause.token === 102); + ts.Debug.assert(heritageClause.token === 103); if (seenImplementsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.implements_clause_already_seen); } @@ -17367,16 +18432,16 @@ var ts; function checkGrammarInterfaceDeclaration(node) { var seenExtendsClause = false; if (node.heritageClauses) { - for (var _i = 0, _a = node.heritageClauses, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) { var heritageClause = _a[_i]; - if (heritageClause.token === 78) { + if (heritageClause.token === 79) { if (seenExtendsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen); } seenExtendsClause = true; } else { - ts.Debug.assert(heritageClause.token === 102); + ts.Debug.assert(heritageClause.token === 103); return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.Interface_declaration_cannot_have_implements_clause); } checkGrammarHeritageClause(heritageClause); @@ -17385,11 +18450,11 @@ var ts; return false; } function checkGrammarComputedPropertyName(node) { - if (node.kind !== 126) { + if (node.kind !== 127) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 167 && computedPropertyName.expression.operatorToken.kind === 23) { + if (computedPropertyName.expression.kind === 169 && computedPropertyName.expression.operatorToken.kind === 23) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } @@ -17413,54 +18478,54 @@ var ts; var SetAccesor = 4; var GetOrSetAccessor = GetAccessor | SetAccesor; var inStrictMode = (node.parserContextFlags & 1) !== 0; - for (var _i = 0, _a = node.properties, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - var _name = prop.name; - if (prop.kind === 172 || - _name.kind === 126) { - checkGrammarComputedPropertyName(_name); + var name_11 = prop.name; + if (prop.kind === 175 || + name_11.kind === 127) { + checkGrammarComputedPropertyName(name_11); continue; } var currentKind = void 0; - if (prop.kind === 218 || prop.kind === 219) { + if (prop.kind === 224 || prop.kind === 225) { checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); - if (_name.kind === 7) { - checkGrammarNumbericLiteral(_name); + if (name_11.kind === 7) { + checkGrammarNumbericLiteral(name_11); } currentKind = Property; } - else if (prop.kind === 132) { + else if (prop.kind === 134) { currentKind = Property; } - else if (prop.kind === 134) { + else if (prop.kind === 136) { currentKind = GetAccessor; } - else if (prop.kind === 135) { + else if (prop.kind === 137) { currentKind = SetAccesor; } else { ts.Debug.fail("Unexpected syntax kind:" + prop.kind); } - if (!ts.hasProperty(seen, _name.text)) { - seen[_name.text] = currentKind; + if (!ts.hasProperty(seen, name_11.text)) { + seen[name_11.text] = currentKind; } else { - var existingKind = seen[_name.text]; + var existingKind = seen[name_11.text]; if (currentKind === Property && existingKind === Property) { if (inStrictMode) { - grammarErrorOnNode(_name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); + grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); } } else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[_name.text] = currentKind | existingKind; + seen[name_11.text] = currentKind | existingKind; } else { - return grammarErrorOnNode(_name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + return grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); } } else { - return grammarErrorOnNode(_name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + return grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); } } } @@ -17469,27 +18534,27 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.initializer.kind === 194) { + if (forInOrOfStatement.initializer.kind === 199) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { if (variableList.declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 182 + var diagnostic = forInOrOfStatement.kind === 187 ? 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 === 182 + var diagnostic = forInOrOfStatement.kind === 187 ? 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); + return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var _diagnostic_1 = forInOrOfStatement.kind === 182 + var diagnostic = forInOrOfStatement.kind === 187 ? 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_1); + return grammarErrorOnNode(firstDeclaration, diagnostic); } } } @@ -17509,10 +18574,10 @@ var ts; else if (accessor.typeParameters) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } - else if (kind === 134 && accessor.parameters.length) { + else if (kind === 136 && accessor.parameters.length) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); } - else if (kind === 135) { + else if (kind === 137) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -17537,7 +18602,7 @@ var ts; } } function checkGrammarForNonSymbolComputedProperty(node, message) { - if (node.kind === 126 && !ts.isWellKnownSymbolSyntactically(node.expression)) { + if (node.kind === 127 && !ts.isWellKnownSymbolSyntactically(node.expression)) { return grammarErrorOnNode(node, message); } } @@ -17547,7 +18612,7 @@ var ts; checkGrammarForGenerator(node)) { return true; } - if (node.parent.kind === 152) { + if (node.parent.kind === 154) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { return true; } @@ -17555,7 +18620,7 @@ var ts; return grammarErrorAtPos(getSourceFile(node), node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } } - if (node.parent.kind === 196) { + if (node.parent.kind === 201) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { return true; } @@ -17566,22 +18631,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 === 197) { + else if (node.parent.kind === 202) { 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 === 143) { + else if (node.parent.kind === 145) { 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 181: - case 182: - case 183: - case 179: - case 180: + case 186: + case 187: + case 188: + case 184: + case 185: return true; - case 189: + case 194: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -17593,9 +18658,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 189: + case 194: if (node.label && current.label.text === node.label.text) { - var isMisplacedContinueLabel = node.kind === 184 + var isMisplacedContinueLabel = node.kind === 189 && !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); @@ -17603,8 +18668,8 @@ var ts; return false; } break; - case 188: - if (node.kind === 185 && !node.label) { + case 193: + if (node.kind === 190 && !node.label) { return false; } break; @@ -17617,16 +18682,16 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 185 + var message = node.kind === 190 ? 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 === 185 + var message = node.kind === 190 ? 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); + return grammarErrorOnNode(node, message); } } function checkGrammarBindingElement(node) { @@ -17642,11 +18707,8 @@ var ts; return checkGrammarEvalOrArgumentsInStrictMode(node, node.name); } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 182 && node.parent.parent.kind !== 183) { + if (node.parent.parent.kind !== 187 && node.parent.parent.kind !== 188) { if (ts.isInAmbientContext(node)) { - if (ts.isBindingPattern(node.name)) { - return grammarErrorOnNode(node, ts.Diagnostics.Destructuring_declarations_are_not_allowed_in_ambient_contexts); - } if (node.initializer) { var equalsTokenLength = "=".length; return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.initializer.pos - equalsTokenLength, equalsTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); @@ -17666,14 +18728,14 @@ var ts; checkGrammarEvalOrArgumentsInStrictMode(node, node.name); } function checkGrammarNameInLetOrConstDeclarations(name) { - if (name.kind === 64) { + if (name.kind === 65) { if (name.text === "let") { return grammarErrorOnNode(name, ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations); } } else { var elements = name.elements; - for (var _i = 0, _n = elements.length; _i < _n; _i++) { + for (var _i = 0; _i < elements.length; _i++) { var element = elements[_i]; checkGrammarNameInLetOrConstDeclarations(element.name); } @@ -17690,15 +18752,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 178: - case 179: - case 180: - case 187: - case 181: - case 182: case 183: + case 184: + case 185: + case 192: + case 186: + case 187: + case 188: return false; - case 189: + case 194: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -17714,7 +18776,7 @@ var ts; } } function isIntegerLiteral(expression) { - if (expression.kind === 165) { + if (expression.kind === 167) { var unaryExpression = expression; if (unaryExpression.operator === 33 || unaryExpression.operator === 34) { expression = unaryExpression.operand; @@ -17731,9 +18793,9 @@ var ts; if (!enumIsConst) { var inConstantEnumMemberSection = true; var inAmbientContext = ts.isInAmbientContext(enumDecl); - for (var _i = 0, _a = enumDecl.members, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = enumDecl.members; _i < _a.length; _i++) { var node = _a[_i]; - if (node.name.kind === 126) { + if (node.name.kind === 127) { hasError = grammarErrorOnNode(node.name, ts.Diagnostics.Computed_property_names_are_not_allowed_in_enums); } else if (inAmbientContext) { @@ -17776,7 +18838,7 @@ var ts; } } function checkGrammarEvalOrArgumentsInStrictMode(contextNode, name) { - if (name && name.kind === 64) { + if (name && name.kind === 65) { var identifier = name; if (contextNode && (contextNode.parserContextFlags & 1) && ts.isEvalOrArgumentsIdentifier(identifier)) { var nameText = ts.declarationNameToString(identifier); @@ -17795,18 +18857,18 @@ var ts; } } function checkGrammarProperty(node) { - if (node.parent.kind === 196) { + if (node.parent.kind === 201) { 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 === 197) { + else if (node.parent.kind === 202) { 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 === 143) { + else if (node.parent.kind === 145) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)) { return true; } @@ -17816,20 +18878,21 @@ var ts; } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 197 || - node.kind === 204 || - node.kind === 203 || - node.kind === 210 || + if (node.kind === 202 || node.kind === 209 || - (node.flags & 2)) { + node.kind === 208 || + node.kind === 215 || + node.kind === 214 || + (node.flags & 2) || + (node.flags & (1 | 256))) { return false; } return grammarErrorOnFirstToken(node, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); } function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { - for (var _i = 0, _a = file.statements, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 175) { + if (ts.isDeclaration(decl) || decl.kind === 180) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -17848,10 +18911,10 @@ 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 === 174 || node.parent.kind === 201 || node.parent.kind === 221) { - var _links = getNodeLinks(node.parent); - if (!_links.hasReportedStatementInAmbientContext) { - return _links.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); + if (node.parent.kind === 179 || node.parent.kind === 206 || node.parent.kind === 227) { + 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); } } else { @@ -17881,251 +18944,16 @@ var ts; } ts.createTypeChecker = createTypeChecker; })(ts || (ts = {})); +/// var ts; (function (ts) { - var indentStrings = ["", " "]; - function getIndentString(level) { - if (indentStrings[level] === undefined) { - indentStrings[level] = getIndentString(level - 1) + indentStrings[1]; - } - return indentStrings[level]; - } - ts.getIndentString = getIndentString; - function getIndentSize() { - return indentStrings[1].length; - } - function shouldEmitToOwnFile(sourceFile, compilerOptions) { - if (!ts.isDeclarationFile(sourceFile)) { - if ((ts.isExternalModule(sourceFile) || !compilerOptions.out) && !ts.fileExtensionIs(sourceFile.fileName, ".js")) { - return true; - } - return false; - } - return false; - } - ts.shouldEmitToOwnFile = shouldEmitToOwnFile; - function isExternalModuleOrDeclarationFile(sourceFile) { - return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); - } - ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; - function createTextWriter(newLine) { - var output = ""; - var indent = 0; - var lineStart = true; - var lineCount = 0; - var linePos = 0; - function write(s) { - if (s && s.length) { - if (lineStart) { - output += getIndentString(indent); - lineStart = false; - } - output += s; - } - } - function rawWrite(s) { - if (s !== undefined) { - if (lineStart) { - lineStart = false; - } - output += s; - } - } - function writeLiteral(s) { - if (s && s.length) { - write(s); - var lineStartsOfS = ts.computeLineStarts(s); - if (lineStartsOfS.length > 1) { - lineCount = lineCount + lineStartsOfS.length - 1; - linePos = output.length - s.length + lineStartsOfS[lineStartsOfS.length - 1]; - } - } - } - function writeLine() { - if (!lineStart) { - output += newLine; - lineCount++; - linePos = output.length; - lineStart = true; - } - } - function writeTextOfNode(sourceFile, node) { - write(ts.getSourceTextOfNodeFromSourceFile(sourceFile, node)); - } - return { - write: write, - rawWrite: rawWrite, - writeTextOfNode: writeTextOfNode, - writeLiteral: writeLiteral, - writeLine: writeLine, - increaseIndent: function () { return indent++; }, - decreaseIndent: function () { return indent--; }, - getIndent: function () { return indent; }, - getTextPos: function () { return output.length; }, - getLine: function () { return lineCount + 1; }, - getColumn: function () { return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; }, - getText: function () { return output; } - }; - } - function getLineOfLocalPosition(currentSourceFile, pos) { - return ts.getLineAndCharacterOfPosition(currentSourceFile, pos).line; - } - function emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments) { - if (leadingComments && leadingComments.length && node.pos !== leadingComments[0].pos && - getLineOfLocalPosition(currentSourceFile, node.pos) !== getLineOfLocalPosition(currentSourceFile, leadingComments[0].pos)) { - writer.writeLine(); - } - } - function emitComments(currentSourceFile, writer, comments, trailingSeparator, newLine, writeComment) { - var emitLeadingSpace = !trailingSeparator; - ts.forEach(comments, function (comment) { - if (emitLeadingSpace) { - writer.write(" "); - emitLeadingSpace = false; - } - writeComment(currentSourceFile, writer, comment, newLine); - if (comment.hasTrailingNewLine) { - writer.writeLine(); - } - else if (trailingSeparator) { - writer.write(" "); - } - else { - emitLeadingSpace = true; - } - }); - } - function writeCommentRange(currentSourceFile, writer, comment, newLine) { - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42) { - var firstCommentLineAndCharacter = ts.getLineAndCharacterOfPosition(currentSourceFile, comment.pos); - var lineCount = ts.getLineStarts(currentSourceFile).length; - var firstCommentLineIndent; - for (var pos = comment.pos, currentLine = firstCommentLineAndCharacter.line; pos < comment.end; currentLine++) { - var nextLineStart = (currentLine + 1) === lineCount - ? currentSourceFile.text.length + 1 - : ts.getStartPositionOfLine(currentLine + 1, currentSourceFile); - if (pos !== comment.pos) { - if (firstCommentLineIndent === undefined) { - firstCommentLineIndent = calculateIndent(ts.getStartPositionOfLine(firstCommentLineAndCharacter.line, currentSourceFile), comment.pos); - } - var currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); - var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(pos, nextLineStart); - if (spacesToEmit > 0) { - var numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); - var indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); - writer.rawWrite(indentSizeSpaceString); - while (numberOfSingleSpacesToEmit) { - writer.rawWrite(" "); - numberOfSingleSpacesToEmit--; - } - } - else { - writer.rawWrite(""); - } - } - writeTrimmedCurrentLine(pos, nextLineStart); - pos = nextLineStart; - } - } - else { - writer.write(currentSourceFile.text.substring(comment.pos, comment.end)); - } - function writeTrimmedCurrentLine(pos, nextLineStart) { - var end = Math.min(comment.end, nextLineStart - 1); - var currentLineText = currentSourceFile.text.substring(pos, end).replace(/^\s+|\s+$/g, ''); - if (currentLineText) { - writer.write(currentLineText); - if (end !== comment.end) { - writer.writeLine(); - } - } - else { - writer.writeLiteral(newLine); - } - } - function calculateIndent(pos, end) { - var currentLineIndent = 0; - for (; pos < end && ts.isWhiteSpace(currentSourceFile.text.charCodeAt(pos)); pos++) { - if (currentSourceFile.text.charCodeAt(pos) === 9) { - currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); - } - else { - currentLineIndent++; - } - } - return currentLineIndent; - } - } - function getFirstConstructorWithBody(node) { - return ts.forEach(node.members, function (member) { - if (member.kind === 133 && ts.nodeIsPresent(member.body)) { - return member; - } - }); - } - function getAllAccessorDeclarations(declarations, accessor) { - var firstAccessor; - var getAccessor; - var setAccessor; - if (ts.hasDynamicName(accessor)) { - firstAccessor = accessor; - if (accessor.kind === 134) { - getAccessor = accessor; - } - else if (accessor.kind === 135) { - setAccessor = accessor; - } - else { - ts.Debug.fail("Accessor has wrong kind"); - } - } - else { - ts.forEach(declarations, function (member) { - if ((member.kind === 134 || member.kind === 135) - && (member.flags & 128) === (accessor.flags & 128)) { - var memberName = ts.getPropertyNameForPropertyNameNode(member.name); - var accessorName = ts.getPropertyNameForPropertyNameNode(accessor.name); - if (memberName === accessorName) { - if (!firstAccessor) { - firstAccessor = member; - } - if (member.kind === 134 && !getAccessor) { - getAccessor = member; - } - if (member.kind === 135 && !setAccessor) { - setAccessor = member; - } - } - } - }); - } - return { - firstAccessor: firstAccessor, - getAccessor: getAccessor, - setAccessor: setAccessor - }; - } - function getSourceFilePathInNewDir(sourceFile, host, newDirPath) { - var sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.fileName, host.getCurrentDirectory()); - sourceFilePath = sourceFilePath.replace(host.getCommonSourceDirectory(), ""); - return ts.combinePaths(newDirPath, sourceFilePath); - } - function getOwnEmitOutputFilePath(sourceFile, host, extension) { - var compilerOptions = host.getCompilerOptions(); - var emitOutputFilePathWithoutExtension; - if (compilerOptions.outDir) { - emitOutputFilePathWithoutExtension = ts.removeFileExtension(getSourceFilePathInNewDir(sourceFile, host, compilerOptions.outDir)); - } - else { - emitOutputFilePathWithoutExtension = ts.removeFileExtension(sourceFile.fileName); - } - return emitOutputFilePathWithoutExtension + extension; - } - function writeFile(host, diagnostics, fileName, data, writeByteOrderMark) { - host.writeFile(fileName, data, writeByteOrderMark, function (hostErrorMessage) { - diagnostics.push(ts.createCompilerDiagnostic(ts.Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage)); - }); + function getDeclarationDiagnostics(host, resolver, targetSourceFile) { + var diagnostics = []; + var jsFilePath = ts.getOwnEmitOutputFilePath(targetSourceFile, host, ".js"); + emitDeclarations(host, resolver, diagnostics, jsFilePath, targetSourceFile); + return diagnostics; } + ts.getDeclarationDiagnostics = getDeclarationDiagnostics; function emitDeclarations(host, resolver, diagnostics, jsFilePath, root) { var newLine = host.getNewLine(); var compilerOptions = host.getCompilerOptions(); @@ -18141,7 +18969,8 @@ var ts; var reportedDeclarationError = false; var emitJsDocComments = compilerOptions.removeComments ? function (declaration) { } : writeJsDocComments; var emit = compilerOptions.stripInternal ? stripInternal : emitNode; - var aliasDeclarationEmitInfo = []; + var moduleElementDeclarationEmitInfo = []; + var asynchronousSubModuleDeclarationEmitInfo; var referencePathsOutput = ""; if (root) { if (!compilerOptions.noResolve) { @@ -18149,25 +18978,38 @@ var ts; ts.forEach(root.referencedFiles, function (fileReference) { var referencedFile = ts.tryResolveScriptReference(host, root, fileReference); if (referencedFile && ((referencedFile.flags & 2048) || - shouldEmitToOwnFile(referencedFile, compilerOptions) || + ts.shouldEmitToOwnFile(referencedFile, compilerOptions) || !addedGlobalFileReference)) { writeReferencePath(referencedFile); - if (!isExternalModuleOrDeclarationFile(referencedFile)) { + if (!ts.isExternalModuleOrDeclarationFile(referencedFile)) { addedGlobalFileReference = true; } } }); } emitSourceFile(root); + if (moduleElementDeclarationEmitInfo.length) { + var oldWriter = writer; + ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { + if (aliasEmitInfo.isVisible) { + ts.Debug.assert(aliasEmitInfo.node.kind === 209); + createAndSetNewTextWriterWithSymbolWriter(); + ts.Debug.assert(aliasEmitInfo.indent === 0); + writeImportDeclaration(aliasEmitInfo.node); + aliasEmitInfo.asynchronousOutput = writer.getText(); + } + }); + setWriter(oldWriter); + } } 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); @@ -18180,7 +19022,7 @@ var ts; } return { reportedDeclarationError: reportedDeclarationError, - aliasDeclarationEmitInfo: aliasDeclarationEmitInfo, + moduleElementDeclarationEmitInfo: moduleElementDeclarationEmitInfo, synchronousDeclarationOutput: writer.getText(), referencePathsOutput: referencePathsOutput }; @@ -18199,17 +19041,17 @@ var ts; } } function createAndSetNewTextWriterWithSymbolWriter() { - var _writer = createTextWriter(newLine); - _writer.trackSymbol = trackSymbol; - _writer.writeKeyword = _writer.write; - _writer.writeOperator = _writer.write; - _writer.writePunctuation = _writer.write; - _writer.writeSpace = _writer.write; - _writer.writeStringLiteral = _writer.writeLiteral; - _writer.writeParameter = _writer.write; - _writer.writeSymbol = _writer.write; - setWriter(_writer); - return _writer; + var writer = ts.createTextWriter(newLine); + writer.trackSymbol = trackSymbol; + writer.writeKeyword = writer.write; + writer.writeOperator = writer.write; + writer.writePunctuation = writer.write; + writer.writeSpace = writer.write; + writer.writeStringLiteral = writer.writeLiteral; + writer.writeParameter = writer.write; + writer.writeSymbol = writer.write; + setWriter(writer); + return writer; } function setWriter(newWriter) { writer = newWriter; @@ -18219,17 +19061,43 @@ var ts; increaseIndent = newWriter.increaseIndent; decreaseIndent = newWriter.decreaseIndent; } - function writeAsychronousImportEqualsDeclarations(importEqualsDeclarations) { + function writeAsynchronousModuleElements(nodes) { var oldWriter = writer; - ts.forEach(importEqualsDeclarations, function (aliasToWrite) { - var aliasEmitInfo = ts.forEach(aliasDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.declaration === aliasToWrite ? declEmitInfo : undefined; }); - if (aliasEmitInfo) { - createAndSetNewTextWriterWithSymbolWriter(); - for (var declarationIndent = aliasEmitInfo.indent; declarationIndent; declarationIndent--) { - increaseIndent(); + ts.forEach(nodes, function (declaration) { + var nodeToCheck; + if (declaration.kind === 198) { + nodeToCheck = declaration.parent.parent; + } + else if (declaration.kind === 212 || declaration.kind === 213 || declaration.kind === 210) { + ts.Debug.fail("We should be getting ImportDeclaration instead to write"); + } + else { + nodeToCheck = declaration; + } + var moduleElementEmitInfo = ts.forEach(moduleElementDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.node === nodeToCheck ? declEmitInfo : undefined; }); + if (!moduleElementEmitInfo && asynchronousSubModuleDeclarationEmitInfo) { + moduleElementEmitInfo = ts.forEach(asynchronousSubModuleDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.node === nodeToCheck ? declEmitInfo : undefined; }); + } + if (moduleElementEmitInfo) { + if (moduleElementEmitInfo.node.kind === 209) { + moduleElementEmitInfo.isVisible = true; + } + else { + createAndSetNewTextWriterWithSymbolWriter(); + for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { + increaseIndent(); + } + if (nodeToCheck.kind === 205) { + ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); + asynchronousSubModuleDeclarationEmitInfo = []; + } + writeModuleElement(nodeToCheck); + if (nodeToCheck.kind === 205) { + moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; + asynchronousSubModuleDeclarationEmitInfo = undefined; + } + moduleElementEmitInfo.asynchronousOutput = writer.getText(); } - writeImportEqualsDeclaration(aliasToWrite); - aliasEmitInfo.asynchronousOutput = writer.getText(); } }); setWriter(oldWriter); @@ -18237,7 +19105,7 @@ var ts; function handleSymbolAccessibilityError(symbolAccesibilityResult) { if (symbolAccesibilityResult.accessibility === 0) { if (symbolAccesibilityResult && symbolAccesibilityResult.aliasesToMakeVisible) { - writeAsychronousImportEqualsDeclarations(symbolAccesibilityResult.aliasesToMakeVisible); + writeAsynchronousModuleElements(symbolAccesibilityResult.aliasesToMakeVisible); } } else { @@ -18277,30 +19145,32 @@ var ts; } } function emitLines(nodes) { - for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + for (var _i = 0; _i < nodes.length; _i++) { var node = nodes[_i]; emit(node); } } - function emitSeparatedList(nodes, separator, eachNodeEmitFn) { + function emitSeparatedList(nodes, separator, eachNodeEmitFn, canEmitFn) { var currentWriterPos = writer.getTextPos(); - for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + for (var _i = 0; _i < nodes.length; _i++) { var node = nodes[_i]; - if (currentWriterPos !== writer.getTextPos()) { - write(separator); + if (!canEmitFn || canEmitFn(node)) { + if (currentWriterPos !== writer.getTextPos()) { + write(separator); + } + currentWriterPos = writer.getTextPos(); + eachNodeEmitFn(node); } - currentWriterPos = writer.getTextPos(); - eachNodeEmitFn(node); } } - function emitCommaList(nodes, eachNodeEmitFn) { - emitSeparatedList(nodes, ", ", eachNodeEmitFn); + function emitCommaList(nodes, eachNodeEmitFn, canEmitFn) { + emitSeparatedList(nodes, ", ", eachNodeEmitFn, canEmitFn); } function writeJsDocComments(declaration) { if (declaration) { var jsDocComments = ts.getJsDocComments(declaration, currentSourceFile); - emitNewLineBeforeLeadingComments(currentSourceFile, writer, declaration, jsDocComments); - emitComments(currentSourceFile, writer, jsDocComments, true, newLine, writeCommentRange); + ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, declaration, jsDocComments); + ts.emitComments(currentSourceFile, writer, jsDocComments, true, newLine, ts.writeCommentRange); } } function emitTypeWithNewGetSymbolAccessibilityDiagnostic(type, getSymbolAccessibilityDiagnostic) { @@ -18309,51 +19179,63 @@ var ts; } function emitType(type) { switch (type.kind) { - case 111: - case 120: - case 118: case 112: case 121: - case 98: + case 119: + case 113: + case 122: + case 99: case 8: return writeTextOfNode(currentSourceFile, type); - case 139: - return emitTypeReference(type); - case 142: - return emitTypeQuery(type); - case 144: - return emitArrayType(type); - case 145: - return emitTupleType(type); - case 146: - return emitUnionType(type); - case 147: - return emitParenType(type); - case 140: + case 177: + return emitHeritageClauseElement(type); case 141: - return emitSignatureDeclarationWithJsDocComments(type); + 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); + case 142: case 143: + return emitSignatureDeclarationWithJsDocComments(type); + case 145: return emitTypeLiteral(type); - case 64: + case 65: return emitEntityName(type); - case 125: + case 126: return emitEntityName(type); - default: - ts.Debug.fail("Unknown type annotation: " + type.kind); } function emitEntityName(entityName) { - var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 203 ? entityName.parent : enclosingDeclaration); + var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 208 ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); writeEntityName(entityName); function writeEntityName(entityName) { - if (entityName.kind === 64) { + if (entityName.kind === 65) { writeTextOfNode(currentSourceFile, entityName); } else { - var qualifiedName = entityName; - writeEntityName(qualifiedName.left); + var left = entityName.kind === 126 ? entityName.left : entityName.expression; + var right = entityName.kind === 126 ? entityName.right : entityName.name; + writeEntityName(left); write("."); - writeTextOfNode(currentSourceFile, qualifiedName.right); + writeTextOfNode(currentSourceFile, right); + } + } + } + function emitHeritageClauseElement(node) { + if (ts.isSupportedHeritageClauseElement(node)) { + ts.Debug.assert(node.expression.kind === 65 || node.expression.kind === 155); + emitEntityName(node.expression); + if (node.typeArguments) { + write("<"); + emitCommaList(node.typeArguments, emitType); + write(">"); } } } @@ -18404,16 +19286,100 @@ var ts; } function emitExportAssignment(node) { write(node.isExportEquals ? "export = " : "export default "); - writeTextOfNode(currentSourceFile, node.expression); + if (node.expression.kind === 65) { + writeTextOfNode(currentSourceFile, node.expression); + } + else { + write(": "); + if (node.type) { + emitType(node.type); + } + else { + writer.getSymbolAccessibilityDiagnostic = getDefaultExportAccessibilityDiagnostic; + resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, 2, writer); + } + } write(";"); writeLine(); + if (node.expression.kind === 65) { + var nodes = resolver.collectLinkedAliases(node.expression); + writeAsynchronousModuleElements(nodes); + } + function getDefaultExportAccessibilityDiagnostic(diagnostic) { + return { + diagnosticMessage: ts.Diagnostics.Default_export_of_the_module_has_or_is_using_private_name_0, + errorNode: node + }; + } + } + function isModuleElementVisible(node) { + return resolver.isDeclarationVisible(node); + } + function emitModuleElement(node, isModuleElementVisible) { + if (isModuleElementVisible) { + writeModuleElement(node); + } + else if (node.kind === 208 || + (node.parent.kind === 227 && ts.isExternalModule(currentSourceFile))) { + var isVisible; + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 227) { + asynchronousSubModuleDeclarationEmitInfo.push({ + node: node, + outputPos: writer.getTextPos(), + indent: writer.getIndent(), + isVisible: isVisible + }); + } + else { + if (node.kind === 209) { + var importDeclaration = node; + if (importDeclaration.importClause) { + isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || + isVisibleNamedBinding(importDeclaration.importClause.namedBindings); + } + } + moduleElementDeclarationEmitInfo.push({ + node: node, + outputPos: writer.getTextPos(), + indent: writer.getIndent(), + isVisible: isVisible + }); + } + } + } + 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); + case 203: + return writeTypeAliasDeclaration(node); + case 204: + return writeEnumDeclaration(node); + case 205: + return writeModuleDeclaration(node); + case 208: + return writeImportEqualsDeclaration(node); + case 209: + return writeImportDeclaration(node); + default: + ts.Debug.fail("Unknown symbol kind"); + } } function emitModuleElementDeclarationFlags(node) { if (node.parent === currentSourceFile) { if (node.flags & 1) { write("export "); } - if (node.kind !== 197) { + if (node.flags & 256) { + write("default "); + } + else if (node.kind !== 202) { write("declare "); } } @@ -18429,18 +19395,6 @@ var ts; write("static "); } } - function emitImportEqualsDeclaration(node) { - var nodeEmitInfo = { - declaration: node, - outputPos: writer.getTextPos(), - indent: writer.getIndent(), - hasWritten: resolver.isDeclarationVisible(node) - }; - aliasDeclarationEmitInfo.push(nodeEmitInfo); - if (nodeEmitInfo.hasWritten) { - writeImportEqualsDeclaration(node); - } - } function writeImportEqualsDeclaration(node) { emitJsDocComments(node); if (node.flags & 1) { @@ -18467,40 +19421,110 @@ var ts; }; } } - function emitModuleDeclaration(node) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - write("module "); - writeTextOfNode(currentSourceFile, node.name); - while (node.body.kind !== 201) { - node = node.body; - write("."); - writeTextOfNode(currentSourceFile, node.name); + function isVisibleNamedBinding(namedBindings) { + if (namedBindings) { + if (namedBindings.kind === 211) { + return resolver.isDeclarationVisible(namedBindings); + } + else { + return ts.forEach(namedBindings.elements, function (namedImport) { return resolver.isDeclarationVisible(namedImport); }); } - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - write(" {"); - writeLine(); - increaseIndent(); - emitLines(node.body.statements); - decreaseIndent(); - write("}"); - writeLine(); - enclosingDeclaration = prevEnclosingDeclaration; } } - function emitTypeAliasDeclaration(node) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - write("type "); - writeTextOfNode(currentSourceFile, node.name); - write(" = "); - emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.type, getTypeAliasDeclarationVisibilityError); - write(";"); - writeLine(); + function writeImportDeclaration(node) { + if (!node.importClause && !(node.flags & 1)) { + return; } + emitJsDocComments(node); + if (node.flags & 1) { + write("export "); + } + write("import "); + if (node.importClause) { + var currentWriterPos = writer.getTextPos(); + if (node.importClause.name && resolver.isDeclarationVisible(node.importClause)) { + writeTextOfNode(currentSourceFile, node.importClause.name); + } + if (node.importClause.namedBindings && isVisibleNamedBinding(node.importClause.namedBindings)) { + if (currentWriterPos !== writer.getTextPos()) { + write(", "); + } + if (node.importClause.namedBindings.kind === 211) { + write("* as "); + writeTextOfNode(currentSourceFile, node.importClause.namedBindings.name); + } + else { + write("{ "); + emitCommaList(node.importClause.namedBindings.elements, emitImportOrExportSpecifier, resolver.isDeclarationVisible); + write(" }"); + } + } + write(" from "); + } + writeTextOfNode(currentSourceFile, node.moduleSpecifier); + write(";"); + writer.writeLine(); + } + function emitImportOrExportSpecifier(node) { + if (node.propertyName) { + writeTextOfNode(currentSourceFile, node.propertyName); + write(" as "); + } + writeTextOfNode(currentSourceFile, node.name); + } + function emitExportSpecifier(node) { + emitImportOrExportSpecifier(node); + var nodes = resolver.collectLinkedAliases(node.propertyName || node.name); + writeAsynchronousModuleElements(nodes); + } + function emitExportDeclaration(node) { + emitJsDocComments(node); + write("export "); + if (node.exportClause) { + write("{ "); + emitCommaList(node.exportClause.elements, emitExportSpecifier); + write(" }"); + } + else { + write("*"); + } + if (node.moduleSpecifier) { + write(" from "); + writeTextOfNode(currentSourceFile, node.moduleSpecifier); + } + write(";"); + writer.writeLine(); + } + function writeModuleDeclaration(node) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + write("module "); + writeTextOfNode(currentSourceFile, node.name); + while (node.body.kind !== 206) { + node = node.body; + write("."); + writeTextOfNode(currentSourceFile, node.name); + } + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node; + write(" {"); + writeLine(); + increaseIndent(); + emitLines(node.body.statements); + decreaseIndent(); + write("}"); + writeLine(); + enclosingDeclaration = prevEnclosingDeclaration; + } + function writeTypeAliasDeclaration(node) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + write("type "); + writeTextOfNode(currentSourceFile, node.name); + write(" = "); + emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.type, getTypeAliasDeclarationVisibilityError); + write(";"); + writeLine(); function getTypeAliasDeclarationVisibilityError(symbolAccesibilityResult) { return { diagnosticMessage: ts.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1, @@ -18509,23 +19533,21 @@ var ts; }; } } - function emitEnumDeclaration(node) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - if (ts.isConst(node)) { - write("const "); - } - write("enum "); - writeTextOfNode(currentSourceFile, node.name); - write(" {"); - writeLine(); - increaseIndent(); - emitLines(node.members); - decreaseIndent(); - write("}"); - writeLine(); + function writeEnumDeclaration(node) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + if (ts.isConst(node)) { + write("const "); } + write("enum "); + writeTextOfNode(currentSourceFile, node.name); + write(" {"); + writeLine(); + increaseIndent(); + emitLines(node.members); + decreaseIndent(); + write("}"); + writeLine(); } function emitEnumMemberDeclaration(node) { emitJsDocComments(node); @@ -18539,7 +19561,7 @@ var ts; writeLine(); } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 132 && (node.parent.flags & 32); + return node.parent.kind === 134 && (node.parent.flags & 32); } function emitTypeParameters(typeParameters) { function emitTypeParameter(node) { @@ -18549,15 +19571,15 @@ var ts; writeTextOfNode(currentSourceFile, node.name); if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); - if (node.parent.kind === 140 || - node.parent.kind === 141 || - (node.parent.parent && node.parent.parent.kind === 143)) { - ts.Debug.assert(node.parent.kind === 132 || - node.parent.kind === 131 || - node.parent.kind === 140 || - node.parent.kind === 141 || - node.parent.kind === 136 || - node.parent.kind === 137); + 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 || + node.parent.kind === 143 || + node.parent.kind === 138 || + node.parent.kind === 139); emitType(node.constraint); } else { @@ -18567,31 +19589,31 @@ var ts; function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.parent.kind) { - case 196: + case 201: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 197: + case 202: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 137: + case 139: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 136: + case 138: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 132: - case 131: + 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 === 196) { + else if (node.parent.parent.kind === 201) { 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 195: + case 200: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: @@ -18616,10 +19638,12 @@ var ts; emitCommaList(typeReferences, emitTypeOfTypeReference); } function emitTypeOfTypeReference(node) { - emitTypeWithNewGetSymbolAccessibilityDiagnostic(node, getHeritageClauseVisibilityError); + if (ts.isSupportedHeritageClauseElement(node)) { + emitTypeWithNewGetSymbolAccessibilityDiagnostic(node, getHeritageClauseVisibilityError); + } function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.parent.parent.kind === 196) { + if (node.parent.parent.kind === 201) { 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; @@ -18635,7 +19659,7 @@ var ts; } } } - function emitClassDeclaration(node) { + function writeClassDeclaration(node) { function emitParameterProperties(constructorDeclaration) { if (constructorDeclaration) { ts.forEach(constructorDeclaration.parameters, function (param) { @@ -18645,49 +19669,45 @@ var ts; }); } } - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - write("class "); - writeTextOfNode(currentSourceFile, node.name); - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - emitTypeParameters(node.typeParameters); - var baseTypeNode = ts.getClassBaseTypeNode(node); - if (baseTypeNode) { - emitHeritageClause([baseTypeNode], false); - } - emitHeritageClause(ts.getClassImplementedTypeNodes(node), true); - write(" {"); - writeLine(); - increaseIndent(); - emitParameterProperties(getFirstConstructorWithBody(node)); - emitLines(node.members); - decreaseIndent(); - write("}"); - writeLine(); - enclosingDeclaration = prevEnclosingDeclaration; + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + write("class "); + writeTextOfNode(currentSourceFile, node.name); + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node; + emitTypeParameters(node.typeParameters); + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); + if (baseTypeNode) { + emitHeritageClause([baseTypeNode], false); } + emitHeritageClause(ts.getClassImplementsHeritageClauseElements(node), true); + write(" {"); + writeLine(); + increaseIndent(); + emitParameterProperties(ts.getFirstConstructorWithBody(node)); + emitLines(node.members); + decreaseIndent(); + write("}"); + writeLine(); + enclosingDeclaration = prevEnclosingDeclaration; } - function emitInterfaceDeclaration(node) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - write("interface "); - writeTextOfNode(currentSourceFile, node.name); - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - emitTypeParameters(node.typeParameters); - emitHeritageClause(ts.getInterfaceBaseTypeNodes(node), false); - write(" {"); - writeLine(); - increaseIndent(); - emitLines(node.members); - decreaseIndent(); - write("}"); - writeLine(); - enclosingDeclaration = prevEnclosingDeclaration; - } + function writeInterfaceDeclaration(node) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + write("interface "); + writeTextOfNode(currentSourceFile, node.name); + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node; + emitTypeParameters(node.typeParameters); + emitHeritageClause(ts.getInterfaceBaseTypeNodes(node), false); + write(" {"); + writeLine(); + increaseIndent(); + emitLines(node.members); + decreaseIndent(); + write("}"); + writeLine(); + enclosingDeclaration = prevEnclosingDeclaration; } function emitPropertyDeclaration(node) { if (ts.hasDynamicName(node)) { @@ -18700,54 +19720,90 @@ var ts; writeLine(); } function emitVariableDeclaration(node) { - if (node.kind !== 193 || resolver.isDeclarationVisible(node)) { - writeTextOfNode(currentSourceFile, node.name); - if ((node.kind === 130 || node.kind === 129) && ts.hasQuestionToken(node)) { - write("?"); + if (node.kind !== 198 || resolver.isDeclarationVisible(node)) { + if (ts.isBindingPattern(node.name)) { + emitBindingPattern(node.name); } - if ((node.kind === 130 || node.kind === 129) && node.parent.kind === 143) { - emitTypeOfVariableDeclarationFromTypeLiteral(node); - } - else if (!(node.flags & 32)) { - writeTypeOfDeclaration(node, node.type, getVariableDeclarationTypeVisibilityError); + else { + writeTextOfNode(currentSourceFile, node.name); + if ((node.kind === 132 || node.kind === 131) && ts.hasQuestionToken(node)) { + write("?"); + } + if ((node.kind === 132 || node.kind === 131) && node.parent.kind === 145) { + emitTypeOfVariableDeclarationFromTypeLiteral(node); + } + else if (!(node.flags & 32)) { + writeTypeOfDeclaration(node, node.type, getVariableDeclarationTypeVisibilityError); + } } } - function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage; - if (node.kind === 193) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { + if (node.kind === 198) { + 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 === 130 || node.kind === 129) { + else if (node.kind === 132 || node.kind === 131) { if (node.flags & 128) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : 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 === 196) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + else if (node.parent.kind === 201) { + 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 : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; } else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + return symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; } } + } + function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult) { + var diagnosticMessage = getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult); return diagnosticMessage !== undefined ? { diagnosticMessage: diagnosticMessage, errorNode: node, typeName: node.name } : undefined; } + function emitBindingPattern(bindingPattern) { + var elements = []; + for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { + var element = _a[_i]; + if (element.kind !== 175) { + elements.push(element); + } + } + emitCommaList(elements, emitBindingElement); + } + function emitBindingElement(bindingElement) { + function getBindingElementTypeVisibilityError(symbolAccesibilityResult) { + var diagnosticMessage = getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult); + return diagnosticMessage !== undefined ? { + diagnosticMessage: diagnosticMessage, + errorNode: bindingElement, + typeName: bindingElement.name + } : undefined; + } + if (bindingElement.name) { + if (ts.isBindingPattern(bindingElement.name)) { + emitBindingPattern(bindingElement.name); + } + else { + writeTextOfNode(currentSourceFile, bindingElement.name); + writeTypeOfDeclaration(bindingElement, undefined, getBindingElementTypeVisibilityError); + } + } + } } function emitTypeOfVariableDeclarationFromTypeLiteral(node) { if (node.type) { @@ -18755,30 +19811,30 @@ var ts; emitType(node.type); } } - function emitVariableStatement(node) { - var hasDeclarationWithEmit = ts.forEach(node.declarationList.declarations, function (varDeclaration) { return resolver.isDeclarationVisible(varDeclaration); }); - if (hasDeclarationWithEmit) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - if (ts.isLet(node.declarationList)) { - write("let "); - } - else if (ts.isConst(node.declarationList)) { - write("const "); - } - else { - write("var "); - } - emitCommaList(node.declarationList.declarations, emitVariableDeclaration); - write(";"); - writeLine(); + function isVariableStatementVisible(node) { + return ts.forEach(node.declarationList.declarations, function (varDeclaration) { return resolver.isDeclarationVisible(varDeclaration); }); + } + function writeVariableStatement(node) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + if (ts.isLet(node.declarationList)) { + write("let "); } + else if (ts.isConst(node.declarationList)) { + write("const "); + } + else { + write("var "); + } + emitCommaList(node.declarationList.declarations, emitVariableDeclaration, resolver.isDeclarationVisible); + write(";"); + writeLine(); } function emitAccessorDeclaration(node) { if (ts.hasDynamicName(node)) { return; } - var accessors = getAllAccessorDeclarations(node.parent.members, node); + var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); var accessorWithTypeAnnotation; if (node === accessors.firstAccessor) { emitJsDocComments(accessors.getAccessor); @@ -18789,7 +19845,7 @@ var ts; accessorWithTypeAnnotation = node; var type = getTypeAnnotationFromAccessor(node); if (!type) { - var anotherAccessor = node.kind === 134 ? accessors.setAccessor : accessors.getAccessor; + var anotherAccessor = node.kind === 136 ? accessors.setAccessor : accessors.getAccessor; type = getTypeAnnotationFromAccessor(anotherAccessor); if (type) { accessorWithTypeAnnotation = anotherAccessor; @@ -18802,7 +19858,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 134 + return accessor.kind === 136 ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type @@ -18811,7 +19867,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (accessorWithTypeAnnotation.kind === 135) { + if (accessorWithTypeAnnotation.kind === 137) { 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 : @@ -18851,24 +19907,23 @@ var ts; } } } - function emitFunctionDeclaration(node) { + function writeFunctionDeclaration(node) { if (ts.hasDynamicName(node)) { return; } - if ((node.kind !== 195 || resolver.isDeclarationVisible(node)) && - !resolver.isImplementationOfOverload(node)) { + if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 195) { + if (node.kind === 200) { emitModuleElementDeclarationFlags(node); } - else if (node.kind === 132) { + else if (node.kind === 134) { emitClassMemberDeclarationFlags(node); } - if (node.kind === 195) { + if (node.kind === 200) { write("function "); writeTextOfNode(currentSourceFile, node.name); } - else if (node.kind === 133) { + else if (node.kind === 135) { write("constructor"); } else { @@ -18885,11 +19940,11 @@ var ts; emitSignatureDeclaration(node); } function emitSignatureDeclaration(node) { - if (node.kind === 137 || node.kind === 141) { + if (node.kind === 139 || node.kind === 143) { write("new "); } emitTypeParameters(node.typeParameters); - if (node.kind === 138) { + if (node.kind === 140) { write("["); } else { @@ -18898,20 +19953,20 @@ var ts; var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 138) { + if (node.kind === 140) { write("]"); } else { write(")"); } - var isFunctionTypeOrConstructorType = node.kind === 140 || node.kind === 141; - if (isFunctionTypeOrConstructorType || node.parent.kind === 143) { + var isFunctionTypeOrConstructorType = node.kind === 142 || node.kind === 143; + if (isFunctionTypeOrConstructorType || node.parent.kind === 145) { if (node.type) { write(isFunctionTypeOrConstructorType ? " => " : ": "); emitType(node.type); } } - else if (node.kind !== 133 && !(node.flags & 32)) { + else if (node.kind !== 135 && !(node.flags & 32)) { writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); } enclosingDeclaration = prevEnclosingDeclaration; @@ -18922,23 +19977,23 @@ var ts; function getReturnTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.kind) { - case 137: + case 139: 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 136: + case 138: 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 138: + case 140: 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 132: - case 131: + case 134: + case 133: if (node.flags & 128) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? @@ -18946,7 +20001,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 === 196) { + else if (node.parent.kind === 201) { 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 : @@ -18959,7 +20014,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 195: + case 200: 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 : @@ -18982,7 +20037,7 @@ var ts; write("..."); } if (ts.isBindingPattern(node.name)) { - write("_" + ts.indexOf(node.parent.parameters, node)); + emitBindingPattern(node.name); } else { writeTextOfNode(currentSourceFile, node.name); @@ -18991,129 +20046,204 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 140 || - node.parent.kind === 141 || - node.parent.parent.kind === 143) { + if (node.parent.kind === 142 || + node.parent.kind === 143 || + node.parent.parent.kind === 145) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!(node.parent.flags & 32)) { writeTypeOfDeclaration(node, node.type, getParameterDeclarationTypeVisibilityError); } function getParameterDeclarationTypeVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage; + var diagnosticMessage = getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult); + return diagnosticMessage !== undefined ? { + diagnosticMessage: diagnosticMessage, + errorNode: node, + typeName: node.name + } : undefined; + } + function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { switch (node.parent.kind) { - case 133: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + case 135: + 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; - break; - case 137: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + case 139: + 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; - break; - case 136: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + case 138: + 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; - break; - case 132: - case 131: + case 134: + case 133: if (node.parent.flags & 128) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : 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 === 196) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + else if (node.parent.parent.kind === 201) { + 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 : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + return symbolAccesibilityResult.errorModuleName ? 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; } - break; - case 195: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + case 200: + 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 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - break; default: ts.Debug.fail("This is unknown parent for parameter: " + node.parent.kind); } - return { - diagnosticMessage: diagnosticMessage, - errorNode: node, - typeName: node.name - }; + } + function emitBindingPattern(bindingPattern) { + if (bindingPattern.kind === 150) { + write("{"); + emitCommaList(bindingPattern.elements, emitBindingElement); + write("}"); + } + else if (bindingPattern.kind === 151) { + write("["); + var elements = bindingPattern.elements; + emitCommaList(elements, emitBindingElement); + if (elements && elements.hasTrailingComma) { + write(", "); + } + write("]"); + } + } + function emitBindingElement(bindingElement) { + function getBindingElementTypeVisibilityError(symbolAccesibilityResult) { + var diagnosticMessage = getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult); + return diagnosticMessage !== undefined ? { + diagnosticMessage: diagnosticMessage, + errorNode: bindingElement, + typeName: bindingElement.name + } : undefined; + } + if (bindingElement.kind === 175) { + write(" "); + } + else if (bindingElement.kind === 152) { + if (bindingElement.propertyName) { + writeTextOfNode(currentSourceFile, bindingElement.propertyName); + write(": "); + emitBindingPattern(bindingElement.name); + } + else if (bindingElement.name) { + if (ts.isBindingPattern(bindingElement.name)) { + emitBindingPattern(bindingElement.name); + } + else { + ts.Debug.assert(bindingElement.name.kind === 65); + if (bindingElement.dotDotDotToken) { + write("..."); + } + writeTextOfNode(currentSourceFile, bindingElement.name); + } + } + } } } 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 209: + return emitModuleElement(node, !node.importClause); + case 215: + return emitExportDeclaration(node); + case 135: + case 134: case 133: - case 195: + return writeFunctionDeclaration(node); + case 139: + case 138: + case 140: + return emitSignatureDeclarationWithJsDocComments(node); + case 136: + case 137: + return emitAccessorDeclaration(node); case 132: case 131: - return emitFunctionDeclaration(node); - case 137: - case 136: - case 138: - return emitSignatureDeclarationWithJsDocComments(node); - case 134: - case 135: - return emitAccessorDeclaration(node); - case 175: - return emitVariableStatement(node); - case 130: - case 129: return emitPropertyDeclaration(node); - case 197: - return emitInterfaceDeclaration(node); - case 196: - return emitClassDeclaration(node); - case 198: - return emitTypeAliasDeclaration(node); - case 220: + case 226: return emitEnumMemberDeclaration(node); - case 199: - return emitEnumDeclaration(node); - case 200: - return emitModuleDeclaration(node); - case 203: - return emitImportEqualsDeclaration(node); - case 209: + case 214: return emitExportAssignment(node); - case 221: + case 227: return emitSourceFile(node); } } function writeReferencePath(referencedFile) { var declFileName = referencedFile.flags & 2048 ? referencedFile.fileName - : shouldEmitToOwnFile(referencedFile, compilerOptions) - ? getOwnEmitOutputFilePath(referencedFile, host, ".d.ts") + : ts.shouldEmitToOwnFile(referencedFile, compilerOptions) + ? ts.getOwnEmitOutputFilePath(referencedFile, host, ".d.ts") : ts.removeFileExtension(compilerOptions.out) + ".d.ts"; declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(jsFilePath)), declFileName, host.getCurrentDirectory(), host.getCanonicalFileName, false); referencePathsOutput += "/// " + newLine; } } - function getDeclarationDiagnostics(host, resolver, targetSourceFile) { - var diagnostics = []; - var jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, host, ".js"); - emitDeclarations(host, resolver, diagnostics, jsFilePath, targetSourceFile); - return diagnostics; + function writeDeclarationFile(jsFilePath, sourceFile, host, resolver, diagnostics) { + var emitDeclarationResult = emitDeclarations(host, resolver, diagnostics, jsFilePath, sourceFile); + if (!emitDeclarationResult.reportedDeclarationError) { + var declarationOutput = emitDeclarationResult.referencePathsOutput + + getDeclarationOutput(emitDeclarationResult.synchronousDeclarationOutput, emitDeclarationResult.moduleElementDeclarationEmitInfo); + ts.writeFile(host, diagnostics, ts.removeFileExtension(jsFilePath) + ".d.ts", declarationOutput, host.getCompilerOptions().emitBOM); + } + function getDeclarationOutput(synchronousDeclarationOutput, moduleElementDeclarationEmitInfo) { + var appliedSyncOutputPos = 0; + var declarationOutput = ""; + ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { + if (aliasEmitInfo.asynchronousOutput) { + declarationOutput += synchronousDeclarationOutput.substring(appliedSyncOutputPos, aliasEmitInfo.outputPos); + declarationOutput += getDeclarationOutput(aliasEmitInfo.asynchronousOutput, aliasEmitInfo.subModuleElementDeclarationEmitInfo); + appliedSyncOutputPos = aliasEmitInfo.outputPos; + } + }); + declarationOutput += synchronousDeclarationOutput.substring(appliedSyncOutputPos); + return declarationOutput; + } } - ts.getDeclarationDiagnostics = getDeclarationDiagnostics; + ts.writeDeclarationFile = writeDeclarationFile; +})(ts || (ts = {})); +/// +/// +var ts; +(function (ts) { + function isExternalModuleOrDeclarationFile(sourceFile) { + return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); + } + ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; + var TempFlags; + (function (TempFlags) { + TempFlags[TempFlags["Auto"] = 0] = "Auto"; + TempFlags[TempFlags["CountMask"] = 268435455] = "CountMask"; + TempFlags[TempFlags["_i"] = 268435456] = "_i"; + TempFlags[TempFlags["_n"] = 536870912] = "_n"; + })(TempFlags || (TempFlags = {})); function emitFiles(resolver, host, targetSourceFile) { var compilerOptions = host.getCompilerOptions(); var languageVersion = compilerOptions.target || 0; @@ -19122,8 +20252,8 @@ var ts; var newLine = host.getNewLine(); if (targetSourceFile === undefined) { ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (shouldEmitToOwnFile(sourceFile, compilerOptions)) { - var jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, ".js"); + if (ts.shouldEmitToOwnFile(sourceFile, compilerOptions)) { + var jsFilePath = ts.getOwnEmitOutputFilePath(sourceFile, host, ".js"); emitFile(jsFilePath, sourceFile); } }); @@ -19132,8 +20262,8 @@ var ts; } } else { - if (shouldEmitToOwnFile(targetSourceFile, compilerOptions)) { - var jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, host, ".js"); + if (ts.shouldEmitToOwnFile(targetSourceFile, compilerOptions)) { + var jsFilePath = ts.getOwnEmitOutputFilePath(targetSourceFile, host, ".js"); emitFile(jsFilePath, targetSourceFile); } else if (!ts.isDeclarationFile(targetSourceFile) && compilerOptions.out) { @@ -19146,35 +20276,49 @@ var ts; diagnostics: diagnostics, sourceMaps: sourceMapDataList }; + function isNodeDescendentOf(node, ancestor) { + while (node) { + if (node === ancestor) + return true; + node = node.parent; + } + return false; + } + function isUniqueLocalName(name, container) { + for (var node = container; isNodeDescendentOf(node, container); node = node.nextContainer) { + if (node.locals && ts.hasProperty(node.locals, name)) { + if (node.locals[name].flags & (107455 | 1048576 | 8388608)) { + return false; + } + } + } + return true; + } function emitJavaScript(jsFilePath, root) { - var writer = createTextWriter(newLine); + var writer = ts.createTextWriter(newLine); var write = writer.write; var writeTextOfNode = writer.writeTextOfNode; var writeLine = writer.writeLine; var increaseIndent = writer.increaseIndent; var decreaseIndent = writer.decreaseIndent; - var preserveNewLines = compilerOptions.preserveNewLines || false; var currentSourceFile; - var lastFrame; - var currentScopeNames; - var generatedBlockScopeNames; + var generatedNameSet = {}; + var nodeToGeneratedName = []; + var blockScopedVariableToGeneratedName; + var computedPropertyNamesToGeneratedNames; var extendsEmitted = false; - var tempCount = 0; + var decorateEmitted = false; + var tempFlags = 0; var tempVariables; var tempParameters; var externalImports; var exportSpecifiers; - var exportDefault; + var exportEquals; + var hasExportStars; var writeEmittedFiles = writeJavaScriptFile; - var emitLeadingComments = compilerOptions.removeComments ? function (node) { } : emitLeadingDeclarationComments; - var emitTrailingComments = compilerOptions.removeComments ? function (node) { } : emitTrailingDeclarationComments; - var emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos) { } : emitLeadingCommentsOfLocalPosition; var detachedCommentsInfo; - var emitDetachedComments = compilerOptions.removeComments ? function (node) { } : emitDetachedCommentsAtPosition; - var writeComment = writeCommentRange; - var emitNodeWithoutSourceMap = compilerOptions.removeComments ? emitNodeWithoutSourceMapWithoutComments : emitNodeWithoutSourceMapWithComments; + var writeComment = ts.writeCommentRange; var emit = emitNodeWithoutSourceMap; - var emitWithoutComments = emitNodeWithoutSourceMapWithoutComments; var emitStart = function (node) { }; var emitEnd = function (node) { }; var emitToken = emitTokenText; @@ -19201,55 +20345,108 @@ var ts; currentSourceFile = sourceFile; emit(sourceFile); } - function enterNameScope() { - var names = currentScopeNames; - currentScopeNames = undefined; - if (names) { - lastFrame = { names: names, previous: lastFrame }; - return true; - } - return false; + function isUniqueName(name) { + return !resolver.hasGlobalName(name) && + !ts.hasProperty(currentSourceFile.identifiers, name) && + !ts.hasProperty(generatedNameSet, name); } - function exitNameScope(popFrame) { - if (popFrame) { - currentScopeNames = lastFrame.names; - lastFrame = lastFrame.previous; - } - else { - currentScopeNames = undefined; - } - } - function generateUniqueNameForLocation(location, baseName) { - var _name; - if (!isExistingName(location, baseName)) { - _name = baseName; - } - else { - _name = ts.generateUniqueName(baseName, function (n) { return isExistingName(location, n); }); - } - return recordNameInCurrentScope(_name); - } - function recordNameInCurrentScope(name) { - if (!currentScopeNames) { - currentScopeNames = {}; - } - return currentScopeNames[name] = name; - } - function isExistingName(location, name) { - if (!resolver.isUnknownIdentifier(location, name)) { - return true; - } - if (currentScopeNames && ts.hasProperty(currentScopeNames, name)) { - return true; - } - var frame = lastFrame; - while (frame) { - if (ts.hasProperty(frame.names, name)) { - return true; + function makeTempVariableName(flags) { + if (flags && !(tempFlags & flags)) { + var name = flags === 268435456 ? "_i" : "_n"; + if (isUniqueName(name)) { + tempFlags |= flags; + return name; } - frame = frame.previous; } - return false; + while (true) { + var count = tempFlags & 268435455; + tempFlags++; + if (count !== 8 && count !== 13) { + var name_12 = count < 26 ? "_" + String.fromCharCode(97 + count) : "_" + (count - 26); + if (isUniqueName(name_12)) { + return name_12; + } + } + } + } + function makeUniqueName(baseName) { + if (baseName.charCodeAt(baseName.length - 1) !== 95) { + baseName += "_"; + } + var i = 1; + while (true) { + var generatedName = baseName + i; + if (isUniqueName(generatedName)) { + return generatedNameSet[generatedName] = generatedName; + } + i++; + } + } + function assignGeneratedName(node, name) { + nodeToGeneratedName[ts.getNodeId(node)] = ts.unescapeIdentifier(name); + } + function generateNameForFunctionOrClassDeclaration(node) { + if (!node.name) { + assignGeneratedName(node, makeUniqueName("default")); + } + } + function generateNameForModuleOrEnum(node) { + if (node.name.kind === 65) { + var name_13 = node.name.text; + assignGeneratedName(node, isUniqueLocalName(name_13, node) ? name_13 : makeUniqueName(name_13)); + } + } + function generateNameForImportOrExportDeclaration(node) { + var expr = ts.getExternalModuleName(node); + var baseName = expr.kind === 8 ? + ts.escapeIdentifier(ts.makeIdentifierFromModuleName(expr.text)) : "module"; + assignGeneratedName(node, makeUniqueName(baseName)); + } + function generateNameForImportDeclaration(node) { + if (node.importClause) { + generateNameForImportOrExportDeclaration(node); + } + } + function generateNameForExportDeclaration(node) { + if (node.moduleSpecifier) { + generateNameForImportOrExportDeclaration(node); + } + } + function generateNameForExportAssignment(node) { + if (node.expression && node.expression.kind !== 65) { + assignGeneratedName(node, makeUniqueName("default")); + } + } + function generateNameForNode(node) { + switch (node.kind) { + case 200: + case 201: + generateNameForFunctionOrClassDeclaration(node); + break; + case 205: + generateNameForModuleOrEnum(node); + generateNameForNode(node.body); + break; + case 204: + generateNameForModuleOrEnum(node); + break; + case 209: + generateNameForImportDeclaration(node); + break; + case 215: + generateNameForExportDeclaration(node); + break; + case 214: + generateNameForExportAssignment(node); + break; + } + } + function getGeneratedNameForNode(node) { + var nodeId = ts.getNodeId(node); + if (!nodeToGeneratedName[nodeId]) { + generateNameForNode(node); + } + return nodeToGeneratedName[nodeId]; } function initializeEmitterWithSourceMaps() { var sourceMapDir; @@ -19375,8 +20572,8 @@ var ts; if (scopeName) { var parentIndex = getSourceMapNameIndex(); if (parentIndex !== -1) { - var _name = node.name; - if (!_name || _name.kind !== 126) { + var name_14 = node.name; + if (!name_14 || name_14.kind !== 127) { scopeName = "." + scopeName; } scopeName = sourceMapData.sourceMapNames[parentIndex] + scopeName; @@ -19393,19 +20590,19 @@ var ts; if (scopeName) { recordScopeNameStart(scopeName); } - else if (node.kind === 195 || - node.kind === 160 || - node.kind === 132 || - node.kind === 131 || + else if (node.kind === 200 || + node.kind === 162 || node.kind === 134 || - node.kind === 135 || - node.kind === 200 || - node.kind === 196 || - node.kind === 199) { + node.kind === 133 || + node.kind === 136 || + node.kind === 137 || + node.kind === 205 || + node.kind === 201 || + node.kind === 204) { if (node.name) { - var _name = node.name; - scopeName = _name.kind === 126 - ? ts.getTextOfNode(_name) + var name_15 = node.name; + scopeName = name_15.kind === 127 + ? ts.getTextOfNode(name_15) : node.name.text; } recordScopeNameStart(scopeName); @@ -19420,7 +20617,7 @@ var ts; ; function writeCommentRangeWithMap(curentSourceFile, writer, comment, newLine) { recordSourceMapSpan(comment.pos); - writeCommentRange(currentSourceFile, writer, comment, newLine); + ts.writeCommentRange(currentSourceFile, writer, comment, newLine); recordSourceMapSpan(comment.end); } function serializeSourceMapContents(version, file, sourceRoot, sources, names, mappings) { @@ -19448,7 +20645,7 @@ var ts; } function writeJavaScriptAndSourceMapFile(emitOutput, writeByteOrderMark) { encodeLastRecordedSourceMapSpan(); - writeFile(host, diagnostics, sourceMapData.sourceMapFilePath, serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings), false); + ts.writeFile(host, diagnostics, sourceMapData.sourceMapFilePath, serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings), false); sourceMapDataList.push(sourceMapData); writeJavaScriptFile(emitOutput + "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL, writeByteOrderMark); } @@ -19471,7 +20668,7 @@ var ts; if (compilerOptions.mapRoot) { sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); if (root) { - sourceMapDir = ts.getDirectoryPath(getSourceFilePathInNewDir(root, host, sourceMapDir)); + sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(root, host, sourceMapDir)); } if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir); @@ -19484,32 +20681,24 @@ var ts; else { sourceMapDir = ts.getDirectoryPath(ts.normalizePath(jsFilePath)); } - function emitNodeWithSourceMap(node) { + function emitNodeWithSourceMap(node, allowGeneratedIdentifiers) { if (node) { if (ts.nodeIsSynthesized(node)) { - return emitNodeWithoutSourceMap(node); + return emitNodeWithoutSourceMap(node, false); } - if (node.kind != 221) { + if (node.kind != 227) { recordEmitNodeStartSpan(node); - emitNodeWithoutSourceMap(node); + emitNodeWithoutSourceMap(node, allowGeneratedIdentifiers); recordEmitNodeEndSpan(node); } else { recordNewSourceFileStart(node); - emitNodeWithoutSourceMap(node); + emitNodeWithoutSourceMap(node, false); } } } - function emitNodeWithSourceMapWithoutComments(node) { - if (node) { - recordEmitNodeStartSpan(node); - emitNodeWithoutSourceMapWithoutComments(node); - recordEmitNodeEndSpan(node); - } - } writeEmittedFiles = writeJavaScriptAndSourceMapFile; emit = emitNodeWithSourceMap; - emitWithoutComments = emitNodeWithSourceMapWithoutComments; emitStart = recordEmitNodeStartSpan; emitEnd = recordEmitNodeEndSpan; emitToken = writeTextWithSpanRecord; @@ -19518,24 +20707,11 @@ var ts; writeComment = writeCommentRangeWithMap; } function writeJavaScriptFile(emitOutput, writeByteOrderMark) { - writeFile(host, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); + ts.writeFile(host, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); } - function createTempVariable(location, preferredName) { - for (var name = preferredName; !name || isExistingName(location, name); tempCount++) { - var char = 97 + tempCount; - if (char === 105 || char === 110) { - continue; - } - if (tempCount < 26) { - name = "_" + String.fromCharCode(char); - } - else { - name = "_" + (tempCount - 26); - } - } - recordNameInCurrentScope(name); - var result = ts.createSynthesizedNode(64); - result.text = name; + function createTempVariable(flags) { + var result = ts.createSynthesizedNode(65); + result.text = makeTempVariableName(flags); return result; } function recordTempDeclaration(name) { @@ -19544,8 +20720,8 @@ var ts; } tempVariables.push(name); } - function createAndRecordTempVariable(location, preferredName) { - var temp = createTempVariable(location, preferredName); + function createAndRecordTempVariable(flags) { + var temp = createTempVariable(flags); recordTempDeclaration(temp); return temp; } @@ -19595,7 +20771,7 @@ var ts; function emitLinePreservingList(parent, nodes, allowTrailingComma, spacesBetweenBraces) { ts.Debug.assert(nodes.length > 0); increaseIndent(); - if (preserveNewLines && nodeStartPositionsAreOnSameLine(parent, nodes[0])) { + if (nodeStartPositionsAreOnSameLine(parent, nodes[0])) { if (spacesBetweenBraces) { write(" "); } @@ -19605,7 +20781,7 @@ var ts; } for (var i = 0, n = nodes.length; i < n; i++) { if (i) { - if (preserveNewLines && nodeEndIsOnSameLineAsNodeStart(nodes[i - 1], nodes[i])) { + if (nodeEndIsOnSameLineAsNodeStart(nodes[i - 1], nodes[i])) { write(", "); } else { @@ -19619,7 +20795,7 @@ var ts; write(","); } decreaseIndent(); - if (preserveNewLines && nodeEndPositionsAreOnSameLine(parent, ts.lastOrUndefined(nodes))) { + if (nodeEndPositionsAreOnSameLine(parent, ts.lastOrUndefined(nodes))) { if (spacesBetweenBraces) { write(" "); } @@ -19737,7 +20913,7 @@ var ts; write("]"); } function emitDownlevelTaggedTemplate(node) { - var tempVariable = createAndRecordTempVariable(node); + var tempVariable = createAndRecordTempVariable(0); write("("); emit(tempVariable); write(" = "); @@ -19750,10 +20926,10 @@ var ts; emitParenthesizedIf(node.tag, needsParenthesisForPropertyAccessOrInvocation(node.tag)); write("("); emit(tempVariable); - if (node.template.kind === 169) { + if (node.template.kind === 171) { ts.forEach(node.template.templateSpans, function (templateSpan) { write(", "); - var needsParens = templateSpan.expression.kind === 167 + var needsParens = templateSpan.expression.kind === 169 && templateSpan.expression.operatorToken.kind === 23; emitParenthesizedIf(templateSpan.expression, needsParens); }); @@ -19777,7 +20953,7 @@ var ts; } for (var i = 0, n = node.templateSpans.length; i < n; i++) { var templateSpan = node.templateSpans[i]; - var needsParens = templateSpan.expression.kind !== 159 + var needsParens = templateSpan.expression.kind !== 161 && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1; if (i > 0 || headEmitted) { write(" + "); @@ -19792,16 +20968,29 @@ var ts; write(")"); } function shouldEmitTemplateHead() { + // If this expression has an empty head literal and the first template span has a non-empty + // literal, then emitting the empty head literal is not necessary. + // `${ foo } and ${ bar }` + // can be emitted as + // foo + " and " + bar + // This is because it is only required that one of the first two operands in the emit + // output must be a string literal, so that the other operand and all following operands + // are forced into strings. + // + // If the first template span has an empty literal, then the head must still be emitted. + // `${ foo }${ bar }` + // must still be emitted as + // "" + foo + bar ts.Debug.assert(node.templateSpans.length !== 0); return node.head.text.length !== 0 || node.templateSpans[0].literal.text.length === 0; } function templateNeedsParens(template, parent) { switch (parent.kind) { - case 155: - case 156: - return parent.expression === template; case 157: + case 158: + return parent.expression === template; case 159: + case 161: return false; default: return comparePrecedenceToBinaryPlus(parent) !== -1; @@ -19809,7 +20998,7 @@ var ts; } function comparePrecedenceToBinaryPlus(expression) { switch (expression.kind) { - case 167: + case 169: switch (expression.operatorToken.kind) { case 35: case 36: @@ -19821,7 +21010,7 @@ var ts; default: return -1; } - case 168: + case 170: return -1; default: return 1; @@ -19833,11 +21022,27 @@ var ts; emit(span.literal); } function emitExpressionForPropertyName(node) { - ts.Debug.assert(node.kind !== 150); + ts.Debug.assert(node.kind !== 152); if (node.kind === 8) { emitLiteral(node); } - else if (node.kind === 126) { + else if (node.kind === 127) { + if (ts.nodeIsDecorated(node.parent)) { + if (!computedPropertyNamesToGeneratedNames) { + computedPropertyNamesToGeneratedNames = []; + } + var generatedName = computedPropertyNamesToGeneratedNames[node.id]; + if (generatedName) { + write(generatedName); + return; + } + var generatedVariable = createTempVariable(0); + generatedName = generatedVariable.text; + recordTempDeclaration(generatedVariable); + computedPropertyNamesToGeneratedNames[node.id] = generatedName; + write(generatedName); + write(" = "); + } emit(node.expression); } else { @@ -19852,38 +21057,43 @@ var ts; } } function isNotExpressionIdentifier(node) { - var _parent = node.parent; - switch (_parent.kind) { - case 128: - case 193: - case 150: - case 130: + var parent = node.parent; + switch (parent.kind) { case 129: - case 218: - case 219: - case 220: + case 198: + case 152: case 132: case 131: - case 195: + case 224: + case 225: + case 226: case 134: - case 135: - case 160: - case 196: - case 197: - case 199: + case 133: case 200: - case 203: - return _parent.name === node; - case 185: - case 184: - case 209: - return false; + case 136: + case 137: + case 162: + case 201: + case 202: + case 204: + case 205: + case 208: + case 210: + case 211: + return parent.name === node; + case 213: + case 217: + return parent.name === node || parent.propertyName === node; + case 190: case 189: + case 214: + return false; + case 194: return node.parent.label === node; } } function emitExpressionIdentifier(node) { - var substitution = resolver.getExpressionNameSubstitution(node); + var substitution = resolver.getExpressionNameSubstitution(node, getGeneratedNameForNode); if (substitution) { write(substitution); } @@ -19891,15 +21101,21 @@ var ts; writeTextOfNode(currentSourceFile, node); } } - function getBlockScopedVariableId(node) { - return !ts.nodeIsSynthesized(node) && resolver.getBlockScopedVariableId(node); + function getGeneratedNameForIdentifier(node) { + if (ts.nodeIsSynthesized(node) || !blockScopedVariableToGeneratedName) { + return undefined; + } + var variableId = resolver.getBlockScopedVariableId(node); + if (variableId === undefined) { + return undefined; + } + return blockScopedVariableToGeneratedName[variableId]; } - function emitIdentifier(node) { - var variableId = getBlockScopedVariableId(node); - if (variableId !== undefined && generatedBlockScopeNames) { - var text = generatedBlockScopeNames[variableId]; - if (text) { - write(text); + function emitIdentifier(node, allowGeneratedIdentifiers) { + if (allowGeneratedIdentifiers) { + var generatedName = getGeneratedNameForIdentifier(node); + if (generatedName) { + write(generatedName); return; } } @@ -19922,15 +21138,17 @@ var ts; } } function emitSuper(node) { - var flags = resolver.getNodeCheckFlags(node); - if (flags & 16) { - write("_super.prototype"); - } - else if (flags & 32) { - write("_super"); + if (languageVersion >= 2) { + write("super"); } else { - write("super"); + var flags = resolver.getNodeCheckFlags(node); + if (flags & 16) { + write("_super.prototype"); + } + else { + write("_super"); + } } } function emitObjectBindingPattern(node) { @@ -19947,7 +21165,7 @@ var ts; } function emitBindingElement(node) { if (node.propertyName) { - emit(node.propertyName); + emit(node.propertyName, false); write(": "); } if (node.dotDotDotToken) { @@ -19967,12 +21185,12 @@ var ts; } function needsParenthesisForPropertyAccessOrInvocation(node) { switch (node.kind) { - case 64: - case 151: + case 65: case 153: - case 154: case 155: - case 159: + case 156: + case 157: + case 161: return false; } return true; @@ -19980,8 +21198,8 @@ var ts; function emitListWithSpread(elements, multiLine, trailingComma) { var pos = 0; var group = 0; - var _length = elements.length; - while (pos < _length) { + var length = elements.length; + while (pos < length) { if (group === 1) { write(".concat("); } @@ -19989,21 +21207,21 @@ var ts; write(", "); } var e = elements[pos]; - if (e.kind === 171) { + if (e.kind === 173) { e = e.expression; emitParenthesizedIf(e, group === 0 && needsParenthesisForPropertyAccessOrInvocation(e)); pos++; } else { var i = pos; - while (i < _length && elements[i].kind !== 171) { + while (i < length && elements[i].kind !== 173) { i++; } write("["); if (multiLine) { increaseIndent(); } - emitList(elements, pos, i - pos, multiLine, trailingComma && i === _length); + emitList(elements, pos, i - pos, multiLine, trailingComma && i === length); if (multiLine) { decreaseIndent(); } @@ -20017,7 +21235,7 @@ var ts; } } function isSpreadElementExpression(node) { - return node.kind === 171; + return node.kind === 173; } function emitArrayLiteral(node) { var elements = node.elements; @@ -20038,11 +21256,11 @@ var ts; return emit(parenthesizedObjectLiteral); } function createDownlevelObjectLiteralWithComputedProperties(originalObjectLiteral, firstComputedPropertyIndex) { - var tempVar = createAndRecordTempVariable(originalObjectLiteral); - var initialObjectLiteral = ts.createSynthesizedNode(152); + var tempVar = createAndRecordTempVariable(0); + var initialObjectLiteral = ts.createSynthesizedNode(154); initialObjectLiteral.properties = originalObjectLiteral.properties.slice(0, firstComputedPropertyIndex); initialObjectLiteral.flags |= 512; - var propertyPatches = createBinaryExpression(tempVar, 52, initialObjectLiteral); + var propertyPatches = createBinaryExpression(tempVar, 53, initialObjectLiteral); ts.forEach(originalObjectLiteral.properties, function (property) { var patchedProperty = tryCreatePatchingPropertyAssignment(originalObjectLiteral, tempVar, property); if (patchedProperty) { @@ -20060,33 +21278,33 @@ var ts; function tryCreatePatchingPropertyAssignment(objectLiteral, tempVar, property) { var leftHandSide = createMemberAccessForPropertyName(tempVar, property.name); var maybeRightHandSide = tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral, property); - return maybeRightHandSide && createBinaryExpression(leftHandSide, 52, maybeRightHandSide, true); + return maybeRightHandSide && createBinaryExpression(leftHandSide, 53, maybeRightHandSide, true); } function tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral, property) { switch (property.kind) { - case 218: + case 224: return property.initializer; - case 219: - return createIdentifier(resolver.getExpressionNameSubstitution(property.name)); - case 132: - return createFunctionExpression(property.parameters, property.body); + case 225: + return createIdentifier(resolver.getExpressionNameSubstitution(property.name, getGeneratedNameForNode)); case 134: - case 135: - var _a = getAllAccessorDeclarations(objectLiteral.properties, property), firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor; + return createFunctionExpression(property.parameters, property.body); + case 136: + case 137: + var _a = ts.getAllAccessorDeclarations(objectLiteral.properties, property), firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor; if (firstAccessor !== property) { return undefined; } - var propertyDescriptor = ts.createSynthesizedNode(152); + var propertyDescriptor = ts.createSynthesizedNode(154); var descriptorProperties = []; if (getAccessor) { - var _getProperty = createPropertyAssignment(createIdentifier("get"), createFunctionExpression(getAccessor.parameters, getAccessor.body)); - descriptorProperties.push(_getProperty); + var getProperty_1 = createPropertyAssignment(createIdentifier("get"), createFunctionExpression(getAccessor.parameters, getAccessor.body)); + descriptorProperties.push(getProperty_1); } if (setAccessor) { var setProperty = createPropertyAssignment(createIdentifier("set"), createFunctionExpression(setAccessor.parameters, setAccessor.body)); descriptorProperties.push(setProperty); } - var trueExpr = ts.createSynthesizedNode(94); + var trueExpr = ts.createSynthesizedNode(95); var enumerableTrue = createPropertyAssignment(createIdentifier("enumerable"), trueExpr); descriptorProperties.push(enumerableTrue); var configurableTrue = createPropertyAssignment(createIdentifier("configurable"), trueExpr); @@ -20099,14 +21317,14 @@ var ts; } } function createParenthesizedExpression(expression) { - var result = ts.createSynthesizedNode(159); + var result = ts.createSynthesizedNode(161); result.expression = expression; return result; } function createNodeArray() { var elements = []; - for (var _i = 0; _i < arguments.length; _i++) { - elements[_i - 0] = arguments[_i]; + for (var _a = 0; _a < arguments.length; _a++) { + elements[_a - 0] = arguments[_a]; } var result = elements; result.pos = -1; @@ -20114,25 +21332,25 @@ var ts; return result; } function createBinaryExpression(left, operator, right, startsOnNewLine) { - var result = ts.createSynthesizedNode(167, startsOnNewLine); + var result = ts.createSynthesizedNode(169, startsOnNewLine); result.operatorToken = ts.createSynthesizedNode(operator); result.left = left; result.right = right; return result; } function createExpressionStatement(expression) { - var result = ts.createSynthesizedNode(177); + var result = ts.createSynthesizedNode(182); result.expression = expression; return result; } function createMemberAccessForPropertyName(expression, memberName) { - if (memberName.kind === 64) { + if (memberName.kind === 65) { return createPropertyAccessExpression(expression, memberName); } else if (memberName.kind === 8 || memberName.kind === 7) { return createElementAccessExpression(expression, memberName); } - else if (memberName.kind === 126) { + else if (memberName.kind === 127) { return createElementAccessExpression(expression, memberName.expression); } else { @@ -20140,37 +21358,37 @@ var ts; } } function createPropertyAssignment(name, initializer) { - var result = ts.createSynthesizedNode(218); + var result = ts.createSynthesizedNode(224); result.name = name; result.initializer = initializer; return result; } function createFunctionExpression(parameters, body) { - var result = ts.createSynthesizedNode(160); + var result = ts.createSynthesizedNode(162); result.parameters = parameters; result.body = body; return result; } function createPropertyAccessExpression(expression, name) { - var result = ts.createSynthesizedNode(153); + var result = ts.createSynthesizedNode(155); result.expression = expression; result.dotToken = ts.createSynthesizedNode(20); result.name = name; return result; } function createElementAccessExpression(expression, argumentExpression) { - var result = ts.createSynthesizedNode(154); + var result = ts.createSynthesizedNode(156); result.expression = expression; result.argumentExpression = argumentExpression; return result; } function createIdentifier(name, startsOnNewLine) { - var result = ts.createSynthesizedNode(64, startsOnNewLine); + var result = ts.createSynthesizedNode(65, startsOnNewLine); result.text = name; return result; } function createCallExpression(invokedExpression, arguments) { - var result = ts.createSynthesizedNode(155); + var result = ts.createSynthesizedNode(157); result.expression = invokedExpression; result.arguments = arguments; return result; @@ -20181,7 +21399,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 === 126) { + if (properties[i].name.kind === 127) { numInitialNonComputedProperties = i; break; } @@ -20200,34 +21418,47 @@ var ts; } function emitComputedPropertyName(node) { write("["); - emit(node.expression); + emitExpressionForPropertyName(node); write("]"); } function emitMethod(node) { - emit(node.name); + emit(node.name, false); if (languageVersion < 2) { write(": function "); } emitSignatureAndBody(node); } function emitPropertyAssignment(node) { - emit(node.name); + emit(node.name, false); write(": "); emit(node.initializer); } function emitShorthandPropertyAssignment(node) { - emit(node.name); - if (languageVersion < 2 || resolver.getExpressionNameSubstitution(node.name)) { + emit(node.name, false); + if (languageVersion < 2) { + write(": "); + var generatedName = getGeneratedNameForIdentifier(node.name); + if (generatedName) { + write(generatedName); + } + else { + emitExpressionIdentifier(node.name); + } + } + else if (resolver.getExpressionNameSubstitution(node.name, getGeneratedNameForNode)) { write(": "); emitExpressionIdentifier(node.name); } } function tryEmitConstantValue(node) { + if (compilerOptions.separateCompilation) { + return false; + } var constantValue = resolver.getConstantValue(node); if (constantValue !== undefined) { write(constantValue.toString()); if (!compilerOptions.removeComments) { - var propertyName = node.kind === 153 ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); + var propertyName = node.kind === 155 ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); write(" /* " + propertyName + " */"); } return true; @@ -20235,7 +21466,7 @@ var ts; return false; } function indentIfOnDifferentLines(parent, node1, node2, valueToWriteWhenNotIndenting) { - var realNodesAreOnDifferentLines = preserveNewLines && !ts.nodeIsSynthesized(parent) && !nodeEndIsOnSameLineAsNodeStart(node1, node2); + var realNodesAreOnDifferentLines = !ts.nodeIsSynthesized(parent) && !nodeEndIsOnSameLineAsNodeStart(node1, node2); var synthesizedNodeIsOnDifferentLine = synthesizedNodeStartsOnNewLine(node2); if (realNodesAreOnDifferentLines || synthesizedNodeIsOnDifferentLine) { increaseIndent(); @@ -20257,7 +21488,7 @@ var ts; var indentedBeforeDot = indentIfOnDifferentLines(node, node.expression, node.dotToken); write("."); var indentedAfterDot = indentIfOnDifferentLines(node, node.dotToken, node.name); - emit(node.name); + emit(node.name, false); decreaseIndentIf(indentedBeforeDot, indentedAfterDot); } function emitQualifiedName(node) { @@ -20275,20 +21506,20 @@ var ts; write("]"); } function hasSpreadElement(elements) { - return ts.forEach(elements, function (e) { return e.kind === 171; }); + return ts.forEach(elements, function (e) { return e.kind === 173; }); } function skipParentheses(node) { - while (node.kind === 159 || node.kind === 158) { + while (node.kind === 161 || node.kind === 160) { node = node.expression; } return node; } function emitCallTarget(node) { - if (node.kind === 64 || node.kind === 92 || node.kind === 90) { + if (node.kind === 65 || node.kind === 93 || node.kind === 91) { emit(node); return node; } - var temp = createAndRecordTempVariable(node); + var temp = createAndRecordTempVariable(0); write("("); emit(temp); write(" = "); @@ -20299,18 +21530,18 @@ var ts; function emitCallWithSpread(node) { var target; var expr = skipParentheses(node.expression); - if (expr.kind === 153) { + if (expr.kind === 155) { target = emitCallTarget(expr.expression); write("."); emit(expr.name); } - else if (expr.kind === 154) { + else if (expr.kind === 156) { target = emitCallTarget(expr.expression); write("["); emit(expr.argumentExpression); write("]"); } - else if (expr.kind === 90) { + else if (expr.kind === 91) { target = expr; write("_super"); } @@ -20319,7 +21550,7 @@ var ts; } write(".apply("); if (target) { - if (target.kind === 90) { + if (target.kind === 91) { emitThis(target); } else { @@ -20339,15 +21570,15 @@ var ts; return; } var superCall = false; - if (node.expression.kind === 90) { - write("_super"); + if (node.expression.kind === 91) { + emitSuper(node.expression); superCall = true; } else { emit(node.expression); - superCall = node.expression.kind === 153 && node.expression.expression.kind === 90; + superCall = node.expression.kind === 155 && node.expression.expression.kind === 91; } - if (superCall) { + if (superCall && languageVersion < 2) { write(".call("); emitThis(node.expression); if (node.arguments.length) { @@ -20372,7 +21603,7 @@ var ts; } } function emitTaggedTemplateExpression(node) { - if (compilerOptions.target >= 2) { + if (languageVersion >= 2) { emit(node.tag); write(" "); emit(node.template); @@ -20382,20 +21613,20 @@ var ts; } } function emitParenExpression(node) { - if (!node.parent || node.parent.kind !== 161) { - if (node.expression.kind === 158) { + if (!node.parent || node.parent.kind !== 163) { + if (node.expression.kind === 160) { var operand = node.expression.expression; - while (operand.kind == 158) { + while (operand.kind == 160) { operand = operand.expression; } - if (operand.kind !== 165 && - operand.kind !== 164 && - operand.kind !== 163 && - operand.kind !== 162 && + if (operand.kind !== 167 && operand.kind !== 166 && - operand.kind !== 156 && - !(operand.kind === 155 && node.parent.kind === 156) && - !(operand.kind === 160 && node.parent.kind === 155)) { + 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)) { emit(operand); return; } @@ -20406,23 +21637,23 @@ var ts; write(")"); } function emitDeleteExpression(node) { - write(ts.tokenToString(73)); + write(ts.tokenToString(74)); write(" "); emit(node.expression); } function emitVoidExpression(node) { - write(ts.tokenToString(98)); + write(ts.tokenToString(99)); write(" "); emit(node.expression); } function emitTypeOfExpression(node) { - write(ts.tokenToString(96)); + write(ts.tokenToString(97)); write(" "); emit(node.expression); } function emitPrefixUnaryExpression(node) { write(ts.tokenToString(node.operator)); - if (node.operand.kind === 165) { + if (node.operand.kind === 167) { var operand = node.operand; if (node.operator === 33 && (operand.operator === 33 || operand.operator === 38)) { write(" "); @@ -20438,9 +21669,9 @@ var ts; write(ts.tokenToString(node.operator)); } function emitBinaryExpression(node) { - if (languageVersion < 2 && node.operatorToken.kind === 52 && - (node.left.kind === 152 || node.left.kind === 151)) { - emitDestructuring(node, node.parent.kind === 177); + if (languageVersion < 2 && node.operatorToken.kind === 53 && + (node.left.kind === 154 || node.left.kind === 153)) { + emitDestructuring(node, node.parent.kind === 182); } else { emit(node.left); @@ -20476,13 +21707,13 @@ var ts; } } function isSingleLineEmptyBlock(node) { - if (node && node.kind === 174) { + if (node && node.kind === 179) { var block = node; return block.statements.length === 0 && nodeEndIsOnSameLineAsNodeStart(block, block); } } function emitBlock(node) { - if (preserveNewLines && isSingleLineEmptyBlock(node)) { + if (isSingleLineEmptyBlock(node)) { emitToken(14, node.pos); write(" "); emitToken(15, node.statements.end); @@ -20491,12 +21722,12 @@ var ts; emitToken(14, node.pos); increaseIndent(); scopeEmitStart(node.parent); - if (node.kind === 201) { - ts.Debug.assert(node.parent.kind === 200); + if (node.kind === 206) { + ts.Debug.assert(node.parent.kind === 205); emitCaptureThisForNodeIfNecessary(node.parent); } emitLines(node.statements); - if (node.kind === 201) { + if (node.kind === 206) { emitTempDeclarations(true); } decreaseIndent(); @@ -20505,7 +21736,7 @@ var ts; scopeEmitEnd(); } function emitEmbeddedStatement(node) { - if (node.kind === 174) { + if (node.kind === 179) { write(" "); emit(node); } @@ -20517,11 +21748,11 @@ var ts; } } function emitExpressionStatement(node) { - emitParenthesizedIf(node.expression, node.expression.kind === 161); + emitParenthesizedIf(node.expression, node.expression.kind === 163); write(";"); } function emitIfStatement(node) { - var endPos = emitToken(83, node.pos); + var endPos = emitToken(84, node.pos); write(" "); endPos = emitToken(16, endPos); emit(node.expression); @@ -20529,8 +21760,8 @@ var ts; emitEmbeddedStatement(node.thenStatement); if (node.elseStatement) { writeLine(); - emitToken(75, node.thenStatement.end); - if (node.elseStatement.kind === 178) { + emitToken(76, node.thenStatement.end); + if (node.elseStatement.kind === 183) { write(" "); emit(node.elseStatement); } @@ -20542,7 +21773,7 @@ var ts; function emitDoStatement(node) { write("do"); emitEmbeddedStatement(node.statement); - if (node.statement.kind === 174) { + if (node.statement.kind === 179) { write(" "); } else { @@ -20559,13 +21790,13 @@ var ts; emitEmbeddedStatement(node.statement); } function emitStartOfVariableDeclarationList(decl, startPos) { - var tokenKind = 97; + var tokenKind = 98; if (decl && languageVersion >= 2) { if (ts.isLet(decl)) { - tokenKind = 104; + tokenKind = 105; } else if (ts.isConst(decl)) { - tokenKind = 69; + tokenKind = 70; } } if (startPos !== undefined) { @@ -20573,20 +21804,20 @@ var ts; } else { switch (tokenKind) { - case 97: + case 98: return write("var "); - case 104: + case 105: return write("let "); - case 69: + case 70: return write("const "); } } } function emitForStatement(node) { - var endPos = emitToken(81, node.pos); + var endPos = emitToken(82, node.pos); write(" "); endPos = emitToken(16, endPos); - if (node.initializer && node.initializer.kind === 194) { + if (node.initializer && node.initializer.kind === 199) { var variableDeclarationList = node.initializer; var declarations = variableDeclarationList.declarations; emitStartOfVariableDeclarationList(declarations[0], endPos); @@ -20604,13 +21835,13 @@ var ts; emitEmbeddedStatement(node.statement); } function emitForInOrForOfStatement(node) { - if (languageVersion < 2 && node.kind === 183) { + if (languageVersion < 2 && node.kind === 188) { return emitDownLevelForOfStatement(node); } - var endPos = emitToken(81, node.pos); + var endPos = emitToken(82, node.pos); write(" "); endPos = emitToken(16, endPos); - if (node.initializer.kind === 194) { + if (node.initializer.kind === 199) { var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length >= 1) { var decl = variableDeclarationList.declarations[0]; @@ -20622,7 +21853,7 @@ var ts; else { emit(node.initializer); } - if (node.kind === 182) { + if (node.kind === 187) { write(" in "); } else { @@ -20633,13 +21864,32 @@ var ts; emitEmbeddedStatement(node.statement); } function emitDownLevelForOfStatement(node) { - var endPos = emitToken(81, node.pos); + // The following ES6 code: + // + // for (let v of expr) { } + // + // should be emitted as + // + // for (let _i = 0, _a = expr; _i < _a.length; _i++) { + // let v = _a[_i]; + // } + // + // where _a and _i are temps emitted to capture the RHS and the counter, + // respectively. + // When the left hand side is an expression instead of a let declaration, + // the "let v" is not emitted. + // When the left hand side is a let/const, the v is renamed if there is + // another v in scope. + // Note that all assignments to the LHS are emitted in the body, including + // all destructuring. + // Note also that because an extra statement is needed to assign to the LHS, + // for-of bodies are always emitted as blocks. + var endPos = emitToken(82, node.pos); write(" "); endPos = emitToken(16, endPos); - var rhsIsIdentifier = node.expression.kind === 64; - var counter = createTempVariable(node, "_i"); - var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(node); - var cachedLength = compilerOptions.cacheDownlevelForOfLength ? createTempVariable(node, "_n") : undefined; + var rhsIsIdentifier = node.expression.kind === 65; + var counter = createTempVariable(268435456); + var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(0); emitStart(node.expression); write("var "); emitNodeWithoutSourceMap(counter); @@ -20653,24 +21903,12 @@ var ts; emitNodeWithoutSourceMap(node.expression); emitEnd(node.expression); } - if (cachedLength) { - write(", "); - emitNodeWithoutSourceMap(cachedLength); - write(" = "); - emitNodeWithoutSourceMap(rhsReference); - write(".length"); - } write("; "); emitStart(node.initializer); emitNodeWithoutSourceMap(counter); write(" < "); - if (cachedLength) { - emitNodeWithoutSourceMap(cachedLength); - } - else { - emitNodeWithoutSourceMap(rhsReference); - write(".length"); - } + emitNodeWithoutSourceMap(rhsReference); + write(".length"); emitEnd(node.initializer); write("; "); emitStart(node.initializer); @@ -20683,7 +21921,7 @@ var ts; increaseIndent(); var rhsIterationValue = createElementAccessExpression(rhsReference, counter); emitStart(node.initializer); - if (node.initializer.kind === 194) { + if (node.initializer.kind === 199) { write("var "); var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -20698,14 +21936,14 @@ var ts; } } else { - emitNodeWithoutSourceMap(createTempVariable(node)); + emitNodeWithoutSourceMap(createTempVariable(0)); write(" = "); emitNodeWithoutSourceMap(rhsIterationValue); } } else { - var assignmentExpression = createBinaryExpression(node.initializer, 52, rhsIterationValue, false); - if (node.initializer.kind === 151 || node.initializer.kind === 152) { + var assignmentExpression = createBinaryExpression(node.initializer, 53, rhsIterationValue, false); + if (node.initializer.kind === 153 || node.initializer.kind === 154) { emitDestructuring(assignmentExpression, true, undefined, node); } else { @@ -20714,7 +21952,7 @@ var ts; } emitEnd(node.initializer); write(";"); - if (node.statement.kind === 174) { + if (node.statement.kind === 179) { emitLines(node.statement.statements); } else { @@ -20726,12 +21964,12 @@ var ts; write("}"); } function emitBreakOrContinueStatement(node) { - emitToken(node.kind === 185 ? 65 : 70, node.pos); + emitToken(node.kind === 190 ? 66 : 71, node.pos); emitOptional(" ", node.label); write(";"); } function emitReturnStatement(node) { - emitToken(89, node.pos); + emitToken(90, node.pos); emitOptional(" ", node.expression); write(";"); } @@ -20742,7 +21980,7 @@ var ts; emitEmbeddedStatement(node.statement); } function emitSwitchStatement(node) { - var endPos = emitToken(91, node.pos); + var endPos = emitToken(92, node.pos); write(" "); emitToken(16, endPos); emit(node.expression); @@ -20759,19 +21997,19 @@ var ts; emitToken(15, node.clauses.end); } function nodeStartPositionsAreOnSameLine(node1, node2) { - return getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node1.pos)) === - getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); + return ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node1.pos)) === + ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); } function nodeEndPositionsAreOnSameLine(node1, node2) { - return getLineOfLocalPosition(currentSourceFile, node1.end) === - getLineOfLocalPosition(currentSourceFile, node2.end); + return ts.getLineOfLocalPosition(currentSourceFile, node1.end) === + ts.getLineOfLocalPosition(currentSourceFile, node2.end); } function nodeEndIsOnSameLineAsNodeStart(node1, node2) { - return getLineOfLocalPosition(currentSourceFile, node1.end) === - getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); + return ts.getLineOfLocalPosition(currentSourceFile, node1.end) === + ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 214) { + if (node.kind === 220) { write("case "); emit(node.expression); write(":"); @@ -20779,7 +22017,7 @@ var ts; else { write("default:"); } - if (preserveNewLines && node.statements.length === 1 && nodeStartPositionsAreOnSameLine(node, node.statements[0])) { + if (node.statements.length === 1 && nodeStartPositionsAreOnSameLine(node, node.statements[0])) { write(" "); emit(node.statements[0]); } @@ -20806,7 +22044,7 @@ var ts; } function emitCatchClause(node) { writeLine(); - var endPos = emitToken(67, node.pos); + var endPos = emitToken(68, node.pos); write(" "); emitToken(16, endPos); emit(node.variableDeclaration); @@ -20815,7 +22053,7 @@ var ts; emitBlock(node.block); } function emitDebuggerStatement(node) { - emitToken(71, node.pos); + emitToken(72, node.pos); write(";"); } function emitLabelledStatement(node) { @@ -20826,18 +22064,24 @@ var ts; function getContainingModule(node) { do { node = node.parent; - } while (node && node.kind !== 200); + } while (node && node.kind !== 205); return node; } function emitContainingModuleName(node) { var container = getContainingModule(node); - write(container ? resolver.getGeneratedNameForNode(container) : "exports"); + write(container ? getGeneratedNameForNode(container) : "exports"); } function emitModuleMemberName(node) { emitStart(node.name); if (ts.getCombinedNodeFlags(node) & 1) { - emitContainingModuleName(node); - write("."); + var container = getContainingModule(node); + if (container) { + write(getGeneratedNameForNode(container)); + write("."); + } + else if (languageVersion < 2) { + write("exports."); + } } emitNodeWithoutSourceMap(node.name); emitEnd(node.name); @@ -20845,13 +22089,30 @@ var ts; function createVoidZero() { var zero = ts.createSynthesizedNode(7); zero.text = "0"; - var result = ts.createSynthesizedNode(164); + var result = ts.createSynthesizedNode(166); result.expression = zero; return result; } + function emitExportMemberAssignment(node) { + if (node.flags & 1) { + writeLine(); + emitStart(node); + if (node.flags & 256) { + write("exports.default"); + } + else { + emitModuleMemberName(node); + } + write(" = "); + emitDeclarationName(node); + emitEnd(node); + write(";"); + } + } function emitExportMemberAssignments(name) { - if (!exportDefault && exportSpecifiers && ts.hasProperty(exportSpecifiers, name.text)) { - ts.forEach(exportSpecifiers[name.text], function (specifier) { + if (!exportEquals && exportSpecifiers && ts.hasProperty(exportSpecifiers, name.text)) { + for (var _a = 0, _b = exportSpecifiers[name.text]; _a < _b.length; _a++) { + var specifier = _b[_a]; writeLine(); emitStart(specifier.name); emitContainingModuleName(specifier); @@ -20859,15 +22120,15 @@ var ts; emitNodeWithoutSourceMap(specifier.name); emitEnd(specifier.name); write(" = "); - emitNodeWithoutSourceMap(name); + emitExpressionIdentifier(name); write(";"); - }); + } } } function emitDestructuring(root, isAssignmentExpressionStatement, value, lowestNonSynthesizedAncestor) { var emitCount = 0; - var _isDeclaration = (root.kind === 193 && !(ts.getCombinedNodeFlags(root) & 1)) || root.kind === 128; - if (root.kind === 167) { + var isDeclaration = (root.kind === 198 && !(ts.getCombinedNodeFlags(root) & 1)) || root.kind === 129; + if (root.kind === 169) { emitAssignmentExpression(root); } else { @@ -20879,7 +22140,7 @@ var ts; write(", "); } renameNonTopLevelLetAndConst(name); - if (name.parent && (name.parent.kind === 193 || name.parent.kind === 150)) { + if (name.parent && (name.parent.kind === 198 || name.parent.kind === 152)) { emitModuleMemberName(name.parent); } else { @@ -20889,9 +22150,9 @@ var ts; emit(value); } function ensureIdentifier(expr) { - if (expr.kind !== 64) { - var identifier = createTempVariable(lowestNonSynthesizedAncestor || root); - if (!_isDeclaration) { + if (expr.kind !== 65) { + var identifier = createTempVariable(0); + if (!isDeclaration) { recordTempDeclaration(identifier); } emitAssignment(identifier, expr); @@ -20901,14 +22162,14 @@ var ts; } function createDefaultValueCheck(value, defaultValue) { value = ensureIdentifier(value); - var equals = ts.createSynthesizedNode(167); + var equals = ts.createSynthesizedNode(169); 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(168); + var cond = ts.createSynthesizedNode(170); cond.condition = condition; cond.questionToken = ts.createSynthesizedNode(50); cond.whenTrue = whenTrue; @@ -20922,21 +22183,21 @@ var ts; return node; } function parenthesizeForAccess(expr) { - if (expr.kind === 64 || expr.kind === 153 || expr.kind === 154) { + if (expr.kind === 65 || expr.kind === 155 || expr.kind === 156) { return expr; } - var node = ts.createSynthesizedNode(159); + var node = ts.createSynthesizedNode(161); node.expression = expr; return node; } function createPropertyAccess(object, propName) { - if (propName.kind !== 64) { + if (propName.kind !== 65) { return createElementAccess(object, propName); } return createPropertyAccessExpression(parenthesizeForAccess(object), propName); } function createElementAccess(object, index) { - var node = ts.createSynthesizedNode(154); + var node = ts.createSynthesizedNode(156); node.expression = parenthesizeForAccess(object); node.argumentExpression = index; return node; @@ -20946,9 +22207,9 @@ var ts; if (properties.length !== 1) { value = ensureIdentifier(value); } - for (var _i = 0, _n = properties.length; _i < _n; _i++) { - var p = properties[_i]; - if (p.kind === 218 || p.kind === 219) { + for (var _a = 0; _a < properties.length; _a++) { + var p = properties[_a]; + if (p.kind === 224 || p.kind === 225) { var propName = (p.name); emitDestructuringAssignment(p.initializer || propName, createPropertyAccess(value, propName)); } @@ -20961,8 +22222,8 @@ var ts; } for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 172) { - if (e.kind !== 171) { + if (e.kind !== 175) { + if (e.kind !== 173) { emitDestructuringAssignment(e, createElementAccess(value, createNumericLiteral(i))); } else { @@ -20976,14 +22237,14 @@ var ts; } } function emitDestructuringAssignment(target, value) { - if (target.kind === 167 && target.operatorToken.kind === 52) { + if (target.kind === 169 && target.operatorToken.kind === 53) { value = createDefaultValueCheck(value, target.right); target = target.left; } - if (target.kind === 152) { + if (target.kind === 154) { emitObjectLiteralAssignment(target, value); } - else if (target.kind === 151) { + else if (target.kind === 153) { emitArrayLiteralAssignment(target, value); } else { @@ -20992,19 +22253,19 @@ var ts; } function emitAssignmentExpression(root) { var target = root.left; - var _value = root.right; + var value = root.right; if (isAssignmentExpressionStatement) { - emitDestructuringAssignment(target, _value); + emitDestructuringAssignment(target, value); } else { - if (root.parent.kind !== 159) { + if (root.parent.kind !== 161) { write("("); } - _value = ensureIdentifier(_value); - emitDestructuringAssignment(target, _value); + value = ensureIdentifier(value); + emitDestructuringAssignment(target, value); write(", "); - emit(_value); - if (root.parent.kind !== 159) { + emit(value); + if (root.parent.kind !== 161) { write(")"); } } @@ -21024,11 +22285,11 @@ var ts; } for (var i = 0; i < elements.length; i++) { var element = elements[i]; - if (pattern.kind === 148) { + if (pattern.kind === 150) { var propName = element.propertyName || element.name; emitBindingElement(element, createPropertyAccess(value, propName)); } - else if (element.kind !== 172) { + else if (element.kind !== 175) { if (!element.dotDotDotToken) { emitBindingElement(element, createElementAccess(value, createNumericLiteral(i))); } @@ -21065,8 +22326,8 @@ var ts; var isUninitializedLet = (resolver.getNodeCheckFlags(node) & 256) && (getCombinedFlagsForIdentifier(node.name) & 4096); if (isUninitializedLet && - node.parent.parent.kind !== 182 && - node.parent.parent.kind !== 183) { + node.parent.parent.kind !== 187 && + node.parent.parent.kind !== 188) { initializer = createVoidZero(); } } @@ -21074,16 +22335,19 @@ var ts; } } function emitExportVariableAssignments(node) { - var _name = node.name; - if (_name.kind === 64) { - emitExportMemberAssignments(_name); + if (node.kind === 175) { + return; } - else if (ts.isBindingPattern(_name)) { - ts.forEach(_name.elements, emitExportVariableAssignments); + var name = node.name; + if (name.kind === 65) { + emitExportMemberAssignments(name); + } + else if (ts.isBindingPattern(name)) { + ts.forEach(name.elements, emitExportVariableAssignments); } } function getCombinedFlagsForIdentifier(node) { - if (!node.parent || (node.parent.kind !== 193 && node.parent.kind !== 150)) { + if (!node.parent || (node.parent.kind !== 198 && node.parent.kind !== 152)) { return 0; } return ts.getCombinedNodeFlags(node.parent); @@ -21091,33 +22355,49 @@ var ts; function renameNonTopLevelLetAndConst(node) { if (languageVersion >= 2 || ts.nodeIsSynthesized(node) || - node.kind !== 64 || - (node.parent.kind !== 193 && node.parent.kind !== 150)) { + node.kind !== 65 || + (node.parent.kind !== 198 && node.parent.kind !== 152)) { return; } var combinedFlags = getCombinedFlagsForIdentifier(node); if (((combinedFlags & 12288) === 0) || combinedFlags & 1) { return; } - var list = ts.getAncestor(node, 194); - if (list.parent.kind === 175 && list.parent.parent.kind === 221) { - 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); + if (isSourceFileLevelBinding || isModuleLevelBinding || isFunctionLevelBinding) { + return; + } } var blockScopeContainer = ts.getEnclosingBlockScopeContainer(node); - var _parent = blockScopeContainer.kind === 221 + var parent = blockScopeContainer.kind === 227 ? blockScopeContainer : blockScopeContainer.parent; - var generatedName = generateUniqueNameForLocation(_parent, node.text); - var variableId = resolver.getBlockScopedVariableId(node); - if (!generatedBlockScopeNames) { - generatedBlockScopeNames = []; + if (resolver.resolvesToSomeValue(parent, node.text)) { + var variableId = resolver.getBlockScopedVariableId(node); + if (!blockScopedVariableToGeneratedName) { + blockScopedVariableToGeneratedName = []; + } + var generatedName = makeUniqueName(node.text); + blockScopedVariableToGeneratedName[variableId] = generatedName; } - generatedBlockScopeNames[variableId] = generatedName; + } + function isES6ExportedDeclaration(node) { + return !!(node.flags & 1) && + languageVersion >= 2 && + node.parent.kind === 227; } function emitVariableStatement(node) { if (!(node.flags & 1)) { emitStartOfVariableDeclarationList(node.declarationList); } + else if (isES6ExportedDeclaration(node)) { + write("export "); + emitStartOfVariableDeclarationList(node.declarationList); + } emitCommaList(node.declarationList.declarations); write(";"); if (languageVersion < 2 && node.parent === currentSourceFile) { @@ -21127,12 +22407,12 @@ var ts; function emitParameter(node) { if (languageVersion < 2) { if (ts.isBindingPattern(node.name)) { - var _name = createTempVariable(node); + var name_16 = createTempVariable(0); if (!tempParameters) { tempParameters = []; } - tempParameters.push(_name); - emit(_name); + tempParameters.push(name_16); + emit(name_16); } else { emit(node.name); @@ -21179,7 +22459,7 @@ var ts; if (languageVersion < 2 && ts.hasRestParameters(node)) { var restIndex = node.parameters.length - 1; var restParam = node.parameters[restIndex]; - var tempName = createTempVariable(node, "_i").text; + var tempName = createTempVariable(268435456).text; writeLine(); emitLeadingComments(restParam); emitStart(restParam); @@ -21214,39 +22494,53 @@ var ts; } } function emitAccessor(node) { - write(node.kind === 134 ? "get " : "set "); - emit(node.name); + write(node.kind === 136 ? "get " : "set "); + emit(node.name, false); emitSignatureAndBody(node); } function shouldEmitAsArrowFunction(node) { - return node.kind === 161 && languageVersion >= 2; + return node.kind === 163 && languageVersion >= 2; } function emitDeclarationName(node) { if (node.name) { emitNodeWithoutSourceMap(node.name); } else { - write(resolver.getGeneratedNameForNode(node)); + write(getGeneratedNameForNode(node)); + } + } + function shouldEmitFunctionName(node) { + if (node.kind === 162) { + return !!node.name; + } + if (node.kind === 200) { + return !!node.name || languageVersion < 2; } } function emitFunctionDeclaration(node) { if (ts.nodeIsMissing(node.body)) { - return emitPinnedOrTripleSlashComments(node); + return emitOnlyPinnedOrTripleSlashComments(node); } - if (node.kind !== 132 && node.kind !== 131) { + if (node.kind !== 134 && node.kind !== 133) { emitLeadingComments(node); } if (!shouldEmitAsArrowFunction(node)) { + if (isES6ExportedDeclaration(node)) { + write("export "); + if (node.flags & 256) { + write("default "); + } + } write("function "); } - if (node.kind === 195 || (node.kind === 160 && node.name)) { + if (shouldEmitFunctionName(node)) { emitDeclarationName(node); } emitSignatureAndBody(node); - if (languageVersion < 2 && node.kind === 195 && node.parent === currentSourceFile && node.name) { + if (languageVersion < 2 && node.kind === 200 && node.parent === currentSourceFile && node.name) { emitExportMemberAssignments(node.name); } - if (node.kind !== 132 && node.kind !== 131) { + if (node.kind !== 134 && node.kind !== 133) { emitTrailingComments(node); } } @@ -21277,13 +22571,12 @@ var ts; emitSignatureParameters(node); } function emitSignatureAndBody(node) { - var saveTempCount = tempCount; + var saveTempFlags = tempFlags; var saveTempVariables = tempVariables; var saveTempParameters = tempParameters; - tempCount = 0; + tempFlags = 0; tempVariables = undefined; tempParameters = undefined; - var popFrame = enterNameScope(); if (shouldEmitAsArrowFunction(node)) { emitSignatureParametersForArrow(node); write(" =>"); @@ -21294,23 +22587,16 @@ var ts; if (!node.body) { write(" { }"); } - else if (node.body.kind === 174) { + else if (node.body.kind === 179) { emitBlockFunctionBody(node, node.body); } else { emitExpressionFunctionBody(node, node.body); } - if (node.flags & 1 && !(node.flags & 256)) { - writeLine(); - emitStart(node); - emitModuleMemberName(node); - write(" = "); - emitDeclarationName(node); - emitEnd(node); - write(";"); + if (!isES6ExportedDeclaration(node)) { + emitExportMemberAssignment(node); } - exitNameScope(popFrame); - tempCount = saveTempCount; + tempFlags = saveTempFlags; tempVariables = saveTempVariables; tempParameters = saveTempParameters; } @@ -21326,10 +22612,10 @@ var ts; } write(" "); var current = body; - while (current.kind === 158) { + while (current.kind === 160) { current = current.expression; } - emitParenthesizedIf(body, current.kind === 152); + emitParenthesizedIf(body, current.kind === 154); } function emitDownLevelExpressionFunctionBody(node, body) { write(" {"); @@ -21340,11 +22626,11 @@ var ts; emitFunctionBodyPreamble(node); var preambleEmitted = writer.getTextPos() !== outPos; decreaseIndent(); - if (preserveNewLines && !preambleEmitted && nodeStartPositionsAreOnSameLine(node, body)) { + if (!preambleEmitted && nodeStartPositionsAreOnSameLine(node, body)) { write(" "); emitStart(body); write("return "); - emitWithoutComments(body); + emit(body); emitEnd(body); write(";"); emitTempDeclarations(false); @@ -21355,7 +22641,7 @@ var ts; writeLine(); emitLeadingComments(node.body); write("return "); - emitWithoutComments(node.body); + emit(body); write(";"); emitTrailingComments(node.body); emitTempDeclarations(true); @@ -21377,9 +22663,9 @@ var ts; emitFunctionBodyPreamble(node); decreaseIndent(); var preambleEmitted = writer.getTextPos() !== initialTextPos; - if (preserveNewLines && !preambleEmitted && nodeEndIsOnSameLineAsNodeStart(body, body)) { - for (var _i = 0, _a = body.statements, _n = _a.length; _i < _n; _i++) { - var statement = _a[_i]; + if (!preambleEmitted && nodeEndIsOnSameLineAsNodeStart(body, body)) { + for (var _a = 0, _b = body.statements; _a < _b.length; _a++) { + var statement = _b[_a]; write(" "); emit(statement); } @@ -21401,11 +22687,11 @@ var ts; function findInitialSuperCall(ctor) { if (ctor.body) { var statement = ctor.body.statements[0]; - if (statement && statement.kind === 177) { + if (statement && statement.kind === 182) { var expr = statement.expression; - if (expr && expr.kind === 155) { + if (expr && expr.kind === 157) { var func = expr.expression; - if (func && func.kind === 90) { + if (func && func.kind === 91) { return statement; } } @@ -21434,7 +22720,7 @@ var ts; emitNodeWithoutSourceMap(memberName); write("]"); } - else if (memberName.kind === 126) { + else if (memberName.kind === 127) { emitComputedPropertyName(memberName); } else { @@ -21444,7 +22730,7 @@ var ts; } function emitMemberAssignments(node, staticFlag) { ts.forEach(node.members, function (member) { - if (member.kind === 130 && (member.flags & 128) === staticFlag && member.initializer) { + if (member.kind === 132 && (member.flags & 128) === staticFlag && member.initializer) { writeLine(); emitLeadingComments(member); emitStart(member); @@ -21465,20 +22751,21 @@ var ts; } }); } - function emitMemberFunctions(node) { + function emitMemberFunctionsForES5AndLower(node) { ts.forEach(node.members, function (member) { - if (member.kind === 132 || node.kind === 131) { + if (member.kind === 178) { + writeLine(); + write(";"); + } + else if (member.kind === 134 || node.kind === 133) { if (!member.body) { - return emitPinnedOrTripleSlashComments(member); + return emitOnlyPinnedOrTripleSlashComments(member); } writeLine(); emitLeadingComments(member); emitStart(member); emitStart(member.name); - emitDeclarationName(node); - if (!(member.flags & 128)) { - write(".prototype"); - } + emitClassMemberPrefix(node, member); emitMemberAccessForPropertyName(member.name); emitEnd(member.name); write(" = "); @@ -21489,17 +22776,14 @@ var ts; write(";"); emitTrailingComments(member); } - else if (member.kind === 134 || member.kind === 135) { - var accessors = getAllAccessorDeclarations(node.members, member); + else if (member.kind === 136 || member.kind === 137) { + var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { writeLine(); emitStart(member); write("Object.defineProperty("); emitStart(member.name); - emitDeclarationName(node); - if (!(member.flags & 128)) { - write(".prototype"); - } + emitClassMemberPrefix(node, member); write(", "); emitExpressionForPropertyName(member.name); emitEnd(member.name); @@ -21539,15 +22823,240 @@ 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) { + emitOnlyPinnedOrTripleSlashComments(member); + } + else if (member.kind === 134 || + member.kind === 136 || + member.kind === 137) { + writeLine(); + emitLeadingComments(member); + emitStart(member); + if (member.flags & 128) { + write("static "); + } + if (member.kind === 136) { + write("get "); + } + else if (member.kind === 137) { + write("set "); + } + emit(member.name); + emitSignatureAndBody(member); + emitEnd(member); + emitTrailingComments(member); + } + else if (member.kind === 178) { + writeLine(); + write(";"); + } + } + } + function emitConstructor(node, baseTypeElement) { + var saveTempFlags = tempFlags; + var saveTempVariables = tempVariables; + var saveTempParameters = tempParameters; + tempFlags = 0; + tempVariables = undefined; + tempParameters = undefined; + var hasInstancePropertyWithInitializer = false; + ts.forEach(node.members, function (member) { + if (member.kind === 135 && !member.body) { + emitOnlyPinnedOrTripleSlashComments(member); + } + if (member.kind === 132 && member.initializer && (member.flags & 128) === 0) { + hasInstancePropertyWithInitializer = true; + } + }); + var ctor = ts.getFirstConstructorWithBody(node); + if (languageVersion >= 2 && !ctor && !hasInstancePropertyWithInitializer) { + return; + } + if (ctor) { + emitLeadingComments(ctor); + } + emitStart(ctor || node); + if (languageVersion < 2) { + write("function "); + emitDeclarationName(node); + emitSignatureParameters(ctor); + } + else { + write("constructor"); + if (ctor) { + emitSignatureParameters(ctor); + } + else { + if (baseTypeElement) { + write("(...args)"); + } + else { + write("()"); + } + } + } + write(" {"); + scopeEmitStart(node, "constructor"); + increaseIndent(); + if (ctor) { + emitDetachedComments(ctor.body.statements); + } + emitCaptureThisForNodeIfNecessary(node); + if (ctor) { + emitDefaultValueAssignments(ctor); + emitRestParameter(ctor); + if (baseTypeElement) { + var superCall = findInitialSuperCall(ctor); + if (superCall) { + writeLine(); + emit(superCall); + } + } + emitParameterPropertyAssignments(ctor); + } + else { + if (baseTypeElement) { + writeLine(); + emitStart(baseTypeElement); + if (languageVersion < 2) { + write("_super.apply(this, arguments);"); + } + else { + write("super(...args);"); + } + emitEnd(baseTypeElement); + } + } + emitMemberAssignments(node, 0); + if (ctor) { + var statements = ctor.body.statements; + if (superCall) { + statements = statements.slice(1); + } + emitLines(statements); + } + emitTempDeclarations(true); + writeLine(); + if (ctor) { + emitLeadingCommentsOfPosition(ctor.body.statements.end); + } + decreaseIndent(); + emitToken(15, ctor ? ctor.body.statements.end : node.members.end); + scopeEmitEnd(); + emitEnd(ctor || node); + if (ctor) { + emitTrailingComments(ctor); + } + tempFlags = saveTempFlags; + tempVariables = saveTempVariables; + tempParameters = saveTempParameters; + } + function emitClassExpression(node) { + return emitClassLikeDeclaration(node); + } function emitClassDeclaration(node) { - write("var "); - emitDeclarationName(node); - write(" = (function ("); - var baseTypeNode = ts.getClassBaseTypeNode(node); + return emitClassLikeDeclaration(node); + } + function emitClassLikeDeclaration(node) { + if (languageVersion < 2) { + emitClassLikeDeclarationBelowES6(node); + } + else { + emitClassLikeDeclarationForES6AndHigher(node); + } + } + function emitClassLikeDeclarationForES6AndHigher(node) { + var thisNodeIsDecorated = ts.nodeIsDecorated(node); + if (node.kind === 201) { + if (thisNodeIsDecorated) { + if (isES6ExportedDeclaration(node) && !(node.flags & 256)) { + write("export "); + } + write("let "); + emitDeclarationName(node); + write(" = "); + } + else if (isES6ExportedDeclaration(node)) { + write("export "); + if (node.flags & 256) { + write("default "); + } + } + } + write("class"); + if ((node.name || !(node.flags & 256)) && !thisNodeIsDecorated) { + write(" "); + emitDeclarationName(node); + } + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); + if (baseTypeNode) { + write(" extends "); + emit(baseTypeNode.expression); + } + write(" {"); + increaseIndent(); + scopeEmitStart(node); + writeLine(); + emitConstructor(node, baseTypeNode); + emitMemberFunctionsForES6AndHigher(node); + decreaseIndent(); + writeLine(); + emitToken(15, node.members.end); + scopeEmitEnd(); + if (thisNodeIsDecorated) { + write(";"); + if (node.name) { + writeLine(); + write("Object.defineProperty("); + emitDeclarationName(node); + write(", \"name\", { value: \""); + emitDeclarationName(node); + write("\", configurable: true });"); + writeLine(); + } + } + writeLine(); + emitMemberAssignments(node, 128); + emitDecoratorsOfClass(node); + if (!isES6ExportedDeclaration(node) && (node.flags & 1)) { + writeLine(); + emitStart(node); + emitModuleMemberName(node); + write(" = "); + emitDeclarationName(node); + emitEnd(node); + write(";"); + } + else if (isES6ExportedDeclaration(node) && (node.flags & 256) && thisNodeIsDecorated) { + writeLine(); + write("export default "); + emitDeclarationName(node); + write(";"); + } + } + function emitClassLikeDeclarationBelowES6(node) { + if (node.kind === 201) { + write("var "); + emitDeclarationName(node); + write(" = "); + } + write("(function ("); + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { write("_super"); } write(") {"); + var saveTempFlags = tempFlags; + var saveTempVariables = tempVariables; + var saveTempParameters = tempParameters; + var saveComputedPropertyNamesToGeneratedNames = computedPropertyNamesToGeneratedNames; + tempFlags = 0; + tempVariables = undefined; + tempParameters = undefined; + computedPropertyNamesToGeneratedNames = undefined; increaseIndent(); scopeEmitStart(node); if (baseTypeNode) { @@ -21559,15 +23068,22 @@ var ts; emitEnd(baseTypeNode); } writeLine(); - emitConstructorOfClass(); - emitMemberFunctions(node); + emitConstructor(node, baseTypeNode); + emitMemberFunctionsForES5AndLower(node); emitMemberAssignments(node, 128); writeLine(); + emitDecoratorsOfClass(node); + writeLine(); emitToken(15, node.members.end, function () { write("return "); emitDeclarationName(node); }); write(";"); + emitTempDeclarations(true); + tempFlags = saveTempFlags; + tempVariables = saveTempVariables; + tempParameters = saveTempParameters; + computedPropertyNamesToGeneratedNames = saveComputedPropertyNamesToGeneratedNames; decreaseIndent(); writeLine(); emitToken(15, node.members.end); @@ -21575,109 +23091,170 @@ var ts; emitStart(node); write(")("); if (baseTypeNode) { - emit(baseTypeNode.typeName); + emit(baseTypeNode.expression); } - write(");"); - emitEnd(node); - if (node.flags & 1 && !(node.flags & 256)) { - writeLine(); - emitStart(node); - emitModuleMemberName(node); - write(" = "); - emitDeclarationName(node); - emitEnd(node); + write(")"); + if (node.kind === 201) { write(";"); } + emitEnd(node); + if (node.kind === 201) { + emitExportMemberAssignment(node); + } if (languageVersion < 2 && node.parent === currentSourceFile && node.name) { emitExportMemberAssignments(node.name); } - function emitConstructorOfClass() { - var saveTempCount = tempCount; - var saveTempVariables = tempVariables; - var saveTempParameters = tempParameters; - tempCount = 0; - tempVariables = undefined; - tempParameters = undefined; - var popFrame = enterNameScope(); - ts.forEach(node.members, function (member) { - if (member.kind === 133 && !member.body) { - emitPinnedOrTripleSlashComments(member); - } - }); - var ctor = getFirstConstructorWithBody(node); - if (ctor) { - emitLeadingComments(ctor); - } - emitStart(ctor || node); - write("function "); - emitDeclarationName(node); - emitSignatureParameters(ctor); - write(" {"); - scopeEmitStart(node, "constructor"); - increaseIndent(); - if (ctor) { - emitDetachedComments(ctor.body.statements); - } - emitCaptureThisForNodeIfNecessary(node); - var superCall; - if (ctor) { - emitDefaultValueAssignments(ctor); - emitRestParameter(ctor); - if (baseTypeNode) { - superCall = findInitialSuperCall(ctor); - if (superCall) { - writeLine(); - emit(superCall); - } - } - emitParameterPropertyAssignments(ctor); - } - else { - if (baseTypeNode) { - writeLine(); - emitStart(baseTypeNode); - write("_super.apply(this, arguments);"); - emitEnd(baseTypeNode); - } - } - emitMemberAssignments(node, 0); - if (ctor) { - var statements = ctor.body.statements; - if (superCall) - statements = statements.slice(1); - emitLines(statements); - } - emitTempDeclarations(true); - writeLine(); - if (ctor) { - emitLeadingCommentsOfPosition(ctor.body.statements.end); - } - decreaseIndent(); - emitToken(15, ctor ? ctor.body.statements.end : node.members.end); - scopeEmitEnd(); - emitEnd(ctor || node); - if (ctor) { - emitTrailingComments(ctor); - } - exitNameScope(popFrame); - tempCount = saveTempCount; - tempVariables = saveTempVariables; - tempParameters = saveTempParameters; + } + function emitClassMemberPrefix(node, member) { + emitDeclarationName(node); + if (!(member.flags & 128)) { + write(".prototype"); } } + function emitDecoratorsOfClass(node) { + emitDecoratorsOfMembers(node, 0); + emitDecoratorsOfMembers(node, 128); + emitDecoratorsOfConstructor(node); + } + function emitDecoratorsOfConstructor(node) { + var constructor = ts.getFirstConstructorWithBody(node); + if (constructor) { + emitDecoratorsOfParameters(node, constructor); + } + if (!ts.nodeIsDecorated(node)) { + return; + } + writeLine(); + emitStart(node); + emitDeclarationName(node); + write(" = "); + emitDecorateStart(node.decorators); + emitDeclarationName(node); + write(");"); + emitEnd(node); + writeLine(); + } + function emitDecoratorsOfMembers(node, staticFlag) { + ts.forEach(node.members, function (member) { + if ((member.flags & 128) !== staticFlag) { + return; + } + var decorators; + switch (member.kind) { + case 134: + emitDecoratorsOfParameters(node, member); + decorators = member.decorators; + break; + case 136: + case 137: + var accessors = ts.getAllAccessorDeclarations(node.members, member); + if (member !== accessors.firstAccessor) { + return; + } + if (accessors.setAccessor) { + emitDecoratorsOfParameters(node, accessors.setAccessor); + } + decorators = accessors.firstAccessor.decorators; + if (!decorators && accessors.secondAccessor) { + decorators = accessors.secondAccessor.decorators; + } + break; + case 132: + decorators = member.decorators; + break; + default: + return; + } + if (!decorators) { + return; + } + writeLine(); + emitStart(member); + if (member.kind !== 132) { + write("Object.defineProperty("); + emitStart(member.name); + emitClassMemberPrefix(node, member); + write(", "); + emitExpressionForPropertyName(member.name); + emitEnd(member.name); + write(", "); + } + emitDecorateStart(decorators); + emitStart(member.name); + emitClassMemberPrefix(node, member); + write(", "); + emitExpressionForPropertyName(member.name); + emitEnd(member.name); + if (member.kind !== 132) { + write(", Object.getOwnPropertyDescriptor("); + emitStart(member.name); + emitClassMemberPrefix(node, member); + write(", "); + emitExpressionForPropertyName(member.name); + emitEnd(member.name); + write("))"); + } + write(");"); + emitEnd(member); + writeLine(); + }); + } + function emitDecoratorsOfParameters(node, member) { + ts.forEach(member.parameters, function (parameter, parameterIndex) { + if (!ts.nodeIsDecorated(parameter)) { + return; + } + writeLine(); + emitStart(parameter); + emitDecorateStart(parameter.decorators); + emitStart(parameter.name); + if (member.kind === 135) { + emitDeclarationName(node); + write(", void 0"); + } + else { + emitClassMemberPrefix(node, member); + write(", "); + emitExpressionForPropertyName(member.name); + } + write(", "); + write(String(parameterIndex)); + emitEnd(parameter.name); + write(");"); + emitEnd(parameter); + writeLine(); + }); + } + function emitDecorateStart(decorators) { + write("__decorate(["); + var decoratorCount = decorators.length; + for (var i = 0; i < decoratorCount; i++) { + if (i > 0) { + write(", "); + } + var decorator = decorators[i]; + emitStart(decorator); + emit(decorator.expression); + emitEnd(decorator); + } + write("], "); + } function emitInterfaceDeclaration(node) { - emitPinnedOrTripleSlashComments(node); + emitOnlyPinnedOrTripleSlashComments(node); } function shouldEmitEnumDeclaration(node) { var isConstEnum = ts.isConst(node); - return !isConstEnum || compilerOptions.preserveConstEnums; + return !isConstEnum || compilerOptions.preserveConstEnums || compilerOptions.separateCompilation; } function emitEnumDeclaration(node) { if (!shouldEmitEnumDeclaration(node)) { return; } - if (!(node.flags & 1)) { + if (!(node.flags & 1) || isES6ExportedDeclaration(node)) { emitStart(node); + if (isES6ExportedDeclaration(node)) { + write("export "); + } write("var "); emit(node.name); emitEnd(node); @@ -21687,7 +23264,7 @@ var ts; emitStart(node); write("(function ("); emitStart(node.name); - write(resolver.getGeneratedNameForNode(node)); + write(getGeneratedNameForNode(node)); emitEnd(node.name); write(") {"); increaseIndent(); @@ -21703,7 +23280,7 @@ var ts; emitModuleMemberName(node); write(" = {}));"); emitEnd(node); - if (node.flags & 1) { + if (!isES6ExportedDeclaration(node) && node.flags & 1) { writeLine(); emitStart(node); write("var "); @@ -21720,9 +23297,9 @@ var ts; function emitEnumMember(node) { var enumParent = node.parent; emitStart(node); - write(resolver.getGeneratedNameForNode(enumParent)); + write(getGeneratedNameForNode(enumParent)); write("["); - write(resolver.getGeneratedNameForNode(enumParent)); + write(getGeneratedNameForNode(enumParent)); write("["); emitExpressionForPropertyName(node.name); write("] = "); @@ -21733,14 +23310,12 @@ var ts; write(";"); } function writeEnumMemberDeclarationValue(member) { - if (!member.initializer || ts.isConst(member.parent)) { - var value = resolver.getConstantValue(member); - if (value !== undefined) { - write(value.toString()); - return; - } + var value = resolver.getConstantValue(member); + if (value !== undefined) { + write(value.toString()); + return; } - if (member.initializer) { + else if (member.initializer) { emit(member.initializer); } else { @@ -21748,20 +23323,23 @@ var ts; } } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 200) { + if (moduleDeclaration.body.kind === 205) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } } function shouldEmitModuleDeclaration(node) { - return ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums); + return ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation); } function emitModuleDeclaration(node) { var shouldEmit = shouldEmitModuleDeclaration(node); if (!shouldEmit) { - return emitPinnedOrTripleSlashComments(node); + return emitOnlyPinnedOrTripleSlashComments(node); } emitStart(node); + if (isES6ExportedDeclaration(node)) { + write("export "); + } write("var "); emit(node.name); write(";"); @@ -21770,18 +23348,16 @@ var ts; emitStart(node); write("(function ("); emitStart(node.name); - write(resolver.getGeneratedNameForNode(node)); + write(getGeneratedNameForNode(node)); emitEnd(node.name); write(") "); - if (node.body.kind === 201) { - var saveTempCount = tempCount; + if (node.body.kind === 206) { + var saveTempFlags = tempFlags; var saveTempVariables = tempVariables; - tempCount = 0; + tempFlags = 0; tempVariables = undefined; - var popFrame = enterNameScope(); emit(node.body); - exitNameScope(popFrame); - tempCount = saveTempCount; + tempFlags = saveTempFlags; tempVariables = saveTempVariables; } else { @@ -21798,7 +23374,7 @@ var ts; scopeEmitEnd(); } write(")("); - if (node.flags & 1) { + if ((node.flags & 1) && !isES6ExportedDeclaration(node)) { emit(node.name); write(" = "); } @@ -21807,7 +23383,7 @@ var ts; emitModuleMemberName(node); write(" = {}));"); emitEnd(node); - if (languageVersion < 2 && node.name.kind === 64 && node.parent === currentSourceFile) { + if (!isES6ExportedDeclaration(node) && node.name.kind === 65 && node.parent === currentSourceFile) { emitExportMemberAssignments(node.name); } } @@ -21818,199 +23394,303 @@ var ts; emitLiteral(moduleName); emitEnd(moduleName); emitToken(17, moduleName.end); - write(";"); } else { - write("require();"); + write("require()"); } } + function getNamespaceDeclarationNode(node) { + if (node.kind === 208) { + return node; + } + var importClause = node.importClause; + if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 211) { + return importClause.namedBindings; + } + } + function isDefaultImport(node) { + return node.kind === 209 && node.importClause && !!node.importClause.name; + } + function emitExportImportAssignments(node) { + if (ts.isAliasSymbolDeclaration(node) && resolver.isValueAliasDeclaration(node)) { + emitExportMemberAssignments(node.name); + } + ts.forEachChild(node, emitExportImportAssignments); + } function emitImportDeclaration(node) { - var info = getExternalImportInfo(node); - if (info) { - var declarationNode = info.declarationNode; - var namedImports = info.namedImports; + if (languageVersion < 2) { + return emitExternalImportDeclaration(node); + } + if (node.importClause) { + var shouldEmitDefaultBindings = resolver.isReferencedAliasDeclaration(node.importClause); + var shouldEmitNamedBindings = node.importClause.namedBindings && resolver.isReferencedAliasDeclaration(node.importClause.namedBindings, true); + if (shouldEmitDefaultBindings || shouldEmitNamedBindings) { + write("import "); + emitStart(node.importClause); + if (shouldEmitDefaultBindings) { + emit(node.importClause.name); + if (shouldEmitNamedBindings) { + write(", "); + } + } + if (shouldEmitNamedBindings) { + emitLeadingComments(node.importClause.namedBindings); + emitStart(node.importClause.namedBindings); + if (node.importClause.namedBindings.kind === 211) { + write("* as "); + emit(node.importClause.namedBindings.name); + } + else { + write("{ "); + emitExportOrImportSpecifierList(node.importClause.namedBindings.elements, resolver.isReferencedAliasDeclaration); + write(" }"); + } + emitEnd(node.importClause.namedBindings); + emitTrailingComments(node.importClause.namedBindings); + } + emitEnd(node.importClause); + write(" from "); + emit(node.moduleSpecifier); + write(";"); + } + } + else { + write("import "); + emit(node.moduleSpecifier); + write(";"); + } + } + function emitExternalImportDeclaration(node) { + if (ts.contains(externalImports, node)) { + var isExportedImport = node.kind === 208 && (node.flags & 1) !== 0; + var namespaceDeclaration = getNamespaceDeclarationNode(node); if (compilerOptions.module !== 2) { emitLeadingComments(node); emitStart(node); - var moduleName = ts.getExternalModuleName(node); - if (declarationNode) { - if (!(declarationNode.flags & 1)) + if (namespaceDeclaration && !isDefaultImport(node)) { + if (!isExportedImport) write("var "); - emitModuleMemberName(declarationNode); + emitModuleMemberName(namespaceDeclaration); write(" = "); - emitRequire(moduleName); - } - else if (namedImports) { - write("var "); - write(resolver.getGeneratedNameForNode(node)); - write(" = "); - emitRequire(moduleName); } else { - emitRequire(moduleName); + var isNakedImport = 209 && !node.importClause; + if (!isNakedImport) { + write("var "); + write(getGeneratedNameForNode(node)); + write(" = "); + } } + emitRequire(ts.getExternalModuleName(node)); + if (namespaceDeclaration && isDefaultImport(node)) { + write(", "); + emitModuleMemberName(namespaceDeclaration); + write(" = "); + write(getGeneratedNameForNode(node)); + } + write(";"); emitEnd(node); + emitExportImportAssignments(node); emitTrailingComments(node); } else { - if (declarationNode) { - if (declarationNode.flags & 1) { - emitModuleMemberName(declarationNode); - write(" = "); - emit(declarationNode.name); - write(";"); - } + if (isExportedImport) { + emitModuleMemberName(namespaceDeclaration); + write(" = "); + emit(namespaceDeclaration.name); + write(";"); } + else if (namespaceDeclaration && isDefaultImport(node)) { + write("var "); + emitModuleMemberName(namespaceDeclaration); + write(" = "); + write(getGeneratedNameForNode(node)); + write(";"); + } + emitExportImportAssignments(node); } } } function emitImportEqualsDeclaration(node) { if (ts.isExternalModuleImportEqualsDeclaration(node)) { - emitImportDeclaration(node); + emitExternalImportDeclaration(node); return; } if (resolver.isReferencedAliasDeclaration(node) || (!ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportEqualsWithEntityName(node))) { emitLeadingComments(node); emitStart(node); - if (!(node.flags & 1)) + if (isES6ExportedDeclaration(node)) { + write("export "); write("var "); + } + else if (!(node.flags & 1)) { + write("var "); + } emitModuleMemberName(node); write(" = "); emit(node.moduleReference); write(";"); emitEnd(node); + emitExportImportAssignments(node); emitTrailingComments(node); } } function emitExportDeclaration(node) { - if (node.moduleSpecifier) { - emitStart(node); - var generatedName = resolver.getGeneratedNameForNode(node); - if (compilerOptions.module !== 2) { - write("var "); - write(generatedName); - write(" = "); - emitRequire(ts.getExternalModuleName(node)); - } - if (node.exportClause) { - ts.forEach(node.exportClause.elements, function (specifier) { + if (languageVersion < 2) { + if (node.moduleSpecifier && (!node.exportClause || resolver.isValueAliasDeclaration(node))) { + emitStart(node); + var generatedName = getGeneratedNameForNode(node); + if (node.exportClause) { + if (compilerOptions.module !== 2) { + write("var "); + write(generatedName); + write(" = "); + emitRequire(ts.getExternalModuleName(node)); + write(";"); + } + for (var _a = 0, _b = node.exportClause.elements; _a < _b.length; _a++) { + var specifier = _b[_a]; + if (resolver.isValueAliasDeclaration(specifier)) { + writeLine(); + emitStart(specifier); + emitContainingModuleName(specifier); + write("."); + emitNodeWithoutSourceMap(specifier.name); + write(" = "); + write(generatedName); + write("."); + emitNodeWithoutSourceMap(specifier.propertyName || specifier.name); + write(";"); + emitEnd(specifier); + } + } + } + else { writeLine(); - emitStart(specifier); - emitContainingModuleName(specifier); - write("."); - emitNodeWithoutSourceMap(specifier.name); - write(" = "); - write(generatedName); - write("."); - emitNodeWithoutSourceMap(specifier.propertyName || specifier.name); + write("__export("); + if (compilerOptions.module !== 2) { + emitRequire(ts.getExternalModuleName(node)); + } + else { + write(generatedName); + } + write(");"); + } + emitEnd(node); + } + } + else { + if (!node.exportClause || resolver.isValueAliasDeclaration(node)) { + emitStart(node); + write("export "); + if (node.exportClause) { + write("{ "); + emitExportOrImportSpecifierList(node.exportClause.elements, resolver.isValueAliasDeclaration); + write(" }"); + } + else { + write("*"); + } + if (node.moduleSpecifier) { + write(" from "); + emitNodeWithoutSourceMap(node.moduleSpecifier); + } + write(";"); + emitEnd(node); + } + } + } + function emitExportOrImportSpecifierList(specifiers, shouldEmit) { + ts.Debug.assert(languageVersion >= 2); + var needsComma = false; + for (var _a = 0; _a < specifiers.length; _a++) { + var specifier = specifiers[_a]; + if (shouldEmit(specifier)) { + if (needsComma) { + write(", "); + } + emitStart(specifier); + if (specifier.propertyName) { + emitNodeWithoutSourceMap(specifier.propertyName); + write(" as "); + } + emitNodeWithoutSourceMap(specifier.name); + emitEnd(specifier); + needsComma = true; + } + } + } + function emitExportAssignment(node) { + if (!node.isExportEquals && resolver.isValueAliasDeclaration(node)) { + if (languageVersion >= 2) { + writeLine(); + emitStart(node); + write("export default "); + var expression = node.expression; + emit(expression); + if (expression.kind !== 200 && + expression.kind !== 201) { write(";"); - emitEnd(specifier); - }); + } + emitEnd(node); } else { - var tempName = createTempVariable(node).text; writeLine(); - write("for (var " + tempName + " in " + generatedName + ") if (!"); + emitStart(node); emitContainingModuleName(node); - write(".hasOwnProperty(" + tempName + ")) "); - emitContainingModuleName(node); - write("[" + tempName + "] = " + generatedName + "[" + tempName + "];"); - } - emitEnd(node); - } - } - function createExternalImportInfo(node) { - if (node.kind === 203) { - if (node.moduleReference.kind === 213) { - return { - rootNode: node, - declarationNode: node - }; - } - } - else if (node.kind === 204) { - var importClause = node.importClause; - if (importClause) { - if (importClause.name) { - return { - rootNode: node, - declarationNode: importClause - }; - } - if (importClause.namedBindings.kind === 206) { - return { - rootNode: node, - declarationNode: importClause.namedBindings - }; - } - return { - rootNode: node, - namedImports: importClause.namedBindings, - localName: resolver.getGeneratedNameForNode(node) - }; - } - return { - rootNode: node - }; - } - else if (node.kind === 210) { - if (node.moduleSpecifier) { - return { - rootNode: node - }; + write(".default = "); + emit(node.expression); + write(";"); + emitEnd(node); } } } - function createExternalModuleInfo(sourceFile) { + function collectExternalModuleInfo(sourceFile) { externalImports = []; exportSpecifiers = {}; - exportDefault = undefined; - ts.forEach(sourceFile.statements, function (node) { - if (node.kind === 210 && !node.moduleSpecifier) { - ts.forEach(node.exportClause.elements, function (specifier) { - if (specifier.name.text === "default") { - exportDefault = exportDefault || specifier; + exportEquals = undefined; + hasExportStars = false; + for (var _a = 0, _b = sourceFile.statements; _a < _b.length; _a++) { + var node = _b[_a]; + switch (node.kind) { + case 209: + if (!node.importClause || + resolver.isReferencedAliasDeclaration(node.importClause, true)) { + externalImports.push(node); } - var _name = (specifier.propertyName || specifier.name).text; - (exportSpecifiers[_name] || (exportSpecifiers[_name] = [])).push(specifier); - }); - } - else if (node.kind === 209) { - exportDefault = exportDefault || node; - } - else if (node.kind === 195 || node.kind === 196) { - if (node.flags & 1 && node.flags & 256) { - exportDefault = exportDefault || node; - } - } - else { - var info = createExternalImportInfo(node); - if (info) { - if ((!info.declarationNode && !info.namedImports) || resolver.isReferencedAliasDeclaration(node)) { - externalImports.push(info); + break; + case 208: + if (node.moduleReference.kind === 219 && resolver.isReferencedAliasDeclaration(node)) { + externalImports.push(node); } - } - } - }); - } - function getExternalImportInfo(node) { - if (externalImports) { - for (var _i = 0, _n = externalImports.length; _i < _n; _i++) { - var info = externalImports[_i]; - if (info.rootNode === node) { - return info; - } + break; + case 215: + if (node.moduleSpecifier) { + if (!node.exportClause) { + externalImports.push(node); + hasExportStars = true; + } + else if (resolver.isValueAliasDeclaration(node)) { + externalImports.push(node); + } + } + else { + for (var _c = 0, _d = node.exportClause.elements; _c < _d.length; _c++) { + var specifier = _d[_c]; + var name_17 = (specifier.propertyName || specifier.name).text; + (exportSpecifiers[name_17] || (exportSpecifiers[name_17] = [])).push(specifier); + } + } + break; + case 214: + if (node.isExportEquals && !exportEquals) { + exportEquals = node; + } + break; } } } - function getFirstExportAssignment(sourceFile) { - return ts.forEach(sourceFile.statements, function (node) { - if (node.kind === 209) { - return node; - } - }); - } function sortAMDModules(amdModules) { return amdModules.sort(function (moduleA, moduleB) { if (moduleA.name === moduleB.name) { @@ -22024,7 +23704,20 @@ var ts; } }); } + function emitExportStarHelper() { + if (hasExportStars) { + writeLine(); + write("function __export(m) {"); + increaseIndent(); + writeLine(); + write("for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];"); + decreaseIndent(); + writeLine(); + write("}"); + } + } function emitAMDModule(node, startIndex) { + collectExternalModuleInfo(node); writeLine(); write("define("); sortAMDModules(node.amdDependencies); @@ -22032,69 +23725,78 @@ var ts; write("\"" + node.amdModuleName + "\", "); } write("[\"require\", \"exports\""); - ts.forEach(externalImports, function (info) { + for (var _a = 0; _a < externalImports.length; _a++) { + var importNode = externalImports[_a]; write(", "); - var moduleName = ts.getExternalModuleName(info.rootNode); + var moduleName = ts.getExternalModuleName(importNode); if (moduleName.kind === 8) { emitLiteral(moduleName); } else { write("\"\""); } - }); - ts.forEach(node.amdDependencies, function (amdDependency) { + } + for (var _b = 0, _c = node.amdDependencies; _b < _c.length; _b++) { + var amdDependency = _c[_b]; var text = "\"" + amdDependency.path + "\""; write(", "); write(text); - }); + } write("], function (require, exports"); - ts.forEach(externalImports, function (info) { + for (var _d = 0; _d < externalImports.length; _d++) { + var importNode = externalImports[_d]; write(", "); - if (info.declarationNode) { - emit(info.declarationNode.name); + var namespaceDeclaration = getNamespaceDeclarationNode(importNode); + if (namespaceDeclaration && !isDefaultImport(importNode)) { + emit(namespaceDeclaration.name); } else { - write(resolver.getGeneratedNameForNode(info.rootNode)); + write(getGeneratedNameForNode(importNode)); } - }); - ts.forEach(node.amdDependencies, function (amdDependency) { + } + for (var _e = 0, _f = node.amdDependencies; _e < _f.length; _e++) { + var amdDependency = _f[_e]; if (amdDependency.name) { write(", "); write(amdDependency.name); } - }); + } write(") {"); increaseIndent(); + emitExportStarHelper(); emitCaptureThisForNodeIfNecessary(node); emitLinesStartingAt(node.statements, startIndex); emitTempDeclarations(true); - emitExportDefault(node, true); + emitExportEquals(true); decreaseIndent(); writeLine(); write("});"); } function emitCommonJSModule(node, startIndex) { + collectExternalModuleInfo(node); + emitExportStarHelper(); emitCaptureThisForNodeIfNecessary(node); emitLinesStartingAt(node.statements, startIndex); emitTempDeclarations(true); - emitExportDefault(node, false); + emitExportEquals(false); } - function emitExportDefault(sourceFile, emitAsReturn) { - if (exportDefault && resolver.hasExportDefaultValue(sourceFile)) { + function emitES6Module(node, startIndex) { + externalImports = undefined; + exportSpecifiers = undefined; + exportEquals = undefined; + hasExportStars = false; + emitCaptureThisForNodeIfNecessary(node); + emitLinesStartingAt(node.statements, startIndex); + emitTempDeclarations(true); + } + function emitExportEquals(emitAsReturn) { + if (exportEquals && resolver.isValueAliasDeclaration(exportEquals)) { writeLine(); - emitStart(exportDefault); + emitStart(exportEquals); write(emitAsReturn ? "return " : "module.exports = "); - if (exportDefault.kind === 209) { - emit(exportDefault.expression); - } - else if (exportDefault.kind === 212) { - emit(exportDefault.propertyName); - } - else { - emitDeclarationName(exportDefault); - } + emit(exportEquals.expression); write(";"); - emitEnd(exportDefault); + emitEnd(exportEquals); } } function emitDirectivePrologues(statements, startWithNewLine) { @@ -22111,11 +23813,21 @@ var ts; } return statements.length; } + function writeHelper(text) { + var lines = text.split(/\r\n|\r|\n/g); + for (var i = 0; i < lines.length; ++i) { + var line = lines[i]; + if (line.length) { + writeLine(); + write(line); + } + } + } function emitSourceFileNode(node) { writeLine(); emitDetachedComments(node); var startIndex = emitDirectivePrologues(node.statements, false); - if (!extendsEmitted && resolver.getNodeCheckFlags(node) & 8) { + if ((languageVersion < 2) && (!extendsEmitted && resolver.getNodeCheckFlags(node) & 8)) { writeLine(); write("var __extends = this.__extends || function (d, b) {"); increaseIndent(); @@ -22132,9 +23844,15 @@ var ts; write("};"); extendsEmitted = true; } + if (!decorateEmitted && resolver.getNodeCheckFlags(node) & 512) { + writeHelper("\nvar __decorate = this.__decorate || function (decorators, target, key, value) {\n var kind = typeof (arguments.length == 2 ? value = target : value);\n for (var i = decorators.length - 1; i >= 0; --i) {\n var decorator = decorators[i];\n switch (kind) {\n case \"function\": value = decorator(value) || value; break;\n case \"number\": decorator(target, key, value); break;\n case \"undefined\": decorator(target, key); break;\n case \"object\": value = decorator(target, key, value) || value; break;\n }\n }\n return value;\n};"); + decorateEmitted = true; + } if (ts.isExternalModule(node)) { - createExternalModuleInfo(node); - if (compilerOptions.module === 2) { + if (languageVersion >= 2) { + emitES6Module(node, startIndex); + } + else if (compilerOptions.module === 2) { emitAMDModule(node, startIndex); } else { @@ -22144,75 +23862,75 @@ var ts; else { externalImports = undefined; exportSpecifiers = undefined; - exportDefault = undefined; + exportEquals = undefined; + hasExportStars = false; emitCaptureThisForNodeIfNecessary(node); emitLinesStartingAt(node.statements, startIndex); emitTempDeclarations(true); } emitLeadingComments(node.endOfFileToken); } - function emitNodeWithoutSourceMapWithComments(node) { + function emitNodeWithoutSourceMap(node, allowGeneratedIdentifiers) { if (!node) { return; } if (node.flags & 2) { - return emitPinnedOrTripleSlashComments(node); + return emitOnlyPinnedOrTripleSlashComments(node); } - var _emitComments = shouldEmitLeadingAndTrailingComments(node); - if (_emitComments) { + var emitComments = shouldEmitLeadingAndTrailingComments(node); + if (emitComments) { emitLeadingComments(node); } - emitJavaScriptWorker(node); - if (_emitComments) { + emitJavaScriptWorker(node, allowGeneratedIdentifiers); + if (emitComments) { emitTrailingComments(node); } } - function emitNodeWithoutSourceMapWithoutComments(node) { - if (!node) { - return; - } - if (node.flags & 2) { - return emitPinnedOrTripleSlashComments(node); - } - emitJavaScriptWorker(node); - } function shouldEmitLeadingAndTrailingComments(node) { switch (node.kind) { - case 197: - case 195: - case 204: - case 203: - case 198: - case 209: - return false; + case 202: case 200: + case 209: + case 208: + case 203: + case 214: + return false; + case 205: return shouldEmitModuleDeclaration(node); - case 199: + case 204: return shouldEmitEnumDeclaration(node); } + if (node.kind !== 179 && + node.parent && + node.parent.kind === 163 && + node.parent.body === node && + compilerOptions.target <= 1) { + return false; + } return true; } - function emitJavaScriptWorker(node) { + function emitJavaScriptWorker(node, allowGeneratedIdentifiers) { + if (allowGeneratedIdentifiers === void 0) { allowGeneratedIdentifiers = true; } switch (node.kind) { - case 64: - return emitIdentifier(node); - case 128: + case 65: + return emitIdentifier(node, allowGeneratedIdentifiers); + case 129: return emitParameter(node); - case 132: - case 131: - return emitMethod(node); case 134: - case 135: + case 133: + return emitMethod(node); + case 136: + case 137: return emitAccessor(node); - case 92: + case 93: return emitThis(node); - case 90: + case 91: return emitSuper(node); - case 88: + case 89: return write("null"); - case 94: + case 95: return write("true"); - case 79: + case 80: return write("false"); case 7: case 8: @@ -22222,125 +23940,129 @@ var ts; case 12: case 13: return emitLiteral(node); - case 169: - return emitTemplateExpression(node); - case 173: - return emitTemplateSpan(node); - case 125: - return emitQualifiedName(node); - case 148: - return emitObjectBindingPattern(node); - case 149: - return emitArrayBindingPattern(node); - case 150: - return emitBindingElement(node); - case 151: - return emitArrayLiteral(node); - case 152: - return emitObjectLiteral(node); - case 218: - return emitPropertyAssignment(node); - case 219: - return emitShorthandPropertyAssignment(node); - case 126: - return emitComputedPropertyName(node); - case 153: - return emitPropertyAccess(node); - case 154: - return emitIndexedAccess(node); - case 155: - return emitCallExpression(node); - case 156: - return emitNewExpression(node); - case 157: - return emitTaggedTemplateExpression(node); - case 158: - return emit(node.expression); - case 159: - return emitParenExpression(node); - case 195: - case 160: - case 161: - return emitFunctionDeclaration(node); - case 162: - return emitDeleteExpression(node); - case 163: - return emitTypeOfExpression(node); - case 164: - return emitVoidExpression(node); - case 165: - return emitPrefixUnaryExpression(node); - case 166: - return emitPostfixUnaryExpression(node); - case 167: - return emitBinaryExpression(node); - case 168: - return emitConditionalExpression(node); case 171: - return emitSpreadElementExpression(node); - case 172: - return; - case 174: - case 201: - return emitBlock(node); - case 175: - return emitVariableStatement(node); + return emitTemplateExpression(node); case 176: - return write(";"); - case 177: - return emitExpressionStatement(node); - case 178: - return emitIfStatement(node); - case 179: - return emitDoStatement(node); - case 180: - return emitWhileStatement(node); - case 181: - return emitForStatement(node); - case 183: - case 182: - return emitForInOrForOfStatement(node); - case 184: - case 185: - return emitBreakOrContinueStatement(node); - case 186: - return emitReturnStatement(node); - case 187: - return emitWithStatement(node); - case 188: - return emitSwitchStatement(node); - case 214: - case 215: - return emitCaseOrDefaultClause(node); - case 189: - return emitLabelledStatement(node); - case 190: - return emitThrowStatement(node); - case 191: - return emitTryStatement(node); - case 217: - return emitCatchClause(node); - case 192: - return emitDebuggerStatement(node); - case 193: - return emitVariableDeclaration(node); - case 196: - return emitClassDeclaration(node); - case 197: - return emitInterfaceDeclaration(node); - case 199: - return emitEnumDeclaration(node); - case 220: - return emitEnumMember(node); + 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: - return emitModuleDeclaration(node); - case 204: - return emitImportDeclaration(node); - case 203: - return emitImportEqualsDeclaration(node); - case 210: - return emitExportDeclaration(node); + 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 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); + case 226: + return emitEnumMember(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); + case 227: return emitSourceFileNode(node); } } @@ -22357,34 +24079,50 @@ var ts; } return leadingComments; } + function filterComments(ranges, onlyPinnedOrTripleSlashComments) { + if (ranges && onlyPinnedOrTripleSlashComments) { + ranges = ts.filter(ranges, isPinnedOrTripleSlashComment); + if (ranges.length === 0) { + return undefined; + } + } + return ranges; + } function getLeadingCommentsToEmit(node) { if (node.parent) { - if (node.parent.kind === 221 || node.pos !== node.parent.pos) { - var leadingComments; + if (node.parent.kind === 227 || node.pos !== node.parent.pos) { if (hasDetachedComments(node.pos)) { - leadingComments = getLeadingCommentsWithoutDetachedComments(); + return getLeadingCommentsWithoutDetachedComments(); } else { - leadingComments = ts.getLeadingCommentRangesOfNode(node, currentSourceFile); + return ts.getLeadingCommentRangesOfNode(node, currentSourceFile); } - return leadingComments; } } } - function emitLeadingDeclarationComments(node) { - var leadingComments = getLeadingCommentsToEmit(node); - emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); - emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); - } - function emitTrailingDeclarationComments(node) { + function getTrailingCommentsToEmit(node) { if (node.parent) { - if (node.parent.kind === 221 || node.end !== node.parent.end) { - var trailingComments = ts.getTrailingCommentRanges(currentSourceFile.text, node.end); - emitComments(currentSourceFile, writer, trailingComments, false, newLine, writeComment); + if (node.parent.kind === 227 || node.end !== node.parent.end) { + return ts.getTrailingCommentRanges(currentSourceFile.text, node.end); } } } - function emitLeadingCommentsOfLocalPosition(pos) { + function emitOnlyPinnedOrTripleSlashComments(node) { + emitLeadingCommentsWorker(node, true); + } + function emitLeadingComments(node) { + return emitLeadingCommentsWorker(node, compilerOptions.removeComments); + } + function emitLeadingCommentsWorker(node, onlyPinnedOrTripleSlashComments) { + var leadingComments = filterComments(getLeadingCommentsToEmit(node), onlyPinnedOrTripleSlashComments); + ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); + ts.emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); + } + function emitTrailingComments(node) { + var trailingComments = filterComments(getTrailingCommentsToEmit(node), compilerOptions.removeComments); + ts.emitComments(currentSourceFile, writer, trailingComments, false, newLine, writeComment); + } + function emitLeadingCommentsOfPosition(pos) { var leadingComments; if (hasDetachedComments(pos)) { leadingComments = getLeadingCommentsWithoutDetachedComments(); @@ -22392,18 +24130,19 @@ var ts; else { leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, pos); } - emitNewLineBeforeLeadingComments(currentSourceFile, writer, { pos: pos, end: pos }, leadingComments); - emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); + leadingComments = filterComments(leadingComments, compilerOptions.removeComments); + ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, { pos: pos, end: pos }, leadingComments); + ts.emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); } - function emitDetachedCommentsAtPosition(node) { + function emitDetachedComments(node) { var leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, node.pos); if (leadingComments) { var detachedComments = []; var lastComment; ts.forEach(leadingComments, function (comment) { if (lastComment) { - var lastCommentLine = getLineOfLocalPosition(currentSourceFile, lastComment.end); - var commentLine = getLineOfLocalPosition(currentSourceFile, comment.pos); + var lastCommentLine = ts.getLineOfLocalPosition(currentSourceFile, lastComment.end); + var commentLine = ts.getLineOfLocalPosition(currentSourceFile, comment.pos); if (commentLine >= lastCommentLine + 2) { return detachedComments; } @@ -22412,11 +24151,11 @@ var ts; lastComment = comment; }); if (detachedComments.length) { - var lastCommentLine = getLineOfLocalPosition(currentSourceFile, detachedComments[detachedComments.length - 1].end); - var nodeLine = getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node.pos)); + var lastCommentLine = ts.getLineOfLocalPosition(currentSourceFile, detachedComments[detachedComments.length - 1].end); + var nodeLine = ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node.pos)); if (nodeLine >= lastCommentLine + 2) { - emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); - emitComments(currentSourceFile, writer, detachedComments, true, newLine, writeComment); + 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 }; if (detachedCommentsInfo) { detachedCommentsInfo.push(currentDetachedCommentInfo); @@ -22428,54 +24167,53 @@ var ts; } } } - function emitPinnedOrTripleSlashComments(node) { - var pinnedComments = ts.filter(getLeadingCommentsToEmit(node), isPinnedOrTripleSlashComment); - function isPinnedOrTripleSlashComment(comment) { - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42) { - return currentSourceFile.text.charCodeAt(comment.pos + 2) === 33; - } - else if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 47 && - comment.pos + 2 < comment.end && - currentSourceFile.text.charCodeAt(comment.pos + 2) === 47 && - currentSourceFile.text.substring(comment.pos, comment.end).match(ts.fullTripleSlashReferencePathRegEx)) { - return true; - } + function isPinnedOrTripleSlashComment(comment) { + if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42) { + return currentSourceFile.text.charCodeAt(comment.pos + 2) === 33; + } + else if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 47 && + comment.pos + 2 < comment.end && + currentSourceFile.text.charCodeAt(comment.pos + 2) === 47 && + currentSourceFile.text.substring(comment.pos, comment.end).match(ts.fullTripleSlashReferencePathRegEx)) { + return true; } - emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, pinnedComments); - emitComments(currentSourceFile, writer, pinnedComments, true, newLine, writeComment); - } - } - function writeDeclarationFile(jsFilePath, sourceFile) { - var emitDeclarationResult = emitDeclarations(host, resolver, diagnostics, jsFilePath, sourceFile); - if (!emitDeclarationResult.reportedDeclarationError) { - var declarationOutput = emitDeclarationResult.referencePathsOutput; - var appliedSyncOutputPos = 0; - ts.forEach(emitDeclarationResult.aliasDeclarationEmitInfo, function (aliasEmitInfo) { - if (aliasEmitInfo.asynchronousOutput) { - declarationOutput += emitDeclarationResult.synchronousDeclarationOutput.substring(appliedSyncOutputPos, aliasEmitInfo.outputPos); - declarationOutput += aliasEmitInfo.asynchronousOutput; - appliedSyncOutputPos = aliasEmitInfo.outputPos; - } - }); - declarationOutput += emitDeclarationResult.synchronousDeclarationOutput.substring(appliedSyncOutputPos); - writeFile(host, diagnostics, ts.removeFileExtension(jsFilePath) + ".d.ts", declarationOutput, compilerOptions.emitBOM); } } function emitFile(jsFilePath, sourceFile) { emitJavaScript(jsFilePath, sourceFile); if (compilerOptions.declaration) { - writeDeclarationFile(jsFilePath, sourceFile); + ts.writeDeclarationFile(jsFilePath, sourceFile, host, resolver, diagnostics); } } } ts.emitFiles = emitFiles; })(ts || (ts = {})); +/// +/// var ts; (function (ts) { + ts.programTime = 0; ts.emitTime = 0; ts.ioReadTime = 0; - ts.version = "1.5.0.0"; - function createCompilerHost(options) { + ts.ioWriteTime = 0; + ts.version = "1.5.0"; + function findConfigFile(searchPath) { + var fileName = "tsconfig.json"; + while (true) { + if (ts.sys.fileExists(fileName)) { + return fileName; + } + var parentPath = ts.getDirectoryPath(searchPath); + if (parentPath === searchPath) { + break; + } + searchPath = parentPath; + fileName = "../" + fileName; + } + return undefined; + } + ts.findConfigFile = findConfigFile; + function createCompilerHost(options, setParentNodes) { var currentDirectory; var existingDirectories = {}; function getCanonicalFileName(fileName) { @@ -22497,29 +24235,31 @@ var ts; } text = ""; } - return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion) : undefined; + return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion, setParentNodes) : undefined; + } + function directoryExists(directoryPath) { + if (ts.hasProperty(existingDirectories, directoryPath)) { + return true; + } + if (ts.sys.directoryExists(directoryPath)) { + existingDirectories[directoryPath] = true; + return true; + } + return false; + } + function ensureDirectoriesExist(directoryPath) { + if (directoryPath.length > ts.getRootLength(directoryPath) && !directoryExists(directoryPath)) { + var parentDirectory = ts.getDirectoryPath(directoryPath); + ensureDirectoriesExist(parentDirectory); + ts.sys.createDirectory(directoryPath); + } } function writeFile(fileName, data, writeByteOrderMark, onError) { - function directoryExists(directoryPath) { - if (ts.hasProperty(existingDirectories, directoryPath)) { - return true; - } - if (ts.sys.directoryExists(directoryPath)) { - existingDirectories[directoryPath] = true; - return true; - } - return false; - } - function ensureDirectoriesExist(directoryPath) { - if (directoryPath.length > ts.getRootLength(directoryPath) && !directoryExists(directoryPath)) { - var parentDirectory = ts.getDirectoryPath(directoryPath); - ensureDirectoriesExist(parentDirectory); - ts.sys.createDirectory(directoryPath); - } - } try { + var start = new Date().getTime(); ensureDirectoriesExist(ts.getDirectoryPath(ts.normalizePath(fileName))); ts.sys.writeFile(fileName, data, writeByteOrderMark); + ts.ioWriteTime += new Date().getTime() - start; } catch (e) { if (onError) { @@ -22540,6 +24280,9 @@ var ts; ts.createCompilerHost = createCompilerHost; function getPreEmitDiagnostics(program) { var diagnostics = program.getSyntacticDiagnostics().concat(program.getGlobalDiagnostics()).concat(program.getSemanticDiagnostics()); + if (program.getCompilerOptions().declaration) { + diagnostics.concat(program.getDeclarationDiagnostics()); + } return ts.sortAndDeduplicateDiagnostics(diagnostics); } ts.getPreEmitDiagnostics = getPreEmitDiagnostics; @@ -22573,14 +24316,16 @@ var ts; var diagnostics = ts.createDiagnosticCollection(); var seenNoDefaultLib = options.noLib; var commonSourceDirectory; + var diagnosticsProducingTypeChecker; + var noDiagnosticsTypeChecker; + var start = new Date().getTime(); host = host || createCompilerHost(options); ts.forEach(rootNames, function (name) { return processRootFile(name, false); }); if (!seenNoDefaultLib) { processRootFile(host.getDefaultLibFileName(options), true); } verifyCompilerOptions(); - var diagnosticsProducingTypeChecker; - var noDiagnosticsTypeChecker; + ts.programTime += new Date().getTime() - start; program = { getSourceFile: getSourceFile, getSourceFiles: function () { return files; }, @@ -22618,10 +24363,6 @@ var ts; function getTypeChecker() { return noDiagnosticsTypeChecker || (noDiagnosticsTypeChecker = ts.createTypeChecker(program, false)); } - function getDeclarationDiagnostics(targetSourceFile) { - var resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(targetSourceFile); - return ts.getDeclarationDiagnostics(getEmitHost(), resolver, targetSourceFile); - } function emit(sourceFile, writeFileCallback) { if (options.noEmitOnError && getPreEmitDiagnostics(this).length > 0) { return { diagnostics: [], sourceMaps: undefined, emitSkipped: true }; @@ -22652,6 +24393,9 @@ var ts; function getSemanticDiagnostics(sourceFile) { return getDiagnosticsHelper(sourceFile, getSemanticDiagnosticsForFile); } + function getDeclarationDiagnostics(sourceFile) { + return getDiagnosticsHelper(sourceFile, getDeclarationDiagnosticsForFile); + } function getSyntacticDiagnosticsForFile(sourceFile) { return sourceFile.parseDiagnostics; } @@ -22663,6 +24407,13 @@ var ts; var programDiagnostics = diagnostics.getDiagnostics(sourceFile.fileName); return bindDiagnostics.concat(checkDiagnostics).concat(programDiagnostics); } + function getDeclarationDiagnosticsForFile(sourceFile) { + if (!ts.isDeclarationFile(sourceFile)) { + var resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile); + var writeFile = function () { }; + return ts.getDeclarationDiagnostics(getEmitHost(writeFile), resolver, sourceFile); + } + } function getGlobalDiagnostics() { var typeChecker = getDiagnosticsProducingTypeChecker(); var allDiagnostics = []; @@ -22678,10 +24429,10 @@ var ts; } function processSourceFile(fileName, isDefaultLib, refFile, refPos, refEnd) { var start; - var _length; + var length; if (refEnd !== undefined && refPos !== undefined) { start = refPos; - _length = refEnd - refPos; + length = refEnd - refPos; } var diagnostic; if (hasExtension(fileName)) { @@ -22706,7 +24457,7 @@ var ts; } if (diagnostic) { if (refFile) { - diagnostics.add(ts.createFileDiagnostic(refFile, start, _length, diagnostic, fileName)); + diagnostics.add(ts.createFileDiagnostic(refFile, start, length, diagnostic, fileName)); } else { diagnostics.add(ts.createCompilerDiagnostic(diagnostic, fileName)); @@ -22750,14 +24501,14 @@ var ts; return file; } function getSourceFileFromCache(fileName, canonicalName, useAbsolutePath) { - var _file = filesByName[canonicalName]; - if (_file && host.useCaseSensitiveFileNames()) { - var sourceFileName = useAbsolutePath ? ts.getNormalizedAbsolutePath(_file.fileName, host.getCurrentDirectory()) : _file.fileName; + var file = filesByName[canonicalName]; + if (file && host.useCaseSensitiveFileNames()) { + var sourceFileName = useAbsolutePath ? ts.getNormalizedAbsolutePath(file.fileName, host.getCurrentDirectory()) : file.fileName; if (canonicalName !== sourceFileName) { diagnostics.add(ts.createFileDiagnostic(refFile, refStart, refLength, ts.Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, fileName, sourceFileName)); } } - return _file; + return file; } } function processReferencedFiles(file, basePath) { @@ -22768,7 +24519,7 @@ var ts; } function processImportedModules(file, basePath) { ts.forEach(file.statements, function (node) { - if (node.kind === 204 || node.kind === 203 || node.kind === 210) { + if (node.kind === 209 || node.kind === 208 || node.kind === 215) { var moduleNameExpr = ts.getExternalModuleName(node); if (moduleNameExpr && moduleNameExpr.kind === 8) { var moduleNameText = moduleNameExpr.text; @@ -22788,17 +24539,17 @@ var ts; } } } - else if (node.kind === 200 && node.name.kind === 8 && (node.flags & 2 || ts.isDeclarationFile(file))) { + else if (node.kind === 205 && 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) { var nameLiteral = ts.getExternalModuleImportEqualsDeclarationExpression(node); var moduleName = nameLiteral.text; if (moduleName) { - var _searchName = ts.normalizePath(ts.combinePaths(basePath, moduleName)); - var tsFile = findModuleSourceFile(_searchName + ".ts", nameLiteral); + var searchName = ts.normalizePath(ts.combinePaths(basePath, moduleName)); + var tsFile = findModuleSourceFile(searchName + ".ts", nameLiteral); if (!tsFile) { - findModuleSourceFile(_searchName + ".d.ts", nameLiteral); + findModuleSourceFile(searchName + ".d.ts", nameLiteral); } } } @@ -22810,6 +24561,20 @@ var ts; } } function verifyCompilerOptions() { + if (options.separateCompilation) { + if (options.sourceMap) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_sourceMap_cannot_be_specified_with_option_separateCompilation)); + } + if (options.declaration) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_declaration_cannot_be_specified_with_option_separateCompilation)); + } + if (options.noEmitOnError) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_noEmitOnError_cannot_be_specified_with_option_separateCompilation)); + } + if (options.out) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_out_cannot_be_specified_with_option_separateCompilation)); + } + } 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)); @@ -22819,11 +24584,25 @@ var ts; } return; } + var languageVersion = options.target || 0; var firstExternalModuleSourceFile = ts.forEach(files, function (f) { return ts.isExternalModule(f) ? f : undefined; }); - if (firstExternalModuleSourceFile && !options.module) { + if (options.separateCompilation) { + if (!options.module && languageVersion < 2) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_separateCompilation_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher)); + } + 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)); + } + } + 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)); } + if (options.module && languageVersion >= 2) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher)); + } if (options.outDir || options.sourceRoot || (options.mapRoot && @@ -22871,6 +24650,10 @@ var ts; } ts.createProgram = createProgram; })(ts || (ts = {})); +/// +/// +/// +/// var ts; (function (ts) { ts.optionDeclarations = [ @@ -22878,10 +24661,6 @@ var ts; name: "charset", type: "string" }, - { - name: "codepage", - type: "number" - }, { name: "declaration", shortName: "d", @@ -22947,10 +24726,6 @@ var ts; name: "noLib", type: "boolean" }, - { - name: "noLibCheck", - type: "boolean" - }, { name: "noResolve", type: "boolean" @@ -22986,6 +24761,10 @@ var ts; type: "boolean", description: ts.Diagnostics.Do_not_emit_comments_to_output }, + { + name: "separateCompilation", + type: "boolean" + }, { name: "sourceMap", type: "boolean", @@ -23009,18 +24788,6 @@ var ts; description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, experimental: true }, - { - name: "preserveNewLines", - type: "boolean", - description: ts.Diagnostics.Preserve_new_lines_when_emitting_code, - experimental: true - }, - { - name: "cacheDownlevelForOfLength", - type: "boolean", - description: "Cache length access when downlevel emitting for-of statements", - experimental: true - }, { name: "target", shortName: "t", @@ -23221,6 +24988,20 @@ var ts; } ts.parseConfigFile = parseConfigFile; })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// var ts; (function (ts) { var OutliningElementsCollector; @@ -23240,7 +25021,7 @@ var ts; } } function autoCollapse(node) { - return ts.isFunctionBlock(node) && node.parent.kind !== 161; + return ts.isFunctionBlock(node) && node.parent.kind !== 163; } var depth = 0; var maxDepth = 20; @@ -23249,30 +25030,30 @@ var ts; return; } switch (n.kind) { - case 174: + case 179: if (!ts.isFunctionBlock(n)) { - var _parent = n.parent; + var parent_6 = n.parent; var openBrace = ts.findChildOfKind(n, 14, sourceFile); var closeBrace = ts.findChildOfKind(n, 15, sourceFile); - if (_parent.kind === 179 || - _parent.kind === 182 || - _parent.kind === 183 || - _parent.kind === 181 || - _parent.kind === 178 || - _parent.kind === 180 || - _parent.kind === 187 || - _parent.kind === 217) { - addOutliningSpan(_parent, openBrace, closeBrace, autoCollapse(n)); + if (parent_6.kind === 184 || + parent_6.kind === 187 || + parent_6.kind === 188 || + parent_6.kind === 186 || + parent_6.kind === 183 || + parent_6.kind === 185 || + parent_6.kind === 192 || + parent_6.kind === 223) { + addOutliningSpan(parent_6, openBrace, closeBrace, autoCollapse(n)); break; } - if (_parent.kind === 191) { - var tryStatement = _parent; + if (parent_6.kind === 196) { + var tryStatement = parent_6; if (tryStatement.tryBlock === n) { - addOutliningSpan(_parent, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(parent_6, openBrace, closeBrace, autoCollapse(n)); break; } else if (tryStatement.finallyBlock === n) { - var finallyKeyword = ts.findChildOfKind(tryStatement, 80, sourceFile); + var finallyKeyword = ts.findChildOfKind(tryStatement, 81, sourceFile); if (finallyKeyword) { addOutliningSpan(finallyKeyword, openBrace, closeBrace, autoCollapse(n)); break; @@ -23288,23 +25069,23 @@ var ts; }); break; } - case 201: { - var _openBrace = ts.findChildOfKind(n, 14, sourceFile); - var _closeBrace = ts.findChildOfKind(n, 15, sourceFile); - addOutliningSpan(n.parent, _openBrace, _closeBrace, autoCollapse(n)); + case 206: { + var openBrace = ts.findChildOfKind(n, 14, sourceFile); + var closeBrace = ts.findChildOfKind(n, 15, sourceFile); + addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); break; } - case 196: - case 197: - case 199: - case 152: - case 202: { - var _openBrace_1 = ts.findChildOfKind(n, 14, sourceFile); - var _closeBrace_1 = ts.findChildOfKind(n, 15, sourceFile); - addOutliningSpan(n, _openBrace_1, _closeBrace_1, autoCollapse(n)); + case 201: + case 202: + case 204: + case 154: + case 207: { + var openBrace = ts.findChildOfKind(n, 14, sourceFile); + var closeBrace = ts.findChildOfKind(n, 15, sourceFile); + addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); break; } - case 151: + case 153: var openBracket = ts.findChildOfKind(n, 18, sourceFile); var closeBracket = ts.findChildOfKind(n, 19, sourceFile); addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); @@ -23330,7 +25111,7 @@ var ts; ts.forEach(program.getSourceFiles(), function (sourceFile) { cancellationToken.throwIfCancellationRequested(); var declarations = sourceFile.getNamedDeclarations(); - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; var name = getDeclarationName(declaration); if (name !== undefined) { @@ -23362,7 +25143,7 @@ var ts; return items; function allMatchesAreCaseSensitive(matches) { ts.Debug.assert(matches.length > 0); - for (var _i = 0, _n = matches.length; _i < _n; _i++) { + for (var _i = 0; _i < matches.length; _i++) { var match = matches[_i]; if (!match.isCaseSensitive) { return false; @@ -23375,9 +25156,9 @@ var ts; if (result !== undefined) { return result; } - if (declaration.name.kind === 126) { + if (declaration.name.kind === 127) { var expr = declaration.name.expression; - if (expr.kind === 153) { + if (expr.kind === 155) { return expr.name.text; } return getTextOfIdentifierOrLiteral(expr); @@ -23385,7 +25166,7 @@ var ts; return undefined; } function getTextOfIdentifierOrLiteral(node) { - if (node.kind === 64 || + if (node.kind === 65 || node.kind === 8 || node.kind === 7) { return node.text; @@ -23398,7 +25179,7 @@ var ts; if (text !== undefined) { containers.unshift(text); } - else if (declaration.name.kind === 126) { + else if (declaration.name.kind === 127) { return tryAddComputedPropertyName(declaration.name.expression, containers, true); } else { @@ -23415,7 +25196,7 @@ var ts; } return true; } - if (expression.kind === 153) { + if (expression.kind === 155) { var propertyAccess = expression; if (includeLastPortion) { containers.unshift(propertyAccess.name.text); @@ -23426,7 +25207,7 @@ var ts; } function getContainers(declaration) { var containers = []; - if (declaration.name.kind === 126) { + if (declaration.name.kind === 127) { if (!tryAddComputedPropertyName(declaration.name.expression, containers, false)) { return undefined; } @@ -23442,15 +25223,15 @@ var ts; } function bestMatchKind(matches) { ts.Debug.assert(matches.length > 0); - var _bestMatchKind = 3; - for (var _i = 0, _n = matches.length; _i < _n; _i++) { + var bestMatchKind = ts.PatternMatchKind.camelCase; + for (var _i = 0; _i < matches.length; _i++) { var match = matches[_i]; var kind = match.kind; - if (kind < _bestMatchKind) { - _bestMatchKind = kind; + if (kind < bestMatchKind) { + bestMatchKind = kind; } } - return _bestMatchKind; + return bestMatchKind; } var baseSensitivity = { sensitivity: "base" }; function compareNavigateToItems(i1, i2) { @@ -23477,6 +25258,7 @@ var ts; NavigateTo.getNavigateToItems = getNavigateToItems; })(NavigateTo = ts.NavigateTo || (ts.NavigateTo = {})); })(ts || (ts = {})); +/// var ts; (function (ts) { var NavigationBar; @@ -23489,14 +25271,14 @@ var ts; var current = node.parent; while (current) { switch (current.kind) { - case 200: + case 205: do { current = current.parent; - } while (current.kind === 200); - case 196: - case 199: - case 197: - case 195: + } while (current.kind === 205); + case 201: + case 204: + case 202: + case 200: indent++; } current = current.parent; @@ -23507,26 +25289,26 @@ var ts; var childNodes = []; function visit(node) { switch (node.kind) { - case 175: + case 180: ts.forEach(node.declarationList.declarations, visit); break; - case 148: - case 149: + case 150: + case 151: ts.forEach(node.elements, visit); break; - case 210: + case 215: if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 204: + case 209: var importClause = node.importClause; if (importClause) { if (importClause.name) { childNodes.push(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 206) { + if (importClause.namedBindings.kind === 211) { childNodes.push(importClause.namedBindings); } else { @@ -23535,20 +25317,20 @@ var ts; } } break; - case 150: - case 193: + case 152: + case 198: if (ts.isBindingPattern(node.name)) { visit(node.name); break; } - case 196: - case 199: - case 197: + case 201: + case 204: + case 202: + case 205: case 200: - case 195: - case 203: case 208: - case 212: + case 213: + case 217: childNodes.push(node); break; } @@ -23580,20 +25362,20 @@ var ts; } function addTopLevelNodes(nodes, topLevelNodes) { nodes = sortNodes(nodes); - for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + for (var _i = 0; _i < nodes.length; _i++) { var node = nodes[_i]; switch (node.kind) { - case 196: - case 199: - case 197: + case 201: + case 204: + case 202: topLevelNodes.push(node); break; - case 200: + case 205: var moduleDeclaration = node; topLevelNodes.push(node); addTopLevelNodes(getInnermostModule(moduleDeclaration).body.statements, topLevelNodes); break; - case 195: + case 200: var functionDeclaration = node; if (isTopLevelFunctionDeclaration(functionDeclaration)) { topLevelNodes.push(node); @@ -23604,9 +25386,9 @@ var ts; } } function isTopLevelFunctionDeclaration(functionDeclaration) { - if (functionDeclaration.kind === 195) { - if (functionDeclaration.body && functionDeclaration.body.kind === 174) { - if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 195 && !isEmpty(s.name.text); })) { + 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); })) { return true; } if (!ts.isFunctionBlock(functionDeclaration.parent)) { @@ -23619,19 +25401,19 @@ var ts; function getItemsWorker(nodes, createItem) { var items = []; var keyToItem = {}; - for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + for (var _i = 0; _i < nodes.length; _i++) { var child = nodes[_i]; - var _item = createItem(child); - if (_item !== undefined) { - if (_item.text.length > 0) { - var key = _item.text + "-" + _item.kind + "-" + _item.indent; + var item_3 = createItem(child); + if (item_3 !== undefined) { + if (item_3.text.length > 0) { + var key = item_3.text + "-" + item_3.kind + "-" + item_3.indent; var itemWithSameName = keyToItem[key]; if (itemWithSameName) { - merge(itemWithSameName, _item); + merge(itemWithSameName, item_3); } else { - keyToItem[key] = _item; - items.push(_item); + keyToItem[key] = item_3; + items.push(item_3); } } } @@ -23644,9 +25426,9 @@ var ts; if (!target.childItems) { target.childItems = []; } - outer: for (var _i = 0, _a = source.childItems, _n = _a.length; _i < _n; _i++) { + outer: for (var _i = 0, _a = source.childItems; _i < _a.length; _i++) { var sourceChild = _a[_i]; - for (var _b = 0, _c = target.childItems, _d = _c.length; _b < _d; _b++) { + for (var _b = 0, _c = target.childItems; _b < _c.length; _b++) { var targetChild = _c[_b]; if (targetChild.text === sourceChild.text && targetChild.kind === sourceChild.kind) { merge(targetChild, sourceChild); @@ -23659,7 +25441,7 @@ var ts; } function createChildItem(node) { switch (node.kind) { - case 128: + case 129: if (ts.isBindingPattern(node.name)) { break; } @@ -23667,34 +25449,34 @@ var ts; return undefined; } return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); + 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); + 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.memberFunctionElement); - case 134: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberGetAccessorElement); - case 135: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberSetAccessorElement); - case 138: - return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement); - case 220: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 136: - return createItem(node, "()", ts.ScriptElementKind.callSignatureElement); - case 137: - return createItem(node, "new()", ts.ScriptElementKind.constructSignatureElement); - case 130: - case 129: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 195: + case 200: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.functionElement); - case 193: - case 150: + case 198: + case 152: var variableDeclarationNode; - var _name; - if (node.kind === 150) { - _name = node.name; + var name_18; + if (node.kind === 152) { + name_18 = node.name; variableDeclarationNode = node; - while (variableDeclarationNode && variableDeclarationNode.kind !== 193) { + while (variableDeclarationNode && variableDeclarationNode.kind !== 198) { variableDeclarationNode = variableDeclarationNode.parent; } ts.Debug.assert(variableDeclarationNode !== undefined); @@ -23702,24 +25484,24 @@ var ts; else { ts.Debug.assert(!ts.isBindingPattern(node.name)); variableDeclarationNode = node; - _name = node.name; + name_18 = node.name; } if (ts.isConst(variableDeclarationNode)) { - return createItem(node, getTextOfNode(_name), ts.ScriptElementKind.constElement); + return createItem(node, getTextOfNode(name_18), ts.ScriptElementKind.constElement); } else if (ts.isLet(variableDeclarationNode)) { - return createItem(node, getTextOfNode(_name), ts.ScriptElementKind.letElement); + return createItem(node, getTextOfNode(name_18), ts.ScriptElementKind.letElement); } else { - return createItem(node, getTextOfNode(_name), ts.ScriptElementKind.variableElement); + return createItem(node, getTextOfNode(name_18), ts.ScriptElementKind.variableElement); } - case 133: + case 135: return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); - case 212: + case 217: + case 213: case 208: - case 203: - case 205: - case 206: + case 210: + case 211: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.alias); } return undefined; @@ -23749,17 +25531,17 @@ var ts; } function createTopLevelItem(node) { switch (node.kind) { - case 221: + case 227: return createSourceFileItem(node); - case 196: + case 201: return createClassItem(node); - case 199: + case 204: return createEnumItem(node); - case 197: + case 202: return createIterfaceItem(node); - case 200: + case 205: return createModuleItem(node); - case 195: + case 200: return createFunctionItem(node); } return undefined; @@ -23769,7 +25551,7 @@ var ts; } var result = []; result.push(moduleDeclaration.name.text); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 200) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 205) { moduleDeclaration = moduleDeclaration.body; result.push(moduleDeclaration.name.text); } @@ -23781,9 +25563,9 @@ var ts; return getNavigationBarItem(moduleName, ts.ScriptElementKind.moduleElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } function createFunctionItem(node) { - if (node.name && node.body && node.body.kind === 174) { + if ((node.name || node.flags & 256) && node.body && node.body.kind === 179) { var childItems = getItemsWorker(sortNodes(node.body.statements), createChildItem); - return getNavigationBarItem(node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); + return getNavigationBarItem((!node.name && node.flags & 256) ? "default" : node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } return undefined; } @@ -23799,13 +25581,10 @@ var ts; return getNavigationBarItem(rootName, ts.ScriptElementKind.moduleElement, ts.ScriptElementKindModifier.none, [getNodeSpan(node)], childItems); } function createClassItem(node) { - if (!node.name) { - return undefined; - } var childItems; if (node.members) { var constructor = ts.forEach(node.members, function (member) { - return member.kind === 133 && member; + return member.kind === 135 && member; }); var nodes = removeDynamicallyNamedProperties(node); if (constructor) { @@ -23813,7 +25592,8 @@ var ts; } childItems = getItemsWorker(sortNodes(nodes), createChildItem); } - return getNavigationBarItem(node.name.text, ts.ScriptElementKind.classElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); + var nodeName = !node.name && (node.flags & 256) ? "default" : node.name.text; + return getNavigationBarItem(nodeName, ts.ScriptElementKind.classElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } function createEnumItem(node) { var childItems = getItemsWorker(sortNodes(removeComputedProperties(node)), createChildItem); @@ -23825,19 +25605,19 @@ var ts; } } function removeComputedProperties(node) { - return ts.filter(node.members, function (member) { return member.name === undefined || member.name.kind !== 126; }); + return ts.filter(node.members, function (member) { return member.name === undefined || member.name.kind !== 127; }); } function removeDynamicallyNamedProperties(node) { return ts.filter(node.members, function (member) { return !ts.hasDynamicName(member); }); } function getInnermostModule(node) { - while (node.body.kind === 200) { + while (node.body.kind === 205) { node = node.body; } return node; } function getNodeSpan(node) { - return node.kind === 221 + return node.kind === 227 ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) : ts.createTextSpanFromBounds(node.getStart(), node.getEnd()); } @@ -23919,27 +25699,27 @@ var ts; var index = indexOfIgnoringCase(candidate, chunk.textLowerCase); if (index === 0) { if (chunk.text.length === candidate.length) { - return createPatternMatch(0, punctuationStripped, candidate === chunk.text); + return createPatternMatch(PatternMatchKind.exact, punctuationStripped, candidate === chunk.text); } else { - return createPatternMatch(1, punctuationStripped, startsWith(candidate, chunk.text)); + return createPatternMatch(PatternMatchKind.prefix, punctuationStripped, startsWith(candidate, chunk.text)); } } var isLowercase = chunk.isLowerCase; if (isLowercase) { if (index > 0) { var wordSpans = getWordSpans(candidate); - for (var _i = 0, _n = wordSpans.length; _i < _n; _i++) { + for (var _i = 0; _i < wordSpans.length; _i++) { var span = wordSpans[_i]; if (partStartsWith(candidate, span, chunk.text, true)) { - return createPatternMatch(2, punctuationStripped, partStartsWith(candidate, span, chunk.text, false)); + return createPatternMatch(PatternMatchKind.substring, punctuationStripped, partStartsWith(candidate, span, chunk.text, false)); } } } } else { if (candidate.indexOf(chunk.text) > 0) { - return createPatternMatch(2, punctuationStripped, true); + return createPatternMatch(PatternMatchKind.substring, punctuationStripped, true); } } if (!isLowercase) { @@ -23947,18 +25727,18 @@ var ts; var candidateParts = getWordSpans(candidate); var camelCaseWeight = tryCamelCaseMatch(candidate, candidateParts, chunk, false); if (camelCaseWeight !== undefined) { - return createPatternMatch(3, punctuationStripped, true, camelCaseWeight); + return createPatternMatch(PatternMatchKind.camelCase, punctuationStripped, true, camelCaseWeight); } camelCaseWeight = tryCamelCaseMatch(candidate, candidateParts, chunk, true); if (camelCaseWeight !== undefined) { - return createPatternMatch(3, punctuationStripped, false, camelCaseWeight); + return createPatternMatch(PatternMatchKind.camelCase, punctuationStripped, false, camelCaseWeight); } } } if (isLowercase) { if (chunk.text.length < candidate.length) { if (index > 0 && isUpperCaseLetter(candidate.charCodeAt(index))) { - return createPatternMatch(2, punctuationStripped, false); + return createPatternMatch(PatternMatchKind.substring, punctuationStripped, false); } } } @@ -23982,7 +25762,7 @@ var ts; } var subWordTextChunks = segment.subWordTextChunks; var matches = undefined; - for (var _i = 0, _n = subWordTextChunks.length; _i < _n; _i++) { + for (var _i = 0; _i < subWordTextChunks.length; _i++) { var subWordTextChunk = subWordTextChunks[_i]; var result = matchTextChunk(candidate, subWordTextChunk, true); if (!result) { @@ -24009,10 +25789,10 @@ var ts; } } else { - for (var _i = 0; _i < patternPartLength; _i++) { - var _ch1 = pattern.charCodeAt(patternPartStart + _i); - var _ch2 = candidate.charCodeAt(candidateSpan.start + _i); - if (_ch1 !== _ch2) { + for (var i = 0; i < patternPartLength; i++) { + var ch1 = pattern.charCodeAt(patternPartStart + i); + var ch2 = candidate.charCodeAt(candidateSpan.start + i); + if (ch1 !== ch2) { return false; } } @@ -24087,7 +25867,7 @@ var ts; return result1.kind - result2.kind; } function compareCamelCase(result1, result2) { - if (result1.kind === 3 && result2.kind === 3) { + if (result1.kind === PatternMatchKind.camelCase && result2.kind === PatternMatchKind.camelCase) { return result2.camelCaseWeight - result1.camelCaseWeight; } return 0; @@ -24299,6 +26079,7 @@ var ts; return transition; } })(ts || (ts = {})); +/// var ts; (function (ts) { var SignatureHelp; @@ -24329,7 +26110,7 @@ var ts; } return createSignatureHelpItems(candidates, resolvedSignature, argumentInfo); function getImmediatelyContainingArgumentInfo(node) { - if (node.parent.kind === 155 || node.parent.kind === 156) { + if (node.parent.kind === 157 || node.parent.kind === 158) { var callExpression = node.parent; if (node.kind === 24 || node.kind === 16) { @@ -24346,50 +26127,50 @@ var ts; } var listItemInfo = ts.findListItemInfo(node); if (listItemInfo) { - var _list = listItemInfo.list; - var _isTypeArgList = callExpression.typeArguments && callExpression.typeArguments.pos === _list.pos; - var argumentIndex = getArgumentIndex(_list, node); - var argumentCount = getArgumentCount(_list); + var list = listItemInfo.list; + var isTypeArgList = callExpression.typeArguments && callExpression.typeArguments.pos === list.pos; + var argumentIndex = getArgumentIndex(list, node); + var argumentCount = getArgumentCount(list); ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); return { - kind: _isTypeArgList ? 0 : 1, + kind: isTypeArgList ? 0 : 1, invocation: callExpression, - argumentsSpan: getApplicableSpanForArguments(_list), + argumentsSpan: getApplicableSpanForArguments(list), argumentIndex: argumentIndex, argumentCount: argumentCount }; } } - else if (node.kind === 10 && node.parent.kind === 157) { + else if (node.kind === 10 && node.parent.kind === 159) { if (ts.isInsideTemplateLiteral(node, position)) { return getArgumentListInfoForTemplate(node.parent, 0); } } - else if (node.kind === 11 && node.parent.parent.kind === 157) { + else if (node.kind === 11 && node.parent.parent.kind === 159) { var templateExpression = node.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 169); - var _argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; - return getArgumentListInfoForTemplate(tagExpression, _argumentIndex); + ts.Debug.assert(templateExpression.kind === 171); + var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; + return getArgumentListInfoForTemplate(tagExpression, argumentIndex); } - else if (node.parent.kind === 173 && node.parent.parent.parent.kind === 157) { + else if (node.parent.kind === 176 && node.parent.parent.parent.kind === 159) { var templateSpan = node.parent; - var _templateExpression = templateSpan.parent; - var _tagExpression = _templateExpression.parent; - ts.Debug.assert(_templateExpression.kind === 169); + var templateExpression = templateSpan.parent; + var tagExpression = templateExpression.parent; + ts.Debug.assert(templateExpression.kind === 171); if (node.kind === 13 && !ts.isInsideTemplateLiteral(node, position)) { return undefined; } - var spanIndex = _templateExpression.templateSpans.indexOf(templateSpan); - var _argumentIndex_1 = getArgumentIndexForTemplatePiece(spanIndex, node); - return getArgumentListInfoForTemplate(_tagExpression, _argumentIndex_1); + var spanIndex = templateExpression.templateSpans.indexOf(templateSpan); + var argumentIndex = getArgumentIndexForTemplatePiece(spanIndex, node); + return getArgumentListInfoForTemplate(tagExpression, argumentIndex); } return undefined; } function getArgumentIndex(argumentsList, node) { var argumentIndex = 0; var listChildren = argumentsList.getChildren(); - for (var _i = 0, _n = listChildren.length; _i < _n; _i++) { + for (var _i = 0; _i < listChildren.length; _i++) { var child = listChildren[_i]; if (child === node) { break; @@ -24440,7 +26221,7 @@ var ts; var template = taggedTemplate.template; var applicableSpanStart = template.getStart(); var applicableSpanEnd = template.getEnd(); - if (template.kind === 169) { + if (template.kind === 171) { var lastSpan = ts.lastOrUndefined(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, false); @@ -24449,16 +26230,16 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node) { - for (var n = node; n.kind !== 221; n = n.parent) { + for (var n = node; n.kind !== 227; n = n.parent) { if (ts.isFunctionBlock(n)) { return undefined; } if (n.pos < n.parent.pos || n.end > n.parent.end) { ts.Debug.fail("Node of kind " + n.kind + " is not a subspan of its parent of kind " + n.parent.kind); } - var _argumentInfo = getImmediatelyContainingArgumentInfo(n); - if (_argumentInfo) { - return _argumentInfo; + var argumentInfo_1 = getImmediatelyContainingArgumentInfo(n); + if (argumentInfo_1) { + return argumentInfo_1; } } return undefined; @@ -24621,6 +26402,129 @@ var ts; return start < end; } ts.startEndOverlapsWithStartEnd = startEndOverlapsWithStartEnd; + function positionBelongsToNode(candidate, position, sourceFile) { + return candidate.end > position || !isCompletedNode(candidate, sourceFile); + } + ts.positionBelongsToNode = positionBelongsToNode; + function isCompletedNode(n, sourceFile) { + if (ts.nodeIsMissing(n)) { + return false; + } + switch (n.kind) { + case 201: + case 202: + case 204: + case 154: + case 150: + case 145: + case 179: + case 206: + case 207: + return nodeEndsWith(n, 15, sourceFile); + case 223: + return isCompletedNode(n.block, sourceFile); + case 158: + if (!n.arguments) { + return true; + } + case 157: + case 161: + case 149: + return nodeEndsWith(n, 17, sourceFile); + case 142: + case 143: + return isCompletedNode(n.type, sourceFile); + case 135: + case 136: + case 137: + case 200: + case 162: + case 134: + case 133: + case 139: + case 138: + case 163: + if (n.body) { + return isCompletedNode(n.body, sourceFile); + } + if (n.type) { + return isCompletedNode(n.type, sourceFile); + } + return hasChildOfKind(n, 17, sourceFile); + case 205: + return n.body && isCompletedNode(n.body, sourceFile); + case 183: + if (n.elseStatement) { + return isCompletedNode(n.elseStatement, sourceFile); + } + return isCompletedNode(n.thenStatement, sourceFile); + case 182: + return isCompletedNode(n.expression, sourceFile); + case 153: + case 151: + case 156: + case 127: + case 147: + return nodeEndsWith(n, 19, sourceFile); + case 140: + if (n.type) { + return isCompletedNode(n.type, sourceFile); + } + return hasChildOfKind(n, 19, sourceFile); + case 220: + case 221: + return false; + case 186: + case 187: + case 188: + case 185: + return isCompletedNode(n.statement, sourceFile); + case 184: + var hasWhileKeyword = findChildOfKind(n, 100, sourceFile); + if (hasWhileKeyword) { + return nodeEndsWith(n, 17, sourceFile); + } + return isCompletedNode(n.statement, sourceFile); + case 144: + return isCompletedNode(n.exprName, sourceFile); + case 165: + case 164: + case 166: + case 172: + case 173: + var unaryWordExpression = n; + return isCompletedNode(unaryWordExpression.expression, sourceFile); + case 159: + return isCompletedNode(n.template, sourceFile); + case 171: + var lastSpan = ts.lastOrUndefined(n.templateSpans); + return isCompletedNode(lastSpan, sourceFile); + case 176: + return ts.nodeIsPresent(n.literal); + case 167: + return isCompletedNode(n.operand, sourceFile); + case 169: + return isCompletedNode(n.right, sourceFile); + case 170: + return isCompletedNode(n.whenFalse, sourceFile); + default: + return true; + } + } + ts.isCompletedNode = isCompletedNode; + function nodeEndsWith(n, expectedLastToken, sourceFile) { + var children = n.getChildren(sourceFile); + if (children.length) { + var last = children[children.length - 1]; + if (last.kind === expectedLastToken) { + return true; + } + else if (last.kind === 22 && children.length !== 1) { + return children[children.length - 2].kind === expectedLastToken; + } + } + return false; + } function findListItemInfo(node) { var list = findContainingList(node); if (!list) { @@ -24634,13 +26538,17 @@ var ts; }; } ts.findListItemInfo = findListItemInfo; + function hasChildOfKind(n, kind, sourceFile) { + return !!findChildOfKind(n, kind, sourceFile); + } + ts.hasChildOfKind = hasChildOfKind; function findChildOfKind(n, kind, sourceFile) { return ts.forEach(n.getChildren(sourceFile), function (c) { return c.kind === kind && c; }); } ts.findChildOfKind = findChildOfKind; function findContainingList(node) { var syntaxList = ts.forEach(node.parent.getChildren(), function (c) { - if (c.kind === 222 && c.pos <= node.pos && c.end >= node.end) { + if (c.kind === 228 && c.pos <= node.pos && c.end >= node.end) { return c; } }); @@ -24705,7 +26613,7 @@ var ts; return n; } var children = n.getChildren(); - for (var _i = 0, _n = children.length; _i < _n; _i++) { + for (var _i = 0; _i < children.length; _i++) { var child = children[_i]; var shouldDiveInChildNode = (child.pos <= previousToken.pos && child.end > previousToken.end) || (child.pos === previousToken.end); @@ -24746,10 +26654,10 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 221); + ts.Debug.assert(startNode !== undefined || n.kind === 227); if (children.length) { - var _candidate = findRightmostChildNodeWithTokens(children, children.length); - return _candidate && findRightmostToken(_candidate); + var candidate = findRightmostChildNodeWithTokens(children, children.length); + return candidate && findRightmostToken(candidate); } } function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) { @@ -24783,22 +26691,23 @@ var ts; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 139 || node.kind === 155) { + if (node.kind === 141 || node.kind === 157) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 196 || node.kind === 197) { + if (ts.isFunctionLike(node) || node.kind === 201 || node.kind === 202) { return node.typeParameters; } return undefined; } ts.getTypeArgumentOrTypeParameterList = getTypeArgumentOrTypeParameterList; function isToken(n) { - return n.kind >= 0 && n.kind <= 124; + return n.kind >= 0 && n.kind <= 125; } ts.isToken = isToken; function isWord(kind) { - return kind === 64 || ts.isKeyword(kind); + return kind === 65 || ts.isKeyword(kind); } + ts.isWord = isWord; function isPropertyName(kind) { return kind === 8 || kind === 7 || isWord(kind); } @@ -24807,7 +26716,7 @@ var ts; } ts.isComment = isComment; function isPunctuation(kind) { - return 14 <= kind && kind <= 63; + return 14 <= kind && kind <= 64; } ts.isPunctuation = isPunctuation; function isInsideTemplateLiteral(node, position) { @@ -24815,6 +26724,16 @@ var ts; && (node.getStart() < position && position < node.getEnd()) || (!!node.isUnterminated && position === node.getEnd()); } ts.isInsideTemplateLiteral = isInsideTemplateLiteral; + function isAccessibilityModifier(kind) { + switch (kind) { + case 109: + case 107: + case 108: + return true; + } + return false; + } + ts.isAccessibilityModifier = isAccessibilityModifier; function compareDataObjects(dst, src) { for (var e in dst) { if (typeof dst[e] === "object") { @@ -24835,7 +26754,7 @@ var ts; var ts; (function (ts) { function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 128; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 129; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -24846,12 +26765,12 @@ var ts; resetWriter(); return { displayParts: function () { return displayParts; }, - writeKeyword: function (text) { return writeKind(text, 5); }, - writeOperator: function (text) { return writeKind(text, 12); }, - writePunctuation: function (text) { return writeKind(text, 15); }, - writeSpace: function (text) { return writeKind(text, 16); }, - writeStringLiteral: function (text) { return writeKind(text, 8); }, - writeParameter: function (text) { return writeKind(text, 13); }, + writeKeyword: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.keyword); }, + writeOperator: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.operator); }, + writePunctuation: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.punctuation); }, + writeSpace: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.space); }, + writeStringLiteral: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.stringLiteral); }, + writeParameter: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.parameterName); }, writeSymbol: writeSymbol, writeLine: writeLine, increaseIndent: function () { indent++; }, @@ -24863,7 +26782,7 @@ var ts; if (lineStart) { var indentString = ts.getIndentString(indent); if (indentString) { - displayParts.push(displayPart(indentString, 16)); + displayParts.push(displayPart(indentString, ts.SymbolDisplayPartKind.space)); } lineStart = false; } @@ -24891,48 +26810,48 @@ var ts; function displayPartKind(symbol) { var flags = symbol.flags; if (flags & 3) { - return isFirstDeclarationOfSymbolParameter(symbol) ? 13 : 9; + return isFirstDeclarationOfSymbolParameter(symbol) ? ts.SymbolDisplayPartKind.parameterName : ts.SymbolDisplayPartKind.localName; } else if (flags & 4) { - return 14; + return ts.SymbolDisplayPartKind.propertyName; } else if (flags & 32768) { - return 14; + return ts.SymbolDisplayPartKind.propertyName; } else if (flags & 65536) { - return 14; + return ts.SymbolDisplayPartKind.propertyName; } else if (flags & 8) { - return 19; + return ts.SymbolDisplayPartKind.enumMemberName; } else if (flags & 16) { - return 20; + return ts.SymbolDisplayPartKind.functionName; } else if (flags & 32) { - return 1; + return ts.SymbolDisplayPartKind.className; } else if (flags & 64) { - return 4; + return ts.SymbolDisplayPartKind.interfaceName; } else if (flags & 384) { - return 2; + return ts.SymbolDisplayPartKind.enumName; } else if (flags & 1536) { - return 11; + return ts.SymbolDisplayPartKind.moduleName; } else if (flags & 8192) { - return 10; + return ts.SymbolDisplayPartKind.methodName; } else if (flags & 262144) { - return 18; + return ts.SymbolDisplayPartKind.typeParameterName; } else if (flags & 524288) { - return 0; + return ts.SymbolDisplayPartKind.aliasName; } else if (flags & 8388608) { - return 0; + return ts.SymbolDisplayPartKind.aliasName; } - return 17; + return ts.SymbolDisplayPartKind.text; } } ts.symbolPart = symbolPart; @@ -24944,27 +26863,34 @@ var ts; } ts.displayPart = displayPart; function spacePart() { - return displayPart(" ", 16); + return displayPart(" ", ts.SymbolDisplayPartKind.space); } ts.spacePart = spacePart; function keywordPart(kind) { - return displayPart(ts.tokenToString(kind), 5); + return displayPart(ts.tokenToString(kind), ts.SymbolDisplayPartKind.keyword); } ts.keywordPart = keywordPart; function punctuationPart(kind) { - return displayPart(ts.tokenToString(kind), 15); + return displayPart(ts.tokenToString(kind), ts.SymbolDisplayPartKind.punctuation); } ts.punctuationPart = punctuationPart; function operatorPart(kind) { - return displayPart(ts.tokenToString(kind), 12); + return displayPart(ts.tokenToString(kind), ts.SymbolDisplayPartKind.operator); } ts.operatorPart = operatorPart; + function textOrKeywordPart(text) { + var kind = ts.stringToToken(text); + return kind === undefined + ? textPart(text) + : keywordPart(kind); + } + ts.textOrKeywordPart = textOrKeywordPart; function textPart(text) { - return displayPart(text, 17); + return displayPart(text, ts.SymbolDisplayPartKind.text); } ts.textPart = textPart; function lineBreakPart() { - return displayPart("\n", 6); + return displayPart("\n", ts.SymbolDisplayPartKind.lineBreak); } ts.lineBreakPart = lineBreakPart; function mapToDisplayParts(writeDisplayParts) { @@ -24993,6 +26919,8 @@ var ts; } ts.signatureToDisplayParts = signatureToDisplayParts; })(ts || (ts = {})); +/// +/// var ts; (function (ts) { var formatting; @@ -25044,21 +26972,21 @@ var ts; var t; var pos = scanner.getStartPos(); while (pos < endPos) { - var _t = scanner.getToken(); - if (!ts.isTrivia(_t)) { + var t_2 = scanner.getToken(); + if (!ts.isTrivia(t_2)) { break; } scanner.scan(); - var _item = { + var item_4 = { pos: pos, end: scanner.getStartPos(), - kind: _t + kind: t_2 }; pos = scanner.getStartPos(); if (!leadingTrivia) { leadingTrivia = []; } - leadingTrivia.push(_item); + leadingTrivia.push(item_4); } savedPos = scanner.getStartPos(); } @@ -25066,8 +26994,8 @@ var ts; if (node) { switch (node.kind) { case 27: - case 59: case 60: + case 61: case 42: case 41: return true; @@ -25083,7 +27011,7 @@ var ts; container.kind === 13; } function startsWithSlashToken(t) { - return t === 36 || t === 56; + return t === 36 || t === 57; } function readTokenInfo(n) { if (!isOnToken()) { @@ -25162,8 +27090,8 @@ var ts; } function isOnToken() { var current = (lastTokenInfo && lastTokenInfo.token.kind) || scanner.getToken(); - var _startPos = (lastTokenInfo && lastTokenInfo.token.pos) || scanner.getStartPos(); - return _startPos < endPos && current !== 1 && !ts.isTrivia(current); + var startPos = (lastTokenInfo && lastTokenInfo.token.pos) || scanner.getStartPos(); + return startPos < endPos && current !== 1 && !ts.isTrivia(current); } function fixTokenKind(tokenInfo, container) { if (ts.isToken(container) && tokenInfo.token.kind !== container.kind) { @@ -25175,6 +27103,21 @@ var ts; formatting.getFormattingScanner = getFormattingScanner; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; @@ -25253,6 +27196,21 @@ var ts; formatting.FormattingContext = FormattingContext; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; @@ -25267,6 +27225,21 @@ var ts; var FormattingRequestKind = formatting.FormattingRequestKind; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; @@ -25288,6 +27261,21 @@ var ts; formatting.Rule = Rule; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; @@ -25301,6 +27289,21 @@ var ts; var RuleAction = formatting.RuleAction; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; @@ -25331,6 +27334,21 @@ var ts; formatting.RuleDescriptor = RuleDescriptor; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; @@ -25342,6 +27360,21 @@ var ts; var RuleFlags = formatting.RuleFlags; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; @@ -25369,6 +27402,21 @@ var ts; formatting.RuleOperation = RuleOperation; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; @@ -25388,7 +27436,7 @@ var ts; if (this.IsAny()) { return true; } - for (var _i = 0, _a = this.customContextChecks, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = this.customContextChecks; _i < _a.length; _i++) { var check = _a[_i]; if (!check(context)) { return false; @@ -25402,12 +27450,30 @@ var ts; formatting.RuleOperationContext = RuleOperationContext; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; (function (formatting) { var Rules = (function () { function Rules() { + /// + /// Common Rules + /// this.IgnoreBeforeComment = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.Comments), formatting.RuleOperation.create1(1)); this.IgnoreAfterLineComment = new formatting.Rule(formatting.RuleDescriptor.create3(2, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create1(1)); this.NoSpaceBeforeSemicolon = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 22), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); @@ -25418,8 +27484,8 @@ var ts; this.NoSpaceAfterQuestionMark = new formatting.Rule(formatting.RuleDescriptor.create3(50, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.SpaceAfterSemicolon = new formatting.Rule(formatting.RuleDescriptor.create3(22, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); this.SpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(15, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsAfterCodeBlockContext), 2)); - this.SpaceBetweenCloseBraceAndElse = new formatting.Rule(formatting.RuleDescriptor.create1(15, 75), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - this.SpaceBetweenCloseBraceAndWhile = new formatting.Rule(formatting.RuleDescriptor.create1(15, 99), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); + this.SpaceBetweenCloseBraceAndElse = new formatting.Rule(formatting.RuleDescriptor.create1(15, 76), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); + this.SpaceBetweenCloseBraceAndWhile = new formatting.Rule(formatting.RuleDescriptor.create1(15, 100), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); this.NoSpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(15, formatting.Shared.TokenRange.FromTokens([17, 19, 23, 22])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.NoSpaceBeforeDot = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.NoSpaceAfterDot = new formatting.Rule(formatting.RuleDescriptor.create3(20, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); @@ -25429,9 +27495,9 @@ var ts; this.NoSpaceAfterCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create3(19, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.FunctionOpenBraceLeftTokenRange = formatting.Shared.TokenRange.AnyIncludingMultilineComments; this.SpaceBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1); - this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([64, 3]); + this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([65, 3]); this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1); - this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([17, 3, 74, 95, 80, 75]); + this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([17, 3, 75, 96, 81, 76]); this.SpaceBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1); this.SpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(14, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2)); this.SpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2)); @@ -25450,25 +27516,25 @@ var ts; this.SpaceAfterSubtractWhenFollowedByUnaryMinus = new formatting.Rule(formatting.RuleDescriptor.create1(34, 34), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); this.SpaceAfterSubtractWhenFollowedByPredecrement = new formatting.Rule(formatting.RuleDescriptor.create1(34, 39), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); this.NoSpaceBeforeComma = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 23), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.SpaceAfterCertainKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([97, 93, 87, 73, 89, 96]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([104, 69]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2)); + this.SpaceAfterCertainKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([98, 94, 88, 74, 90, 97]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); + this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([105, 70]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2)); this.NoSpaceBeforeOpenParenInFuncCall = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionCallOrNewContext, Rules.IsPreviousTokenNotComma), 8)); - this.SpaceAfterFunctionInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create3(82, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); + this.SpaceAfterFunctionInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create3(83, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); this.NoSpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionDeclContext), 8)); - this.SpaceAfterVoidOperator = new formatting.Rule(formatting.RuleDescriptor.create3(98, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsVoidOpContext), 2)); - this.NoSpaceBetweenReturnAndSemicolon = new formatting.Rule(formatting.RuleDescriptor.create1(89, 22), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.SpaceBetweenStatements = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([17, 74, 75, 66]), 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([95, 80]), 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([115, 119]), 64), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); + this.SpaceAfterVoidOperator = new formatting.Rule(formatting.RuleDescriptor.create3(99, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsVoidOpContext), 2)); + 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.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(113, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([116, 117]), 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([68, 114, 76, 77, 78, 115, 102, 84, 103, 116, 106, 108, 119, 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([78, 102])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 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, 103, 85, 104, 117, 107, 109, 120, 110]), 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, 103])), 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)); - this.NoSpaceAfterEllipsis = new formatting.Rule(formatting.RuleDescriptor.create1(21, 64), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); + this.NoSpaceAfterEllipsis = new formatting.Rule(formatting.RuleDescriptor.create1(21, 65), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.NoSpaceAfterOptionalParameters = new formatting.Rule(formatting.RuleDescriptor.create3(50, formatting.Shared.TokenRange.FromTokens([17, 23])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8)); this.NoSpaceBeforeOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.TypeNames, 24), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); this.NoSpaceBetweenCloseParenAndAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create1(17, 24), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); @@ -25541,42 +27607,42 @@ var ts; this.NoSpaceBetweenParens = new formatting.Rule(formatting.RuleDescriptor.create1(16, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.NoSpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.NoSpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.SpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(82, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); - this.NoSpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(82, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 8)); + this.SpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(83, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); + this.NoSpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(83, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 8)); } Rules.prototype.getRuleName = function (rule) { var o = this; - for (var _name in o) { - if (o[_name] === rule) { - return _name; + for (var name_19 in o) { + if (o[name_19] === rule) { + return name_19; } } throw new Error("Unknown rule"); }; Rules.IsForContext = function (context) { - return context.contextNode.kind === 181; + return context.contextNode.kind === 186; }; Rules.IsNotForContext = function (context) { return !Rules.IsForContext(context); }; Rules.IsBinaryOpContext = function (context) { switch (context.contextNode.kind) { - case 167: - case 168: + case 169: + case 170: return true; - case 203: - case 193: - case 128: - case 220: - case 130: + case 208: + case 198: case 129: - return context.currentTokenSpan.kind === 52 || context.nextTokenSpan.kind === 52; - case 182: - return context.currentTokenSpan.kind === 85 || context.nextTokenSpan.kind === 85; - case 183: - return context.currentTokenSpan.kind === 124 || context.nextTokenSpan.kind === 124; - case 150: - return context.currentTokenSpan.kind === 52 || context.nextTokenSpan.kind === 52; + case 226: + 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 false; }; @@ -25584,9 +27650,25 @@ var ts; return !Rules.IsBinaryOpContext(context); }; Rules.IsConditionalOperatorContext = function (context) { - return context.contextNode.kind === 168; + return context.contextNode.kind === 170; }; Rules.IsSameLineTokenOrBeforeMultilineBlockContext = function (context) { + //// This check is mainly used inside SpaceBeforeOpenBraceInControl and SpaceBeforeOpenBraceInFunction. + //// + //// Ex: + //// if (1) { .... + //// * ) and { are on the same line so apply the rule. Here we don't care whether it's same or multi block context + //// + //// Ex: + //// if (1) + //// { ... } + //// * ) and { are on differnet lines. We only need to format if the block is multiline context. So in this case we don't format. + //// + //// Ex: + //// if (1) + //// { ... + //// } + //// * ) and { are on differnet lines. We only need to format if the block is multiline context. So in this case we format. return context.TokensAreOnSameLine() || Rules.IsBeforeMultilineBlockContext(context); }; Rules.IsBeforeMultilineBlockContext = function (context) { @@ -25609,26 +27691,26 @@ var ts; return true; } switch (node.kind) { - case 174: - case 202: - case 152: - case 201: + case 179: + case 207: + case 154: + case 206: return true; } return false; }; Rules.IsFunctionDeclContext = function (context) { switch (context.contextNode.kind) { - case 195: - case 132: - case 131: + case 200: case 134: - case 135: - case 136: - case 160: case 133: - case 161: - case 197: + case 136: + case 137: + case 138: + case 162: + case 135: + case 163: + case 202: return true; } return false; @@ -25638,53 +27720,53 @@ var ts; }; Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) { switch (node.kind) { - case 196: - case 197: - case 199: - case 143: - case 200: + case 201: + case 202: + case 204: + case 145: + case 205: return true; } return false; }; Rules.IsAfterCodeBlockContext = function (context) { switch (context.currentTokenParent.kind) { - case 196: - case 200: - case 199: - case 174: - case 217: case 201: - case 188: + case 205: + case 204: + case 179: + case 223: + case 206: + case 193: return true; } return false; }; Rules.IsControlDeclContext = function (context) { switch (context.contextNode.kind) { - case 178: - case 188: - case 181: - case 182: case 183: - case 180: - case 191: - case 179: + case 193: + case 186: case 187: - case 217: + case 188: + case 185: + case 196: + case 184: + case 192: + case 223: return true; default: return false; } }; Rules.IsObjectContext = function (context) { - return context.contextNode.kind === 152; + return context.contextNode.kind === 154; }; Rules.IsFunctionCallContext = function (context) { - return context.contextNode.kind === 155; + return context.contextNode.kind === 157; }; Rules.IsNewContext = function (context) { - return context.contextNode.kind === 156; + return context.contextNode.kind === 158; }; Rules.IsFunctionCallOrNewContext = function (context) { return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context); @@ -25696,35 +27778,35 @@ var ts; return context.TokensAreOnSameLine(); }; Rules.IsStartOfVariableDeclarationList = function (context) { - return context.currentTokenParent.kind === 194 && + return context.currentTokenParent.kind === 199 && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; }; Rules.IsNotFormatOnEnter = function (context) { return context.formattingRequestKind != 2; }; Rules.IsModuleDeclContext = function (context) { - return context.contextNode.kind === 200; + return context.contextNode.kind === 205; }; Rules.IsObjectTypeContext = function (context) { - return context.contextNode.kind === 143; + return context.contextNode.kind === 145; }; Rules.IsTypeArgumentOrParameter = function (token, parent) { if (token.kind !== 24 && token.kind !== 25) { return false; } switch (parent.kind) { + case 141: + case 201: + case 202: + case 200: + case 162: + case 163: + case 134: + case 133: + case 138: case 139: - case 196: - case 197: - case 195: - case 160: - case 161: - case 132: - case 131: - case 136: - case 137: - case 155: - case 156: + case 157: + case 158: return true; default: return false; @@ -25735,13 +27817,28 @@ var ts; Rules.IsTypeArgumentOrParameter(context.nextTokenSpan, context.nextTokenParent); }; Rules.IsVoidOpContext = function (context) { - return context.currentTokenSpan.kind === 98 && context.currentTokenParent.kind === 164; + return context.currentTokenSpan.kind === 99 && context.currentTokenParent.kind === 166; }; return Rules; })(); formatting.Rules = Rules; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; @@ -25757,7 +27854,7 @@ var ts; return result; }; RulesMap.prototype.Initialize = function (rules) { - this.mapRowLength = 124 + 1; + this.mapRowLength = 125 + 1; this.map = new Array(this.mapRowLength * this.mapRowLength); var rulesBucketConstructionStateList = new Array(this.map.length); this.FillRules(rules, rulesBucketConstructionStateList); @@ -25792,7 +27889,7 @@ var ts; var bucketIndex = this.GetRuleBucketIndex(context.currentTokenSpan.kind, context.nextTokenSpan.kind); var bucket = this.map[bucketIndex]; if (bucket != null) { - for (var _i = 0, _a = bucket.Rules(), _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = bucket.Rules(); _i < _a.length; _i++) { var rule = _a[_i]; if (rule.Operation.Context.InContext(context)) { return rule; @@ -25852,7 +27949,7 @@ var ts; var position; if (rule.Operation.Action == 1) { position = specificTokens ? - 0 : + RulesPosition.IgnoreRulesSpecific : RulesPosition.IgnoreRulesAny; } else if (!rule.Operation.Context.IsAny()) { @@ -25878,6 +27975,21 @@ var ts; formatting.RulesBucket = RulesBucket; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; @@ -25933,7 +28045,7 @@ var ts; } TokenAllAccess.prototype.GetTokens = function () { var result = []; - for (var token = 0; token <= 124; token++) { + for (var token = 0; token <= 125; token++) { result.push(token); } return result; @@ -25975,23 +28087,64 @@ var ts; }; TokenRange.Any = TokenRange.AllTokens(); TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([3])); - TokenRange.Keywords = TokenRange.FromRange(65, 124); - TokenRange.BinaryOperators = TokenRange.FromRange(24, 63); - TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([85, 86, 124]); + TokenRange.Keywords = TokenRange.FromRange(66, 125); + TokenRange.BinaryOperators = TokenRange.FromRange(24, 64); + TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([86, 87, 125]); TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([38, 39, 47, 46]); - TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([7, 64, 16, 18, 14, 92, 87]); - TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([64, 16, 92, 87]); - TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([64, 17, 19, 87]); - TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([64, 16, 92, 87]); - TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([64, 17, 19, 87]); + TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([7, 65, 16, 18, 14, 93, 88]); + TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([65, 16, 93, 88]); + TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([65, 17, 19, 88]); + 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([64, 118, 120, 112, 121, 98, 111]); + TokenRange.TypeNames = TokenRange.FromTokens([65, 119, 121, 113, 122, 99, 112]); return TokenRange; })(); Shared.TokenRange = TokenRange; })(Shared = formatting.Shared || (formatting.Shared = {})); })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; @@ -26077,6 +28230,10 @@ var ts; formatting.RulesProvider = RulesProvider; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); +/// +/// +/// +/// var ts; (function (ts) { var formatting; @@ -26122,13 +28279,13 @@ var ts; } formatting.formatSelection = formatSelection; function formatOutermostParent(position, expectedLastToken, sourceFile, options, rulesProvider, requestKind) { - var _parent = findOutermostParent(position, expectedLastToken, sourceFile); - if (!_parent) { + var parent = findOutermostParent(position, expectedLastToken, sourceFile); + if (!parent) { return []; } var span = { - pos: ts.getLineStartPositionForPosition(_parent.getStart(sourceFile), sourceFile), - end: _parent.end + pos: ts.getLineStartPositionForPosition(parent.getStart(sourceFile), sourceFile), + end: parent.end }; return formatSpan(span, sourceFile, options, rulesProvider, requestKind); } @@ -26150,17 +28307,17 @@ var ts; } function isListElement(parent, node) { switch (parent.kind) { - case 196: - case 197: - return ts.rangeContainsRange(parent.members, node); - case 200: - var body = parent.body; - return body && body.kind === 174 && ts.rangeContainsRange(body.statements, node); - case 221: - case 174: case 201: + case 202: + 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: return ts.rangeContainsRange(parent.statements, node); - case 217: + case 223: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -26265,10 +28422,10 @@ var ts; } } else { - var _startLine = sourceFile.getLineAndCharacterOfPosition(startPos).line; + var startLine = sourceFile.getLineAndCharacterOfPosition(startPos).line; var startLinePosition = ts.getLineStartPositionForPosition(startPos, sourceFile); var column = formatting.SmartIndenter.findFirstNonWhitespaceColumn(startLinePosition, startPos, sourceFile, options); - if (_startLine !== parentStartLine || startPos === column) { + if (startLine !== parentStartLine || startPos === column) { return column; } } @@ -26279,9 +28436,9 @@ var ts; if (indentation === -1) { if (isSomeBlock(node.kind)) { if (isSomeBlock(parent.kind) || - parent.kind === 221 || - parent.kind === 214 || - parent.kind === 215) { + parent.kind === 227 || + parent.kind === 220 || + parent.kind === 221) { indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); } else { @@ -26307,6 +28464,26 @@ var ts; delta: delta }; } + function getFirstNonDecoratorTokenOfNode(node) { + if (node.modifiers && node.modifiers.length) { + return node.modifiers[0].kind; + } + switch (node.kind) { + case 201: return 69; + case 202: return 104; + case 200: return 83; + case 204: return 204; + case 136: return 116; + case 137: return 120; + case 134: + if (node.asteriskToken) { + return 35; + } + case 132: + case 129: + return node.name.kind; + } + } function getDynamicIndentation(node, nodeStartLine, indentation, delta) { return { getIndentationForComment: function (kind) { @@ -26318,13 +28495,19 @@ var ts; return indentation; }, getIndentationForToken: function (line, kind) { + if (nodeStartLine !== line && node.decorators) { + if (kind === getFirstNonDecoratorTokenOfNode(node)) { + return indentation; + } + } switch (kind) { case 14: case 15: case 18: case 19: - case 75: - case 99: + case 76: + case 100: + case 52: return indentation; default: return nodeStartLine !== line ? indentation + delta : indentation; @@ -26385,19 +28568,19 @@ var ts; return inheritedIndentation; } while (formattingScanner.isOnToken()) { - var _tokenInfo = formattingScanner.readTokenInfo(node); - if (_tokenInfo.token.end > childStartPos) { + var tokenInfo = formattingScanner.readTokenInfo(node); + if (tokenInfo.token.end > childStartPos) { break; } - consumeTokenAndAdvanceScanner(_tokenInfo, node, parentDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); } if (!formattingScanner.isOnToken()) { return inheritedIndentation; } if (ts.isToken(child)) { - var _tokenInfo_1 = formattingScanner.readTokenInfo(child); - ts.Debug.assert(_tokenInfo_1.token.end === child.end); - consumeTokenAndAdvanceScanner(_tokenInfo_1, node, parentDynamicIndentation); + var tokenInfo = formattingScanner.readTokenInfo(child); + ts.Debug.assert(tokenInfo.token.end === child.end); + consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); return inheritedIndentation; } var childIndentation = computeIndentation(child, childStart.line, childIndentationAmount, node, parentDynamicIndentation, parentStartLine); @@ -26409,34 +28592,34 @@ var ts; var listStartToken = getOpenTokenForList(parent, nodes); var listEndToken = getCloseTokenForOpenToken(listStartToken); var listDynamicIndentation = parentDynamicIndentation; - var _startLine = parentStartLine; + var startLine = parentStartLine; if (listStartToken !== 0) { while (formattingScanner.isOnToken()) { - var _tokenInfo = formattingScanner.readTokenInfo(parent); - if (_tokenInfo.token.end > nodes.pos) { + var tokenInfo = formattingScanner.readTokenInfo(parent); + if (tokenInfo.token.end > nodes.pos) { break; } - else if (_tokenInfo.token.kind === listStartToken) { - _startLine = sourceFile.getLineAndCharacterOfPosition(_tokenInfo.token.pos).line; - var _indentation = computeIndentation(_tokenInfo.token, _startLine, -1, parent, parentDynamicIndentation, _startLine); - listDynamicIndentation = getDynamicIndentation(parent, parentStartLine, _indentation.indentation, _indentation.delta); - consumeTokenAndAdvanceScanner(_tokenInfo, parent, listDynamicIndentation); + else if (tokenInfo.token.kind === listStartToken) { + startLine = sourceFile.getLineAndCharacterOfPosition(tokenInfo.token.pos).line; + var indentation_1 = computeIndentation(tokenInfo.token, startLine, -1, parent, parentDynamicIndentation, startLine); + listDynamicIndentation = getDynamicIndentation(parent, parentStartLine, indentation_1.indentation, indentation_1.delta); + consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); } else { - consumeTokenAndAdvanceScanner(_tokenInfo, parent, parentDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, parent, parentDynamicIndentation); } } } var inheritedIndentation = -1; - for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + for (var _i = 0; _i < nodes.length; _i++) { var child = nodes[_i]; - inheritedIndentation = processChildNode(child, inheritedIndentation, node, listDynamicIndentation, _startLine, true); + inheritedIndentation = processChildNode(child, inheritedIndentation, node, listDynamicIndentation, startLine, true); } if (listEndToken !== 0) { if (formattingScanner.isOnToken()) { - var _tokenInfo_1 = formattingScanner.readTokenInfo(parent); - if (_tokenInfo_1.token.kind === listEndToken && ts.rangeContainsRange(parent, _tokenInfo_1.token)) { - consumeTokenAndAdvanceScanner(_tokenInfo_1, parent, listDynamicIndentation); + var tokenInfo = formattingScanner.readTokenInfo(parent); + if (tokenInfo.token.kind === listEndToken && ts.rangeContainsRange(parent, tokenInfo.token)) { + consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); } } } @@ -26473,7 +28656,7 @@ var ts; if (indentToken) { var indentNextTokenOrTrivia = true; if (currentTokenInfo.leadingTrivia) { - for (var _i = 0, _a = currentTokenInfo.leadingTrivia, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = currentTokenInfo.leadingTrivia; _i < _a.length; _i++) { var triviaItem = _a[_i]; if (!ts.rangeContainsRange(originalRange, triviaItem)) { continue; @@ -26487,8 +28670,8 @@ var ts; break; case 2: if (indentNextTokenOrTrivia) { - var _commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); - insertIndentation(triviaItem.pos, _commentIndentation, false); + var commentIndentation_1 = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); + insertIndentation(triviaItem.pos, commentIndentation_1, false); indentNextTokenOrTrivia = false; } break; @@ -26508,7 +28691,7 @@ var ts; } } function processTrivia(trivia, parent, contextNode, dynamicIndentation) { - for (var _i = 0, _n = trivia.length; _i < _n; _i++) { + for (var _i = 0; _i < trivia.length; _i++) { var triviaItem = trivia[_i]; if (ts.isComment(triviaItem.kind) && ts.rangeContainsRange(originalRange, triviaItem)) { var triviaItemStart = sourceFile.getLineAndCharacterOfPosition(triviaItem.pos); @@ -26580,10 +28763,10 @@ var ts; } } function indentMultilineComment(commentRange, indentation, firstLineIsIndented) { - var _startLine = sourceFile.getLineAndCharacterOfPosition(commentRange.pos).line; + var startLine = sourceFile.getLineAndCharacterOfPosition(commentRange.pos).line; var endLine = sourceFile.getLineAndCharacterOfPosition(commentRange.end).line; var parts; - if (_startLine === endLine) { + if (startLine === endLine) { if (!firstLineIsIndented) { insertIndentation(commentRange.pos, indentation, false); } @@ -26592,14 +28775,14 @@ var ts; else { parts = []; var startPos = commentRange.pos; - for (var line = _startLine; line < endLine; ++line) { + for (var line = startLine; line < endLine; ++line) { var endOfLine = ts.getEndLinePosition(line, sourceFile); parts.push({ pos: startPos, end: endOfLine }); startPos = ts.getStartPositionOfLine(line + 1, sourceFile); } parts.push({ pos: startPos, end: commentRange.end }); } - var startLinePos = ts.getStartPositionOfLine(_startLine, sourceFile); + var startLinePos = ts.getStartPositionOfLine(startLine, sourceFile); var nonWhitespaceColumnInFirstPart = formatting.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(startLinePos, parts[0].pos, sourceFile, options); if (indentation === nonWhitespaceColumnInFirstPart.column) { return; @@ -26607,21 +28790,21 @@ var ts; var startIndex = 0; if (firstLineIsIndented) { startIndex = 1; - _startLine++; + startLine++; } - var _delta = indentation - nonWhitespaceColumnInFirstPart.column; - for (var i = startIndex, len = parts.length; i < len; ++i, ++_startLine) { - var _startLinePos = ts.getStartPositionOfLine(_startLine, sourceFile); + var delta = indentation - nonWhitespaceColumnInFirstPart.column; + for (var i = startIndex, len = parts.length; i < len; ++i, ++startLine) { + var startLinePos_1 = ts.getStartPositionOfLine(startLine, sourceFile); var nonWhitespaceCharacterAndColumn = i === 0 ? nonWhitespaceColumnInFirstPart : formatting.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(parts[i].pos, parts[i].end, sourceFile, options); - var newIndentation = nonWhitespaceCharacterAndColumn.column + _delta; + var newIndentation = nonWhitespaceCharacterAndColumn.column + delta; if (newIndentation > 0) { var indentationString = getIndentationString(newIndentation, options); - recordReplace(_startLinePos, nonWhitespaceCharacterAndColumn.character, indentationString); + recordReplace(startLinePos_1, nonWhitespaceCharacterAndColumn.character, indentationString); } else { - recordDelete(_startLinePos, nonWhitespaceCharacterAndColumn.character); + recordDelete(startLinePos_1, nonWhitespaceCharacterAndColumn.character); } } } @@ -26688,20 +28871,20 @@ var ts; } function isSomeBlock(kind) { switch (kind) { - case 174: - case 201: + case 179: + case 206: return true; } return false; } function getOpenTokenForList(node, list) { switch (node.kind) { + case 135: + case 200: + case 162: + case 134: case 133: - case 195: - case 160: - case 132: - case 131: - case 161: + case 163: if (node.typeParameters === list) { return 24; } @@ -26709,8 +28892,8 @@ var ts; return 16; } break; - case 155: - case 156: + case 157: + case 158: if (node.typeArguments === list) { return 24; } @@ -26718,7 +28901,7 @@ var ts; return 16; } break; - case 139: + case 141: if (node.typeArguments === list) { return 24; } @@ -26734,9 +28917,15 @@ var ts; } return 0; } + var internedSizes; var internedTabsIndentation; var internedSpacesIndentation; function getIndentationString(indentation, options) { + var resetInternedStrings = !internedSizes || (internedSizes.tabSize !== options.TabSize || internedSizes.indentSize !== options.IndentSize); + if (resetInternedStrings) { + internedSizes = { tabSize: options.TabSize, indentSize: options.IndentSize }; + internedTabsIndentation = internedSpacesIndentation = undefined; + } if (!options.ConvertTabsToSpaces) { var tabs = Math.floor(indentation / options.TabSize); var spaces = indentation - tabs * options.TabSize; @@ -26779,6 +28968,7 @@ var ts; formatting.getIndentationString = getIndentationString; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); +/// var ts; (function (ts) { var formatting; @@ -26807,7 +28997,7 @@ var ts; return 0; } var lineAtPosition = sourceFile.getLineAndCharacterOfPosition(position).line; - if (precedingToken.kind === 23 && precedingToken.parent.kind !== 167) { + if (precedingToken.kind === 23 && precedingToken.parent.kind !== 169) { var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1) { return actualIndentation; @@ -26818,7 +29008,7 @@ var ts; var currentStart; var indentationDelta; while (current) { - if (positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode(current.kind, previous ? previous.kind : 0)) { + if (ts.positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode(current.kind, previous ? previous.kind : 0)) { currentStart = getStartLineAndCharacterForNode(current, sourceFile); if (nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile)) { indentationDelta = 0; @@ -26828,9 +29018,9 @@ var ts; } break; } - var _actualIndentation = getActualIndentationForListItem(current, sourceFile, options); - if (_actualIndentation !== -1) { - return _actualIndentation; + var actualIndentation = getActualIndentationForListItem(current, sourceFile, options); + if (actualIndentation !== -1) { + return actualIndentation; } previous = current; current = current.parent; @@ -26847,9 +29037,9 @@ var ts; } SmartIndenter.getIndentationForNode = getIndentationForNode; function getIndentationForNodeWorker(current, currentStart, ignoreActualIndentationRange, indentationDelta, sourceFile, options) { - var _parent = current.parent; + var parent = current.parent; var parentStart; - while (_parent) { + while (parent) { var useActualIndentation = true; if (ignoreActualIndentationRange) { var start = current.getStart(sourceFile); @@ -26861,21 +29051,21 @@ var ts; return actualIndentation + indentationDelta; } } - parentStart = getParentStart(_parent, current, sourceFile); + parentStart = getParentStart(parent, current, sourceFile); var parentAndChildShareLine = parentStart.line === currentStart.line || - childStartsOnTheSameLineWithElseInIfStatement(_parent, current, currentStart.line, sourceFile); + childStartsOnTheSameLineWithElseInIfStatement(parent, current, currentStart.line, sourceFile); if (useActualIndentation) { - var _actualIndentation = getActualIndentationForNode(current, _parent, currentStart, parentAndChildShareLine, sourceFile, options); - if (_actualIndentation !== -1) { - return _actualIndentation + indentationDelta; + var actualIndentation = getActualIndentationForNode(current, parent, currentStart, parentAndChildShareLine, sourceFile, options); + if (actualIndentation !== -1) { + return actualIndentation + indentationDelta; } } - if (shouldIndentChildNode(_parent.kind, current.kind) && !parentAndChildShareLine) { + if (shouldIndentChildNode(parent.kind, current.kind) && !parentAndChildShareLine) { indentationDelta += options.IndentSize; } - current = _parent; + current = parent; currentStart = parentStart; - _parent = current.parent; + parent = current.parent; } return indentationDelta; } @@ -26897,7 +29087,7 @@ var ts; } function getActualIndentationForNode(current, parent, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && - (parent.kind === 221 || !parentAndChildShareLine); + (parent.kind === 227 || !parentAndChildShareLine); if (!useActualIndentation) { return -1; } @@ -26920,12 +29110,9 @@ var ts; function getStartLineAndCharacterForNode(n, sourceFile) { return sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)); } - function positionBelongsToNode(candidate, position, sourceFile) { - return candidate.end > position || !isCompletedNode(candidate, sourceFile); - } function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 178 && parent.elseStatement === child) { - var elseKeyword = ts.findChildOfKind(parent, 75, sourceFile); + if (parent.kind === 183 && parent.elseStatement === child) { + var elseKeyword = ts.findChildOfKind(parent, 76, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; return elseKeywordStartLine === childStartLine; @@ -26936,23 +29123,23 @@ var ts; function getContainingList(node, sourceFile) { if (node.parent) { switch (node.parent.kind) { - case 139: + case 141: if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd())) { return node.parent.typeArguments; } break; - case 152: + case 154: return node.parent.properties; - case 151: + case 153: return node.parent.elements; - case 195: - case 160: - case 161: - case 132: - case 131: - case 136: - case 137: { + case 200: + case 162: + case 163: + case 134: + case 133: + case 138: + case 139: { var start = node.getStart(sourceFile); if (node.parent.typeParameters && ts.rangeContainsStartEnd(node.parent.typeParameters, start, node.getEnd())) { @@ -26963,15 +29150,15 @@ var ts; } break; } - case 156: - case 155: { - var _start = node.getStart(sourceFile); + case 158: + case 157: { + var start = node.getStart(sourceFile); if (node.parent.typeArguments && - ts.rangeContainsStartEnd(node.parent.typeArguments, _start, node.getEnd())) { + ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { return node.parent.typeArguments; } if (node.parent.arguments && - ts.rangeContainsStartEnd(node.parent.arguments, _start, node.getEnd())) { + ts.rangeContainsStartEnd(node.parent.arguments, start, node.getEnd())) { return node.parent.arguments; } break; @@ -27033,25 +29220,28 @@ var ts; SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; function nodeContentIsAlwaysIndented(kind) { switch (kind) { - case 196: - case 197: - case 199: - case 151: - case 174: case 201: - case 152: - case 143: case 202: - case 215: + case 204: + case 153: + case 179: + case 206: + 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 159: - case 155: - case 156: - case 175: - case 193: - case 209: - case 186: - case 168: + case 191: + case 170: + case 151: + case 150: return true; } return false; @@ -27061,106 +29251,46 @@ var ts; return true; } switch (parent) { - case 179: - case 180: - case 182: + case 184: + case 185: + case 187: + case 188: + case 186: case 183: - case 181: - case 178: - case 195: - case 160: - case 132: - case 131: - case 161: - case 133: + case 200: + case 162: case 134: + case 133: + case 138: + case 163: case 135: - return child !== 174; + case 136: + case 137: + return child !== 179; default: return false; } } SmartIndenter.shouldIndentChildNode = shouldIndentChildNode; - function nodeEndsWith(n, expectedLastToken, sourceFile) { - var children = n.getChildren(sourceFile); - if (children.length) { - var last = children[children.length - 1]; - if (last.kind === expectedLastToken) { - return true; - } - else if (last.kind === 22 && children.length !== 1) { - return children[children.length - 2].kind === expectedLastToken; - } - } - return false; - } - function isCompletedNode(n, sourceFile) { - if (n.getFullWidth() === 0) { - return false; - } - switch (n.kind) { - case 196: - case 197: - case 199: - case 152: - case 174: - case 201: - case 202: - return nodeEndsWith(n, 15, sourceFile); - case 217: - return isCompletedNode(n.block, sourceFile); - case 159: - case 136: - case 155: - case 137: - return nodeEndsWith(n, 17, sourceFile); - case 195: - case 160: - case 132: - case 131: - case 161: - return !n.body || isCompletedNode(n.body, sourceFile); - case 200: - return n.body && isCompletedNode(n.body, sourceFile); - case 178: - if (n.elseStatement) { - return isCompletedNode(n.elseStatement, sourceFile); - } - return isCompletedNode(n.thenStatement, sourceFile); - case 177: - return isCompletedNode(n.expression, sourceFile); - case 151: - return nodeEndsWith(n, 19, sourceFile); - case 214: - case 215: - return false; - case 181: - return isCompletedNode(n.statement, sourceFile); - case 182: - return isCompletedNode(n.statement, sourceFile); - case 183: - return isCompletedNode(n.statement, sourceFile); - case 180: - return isCompletedNode(n.statement, sourceFile); - case 179: - var hasWhileKeyword = ts.findChildOfKind(n, 99, sourceFile); - if (hasWhileKeyword) { - return nodeEndsWith(n, 17, sourceFile); - } - return isCompletedNode(n.statement, sourceFile); - default: - return true; - } - } })(SmartIndenter = formatting.SmartIndenter || (formatting.SmartIndenter = {})); })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); +/// var __extends = this.__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 ts; (function (ts) { ts.servicesVersion = "0.4"; @@ -27238,10 +29368,10 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(222, nodes.pos, nodes.end, 1024, this); + var list = createNode(228, nodes.pos, nodes.end, 1024, this); list._children = []; var pos = nodes.pos; - for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + for (var _i = 0; _i < nodes.length; _i++) { var node = nodes[_i]; if (pos < node.pos) { pos = this.addSyntheticNodes(list._children, pos, node.pos); @@ -27257,7 +29387,7 @@ var ts; NodeObject.prototype.createChildren = function (sourceFile) { var _this = this; var children; - if (this.kind >= 125) { + if (this.kind >= 126) { scanner.setText((sourceFile || this.getSourceFile()).text); children = []; var pos = this.pos; @@ -27300,9 +29430,9 @@ var ts; }; NodeObject.prototype.getFirstToken = function (sourceFile) { var children = this.getChildren(); - for (var _i = 0, _n = children.length; _i < _n; _i++) { + for (var _i = 0; _i < children.length; _i++) { var child = children[_i]; - if (child.kind < 125) { + if (child.kind < 126) { return child; } return child.getFirstToken(sourceFile); @@ -27312,7 +29442,7 @@ var ts; var children = this.getChildren(sourceFile); for (var i = children.length - 1; i >= 0; i--) { var child = children[i]; - if (child.kind < 125) { + if (child.kind < 126) { return child; } return child.getLastToken(sourceFile); @@ -27358,7 +29488,7 @@ var ts; ts.forEach(declarations, function (declaration, indexOfDeclaration) { if (ts.indexOf(declarations, declaration) === indexOfDeclaration) { var sourceFileOfDeclaration = ts.getSourceFileOfNode(declaration); - if (canUseParsedParamTagComments && declaration.kind === 128) { + if (canUseParsedParamTagComments && declaration.kind === 129) { ts.forEach(getJsDocCommentTextRange(declaration.parent, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedParamJsDocComment = getCleanedParamJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedParamJsDocComment) { @@ -27366,13 +29496,13 @@ var ts; } }); } - if (declaration.kind === 200 && declaration.body.kind === 200) { + if (declaration.kind === 205 && declaration.body.kind === 205) { return; } - while (declaration.kind === 200 && declaration.parent.kind === 200) { + while (declaration.kind === 205 && declaration.parent.kind === 205) { declaration = declaration.parent; } - ts.forEach(getJsDocCommentTextRange(declaration.kind === 193 ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { + ts.forEach(getJsDocCommentTextRange(declaration.kind === 198 ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedJsDocComment = getCleanedJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedJsDocComment) { jsDocCommentParts.push.apply(jsDocCommentParts, cleanedJsDocComment); @@ -27417,13 +29547,14 @@ var ts; return isName(pos, end, sourceFile, paramTag); } function pushDocCommentLineText(docComments, text, blankLineCount) { - while (blankLineCount--) + while (blankLineCount--) { docComments.push(ts.textPart("")); + } docComments.push(ts.textPart(text)); } function getCleanedJsDocComment(pos, end, sourceFile) { var spacesToRemoveAfterAsterisk; - var _docComments = []; + var docComments = []; var blankLineCount = 0; var isInParamTag = false; while (pos < end) { @@ -27458,14 +29589,14 @@ var ts; } pos = consumeLineBreaks(pos, end, sourceFile); if (docCommentTextOfLine) { - pushDocCommentLineText(_docComments, docCommentTextOfLine, blankLineCount); + pushDocCommentLineText(docComments, docCommentTextOfLine, blankLineCount); blankLineCount = 0; } - else if (!isInParamTag && _docComments.length) { + else if (!isInParamTag && docComments.length) { blankLineCount++; } } - return _docComments; + return docComments; } function getCleanedParamJsDocComment(pos, end, sourceFile) { var paramHelpStringMargin; @@ -27566,8 +29697,8 @@ var ts; } var consumedSpaces = pos - startOfLinePos; if (consumedSpaces < paramHelpStringMargin) { - var _ch = sourceFile.text.charCodeAt(pos); - if (_ch === 42) { + var ch = sourceFile.text.charCodeAt(pos); + if (ch === 42) { pos = consumeWhiteSpacesOnTheLine(pos + 1, end, sourceFile, paramHelpStringMargin - consumedSpaces - 1); } } @@ -27656,9 +29787,9 @@ var ts; var namedDeclarations = []; ts.forEachChild(sourceFile, function visit(node) { switch (node.kind) { - case 195: - case 132: - case 131: + case 200: + case 134: + case 133: var functionDeclaration = node; if (functionDeclaration.name && functionDeclaration.name.getFullWidth() > 0) { var lastDeclaration = namedDeclarations.length > 0 ? @@ -27675,64 +29806,64 @@ var ts; ts.forEachChild(node, visit); } break; - case 196: - case 197: - case 198: - case 199: - case 200: - case 203: - case 212: - case 208: + case 201: + case 202: case 203: + case 204: case 205: - case 206: - case 134: - case 135: - case 143: + case 208: + case 217: + case 213: + case 208: + case 210: + case 211: + case 136: + case 137: + case 145: if (node.name) { namedDeclarations.push(node); } - case 133: - case 175: - case 194: - case 148: - case 149: - case 201: + case 135: + case 180: + case 199: + case 150: + case 151: + case 206: ts.forEachChild(node, visit); break; - case 174: + case 179: if (ts.isFunctionBlock(node)) { ts.forEachChild(node, visit); } break; - case 128: + case 129: if (!(node.flags & 112)) { break; } - case 193: - case 150: + case 198: + case 152: if (ts.isBindingPattern(node.name)) { ts.forEachChild(node.name, visit); break; } - case 220: - case 130: - case 129: + case 226: + case 132: + case 131: namedDeclarations.push(node); break; - case 210: + case 215: if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 204: + case 209: var importClause = node.importClause; if (importClause) { if (importClause.name) { namedDeclarations.push(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 206) { + if (importClause.namedBindings.kind === 211) { namedDeclarations.push(importClause.namedBindings); } else { @@ -27887,14 +30018,14 @@ var ts; return false; } return ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 160) { + if (declaration.kind === 162) { return true; } - if (declaration.kind !== 193 && declaration.kind !== 195) { + if (declaration.kind !== 198 && declaration.kind !== 200) { return false; } - for (var _parent = declaration.parent; !ts.isFunctionBlock(_parent); _parent = _parent.parent) { - if (_parent.kind === 221 || _parent.kind === 201) { + for (var parent_7 = declaration.parent; !ts.isFunctionBlock(parent_7); parent_7 = parent_7.parent) { + if (parent_7.kind === 227 || parent_7.kind === 206) { return false; } } @@ -27935,7 +30066,7 @@ var ts; this.host = host; this.fileNameToEntry = {}; var rootFileNames = host.getScriptFileNames(); - for (var _i = 0, _n = rootFileNames.length; _i < _n; _i++) { + for (var _i = 0; _i < rootFileNames.length; _i++) { var fileName = rootFileNames[_i]; this.createEntry(fileName); } @@ -27996,17 +30127,17 @@ var ts; if (!scriptSnapshot) { throw new Error("Could not find file: '" + fileName + "'."); } - var _version = this.host.getScriptVersion(fileName); + var version = this.host.getScriptVersion(fileName); var sourceFile; if (this.currentFileName !== fileName) { - sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 2, _version, true); + sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 2, version, true); } - else if (this.currentFileVersion !== _version) { + else if (this.currentFileVersion !== version) { var editRange = scriptSnapshot.getChangeRange(this.currentFileScriptSnapshot); - sourceFile = updateLanguageServiceSourceFile(this.currentSourceFile, scriptSnapshot, _version, editRange); + sourceFile = updateLanguageServiceSourceFile(this.currentSourceFile, scriptSnapshot, version, editRange); } if (sourceFile) { - this.currentFileVersion = _version; + this.currentFileVersion = version; this.currentFileName = fileName; this.currentFileScriptSnapshot = scriptSnapshot; this.currentSourceFile = sourceFile; @@ -28019,6 +30150,37 @@ var ts; sourceFile.version = version; sourceFile.scriptSnapshot = scriptSnapshot; } + function transpile(input, compilerOptions, fileName, diagnostics) { + var options = compilerOptions ? ts.clone(compilerOptions) : getDefaultCompilerOptions(); + options.separateCompilation = true; + options.allowNonTsExtensions = true; + var inputFileName = fileName || "module.ts"; + var sourceFile = ts.createSourceFile(inputFileName, input, options.target); + if (diagnostics && sourceFile.parseDiagnostics) { + diagnostics.push.apply(diagnostics, sourceFile.parseDiagnostics); + } + var outputText; + var compilerHost = { + getSourceFile: function (fileName, target) { return fileName === inputFileName ? sourceFile : undefined; }, + writeFile: function (name, text, writeByteOrderMark) { + ts.Debug.assert(outputText === undefined, "Unexpected multiple outputs for the file: " + name); + outputText = text; + }, + getDefaultLibFileName: function () { return "lib.d.ts"; }, + useCaseSensitiveFileNames: function () { return false; }, + getCanonicalFileName: function (fileName) { return fileName; }, + getCurrentDirectory: function () { return ""; }, + getNewLine: function () { return "\r\n"; } + }; + var program = ts.createProgram([inputFileName], options, compilerHost); + if (diagnostics) { + diagnostics.push.apply(diagnostics, program.getGlobalDiagnostics()); + } + program.emit(); + ts.Debug.assert(outputText !== undefined, "Output generation failed"); + return outputText; + } + ts.transpile = transpile; function createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTarget, version, setNodeParents) { var sourceFile = ts.createSourceFile(fileName, scriptSnapshot.getText(0, scriptSnapshot.getLength()), scriptTarget, setNodeParents); setSourceFileFields(sourceFile, scriptSnapshot, version); @@ -28152,25 +30314,25 @@ var ts; scanner.setText(sourceText); var token = scanner.scan(); while (token !== 1) { - if (token === 84) { + if (token === 85) { token = scanner.scan(); if (token === 8) { recordModuleName(); continue; } else { - if (token === 64) { + if (token === 65) { token = scanner.scan(); - if (token === 123) { + if (token === 124) { token = scanner.scan(); if (token === 8) { recordModuleName(); continue; } } - else if (token === 52) { + else if (token === 53) { token = scanner.scan(); - if (token === 117) { + if (token === 118) { token = scanner.scan(); if (token === 16) { token = scanner.scan(); @@ -28195,7 +30357,7 @@ var ts; } if (token === 15) { token = scanner.scan(); - if (token === 123) { + if (token === 124) { token = scanner.scan(); if (token === 8) { recordModuleName(); @@ -28205,11 +30367,11 @@ var ts; } else if (token === 35) { token = scanner.scan(); - if (token === 101) { + if (token === 102) { token = scanner.scan(); - if (token === 64) { + if (token === 65) { token = scanner.scan(); - if (token === 123) { + if (token === 124) { token = scanner.scan(); if (token === 8) { recordModuleName(); @@ -28220,7 +30382,7 @@ var ts; } } } - else if (token === 77) { + else if (token === 78) { token = scanner.scan(); if (token === 14) { token = scanner.scan(); @@ -28229,7 +30391,7 @@ var ts; } if (token === 15) { token = scanner.scan(); - if (token === 123) { + if (token === 124) { token = scanner.scan(); if (token === 8) { recordModuleName(); @@ -28239,7 +30401,7 @@ var ts; } else if (token === 35) { token = scanner.scan(); - if (token === 123) { + if (token === 124) { token = scanner.scan(); if (token === 8) { recordModuleName(); @@ -28260,7 +30422,7 @@ var ts; ts.preProcessFile = preProcessFile; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 189 && referenceNode.label.text === labelName) { + if (referenceNode.kind === 194 && referenceNode.label.text === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -28268,17 +30430,17 @@ var ts; return undefined; } function isJumpStatementTarget(node) { - return node.kind === 64 && - (node.parent.kind === 185 || node.parent.kind === 184) && + return node.kind === 65 && + (node.parent.kind === 190 || node.parent.kind === 189) && node.parent.label === node; } function isLabelOfLabeledStatement(node) { - return node.kind === 64 && - node.parent.kind === 189 && + return node.kind === 65 && + node.parent.kind === 194 && node.parent.label === node; } function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 189; owner = owner.parent) { + for (var owner = node.parent; owner.kind === 194; owner = owner.parent) { if (owner.label.text === labelName) { return true; } @@ -28289,48 +30451,48 @@ var ts; return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node); } function isRightSideOfQualifiedName(node) { - return node.parent.kind === 125 && node.parent.right === node; + return node.parent.kind === 126 && node.parent.right === node; } function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 153 && node.parent.name === node; + return node && node.parent && node.parent.kind === 155 && node.parent.name === node; } function isCallExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 155 && node.parent.expression === node; + return node && node.parent && node.parent.kind === 157 && node.parent.expression === node; } function isNewExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 156 && node.parent.expression === node; + return node && node.parent && node.parent.kind === 158 && node.parent.expression === node; } function isNameOfModuleDeclaration(node) { - return node.parent.kind === 200 && node.parent.name === node; + return node.parent.kind === 205 && node.parent.name === node; } function isNameOfFunctionDeclaration(node) { - return node.kind === 64 && + return node.kind === 65 && ts.isFunctionLike(node.parent) && node.parent.name === node; } function isNameOfPropertyAssignment(node) { - return (node.kind === 64 || node.kind === 8 || node.kind === 7) && - (node.parent.kind === 218 || node.parent.kind === 219) && node.parent.name === node; + return (node.kind === 65 || node.kind === 8 || node.kind === 7) && + (node.parent.kind === 224 || node.parent.kind === 225) && node.parent.name === node; } function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { if (node.kind === 8 || node.kind === 7) { switch (node.parent.kind) { - case 130: - case 129: - case 218: - case 220: case 132: case 131: + case 224: + case 226: case 134: - case 135: - case 200: + case 133: + case 136: + case 137: + case 205: return node.parent.name === node; - case 154: + case 156: return node.parent.argumentExpression === node; } } @@ -28383,7 +30545,7 @@ var ts; BreakContinueSearchType[BreakContinueSearchType["All"] = 3] = "All"; })(BreakContinueSearchType || (BreakContinueSearchType = {})); var keywordCompletions = []; - for (var i = 65; i <= 124; i++) { + for (var i = 66; i <= 125; i++) { keywordCompletions.push({ name: ts.tokenToString(i), kind: ScriptElementKind.keyword, @@ -28397,17 +30559,17 @@ var ts; return undefined; } switch (node.kind) { - case 221: - case 132: - case 131: - case 195: - case 160: + case 227: case 134: - case 135: - case 196: - case 197: - case 199: + case 133: case 200: + case 162: + case 136: + case 137: + case 201: + case 202: + case 204: + case 205: return node; } } @@ -28415,38 +30577,38 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 200: return ScriptElementKind.moduleElement; - case 196: return ScriptElementKind.classElement; - case 197: return ScriptElementKind.interfaceElement; - case 198: return ScriptElementKind.typeElement; - case 199: return ScriptElementKind.enumElement; - case 193: + 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: return ts.isConst(node) ? ScriptElementKind.constElement : ts.isLet(node) ? ScriptElementKind.letElement : ScriptElementKind.variableElement; - case 195: return ScriptElementKind.functionElement; - case 134: return ScriptElementKind.memberGetAccessorElement; - case 135: return ScriptElementKind.memberSetAccessorElement; + case 200: return ScriptElementKind.functionElement; + case 136: return ScriptElementKind.memberGetAccessorElement; + case 137: return ScriptElementKind.memberSetAccessorElement; + case 134: + case 133: + return ScriptElementKind.memberFunctionElement; case 132: case 131: - return ScriptElementKind.memberFunctionElement; - case 130: - case 129: return ScriptElementKind.memberVariableElement; - case 138: return ScriptElementKind.indexSignatureElement; - case 137: return ScriptElementKind.constructSignatureElement; - case 136: return ScriptElementKind.callSignatureElement; - case 133: return ScriptElementKind.constructorImplementationElement; - case 127: return ScriptElementKind.typeParameterElement; - case 220: return ScriptElementKind.variableElement; - case 128: return (node.flags & 112) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; - case 203: + 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 205: - case 212: - case 206: + case 213: + case 210: + case 217: + case 211: return ScriptElementKind.alias; } return ScriptElementKind.unknown; @@ -28460,7 +30622,6 @@ var ts; var typeInfoResolver; var useCaseSensitivefileNames = false; var cancellationToken = new CancellationTokenObject(host.getCancellationToken && host.getCancellationToken()); - var activeCompletionSession; if (!ts.localizedDiagnosticMessages && host.getLocalizedDiagnosticMessages) { ts.localizedDiagnosticMessages = host.getLocalizedDiagnosticMessages(); } @@ -28507,7 +30668,7 @@ var ts; }); if (program) { var oldSourceFiles = program.getSourceFiles(); - for (var _i = 0, _n = oldSourceFiles.length; _i < _n; _i++) { + for (var _i = 0; _i < oldSourceFiles.length; _i++) { var oldSourceFile = oldSourceFiles[_i]; var fileName = oldSourceFile.fileName; if (!newProgram.getSourceFile(fileName) || changesInCompilationSettingsAffectSyntax) { @@ -28524,8 +30685,8 @@ var ts; return undefined; } if (!changesInCompilationSettingsAffectSyntax) { - var _oldSourceFile = program && program.getSourceFile(fileName); - if (_oldSourceFile) { + var oldSourceFile = program && program.getSourceFile(fileName); + if (oldSourceFile) { return documentRegistry.updateDocument(fileName, newSettings, hostFileInformation.scriptSnapshot, hostFileInformation.version); } } @@ -28542,9 +30703,9 @@ var ts; if (program.getSourceFiles().length !== rootFileNames.length) { return false; } - for (var _a = 0, _b = rootFileNames.length; _a < _b; _a++) { - var _fileName = rootFileNames[_a]; - if (!sourceFileUpToDate(program.getSourceFile(_fileName))) { + for (var _i = 0; _i < rootFileNames.length; _i++) { + var fileName = rootFileNames[_i]; + if (!sourceFileUpToDate(program.getSourceFile(fileName))) { return false; } } @@ -28579,35 +30740,48 @@ var ts; return semanticDiagnostics; } var declarationDiagnostics = program.getDeclarationDiagnostics(targetSourceFile); - return semanticDiagnostics.concat(declarationDiagnostics); + return ts.concatenate(semanticDiagnostics, declarationDiagnostics); } function getCompilerOptionsDiagnostics() { synchronizeHostData(); return program.getGlobalDiagnostics(); } - function getValidCompletionEntryDisplayName(symbol, target) { + function getCompletionEntryDisplayName(symbol, target, performCharacterChecks) { var displayName = symbol.getName(); - if (displayName && displayName.length > 0) { - var firstCharCode = displayName.charCodeAt(0); - if ((symbol.flags & 1536) && (firstCharCode === 39 || firstCharCode === 34)) { - return undefined; - } - if (displayName && displayName.length >= 2 && firstCharCode === displayName.charCodeAt(displayName.length - 1) && - (firstCharCode === 39 || firstCharCode === 34)) { - displayName = displayName.substring(1, displayName.length - 1); - } - var isValid = ts.isIdentifierStart(displayName.charCodeAt(0), target); - for (var _i = 1, n = displayName.length; isValid && _i < n; _i++) { - isValid = ts.isIdentifierPart(displayName.charCodeAt(_i), target); - } - if (isValid) { - return ts.unescapeIdentifier(displayName); + if (!displayName) { + return undefined; + } + if (displayName === "default") { + var localSymbol = ts.getLocalSymbolForExportDefault(symbol); + if (localSymbol && localSymbol.name) { + displayName = symbol.valueDeclaration.localSymbol.name; } } - return undefined; + var firstCharCode = displayName.charCodeAt(0); + if ((symbol.flags & 1536) && (firstCharCode === 39 || firstCharCode === 34)) { + return undefined; + } + if (displayName && displayName.length >= 2 && firstCharCode === displayName.charCodeAt(displayName.length - 1) && + (firstCharCode === 39 || firstCharCode === 34)) { + displayName = displayName.substring(1, displayName.length - 1); + } + if (!displayName) { + return undefined; + } + if (performCharacterChecks) { + if (!ts.isIdentifierStart(displayName.charCodeAt(0), target)) { + return undefined; + } + for (var i = 1, n = displayName.length; i < n; i++) { + if (!ts.isIdentifierPart(displayName.charCodeAt(i), target)) { + return undefined; + } + } + } + return ts.unescapeIdentifier(displayName); } function createCompletionEntry(symbol, typeChecker, location) { - var displayName = getValidCompletionEntryDisplayName(symbol, program.getCompilerOptions().target); + var displayName = getCompletionEntryDisplayName(symbol, program.getCompilerOptions().target, true); if (!displayName) { return undefined; } @@ -28617,63 +30791,53 @@ var ts; kindModifiers: getSymbolModifiers(symbol) }; } - function getCompletionsAtPosition(fileName, position) { - synchronizeHostData(); + function getCompletionData(fileName, position) { var syntacticStart = new Date().getTime(); var sourceFile = getValidSourceFile(fileName); var start = new Date().getTime(); var currentToken = ts.getTokenAtPosition(sourceFile, position); - log("getCompletionsAtPosition: Get current token: " + (new Date().getTime() - start)); + log("getCompletionData: Get current token: " + (new Date().getTime() - start)); start = new Date().getTime(); var insideComment = isInsideComment(sourceFile, currentToken, position); - log("getCompletionsAtPosition: Is inside comment: " + (new Date().getTime() - start)); + log("getCompletionData: Is inside comment: " + (new Date().getTime() - start)); if (insideComment) { log("Returning an empty list because completion was inside a comment."); return undefined; } start = new Date().getTime(); var previousToken = ts.findPrecedingToken(position, sourceFile); - log("getCompletionsAtPosition: Get previous token 1: " + (new Date().getTime() - start)); - if (previousToken && position <= previousToken.end && previousToken.kind === 64) { - var _start = new Date().getTime(); - previousToken = ts.findPrecedingToken(previousToken.pos, sourceFile); - log("getCompletionsAtPosition: Get previous token 2: " + (new Date().getTime() - _start)); + log("getCompletionData: Get previous token 1: " + (new Date().getTime() - start)); + var contextToken = previousToken; + if (contextToken && position <= contextToken.end && ts.isWord(contextToken.kind)) { + var start_1 = new Date().getTime(); + contextToken = ts.findPrecedingToken(contextToken.getFullStart(), sourceFile); + log("getCompletionData: Get previous token 2: " + (new Date().getTime() - start_1)); } - if (previousToken && isCompletionListBlocker(previousToken)) { + if (contextToken && isCompletionListBlocker(contextToken)) { log("Returning an empty list because completion was requested in an invalid position."); return undefined; } - var node; - var isRightOfDot; - if (previousToken && previousToken.kind === 20 && previousToken.parent.kind === 153) { - node = previousToken.parent.expression; + var node = currentToken; + var isRightOfDot = false; + if (contextToken && contextToken.kind === 20 && contextToken.parent.kind === 155) { + node = contextToken.parent.expression; isRightOfDot = true; } - else if (previousToken && previousToken.kind === 20 && previousToken.parent.kind === 125) { - node = previousToken.parent.left; + else if (contextToken && contextToken.kind === 20 && contextToken.parent.kind === 126) { + node = contextToken.parent.left; isRightOfDot = true; } - else { - node = currentToken; - isRightOfDot = false; - } - activeCompletionSession = { - fileName: fileName, - position: position, - entries: [], - symbols: {}, - typeChecker: typeInfoResolver - }; - log("getCompletionsAtPosition: Syntactic work: " + (new Date().getTime() - syntacticStart)); - var _location = ts.getTouchingPropertyName(sourceFile, position); + var location = ts.getTouchingPropertyName(sourceFile, position); + var target = program.getCompilerOptions().target; var semanticStart = new Date().getTime(); var isMemberCompletion; var isNewIdentifierLocation; + var symbols; if (isRightOfDot) { - var symbols = []; + symbols = []; isMemberCompletion = true; isNewIdentifierLocation = false; - if (node.kind === 64 || node.kind === 125 || node.kind === 153) { + if (node.kind === 65 || node.kind === 126 || node.kind === 155) { var symbol = typeInfoResolver.getSymbolAtLocation(node); if (symbol && symbol.flags & 8388608) { symbol = typeInfoResolver.getAliasedSymbol(symbol); @@ -28694,10 +30858,9 @@ var ts; } }); } - getCompletionEntriesFromSymbols(symbols, activeCompletionSession); } else { - var containingObjectLiteral = getContainingObjectLiteralApplicableForCompletion(previousToken); + var containingObjectLiteral = getContainingObjectLiteralApplicableForCompletion(contextToken); if (containingObjectLiteral) { isMemberCompletion = true; isNewIdentifierLocation = true; @@ -28707,65 +30870,54 @@ var ts; } var contextualTypeMembers = typeInfoResolver.getPropertiesOfType(contextualType); if (contextualTypeMembers && contextualTypeMembers.length > 0) { - var filteredMembers = filterContextualMembersList(contextualTypeMembers, containingObjectLiteral.properties); - getCompletionEntriesFromSymbols(filteredMembers, activeCompletionSession); + symbols = filterContextualMembersList(contextualTypeMembers, containingObjectLiteral.properties); } } - else if (ts.getAncestor(previousToken, 205)) { + else if (ts.getAncestor(contextToken, 210)) { isMemberCompletion = true; isNewIdentifierLocation = true; - if (showCompletionsInImportsClause(previousToken)) { - var importDeclaration = ts.getAncestor(previousToken, 204); + if (showCompletionsInImportsClause(contextToken)) { + var importDeclaration = ts.getAncestor(contextToken, 209); ts.Debug.assert(importDeclaration !== undefined); var exports = typeInfoResolver.getExportsOfExternalModule(importDeclaration); - var filteredExports = filterModuleExports(exports, importDeclaration); - getCompletionEntriesFromSymbols(filteredExports, activeCompletionSession); + symbols = filterModuleExports(exports, importDeclaration); } } else { isMemberCompletion = false; - isNewIdentifierLocation = isNewIdentifierDefinitionLocation(previousToken); + isNewIdentifierLocation = isNewIdentifierDefinitionLocation(contextToken); + if (previousToken !== contextToken) { + ts.Debug.assert(!!previousToken, "Expected 'contextToken' to be defined when different from 'previousToken'."); + } + var adjustedPosition = previousToken !== contextToken ? + previousToken.getStart() : + position; + var scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile; var symbolMeanings = 793056 | 107455 | 1536 | 8388608; - var _symbols = typeInfoResolver.getSymbolsInScope(node, symbolMeanings); - getCompletionEntriesFromSymbols(_symbols, activeCompletionSession); + symbols = typeInfoResolver.getSymbolsInScope(scopeNode, symbolMeanings); } } - if (!isMemberCompletion) { - Array.prototype.push.apply(activeCompletionSession.entries, keywordCompletions); - } - log("getCompletionsAtPosition: Semantic work: " + (new Date().getTime() - semanticStart)); - return { - isMemberCompletion: isMemberCompletion, - isNewIdentifierLocation: isNewIdentifierLocation, - isBuilder: isNewIdentifierDefinitionLocation, - entries: activeCompletionSession.entries - }; - function getCompletionEntriesFromSymbols(symbols, session) { - var _start_1 = new Date().getTime(); - ts.forEach(symbols, function (symbol) { - var entry = createCompletionEntry(symbol, session.typeChecker, _location); - if (entry) { - var id = ts.escapeIdentifier(entry.name); - if (!ts.lookUp(session.symbols, id)) { - session.entries.push(entry); - session.symbols[id] = symbol; - } - } - }); - log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (new Date().getTime() - _start_1)); + log("getCompletionData: Semantic work: " + (new Date().getTime() - semanticStart)); + return { symbols: symbols, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, location: location }; + function getScopeNode(initialToken, position, sourceFile) { + var scope = initialToken; + while (scope && !ts.positionBelongsToNode(scope, position, sourceFile)) { + scope = scope.parent; + } + return scope; } function isCompletionListBlocker(previousToken) { - var _start_1 = new Date().getTime(); + var start = new Date().getTime(); var result = isInStringOrRegularExpressionOrTemplateLiteral(previousToken) || isIdentifierDefinitionLocation(previousToken) || isRightOfIllegalDot(previousToken); - log("getCompletionsAtPosition: isCompletionListBlocker: " + (new Date().getTime() - _start_1)); + log("getCompletionsAtPosition: isCompletionListBlocker: " + (new Date().getTime() - start)); return result; } function showCompletionsInImportsClause(node) { if (node) { if (node.kind === 14 || node.kind === 23) { - return node.parent.kind === 207; + return node.parent.kind === 212; } } return false; @@ -28775,35 +30927,35 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 23: - return containingNodeKind === 155 - || containingNodeKind === 133 - || containingNodeKind === 156 - || containingNodeKind === 151 - || containingNodeKind === 167; + return containingNodeKind === 157 + || containingNodeKind === 135 + || containingNodeKind === 158 + || containingNodeKind === 153 + || containingNodeKind === 169; case 16: - return containingNodeKind === 155 - || containingNodeKind === 133 - || containingNodeKind === 156 - || containingNodeKind === 159; + return containingNodeKind === 157 + || containingNodeKind === 135 + || containingNodeKind === 158 + || containingNodeKind === 161; case 18: - return containingNodeKind === 151; - case 116: + return containingNodeKind === 153; + case 117: return true; case 20: - return containingNodeKind === 200; + return containingNodeKind === 205; case 14: - return containingNodeKind === 196; - case 52: - return containingNodeKind === 193 - || containingNodeKind === 167; + return containingNodeKind === 201; + case 53: + return containingNodeKind === 198 + || containingNodeKind === 169; case 11: - return containingNodeKind === 169; + return containingNodeKind === 171; case 12: - return containingNodeKind === 173; - case 108: - case 106: + return containingNodeKind === 176; + case 109: case 107: - return containingNodeKind === 130; + case 108: + return containingNodeKind === 132; } switch (previousToken.getText()) { case "public": @@ -28818,9 +30970,9 @@ var ts; if (previousToken.kind === 8 || previousToken.kind === 9 || ts.isTemplateLiteralKind(previousToken.kind)) { - var _start_1 = previousToken.getStart(); + var start_2 = previousToken.getStart(); var end = previousToken.getEnd(); - if (_start_1 < position && position < end) { + if (start_2 < position && position < end) { return true; } else if (position === end) { @@ -28830,13 +30982,14 @@ var ts; return false; } function getContainingObjectLiteralApplicableForCompletion(previousToken) { + // The locations in an object literal expression that are applicable for completion are property name definition locations. if (previousToken) { - var _parent = previousToken.parent; + var parent_8 = previousToken.parent; switch (previousToken.kind) { case 14: case 23: - if (_parent && _parent.kind === 152) { - return _parent; + if (parent_8 && parent_8.kind === 154) { + return parent_8; } break; } @@ -28845,16 +30998,16 @@ var ts; } function isFunction(kind) { switch (kind) { - case 160: - case 161: - case 195: - case 132: - case 131: + case 162: + case 163: + case 200: case 134: - case 135: + case 133: case 136: case 137: case 138: + case 139: + case 140: return true; } return false; @@ -28864,58 +31017,58 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 23: - return containingNodeKind === 193 || - containingNodeKind === 194 || - containingNodeKind === 175 || + return containingNodeKind === 198 || containingNodeKind === 199 || + containingNodeKind === 180 || + containingNodeKind === 204 || isFunction(containingNodeKind) || - containingNodeKind === 196 || - containingNodeKind === 195 || - containingNodeKind === 197 || - containingNodeKind === 149 || - containingNodeKind === 148; + containingNodeKind === 201 || + containingNodeKind === 200 || + containingNodeKind === 202 || + containingNodeKind === 151 || + containingNodeKind === 150; case 20: - return containingNodeKind === 149; + return containingNodeKind === 151; case 18: - return containingNodeKind === 149; + return containingNodeKind === 151; case 16: - return containingNodeKind === 217 || + return containingNodeKind === 223 || isFunction(containingNodeKind); case 14: - return containingNodeKind === 199 || - containingNodeKind === 197 || - containingNodeKind === 143 || - containingNodeKind === 148; + return containingNodeKind === 204 || + containingNodeKind === 202 || + containingNodeKind === 145 || + containingNodeKind === 150; case 22: - return containingNodeKind === 129 && - (previousToken.parent.parent.kind === 197 || - previousToken.parent.parent.kind === 143); + return containingNodeKind === 131 && + (previousToken.parent.parent.kind === 202 || + previousToken.parent.parent.kind === 145); case 24: - return containingNodeKind === 196 || - containingNodeKind === 195 || - containingNodeKind === 197 || + return containingNodeKind === 201 || + containingNodeKind === 200 || + containingNodeKind === 202 || isFunction(containingNodeKind); - case 109: - return containingNodeKind === 130; - case 21: - return containingNodeKind === 128 || - containingNodeKind === 133 || - (previousToken.parent.parent.kind === 149); - case 108: - case 106: - case 107: - return containingNodeKind === 128; - case 68: - case 76: - case 103: - case 82: - case 97: - case 115: - case 119: - case 84: - case 104: - case 69: case 110: + return containingNodeKind === 132; + case 21: + return containingNodeKind === 129 || + containingNodeKind === 135 || + (previousToken.parent.parent.kind === 151); + case 109: + case 107: + case 108: + return containingNodeKind === 129; + case 69: + case 77: + case 104: + case 83: + case 98: + case 116: + case 120: + case 85: + case 105: + case 70: + case 111: return true; } switch (previousToken.getText()) { @@ -28946,10 +31099,10 @@ var ts; return exports; } if (importDeclaration.importClause.namedBindings && - importDeclaration.importClause.namedBindings.kind === 207) { + importDeclaration.importClause.namedBindings.kind === 212) { ts.forEach(importDeclaration.importClause.namedBindings.elements, function (el) { - var _name = el.propertyName || el.name; - exisingImports[_name.text] = true; + var name = el.propertyName || el.name; + exisingImports[name.text] = true; }); } if (ts.isEmpty(exisingImports)) { @@ -28963,7 +31116,7 @@ var ts; } var existingMemberNames = {}; ts.forEach(existingMembers, function (m) { - if (m.kind !== 218 && m.kind !== 219) { + if (m.kind !== 224 && m.kind !== 225) { return; } if (m.getStart() <= position && position <= m.getEnd()) { @@ -28971,44 +31124,78 @@ var ts; } existingMemberNames[m.name.text] = true; }); - var _filteredMembers = []; + var filteredMembers = []; ts.forEach(contextualMemberSymbols, function (s) { if (!existingMemberNames[s.name]) { - _filteredMembers.push(s); + filteredMembers.push(s); } }); - return _filteredMembers; + return filteredMembers; + } + } + function getCompletionsAtPosition(fileName, position) { + synchronizeHostData(); + var completionData = getCompletionData(fileName, position); + if (!completionData) { + return undefined; + } + var symbols = completionData.symbols, isMemberCompletion = completionData.isMemberCompletion, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location; + if (!symbols || symbols.length === 0) { + return undefined; + } + var entries = getCompletionEntriesFromSymbols(symbols); + if (!isMemberCompletion) { + ts.addRange(entries, keywordCompletions); + } + return { isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; + function getCompletionEntriesFromSymbols(symbols) { + var start = new Date().getTime(); + var entries = []; + var nameToSymbol = {}; + for (var _i = 0; _i < symbols.length; _i++) { + var symbol = symbols[_i]; + var entry = createCompletionEntry(symbol, typeInfoResolver, location); + if (entry) { + var id = ts.escapeIdentifier(entry.name); + if (!ts.lookUp(nameToSymbol, id)) { + entries.push(entry); + nameToSymbol[id] = symbol; + } + } + } + log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (new Date().getTime() - start)); + return entries; } } function getCompletionEntryDetails(fileName, position, entryName) { - var sourceFile = getValidSourceFile(fileName); - var session = activeCompletionSession; - if (!session || session.fileName !== fileName || session.position !== position) { - return undefined; + synchronizeHostData(); + var completionData = getCompletionData(fileName, position); + if (completionData) { + var symbols = completionData.symbols, location_2 = completionData.location; + var target = program.getCompilerOptions().target; + var symbol = ts.forEach(symbols, function (s) { return getCompletionEntryDisplayName(s, target, false) === entryName ? s : undefined; }); + if (symbol) { + var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location_2, typeInfoResolver, location_2, 7); + return { + name: entryName, + kind: displayPartsDocumentationsAndSymbolKind.symbolKind, + kindModifiers: getSymbolModifiers(symbol), + displayParts: displayPartsDocumentationsAndSymbolKind.displayParts, + documentation: displayPartsDocumentationsAndSymbolKind.documentation + }; + } } - var symbol = ts.lookUp(activeCompletionSession.symbols, ts.escapeIdentifier(entryName)); - if (symbol) { - var _location = ts.getTouchingPropertyName(sourceFile, position); - var completionEntry = createCompletionEntry(symbol, session.typeChecker, _location); - ts.Debug.assert(session.typeChecker.getTypeOfSymbolAtLocation(symbol, _location) !== undefined, "Could not find type for symbol"); - var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), _location, session.typeChecker, _location, 7); - return { - name: entryName, - kind: displayPartsDocumentationsAndSymbolKind.symbolKind, - kindModifiers: completionEntry.kindModifiers, - displayParts: displayPartsDocumentationsAndSymbolKind.displayParts, - documentation: displayPartsDocumentationsAndSymbolKind.documentation - }; - } - else { + var keywordCompletion = ts.forEach(keywordCompletions, function (c) { return c.name === entryName; }); + if (keywordCompletion) { return { name: entryName, kind: ScriptElementKind.keyword, kindModifiers: ScriptElementKindModifier.none, - displayParts: [ts.displayPart(entryName, 5)], + displayParts: [ts.displayPart(entryName, SymbolDisplayPartKind.keyword)], documentation: undefined }; } + return undefined; } function getSymbolKind(symbol, typeResolver, location) { var flags = symbol.getFlags(); @@ -29122,14 +31309,14 @@ var ts; var signature; type = typeResolver.getTypeOfSymbolAtLocation(symbol, location); if (type) { - if (location.parent && location.parent.kind === 153) { + if (location.parent && location.parent.kind === 155) { var right = location.parent.name; if (right === location || (right && right.getFullWidth() === 0)) { location = location.parent; } } var callExpression; - if (location.kind === 155 || location.kind === 156) { + if (location.kind === 157 || location.kind === 158) { callExpression = location; } else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { @@ -29141,7 +31328,7 @@ var ts; if (!signature && candidateSignatures.length) { signature = candidateSignatures[0]; } - var useConstructSignatures = callExpression.kind === 156 || callExpression.expression.kind === 90; + var useConstructSignatures = callExpression.kind === 158 || callExpression.expression.kind === 91; var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target || signature)) { signature = allSignatures.length ? allSignatures[0] : undefined; @@ -29153,12 +31340,10 @@ var ts; } else if (symbolFlags & 8388608) { symbolKind = ScriptElementKind.alias; - displayParts.push(ts.punctuationPart(16)); - displayParts.push(ts.textPart(symbolKind)); - displayParts.push(ts.punctuationPart(17)); + pushTypePart(symbolKind); displayParts.push(ts.spacePart()); if (useConstructSignatures) { - displayParts.push(ts.keywordPart(87)); + displayParts.push(ts.keywordPart(88)); displayParts.push(ts.spacePart()); } addFullSymbolName(symbol); @@ -29176,7 +31361,7 @@ var ts; displayParts.push(ts.punctuationPart(51)); displayParts.push(ts.spacePart()); if (useConstructSignatures) { - displayParts.push(ts.keywordPart(87)); + displayParts.push(ts.keywordPart(88)); displayParts.push(ts.spacePart()); } if (!(type.flags & 32768)) { @@ -29191,64 +31376,64 @@ var ts; } } else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304)) || - (location.kind === 113 && location.parent.kind === 133)) { + (location.kind === 114 && location.parent.kind === 135)) { var functionDeclaration = location.parent; - var _allSignatures = functionDeclaration.kind === 133 ? type.getConstructSignatures() : type.getCallSignatures(); + var allSignatures = functionDeclaration.kind === 135 ? type.getConstructSignatures() : type.getCallSignatures(); if (!typeResolver.isImplementationOfOverload(functionDeclaration)) { signature = typeResolver.getSignatureFromDeclaration(functionDeclaration); } else { - signature = _allSignatures[0]; + signature = allSignatures[0]; } - if (functionDeclaration.kind === 133) { + if (functionDeclaration.kind === 135) { symbolKind = ScriptElementKind.constructorImplementationElement; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { - addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 136 && + addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 138 && !(type.symbol.flags & 2048 || type.symbol.flags & 4096) ? type.symbol : symbol, symbolKind); } - addSignatureDisplayParts(signature, _allSignatures); + addSignatureDisplayParts(signature, allSignatures); hasAddedSymbolInfo = true; } } } if (symbolFlags & 32 && !hasAddedSymbolInfo) { - displayParts.push(ts.keywordPart(68)); + displayParts.push(ts.keywordPart(69)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); } if ((symbolFlags & 64) && (semanticMeaning & 2)) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(103)); + displayParts.push(ts.keywordPart(104)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); } if (symbolFlags & 524288) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(122)); + displayParts.push(ts.keywordPart(123)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(52)); + displayParts.push(ts.operatorPart(53)); displayParts.push(ts.spacePart()); displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeResolver, typeResolver.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration)); } if (symbolFlags & 384) { addNewLineIfDisplayPartsExist(); if (ts.forEach(symbol.declarations, ts.isConstEnumDeclaration)) { - displayParts.push(ts.keywordPart(69)); + displayParts.push(ts.keywordPart(70)); displayParts.push(ts.spacePart()); } - displayParts.push(ts.keywordPart(76)); + displayParts.push(ts.keywordPart(77)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } if (symbolFlags & 1536) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(116)); + displayParts.push(ts.keywordPart(117)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } @@ -29260,60 +31445,60 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(85)); + displayParts.push(ts.keywordPart(86)); displayParts.push(ts.spacePart()); if (symbol.parent) { addFullSymbolName(symbol.parent, enclosingDeclaration); writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration); } else { - var signatureDeclaration = ts.getDeclarationOfKind(symbol, 127).parent; - var _signature = typeResolver.getSignatureFromDeclaration(signatureDeclaration); - if (signatureDeclaration.kind === 137) { - displayParts.push(ts.keywordPart(87)); + var signatureDeclaration = ts.getDeclarationOfKind(symbol, 128).parent; + var signature = typeResolver.getSignatureFromDeclaration(signatureDeclaration); + if (signatureDeclaration.kind === 139) { + displayParts.push(ts.keywordPart(88)); displayParts.push(ts.spacePart()); } - else if (signatureDeclaration.kind !== 136 && signatureDeclaration.name) { + else if (signatureDeclaration.kind !== 138 && signatureDeclaration.name) { addFullSymbolName(signatureDeclaration.symbol); } - displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeResolver, _signature, sourceFile, 32)); + displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeResolver, signature, sourceFile, 32)); } } if (symbolFlags & 8) { addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 220) { + if (declaration.kind === 226) { var constantValue = typeResolver.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(52)); + displayParts.push(ts.operatorPart(53)); displayParts.push(ts.spacePart()); - displayParts.push(ts.displayPart(constantValue.toString(), 7)); + displayParts.push(ts.displayPart(constantValue.toString(), SymbolDisplayPartKind.numericLiteral)); } } } if (symbolFlags & 8388608) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(84)); + displayParts.push(ts.keywordPart(85)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 203) { + if (declaration.kind === 208) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(52)); + displayParts.push(ts.operatorPart(53)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(117)); + displayParts.push(ts.keywordPart(118)); displayParts.push(ts.punctuationPart(16)); - displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), 8)); + displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), SymbolDisplayPartKind.stringLiteral)); displayParts.push(ts.punctuationPart(17)); } else { var internalAliasSymbol = typeResolver.getSymbolAtLocation(importEqualsDeclaration.moduleReference); if (internalAliasSymbol) { displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(52)); + displayParts.push(ts.operatorPart(53)); displayParts.push(ts.spacePart()); addFullSymbolName(internalAliasSymbol, enclosingDeclaration); } @@ -29347,8 +31532,8 @@ var ts; symbolFlags & 131072 || symbolFlags & 98304 || symbolKind === ScriptElementKind.memberFunctionElement) { - var _allSignatures_1 = type.getCallSignatures(); - addSignatureDisplayParts(_allSignatures_1[0], _allSignatures_1); + var allSignatures = type.getCallSignatures(); + addSignatureDisplayParts(allSignatures[0], allSignatures); } } } @@ -29372,20 +31557,34 @@ var ts; function addPrefixForAnyFunctionOrVar(symbol, symbolKind) { addNewLineIfDisplayPartsExist(); if (symbolKind) { - displayParts.push(ts.punctuationPart(16)); - displayParts.push(ts.textPart(symbolKind)); - displayParts.push(ts.punctuationPart(17)); + pushTypePart(symbolKind); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } } + function pushTypePart(symbolKind) { + switch (symbolKind) { + case ScriptElementKind.variableElement: + case ScriptElementKind.functionElement: + case ScriptElementKind.letElement: + case ScriptElementKind.constElement: + case ScriptElementKind.constructorImplementationElement: + displayParts.push(ts.textOrKeywordPart(symbolKind)); + return; + default: + displayParts.push(ts.punctuationPart(16)); + displayParts.push(ts.textOrKeywordPart(symbolKind)); + displayParts.push(ts.punctuationPart(17)); + return; + } + } function addSignatureDisplayParts(signature, allSignatures, flags) { displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeResolver, signature, enclosingDeclaration, flags | 32)); if (allSignatures.length > 1) { displayParts.push(ts.spacePart()); displayParts.push(ts.punctuationPart(16)); displayParts.push(ts.operatorPart(33)); - displayParts.push(ts.displayPart((allSignatures.length - 1).toString(), 7)); + displayParts.push(ts.displayPart((allSignatures.length - 1).toString(), SymbolDisplayPartKind.numericLiteral)); displayParts.push(ts.spacePart()); displayParts.push(ts.textPart(allSignatures.length === 2 ? "overload" : "overloads")); displayParts.push(ts.punctuationPart(17)); @@ -29393,10 +31592,10 @@ var ts; documentation = signature.getDocumentationComment(); } function writeTypeParametersOfSymbol(symbol, enclosingDeclaration) { - var _typeParameterParts = ts.mapToDisplayParts(function (writer) { + var typeParameterParts = ts.mapToDisplayParts(function (writer) { typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration); }); - displayParts.push.apply(displayParts, _typeParameterParts); + displayParts.push.apply(displayParts, typeParameterParts); } } function getQuickInfoAtPosition(fileName, position) { @@ -29409,11 +31608,11 @@ var ts; var symbol = typeInfoResolver.getSymbolAtLocation(node); if (!symbol) { switch (node.kind) { - case 64: - case 153: - case 125: - case 92: - case 90: + case 65: + case 155: + case 126: + case 93: + case 91: var type = typeInfoResolver.getTypeAtLocation(node); if (type) { return { @@ -29436,6 +31635,16 @@ var ts; documentation: displayPartsDocumentationsAndKind.documentation }; } + function createDefinitionInfo(node, symbolKind, symbolName, containerName) { + return { + fileName: node.getSourceFile().fileName, + textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()), + kind: symbolKind, + name: symbolName, + containerKind: undefined, + containerName: containerName + }; + } function getDefinitionAtPosition(fileName, position) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); @@ -29446,7 +31655,7 @@ var ts; if (isJumpStatementTarget(node)) { var labelName = node.text; var label = getTargetLabel(node.parent, node.text); - return label ? [getDefinitionInfo(label, ScriptElementKind.label, labelName, undefined)] : undefined; + return label ? [createDefinitionInfo(label, ScriptElementKind.label, labelName, undefined)] : undefined; } var comment = ts.forEach(sourceFile.referencedFiles, function (r) { return (r.pos <= position && position < r.end) ? r : undefined; }); if (comment) { @@ -29469,22 +31678,22 @@ var ts; } if (symbol.flags & 8388608) { var declaration = symbol.declarations[0]; - if (node.kind === 64 && node.parent === declaration) { + if (node.kind === 65 && node.parent === declaration) { symbol = typeInfoResolver.getAliasedSymbol(symbol); } } - var result = []; - if (node.parent.kind === 219) { + if (node.parent.kind === 225) { var shorthandSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); + if (!shorthandSymbol) { + return []; + } var shorthandDeclarations = shorthandSymbol.getDeclarations(); var shorthandSymbolKind = getSymbolKind(shorthandSymbol, typeInfoResolver, node); var shorthandSymbolName = typeInfoResolver.symbolToString(shorthandSymbol); var shorthandContainerName = typeInfoResolver.symbolToString(symbol.parent, node); - ts.forEach(shorthandDeclarations, function (declaration) { - result.push(getDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName)); - }); - return result; + return ts.map(shorthandDeclarations, function (declaration) { return createDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName); }); } + var result = []; var declarations = symbol.getDeclarations(); var symbolName = typeInfoResolver.symbolToString(symbol); var symbolKind = getSymbolKind(symbol, typeInfoResolver, node); @@ -29493,46 +31702,15 @@ var ts; if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { ts.forEach(declarations, function (declaration) { - result.push(getDefinitionInfo(declaration, symbolKind, symbolName, containerName)); + result.push(createDefinitionInfo(declaration, symbolKind, symbolName, containerName)); }); } return result; - function getDefinitionInfo(node, symbolKind, symbolName, containerName) { - return { - fileName: node.getSourceFile().fileName, - textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()), - kind: symbolKind, - name: symbolName, - containerKind: undefined, - containerName: containerName - }; - } - function tryAddSignature(signatureDeclarations, selectConstructors, symbolKind, symbolName, containerName, result) { - var _declarations = []; - var definition; - ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 133) || - (!selectConstructors && (d.kind === 195 || d.kind === 132 || d.kind === 131))) { - _declarations.push(d); - if (d.body) - definition = d; - } - }); - if (definition) { - result.push(getDefinitionInfo(definition, symbolKind, symbolName, containerName)); - return true; - } - else if (_declarations.length) { - result.push(getDefinitionInfo(_declarations[_declarations.length - 1], symbolKind, symbolName, containerName)); - return true; - } - return false; - } function tryAddConstructSignature(symbol, location, symbolKind, symbolName, containerName, result) { - if (isNewExpressionTarget(location) || location.kind === 113) { + if (isNewExpressionTarget(location) || location.kind === 114) { if (symbol.flags & 32) { var classDeclaration = symbol.getDeclarations()[0]; - ts.Debug.assert(classDeclaration && classDeclaration.kind === 196); + ts.Debug.assert(classDeclaration && classDeclaration.kind === 201); return tryAddSignature(classDeclaration.members, true, symbolKind, symbolName, containerName, result); } } @@ -29544,116 +31722,148 @@ var ts; } return false; } + 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 (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; + } } function getOccurrencesAtPosition(fileName, position) { + var results = getOccurrencesAtPositionCore(fileName, position); + if (results) { + var sourceFile = getCanonicalFileName(ts.normalizeSlashes(fileName)); + results.forEach(function (value) { + var targetFile = getCanonicalFileName(ts.normalizeSlashes(value.fileName)); + ts.Debug.assert(sourceFile == targetFile, "Unexpected file in results. Found results in " + targetFile + " expected only results in " + sourceFile + "."); + }); + } + return results; + } + function getOccurrencesAtPositionCore(fileName, position) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); var node = ts.getTouchingWord(sourceFile, position); if (!node) { return undefined; } - if (node.kind === 64 || node.kind === 92 || node.kind === 90 || + if (node.kind === 65 || node.kind === 93 || node.kind === 91 || isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { - return getReferencesForNode(node, [sourceFile], true, false, false); + return convertReferences(getReferencesForNode(node, [sourceFile], true, false, false)); } switch (node.kind) { - case 83: - case 75: - if (hasKind(node.parent, 178)) { + case 84: + case 76: + if (hasKind(node.parent, 183)) { return getIfElseOccurrences(node.parent); } break; - case 89: - if (hasKind(node.parent, 186)) { + case 90: + if (hasKind(node.parent, 191)) { return getReturnOccurrences(node.parent); } break; - case 93: - if (hasKind(node.parent, 190)) { + case 94: + if (hasKind(node.parent, 195)) { return getThrowOccurrences(node.parent); } break; - case 67: - if (hasKind(parent(parent(node)), 191)) { + case 68: + if (hasKind(parent(parent(node)), 196)) { return getTryCatchFinallyOccurrences(node.parent.parent); } break; - case 95: - case 80: - if (hasKind(parent(node), 191)) { + case 96: + case 81: + if (hasKind(parent(node), 196)) { return getTryCatchFinallyOccurrences(node.parent); } break; - case 91: - if (hasKind(node.parent, 188)) { + case 92: + if (hasKind(node.parent, 193)) { return getSwitchCaseDefaultOccurrences(node.parent); } break; - case 66: - case 72: - if (hasKind(parent(parent(parent(node))), 188)) { + case 67: + case 73: + if (hasKind(parent(parent(parent(node))), 193)) { return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); } break; - case 65: - case 70: - if (hasKind(node.parent, 185) || hasKind(node.parent, 184)) { + case 66: + case 71: + if (hasKind(node.parent, 190) || hasKind(node.parent, 189)) { return getBreakOrContinueStatementOccurences(node.parent); } break; - case 81: - if (hasKind(node.parent, 181) || - hasKind(node.parent, 182) || - hasKind(node.parent, 183)) { + case 82: + if (hasKind(node.parent, 186) || + hasKind(node.parent, 187) || + hasKind(node.parent, 188)) { return getLoopBreakContinueOccurrences(node.parent); } break; - case 99: - case 74: - if (hasKind(node.parent, 180) || hasKind(node.parent, 179)) { + case 100: + case 75: + if (hasKind(node.parent, 185) || hasKind(node.parent, 184)) { return getLoopBreakContinueOccurrences(node.parent); } break; - case 113: - if (hasKind(node.parent, 133)) { + case 114: + if (hasKind(node.parent, 135)) { return getConstructorOccurrences(node.parent); } break; - case 115: - case 119: - if (hasKind(node.parent, 134) || hasKind(node.parent, 135)) { + case 116: + case 120: + if (hasKind(node.parent, 136) || hasKind(node.parent, 137)) { return getGetAndSetOccurrences(node.parent); } default: if (ts.isModifier(node.kind) && node.parent && - (ts.isDeclaration(node.parent) || node.parent.kind === 175)) { + (ts.isDeclaration(node.parent) || node.parent.kind === 180)) { return getModifierOccurrences(node.kind, node.parent); } } return undefined; function getIfElseOccurrences(ifStatement) { var keywords = []; - while (hasKind(ifStatement.parent, 178) && ifStatement.parent.elseStatement === ifStatement) { + while (hasKind(ifStatement.parent, 183) && ifStatement.parent.elseStatement === ifStatement) { ifStatement = ifStatement.parent; } while (ifStatement) { var children = ifStatement.getChildren(); - pushKeywordIf(keywords, children[0], 83); - for (var _i = children.length - 1; _i >= 0; _i--) { - if (pushKeywordIf(keywords, children[_i], 75)) { + pushKeywordIf(keywords, children[0], 84); + for (var i = children.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, children[i], 76)) { break; } } - if (!hasKind(ifStatement.elseStatement, 178)) { + if (!hasKind(ifStatement.elseStatement, 183)) { break; } ifStatement = ifStatement.elseStatement; } var result = []; - for (var _i_1 = 0; _i_1 < keywords.length; _i_1++) { - if (keywords[_i_1].kind === 75 && _i_1 < keywords.length - 1) { - var elseKeyword = keywords[_i_1]; - var ifKeyword = keywords[_i_1 + 1]; + for (var i = 0; i < keywords.length; i++) { + if (keywords[i].kind === 76 && i < keywords.length - 1) { + var elseKeyword = keywords[i]; + var ifKeyword = keywords[i + 1]; var shouldHighlightNextKeyword = true; for (var j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { if (!ts.isWhiteSpace(sourceFile.text.charCodeAt(j))) { @@ -29667,25 +31877,25 @@ var ts; textSpan: ts.createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), isWriteAccess: false }); - _i_1++; + i++; continue; } } - result.push(getReferenceEntryFromNode(keywords[_i_1])); + result.push(getReferenceEntryFromNode(keywords[i])); } return result; } function getReturnOccurrences(returnStatement) { var func = ts.getContainingFunction(returnStatement); - if (!(func && hasKind(func.body, 174))) { + if (!(func && hasKind(func.body, 179))) { return undefined; } var keywords = []; ts.forEachReturnStatement(func.body, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 89); + pushKeywordIf(keywords, returnStatement.getFirstToken(), 90); }); ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 93); + pushKeywordIf(keywords, throwStatement.getFirstToken(), 94); }); return ts.map(keywords, getReferenceEntryFromNode); } @@ -29696,11 +31906,11 @@ var ts; } var keywords = []; ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 93); + pushKeywordIf(keywords, throwStatement.getFirstToken(), 94); }); if (ts.isFunctionBlock(owner)) { ts.forEachReturnStatement(owner, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 89); + pushKeywordIf(keywords, returnStatement.getFirstToken(), 90); }); } return ts.map(keywords, getReferenceEntryFromNode); @@ -29710,10 +31920,10 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 190) { + if (node.kind === 195) { statementAccumulator.push(node); } - else if (node.kind === 191) { + else if (node.kind === 196) { var tryStatement = node; if (tryStatement.catchClause) { aggregate(tryStatement.catchClause); @@ -29734,39 +31944,39 @@ var ts; function getThrowStatementOwner(throwStatement) { var child = throwStatement; while (child.parent) { - var _parent = child.parent; - if (ts.isFunctionBlock(_parent) || _parent.kind === 221) { - return _parent; + var parent_9 = child.parent; + if (ts.isFunctionBlock(parent_9) || parent_9.kind === 227) { + return parent_9; } - if (_parent.kind === 191) { - var tryStatement = _parent; + if (parent_9.kind === 196) { + var tryStatement = parent_9; if (tryStatement.tryBlock === child && tryStatement.catchClause) { return child; } } - child = _parent; + child = parent_9; } return undefined; } function getTryCatchFinallyOccurrences(tryStatement) { var keywords = []; - pushKeywordIf(keywords, tryStatement.getFirstToken(), 95); + pushKeywordIf(keywords, tryStatement.getFirstToken(), 96); if (tryStatement.catchClause) { - pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 67); + pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 68); } if (tryStatement.finallyBlock) { - var finallyKeyword = ts.findChildOfKind(tryStatement, 80, sourceFile); - pushKeywordIf(keywords, finallyKeyword, 80); + var finallyKeyword = ts.findChildOfKind(tryStatement, 81, sourceFile); + pushKeywordIf(keywords, finallyKeyword, 81); } return ts.map(keywords, getReferenceEntryFromNode); } function getLoopBreakContinueOccurrences(loopNode) { var keywords = []; - if (pushKeywordIf(keywords, loopNode.getFirstToken(), 81, 99, 74)) { - if (loopNode.kind === 179) { + if (pushKeywordIf(keywords, loopNode.getFirstToken(), 82, 100, 75)) { + if (loopNode.kind === 184) { var loopTokens = loopNode.getChildren(); - for (var _i = loopTokens.length - 1; _i >= 0; _i--) { - if (pushKeywordIf(keywords, loopTokens[_i], 99)) { + for (var i = loopTokens.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, loopTokens[i], 100)) { break; } } @@ -29775,20 +31985,20 @@ var ts; var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); ts.forEach(breaksAndContinues, function (statement) { if (ownsBreakOrContinueStatement(loopNode, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 65, 70); + pushKeywordIf(keywords, statement.getFirstToken(), 66, 71); } }); return ts.map(keywords, getReferenceEntryFromNode); } function getSwitchCaseDefaultOccurrences(switchStatement) { var keywords = []; - pushKeywordIf(keywords, switchStatement.getFirstToken(), 91); + pushKeywordIf(keywords, switchStatement.getFirstToken(), 92); ts.forEach(switchStatement.caseBlock.clauses, function (clause) { - pushKeywordIf(keywords, clause.getFirstToken(), 66, 72); + pushKeywordIf(keywords, clause.getFirstToken(), 67, 73); var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); ts.forEach(breaksAndContinues, function (statement) { if (ownsBreakOrContinueStatement(switchStatement, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 65); + pushKeywordIf(keywords, statement.getFirstToken(), 66); } }); }); @@ -29798,13 +32008,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 181: - case 182: - case 183: - case 179: - case 180: - return getLoopBreakContinueOccurrences(owner); + case 186: + case 187: case 188: + case 184: + case 185: + return getLoopBreakContinueOccurrences(owner); + case 193: return getSwitchCaseDefaultOccurrences(owner); } } @@ -29815,7 +32025,7 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 185 || node.kind === 184) { + if (node.kind === 190 || node.kind === 189) { statementAccumulator.push(node); } else if (!ts.isFunctionLike(node)) { @@ -29829,23 +32039,23 @@ var ts; return actualOwner && actualOwner === owner; } function getBreakOrContinueOwner(statement) { - for (var _node = statement.parent; _node; _node = _node.parent) { - switch (_node.kind) { - case 188: - if (statement.kind === 184) { + for (var node_1 = statement.parent; node_1; node_1 = node_1.parent) { + switch (node_1.kind) { + case 193: + if (statement.kind === 189) { continue; } - case 181: - case 182: - case 183: - case 180: - case 179: - if (!statement.label || isLabeledBy(_node, statement.label.text)) { - return _node; + case 186: + case 187: + case 188: + case 185: + case 184: + if (!statement.label || isLabeledBy(node_1, statement.label.text)) { + return node_1; } break; default: - if (ts.isFunctionLike(_node)) { + if (ts.isFunctionLike(node_1)) { return undefined; } break; @@ -29858,38 +32068,38 @@ var ts; var keywords = []; ts.forEach(declarations, function (declaration) { ts.forEach(declaration.getChildren(), function (token) { - return pushKeywordIf(keywords, token, 113); + return pushKeywordIf(keywords, token, 114); }); }); return ts.map(keywords, getReferenceEntryFromNode); } function getGetAndSetOccurrences(accessorDeclaration) { var keywords = []; - tryPushAccessorKeyword(accessorDeclaration.symbol, 134); - tryPushAccessorKeyword(accessorDeclaration.symbol, 135); + tryPushAccessorKeyword(accessorDeclaration.symbol, 136); + tryPushAccessorKeyword(accessorDeclaration.symbol, 137); return ts.map(keywords, getReferenceEntryFromNode); function tryPushAccessorKeyword(accessorSymbol, accessorKind) { var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); if (accessor) { - ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 115, 119); }); + ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 116, 120); }); } } } function getModifierOccurrences(modifier, declaration) { var container = declaration.parent; - if (declaration.flags & 112) { - if (!(container.kind === 196 || - (declaration.kind === 128 && hasKind(container, 133)))) { + if (ts.isAccessibilityModifier(modifier)) { + if (!(container.kind === 201 || + (declaration.kind === 129 && hasKind(container, 135)))) { return undefined; } } - else if (declaration.flags & 128) { - if (container.kind !== 196) { + else if (modifier === 110) { + if (container.kind !== 201) { return undefined; } } - else if (declaration.flags & (1 | 2)) { - if (!(container.kind === 201 || container.kind === 221)) { + else if (modifier === 78 || modifier === 115) { + if (!(container.kind === 206 || container.kind === 227)) { return undefined; } } @@ -29900,18 +32110,18 @@ var ts; var modifierFlag = getFlagFromModifier(modifier); var nodes; switch (container.kind) { - case 201: - case 221: + case 206: + case 227: nodes = container.statements; break; - case 133: + case 135: nodes = container.parameters.concat(container.parent.members); break; - case 196: + case 201: nodes = container.members; if (modifierFlag & 112) { var constructor = ts.forEach(container.members, function (member) { - return member.kind === 133 && member; + return member.kind === 135 && member; }); if (constructor) { nodes = nodes.concat(constructor.parameters); @@ -29929,17 +32139,17 @@ var ts; return ts.map(keywords, getReferenceEntryFromNode); function getFlagFromModifier(modifier) { switch (modifier) { - case 108: - return 16; - case 106: - return 32; - case 107: - return 64; case 109: + return 16; + case 107: + return 32; + case 108: + return 64; + case 110: return 128; - case 77: + case 78: return 1; - case 114: + case 115: return 2; default: ts.Debug.fail(); @@ -29964,46 +32174,63 @@ var ts; return false; } } + function convertReferences(referenceSymbols) { + if (!referenceSymbols) { + return undefined; + } + var referenceEntries = []; + for (var _i = 0; _i < referenceSymbols.length; _i++) { + var referenceSymbol = referenceSymbols[_i]; + ts.addRange(referenceEntries, referenceSymbol.references); + } + return referenceEntries; + } function findRenameLocations(fileName, position, findInStrings, findInComments) { - return findReferences(fileName, position, findInStrings, findInComments); + var referencedSymbols = findReferencedSymbols(fileName, position, findInStrings, findInComments); + return convertReferences(referencedSymbols); } function getReferencesAtPosition(fileName, position) { - return findReferences(fileName, position, false, false); + var referencedSymbols = findReferencedSymbols(fileName, position, false, false); + return convertReferences(referencedSymbols); } - function findReferences(fileName, position, findInStrings, findInComments) { + function findReferences(fileName, position) { + var referencedSymbols = findReferencedSymbols(fileName, position, false, false); + return ts.filter(referencedSymbols, function (rs) { return !!rs.definition; }); + } + function findReferencedSymbols(fileName, position, findInStrings, findInComments) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); var node = ts.getTouchingPropertyName(sourceFile, position); if (!node) { return undefined; } - if (node.kind !== 64 && + if (node.kind !== 65 && !isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && !isNameOfExternalModuleImportOrDeclaration(node)) { return undefined; } - ts.Debug.assert(node.kind === 64 || node.kind === 7 || node.kind === 8); + ts.Debug.assert(node.kind === 65 || node.kind === 7 || node.kind === 8); return getReferencesForNode(node, program.getSourceFiles(), false, findInStrings, findInComments); } function getReferencesForNode(node, sourceFiles, searchOnlyInCurrentFile, findInStrings, findInComments) { if (isLabelName(node)) { if (isJumpStatementTarget(node)) { var labelDefinition = getTargetLabel(node.parent, node.text); - return labelDefinition ? getLabelReferencesInNode(labelDefinition.parent, labelDefinition) : [getReferenceEntryFromNode(node)]; + return labelDefinition ? getLabelReferencesInNode(labelDefinition.parent, labelDefinition) : undefined; } else { return getLabelReferencesInNode(node.parent, node); } } - if (node.kind === 92) { + if (node.kind === 93) { return getReferencesForThisKeyword(node, sourceFiles); } - if (node.kind === 90) { + if (node.kind === 91) { return getReferencesForSuperKeyword(node); } var symbol = typeInfoResolver.getSymbolAtLocation(node); if (!symbol) { - return [getReferenceEntryFromNode(node)]; + return undefined; } var declarations = symbol.declarations; if (!declarations || !declarations.length) { @@ -30013,15 +32240,16 @@ var ts; var searchMeaning = getIntersectingMeaningFromDeclarations(getMeaningFromLocation(node), declarations); var declaredName = getDeclaredName(symbol, node); var scope = getSymbolScope(symbol); + var symbolToIndex = []; if (scope) { result = []; - getReferencesInNode(scope, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result); + getReferencesInNode(scope, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); } else { if (searchOnlyInCurrentFile) { ts.Debug.assert(sourceFiles.length === 1); result = []; - getReferencesInNode(sourceFiles[0], symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result); + getReferencesInNode(sourceFiles[0], symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); } else { var internedName = getInternedName(symbol, node, declarations); @@ -30030,48 +32258,64 @@ var ts; var nameTable = getNameTable(sourceFile); if (ts.lookUp(nameTable, internedName)) { result = result || []; - getReferencesInNode(sourceFile, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result); + getReferencesInNode(sourceFile, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); } }); } } return result; + function getDefinition(symbol) { + var info = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, node.getSourceFile(), getContainerNode(node), typeInfoResolver, node); + var name = ts.map(info.displayParts, function (p) { return p.text; }).join(""); + var declarations = symbol.declarations; + if (!declarations || declarations.length === 0) { + return undefined; + } + return { + containerKind: "", + containerName: "", + name: name, + kind: info.symbolKind, + fileName: declarations[0].getSourceFile().fileName, + textSpan: ts.createTextSpan(declarations[0].getStart(), 0) + }; + } function isImportOrExportSpecifierName(location) { return location.parent && - (location.parent.kind === 208 || location.parent.kind === 212) && + (location.parent.kind === 213 || location.parent.kind === 217) && location.parent.propertyName === location; } function isImportOrExportSpecifierImportSymbol(symbol) { return (symbol.flags & 8388608) && ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 208 || declaration.kind === 212; + return declaration.kind === 213 || declaration.kind === 217; }); } function getDeclaredName(symbol, location) { - var functionExpression = ts.forEach(symbol.declarations, function (d) { return d.kind === 160 ? d : undefined; }); - var _name; + var functionExpression = ts.forEach(symbol.declarations, function (d) { return d.kind === 162 ? d : undefined; }); + var name; if (functionExpression && functionExpression.name) { - _name = functionExpression.name.text; + name = functionExpression.name.text; } if (isImportOrExportSpecifierName(location)) { return location.getText(); } - _name = typeInfoResolver.symbolToString(symbol); - return stripQuotes(_name); + name = typeInfoResolver.symbolToString(symbol); + return stripQuotes(name); } function getInternedName(symbol, location, declarations) { if (isImportOrExportSpecifierName(location)) { return location.getText(); } - var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 160 ? d : undefined; }); - var _name = functionExpression && functionExpression.name + var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 162 ? d : undefined; }); + var name = functionExpression && functionExpression.name ? functionExpression.name.text : symbol.name; - return stripQuotes(_name); + return stripQuotes(name); } function stripQuotes(name) { - var _length = name.length; - if (_length >= 2 && name.charCodeAt(0) === 34 && name.charCodeAt(_length - 1) === 34) { - return name.substring(1, _length - 1); + var length = name.length; + if (length >= 2 && name.charCodeAt(0) === 34 && name.charCodeAt(length - 1) === 34) { + return name.substring(1, length - 1); } ; return name; @@ -30080,7 +32324,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, 196); + return ts.getAncestor(privateDeclaration, 201); } } if (symbol.flags & 8388608) { @@ -30089,25 +32333,25 @@ var ts; if (symbol.parent || (symbol.flags & 268435456)) { return undefined; } - var _scope = undefined; - var _declarations = symbol.getDeclarations(); - if (_declarations) { - for (var _i = 0, _n = _declarations.length; _i < _n; _i++) { - var declaration = _declarations[_i]; + var scope = undefined; + var declarations = symbol.getDeclarations(); + if (declarations) { + for (var _i = 0; _i < declarations.length; _i++) { + var declaration = declarations[_i]; var container = getContainerNode(declaration); if (!container) { return undefined; } - if (_scope && _scope !== container) { + if (scope && scope !== container) { return undefined; } - if (container.kind === 221 && !ts.isExternalModule(container)) { + if (container.kind === 227 && !ts.isExternalModule(container)) { return undefined; } - _scope = container; + scope = container; } } - return _scope; + return scope; } function getPossibleSymbolReferencePositions(sourceFile, symbolName, start, end) { var positions = []; @@ -30132,27 +32376,35 @@ var ts; return positions; } function getLabelReferencesInNode(container, targetLabel) { - var _result = []; + var references = []; var sourceFile = container.getSourceFile(); var labelName = targetLabel.text; var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, labelName, container.getStart(), container.getEnd()); ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); - var _node = ts.getTouchingWord(sourceFile, position); - if (!_node || _node.getWidth() !== labelName.length) { + var node = ts.getTouchingWord(sourceFile, position); + if (!node || node.getWidth() !== labelName.length) { return; } - if (_node === targetLabel || - (isJumpStatementTarget(_node) && getTargetLabel(_node, labelName) === targetLabel)) { - _result.push(getReferenceEntryFromNode(_node)); + if (node === targetLabel || + (isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel)) { + references.push(getReferenceEntryFromNode(node)); } }); - return _result; + var definition = { + containerKind: "", + containerName: "", + fileName: targetLabel.getSourceFile().fileName, + kind: ScriptElementKind.label, + name: labelName, + textSpan: ts.createTextSpanFromBounds(targetLabel.getStart(), targetLabel.getEnd()) + }; + return [{ definition: definition, references: references }]; } function isValidReferencePosition(node, searchSymbolName) { if (node) { switch (node.kind) { - case 64: + case 65: return node.getWidth() === searchSymbolName.length; case 8: if (isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || @@ -30169,7 +32421,7 @@ var ts; } return false; } - function getReferencesInNode(container, searchSymbol, searchText, searchLocation, searchMeaning, findInStrings, findInComments, result) { + function getReferencesInNode(container, searchSymbol, searchText, searchLocation, searchMeaning, findInStrings, findInComments, result, symbolToIndex) { var sourceFile = container.getSourceFile(); var tripleSlashDirectivePrefixRegex = /^\/\/\/\s*= 0) { - result.push(getReferenceEntryFromNode(referenceSymbolDeclaration.name)); + var referencedSymbol = getReferencedSymbol(shorthandValueSymbol); + referencedSymbol.references.push(getReferenceEntryFromNode(referenceSymbolDeclaration.name)); } } }); } + return; + function getReferencedSymbol(symbol) { + var symbolId = ts.getSymbolId(symbol); + var index = symbolToIndex[symbolId]; + if (index === undefined) { + index = result.length; + symbolToIndex[symbolId] = index; + result.push({ + definition: getDefinition(symbol), + references: [] + }); + } + return result[index]; + } function isInString(position) { var token = ts.getTokenAtPosition(sourceFile, position); return token && token.kind === 8 && position > token.getStart(); @@ -30232,105 +32504,116 @@ var ts; } var staticFlag = 128; switch (searchSpaceNode.kind) { - case 130: - case 129: case 132: case 131: - case 133: case 134: + case 133: case 135: + case 136: + case 137: staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; break; default: return undefined; } - var _result = []; + var references = []; var sourceFile = searchSpaceNode.getSourceFile(); var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "super", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); - var _node = ts.getTouchingWord(sourceFile, position); - if (!_node || _node.kind !== 90) { + var node = ts.getTouchingWord(sourceFile, position); + if (!node || node.kind !== 91) { return; } - var container = ts.getSuperContainer(_node, false); + var container = ts.getSuperContainer(node, false); if (container && (128 & container.flags) === staticFlag && container.parent.symbol === searchSpaceNode.symbol) { - _result.push(getReferenceEntryFromNode(_node)); + references.push(getReferenceEntryFromNode(node)); } }); - return _result; + var definition = getDefinition(searchSpaceNode.symbol); + return [{ definition: definition, references: references }]; } function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles) { var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, false); var staticFlag = 128; switch (searchSpaceNode.kind) { - case 132: - case 131: + case 134: + case 133: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } - case 130: - case 129: - case 133: - case 134: + case 132: + case 131: case 135: + case 136: + case 137: staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; break; - case 221: + case 227: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } - case 195: - case 160: + case 200: + case 162: break; default: return undefined; } - var _result = []; + var references = []; var possiblePositions; - if (searchSpaceNode.kind === 221) { + if (searchSpaceNode.kind === 227) { ts.forEach(sourceFiles, function (sourceFile) { possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); - getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, _result); + getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references); }); } else { var sourceFile = searchSpaceNode.getSourceFile(); possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); - getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, _result); + getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, references); } - return _result; + return [{ + definition: { + containerKind: "", + containerName: "", + fileName: node.getSourceFile().fileName, + kind: ScriptElementKind.variableElement, + name: "this", + textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()) + }, + references: references + }]; function getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, result) { ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); - var _node = ts.getTouchingWord(sourceFile, position); - if (!_node || _node.kind !== 92) { + var node = ts.getTouchingWord(sourceFile, position); + if (!node || node.kind !== 93) { return; } - var container = ts.getThisContainer(_node, false); + var container = ts.getThisContainer(node, false); switch (searchSpaceNode.kind) { - case 160: - case 195: + case 162: + case 200: if (searchSpaceNode.symbol === container.symbol) { - result.push(getReferenceEntryFromNode(_node)); + result.push(getReferenceEntryFromNode(node)); } break; - case 132: - case 131: + case 134: + case 133: if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { - result.push(getReferenceEntryFromNode(_node)); + result.push(getReferenceEntryFromNode(node)); } break; - case 196: + case 201: if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (container.flags & 128) === staticFlag) { - result.push(getReferenceEntryFromNode(_node)); + result.push(getReferenceEntryFromNode(node)); } break; - case 221: - if (container.kind === 221 && !ts.isExternalModule(container)) { - result.push(getReferenceEntryFromNode(_node)); + case 227: + if (container.kind === 227 && !ts.isExternalModule(container)) { + result.push(getReferenceEntryFromNode(node)); } break; } @@ -30338,37 +32621,37 @@ var ts; } } function populateSearchSymbolSet(symbol, location) { - var _result = [symbol]; + var result = [symbol]; if (isImportOrExportSpecifierImportSymbol(symbol)) { - _result.push(typeInfoResolver.getAliasedSymbol(symbol)); + result.push(typeInfoResolver.getAliasedSymbol(symbol)); } if (isNameOfPropertyAssignment(location)) { ts.forEach(getPropertySymbolsFromContextualType(location), function (contextualSymbol) { - _result.push.apply(_result, typeInfoResolver.getRootSymbols(contextualSymbol)); + result.push.apply(result, typeInfoResolver.getRootSymbols(contextualSymbol)); }); var shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(location.parent); if (shorthandValueSymbol) { - _result.push(shorthandValueSymbol); + result.push(shorthandValueSymbol); } } ts.forEach(typeInfoResolver.getRootSymbols(symbol), function (rootSymbol) { if (rootSymbol !== symbol) { - _result.push(rootSymbol); + result.push(rootSymbol); } if (rootSymbol.parent && rootSymbol.parent.flags & (32 | 64)) { - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), _result); + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result); } }); - return _result; + return result; } function getPropertySymbolsFromBaseTypes(symbol, propertyName, result) { if (symbol && symbol.flags & (32 | 64)) { ts.forEach(symbol.getDeclarations(), function (declaration) { - if (declaration.kind === 196) { - getPropertySymbolFromTypeReference(ts.getClassBaseTypeNode(declaration)); - ts.forEach(ts.getClassImplementedTypeNodes(declaration), getPropertySymbolFromTypeReference); + if (declaration.kind === 201) { + getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); + ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); } - else if (declaration.kind === 197) { + else if (declaration.kind === 202) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); } }); @@ -30387,57 +32670,59 @@ var ts; } } } - function isRelatableToSearchSet(searchSymbols, referenceSymbol, referenceLocation) { + function getRelatedSymbol(searchSymbols, referenceSymbol, referenceLocation) { if (searchSymbols.indexOf(referenceSymbol) >= 0) { - return true; + return referenceSymbol; } - if (isImportOrExportSpecifierImportSymbol(referenceSymbol) && - searchSymbols.indexOf(typeInfoResolver.getAliasedSymbol(referenceSymbol)) >= 0) { - return true; + if (isImportOrExportSpecifierImportSymbol(referenceSymbol)) { + var aliasedSymbol = typeInfoResolver.getAliasedSymbol(referenceSymbol); + if (searchSymbols.indexOf(aliasedSymbol) >= 0) { + return aliasedSymbol; + } } if (isNameOfPropertyAssignment(referenceLocation)) { return ts.forEach(getPropertySymbolsFromContextualType(referenceLocation), function (contextualSymbol) { - return ts.forEach(typeInfoResolver.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0; }); + return ts.forEach(typeInfoResolver.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); }); } return ts.forEach(typeInfoResolver.getRootSymbols(referenceSymbol), function (rootSymbol) { if (searchSymbols.indexOf(rootSymbol) >= 0) { - return true; + return rootSymbol; } if (rootSymbol.parent && rootSymbol.parent.flags & (32 | 64)) { - var _result = []; - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), _result); - return ts.forEach(_result, function (s) { return searchSymbols.indexOf(s) >= 0; }); + var result_2 = []; + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result_2); + return ts.forEach(result_2, function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); } - return false; + return undefined; }); } function getPropertySymbolsFromContextualType(node) { if (isNameOfPropertyAssignment(node)) { var objectLiteral = node.parent.parent; var contextualType = typeInfoResolver.getContextualType(objectLiteral); - var _name = node.text; + var name_20 = node.text; if (contextualType) { if (contextualType.flags & 16384) { - var unionProperty = contextualType.getProperty(_name); + var unionProperty = contextualType.getProperty(name_20); if (unionProperty) { return [unionProperty]; } else { - var _result = []; + var result_3 = []; ts.forEach(contextualType.types, function (t) { - var _symbol = t.getProperty(_name); - if (_symbol) { - _result.push(_symbol); + var symbol = t.getProperty(name_20); + if (symbol) { + result_3.push(symbol); } }); - return _result; + return result_3; } } else { - var _symbol = contextualType.getProperty(_name); - if (_symbol) { - return [_symbol]; + var symbol_1 = contextualType.getProperty(name_20); + if (symbol_1) { + return [symbol_1]; } } } @@ -30449,7 +32734,7 @@ var ts; var lastIterationMeaning; do { lastIterationMeaning = meaning; - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; var declarationMeaning = getMeaningFromDeclaration(declaration); if (declarationMeaning & meaning) { @@ -30475,17 +32760,17 @@ var ts; }; } function isWriteAccess(node) { - if (node.kind === 64 && ts.isDeclarationName(node)) { + if (node.kind === 65 && ts.isDeclarationName(node)) { return true; } - var _parent = node.parent; - if (_parent) { - if (_parent.kind === 166 || _parent.kind === 165) { + var parent = node.parent; + if (parent) { + if (parent.kind === 168 || parent.kind === 167) { return true; } - else if (_parent.kind === 167 && _parent.left === node) { - var operator = _parent.operatorToken.kind; - return 52 <= operator && operator <= 63; + else if (parent.kind === 169 && parent.left === node) { + var operator = parent.operatorToken.kind; + return 53 <= operator && operator <= 64; } } return false; @@ -30495,7 +32780,7 @@ var ts; return ts.NavigateTo.getNavigateToItems(program, cancellationToken, searchValue, maxResultCount); } function containErrors(diagnostics) { - return ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === 1; }); + return ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; }); } function getEmitOutput(fileName) { synchronizeHostData(); @@ -30516,33 +32801,33 @@ var ts; } function getMeaningFromDeclaration(node) { switch (node.kind) { - case 128: - case 193: - case 150: - case 130: case 129: - case 218: - case 219: - case 220: + case 198: + case 152: case 132: case 131: - case 133: + case 224: + case 225: + case 226: case 134: + case 133: case 135: - case 195: - case 160: - case 161: - case 217: - return 1; - case 127: - case 197: - case 198: - case 143: - return 2; - case 196: - case 199: - return 1 | 2; + 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 201: + case 204: + return 1 | 2; + case 205: if (node.name.kind === 8) { return 4 | 1; } @@ -30552,52 +32837,72 @@ var ts; else { return 4; } - case 207: + case 212: + case 213: case 208: - case 203: - case 204: case 209: - case 210: + case 214: + case 215: return 1 | 2 | 4; - case 221: + case 227: return 4 | 1; } return 1 | 2 | 4; ts.Debug.fail("Unknown declaration type"); } function isTypeReference(node) { - if (isRightSideOfQualifiedName(node)) { + if (ts.isRightSideOfQualifiedNameOrPropertyAccess(node)) { node = node.parent; } - return node.parent.kind === 139; + return node.parent.kind === 141 || node.parent.kind === 177; } function isNamespaceReference(node) { + return isQualifiedNameNamespaceReference(node) || isPropertyAccessNamespaceReference(node); + } + function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 125) { - while (root.parent && root.parent.kind === 125) + if (root.parent.kind === 155) { + while (root.parent && root.parent.kind === 155) { root = root.parent; + } + isLastClause = root.name === node; + } + if (!isLastClause && root.parent.kind === 177 && root.parent.parent.kind === 222) { + var decl = root.parent.parent.parent; + return (decl.kind === 201 && root.parent.parent.token === 103) || + (decl.kind === 202 && 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) { + root = root.parent; + } isLastClause = root.right === node; } - return root.parent.kind === 139 && !isLastClause; + return root.parent.kind === 141 && !isLastClause; } function isInRightSideOfImport(node) { - while (node.parent.kind === 125) { + while (node.parent.kind === 126) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; } function getMeaningFromRightHandSideOfImportEquals(node) { - ts.Debug.assert(node.kind === 64); - if (node.parent.kind === 125 && + ts.Debug.assert(node.kind === 65); + if (node.parent.kind === 126 && node.parent.right === node && - node.parent.parent.kind === 203) { + node.parent.parent.kind === 208) { return 1 | 2 | 4; } return 4; } function getMeaningFromLocation(node) { - if (node.parent.kind === 209) { + if (node.parent.kind === 214) { return 1 | 2 | 4; } else if (isInRightSideOfImport(node)) { @@ -30631,15 +32936,15 @@ var ts; return; } switch (node.kind) { - case 153: - case 125: + case 155: + case 126: case 8: - case 79: - case 94: - case 88: - case 90: - case 92: - case 64: + case 80: + case 95: + case 89: + case 91: + case 93: + case 65: break; default: return; @@ -30650,7 +32955,7 @@ var ts; nodeForStartPos = nodeForStartPos.parent; } else if (isNameOfModuleDeclaration(nodeForStartPos)) { - if (nodeForStartPos.parent.parent.kind === 200 && + if (nodeForStartPos.parent.parent.kind === 205 && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { nodeForStartPos = nodeForStartPos.parent.parent.name; } @@ -30706,13 +33011,13 @@ var ts; return undefined; function hasValueSideModule(symbol) { return ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 200 && ts.getModuleInstanceState(declaration) == 1; + return declaration.kind === 205 && ts.getModuleInstanceState(declaration) == 1; }); } } function processNode(node) { if (node && ts.textSpanIntersectsWith(span, node.getStart(), node.getWidth())) { - if (node.kind === 64 && node.getWidth() > 0) { + if (node.kind === 65 && node.getWidth() > 0) { var symbol = typeInfoResolver.getSymbolAtLocation(node); if (symbol) { var type = classifySymbol(symbol, getMeaningFromLocation(node)); @@ -30823,17 +33128,17 @@ var ts; } if (ts.isPunctuation(tokenKind)) { if (token) { - if (tokenKind === 52) { - if (token.parent.kind === 193 || - token.parent.kind === 130 || - token.parent.kind === 128) { + if (tokenKind === 53) { + if (token.parent.kind === 198 || + token.parent.kind === 132 || + token.parent.kind === 129) { return ClassificationTypeNames.operator; } } - if (token.parent.kind === 167 || - token.parent.kind === 165 || - token.parent.kind === 166 || - token.parent.kind === 168) { + if (token.parent.kind === 169 || + token.parent.kind === 167 || + token.parent.kind === 168 || + token.parent.kind === 170) { return ClassificationTypeNames.operator; } } @@ -30851,30 +33156,30 @@ var ts; else if (ts.isTemplateLiteralKind(tokenKind)) { return ClassificationTypeNames.stringLiteral; } - else if (tokenKind === 64) { + else if (tokenKind === 65) { if (token) { switch (token.parent.kind) { - case 196: + case 201: if (token.parent.name === token) { return ClassificationTypeNames.className; } return; - case 127: + case 128: if (token.parent.name === token) { return ClassificationTypeNames.typeParameterName; } return; - case 197: + case 202: if (token.parent.name === token) { return ClassificationTypeNames.interfaceName; } return; - case 199: + case 204: if (token.parent.name === token) { return ClassificationTypeNames.enumName; } return; - case 200: + case 205: if (token.parent.name === token) { return ClassificationTypeNames.moduleName; } @@ -30887,7 +33192,7 @@ var ts; function processElement(element) { if (ts.textSpanIntersectsWith(span, element.getFullStart(), element.getFullWidth())) { var children = element.getChildren(); - for (var _i = 0, _n = children.length; _i < _n; _i++) { + for (var _i = 0; _i < children.length; _i++) { var child = children[_i]; if (ts.isToken(child)) { classifyToken(child); @@ -30912,7 +33217,7 @@ var ts; if (matchKind) { var parentElement = token.parent; var childNodes = parentElement.getChildren(sourceFile); - for (var _i = 0, _n = childNodes.length; _i < _n; _i++) { + for (var _i = 0; _i < childNodes.length; _i++) { var current = childNodes[_i]; if (current.kind === matchKind) { var range1 = ts.createTextSpan(token.getStart(sourceFile), token.getWidth(sourceFile)); @@ -30993,9 +33298,9 @@ var ts; continue; } var descriptor = undefined; - for (var _i = 0, n = descriptors.length; _i < n; _i++) { - if (matchArray[_i + firstDescriptorCaptureIndex]) { - descriptor = descriptors[_i]; + for (var i = 0, n = descriptors.length; i < n; i++) { + if (matchArray[i + firstDescriptorCaptureIndex]) { + descriptor = descriptors[i]; } } ts.Debug.assert(descriptor !== undefined); @@ -31015,15 +33320,17 @@ var ts; return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); } function getTodoCommentsRegExp() { + // NOTE: ?: means 'non-capture group'. It allows us to have groups without having to + // filter them out later in the final result array. var singleLineCommentStart = /(?:\/\/+\s*)/.source; var multiLineCommentStart = /(?:\/\*+\s*)/.source; var anyNumberOfSpacesAndAsterixesAtStartOfLine = /(?:^(?:\s|\*)*)/.source; - var _preamble = "(" + anyNumberOfSpacesAndAsterixesAtStartOfLine + "|" + singleLineCommentStart + "|" + multiLineCommentStart + ")"; + var preamble = "(" + anyNumberOfSpacesAndAsterixesAtStartOfLine + "|" + singleLineCommentStart + "|" + multiLineCommentStart + ")"; var literals = "(?:" + ts.map(descriptors, function (d) { return "(" + escapeRegExp(d.text) + ")"; }).join("|") + ")"; var endOfLineOrEndOfComment = /(?:$|\*\/)/.source; var messageRemainder = /(?:.*?)/.source; var messagePortion = "(" + literals + messageRemainder + ")"; - var regExpString = _preamble + messagePortion + endOfLineOrEndOfComment; + var regExpString = preamble + messagePortion + endOfLineOrEndOfComment; return new RegExp(regExpString, "gim"); } function isLetterOrDigit(char) { @@ -31036,17 +33343,17 @@ var ts; synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); var node = ts.getTouchingWord(sourceFile, position); - if (node && node.kind === 64) { + if (node && node.kind === 65) { var symbol = typeInfoResolver.getSymbolAtLocation(node); if (symbol) { var declarations = symbol.getDeclarations(); if (declarations && declarations.length > 0) { var defaultLibFileName = host.getDefaultLibFileName(host.getCompilationSettings()); if (defaultLibFileName) { - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + for (var _i = 0; _i < declarations.length; _i++) { var current = declarations[_i]; - var _sourceFile = current.getSourceFile(); - if (_sourceFile && getCanonicalFileName(ts.normalizePath(_sourceFile.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) { + var sourceFile_1 = current.getSourceFile(); + if (sourceFile_1 && getCanonicalFileName(ts.normalizePath(sourceFile_1.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) { return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library.key)); } } @@ -31093,6 +33400,7 @@ var ts; getQuickInfoAtPosition: getQuickInfoAtPosition, getDefinitionAtPosition: getDefinitionAtPosition, getReferencesAtPosition: getReferencesAtPosition, + findReferences: findReferences, getOccurrencesAtPosition: getOccurrencesAtPosition, getNameOrDottedNameSpan: getNameOrDottedNameSpan, getBreakpointStatementAtPosition: getBreakpointStatementAtPosition, @@ -31126,13 +33434,13 @@ var ts; sourceFile.nameTable = nameTable; function walk(node) { switch (node.kind) { - case 64: + case 65: nameTable[node.text] = node.text; break; case 8: case 7: if (ts.isDeclarationName(node) || - node.parent.kind === 213 || + node.parent.kind === 219 || isArgumentOfElementAccessExpression(node)) { nameTable[node.text] = node.text; } @@ -31145,40 +33453,31 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 154 && + node.parent.kind === 156 && node.parent.argumentExpression === node; } function createClassifier() { - var _scanner = ts.createScanner(2, false); + var scanner = ts.createScanner(2, false); var noRegexTable = []; - noRegexTable[64] = true; + noRegexTable[65] = true; noRegexTable[8] = true; noRegexTable[7] = true; noRegexTable[9] = true; - noRegexTable[92] = true; + noRegexTable[93] = true; noRegexTable[38] = true; noRegexTable[39] = true; noRegexTable[17] = true; noRegexTable[19] = true; noRegexTable[15] = true; - noRegexTable[94] = true; - noRegexTable[79] = true; + noRegexTable[95] = true; + noRegexTable[80] = true; var templateStack = []; - function isAccessibilityModifier(kind) { - switch (kind) { - case 108: - case 106: - case 107: - return true; - } - return false; - } function canFollow(keyword1, keyword2) { - if (isAccessibilityModifier(keyword1)) { - if (keyword2 === 115 || - keyword2 === 119 || - keyword2 === 113 || - keyword2 === 109) { + if (ts.isAccessibilityModifier(keyword1)) { + if (keyword2 === 116 || + keyword2 === 120 || + keyword2 === 114 || + keyword2 === 110) { return true; } return false; @@ -31216,40 +33515,40 @@ var ts; templateStack.push(11); break; } - _scanner.setText(text); + scanner.setText(text); var result = { finalLexState: 0, entries: [] }; var angleBracketStack = 0; do { - token = _scanner.scan(); + token = scanner.scan(); if (!ts.isTrivia(token)) { - if ((token === 36 || token === 56) && !noRegexTable[lastNonTriviaToken]) { - if (_scanner.reScanSlashToken() === 9) { + if ((token === 36 || token === 57) && !noRegexTable[lastNonTriviaToken]) { + if (scanner.reScanSlashToken() === 9) { token = 9; } } else if (lastNonTriviaToken === 20 && isKeyword(token)) { - token = 64; + token = 65; } else if (isKeyword(lastNonTriviaToken) && isKeyword(token) && !canFollow(lastNonTriviaToken, token)) { - token = 64; + token = 65; } - else if (lastNonTriviaToken === 64 && + else if (lastNonTriviaToken === 65 && token === 24) { angleBracketStack++; } else if (token === 25 && angleBracketStack > 0) { angleBracketStack--; } - else if (token === 111 || - token === 120 || - token === 118 || - token === 112 || - token === 121) { + else if (token === 112 || + token === 121 || + token === 119 || + token === 113 || + token === 122) { if (angleBracketStack > 0 && !syntacticClassifierAbsent) { - token = 64; + token = 65; } } else if (token === 11) { @@ -31264,7 +33563,7 @@ var ts; if (templateStack.length > 0) { var lastTemplateStackToken = ts.lastOrUndefined(templateStack); if (lastTemplateStackToken === 11) { - token = _scanner.reScanTemplateToken(); + token = scanner.reScanTemplateToken(); if (token === 13) { templateStack.pop(); } @@ -31284,13 +33583,13 @@ var ts; } while (token !== 1); return result; function processToken() { - var start = _scanner.getTokenPos(); - var end = _scanner.getTextPos(); + var start = scanner.getTokenPos(); + var end = scanner.getTextPos(); addResult(end - start, classFromKind(token)); if (end >= text.length) { if (token === 8) { - var tokenText = _scanner.getTokenText(); - if (_scanner.isUnterminated()) { + var tokenText = scanner.getTokenText(); + if (scanner.isUnterminated()) { var lastCharIndex = tokenText.length - 1; var numBackslashes = 0; while (tokenText.charCodeAt(lastCharIndex - numBackslashes) === 92) { @@ -31305,12 +33604,12 @@ var ts; } } else if (token === 3) { - if (_scanner.isUnterminated()) { + if (scanner.isUnterminated()) { result.finalLexState = 1; } } else if (ts.isTemplateLiteralKind(token)) { - if (_scanner.isUnterminated()) { + if (scanner.isUnterminated()) { if (token === 13) { result.finalLexState = 5; } @@ -31350,8 +33649,8 @@ var ts; case 25: case 26: case 27: + case 87: case 86: - case 85: case 28: case 29: case 30: @@ -31361,18 +33660,18 @@ var ts; case 44: case 48: case 49: - case 62: - case 61: case 63: - case 58: + case 62: + case 64: case 59: case 60: - case 53: + case 61: case 54: case 55: case 56: case 57: - case 52: + case 58: + case 53: case 23: return true; default: @@ -31393,38 +33692,38 @@ var ts; } } function isKeyword(token) { - return token >= 65 && token <= 124; + return token >= 66 && token <= 125; } function classFromKind(token) { if (isKeyword(token)) { - return 1; + return TokenClass.Keyword; } else if (isBinaryExpressionOperatorToken(token) || isPrefixUnaryExpressionOperatorToken(token)) { - return 2; + return TokenClass.Operator; } - else if (token >= 14 && token <= 63) { - return 0; + else if (token >= 14 && token <= 64) { + return TokenClass.Punctuation; } switch (token) { case 7: - return 6; + return TokenClass.NumberLiteral; case 8: - return 7; + return TokenClass.StringLiteral; case 9: - return 8; + return TokenClass.RegExpLiteral; case 6: case 3: case 2: - return 3; + return TokenClass.Comment; case 5: case 4: - return 4; - case 64: + return TokenClass.Whitespace; + case 65: default: if (ts.isTemplateLiteralKind(token)) { - return 7; + return TokenClass.StringLiteral; } - return 5; + return TokenClass.Identifier; } } return { getClassificationsForLine: getClassificationsForLine }; @@ -31442,7 +33741,7 @@ var ts; getNodeConstructor: function (kind) { function Node() { } - var proto = kind === 221 ? new SourceFileObject() : new NodeObject(); + var proto = kind === 227 ? new SourceFileObject() : new NodeObject(); proto.kind = kind; proto.pos = 0; proto.end = 0; @@ -31458,6 +33757,9 @@ var ts; } initializeServices(); })(ts || (ts = {})); +// Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. +// See LICENSE.txt in the project root for complete license information. +/// var ts; (function (ts) { var BreakpointResolver; @@ -31496,98 +33798,101 @@ var ts; function spanInNode(node) { if (node) { if (ts.isExpression(node)) { - if (node.parent.kind === 179) { + if (node.parent.kind === 184) { return spanInPreviousNode(node); } - if (node.parent.kind === 181) { + if (node.parent.kind === 186) { return textSpan(node); } - if (node.parent.kind === 167 && node.parent.operatorToken.kind === 23) { + if (node.parent.kind === 169 && node.parent.operatorToken.kind === 23) { return textSpan(node); } - if (node.parent.kind == 161 && node.parent.body == node) { + if (node.parent.kind == 163 && node.parent.body == node) { return textSpan(node); } } switch (node.kind) { - case 175: + case 180: return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 193: - case 130: - case 129: - return spanInVariableDeclaration(node); - case 128: - return spanInParameterDeclaration(node); - case 195: + case 198: case 132: case 131: + return spanInVariableDeclaration(node); + case 129: + return spanInParameterDeclaration(node); + case 200: case 134: - case 135: case 133: - case 160: - case 161: + case 136: + case 137: + case 135: + case 162: + case 163: return spanInFunctionDeclaration(node); - case 174: + case 179: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } - case 201: + case 206: return spanInBlock(node); - case 217: + case 223: return spanInBlock(node.block); - case 177: - return textSpan(node.expression); - case 186: - return textSpan(node.getChildAt(0), node.expression); - case 180: - return textSpan(node, ts.findNextToken(node.expression, node)); - case 179: - return spanInNode(node.statement); - case 192: - return textSpan(node.getChildAt(0)); - case 178: - return textSpan(node, ts.findNextToken(node.expression, node)); - case 189: - return spanInNode(node.statement); - case 185: - case 184: - return textSpan(node.getChildAt(0), node.label); - case 181: - return spanInForStatement(node); 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, 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 214: - case 215: + case 193: + return textSpan(node, ts.findNextToken(node.expression, node)); + case 220: + case 221: return spanInNode(node.statements[0]); - case 191: + case 196: return spanInBlock(node.tryBlock); - case 190: + case 195: return textSpan(node, node.expression); - case 209: + case 214: + if (!node.expression) { + return undefined; + } return textSpan(node, node.expression); - case 203: + case 208: return textSpan(node, node.moduleReference); - case 204: + case 209: return textSpan(node, node.moduleSpecifier); - case 210: + case 215: return textSpan(node, node.moduleSpecifier); - case 200: + case 205: if (ts.getModuleInstanceState(node) !== 1) { return undefined; } - case 196: - case 199: - case 220: - case 155: - case 156: + case 201: + case 204: + case 226: + case 157: + case 158: return textSpan(node); - case 187: + case 192: return spanInNode(node.statement); - case 197: - case 198: + case 202: + case 203: return undefined; case 22: case 1: @@ -31607,17 +33912,17 @@ var ts; case 25: case 24: return spanInGreaterThanOrLessThanToken(node); - case 99: + case 100: return spanInWhileKeyword(node); - case 75: - case 67: - case 80: + case 76: + case 68: + case 81: return spanInNextNode(node); default: - if (node.parent.kind === 218 && node.parent.name === node) { + if (node.parent.kind === 224 && node.parent.name === node) { return spanInNode(node.parent.initializer); } - if (node.parent.kind === 158 && node.parent.type === node) { + if (node.parent.kind === 160 && node.parent.type === node) { return spanInNode(node.parent.expression); } if (ts.isFunctionLike(node.parent) && node.parent.type === node) { @@ -31627,12 +33932,12 @@ var ts; } } function spanInVariableDeclaration(variableDeclaration) { - if (variableDeclaration.parent.parent.kind === 182 || - variableDeclaration.parent.parent.kind === 183) { + if (variableDeclaration.parent.parent.kind === 187 || + variableDeclaration.parent.parent.kind === 188) { return spanInNode(variableDeclaration.parent.parent); } - var isParentVariableStatement = variableDeclaration.parent.parent.kind === 175; - var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 181 && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); + var isParentVariableStatement = variableDeclaration.parent.parent.kind === 180; + var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 186 && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); var declarations = isParentVariableStatement ? variableDeclaration.parent.parent.declarationList.declarations : isDeclarationOfForStatement @@ -31678,7 +33983,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return !!(functionDeclaration.flags & 1) || - (functionDeclaration.parent.kind === 196 && functionDeclaration.kind !== 133); + (functionDeclaration.parent.kind === 201 && functionDeclaration.kind !== 135); } function spanInFunctionDeclaration(functionDeclaration) { if (!functionDeclaration.body) { @@ -31698,23 +34003,23 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 200: + case 205: if (ts.getModuleInstanceState(block.parent) !== 1) { return undefined; } - case 180: - case 178: - case 182: + case 185: case 183: + case 187: + case 188: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); - case 181: + case 186: 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 === 194) { + if (forStatement.initializer.kind === 199) { var variableDeclarationList = forStatement.initializer; if (variableDeclarationList.declarations.length > 0) { return spanInNode(variableDeclarationList.declarations[0]); @@ -31733,34 +34038,34 @@ var ts; } function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 199: + case 204: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 196: + case 201: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 202: + case 207: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } return spanInNode(node.parent); } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 201: + case 206: if (ts.getModuleInstanceState(node.parent.parent) !== 1) { return undefined; } - case 199: - case 196: + case 204: + case 201: return textSpan(node); - case 174: + case 179: if (ts.isFunctionBlock(node.parent)) { return textSpan(node); } - case 217: + case 223: return spanInNode(node.parent.statements[node.parent.statements.length - 1]); ; - case 202: + case 207: var caseBlock = node.parent; var lastClause = caseBlock.clauses[caseBlock.clauses.length - 1]; if (lastClause) { @@ -31772,24 +34077,24 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 179) { + if (node.parent.kind === 184) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInCloseParenToken(node) { switch (node.parent.kind) { - case 160: - case 195: - case 161: - case 132: - case 131: + case 162: + case 200: + case 163: case 134: - case 135: case 133: - case 180: - case 179: - case 181: + case 136: + case 137: + case 135: + case 185: + case 184: + case 186: return spanInPreviousNode(node); default: return spanInNode(node.parent); @@ -31797,19 +34102,19 @@ var ts; return spanInNode(node.parent); } function spanInColonToken(node) { - if (ts.isFunctionLike(node.parent) || node.parent.kind === 218) { + if (ts.isFunctionLike(node.parent) || node.parent.kind === 224) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 158) { + if (node.parent.kind === 160) { return spanInNode(node.parent.expression); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 179) { + if (node.parent.kind === 184) { return textSpan(node, ts.findNextToken(node.parent.expression, node.parent)); } return spanInNode(node.parent); @@ -31819,6 +34124,21 @@ var ts; BreakpointResolver.spanInSourceFileAtLocation = spanInSourceFileAtLocation; })(BreakpointResolver = ts.BreakpointResolver || (ts.BreakpointResolver = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var debugObjectHost = this; var ts; (function (ts) { @@ -32103,6 +34423,12 @@ var ts; return _this.languageService.getReferencesAtPosition(fileName, position); }); }; + LanguageServiceShimObject.prototype.findReferences = function (fileName, position) { + var _this = this; + return this.forwardJSONCall("findReferences('" + fileName + "', " + position + ")", function () { + return _this.languageService.findReferences(fileName, position); + }); + }; LanguageServiceShimObject.prototype.getOccurrencesAtPosition = function (fileName, position) { var _this = this; return this.forwardJSONCall("getOccurrencesAtPosition('" + fileName + "', " + position + ")", function () { @@ -32312,3 +34638,4 @@ var TypeScript; Services.TypeScriptServicesFactory = ts.TypeScriptServicesFactory; })(Services = TypeScript.Services || (TypeScript.Services = {})); })(TypeScript || (TypeScript = {})); +var toolsVersion = "1.4"; diff --git a/bin/typescriptServices.d.ts b/bin/typescriptServices.d.ts index a557e814a79..972a63a67bf 100644 --- a/bin/typescriptServices.d.ts +++ b/bin/typescriptServices.d.ts @@ -74,192 +74,198 @@ declare module ts { BarBarToken = 49, QuestionToken = 50, ColonToken = 51, - EqualsToken = 52, - PlusEqualsToken = 53, - MinusEqualsToken = 54, - AsteriskEqualsToken = 55, - SlashEqualsToken = 56, - PercentEqualsToken = 57, - LessThanLessThanEqualsToken = 58, - GreaterThanGreaterThanEqualsToken = 59, - GreaterThanGreaterThanGreaterThanEqualsToken = 60, - AmpersandEqualsToken = 61, - BarEqualsToken = 62, - CaretEqualsToken = 63, - Identifier = 64, - BreakKeyword = 65, - CaseKeyword = 66, - CatchKeyword = 67, - ClassKeyword = 68, - ConstKeyword = 69, - ContinueKeyword = 70, - DebuggerKeyword = 71, - DefaultKeyword = 72, - DeleteKeyword = 73, - DoKeyword = 74, - ElseKeyword = 75, - EnumKeyword = 76, - ExportKeyword = 77, - ExtendsKeyword = 78, - FalseKeyword = 79, - FinallyKeyword = 80, - ForKeyword = 81, - FunctionKeyword = 82, - IfKeyword = 83, - ImportKeyword = 84, - InKeyword = 85, - InstanceOfKeyword = 86, - NewKeyword = 87, - NullKeyword = 88, - ReturnKeyword = 89, - SuperKeyword = 90, - SwitchKeyword = 91, - ThisKeyword = 92, - ThrowKeyword = 93, - TrueKeyword = 94, - TryKeyword = 95, - TypeOfKeyword = 96, - VarKeyword = 97, - VoidKeyword = 98, - WhileKeyword = 99, - WithKeyword = 100, - AsKeyword = 101, - ImplementsKeyword = 102, - InterfaceKeyword = 103, - LetKeyword = 104, - PackageKeyword = 105, - PrivateKeyword = 106, - ProtectedKeyword = 107, - PublicKeyword = 108, - StaticKeyword = 109, - YieldKeyword = 110, - AnyKeyword = 111, - BooleanKeyword = 112, - ConstructorKeyword = 113, - DeclareKeyword = 114, - GetKeyword = 115, - ModuleKeyword = 116, - RequireKeyword = 117, - NumberKeyword = 118, - SetKeyword = 119, - StringKeyword = 120, - SymbolKeyword = 121, - TypeKeyword = 122, - FromKeyword = 123, - OfKeyword = 124, - QualifiedName = 125, - ComputedPropertyName = 126, - TypeParameter = 127, - Parameter = 128, - PropertySignature = 129, - PropertyDeclaration = 130, - MethodSignature = 131, - MethodDeclaration = 132, - Constructor = 133, - GetAccessor = 134, - SetAccessor = 135, - CallSignature = 136, - ConstructSignature = 137, - IndexSignature = 138, - TypeReference = 139, - FunctionType = 140, - ConstructorType = 141, - TypeQuery = 142, - TypeLiteral = 143, - ArrayType = 144, - TupleType = 145, - UnionType = 146, - ParenthesizedType = 147, - ObjectBindingPattern = 148, - ArrayBindingPattern = 149, - BindingElement = 150, - ArrayLiteralExpression = 151, - ObjectLiteralExpression = 152, - PropertyAccessExpression = 153, - ElementAccessExpression = 154, - CallExpression = 155, - NewExpression = 156, - TaggedTemplateExpression = 157, - TypeAssertionExpression = 158, - ParenthesizedExpression = 159, - FunctionExpression = 160, - ArrowFunction = 161, - DeleteExpression = 162, - TypeOfExpression = 163, - VoidExpression = 164, - PrefixUnaryExpression = 165, - PostfixUnaryExpression = 166, - BinaryExpression = 167, - ConditionalExpression = 168, - TemplateExpression = 169, - YieldExpression = 170, - SpreadElementExpression = 171, - OmittedExpression = 172, - TemplateSpan = 173, - Block = 174, - VariableStatement = 175, - EmptyStatement = 176, - ExpressionStatement = 177, - IfStatement = 178, - DoStatement = 179, - WhileStatement = 180, - ForStatement = 181, - ForInStatement = 182, - ForOfStatement = 183, - ContinueStatement = 184, - BreakStatement = 185, - ReturnStatement = 186, - WithStatement = 187, - SwitchStatement = 188, - LabeledStatement = 189, - ThrowStatement = 190, - TryStatement = 191, - DebuggerStatement = 192, - VariableDeclaration = 193, - VariableDeclarationList = 194, - FunctionDeclaration = 195, - ClassDeclaration = 196, - InterfaceDeclaration = 197, - TypeAliasDeclaration = 198, - EnumDeclaration = 199, - ModuleDeclaration = 200, - ModuleBlock = 201, - CaseBlock = 202, - ImportEqualsDeclaration = 203, - ImportDeclaration = 204, - ImportClause = 205, - NamespaceImport = 206, - NamedImports = 207, - ImportSpecifier = 208, - ExportAssignment = 209, - ExportDeclaration = 210, - NamedExports = 211, - ExportSpecifier = 212, - ExternalModuleReference = 213, - CaseClause = 214, - DefaultClause = 215, - HeritageClause = 216, - CatchClause = 217, - PropertyAssignment = 218, - ShorthandPropertyAssignment = 219, - EnumMember = 220, - SourceFile = 221, - SyntaxList = 222, - Count = 223, - FirstAssignment = 52, - LastAssignment = 63, - FirstReservedWord = 65, - LastReservedWord = 100, - FirstKeyword = 65, - LastKeyword = 124, - FirstFutureReservedWord = 102, - LastFutureReservedWord = 110, - FirstTypeNode = 139, - LastTypeNode = 147, + AtToken = 52, + EqualsToken = 53, + PlusEqualsToken = 54, + MinusEqualsToken = 55, + AsteriskEqualsToken = 56, + SlashEqualsToken = 57, + PercentEqualsToken = 58, + LessThanLessThanEqualsToken = 59, + GreaterThanGreaterThanEqualsToken = 60, + GreaterThanGreaterThanGreaterThanEqualsToken = 61, + AmpersandEqualsToken = 62, + BarEqualsToken = 63, + CaretEqualsToken = 64, + Identifier = 65, + BreakKeyword = 66, + CaseKeyword = 67, + CatchKeyword = 68, + ClassKeyword = 69, + ConstKeyword = 70, + ContinueKeyword = 71, + DebuggerKeyword = 72, + DefaultKeyword = 73, + DeleteKeyword = 74, + DoKeyword = 75, + ElseKeyword = 76, + EnumKeyword = 77, + ExportKeyword = 78, + ExtendsKeyword = 79, + FalseKeyword = 80, + FinallyKeyword = 81, + ForKeyword = 82, + FunctionKeyword = 83, + IfKeyword = 84, + ImportKeyword = 85, + InKeyword = 86, + InstanceOfKeyword = 87, + NewKeyword = 88, + NullKeyword = 89, + ReturnKeyword = 90, + SuperKeyword = 91, + SwitchKeyword = 92, + ThisKeyword = 93, + ThrowKeyword = 94, + TrueKeyword = 95, + TryKeyword = 96, + TypeOfKeyword = 97, + VarKeyword = 98, + VoidKeyword = 99, + WhileKeyword = 100, + WithKeyword = 101, + AsKeyword = 102, + ImplementsKeyword = 103, + InterfaceKeyword = 104, + LetKeyword = 105, + PackageKeyword = 106, + PrivateKeyword = 107, + ProtectedKeyword = 108, + PublicKeyword = 109, + StaticKeyword = 110, + YieldKeyword = 111, + AnyKeyword = 112, + BooleanKeyword = 113, + ConstructorKeyword = 114, + 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, + FirstAssignment = 53, + LastAssignment = 64, + FirstReservedWord = 66, + LastReservedWord = 101, + FirstKeyword = 66, + LastKeyword = 125, + FirstFutureReservedWord = 103, + LastFutureReservedWord = 111, + FirstTypeNode = 141, + LastTypeNode = 149, FirstPunctuation = 14, - LastPunctuation = 63, + LastPunctuation = 64, FirstToken = 0, - LastToken = 124, + LastToken = 125, FirstTriviaToken = 2, LastTriviaToken = 6, FirstLiteralToken = 7, @@ -267,8 +273,8 @@ declare module ts { FirstTemplateToken = 10, LastTemplateToken = 13, FirstBinaryOperator = 24, - LastBinaryOperator = 63, - FirstNode = 125, + LastBinaryOperator = 64, + FirstNode = 126, } const enum NodeFlags { Export = 1, @@ -284,6 +290,7 @@ declare module ts { Let = 4096, Const = 8192, OctalLiteral = 16384, + ExportContext = 32768, Modifier = 499, AccessibilityModifier = 112, BlockScoped = 12288, @@ -293,10 +300,11 @@ declare module ts { DisallowIn = 2, Yield = 4, GeneratorParameter = 8, - ThisNodeHasError = 16, - ParserGeneratedFlags = 31, - ThisNodeOrAnySubNodesHasError = 32, - HasAggregatedChildData = 64, + Decorator = 16, + ThisNodeHasError = 32, + ParserGeneratedFlags = 63, + ThisNodeOrAnySubNodesHasError = 64, + HasAggregatedChildData = 128, } const enum RelationComparisonResult { Succeeded = 1, @@ -307,6 +315,7 @@ declare module ts { kind: SyntaxKind; flags: NodeFlags; parserContextFlags?: ParserContextFlags; + decorators?: NodeArray; modifiers?: ModifiersArray; id?: number; parent?: Node; @@ -337,6 +346,9 @@ declare module ts { interface ComputedPropertyName extends Node { expression: Expression; } + interface Decorator extends Node { + expression: LeftHandSideExpression; + } interface TypeParameterDeclaration extends Declaration { name: Identifier; constraint?: TypeNode; @@ -423,6 +435,9 @@ declare module ts { interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { body?: Block; } + interface SemicolonClassElement extends ClassElement { + _semicolonClassElementBrand: any; + } interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { _accessorDeclarationBrand: any; body: Block; @@ -516,6 +531,9 @@ declare module ts { name?: Identifier; body: Block | Expression; } + interface ArrowFunction extends Expression, FunctionLikeDeclaration { + equalsGreaterThanToken: Node; + } interface LiteralExpression extends PrimaryExpression { text: string; isUnterminated?: boolean; @@ -558,6 +576,10 @@ declare module ts { typeArguments?: NodeArray; arguments: NodeArray; } + interface HeritageClauseElement extends Node { + expression: LeftHandSideExpression; + typeArguments?: NodeArray; + } interface NewExpression extends CallExpression, PrimaryExpression { } interface TaggedTemplateExpression extends MemberExpression { @@ -652,12 +674,16 @@ declare module ts { interface ModuleElement extends Node { _moduleElementBrand: any; } - interface ClassDeclaration extends Declaration, ModuleElement { + interface ClassLikeDeclaration extends Declaration { name?: Identifier; typeParameters?: NodeArray; heritageClauses?: NodeArray; members: NodeArray; } + interface ClassDeclaration extends ClassLikeDeclaration, Statement { + } + interface ClassExpression extends ClassLikeDeclaration, PrimaryExpression { + } interface ClassElement extends Declaration { _classElementBrand: any; } @@ -669,7 +695,7 @@ declare module ts { } interface HeritageClause extends Node { token: SyntaxKind; - types?: NodeArray; + types?: NodeArray; } interface TypeAliasDeclaration extends Declaration, ModuleElement { name: Identifier; @@ -725,7 +751,8 @@ declare module ts { type ExportSpecifier = ImportOrExportSpecifier; interface ExportAssignment extends Declaration, ModuleElement { isExportEquals?: boolean; - expression: Expression; + expression?: Expression; + type?: TypeNode; } interface FileReference extends TextRange { fileName: string; @@ -760,14 +787,14 @@ declare module ts { interface Program extends ScriptReferenceHost { getSourceFiles(): SourceFile[]; /** - * Emits the javascript and declaration files. If targetSourceFile is not specified, then - * the javascript and declaration files will be produced for all the files in this program. - * If targetSourceFile is specified, then only the javascript and declaration for that + * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then + * the JavaScript and declaration files will be produced for all the files in this program. + * If targetSourceFile is specified, then only the JavaScript and declaration for that * specific file will be generated. * * If writeFile is not specified then the writeFile callback from the compiler host will be - * used for writing the javascript and declaration files. Otherwise, the writeFile parameter - * will be invoked when writing the javascript and declaration files. + * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter + * will be invoked when writing the JavaScript and declaration files. */ emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback): EmitResult; getSyntacticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; @@ -886,9 +913,10 @@ declare module ts { NotAccessible = 1, CannotBeNamed = 2, } + type AnyImportSyntax = ImportDeclaration | ImportEqualsDeclaration; interface SymbolVisibilityResult { accessibility: SymbolAccessibility; - aliasesToMakeVisible?: ImportEqualsDeclaration[]; + aliasesToMakeVisible?: AnyImportSyntax[]; errorSymbolName?: string; errorNode?: Node; } @@ -896,20 +924,22 @@ declare module ts { errorModuleName?: string; } interface EmitResolver { - getGeneratedNameForNode(node: Node): string; - getExpressionNameSubstitution(node: Identifier): string; - hasExportDefaultValue(node: SourceFile): boolean; - isReferencedAliasDeclaration(node: Node): boolean; + hasGlobalName(name: string): boolean; + getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string; + isValueAliasDeclaration(node: Node): boolean; + isReferencedAliasDeclaration(node: Node, checkChildren?: boolean): boolean; isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; getNodeCheckFlags(node: Node): NodeCheckFlags; isDeclarationVisible(node: Declaration): boolean; + collectLinkedAliases(node: Identifier): Node[]; isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; + writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult; - isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult; + isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult; getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; - isUnknownIdentifier(location: Node, name: string): boolean; + resolvesToSomeValue(location: Node, name: string): boolean; getBlockScopedVariableId(node: Identifier): number; } const enum SymbolFlags { @@ -1016,6 +1046,7 @@ declare module ts { ContextChecked = 64, EnumValuesComputed = 128, BlockScopedBindingInLoop = 256, + EmitDecorate = 512, } interface NodeLinks { resolvedType?: Type; @@ -1135,17 +1166,6 @@ declare module ts { interface TypeMapper { (t: Type): Type; } - interface TypeInferences { - primary: Type[]; - secondary: Type[]; - } - interface InferenceContext { - typeParameters: TypeParameter[]; - inferUnionTypes: boolean; - inferences: TypeInferences[]; - inferredTypes: Type[]; - failedTypeParameterIndex?: number; - } interface DiagnosticMessage { key: string; category: DiagnosticCategory; @@ -1173,7 +1193,6 @@ declare module ts { interface CompilerOptions { allowNonTsExtensions?: boolean; charset?: string; - codepage?: number; declaration?: boolean; diagnostics?: boolean; emitBOM?: boolean; @@ -1187,7 +1206,6 @@ declare module ts { noErrorTruncation?: boolean; noImplicitAny?: boolean; noLib?: boolean; - noLibCheck?: boolean; noResolve?: boolean; out?: string; outDir?: string; @@ -1200,6 +1218,7 @@ declare module ts { target?: ScriptTarget; version?: boolean; watch?: boolean; + separateCompilation?: boolean; [option: string]: string | number | boolean; } const enum ModuleKind { @@ -1442,11 +1461,26 @@ declare module ts { declare module ts { /** The version of the TypeScript compiler release */ let version: string; - function createCompilerHost(options: CompilerOptions): CompilerHost; + function findConfigFile(searchPath: string): string; + function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; function getPreEmitDiagnostics(program: Program): Diagnostic[]; function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; } +declare module ts { + /** + * Read tsconfig.json file + * @param fileName The path to the config file + */ + function readConfigFile(fileName: string): any; + /** + * 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; +} declare module ts { /** The version of the language service API */ let servicesVersion: string; @@ -1556,6 +1590,7 @@ declare module ts { getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; + findReferences(fileName: string, position: number): ReferencedSymbol[]; getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[]; getNavigationBarItems(fileName: string): NavigationBarItem[]; getOutliningSpans(fileName: string): OutliningSpan[]; @@ -1642,6 +1677,10 @@ declare module ts { containerKind: string; containerName: string; } + interface ReferencedSymbol { + definition: DefinitionInfo; + references: ReferenceEntry[]; + } enum SymbolDisplayPartKind { aliasName = 0, className = 1, @@ -1935,6 +1974,7 @@ declare module ts { isCancellationRequested(): boolean; throwIfCancellationRequested(): void; } + function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[]): string; function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile; let disableIncrementalParsing: boolean; function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; diff --git a/bin/typescriptServices.js b/bin/typescriptServices.js index 9e939631006..0ea54239508 100644 --- a/bin/typescriptServices.js +++ b/bin/typescriptServices.js @@ -68,192 +68,198 @@ var ts; SyntaxKind[SyntaxKind["BarBarToken"] = 49] = "BarBarToken"; SyntaxKind[SyntaxKind["QuestionToken"] = 50] = "QuestionToken"; SyntaxKind[SyntaxKind["ColonToken"] = 51] = "ColonToken"; - SyntaxKind[SyntaxKind["EqualsToken"] = 52] = "EqualsToken"; - SyntaxKind[SyntaxKind["PlusEqualsToken"] = 53] = "PlusEqualsToken"; - SyntaxKind[SyntaxKind["MinusEqualsToken"] = 54] = "MinusEqualsToken"; - SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 55] = "AsteriskEqualsToken"; - SyntaxKind[SyntaxKind["SlashEqualsToken"] = 56] = "SlashEqualsToken"; - SyntaxKind[SyntaxKind["PercentEqualsToken"] = 57] = "PercentEqualsToken"; - SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 58] = "LessThanLessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 59] = "GreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 60] = "GreaterThanGreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 61] = "AmpersandEqualsToken"; - SyntaxKind[SyntaxKind["BarEqualsToken"] = 62] = "BarEqualsToken"; - SyntaxKind[SyntaxKind["CaretEqualsToken"] = 63] = "CaretEqualsToken"; - SyntaxKind[SyntaxKind["Identifier"] = 64] = "Identifier"; - SyntaxKind[SyntaxKind["BreakKeyword"] = 65] = "BreakKeyword"; - SyntaxKind[SyntaxKind["CaseKeyword"] = 66] = "CaseKeyword"; - SyntaxKind[SyntaxKind["CatchKeyword"] = 67] = "CatchKeyword"; - SyntaxKind[SyntaxKind["ClassKeyword"] = 68] = "ClassKeyword"; - SyntaxKind[SyntaxKind["ConstKeyword"] = 69] = "ConstKeyword"; - SyntaxKind[SyntaxKind["ContinueKeyword"] = 70] = "ContinueKeyword"; - SyntaxKind[SyntaxKind["DebuggerKeyword"] = 71] = "DebuggerKeyword"; - SyntaxKind[SyntaxKind["DefaultKeyword"] = 72] = "DefaultKeyword"; - SyntaxKind[SyntaxKind["DeleteKeyword"] = 73] = "DeleteKeyword"; - SyntaxKind[SyntaxKind["DoKeyword"] = 74] = "DoKeyword"; - SyntaxKind[SyntaxKind["ElseKeyword"] = 75] = "ElseKeyword"; - SyntaxKind[SyntaxKind["EnumKeyword"] = 76] = "EnumKeyword"; - SyntaxKind[SyntaxKind["ExportKeyword"] = 77] = "ExportKeyword"; - SyntaxKind[SyntaxKind["ExtendsKeyword"] = 78] = "ExtendsKeyword"; - SyntaxKind[SyntaxKind["FalseKeyword"] = 79] = "FalseKeyword"; - SyntaxKind[SyntaxKind["FinallyKeyword"] = 80] = "FinallyKeyword"; - SyntaxKind[SyntaxKind["ForKeyword"] = 81] = "ForKeyword"; - SyntaxKind[SyntaxKind["FunctionKeyword"] = 82] = "FunctionKeyword"; - SyntaxKind[SyntaxKind["IfKeyword"] = 83] = "IfKeyword"; - SyntaxKind[SyntaxKind["ImportKeyword"] = 84] = "ImportKeyword"; - SyntaxKind[SyntaxKind["InKeyword"] = 85] = "InKeyword"; - SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 86] = "InstanceOfKeyword"; - SyntaxKind[SyntaxKind["NewKeyword"] = 87] = "NewKeyword"; - SyntaxKind[SyntaxKind["NullKeyword"] = 88] = "NullKeyword"; - SyntaxKind[SyntaxKind["ReturnKeyword"] = 89] = "ReturnKeyword"; - SyntaxKind[SyntaxKind["SuperKeyword"] = 90] = "SuperKeyword"; - SyntaxKind[SyntaxKind["SwitchKeyword"] = 91] = "SwitchKeyword"; - SyntaxKind[SyntaxKind["ThisKeyword"] = 92] = "ThisKeyword"; - SyntaxKind[SyntaxKind["ThrowKeyword"] = 93] = "ThrowKeyword"; - SyntaxKind[SyntaxKind["TrueKeyword"] = 94] = "TrueKeyword"; - SyntaxKind[SyntaxKind["TryKeyword"] = 95] = "TryKeyword"; - SyntaxKind[SyntaxKind["TypeOfKeyword"] = 96] = "TypeOfKeyword"; - SyntaxKind[SyntaxKind["VarKeyword"] = 97] = "VarKeyword"; - SyntaxKind[SyntaxKind["VoidKeyword"] = 98] = "VoidKeyword"; - SyntaxKind[SyntaxKind["WhileKeyword"] = 99] = "WhileKeyword"; - SyntaxKind[SyntaxKind["WithKeyword"] = 100] = "WithKeyword"; - SyntaxKind[SyntaxKind["AsKeyword"] = 101] = "AsKeyword"; - SyntaxKind[SyntaxKind["ImplementsKeyword"] = 102] = "ImplementsKeyword"; - SyntaxKind[SyntaxKind["InterfaceKeyword"] = 103] = "InterfaceKeyword"; - SyntaxKind[SyntaxKind["LetKeyword"] = 104] = "LetKeyword"; - SyntaxKind[SyntaxKind["PackageKeyword"] = 105] = "PackageKeyword"; - SyntaxKind[SyntaxKind["PrivateKeyword"] = 106] = "PrivateKeyword"; - SyntaxKind[SyntaxKind["ProtectedKeyword"] = 107] = "ProtectedKeyword"; - SyntaxKind[SyntaxKind["PublicKeyword"] = 108] = "PublicKeyword"; - SyntaxKind[SyntaxKind["StaticKeyword"] = 109] = "StaticKeyword"; - SyntaxKind[SyntaxKind["YieldKeyword"] = 110] = "YieldKeyword"; - SyntaxKind[SyntaxKind["AnyKeyword"] = 111] = "AnyKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 112] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 113] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 114] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 115] = "GetKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 116] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 117] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 118] = "NumberKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 119] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 120] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 121] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 122] = "TypeKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 123] = "FromKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 124] = "OfKeyword"; - SyntaxKind[SyntaxKind["QualifiedName"] = 125] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 126] = "ComputedPropertyName"; - SyntaxKind[SyntaxKind["TypeParameter"] = 127] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 128] = "Parameter"; - SyntaxKind[SyntaxKind["PropertySignature"] = 129] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 130] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 131] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 132] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 133] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 134] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 135] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 136] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 137] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 138] = "IndexSignature"; - SyntaxKind[SyntaxKind["TypeReference"] = 139] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 140] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 141] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 142] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 143] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 144] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 145] = "TupleType"; - SyntaxKind[SyntaxKind["UnionType"] = 146] = "UnionType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 147] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 148] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 149] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 150] = "BindingElement"; - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 151] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 152] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 153] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 154] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 155] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 156] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 157] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 158] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 159] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 160] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 161] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 162] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 163] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 164] = "VoidExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 165] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 166] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 167] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 168] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 169] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 170] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElementExpression"] = 171] = "SpreadElementExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 172] = "OmittedExpression"; - SyntaxKind[SyntaxKind["TemplateSpan"] = 173] = "TemplateSpan"; - SyntaxKind[SyntaxKind["Block"] = 174] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 175] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 176] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 177] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 178] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 179] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 180] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 181] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 182] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 183] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 184] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 185] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 186] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 187] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 188] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 189] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 190] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 191] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 192] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 193] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 194] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 195] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 196] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 197] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 198] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 199] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 200] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 201] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 202] = "CaseBlock"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 203] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 204] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 205] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 206] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 207] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 208] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 209] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 210] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 211] = "NamedExports"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 212] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 213] = "ExternalModuleReference"; - SyntaxKind[SyntaxKind["CaseClause"] = 214] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 215] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 216] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 217] = "CatchClause"; - SyntaxKind[SyntaxKind["PropertyAssignment"] = 218] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 219] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["EnumMember"] = 220] = "EnumMember"; - SyntaxKind[SyntaxKind["SourceFile"] = 221] = "SourceFile"; - SyntaxKind[SyntaxKind["SyntaxList"] = 222] = "SyntaxList"; - SyntaxKind[SyntaxKind["Count"] = 223] = "Count"; - SyntaxKind[SyntaxKind["FirstAssignment"] = 52] = "FirstAssignment"; - SyntaxKind[SyntaxKind["LastAssignment"] = 63] = "LastAssignment"; - SyntaxKind[SyntaxKind["FirstReservedWord"] = 65] = "FirstReservedWord"; - SyntaxKind[SyntaxKind["LastReservedWord"] = 100] = "LastReservedWord"; - SyntaxKind[SyntaxKind["FirstKeyword"] = 65] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 124] = "LastKeyword"; - SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 102] = "FirstFutureReservedWord"; - SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 110] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 139] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 147] = "LastTypeNode"; + SyntaxKind[SyntaxKind["AtToken"] = 52] = "AtToken"; + SyntaxKind[SyntaxKind["EqualsToken"] = 53] = "EqualsToken"; + SyntaxKind[SyntaxKind["PlusEqualsToken"] = 54] = "PlusEqualsToken"; + SyntaxKind[SyntaxKind["MinusEqualsToken"] = 55] = "MinusEqualsToken"; + SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 56] = "AsteriskEqualsToken"; + SyntaxKind[SyntaxKind["SlashEqualsToken"] = 57] = "SlashEqualsToken"; + SyntaxKind[SyntaxKind["PercentEqualsToken"] = 58] = "PercentEqualsToken"; + SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 59] = "LessThanLessThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 60] = "GreaterThanGreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 61] = "GreaterThanGreaterThanGreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 62] = "AmpersandEqualsToken"; + SyntaxKind[SyntaxKind["BarEqualsToken"] = 63] = "BarEqualsToken"; + SyntaxKind[SyntaxKind["CaretEqualsToken"] = 64] = "CaretEqualsToken"; + SyntaxKind[SyntaxKind["Identifier"] = 65] = "Identifier"; + SyntaxKind[SyntaxKind["BreakKeyword"] = 66] = "BreakKeyword"; + SyntaxKind[SyntaxKind["CaseKeyword"] = 67] = "CaseKeyword"; + SyntaxKind[SyntaxKind["CatchKeyword"] = 68] = "CatchKeyword"; + SyntaxKind[SyntaxKind["ClassKeyword"] = 69] = "ClassKeyword"; + SyntaxKind[SyntaxKind["ConstKeyword"] = 70] = "ConstKeyword"; + SyntaxKind[SyntaxKind["ContinueKeyword"] = 71] = "ContinueKeyword"; + SyntaxKind[SyntaxKind["DebuggerKeyword"] = 72] = "DebuggerKeyword"; + SyntaxKind[SyntaxKind["DefaultKeyword"] = 73] = "DefaultKeyword"; + SyntaxKind[SyntaxKind["DeleteKeyword"] = 74] = "DeleteKeyword"; + SyntaxKind[SyntaxKind["DoKeyword"] = 75] = "DoKeyword"; + SyntaxKind[SyntaxKind["ElseKeyword"] = 76] = "ElseKeyword"; + SyntaxKind[SyntaxKind["EnumKeyword"] = 77] = "EnumKeyword"; + SyntaxKind[SyntaxKind["ExportKeyword"] = 78] = "ExportKeyword"; + SyntaxKind[SyntaxKind["ExtendsKeyword"] = 79] = "ExtendsKeyword"; + SyntaxKind[SyntaxKind["FalseKeyword"] = 80] = "FalseKeyword"; + SyntaxKind[SyntaxKind["FinallyKeyword"] = 81] = "FinallyKeyword"; + SyntaxKind[SyntaxKind["ForKeyword"] = 82] = "ForKeyword"; + SyntaxKind[SyntaxKind["FunctionKeyword"] = 83] = "FunctionKeyword"; + SyntaxKind[SyntaxKind["IfKeyword"] = 84] = "IfKeyword"; + SyntaxKind[SyntaxKind["ImportKeyword"] = 85] = "ImportKeyword"; + SyntaxKind[SyntaxKind["InKeyword"] = 86] = "InKeyword"; + SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 87] = "InstanceOfKeyword"; + SyntaxKind[SyntaxKind["NewKeyword"] = 88] = "NewKeyword"; + SyntaxKind[SyntaxKind["NullKeyword"] = 89] = "NullKeyword"; + SyntaxKind[SyntaxKind["ReturnKeyword"] = 90] = "ReturnKeyword"; + SyntaxKind[SyntaxKind["SuperKeyword"] = 91] = "SuperKeyword"; + SyntaxKind[SyntaxKind["SwitchKeyword"] = 92] = "SwitchKeyword"; + SyntaxKind[SyntaxKind["ThisKeyword"] = 93] = "ThisKeyword"; + SyntaxKind[SyntaxKind["ThrowKeyword"] = 94] = "ThrowKeyword"; + SyntaxKind[SyntaxKind["TrueKeyword"] = 95] = "TrueKeyword"; + SyntaxKind[SyntaxKind["TryKeyword"] = 96] = "TryKeyword"; + SyntaxKind[SyntaxKind["TypeOfKeyword"] = 97] = "TypeOfKeyword"; + SyntaxKind[SyntaxKind["VarKeyword"] = 98] = "VarKeyword"; + SyntaxKind[SyntaxKind["VoidKeyword"] = 99] = "VoidKeyword"; + SyntaxKind[SyntaxKind["WhileKeyword"] = 100] = "WhileKeyword"; + SyntaxKind[SyntaxKind["WithKeyword"] = 101] = "WithKeyword"; + SyntaxKind[SyntaxKind["AsKeyword"] = 102] = "AsKeyword"; + SyntaxKind[SyntaxKind["ImplementsKeyword"] = 103] = "ImplementsKeyword"; + SyntaxKind[SyntaxKind["InterfaceKeyword"] = 104] = "InterfaceKeyword"; + SyntaxKind[SyntaxKind["LetKeyword"] = 105] = "LetKeyword"; + SyntaxKind[SyntaxKind["PackageKeyword"] = 106] = "PackageKeyword"; + SyntaxKind[SyntaxKind["PrivateKeyword"] = 107] = "PrivateKeyword"; + SyntaxKind[SyntaxKind["ProtectedKeyword"] = 108] = "ProtectedKeyword"; + SyntaxKind[SyntaxKind["PublicKeyword"] = 109] = "PublicKeyword"; + SyntaxKind[SyntaxKind["StaticKeyword"] = 110] = "StaticKeyword"; + SyntaxKind[SyntaxKind["YieldKeyword"] = 111] = "YieldKeyword"; + SyntaxKind[SyntaxKind["AnyKeyword"] = 112] = "AnyKeyword"; + SyntaxKind[SyntaxKind["BooleanKeyword"] = 113] = "BooleanKeyword"; + SyntaxKind[SyntaxKind["ConstructorKeyword"] = 114] = "ConstructorKeyword"; + 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["QualifiedName"] = 126] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 127] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["TypeParameter"] = 128] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 129] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 130] = "Decorator"; + 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["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["ObjectBindingPattern"] = 150] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 151] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 152] = "BindingElement"; + 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["TemplateSpan"] = 176] = "TemplateSpan"; + SyntaxKind[SyntaxKind["HeritageClauseElement"] = 177] = "HeritageClauseElement"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 178] = "SemicolonClassElement"; + 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["ExternalModuleReference"] = 219] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["CaseClause"] = 220] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 221] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 222] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 223] = "CatchClause"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 224] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 225] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["EnumMember"] = 226] = "EnumMember"; + SyntaxKind[SyntaxKind["SourceFile"] = 227] = "SourceFile"; + SyntaxKind[SyntaxKind["SyntaxList"] = 228] = "SyntaxList"; + SyntaxKind[SyntaxKind["Count"] = 229] = "Count"; + 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["FirstFutureReservedWord"] = 103] = "FirstFutureReservedWord"; + SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 111] = "LastFutureReservedWord"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 141] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 149] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 14] = "FirstPunctuation"; - SyntaxKind[SyntaxKind["LastPunctuation"] = 63] = "LastPunctuation"; + SyntaxKind[SyntaxKind["LastPunctuation"] = 64] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 124] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 125] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 6] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 7] = "FirstLiteralToken"; @@ -261,8 +267,8 @@ var ts; SyntaxKind[SyntaxKind["FirstTemplateToken"] = 10] = "FirstTemplateToken"; SyntaxKind[SyntaxKind["LastTemplateToken"] = 13] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 24] = "FirstBinaryOperator"; - SyntaxKind[SyntaxKind["LastBinaryOperator"] = 63] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstNode"] = 125] = "FirstNode"; + SyntaxKind[SyntaxKind["LastBinaryOperator"] = 64] = "LastBinaryOperator"; + SyntaxKind[SyntaxKind["FirstNode"] = 126] = "FirstNode"; })(ts.SyntaxKind || (ts.SyntaxKind = {})); var SyntaxKind = ts.SyntaxKind; (function (NodeFlags) { @@ -279,6 +285,7 @@ var ts; NodeFlags[NodeFlags["Let"] = 4096] = "Let"; NodeFlags[NodeFlags["Const"] = 8192] = "Const"; NodeFlags[NodeFlags["OctalLiteral"] = 16384] = "OctalLiteral"; + NodeFlags[NodeFlags["ExportContext"] = 32768] = "ExportContext"; NodeFlags[NodeFlags["Modifier"] = 499] = "Modifier"; NodeFlags[NodeFlags["AccessibilityModifier"] = 112] = "AccessibilityModifier"; NodeFlags[NodeFlags["BlockScoped"] = 12288] = "BlockScoped"; @@ -289,10 +296,11 @@ var ts; ParserContextFlags[ParserContextFlags["DisallowIn"] = 2] = "DisallowIn"; ParserContextFlags[ParserContextFlags["Yield"] = 4] = "Yield"; ParserContextFlags[ParserContextFlags["GeneratorParameter"] = 8] = "GeneratorParameter"; - ParserContextFlags[ParserContextFlags["ThisNodeHasError"] = 16] = "ThisNodeHasError"; - ParserContextFlags[ParserContextFlags["ParserGeneratedFlags"] = 31] = "ParserGeneratedFlags"; - ParserContextFlags[ParserContextFlags["ThisNodeOrAnySubNodesHasError"] = 32] = "ThisNodeOrAnySubNodesHasError"; - ParserContextFlags[ParserContextFlags["HasAggregatedChildData"] = 64] = "HasAggregatedChildData"; + ParserContextFlags[ParserContextFlags["Decorator"] = 16] = "Decorator"; + ParserContextFlags[ParserContextFlags["ThisNodeHasError"] = 32] = "ThisNodeHasError"; + ParserContextFlags[ParserContextFlags["ParserGeneratedFlags"] = 63] = "ParserGeneratedFlags"; + ParserContextFlags[ParserContextFlags["ThisNodeOrAnySubNodesHasError"] = 64] = "ThisNodeOrAnySubNodesHasError"; + ParserContextFlags[ParserContextFlags["HasAggregatedChildData"] = 128] = "HasAggregatedChildData"; })(ts.ParserContextFlags || (ts.ParserContextFlags = {})); var ParserContextFlags = ts.ParserContextFlags; (function (RelationComparisonResult) { @@ -408,6 +416,7 @@ var ts; NodeCheckFlags[NodeCheckFlags["ContextChecked"] = 64] = "ContextChecked"; NodeCheckFlags[NodeCheckFlags["EnumValuesComputed"] = 128] = "EnumValuesComputed"; NodeCheckFlags[NodeCheckFlags["BlockScopedBindingInLoop"] = 256] = "BlockScopedBindingInLoop"; + NodeCheckFlags[NodeCheckFlags["EmitDecorate"] = 512] = "EmitDecorate"; })(ts.NodeCheckFlags || (ts.NodeCheckFlags = {})); var NodeCheckFlags = ts.NodeCheckFlags; (function (TypeFlags) { @@ -597,6 +606,7 @@ var ts; })(ts.CharacterCodes || (ts.CharacterCodes = {})); var CharacterCodes = ts.CharacterCodes; })(ts || (ts = {})); +/// var ts; (function (ts) { (function (Ternary) { @@ -625,7 +635,7 @@ var ts; ts.forEach = forEach; function contains(array, value) { if (array) { - for (var _i = 0, _n = array.length; _i < _n; _i++) { + for (var _i = 0; _i < array.length; _i++) { var v = array[_i]; if (v === value) { return true; @@ -649,7 +659,7 @@ var ts; function countWhere(array, predicate) { var count = 0; if (array) { - for (var _i = 0, _n = array.length; _i < _n; _i++) { + for (var _i = 0; _i < array.length; _i++) { var v = array[_i]; if (predicate(v)) { count++; @@ -663,10 +673,10 @@ var ts; var result; if (array) { result = []; - for (var _i = 0, _n = array.length; _i < _n; _i++) { - var _item = array[_i]; - if (f(_item)) { - result.push(_item); + for (var _i = 0; _i < array.length; _i++) { + var item_1 = array[_i]; + if (f(item_1)) { + result.push(item_1); } } } @@ -677,7 +687,7 @@ var ts; var result; if (array) { result = []; - for (var _i = 0, _n = array.length; _i < _n; _i++) { + for (var _i = 0; _i < array.length; _i++) { var v = array[_i]; result.push(f(v)); } @@ -697,10 +707,10 @@ var ts; var result; if (array) { result = []; - for (var _i = 0, _n = array.length; _i < _n; _i++) { - var _item = array[_i]; - if (!contains(result, _item)) { - result.push(_item); + for (var _i = 0; _i < array.length; _i++) { + var item_2 = array[_i]; + if (!contains(result, item_2)) { + result.push(item_2); } } } @@ -709,7 +719,7 @@ var ts; ts.deduplicate = deduplicate; function sum(array, prop) { var result = 0; - for (var _i = 0, _n = array.length; _i < _n; _i++) { + for (var _i = 0; _i < array.length; _i++) { var v = array[_i]; result += v[prop]; } @@ -717,9 +727,11 @@ var ts; } ts.sum = sum; function addRange(to, from) { - for (var _i = 0, _n = from.length; _i < _n; _i++) { - var v = from[_i]; - to.push(v); + if (to && from) { + for (var _i = 0; _i < from.length; _i++) { + var v = from[_i]; + to.push(v); + } } } ts.addRange = addRange; @@ -749,6 +761,35 @@ var ts; return ~low; } ts.binarySearch = binarySearch; + function reduceLeft(array, f, initial) { + if (array) { + var count = array.length; + if (count > 0) { + var pos = 0; + var result = arguments.length <= 2 ? array[pos++] : initial; + while (pos < count) { + result = f(result, array[pos++]); + } + return result; + } + } + return initial; + } + ts.reduceLeft = reduceLeft; + function reduceRight(array, f, initial) { + if (array) { + var pos = array.length - 1; + if (pos >= 0) { + var result = arguments.length <= 2 ? array[pos--] : initial; + while (pos >= 0) { + result = f(result, array[pos--]); + } + return result; + } + } + return initial; + } + ts.reduceRight = reduceRight; var hasOwnProperty = Object.prototype.hasOwnProperty; function hasProperty(map, key) { return hasOwnProperty.call(map, key); @@ -780,9 +821,9 @@ var ts; for (var id in first) { result[id] = first[id]; } - for (var _id in second) { - if (!hasProperty(result, _id)) { - result[_id] = second[_id]; + for (var id in second) { + if (!hasProperty(result, id)) { + result[id] = second[id]; } } return result; @@ -810,14 +851,6 @@ var ts; return hasProperty(map, key) ? map[key] : undefined; } ts.lookUp = lookUp; - function mapToArray(map) { - var result = []; - for (var id in map) { - result.push(map[id]); - } - return result; - } - ts.mapToArray = mapToArray; function copyMap(source, target) { for (var p in source) { target[p] = source[p]; @@ -984,7 +1017,7 @@ var ts; function getNormalizedParts(normalizedSlashedPath, rootLength) { var parts = normalizedSlashedPath.substr(rootLength).split(ts.directorySeparator); var normalized = []; - for (var _i = 0, _n = parts.length; _i < _n; _i++) { + for (var _i = 0; _i < parts.length; _i++) { var part = parts[_i]; if (part !== ".") { if (part === ".." && normalized.length > 0 && normalized[normalized.length - 1] !== "..") { @@ -1043,6 +1076,9 @@ var ts; } ts.getNormalizedPathFromPathComponents = getNormalizedPathFromPathComponents; function getNormalizedPathComponentsOfUrl(url) { + // Get root length of http://www.website.com/folder1/foler2/ + // In this example the root is: http://www.website.com/ + // normalized path components should be ["http://www.website.com/", "folder1", "folder2"] var urlLength = url.length; var rootLength = url.indexOf("://") + "://".length; while (rootLength < urlLength) { @@ -1126,7 +1162,7 @@ var ts; ts.fileExtensionIs = fileExtensionIs; var supportedExtensions = [".d.ts", ".ts", ".js"]; function removeFileExtension(path) { - for (var _i = 0, _n = supportedExtensions.length; _i < _n; _i++) { + for (var _i = 0; _i < supportedExtensions.length; _i++) { var ext = supportedExtensions[_i]; if (fileExtensionIs(path, ext)) { return path.substr(0, path.length - ext.length); @@ -1212,6 +1248,7 @@ var ts; Debug.fail = fail; })(Debug = ts.Debug || (ts.Debug = {})); })(ts || (ts = {})); +/// var ts; (function (ts) { ts.sys = (function () { @@ -1285,14 +1322,14 @@ var ts; function visitDirectory(path) { var folder = fso.GetFolder(path || "."); var files = getNames(folder.files); - for (var _i = 0, _n = files.length; _i < _n; _i++) { - var _name = files[_i]; - if (!extension || ts.fileExtensionIs(_name, extension)) { - result.push(ts.combinePaths(path, _name)); + for (var _i = 0; _i < files.length; _i++) { + var name_1 = files[_i]; + if (!extension || ts.fileExtensionIs(name_1, extension)) { + result.push(ts.combinePaths(path, name_1)); } } var subfolders = getNames(folder.subfolders); - for (var _a = 0, _b = subfolders.length; _a < _b; _a++) { + for (var _a = 0; _a < subfolders.length; _a++) { var current = subfolders[_a]; visitDirectory(ts.combinePaths(path, current)); } @@ -1379,7 +1416,7 @@ var ts; function visitDirectory(path) { var files = _fs.readdirSync(path || ".").sort(); var directories = []; - for (var _i = 0, _n = files.length; _i < _n; _i++) { + for (var _i = 0; _i < files.length; _i++) { var current = files[_i]; var name = ts.combinePaths(path, current); var stat = _fs.lstatSync(name); @@ -1392,9 +1429,9 @@ var ts; directories.push(name); } } - for (var _a = 0, _b = directories.length; _a < _b; _a++) { - var _current = directories[_a]; - visitDirectory(_current); + for (var _a = 0; _a < directories.length; _a++) { + var current = directories[_a]; + visitDirectory(current); } } } @@ -1463,559 +1500,585 @@ var ts; } })(); })(ts || (ts = {})); +/// var ts; (function (ts) { ts.Diagnostics = { - Unterminated_string_literal: { code: 1002, category: 1, key: "Unterminated string literal." }, - Identifier_expected: { code: 1003, category: 1, key: "Identifier expected." }, - _0_expected: { code: 1005, category: 1, key: "'{0}' expected." }, - A_file_cannot_have_a_reference_to_itself: { code: 1006, category: 1, key: "A file cannot have a reference to itself." }, - Trailing_comma_not_allowed: { code: 1009, category: 1, key: "Trailing comma not allowed." }, - Asterisk_Slash_expected: { code: 1010, category: 1, key: "'*/' expected." }, - Unexpected_token: { code: 1012, category: 1, key: "Unexpected token." }, - A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: 1, key: "A rest parameter must be last in a parameter list." }, - Parameter_cannot_have_question_mark_and_initializer: { code: 1015, category: 1, key: "Parameter cannot have question mark and initializer." }, - A_required_parameter_cannot_follow_an_optional_parameter: { code: 1016, category: 1, key: "A required parameter cannot follow an optional parameter." }, - An_index_signature_cannot_have_a_rest_parameter: { code: 1017, category: 1, key: "An index signature cannot have a rest parameter." }, - An_index_signature_parameter_cannot_have_an_accessibility_modifier: { code: 1018, category: 1, key: "An index signature parameter cannot have an accessibility modifier." }, - An_index_signature_parameter_cannot_have_a_question_mark: { code: 1019, category: 1, key: "An index signature parameter cannot have a question mark." }, - An_index_signature_parameter_cannot_have_an_initializer: { code: 1020, category: 1, key: "An index signature parameter cannot have an initializer." }, - An_index_signature_must_have_a_type_annotation: { code: 1021, category: 1, key: "An index signature must have a type annotation." }, - An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: 1, key: "An index signature parameter must have a type annotation." }, - An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: 1, key: "An index signature parameter type must be 'string' or 'number'." }, - A_class_or_interface_declaration_can_only_have_one_extends_clause: { code: 1024, category: 1, key: "A class or interface declaration can only have one 'extends' clause." }, - An_extends_clause_must_precede_an_implements_clause: { code: 1025, category: 1, key: "An 'extends' clause must precede an 'implements' clause." }, - A_class_can_only_extend_a_single_class: { code: 1026, category: 1, key: "A class can only extend a single class." }, - A_class_declaration_can_only_have_one_implements_clause: { code: 1027, category: 1, key: "A class declaration can only have one 'implements' clause." }, - Accessibility_modifier_already_seen: { code: 1028, category: 1, key: "Accessibility modifier already seen." }, - _0_modifier_must_precede_1_modifier: { code: 1029, category: 1, key: "'{0}' modifier must precede '{1}' modifier." }, - _0_modifier_already_seen: { code: 1030, category: 1, key: "'{0}' modifier already seen." }, - _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: 1, key: "'{0}' modifier cannot appear on a class element." }, - An_interface_declaration_cannot_have_an_implements_clause: { code: 1032, category: 1, key: "An interface declaration cannot have an 'implements' clause." }, - super_must_be_followed_by_an_argument_list_or_member_access: { code: 1034, category: 1, key: "'super' must be followed by an argument list or member access." }, - Only_ambient_modules_can_use_quoted_names: { code: 1035, category: 1, key: "Only ambient modules can use quoted names." }, - Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: 1, key: "Statements are not allowed in ambient contexts." }, - A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { code: 1038, category: 1, key: "A 'declare' modifier cannot be used in an already ambient context." }, - Initializers_are_not_allowed_in_ambient_contexts: { code: 1039, category: 1, key: "Initializers are not allowed in ambient contexts." }, - _0_modifier_cannot_appear_on_a_module_element: { code: 1044, category: 1, key: "'{0}' modifier cannot appear on a module element." }, - A_declare_modifier_cannot_be_used_with_an_interface_declaration: { code: 1045, category: 1, key: "A 'declare' modifier cannot be used with an interface declaration." }, - A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { code: 1046, category: 1, key: "A 'declare' modifier is required for a top level declaration in a .d.ts file." }, - A_rest_parameter_cannot_be_optional: { code: 1047, category: 1, key: "A rest parameter cannot be optional." }, - A_rest_parameter_cannot_have_an_initializer: { code: 1048, category: 1, key: "A rest parameter cannot have an initializer." }, - A_set_accessor_must_have_exactly_one_parameter: { code: 1049, category: 1, key: "A 'set' accessor must have exactly one parameter." }, - A_set_accessor_cannot_have_an_optional_parameter: { code: 1051, category: 1, key: "A 'set' accessor cannot have an optional parameter." }, - A_set_accessor_parameter_cannot_have_an_initializer: { code: 1052, category: 1, key: "A 'set' accessor parameter cannot have an initializer." }, - A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: 1, key: "A 'set' accessor cannot have rest parameter." }, - A_get_accessor_cannot_have_parameters: { code: 1054, category: 1, key: "A 'get' accessor cannot have parameters." }, - Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: 1, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, - Enum_member_must_have_initializer: { code: 1061, category: 1, key: "Enum member must have initializer." }, - An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: 1, key: "An export assignment cannot be used in an internal module." }, - Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: 1, key: "Ambient enum elements can only have integer literal initializers." }, - Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: 1, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, - A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: 1, key: "A 'declare' modifier cannot be used with an import declaration." }, - Invalid_reference_directive_syntax: { code: 1084, category: 1, key: "Invalid 'reference' directive syntax." }, - Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: 1, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, - An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: 1, key: "An accessor cannot be declared in an ambient context." }, - _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: 1, key: "'{0}' modifier cannot appear on a constructor declaration." }, - _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: 1, key: "'{0}' modifier cannot appear on a parameter." }, - Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { code: 1091, category: 1, key: "Only a single variable declaration is allowed in a 'for...in' statement." }, - Type_parameters_cannot_appear_on_a_constructor_declaration: { code: 1092, category: 1, key: "Type parameters cannot appear on a constructor declaration." }, - Type_annotation_cannot_appear_on_a_constructor_declaration: { code: 1093, category: 1, key: "Type annotation cannot appear on a constructor declaration." }, - An_accessor_cannot_have_type_parameters: { code: 1094, category: 1, key: "An accessor cannot have type parameters." }, - A_set_accessor_cannot_have_a_return_type_annotation: { code: 1095, category: 1, key: "A 'set' accessor cannot have a return type annotation." }, - An_index_signature_must_have_exactly_one_parameter: { code: 1096, category: 1, key: "An index signature must have exactly one parameter." }, - _0_list_cannot_be_empty: { code: 1097, category: 1, key: "'{0}' list cannot be empty." }, - Type_parameter_list_cannot_be_empty: { code: 1098, category: 1, key: "Type parameter list cannot be empty." }, - Type_argument_list_cannot_be_empty: { code: 1099, category: 1, key: "Type argument list cannot be empty." }, - Invalid_use_of_0_in_strict_mode: { code: 1100, category: 1, key: "Invalid use of '{0}' in strict mode." }, - with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: 1, key: "'with' statements are not allowed in strict mode." }, - delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: 1, key: "'delete' cannot be called on an identifier in strict mode." }, - A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: 1, key: "A 'continue' statement can only be used within an enclosing iteration statement." }, - A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: 1, key: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, - Jump_target_cannot_cross_function_boundary: { code: 1107, category: 1, key: "Jump target cannot cross function boundary." }, - A_return_statement_can_only_be_used_within_a_function_body: { code: 1108, category: 1, key: "A 'return' statement can only be used within a function body." }, - Expression_expected: { code: 1109, category: 1, key: "Expression expected." }, - Type_expected: { code: 1110, category: 1, key: "Type expected." }, - A_class_member_cannot_be_declared_optional: { code: 1112, category: 1, key: "A class member cannot be declared optional." }, - A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: 1, key: "A 'default' clause cannot appear more than once in a 'switch' statement." }, - Duplicate_label_0: { code: 1114, category: 1, key: "Duplicate label '{0}'" }, - A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: 1, key: "A 'continue' statement can only jump to a label of an enclosing iteration statement." }, - A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: 1, key: "A 'break' statement can only jump to a label of an enclosing statement." }, - An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: 1, key: "An object literal cannot have multiple properties with the same name in strict mode." }, - An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: { code: 1118, category: 1, key: "An object literal cannot have multiple get/set accessors with the same name." }, - An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { code: 1119, category: 1, key: "An object literal cannot have property and accessor with the same name." }, - An_export_assignment_cannot_have_modifiers: { code: 1120, category: 1, key: "An export assignment cannot have modifiers." }, - Octal_literals_are_not_allowed_in_strict_mode: { code: 1121, category: 1, key: "Octal literals are not allowed in strict mode." }, - A_tuple_type_element_list_cannot_be_empty: { code: 1122, category: 1, key: "A tuple type element list cannot be empty." }, - Variable_declaration_list_cannot_be_empty: { code: 1123, category: 1, key: "Variable declaration list cannot be empty." }, - Digit_expected: { code: 1124, category: 1, key: "Digit expected." }, - Hexadecimal_digit_expected: { code: 1125, category: 1, key: "Hexadecimal digit expected." }, - Unexpected_end_of_text: { code: 1126, category: 1, key: "Unexpected end of text." }, - Invalid_character: { code: 1127, category: 1, key: "Invalid character." }, - Declaration_or_statement_expected: { code: 1128, category: 1, key: "Declaration or statement expected." }, - Statement_expected: { code: 1129, category: 1, key: "Statement expected." }, - case_or_default_expected: { code: 1130, category: 1, key: "'case' or 'default' expected." }, - Property_or_signature_expected: { code: 1131, category: 1, key: "Property or signature expected." }, - Enum_member_expected: { code: 1132, category: 1, key: "Enum member expected." }, - Type_reference_expected: { code: 1133, category: 1, key: "Type reference expected." }, - Variable_declaration_expected: { code: 1134, category: 1, key: "Variable declaration expected." }, - Argument_expression_expected: { code: 1135, category: 1, key: "Argument expression expected." }, - Property_assignment_expected: { code: 1136, category: 1, key: "Property assignment expected." }, - Expression_or_comma_expected: { code: 1137, category: 1, key: "Expression or comma expected." }, - Parameter_declaration_expected: { code: 1138, category: 1, key: "Parameter declaration expected." }, - Type_parameter_declaration_expected: { code: 1139, category: 1, key: "Type parameter declaration expected." }, - Type_argument_expected: { code: 1140, category: 1, key: "Type argument expected." }, - String_literal_expected: { code: 1141, category: 1, key: "String literal expected." }, - Line_break_not_permitted_here: { code: 1142, category: 1, key: "Line break not permitted here." }, - or_expected: { code: 1144, category: 1, key: "'{' or ';' expected." }, - Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: 1, key: "Modifiers not permitted on index signature members." }, - Declaration_expected: { code: 1146, category: 1, key: "Declaration expected." }, - Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: 1, 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: 1, key: "Cannot compile external modules unless the '--module' flag is provided." }, - File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: 1, 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: 1, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, - var_let_or_const_expected: { code: 1152, category: 1, key: "'var', 'let' or 'const' expected." }, - let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1153, category: 1, key: "'let' declarations are only available when targeting ECMAScript 6 and higher." }, - const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1154, category: 1, key: "'const' declarations are only available when targeting ECMAScript 6 and higher." }, - const_declarations_must_be_initialized: { code: 1155, category: 1, key: "'const' declarations must be initialized" }, - const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: 1, key: "'const' declarations can only be declared inside a block." }, - let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: 1, key: "'let' declarations can only be declared inside a block." }, - Unterminated_template_literal: { code: 1160, category: 1, key: "Unterminated template literal." }, - Unterminated_regular_expression_literal: { code: 1161, category: 1, key: "Unterminated regular expression literal." }, - An_object_member_cannot_be_declared_optional: { code: 1162, category: 1, key: "An object member cannot be declared optional." }, - yield_expression_must_be_contained_within_a_generator_declaration: { code: 1163, category: 1, key: "'yield' expression must be contained_within a generator declaration." }, - Computed_property_names_are_not_allowed_in_enums: { code: 1164, category: 1, key: "Computed property names are not allowed in enums." }, - A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_symbol: { code: 1165, category: 1, key: "A computed property name in an ambient context must directly refer to a built-in symbol." }, - A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol: { code: 1166, category: 1, key: "A computed property name in a class property declaration must directly refer to a built-in symbol." }, - Computed_property_names_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1167, category: 1, key: "Computed property names are only available when targeting ECMAScript 6 and higher." }, - A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol: { code: 1168, category: 1, key: "A computed property name in a method overload must directly refer to a built-in symbol." }, - A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol: { code: 1169, category: 1, key: "A computed property name in an interface must directly refer to a built-in symbol." }, - A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol: { code: 1170, category: 1, key: "A computed property name in a type literal must directly refer to a built-in symbol." }, - A_comma_expression_is_not_allowed_in_a_computed_property_name: { code: 1171, category: 1, key: "A comma expression is not allowed in a computed property name." }, - extends_clause_already_seen: { code: 1172, category: 1, key: "'extends' clause already seen." }, - extends_clause_must_precede_implements_clause: { code: 1173, category: 1, key: "'extends' clause must precede 'implements' clause." }, - Classes_can_only_extend_a_single_class: { code: 1174, category: 1, key: "Classes can only extend a single class." }, - implements_clause_already_seen: { code: 1175, category: 1, key: "'implements' clause already seen." }, - Interface_declaration_cannot_have_implements_clause: { code: 1176, category: 1, key: "Interface declaration cannot have 'implements' clause." }, - Binary_digit_expected: { code: 1177, category: 1, key: "Binary digit expected." }, - Octal_digit_expected: { code: 1178, category: 1, key: "Octal digit expected." }, - Unexpected_token_expected: { code: 1179, category: 1, key: "Unexpected token. '{' expected." }, - Property_destructuring_pattern_expected: { code: 1180, category: 1, key: "Property destructuring pattern expected." }, - Array_element_destructuring_pattern_expected: { code: 1181, category: 1, key: "Array element destructuring pattern expected." }, - A_destructuring_declaration_must_have_an_initializer: { code: 1182, category: 1, key: "A destructuring declaration must have an initializer." }, - Destructuring_declarations_are_not_allowed_in_ambient_contexts: { code: 1183, category: 1, key: "Destructuring declarations are not allowed in ambient contexts." }, - An_implementation_cannot_be_declared_in_ambient_contexts: { code: 1184, category: 1, key: "An implementation cannot be declared in ambient contexts." }, - Modifiers_cannot_appear_here: { code: 1184, category: 1, key: "Modifiers cannot appear here." }, - Merge_conflict_marker_encountered: { code: 1185, category: 1, key: "Merge conflict marker encountered." }, - A_rest_element_cannot_have_an_initializer: { code: 1186, category: 1, key: "A rest element cannot have an initializer." }, - A_parameter_property_may_not_be_a_binding_pattern: { code: 1187, category: 1, key: "A parameter property may not be a binding pattern." }, - Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement: { code: 1188, category: 1, key: "Only a single variable declaration is allowed in a 'for...of' statement." }, - The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer: { code: 1189, category: 1, 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: 1, key: "The variable declaration of a 'for...of' statement cannot have an initializer." }, - An_import_declaration_cannot_have_modifiers: { code: 1191, category: 1, key: "An import declaration cannot have modifiers." }, - External_module_0_has_no_default_export_or_export_assignment: { code: 1192, category: 1, key: "External module '{0}' has no default export or export assignment." }, - An_export_declaration_cannot_have_modifiers: { code: 1193, category: 1, key: "An export declaration cannot have modifiers." }, - Export_declarations_are_not_permitted_in_an_internal_module: { code: 1194, category: 1, key: "Export declarations are not permitted in an internal module." }, - Catch_clause_variable_name_must_be_an_identifier: { code: 1195, category: 1, key: "Catch clause variable name must be an identifier." }, - Catch_clause_variable_cannot_have_a_type_annotation: { code: 1196, category: 1, key: "Catch clause variable cannot have a type annotation." }, - Catch_clause_variable_cannot_have_an_initializer: { code: 1197, category: 1, key: "Catch clause variable cannot have an initializer." }, - An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: { code: 1198, category: 1, key: "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive." }, - Unterminated_Unicode_escape_sequence: { code: 1199, category: 1, key: "Unterminated Unicode escape sequence." }, - Duplicate_identifier_0: { code: 2300, category: 1, key: "Duplicate identifier '{0}'." }, - Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: 1, 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: 1, key: "Static members cannot reference class type parameters." }, - Circular_definition_of_import_alias_0: { code: 2303, category: 1, key: "Circular definition of import alias '{0}'." }, - Cannot_find_name_0: { code: 2304, category: 1, key: "Cannot find name '{0}'." }, - Module_0_has_no_exported_member_1: { code: 2305, category: 1, key: "Module '{0}' has no exported member '{1}'." }, - File_0_is_not_an_external_module: { code: 2306, category: 1, key: "File '{0}' is not an external module." }, - Cannot_find_external_module_0: { code: 2307, category: 1, key: "Cannot find external module '{0}'." }, - A_module_cannot_have_more_than_one_export_assignment: { code: 2308, category: 1, 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: 1, 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: 1, key: "Type '{0}' recursively references itself as a base type." }, - A_class_may_only_extend_another_class: { code: 2311, category: 1, key: "A class may only extend another class." }, - An_interface_may_only_extend_a_class_or_another_interface: { code: 2312, category: 1, key: "An interface may only extend a class or another interface." }, - Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2313, category: 1, key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, - Generic_type_0_requires_1_type_argument_s: { code: 2314, category: 1, key: "Generic type '{0}' requires {1} type argument(s)." }, - Type_0_is_not_generic: { code: 2315, category: 1, key: "Type '{0}' is not generic." }, - Global_type_0_must_be_a_class_or_interface_type: { code: 2316, category: 1, key: "Global type '{0}' must be a class or interface type." }, - Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: 1, key: "Global type '{0}' must have {1} type parameter(s)." }, - Cannot_find_global_type_0: { code: 2318, category: 1, key: "Cannot find global type '{0}'." }, - Named_property_0_of_types_1_and_2_are_not_identical: { code: 2319, category: 1, key: "Named property '{0}' of types '{1}' and '{2}' are not identical." }, - Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: 1, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." }, - Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: 1, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, - Type_0_is_not_assignable_to_type_1: { code: 2322, category: 1, key: "Type '{0}' is not assignable to type '{1}'." }, - Property_0_is_missing_in_type_1: { code: 2324, category: 1, key: "Property '{0}' is missing in type '{1}'." }, - Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: 1, key: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, - Types_of_property_0_are_incompatible: { code: 2326, category: 1, key: "Types of property '{0}' are incompatible." }, - Property_0_is_optional_in_type_1_but_required_in_type_2: { code: 2327, category: 1, key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." }, - Types_of_parameters_0_and_1_are_incompatible: { code: 2328, category: 1, key: "Types of parameters '{0}' and '{1}' are incompatible." }, - Index_signature_is_missing_in_type_0: { code: 2329, category: 1, key: "Index signature is missing in type '{0}'." }, - Index_signatures_are_incompatible: { code: 2330, category: 1, key: "Index signatures are incompatible." }, - this_cannot_be_referenced_in_a_module_body: { code: 2331, category: 1, key: "'this' cannot be referenced in a module body." }, - this_cannot_be_referenced_in_current_location: { code: 2332, category: 1, key: "'this' cannot be referenced in current location." }, - this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: 1, key: "'this' cannot be referenced in constructor arguments." }, - this_cannot_be_referenced_in_a_static_property_initializer: { code: 2334, category: 1, key: "'this' cannot be referenced in a static property initializer." }, - super_can_only_be_referenced_in_a_derived_class: { code: 2335, category: 1, key: "'super' can only be referenced in a derived class." }, - super_cannot_be_referenced_in_constructor_arguments: { code: 2336, category: 1, key: "'super' cannot be referenced in constructor arguments." }, - Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: 2337, category: 1, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, - super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2338, category: 1, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, - Property_0_does_not_exist_on_type_1: { code: 2339, category: 1, key: "Property '{0}' does not exist on type '{1}'." }, - Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: 1, key: "Only public and protected methods of the base class are accessible via the 'super' keyword" }, - Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: 1, key: "Property '{0}' is private and only accessible within class '{1}'." }, - An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: { code: 2342, category: 1, key: "An index expression argument must be of type 'string', 'number', 'symbol, or 'any'." }, - Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: 1, key: "Type '{0}' does not satisfy the constraint '{1}'." }, - Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: 1, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, - Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: 1, key: "Supplied parameters do not match any signature of call target." }, - Untyped_function_calls_may_not_accept_type_arguments: { code: 2347, category: 1, key: "Untyped function calls may not accept type arguments." }, - Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { code: 2348, category: 1, key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" }, - Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { code: 2349, category: 1, key: "Cannot invoke an expression whose type lacks a call signature." }, - Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: 1, key: "Only a void function can be called with the 'new' keyword." }, - Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: 1, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, - Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: 1, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, - No_best_common_type_exists_among_return_expressions: { code: 2354, category: 1, key: "No best common type exists among return expressions." }, - A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: 1, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, - An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: 1, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, - The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2357, category: 1, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, - The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: 1, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, - The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: 1, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, - The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: { code: 2360, category: 1, key: "The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'." }, - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: 1, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, - The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: 1, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: 1, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - Invalid_left_hand_side_of_assignment_expression: { code: 2364, category: 1, key: "Invalid left-hand side of assignment expression." }, - Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: 1, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, - Type_parameter_name_cannot_be_0: { code: 2368, category: 1, key: "Type parameter name cannot be '{0}'" }, - A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: 1, key: "A parameter property is only allowed in a constructor implementation." }, - A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: 1, key: "A rest parameter must be of an array type." }, - A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: 1, key: "A parameter initializer is only allowed in a function or constructor implementation." }, - Parameter_0_cannot_be_referenced_in_its_initializer: { code: 2372, category: 1, key: "Parameter '{0}' cannot be referenced in its initializer." }, - Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { code: 2373, category: 1, key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." }, - Duplicate_string_index_signature: { code: 2374, category: 1, key: "Duplicate string index signature." }, - Duplicate_number_index_signature: { code: 2375, category: 1, key: "Duplicate number index signature." }, - A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: 2376, category: 1, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, - Constructors_for_derived_classes_must_contain_a_super_call: { code: 2377, category: 1, key: "Constructors for derived classes must contain a 'super' call." }, - A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2378, category: 1, key: "A 'get' accessor must return a value or consist of a single 'throw' statement." }, - Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2379, category: 1, key: "Getter and setter accessors do not agree in visibility." }, - get_and_set_accessor_must_have_the_same_type: { code: 2380, category: 1, key: "'get' and 'set' accessor must have the same type." }, - A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2381, category: 1, key: "A signature with an implementation cannot use a string literal type." }, - Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 2382, category: 1, key: "Specialized overload signature is not assignable to any non-specialized signature." }, - Overload_signatures_must_all_be_exported_or_not_exported: { code: 2383, category: 1, key: "Overload signatures must all be exported or not exported." }, - Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2384, category: 1, key: "Overload signatures must all be ambient or non-ambient." }, - Overload_signatures_must_all_be_public_private_or_protected: { code: 2385, category: 1, key: "Overload signatures must all be public, private or protected." }, - Overload_signatures_must_all_be_optional_or_required: { code: 2386, category: 1, key: "Overload signatures must all be optional or required." }, - Function_overload_must_be_static: { code: 2387, category: 1, key: "Function overload must be static." }, - Function_overload_must_not_be_static: { code: 2388, category: 1, key: "Function overload must not be static." }, - Function_implementation_name_must_be_0: { code: 2389, category: 1, key: "Function implementation name must be '{0}'." }, - Constructor_implementation_is_missing: { code: 2390, category: 1, key: "Constructor implementation is missing." }, - Function_implementation_is_missing_or_not_immediately_following_the_declaration: { code: 2391, category: 1, key: "Function implementation is missing or not immediately following the declaration." }, - Multiple_constructor_implementations_are_not_allowed: { code: 2392, category: 1, key: "Multiple constructor implementations are not allowed." }, - Duplicate_function_implementation: { code: 2393, category: 1, key: "Duplicate function implementation." }, - Overload_signature_is_not_compatible_with_function_implementation: { code: 2394, category: 1, key: "Overload signature is not compatible with function implementation." }, - Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2395, category: 1, key: "Individual declarations in merged declaration {0} must be all exported or all local." }, - Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2396, category: 1, key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, - Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2399, category: 1, key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, - Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2400, category: 1, key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, - Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2401, category: 1, key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, - Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { code: 2402, category: 1, key: "Expression resolves to '_super' that compiler uses to capture base class reference." }, - Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { code: 2403, category: 1, key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." }, - The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { code: 2404, category: 1, key: "The left-hand side of a 'for...in' statement cannot use a type annotation." }, - The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { code: 2405, category: 1, key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." }, - Invalid_left_hand_side_in_for_in_statement: { code: 2406, category: 1, key: "Invalid left-hand side in 'for...in' statement." }, - The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: 1, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, - Setters_cannot_return_a_value: { code: 2408, category: 1, key: "Setters cannot return a value." }, - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: 1, key: "Return type of constructor signature must be assignable to the instance type of the class" }, - All_symbols_within_a_with_block_will_be_resolved_to_any: { code: 2410, category: 1, key: "All symbols within a 'with' block will be resolved to 'any'." }, - Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: 1, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, - Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: 1, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, - Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: 1, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, - Class_name_cannot_be_0: { code: 2414, category: 1, key: "Class name cannot be '{0}'" }, - Class_0_incorrectly_extends_base_class_1: { code: 2415, category: 1, key: "Class '{0}' incorrectly extends base class '{1}'." }, - Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: 1, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, - Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: 1, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, - Class_0_incorrectly_implements_interface_1: { code: 2420, category: 1, key: "Class '{0}' incorrectly implements interface '{1}'." }, - A_class_may_only_implement_another_class_or_interface: { code: 2422, category: 1, key: "A class may only implement another class or interface." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: 1, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: 1, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, - Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: 1, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, - Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: 1, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, - Interface_name_cannot_be_0: { code: 2427, category: 1, key: "Interface name cannot be '{0}'" }, - All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: 1, key: "All declarations of an interface must have identical type parameters." }, - Interface_0_incorrectly_extends_interface_1: { code: 2430, category: 1, key: "Interface '{0}' incorrectly extends interface '{1}'." }, - Enum_name_cannot_be_0: { code: 2431, category: 1, 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: 1, 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: 1, 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: 1, 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: 1, key: "Ambient external modules cannot be nested in other modules." }, - Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: 1, key: "Ambient external module declaration cannot specify relative module name." }, - Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: 1, key: "Module '{0}' is hidden by a local declaration with the same name" }, - Import_name_cannot_be_0: { code: 2438, category: 1, 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: 1, key: "Import or export declaration in an ambient external module declaration cannot reference external module through relative external module name." }, - Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: 1, 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: 1, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module." }, - Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: 1, 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: 1, 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: 1, key: "Property '{0}' is protected in type '{1}' but public in type '{2}'." }, - Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { code: 2445, category: 1, key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." }, - Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: 1, key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, - The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: 1, key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, - Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: 1, key: "Block-scoped variable '{0}' used before its declaration." }, - The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant: { code: 2449, category: 1, key: "The operand of an increment or decrement operator cannot be a constant." }, - Left_hand_side_of_assignment_expression_cannot_be_a_constant: { code: 2450, category: 1, key: "Left-hand side of assignment expression cannot be a constant." }, - Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: 1, key: "Cannot redeclare block-scoped variable '{0}'." }, - An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: 1, key: "An enum member cannot have a numeric name." }, - The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: 1, key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, - Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: 1, key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, - Type_alias_0_circularly_references_itself: { code: 2456, category: 1, key: "Type alias '{0}' circularly references itself." }, - Type_alias_name_cannot_be_0: { code: 2457, category: 1, key: "Type alias name cannot be '{0}'" }, - An_AMD_module_cannot_have_multiple_name_assignments: { code: 2458, category: 1, key: "An AMD module cannot have multiple name assignments." }, - Type_0_has_no_property_1_and_no_string_index_signature: { code: 2459, category: 1, key: "Type '{0}' has no property '{1}' and no string index signature." }, - Type_0_has_no_property_1: { code: 2460, category: 1, key: "Type '{0}' has no property '{1}'." }, - Type_0_is_not_an_array_type: { code: 2461, category: 1, key: "Type '{0}' is not an array type." }, - A_rest_element_must_be_last_in_an_array_destructuring_pattern: { code: 2462, category: 1, key: "A rest element must be last in an array destructuring pattern" }, - A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: { code: 2463, category: 1, key: "A binding pattern parameter cannot be optional in an implementation signature." }, - A_computed_property_name_must_be_of_type_string_number_symbol_or_any: { code: 2464, category: 1, key: "A computed property name must be of type 'string', 'number', 'symbol', or 'any'." }, - this_cannot_be_referenced_in_a_computed_property_name: { code: 2465, category: 1, key: "'this' cannot be referenced in a computed property name." }, - super_cannot_be_referenced_in_a_computed_property_name: { code: 2466, category: 1, key: "'super' cannot be referenced in a computed property name." }, - A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: { code: 2467, category: 1, key: "A computed property name cannot reference a type parameter from its containing type." }, - Cannot_find_global_value_0: { code: 2468, category: 1, key: "Cannot find global value '{0}'." }, - The_0_operator_cannot_be_applied_to_type_symbol: { code: 2469, category: 1, key: "The '{0}' operator cannot be applied to type 'symbol'." }, - Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object: { code: 2470, category: 1, key: "'Symbol' reference does not refer to the global Symbol constructor object." }, - A_computed_property_name_of_the_form_0_must_be_of_type_symbol: { code: 2471, category: 1, key: "A computed property name of the form '{0}' must be of type 'symbol'." }, - Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_6_and_higher: { code: 2472, category: 1, key: "Spread operator in 'new' expressions is only available when targeting ECMAScript 6 and higher." }, - Enum_declarations_must_all_be_const_or_non_const: { code: 2473, category: 1, key: "Enum declarations must all be const or non-const." }, - In_const_enum_declarations_member_initializer_must_be_constant_expression: { code: 2474, category: 1, key: "In 'const' enum declarations member initializer must be constant expression." }, - const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: { code: 2475, category: 1, key: "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment." }, - A_const_enum_member_can_only_be_accessed_using_a_string_literal: { code: 2476, category: 1, key: "A const enum member can only be accessed using a string literal." }, - const_enum_member_initializer_was_evaluated_to_a_non_finite_value: { code: 2477, category: 1, key: "'const' enum member initializer was evaluated to a non-finite value." }, - const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: { code: 2478, category: 1, key: "'const' enum member initializer was evaluated to disallowed value 'NaN'." }, - Property_0_does_not_exist_on_const_enum_1: { code: 2479, category: 1, key: "Property '{0}' does not exist on 'const' enum '{1}'." }, - let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { code: 2480, category: 1, key: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." }, - Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { code: 2481, category: 1, key: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." }, - The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: { code: 2483, category: 1, key: "The left-hand side of a 'for...of' statement cannot use a type annotation." }, - Export_declaration_conflicts_with_exported_declaration_of_0: { code: 2484, category: 1, key: "Export declaration conflicts with exported declaration of '{0}'" }, - The_left_hand_side_of_a_for_of_statement_cannot_be_a_previously_defined_constant: { code: 2485, category: 1, key: "The left-hand side of a 'for...of' statement cannot be a previously defined constant." }, - The_left_hand_side_of_a_for_in_statement_cannot_be_a_previously_defined_constant: { code: 2486, category: 1, key: "The left-hand side of a 'for...in' statement cannot be a previously defined constant." }, - Invalid_left_hand_side_in_for_of_statement: { code: 2487, category: 1, key: "Invalid left-hand side in 'for...of' statement." }, - The_right_hand_side_of_a_for_of_statement_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2488, category: 1, key: "The right-hand side of a 'for...of' statement must have a '[Symbol.iterator]()' method that returns an iterator." }, - The_iterator_returned_by_the_right_hand_side_of_a_for_of_statement_must_have_a_next_method: { code: 2489, category: 1, key: "The iterator returned by the right-hand side of a 'for...of' statement must have a 'next()' method." }, - The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: { code: 2490, category: 1, key: "The type returned by the 'next()' method of an iterator must have a 'value' property." }, - The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: { code: 2491, category: 1, key: "The left-hand side of a 'for...in' statement cannot be a destructuring pattern." }, - Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: 1, key: "Cannot redeclare identifier '{0}' in catch clause" }, - Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: { code: 2493, category: 1, key: "Tuple type '{0}' with length '{1}' cannot be assigned to tuple with length '{2}'." }, - Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: { code: 2494, category: 1, 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: 2461, category: 1, key: "Type '{0}' is not an array type or a string type." }, - Import_declaration_0_is_using_private_name_1: { code: 4000, category: 1, 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: 1, 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: 1, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4006, category: 1, key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4008, category: 1, key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4010, category: 1, key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4012, category: 1, key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: 1, key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: 1, key: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, - Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: 1, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: 1, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: 1, key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, - Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: 1, key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, - Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: 1, key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, - Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: 1, key: "Exported variable '{0}' has or is using private name '{1}'." }, - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4026, category: 1, key: "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4027, category: 1, key: "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4028, category: 1, key: "Public static property '{0}' of exported class has or is using private name '{1}'." }, - Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4029, category: 1, key: "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4030, category: 1, key: "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Public_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4031, category: 1, key: "Public property '{0}' of exported class has or is using private name '{1}'." }, - Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4032, category: 1, key: "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, - Property_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4033, category: 1, key: "Property '{0}' of exported interface has or is using private name '{1}'." }, - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4034, category: 1, key: "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4035, category: 1, key: "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4036, category: 1, key: "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4037, category: 1, key: "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4038, category: 1, key: "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4039, category: 1, key: "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4040, category: 1, key: "Return type of public static property getter from exported class has or is using private name '{0}'." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4041, category: 1, key: "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4042, category: 1, key: "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4043, category: 1, key: "Return type of public property getter from exported class has or is using private name '{0}'." }, - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4044, category: 1, key: "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4045, category: 1, key: "Return type of constructor signature from exported interface has or is using private name '{0}'." }, - Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4046, category: 1, key: "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4047, category: 1, key: "Return type of call signature from exported interface has or is using private name '{0}'." }, - Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4048, category: 1, key: "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4049, category: 1, key: "Return type of index signature from exported interface has or is using private name '{0}'." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4050, category: 1, key: "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4051, category: 1, key: "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: { code: 4052, category: 1, key: "Return type of public static method from exported class has or is using private name '{0}'." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4053, category: 1, key: "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4054, category: 1, key: "Return type of public method from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: { code: 4055, category: 1, key: "Return type of public method from exported class has or is using private name '{0}'." }, - Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4056, category: 1, key: "Return type of method from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: { code: 4057, category: 1, key: "Return type of method from exported interface has or is using private name '{0}'." }, - Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4058, category: 1, key: "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: { code: 4059, category: 1, key: "Return type of exported function has or is using name '{0}' from private module '{1}'." }, - Return_type_of_exported_function_has_or_is_using_private_name_0: { code: 4060, category: 1, key: "Return type of exported function has or is using private name '{0}'." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4061, category: 1, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4062, category: 1, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: { code: 4063, category: 1, key: "Parameter '{0}' of constructor from exported class has or is using private name '{1}'." }, - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4064, category: 1, key: "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4065, category: 1, key: "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4066, category: 1, key: "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4067, category: 1, key: "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4068, category: 1, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4069, category: 1, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4070, category: 1, key: "Parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4071, category: 1, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4072, category: 1, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4073, category: 1, key: "Parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4074, category: 1, key: "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4075, category: 1, key: "Parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: 1, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: 1, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: 1, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, - Exported_type_alias_0_has_or_is_using_private_name_1: { code: 4081, category: 1, key: "Exported type alias '{0}' has or is using private name '{1}'." }, - Loop_contains_block_scoped_variable_0_referenced_by_a_function_in_the_loop_This_is_only_supported_in_ECMAScript_6_or_higher: { code: 4091, category: 1, key: "Loop contains block-scoped variable '{0}' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher." }, - The_current_host_does_not_support_the_0_option: { code: 5001, category: 1, key: "The current host does not support the '{0}' option." }, - Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: 1, key: "Cannot find the common subdirectory path for the input files." }, - Cannot_read_file_0_Colon_1: { code: 5012, category: 1, key: "Cannot read file '{0}': {1}" }, - Unsupported_file_encoding: { code: 5013, category: 1, key: "Unsupported file encoding." }, - Unknown_compiler_option_0: { code: 5023, category: 1, key: "Unknown compiler option '{0}'." }, - Compiler_option_0_requires_a_value_of_type_1: { code: 5024, category: 1, key: "Compiler option '{0}' requires a value of type {1}." }, - Could_not_write_file_0_Colon_1: { code: 5033, category: 1, key: "Could not write file '{0}': {1}" }, - Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5038, category: 1, key: "Option 'mapRoot' cannot be specified without specifying 'sourcemap' option." }, - Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5039, category: 1, key: "Option 'sourceRoot' cannot be specified without specifying 'sourcemap' option." }, - Option_noEmit_cannot_be_specified_with_option_out_or_outDir: { code: 5040, category: 1, key: "Option 'noEmit' cannot be specified with option 'out' or 'outDir'." }, - Option_noEmit_cannot_be_specified_with_option_declaration: { code: 5041, category: 1, key: "Option 'noEmit' cannot be specified with option 'declaration'." }, - Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { code: 5042, category: 1, key: "Option 'project' cannot be mixed with source files on a command line." }, - Concatenate_and_emit_output_to_single_file: { code: 6001, category: 2, key: "Concatenate and emit output to single file." }, - Generates_corresponding_d_ts_file: { code: 6002, category: 2, key: "Generates corresponding '.d.ts' file." }, - Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: 2, key: "Specifies the location where debugger should locate map files instead of generated locations." }, - Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { code: 6004, category: 2, key: "Specifies the location where debugger should locate TypeScript files instead of source locations." }, - Watch_input_files: { code: 6005, category: 2, key: "Watch input files." }, - Redirect_output_structure_to_the_directory: { code: 6006, category: 2, key: "Redirect output structure to the directory." }, - Do_not_erase_const_enum_declarations_in_generated_code: { code: 6007, category: 2, key: "Do not erase const enum declarations in generated code." }, - Do_not_emit_outputs_if_any_type_checking_errors_were_reported: { code: 6008, category: 2, key: "Do not emit outputs if any type checking errors were reported." }, - Do_not_emit_comments_to_output: { code: 6009, category: 2, key: "Do not emit comments to output." }, - Do_not_emit_outputs: { code: 6010, category: 2, key: "Do not emit outputs." }, - Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: 2, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" }, - Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: 2, key: "Specify module code generation: 'commonjs' or 'amd'" }, - Print_this_message: { code: 6017, category: 2, key: "Print this message." }, - Print_the_compiler_s_version: { code: 6019, category: 2, key: "Print the compiler's version." }, - Compile_the_project_in_the_given_directory: { code: 6020, category: 2, key: "Compile the project in the given directory." }, - Syntax_Colon_0: { code: 6023, category: 2, key: "Syntax: {0}" }, - options: { code: 6024, category: 2, key: "options" }, - file: { code: 6025, category: 2, key: "file" }, - Examples_Colon_0: { code: 6026, category: 2, key: "Examples: {0}" }, - Options_Colon: { code: 6027, category: 2, key: "Options:" }, - Version_0: { code: 6029, category: 2, key: "Version {0}" }, - Insert_command_line_options_and_files_from_a_file: { code: 6030, category: 2, key: "Insert command line options and files from a file." }, - File_change_detected_Starting_incremental_compilation: { code: 6032, category: 2, key: "File change detected. Starting incremental compilation..." }, - KIND: { code: 6034, category: 2, key: "KIND" }, - FILE: { code: 6035, category: 2, key: "FILE" }, - VERSION: { code: 6036, category: 2, key: "VERSION" }, - LOCATION: { code: 6037, category: 2, key: "LOCATION" }, - DIRECTORY: { code: 6038, category: 2, key: "DIRECTORY" }, - Compilation_complete_Watching_for_file_changes: { code: 6042, category: 2, key: "Compilation complete. Watching for file changes." }, - Generates_corresponding_map_file: { code: 6043, category: 2, key: "Generates corresponding '.map' file." }, - Compiler_option_0_expects_an_argument: { code: 6044, category: 1, key: "Compiler option '{0}' expects an argument." }, - Unterminated_quoted_string_in_response_file_0: { code: 6045, category: 1, key: "Unterminated quoted string in response file '{0}'." }, - Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: 1, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, - Argument_for_target_option_must_be_es3_es5_or_es6: { code: 6047, category: 1, 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: 1, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, - Unsupported_locale_0: { code: 6049, category: 1, key: "Unsupported locale '{0}'." }, - Unable_to_open_file_0: { code: 6050, category: 1, key: "Unable to open file '{0}'." }, - Corrupted_locale_file_0: { code: 6051, category: 1, key: "Corrupted locale file {0}." }, - Raise_error_on_expressions_and_declarations_with_an_implied_any_type: { code: 6052, category: 2, key: "Raise error on expressions and declarations with an implied 'any' type." }, - File_0_not_found: { code: 6053, category: 1, key: "File '{0}' not found." }, - File_0_must_have_extension_ts_or_d_ts: { code: 6054, category: 1, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, - Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: { code: 6055, category: 2, key: "Suppress noImplicitAny errors for indexing objects lacking index signatures." }, - Do_not_emit_declarations_for_code_that_has_an_internal_annotation: { code: 6056, category: 2, key: "Do not emit declarations for code that has an '@internal' annotation." }, - Preserve_new_lines_when_emitting_code: { code: 6057, category: 2, key: "Preserve new-lines when emitting code." }, - Variable_0_implicitly_has_an_1_type: { code: 7005, category: 1, key: "Variable '{0}' implicitly has an '{1}' type." }, - Parameter_0_implicitly_has_an_1_type: { code: 7006, category: 1, key: "Parameter '{0}' implicitly has an '{1}' type." }, - Member_0_implicitly_has_an_1_type: { code: 7008, category: 1, key: "Member '{0}' implicitly has an '{1}' type." }, - new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: { code: 7009, category: 1, key: "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type." }, - _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: 1, key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, - Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: 1, key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, - Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: 1, key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: 1, key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, - Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: 1, key: "Index signature of object type implicitly has an 'any' type." }, - Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: 1, key: "Object literal's property '{0}' implicitly has an '{1}' type." }, - Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: 1, 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: 1, 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: 1, 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: 1, 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: 1, 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: 1, 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." }, - You_cannot_rename_this_element: { code: 8000, category: 1, key: "You cannot rename this element." }, - You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: { code: 8001, category: 1, key: "You cannot rename elements that are defined in the standard TypeScript library." }, - yield_expressions_are_not_currently_supported: { code: 9000, category: 1, key: "'yield' expressions are not currently supported." }, - Generators_are_not_currently_supported: { code: 9001, category: 1, key: "Generators are not currently supported." }, - The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression: { code: 9002, category: 1, key: "The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression." } + Unterminated_string_literal: { code: 1002, category: ts.DiagnosticCategory.Error, key: "Unterminated string literal." }, + Identifier_expected: { code: 1003, category: ts.DiagnosticCategory.Error, key: "Identifier expected." }, + _0_expected: { code: 1005, category: ts.DiagnosticCategory.Error, key: "'{0}' expected." }, + A_file_cannot_have_a_reference_to_itself: { code: 1006, category: ts.DiagnosticCategory.Error, key: "A file cannot have a reference to itself." }, + Trailing_comma_not_allowed: { code: 1009, category: ts.DiagnosticCategory.Error, key: "Trailing comma not allowed." }, + Asterisk_Slash_expected: { code: 1010, category: ts.DiagnosticCategory.Error, key: "'*/' expected." }, + Unexpected_token: { code: 1012, category: ts.DiagnosticCategory.Error, key: "Unexpected token." }, + A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: ts.DiagnosticCategory.Error, key: "A rest parameter must be last in a parameter list." }, + Parameter_cannot_have_question_mark_and_initializer: { code: 1015, category: ts.DiagnosticCategory.Error, key: "Parameter cannot have question mark and initializer." }, + A_required_parameter_cannot_follow_an_optional_parameter: { code: 1016, category: ts.DiagnosticCategory.Error, key: "A required parameter cannot follow an optional parameter." }, + An_index_signature_cannot_have_a_rest_parameter: { code: 1017, category: ts.DiagnosticCategory.Error, key: "An index signature cannot have a rest parameter." }, + An_index_signature_parameter_cannot_have_an_accessibility_modifier: { code: 1018, category: ts.DiagnosticCategory.Error, key: "An index signature parameter cannot have an accessibility modifier." }, + An_index_signature_parameter_cannot_have_a_question_mark: { code: 1019, category: ts.DiagnosticCategory.Error, key: "An index signature parameter cannot have a question mark." }, + An_index_signature_parameter_cannot_have_an_initializer: { code: 1020, category: ts.DiagnosticCategory.Error, key: "An index signature parameter cannot have an initializer." }, + An_index_signature_must_have_a_type_annotation: { code: 1021, category: ts.DiagnosticCategory.Error, key: "An index signature must have a type annotation." }, + An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: ts.DiagnosticCategory.Error, key: "An index signature parameter must have a type annotation." }, + An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: ts.DiagnosticCategory.Error, key: "An index signature parameter type must be 'string' or 'number'." }, + A_class_or_interface_declaration_can_only_have_one_extends_clause: { code: 1024, category: ts.DiagnosticCategory.Error, key: "A class or interface declaration can only have one 'extends' clause." }, + An_extends_clause_must_precede_an_implements_clause: { code: 1025, category: ts.DiagnosticCategory.Error, key: "An 'extends' clause must precede an 'implements' clause." }, + A_class_can_only_extend_a_single_class: { code: 1026, category: ts.DiagnosticCategory.Error, key: "A class can only extend a single class." }, + A_class_declaration_can_only_have_one_implements_clause: { code: 1027, category: ts.DiagnosticCategory.Error, key: "A class declaration can only have one 'implements' clause." }, + Accessibility_modifier_already_seen: { code: 1028, category: ts.DiagnosticCategory.Error, key: "Accessibility modifier already seen." }, + _0_modifier_must_precede_1_modifier: { code: 1029, category: ts.DiagnosticCategory.Error, key: "'{0}' modifier must precede '{1}' modifier." }, + _0_modifier_already_seen: { code: 1030, category: ts.DiagnosticCategory.Error, key: "'{0}' modifier already seen." }, + _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: ts.DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a class element." }, + An_interface_declaration_cannot_have_an_implements_clause: { code: 1032, category: ts.DiagnosticCategory.Error, key: "An interface declaration cannot have an 'implements' clause." }, + super_must_be_followed_by_an_argument_list_or_member_access: { code: 1034, category: ts.DiagnosticCategory.Error, key: "'super' must be followed by an argument list or member access." }, + Only_ambient_modules_can_use_quoted_names: { code: 1035, category: ts.DiagnosticCategory.Error, key: "Only ambient modules can use quoted names." }, + Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: ts.DiagnosticCategory.Error, key: "Statements are not allowed in ambient contexts." }, + A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { code: 1038, category: ts.DiagnosticCategory.Error, key: "A 'declare' modifier cannot be used in an already ambient context." }, + Initializers_are_not_allowed_in_ambient_contexts: { code: 1039, category: ts.DiagnosticCategory.Error, key: "Initializers are not allowed in ambient contexts." }, + _0_modifier_cannot_appear_on_a_module_element: { code: 1044, category: ts.DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a module element." }, + A_declare_modifier_cannot_be_used_with_an_interface_declaration: { code: 1045, category: ts.DiagnosticCategory.Error, key: "A 'declare' modifier cannot be used with an interface declaration." }, + A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { code: 1046, category: ts.DiagnosticCategory.Error, key: "A 'declare' modifier is required for a top level declaration in a .d.ts file." }, + A_rest_parameter_cannot_be_optional: { code: 1047, category: ts.DiagnosticCategory.Error, key: "A rest parameter cannot be optional." }, + A_rest_parameter_cannot_have_an_initializer: { code: 1048, category: ts.DiagnosticCategory.Error, key: "A rest parameter cannot have an initializer." }, + A_set_accessor_must_have_exactly_one_parameter: { code: 1049, category: ts.DiagnosticCategory.Error, key: "A 'set' accessor must have exactly one parameter." }, + A_set_accessor_cannot_have_an_optional_parameter: { code: 1051, category: ts.DiagnosticCategory.Error, key: "A 'set' accessor cannot have an optional parameter." }, + A_set_accessor_parameter_cannot_have_an_initializer: { code: 1052, category: ts.DiagnosticCategory.Error, key: "A 'set' accessor parameter cannot have an initializer." }, + A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: ts.DiagnosticCategory.Error, key: "A 'set' accessor cannot have rest parameter." }, + 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." }, + 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." }, + Invalid_reference_directive_syntax: { code: 1084, category: ts.DiagnosticCategory.Error, key: "Invalid 'reference' directive syntax." }, + Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: ts.DiagnosticCategory.Error, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, + An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: ts.DiagnosticCategory.Error, key: "An accessor cannot be declared in an ambient context." }, + _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: ts.DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a constructor declaration." }, + _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: ts.DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a parameter." }, + Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { code: 1091, category: ts.DiagnosticCategory.Error, key: "Only a single variable declaration is allowed in a 'for...in' statement." }, + Type_parameters_cannot_appear_on_a_constructor_declaration: { code: 1092, category: ts.DiagnosticCategory.Error, key: "Type parameters cannot appear on a constructor declaration." }, + Type_annotation_cannot_appear_on_a_constructor_declaration: { code: 1093, category: ts.DiagnosticCategory.Error, key: "Type annotation cannot appear on a constructor declaration." }, + An_accessor_cannot_have_type_parameters: { code: 1094, category: ts.DiagnosticCategory.Error, key: "An accessor cannot have type parameters." }, + A_set_accessor_cannot_have_a_return_type_annotation: { code: 1095, category: ts.DiagnosticCategory.Error, key: "A 'set' accessor cannot have a return type annotation." }, + An_index_signature_must_have_exactly_one_parameter: { code: 1096, category: ts.DiagnosticCategory.Error, key: "An index signature must have exactly one parameter." }, + _0_list_cannot_be_empty: { code: 1097, category: ts.DiagnosticCategory.Error, key: "'{0}' list cannot be empty." }, + Type_parameter_list_cannot_be_empty: { code: 1098, category: ts.DiagnosticCategory.Error, key: "Type parameter list cannot be empty." }, + Type_argument_list_cannot_be_empty: { code: 1099, category: ts.DiagnosticCategory.Error, key: "Type argument list cannot be empty." }, + Invalid_use_of_0_in_strict_mode: { code: 1100, category: ts.DiagnosticCategory.Error, key: "Invalid use of '{0}' in strict mode." }, + with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: ts.DiagnosticCategory.Error, key: "'with' statements are not allowed in strict mode." }, + delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: ts.DiagnosticCategory.Error, key: "'delete' cannot be called on an identifier in strict mode." }, + A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: ts.DiagnosticCategory.Error, key: "A 'continue' statement can only be used within an enclosing iteration statement." }, + A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: ts.DiagnosticCategory.Error, key: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, + Jump_target_cannot_cross_function_boundary: { code: 1107, category: ts.DiagnosticCategory.Error, key: "Jump target cannot cross function boundary." }, + A_return_statement_can_only_be_used_within_a_function_body: { code: 1108, category: ts.DiagnosticCategory.Error, key: "A 'return' statement can only be used within a function body." }, + Expression_expected: { code: 1109, category: ts.DiagnosticCategory.Error, key: "Expression expected." }, + Type_expected: { code: 1110, category: ts.DiagnosticCategory.Error, key: "Type expected." }, + A_class_member_cannot_be_declared_optional: { code: 1112, category: ts.DiagnosticCategory.Error, key: "A class member cannot be declared optional." }, + A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: ts.DiagnosticCategory.Error, key: "A 'default' clause cannot appear more than once in a 'switch' statement." }, + Duplicate_label_0: { code: 1114, category: ts.DiagnosticCategory.Error, key: "Duplicate label '{0}'" }, + A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: ts.DiagnosticCategory.Error, key: "A 'continue' statement can only jump to a label of an enclosing iteration statement." }, + A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: ts.DiagnosticCategory.Error, key: "A 'break' statement can only jump to a label of an enclosing statement." }, + An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: ts.DiagnosticCategory.Error, key: "An object literal cannot have multiple properties with the same name in strict mode." }, + An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: { code: 1118, category: ts.DiagnosticCategory.Error, key: "An object literal cannot have multiple get/set accessors with the same name." }, + An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { code: 1119, category: ts.DiagnosticCategory.Error, key: "An object literal cannot have property and accessor with the same name." }, + An_export_assignment_cannot_have_modifiers: { code: 1120, category: ts.DiagnosticCategory.Error, key: "An export assignment cannot have modifiers." }, + Octal_literals_are_not_allowed_in_strict_mode: { code: 1121, category: ts.DiagnosticCategory.Error, key: "Octal literals are not allowed in strict mode." }, + A_tuple_type_element_list_cannot_be_empty: { code: 1122, category: ts.DiagnosticCategory.Error, key: "A tuple type element list cannot be empty." }, + Variable_declaration_list_cannot_be_empty: { code: 1123, category: ts.DiagnosticCategory.Error, key: "Variable declaration list cannot be empty." }, + Digit_expected: { code: 1124, category: ts.DiagnosticCategory.Error, key: "Digit expected." }, + Hexadecimal_digit_expected: { code: 1125, category: ts.DiagnosticCategory.Error, key: "Hexadecimal digit expected." }, + Unexpected_end_of_text: { code: 1126, category: ts.DiagnosticCategory.Error, key: "Unexpected end of text." }, + Invalid_character: { code: 1127, category: ts.DiagnosticCategory.Error, key: "Invalid character." }, + Declaration_or_statement_expected: { code: 1128, category: ts.DiagnosticCategory.Error, key: "Declaration or statement expected." }, + Statement_expected: { code: 1129, category: ts.DiagnosticCategory.Error, key: "Statement expected." }, + case_or_default_expected: { code: 1130, category: ts.DiagnosticCategory.Error, key: "'case' or 'default' expected." }, + Property_or_signature_expected: { code: 1131, category: ts.DiagnosticCategory.Error, key: "Property or signature expected." }, + Enum_member_expected: { code: 1132, category: ts.DiagnosticCategory.Error, key: "Enum member expected." }, + Type_reference_expected: { code: 1133, category: ts.DiagnosticCategory.Error, key: "Type reference expected." }, + Variable_declaration_expected: { code: 1134, category: ts.DiagnosticCategory.Error, key: "Variable declaration expected." }, + Argument_expression_expected: { code: 1135, category: ts.DiagnosticCategory.Error, key: "Argument expression expected." }, + Property_assignment_expected: { code: 1136, category: ts.DiagnosticCategory.Error, key: "Property assignment expected." }, + Expression_or_comma_expected: { code: 1137, category: ts.DiagnosticCategory.Error, key: "Expression or comma expected." }, + Parameter_declaration_expected: { code: 1138, category: ts.DiagnosticCategory.Error, key: "Parameter declaration expected." }, + Type_parameter_declaration_expected: { code: 1139, category: ts.DiagnosticCategory.Error, key: "Type parameter declaration expected." }, + Type_argument_expected: { code: 1140, category: ts.DiagnosticCategory.Error, key: "Type argument expected." }, + String_literal_expected: { code: 1141, category: ts.DiagnosticCategory.Error, key: "String literal expected." }, + Line_break_not_permitted_here: { code: 1142, category: ts.DiagnosticCategory.Error, key: "Line break not permitted here." }, + 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." }, + 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." }, + let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1153, category: ts.DiagnosticCategory.Error, key: "'let' declarations are only available when targeting ECMAScript 6 and higher." }, + const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1154, category: ts.DiagnosticCategory.Error, key: "'const' declarations are only available when targeting ECMAScript 6 and higher." }, + const_declarations_must_be_initialized: { code: 1155, category: ts.DiagnosticCategory.Error, key: "'const' declarations must be initialized" }, + const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: ts.DiagnosticCategory.Error, key: "'const' declarations can only be declared inside a block." }, + let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: ts.DiagnosticCategory.Error, key: "'let' declarations can only be declared inside a block." }, + Unterminated_template_literal: { code: 1160, category: ts.DiagnosticCategory.Error, key: "Unterminated template literal." }, + Unterminated_regular_expression_literal: { code: 1161, category: ts.DiagnosticCategory.Error, key: "Unterminated regular expression literal." }, + An_object_member_cannot_be_declared_optional: { code: 1162, category: ts.DiagnosticCategory.Error, key: "An object member cannot be declared optional." }, + yield_expression_must_be_contained_within_a_generator_declaration: { code: 1163, category: ts.DiagnosticCategory.Error, key: "'yield' expression must be contained_within a generator declaration." }, + Computed_property_names_are_not_allowed_in_enums: { code: 1164, category: ts.DiagnosticCategory.Error, key: "Computed property names are not allowed in enums." }, + A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_symbol: { code: 1165, category: ts.DiagnosticCategory.Error, key: "A computed property name in an ambient context must directly refer to a built-in symbol." }, + A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol: { code: 1166, category: ts.DiagnosticCategory.Error, key: "A computed property name in a class property declaration must directly refer to a built-in symbol." }, + Computed_property_names_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1167, category: ts.DiagnosticCategory.Error, key: "Computed property names are only available when targeting ECMAScript 6 and higher." }, + A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol: { code: 1168, category: ts.DiagnosticCategory.Error, key: "A computed property name in a method overload must directly refer to a built-in symbol." }, + A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol: { code: 1169, category: ts.DiagnosticCategory.Error, key: "A computed property name in an interface must directly refer to a built-in symbol." }, + A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol: { code: 1170, category: ts.DiagnosticCategory.Error, key: "A computed property name in a type literal must directly refer to a built-in symbol." }, + A_comma_expression_is_not_allowed_in_a_computed_property_name: { code: 1171, category: ts.DiagnosticCategory.Error, key: "A comma expression is not allowed in a computed property name." }, + extends_clause_already_seen: { code: 1172, category: ts.DiagnosticCategory.Error, key: "'extends' clause already seen." }, + extends_clause_must_precede_implements_clause: { code: 1173, category: ts.DiagnosticCategory.Error, key: "'extends' clause must precede 'implements' clause." }, + Classes_can_only_extend_a_single_class: { code: 1174, category: ts.DiagnosticCategory.Error, key: "Classes can only extend a single class." }, + implements_clause_already_seen: { code: 1175, category: ts.DiagnosticCategory.Error, key: "'implements' clause already seen." }, + Interface_declaration_cannot_have_implements_clause: { code: 1176, category: ts.DiagnosticCategory.Error, key: "Interface declaration cannot have 'implements' clause." }, + Binary_digit_expected: { code: 1177, category: ts.DiagnosticCategory.Error, key: "Binary digit expected." }, + Octal_digit_expected: { code: 1178, category: ts.DiagnosticCategory.Error, key: "Octal digit expected." }, + Unexpected_token_expected: { code: 1179, category: ts.DiagnosticCategory.Error, key: "Unexpected token. '{' expected." }, + Property_destructuring_pattern_expected: { code: 1180, category: ts.DiagnosticCategory.Error, key: "Property destructuring pattern expected." }, + Array_element_destructuring_pattern_expected: { code: 1181, category: ts.DiagnosticCategory.Error, key: "Array element destructuring pattern expected." }, + A_destructuring_declaration_must_have_an_initializer: { code: 1182, category: ts.DiagnosticCategory.Error, key: "A destructuring declaration must have an initializer." }, + Destructuring_declarations_are_not_allowed_in_ambient_contexts: { code: 1183, category: ts.DiagnosticCategory.Error, key: "Destructuring declarations are not allowed in ambient contexts." }, + An_implementation_cannot_be_declared_in_ambient_contexts: { code: 1184, category: ts.DiagnosticCategory.Error, key: "An implementation cannot be declared in ambient contexts." }, + Modifiers_cannot_appear_here: { code: 1184, category: ts.DiagnosticCategory.Error, key: "Modifiers cannot appear here." }, + Merge_conflict_marker_encountered: { code: 1185, category: ts.DiagnosticCategory.Error, key: "Merge conflict marker encountered." }, + A_rest_element_cannot_have_an_initializer: { code: 1186, category: ts.DiagnosticCategory.Error, key: "A rest element cannot have an initializer." }, + A_parameter_property_may_not_be_a_binding_pattern: { code: 1187, category: ts.DiagnosticCategory.Error, key: "A parameter property may not be a binding pattern." }, + Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement: { code: 1188, category: ts.DiagnosticCategory.Error, key: "Only a single variable declaration is allowed in a 'for...of' statement." }, + 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." }, + 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." }, + 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." }, + An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: { code: 1198, category: ts.DiagnosticCategory.Error, key: "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive." }, + Unterminated_Unicode_escape_sequence: { code: 1199, category: ts.DiagnosticCategory.Error, key: "Unterminated Unicode escape sequence." }, + Line_terminator_not_permitted_before_arrow: { code: 1200, category: ts.DiagnosticCategory.Error, key: "Line terminator not permitted before arrow." }, + A_type_annotation_on_an_export_statement_is_only_allowed_in_an_ambient_external_module_declaration: { code: 1201, category: ts.DiagnosticCategory.Error, key: "A type annotation on an export statement is only allowed in an ambient external module declaration." }, + 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." }, + 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." }, + 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." }, + 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}'." }, + 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." }, + A_class_may_only_extend_another_class: { code: 2311, category: ts.DiagnosticCategory.Error, key: "A class may only extend another class." }, + An_interface_may_only_extend_a_class_or_another_interface: { code: 2312, category: ts.DiagnosticCategory.Error, key: "An interface may only extend a class or another interface." }, + Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2313, category: ts.DiagnosticCategory.Error, key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, + Generic_type_0_requires_1_type_argument_s: { code: 2314, category: ts.DiagnosticCategory.Error, key: "Generic type '{0}' requires {1} type argument(s)." }, + Type_0_is_not_generic: { code: 2315, category: ts.DiagnosticCategory.Error, key: "Type '{0}' is not generic." }, + Global_type_0_must_be_a_class_or_interface_type: { code: 2316, category: ts.DiagnosticCategory.Error, key: "Global type '{0}' must be a class or interface type." }, + Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: ts.DiagnosticCategory.Error, key: "Global type '{0}' must have {1} type parameter(s)." }, + Cannot_find_global_type_0: { code: 2318, category: ts.DiagnosticCategory.Error, key: "Cannot find global type '{0}'." }, + Named_property_0_of_types_1_and_2_are_not_identical: { code: 2319, category: ts.DiagnosticCategory.Error, key: "Named property '{0}' of types '{1}' and '{2}' are not identical." }, + Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: ts.DiagnosticCategory.Error, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." }, + Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: ts.DiagnosticCategory.Error, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, + Type_0_is_not_assignable_to_type_1: { code: 2322, category: ts.DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}'." }, + Property_0_is_missing_in_type_1: { code: 2324, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is missing in type '{1}'." }, + Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, + Types_of_property_0_are_incompatible: { code: 2326, category: ts.DiagnosticCategory.Error, key: "Types of property '{0}' are incompatible." }, + Property_0_is_optional_in_type_1_but_required_in_type_2: { code: 2327, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." }, + 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_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." }, + super_can_only_be_referenced_in_a_derived_class: { code: 2335, category: ts.DiagnosticCategory.Error, key: "'super' can only be referenced in a derived class." }, + super_cannot_be_referenced_in_constructor_arguments: { code: 2336, category: ts.DiagnosticCategory.Error, key: "'super' cannot be referenced in constructor arguments." }, + Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: 2337, category: ts.DiagnosticCategory.Error, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, + super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2338, category: ts.DiagnosticCategory.Error, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, + Property_0_does_not_exist_on_type_1: { code: 2339, category: ts.DiagnosticCategory.Error, key: "Property '{0}' does not exist on type '{1}'." }, + Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: ts.DiagnosticCategory.Error, key: "Only public and protected methods of the base class are accessible via the 'super' keyword" }, + Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is private and only accessible within class '{1}'." }, + An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: { code: 2342, category: ts.DiagnosticCategory.Error, key: "An index expression argument must be of type 'string', 'number', 'symbol, or 'any'." }, + Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: ts.DiagnosticCategory.Error, key: "Type '{0}' does not satisfy the constraint '{1}'." }, + Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: ts.DiagnosticCategory.Error, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, + Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: ts.DiagnosticCategory.Error, key: "Supplied parameters do not match any signature of call target." }, + Untyped_function_calls_may_not_accept_type_arguments: { code: 2347, category: ts.DiagnosticCategory.Error, key: "Untyped function calls may not accept type arguments." }, + Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { code: 2348, category: ts.DiagnosticCategory.Error, key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" }, + Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { code: 2349, category: ts.DiagnosticCategory.Error, key: "Cannot invoke an expression whose type lacks a call signature." }, + Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: ts.DiagnosticCategory.Error, key: "Only a void function can be called with the 'new' keyword." }, + Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: ts.DiagnosticCategory.Error, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, + Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: ts.DiagnosticCategory.Error, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, + No_best_common_type_exists_among_return_expressions: { code: 2354, category: ts.DiagnosticCategory.Error, key: "No best common type exists among return expressions." }, + A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: ts.DiagnosticCategory.Error, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, + An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: ts.DiagnosticCategory.Error, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, + The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2357, category: ts.DiagnosticCategory.Error, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, + The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: ts.DiagnosticCategory.Error, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, + The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: ts.DiagnosticCategory.Error, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, + The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: { code: 2360, category: ts.DiagnosticCategory.Error, key: "The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'." }, + The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: ts.DiagnosticCategory.Error, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, + The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: ts.DiagnosticCategory.Error, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, + The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: ts.DiagnosticCategory.Error, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, + Invalid_left_hand_side_of_assignment_expression: { code: 2364, category: ts.DiagnosticCategory.Error, key: "Invalid left-hand side of assignment expression." }, + Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: ts.DiagnosticCategory.Error, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, + Type_parameter_name_cannot_be_0: { code: 2368, category: ts.DiagnosticCategory.Error, key: "Type parameter name cannot be '{0}'" }, + A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: ts.DiagnosticCategory.Error, key: "A parameter property is only allowed in a constructor implementation." }, + A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: ts.DiagnosticCategory.Error, key: "A rest parameter must be of an array type." }, + A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: ts.DiagnosticCategory.Error, key: "A parameter initializer is only allowed in a function or constructor implementation." }, + Parameter_0_cannot_be_referenced_in_its_initializer: { code: 2372, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' cannot be referenced in its initializer." }, + Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { code: 2373, category: ts.DiagnosticCategory.Error, key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." }, + Duplicate_string_index_signature: { code: 2374, category: ts.DiagnosticCategory.Error, key: "Duplicate string index signature." }, + Duplicate_number_index_signature: { code: 2375, category: ts.DiagnosticCategory.Error, key: "Duplicate number index signature." }, + A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: 2376, category: ts.DiagnosticCategory.Error, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, + Constructors_for_derived_classes_must_contain_a_super_call: { code: 2377, category: ts.DiagnosticCategory.Error, key: "Constructors for derived classes must contain a 'super' call." }, + A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2378, category: ts.DiagnosticCategory.Error, key: "A 'get' accessor must return a value or consist of a single 'throw' statement." }, + Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2379, category: ts.DiagnosticCategory.Error, key: "Getter and setter accessors do not agree in visibility." }, + get_and_set_accessor_must_have_the_same_type: { code: 2380, category: ts.DiagnosticCategory.Error, key: "'get' and 'set' accessor must have the same type." }, + A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2381, category: ts.DiagnosticCategory.Error, key: "A signature with an implementation cannot use a string literal type." }, + Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 2382, category: ts.DiagnosticCategory.Error, key: "Specialized overload signature is not assignable to any non-specialized signature." }, + Overload_signatures_must_all_be_exported_or_not_exported: { code: 2383, category: ts.DiagnosticCategory.Error, key: "Overload signatures must all be exported or not exported." }, + Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2384, category: ts.DiagnosticCategory.Error, key: "Overload signatures must all be ambient or non-ambient." }, + Overload_signatures_must_all_be_public_private_or_protected: { code: 2385, category: ts.DiagnosticCategory.Error, key: "Overload signatures must all be public, private or protected." }, + Overload_signatures_must_all_be_optional_or_required: { code: 2386, category: ts.DiagnosticCategory.Error, key: "Overload signatures must all be optional or required." }, + Function_overload_must_be_static: { code: 2387, category: ts.DiagnosticCategory.Error, key: "Function overload must be static." }, + Function_overload_must_not_be_static: { code: 2388, category: ts.DiagnosticCategory.Error, key: "Function overload must not be static." }, + Function_implementation_name_must_be_0: { code: 2389, category: ts.DiagnosticCategory.Error, key: "Function implementation name must be '{0}'." }, + Constructor_implementation_is_missing: { code: 2390, category: ts.DiagnosticCategory.Error, key: "Constructor implementation is missing." }, + Function_implementation_is_missing_or_not_immediately_following_the_declaration: { code: 2391, category: ts.DiagnosticCategory.Error, key: "Function implementation is missing or not immediately following the declaration." }, + Multiple_constructor_implementations_are_not_allowed: { code: 2392, category: ts.DiagnosticCategory.Error, key: "Multiple constructor implementations are not allowed." }, + Duplicate_function_implementation: { code: 2393, category: ts.DiagnosticCategory.Error, key: "Duplicate function implementation." }, + Overload_signature_is_not_compatible_with_function_implementation: { code: 2394, category: ts.DiagnosticCategory.Error, key: "Overload signature is not compatible with function implementation." }, + Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2395, category: ts.DiagnosticCategory.Error, key: "Individual declarations in merged declaration {0} must be all exported or all local." }, + Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2396, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, + Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2399, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, + Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2400, category: ts.DiagnosticCategory.Error, key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, + Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2401, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, + Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { code: 2402, category: ts.DiagnosticCategory.Error, key: "Expression resolves to '_super' that compiler uses to capture base class reference." }, + Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { code: 2403, category: ts.DiagnosticCategory.Error, key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." }, + The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { code: 2404, category: ts.DiagnosticCategory.Error, key: "The left-hand side of a 'for...in' statement cannot use a type annotation." }, + The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { code: 2405, category: ts.DiagnosticCategory.Error, key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." }, + Invalid_left_hand_side_in_for_in_statement: { code: 2406, category: ts.DiagnosticCategory.Error, key: "Invalid left-hand side in 'for...in' statement." }, + The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: ts.DiagnosticCategory.Error, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, + Setters_cannot_return_a_value: { code: 2408, category: ts.DiagnosticCategory.Error, key: "Setters cannot return a value." }, + Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: ts.DiagnosticCategory.Error, key: "Return type of constructor signature must be assignable to the instance type of the class" }, + All_symbols_within_a_with_block_will_be_resolved_to_any: { code: 2410, category: ts.DiagnosticCategory.Error, key: "All symbols within a 'with' block will be resolved to 'any'." }, + Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: ts.DiagnosticCategory.Error, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, + Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: ts.DiagnosticCategory.Error, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, + Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: ts.DiagnosticCategory.Error, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, + Class_name_cannot_be_0: { code: 2414, category: ts.DiagnosticCategory.Error, key: "Class name cannot be '{0}'" }, + Class_0_incorrectly_extends_base_class_1: { code: 2415, category: ts.DiagnosticCategory.Error, key: "Class '{0}' incorrectly extends base class '{1}'." }, + Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: ts.DiagnosticCategory.Error, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, + Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: ts.DiagnosticCategory.Error, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, + Class_0_incorrectly_implements_interface_1: { code: 2420, category: ts.DiagnosticCategory.Error, key: "Class '{0}' incorrectly implements interface '{1}'." }, + A_class_may_only_implement_another_class_or_interface: { code: 2422, category: ts.DiagnosticCategory.Error, key: "A class may only implement another class or interface." }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: ts.DiagnosticCategory.Error, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: ts.DiagnosticCategory.Error, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, + Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: ts.DiagnosticCategory.Error, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, + Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: ts.DiagnosticCategory.Error, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, + Interface_name_cannot_be_0: { code: 2427, category: ts.DiagnosticCategory.Error, key: "Interface name cannot be '{0}'" }, + All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: ts.DiagnosticCategory.Error, key: "All declarations of an interface must have identical type parameters." }, + 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." }, + 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_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." }, + 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}'." }, + Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { code: 2445, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." }, + Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, + The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: ts.DiagnosticCategory.Error, key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, + Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: ts.DiagnosticCategory.Error, key: "Block-scoped variable '{0}' used before its declaration." }, + The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant: { code: 2449, category: ts.DiagnosticCategory.Error, key: "The operand of an increment or decrement operator cannot be a constant." }, + Left_hand_side_of_assignment_expression_cannot_be_a_constant: { code: 2450, category: ts.DiagnosticCategory.Error, key: "Left-hand side of assignment expression cannot be a constant." }, + Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: ts.DiagnosticCategory.Error, key: "Cannot redeclare block-scoped variable '{0}'." }, + An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: ts.DiagnosticCategory.Error, key: "An enum member cannot have a numeric name." }, + The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: ts.DiagnosticCategory.Error, key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, + Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: ts.DiagnosticCategory.Error, key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, + Type_alias_0_circularly_references_itself: { code: 2456, category: ts.DiagnosticCategory.Error, key: "Type alias '{0}' circularly references itself." }, + Type_alias_name_cannot_be_0: { code: 2457, category: ts.DiagnosticCategory.Error, key: "Type alias name cannot be '{0}'" }, + An_AMD_module_cannot_have_multiple_name_assignments: { code: 2458, category: ts.DiagnosticCategory.Error, key: "An AMD module cannot have multiple name assignments." }, + Type_0_has_no_property_1_and_no_string_index_signature: { code: 2459, category: ts.DiagnosticCategory.Error, key: "Type '{0}' has no property '{1}' and no string index signature." }, + Type_0_has_no_property_1: { code: 2460, category: ts.DiagnosticCategory.Error, key: "Type '{0}' has no property '{1}'." }, + Type_0_is_not_an_array_type: { code: 2461, category: ts.DiagnosticCategory.Error, key: "Type '{0}' is not an array type." }, + A_rest_element_must_be_last_in_an_array_destructuring_pattern: { code: 2462, category: ts.DiagnosticCategory.Error, key: "A rest element must be last in an array destructuring pattern" }, + A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: { code: 2463, category: ts.DiagnosticCategory.Error, key: "A binding pattern parameter cannot be optional in an implementation signature." }, + A_computed_property_name_must_be_of_type_string_number_symbol_or_any: { code: 2464, category: ts.DiagnosticCategory.Error, key: "A computed property name must be of type 'string', 'number', 'symbol', or 'any'." }, + this_cannot_be_referenced_in_a_computed_property_name: { code: 2465, category: ts.DiagnosticCategory.Error, key: "'this' cannot be referenced in a computed property name." }, + super_cannot_be_referenced_in_a_computed_property_name: { code: 2466, category: ts.DiagnosticCategory.Error, key: "'super' cannot be referenced in a computed property name." }, + A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: { code: 2467, category: ts.DiagnosticCategory.Error, key: "A computed property name cannot reference a type parameter from its containing type." }, + Cannot_find_global_value_0: { code: 2468, category: ts.DiagnosticCategory.Error, key: "Cannot find global value '{0}'." }, + The_0_operator_cannot_be_applied_to_type_symbol: { code: 2469, category: ts.DiagnosticCategory.Error, key: "The '{0}' operator cannot be applied to type 'symbol'." }, + Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object: { code: 2470, category: ts.DiagnosticCategory.Error, key: "'Symbol' reference does not refer to the global Symbol constructor object." }, + A_computed_property_name_of_the_form_0_must_be_of_type_symbol: { code: 2471, category: ts.DiagnosticCategory.Error, key: "A computed property name of the form '{0}' must be of type 'symbol'." }, + Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_6_and_higher: { code: 2472, category: ts.DiagnosticCategory.Error, key: "Spread operator in 'new' expressions is only available when targeting ECMAScript 6 and higher." }, + Enum_declarations_must_all_be_const_or_non_const: { code: 2473, category: ts.DiagnosticCategory.Error, key: "Enum declarations must all be const or non-const." }, + In_const_enum_declarations_member_initializer_must_be_constant_expression: { code: 2474, category: ts.DiagnosticCategory.Error, key: "In 'const' enum declarations member initializer must be constant expression." }, + const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: { code: 2475, category: ts.DiagnosticCategory.Error, key: "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment." }, + A_const_enum_member_can_only_be_accessed_using_a_string_literal: { code: 2476, category: ts.DiagnosticCategory.Error, key: "A const enum member can only be accessed using a string literal." }, + const_enum_member_initializer_was_evaluated_to_a_non_finite_value: { code: 2477, category: ts.DiagnosticCategory.Error, key: "'const' enum member initializer was evaluated to a non-finite value." }, + const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: { code: 2478, category: ts.DiagnosticCategory.Error, key: "'const' enum member initializer was evaluated to disallowed value 'NaN'." }, + Property_0_does_not_exist_on_const_enum_1: { code: 2479, category: ts.DiagnosticCategory.Error, key: "Property '{0}' does not exist on 'const' enum '{1}'." }, + let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { code: 2480, category: ts.DiagnosticCategory.Error, key: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." }, + Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { code: 2481, category: ts.DiagnosticCategory.Error, key: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." }, + The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: { code: 2483, category: ts.DiagnosticCategory.Error, key: "The left-hand side of a 'for...of' statement cannot use a type annotation." }, + Export_declaration_conflicts_with_exported_declaration_of_0: { code: 2484, category: ts.DiagnosticCategory.Error, key: "Export declaration conflicts with exported declaration of '{0}'" }, + The_left_hand_side_of_a_for_of_statement_cannot_be_a_previously_defined_constant: { code: 2485, category: ts.DiagnosticCategory.Error, key: "The left-hand side of a 'for...of' statement cannot be a previously defined constant." }, + The_left_hand_side_of_a_for_in_statement_cannot_be_a_previously_defined_constant: { code: 2486, category: ts.DiagnosticCategory.Error, key: "The left-hand side of a 'for...in' statement cannot be a previously defined constant." }, + Invalid_left_hand_side_in_for_of_statement: { code: 2487, category: ts.DiagnosticCategory.Error, key: "Invalid left-hand side in 'for...of' statement." }, + The_right_hand_side_of_a_for_of_statement_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2488, category: ts.DiagnosticCategory.Error, key: "The right-hand side of a 'for...of' statement must have a '[Symbol.iterator]()' method that returns an iterator." }, + The_iterator_returned_by_the_right_hand_side_of_a_for_of_statement_must_have_a_next_method: { code: 2489, category: ts.DiagnosticCategory.Error, key: "The iterator returned by the right-hand side of a 'for...of' statement must have a 'next()' method." }, + The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: { code: 2490, category: ts.DiagnosticCategory.Error, key: "The type returned by the 'next()' method of an iterator must have a 'value' property." }, + The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: { code: 2491, category: ts.DiagnosticCategory.Error, key: "The left-hand side of a 'for...in' statement cannot be a destructuring pattern." }, + Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: ts.DiagnosticCategory.Error, key: "Cannot redeclare identifier '{0}' in catch clause" }, + Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: { code: 2493, category: ts.DiagnosticCategory.Error, key: "Tuple type '{0}' with length '{1}' cannot be assigned to tuple with length '{2}'." }, + 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_Consider_using_a_standard_function_expression: { code: 2496, category: ts.DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an arrow function. 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 *'." }, + 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." }, + 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}'." }, + Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4006, category: ts.DiagnosticCategory.Error, key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4008, category: ts.DiagnosticCategory.Error, key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4010, category: ts.DiagnosticCategory.Error, key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, + Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4012, category: ts.DiagnosticCategory.Error, key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." }, + Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: ts.DiagnosticCategory.Error, key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: ts.DiagnosticCategory.Error, key: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, + Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: ts.DiagnosticCategory.Error, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, + Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: ts.DiagnosticCategory.Error, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, + Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: ts.DiagnosticCategory.Error, key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, + Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: ts.DiagnosticCategory.Error, key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, + Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: ts.DiagnosticCategory.Error, key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, + Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: ts.DiagnosticCategory.Error, key: "Exported variable '{0}' has or is using private name '{1}'." }, + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4026, category: ts.DiagnosticCategory.Error, key: "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4027, category: ts.DiagnosticCategory.Error, key: "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, + Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4028, category: ts.DiagnosticCategory.Error, key: "Public static property '{0}' of exported class has or is using private name '{1}'." }, + Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4029, category: ts.DiagnosticCategory.Error, key: "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4030, category: ts.DiagnosticCategory.Error, key: "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, + Public_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4031, category: ts.DiagnosticCategory.Error, key: "Public property '{0}' of exported class has or is using private name '{1}'." }, + Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4032, category: ts.DiagnosticCategory.Error, key: "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, + Property_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4033, category: ts.DiagnosticCategory.Error, key: "Property '{0}' of exported interface has or is using private name '{1}'." }, + Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4034, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4035, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'." }, + Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4036, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4037, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'." }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4038, category: ts.DiagnosticCategory.Error, key: "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4039, category: ts.DiagnosticCategory.Error, key: "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4040, category: ts.DiagnosticCategory.Error, key: "Return type of public static property getter from exported class has or is using private name '{0}'." }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4041, category: ts.DiagnosticCategory.Error, key: "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4042, category: ts.DiagnosticCategory.Error, key: "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4043, category: ts.DiagnosticCategory.Error, key: "Return type of public property getter from exported class has or is using private name '{0}'." }, + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4044, category: ts.DiagnosticCategory.Error, key: "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4045, category: ts.DiagnosticCategory.Error, key: "Return type of constructor signature from exported interface has or is using private name '{0}'." }, + Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4046, category: ts.DiagnosticCategory.Error, key: "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4047, category: ts.DiagnosticCategory.Error, key: "Return type of call signature from exported interface has or is using private name '{0}'." }, + Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4048, category: ts.DiagnosticCategory.Error, key: "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4049, category: ts.DiagnosticCategory.Error, key: "Return type of index signature from exported interface has or is using private name '{0}'." }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4050, category: ts.DiagnosticCategory.Error, key: "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4051, category: ts.DiagnosticCategory.Error, key: "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: { code: 4052, category: ts.DiagnosticCategory.Error, key: "Return type of public static method from exported class has or is using private name '{0}'." }, + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4053, category: ts.DiagnosticCategory.Error, key: "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4054, category: ts.DiagnosticCategory.Error, key: "Return type of public method from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: { code: 4055, category: ts.DiagnosticCategory.Error, key: "Return type of public method from exported class has or is using private name '{0}'." }, + Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4056, category: ts.DiagnosticCategory.Error, key: "Return type of method from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: { code: 4057, category: ts.DiagnosticCategory.Error, key: "Return type of method from exported interface has or is using private name '{0}'." }, + Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4058, category: ts.DiagnosticCategory.Error, key: "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: { code: 4059, category: ts.DiagnosticCategory.Error, key: "Return type of exported function has or is using name '{0}' from private module '{1}'." }, + Return_type_of_exported_function_has_or_is_using_private_name_0: { code: 4060, category: ts.DiagnosticCategory.Error, key: "Return type of exported function has or is using private name '{0}'." }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4061, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4062, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: { code: 4063, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of constructor from exported class has or is using private name '{1}'." }, + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4064, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4065, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4066, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4067, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4068, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4069, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4070, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4071, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4072, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4073, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public method from exported class has or is using private name '{1}'." }, + Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4074, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4075, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of method from exported interface has or is using private name '{1}'." }, + Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, + Exported_type_alias_0_has_or_is_using_private_name_1: { code: 4081, category: ts.DiagnosticCategory.Error, key: "Exported type alias '{0}' has or is using private name '{1}'." }, + Default_export_of_the_module_has_or_is_using_private_name_0: { code: 4082, category: ts.DiagnosticCategory.Error, key: "Default export of the module has or is using private name '{0}'." }, + Loop_contains_block_scoped_variable_0_referenced_by_a_function_in_the_loop_This_is_only_supported_in_ECMAScript_6_or_higher: { code: 4091, category: ts.DiagnosticCategory.Error, key: "Loop contains block-scoped variable '{0}' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher." }, + The_current_host_does_not_support_the_0_option: { code: 5001, category: ts.DiagnosticCategory.Error, key: "The current host does not support the '{0}' option." }, + 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." }, + 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}" }, + Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5038, category: ts.DiagnosticCategory.Error, key: "Option 'mapRoot' cannot be specified without specifying 'sourcemap' option." }, + Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5039, category: ts.DiagnosticCategory.Error, key: "Option 'sourceRoot' cannot be specified without specifying 'sourcemap' option." }, + Option_noEmit_cannot_be_specified_with_option_out_or_outDir: { code: 5040, category: ts.DiagnosticCategory.Error, key: "Option 'noEmit' cannot be specified with option 'out' or 'outDir'." }, + Option_noEmit_cannot_be_specified_with_option_declaration: { code: 5041, category: ts.DiagnosticCategory.Error, key: "Option 'noEmit' cannot be specified with option 'declaration'." }, + Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { code: 5042, category: ts.DiagnosticCategory.Error, key: "Option 'project' cannot be mixed with source files on a command line." }, + Option_sourceMap_cannot_be_specified_with_option_separateCompilation: { code: 5043, category: ts.DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'separateCompilation'." }, + Option_declaration_cannot_be_specified_with_option_separateCompilation: { code: 5044, category: ts.DiagnosticCategory.Error, key: "Option 'declaration' cannot be specified with option 'separateCompilation'." }, + 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." }, + 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." }, + Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { code: 6004, category: ts.DiagnosticCategory.Message, key: "Specifies the location where debugger should locate TypeScript files instead of source locations." }, + Watch_input_files: { code: 6005, category: ts.DiagnosticCategory.Message, key: "Watch input files." }, + Redirect_output_structure_to_the_directory: { code: 6006, category: ts.DiagnosticCategory.Message, key: "Redirect output structure to the directory." }, + Do_not_erase_const_enum_declarations_in_generated_code: { code: 6007, category: ts.DiagnosticCategory.Message, key: "Do not erase const enum declarations in generated code." }, + Do_not_emit_outputs_if_any_type_checking_errors_were_reported: { code: 6008, category: ts.DiagnosticCategory.Message, key: "Do not emit outputs if any type checking errors were reported." }, + 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'" }, + 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." }, + Syntax_Colon_0: { code: 6023, category: ts.DiagnosticCategory.Message, key: "Syntax: {0}" }, + options: { code: 6024, category: ts.DiagnosticCategory.Message, key: "options" }, + file: { code: 6025, category: ts.DiagnosticCategory.Message, key: "file" }, + Examples_Colon_0: { code: 6026, category: ts.DiagnosticCategory.Message, key: "Examples: {0}" }, + Options_Colon: { code: 6027, category: ts.DiagnosticCategory.Message, key: "Options:" }, + Version_0: { code: 6029, category: ts.DiagnosticCategory.Message, key: "Version {0}" }, + Insert_command_line_options_and_files_from_a_file: { code: 6030, category: ts.DiagnosticCategory.Message, key: "Insert command line options and files from a file." }, + File_change_detected_Starting_incremental_compilation: { code: 6032, category: ts.DiagnosticCategory.Message, key: "File change detected. Starting incremental compilation..." }, + KIND: { code: 6034, category: ts.DiagnosticCategory.Message, key: "KIND" }, + FILE: { code: 6035, category: ts.DiagnosticCategory.Message, key: "FILE" }, + VERSION: { code: 6036, category: ts.DiagnosticCategory.Message, key: "VERSION" }, + LOCATION: { code: 6037, category: ts.DiagnosticCategory.Message, key: "LOCATION" }, + DIRECTORY: { code: 6038, category: ts.DiagnosticCategory.Message, key: "DIRECTORY" }, + Compilation_complete_Watching_for_file_changes: { code: 6042, category: ts.DiagnosticCategory.Message, key: "Compilation complete. Watching for file changes." }, + 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'." }, + 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}'." }, + Corrupted_locale_file_0: { code: 6051, category: ts.DiagnosticCategory.Error, key: "Corrupted locale file {0}." }, + Raise_error_on_expressions_and_declarations_with_an_implied_any_type: { code: 6052, category: ts.DiagnosticCategory.Message, key: "Raise error on expressions and declarations with an implied 'any' type." }, + File_0_not_found: { code: 6053, category: ts.DiagnosticCategory.Error, key: "File '{0}' not found." }, + File_0_must_have_extension_ts_or_d_ts: { code: 6054, category: ts.DiagnosticCategory.Error, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, + Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: { code: 6055, category: ts.DiagnosticCategory.Message, key: "Suppress noImplicitAny errors for indexing objects lacking index signatures." }, + Do_not_emit_declarations_for_code_that_has_an_internal_annotation: { code: 6056, category: ts.DiagnosticCategory.Message, key: "Do not emit declarations for code that has an '@internal' annotation." }, + Preserve_new_lines_when_emitting_code: { code: 6057, category: ts.DiagnosticCategory.Message, key: "Preserve new-lines when emitting code." }, + 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." }, + new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: { code: 7009, category: ts.DiagnosticCategory.Error, key: "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type." }, + _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: ts.DiagnosticCategory.Error, key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, + Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: ts.DiagnosticCategory.Error, key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, + Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: ts.DiagnosticCategory.Error, key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, + Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: ts.DiagnosticCategory.Error, key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, + Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: ts.DiagnosticCategory.Error, key: "Index signature of object type implicitly has an 'any' type." }, + 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." }, + You_cannot_rename_this_element: { code: 8000, category: ts.DiagnosticCategory.Error, key: "You cannot rename this element." }, + You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: { code: 8001, category: ts.DiagnosticCategory.Error, key: "You cannot rename elements that are defined in the standard TypeScript library." }, + yield_expressions_are_not_currently_supported: { code: 9000, category: ts.DiagnosticCategory.Error, key: "'yield' expressions are not currently supported." }, + Generators_are_not_currently_supported: { code: 9001, category: ts.DiagnosticCategory.Error, key: "Generators are not currently supported." }, + Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clauses: { code: 9002, category: ts.DiagnosticCategory.Error, key: "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses." }, + class_expressions_are_not_currently_supported: { code: 9003, category: ts.DiagnosticCategory.Error, key: "'class' expressions are not currently supported." }, + class_declarations_are_only_supported_directly_inside_a_module_or_as_a_top_level_declaration: { code: 9004, category: ts.DiagnosticCategory.Error, key: "'class' declarations are only supported directly inside a module or as a top level declaration." } }; })(ts || (ts = {})); +/// +/// var ts; (function (ts) { var textToToken = { - "any": 111, - "as": 101, - "boolean": 112, - "break": 65, - "case": 66, - "catch": 67, - "class": 68, - "continue": 70, - "const": 69, - "constructor": 113, - "debugger": 71, - "declare": 114, - "default": 72, - "delete": 73, - "do": 74, - "else": 75, - "enum": 76, - "export": 77, - "extends": 78, - "false": 79, - "finally": 80, - "for": 81, - "from": 123, - "function": 82, - "get": 115, - "if": 83, - "implements": 102, - "import": 84, - "in": 85, - "instanceof": 86, - "interface": 103, - "let": 104, - "module": 116, - "new": 87, - "null": 88, - "number": 118, - "package": 105, - "private": 106, - "protected": 107, - "public": 108, - "require": 117, - "return": 89, - "set": 119, - "static": 109, - "string": 120, - "super": 90, - "switch": 91, - "symbol": 121, - "this": 92, - "throw": 93, - "true": 94, - "try": 95, - "type": 122, - "typeof": 96, - "var": 97, - "void": 98, - "while": 99, - "with": 100, - "yield": 110, - "of": 124, + "any": 112, + "as": 102, + "boolean": 113, + "break": 66, + "case": 67, + "catch": 68, + "class": 69, + "continue": 71, + "const": 70, + "constructor": 114, + "debugger": 72, + "declare": 115, + "default": 73, + "delete": 74, + "do": 75, + "else": 76, + "enum": 77, + "export": 78, + "extends": 79, + "false": 80, + "finally": 81, + "for": 82, + "from": 124, + "function": 83, + "get": 116, + "if": 84, + "implements": 103, + "import": 85, + "in": 86, + "instanceof": 87, + "interface": 104, + "let": 105, + "module": 117, + "new": 88, + "null": 89, + "number": 119, + "package": 106, + "private": 107, + "protected": 108, + "public": 109, + "require": 118, + "return": 90, + "set": 120, + "static": 110, + "string": 121, + "super": 91, + "switch": 92, + "symbol": 122, + "this": 93, + "throw": 94, + "true": 95, + "try": 96, + "type": 123, + "typeof": 97, + "var": 98, + "void": 99, + "while": 100, + "with": 101, + "yield": 111, + "of": 125, "{": 14, "}": 15, "(": 16, @@ -2054,18 +2117,19 @@ var ts; "||": 49, "?": 50, ":": 51, - "=": 52, - "+=": 53, - "-=": 54, - "*=": 55, - "/=": 56, - "%=": 57, - "<<=": 58, - ">>=": 59, - ">>>=": 60, - "&=": 61, - "|=": 62, - "^=": 63 + "=": 53, + "+=": 54, + "-=": 55, + "*=": 56, + "/=": 57, + "%=": 58, + "<<=": 59, + ">>=": 60, + ">>>=": 61, + "&=": 62, + "|=": 63, + "^=": 64, + "@": 52 }; var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; @@ -2106,9 +2170,9 @@ var ts; } function makeReverseMap(source) { var result = []; - for (var _name in source) { - if (source.hasOwnProperty(_name)) { - result[source[_name]] = _name; + for (var name_2 in source) { + if (source.hasOwnProperty(name_2)) { + result[source[name_2]] = name_2; } } return result; @@ -2118,6 +2182,10 @@ var ts; return tokenStrings[t]; } ts.tokenToString = tokenToString; + function stringToToken(s) { + return textToToken[s]; + } + ts.stringToToken = stringToToken; function computeLineStarts(text) { var result = new Array(); var pos = 0; @@ -2175,13 +2243,35 @@ var ts; ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition; var hasOwnProperty = Object.prototype.hasOwnProperty; function isWhiteSpace(ch) { - return ch === 32 || ch === 9 || ch === 11 || ch === 12 || - ch === 160 || ch === 5760 || ch >= 8192 && ch <= 8203 || - ch === 8239 || ch === 8287 || ch === 12288 || ch === 65279; + return ch === 32 || + ch === 9 || + ch === 11 || + ch === 12 || + ch === 160 || + ch === 133 || + ch === 5760 || + ch >= 8192 && ch <= 8203 || + ch === 8239 || + ch === 8287 || + ch === 12288 || + ch === 65279; } ts.isWhiteSpace = isWhiteSpace; function isLineBreak(ch) { - return ch === 10 || ch === 13 || ch === 8232 || ch === 8233 || ch === 133; + // ES5 7.3: + // The ECMAScript line terminator characters are listed in Table 3. + // Table 3 � Line Terminator Characters + // Code Unit Value Name Formal Name + // \u000A Line Feed + // \u000D Carriage Return + // \u2028 Line separator + // \u2029 Paragraph separator + // Only the characters in Table 3 are treated as line terminators. Other new line or line + // breaking characters are treated as white space but not as line terminators. + return ch === 10 || + ch === 13 || + ch === 8232 || + ch === 8233; } ts.isLineBreak = isLineBreak; function isDigit(ch) { @@ -2284,8 +2374,8 @@ var ts; else { ts.Debug.assert(ch === 61); while (pos < len) { - var _ch = text.charCodeAt(pos); - if (_ch === 62 && isConflictMarkerTrivia(text, pos)) { + var ch_1 = text.charCodeAt(pos); + if (ch_1 === 62 && isConflictMarkerTrivia(text, pos)) { break; } pos++; @@ -2300,8 +2390,9 @@ var ts; var ch = text.charCodeAt(pos); switch (ch) { case 13: - if (text.charCodeAt(pos + 1) === 10) + if (text.charCodeAt(pos + 1) === 10) { pos++; + } case 10: pos++; if (trailing) { @@ -2343,8 +2434,9 @@ var ts; } } if (collecting) { - if (!result) + if (!result) { result = []; + } result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine }); } continue; @@ -2683,14 +2775,14 @@ var ts; return result; } function getIdentifierToken() { - var _len = tokenValue.length; - if (_len >= 2 && _len <= 11) { + var len = tokenValue.length; + if (len >= 2 && len <= 11) { var ch = tokenValue.charCodeAt(0); if (ch >= 97 && ch <= 122 && hasOwnProperty.call(textToToken, tokenValue)) { return token = textToToken[tokenValue]; } } - return token = 64; + return token = 65; } function scanBinaryOrOctalDigits(base) { ts.Debug.assert(base !== 2 || base !== 8, "Expected either base 2 or base 8"); @@ -2769,7 +2861,7 @@ var ts; return token = scanTemplateAndSetTokenValue(); case 37: if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 57; + return pos += 2, token = 58; } return pos++, token = 37; case 38: @@ -2777,7 +2869,7 @@ var ts; return pos += 2, token = 48; } if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 61; + return pos += 2, token = 62; } return pos++, token = 43; case 40: @@ -2786,7 +2878,7 @@ var ts; return pos++, token = 17; case 42: if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 55; + return pos += 2, token = 56; } return pos++, token = 35; case 43: @@ -2794,7 +2886,7 @@ var ts; return pos += 2, token = 38; } if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 53; + return pos += 2, token = 54; } return pos++, token = 33; case 44: @@ -2804,7 +2896,7 @@ var ts; return pos += 2, token = 39; } if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 54; + return pos += 2, token = 55; } return pos++, token = 34; case 46: @@ -2836,13 +2928,13 @@ var ts; pos += 2; var commentClosed = false; while (pos < len) { - var _ch = text.charCodeAt(pos); - if (_ch === 42 && text.charCodeAt(pos + 1) === 47) { + var ch_2 = text.charCodeAt(pos); + if (ch_2 === 42 && text.charCodeAt(pos + 1) === 47) { pos += 2; commentClosed = true; break; } - if (isLineBreak(_ch)) { + if (isLineBreak(ch_2)) { precedingLineBreak = true; } pos++; @@ -2859,7 +2951,7 @@ var ts; } } if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 56; + return pos += 2, token = 57; } return pos++, token = 36; case 48: @@ -2875,22 +2967,22 @@ var ts; } else if (pos + 2 < len && (text.charCodeAt(pos + 1) === 66 || text.charCodeAt(pos + 1) === 98)) { pos += 2; - var _value = scanBinaryOrOctalDigits(2); - if (_value < 0) { + var value = scanBinaryOrOctalDigits(2); + if (value < 0) { error(ts.Diagnostics.Binary_digit_expected); - _value = 0; + value = 0; } - tokenValue = "" + _value; + tokenValue = "" + value; return token = 7; } else if (pos + 2 < len && (text.charCodeAt(pos + 1) === 79 || text.charCodeAt(pos + 1) === 111)) { pos += 2; - var _value_1 = scanBinaryOrOctalDigits(8); - if (_value_1 < 0) { + var value = scanBinaryOrOctalDigits(8); + if (value < 0) { error(ts.Diagnostics.Octal_digit_expected); - _value_1 = 0; + value = 0; } - tokenValue = "" + _value_1; + tokenValue = "" + value; return token = 7; } if (pos + 1 < len && isOctalDigit(text.charCodeAt(pos + 1))) { @@ -2924,7 +3016,7 @@ var ts; } if (text.charCodeAt(pos + 1) === 60) { if (text.charCodeAt(pos + 2) === 61) { - return pos += 3, token = 58; + return pos += 3, token = 59; } return pos += 2, token = 40; } @@ -2951,7 +3043,7 @@ var ts; if (text.charCodeAt(pos + 1) === 62) { return pos += 2, token = 32; } - return pos++, token = 52; + return pos++, token = 53; case 62: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); @@ -2971,7 +3063,7 @@ var ts; return pos++, token = 19; case 94: if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 63; + return pos += 2, token = 64; } return pos++, token = 45; case 123: @@ -2981,13 +3073,15 @@ var ts; return pos += 2, token = 49; } if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 62; + return pos += 2, token = 63; } return pos++, token = 44; case 125: return pos++, token = 15; case 126: return pos++, token = 47; + case 64: + return pos++, token = 52; case 92: var cookedChar = peekUnicodeEscape(); if (cookedChar >= 0 && isIdentifierStart(cookedChar)) { @@ -3027,12 +3121,12 @@ var ts; if (text.charCodeAt(pos) === 62) { if (text.charCodeAt(pos + 1) === 62) { if (text.charCodeAt(pos + 2) === 61) { - return pos += 3, token = 60; + return pos += 3, token = 61; } return pos += 2, token = 42; } if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 59; + return pos += 2, token = 60; } return pos++, token = 41; } @@ -3043,7 +3137,7 @@ var ts; return token; } function reScanSlashToken() { - if (token === 36 || token === 56) { + if (token === 36 || token === 57) { var p = tokenPos + 1; var inEscape = false; var inCharacterClass = false; @@ -3137,8 +3231,8 @@ var ts; getTokenValue: function () { return tokenValue; }, hasExtendedUnicodeEscape: function () { return hasExtendedUnicodeEscape; }, hasPrecedingLineBreak: function () { return precedingLineBreak; }, - isIdentifier: function () { return token === 64 || token > 100; }, - isReservedWord: function () { return token >= 65 && token <= 100; }, + isIdentifier: function () { return token === 65 || token > 101; }, + isReservedWord: function () { return token >= 66 && token <= 101; }, isUnterminated: function () { return tokenIsUnterminated; }, reScanGreaterToken: reScanGreaterToken, reScanSlashToken: reScanSlashToken, @@ -3152,11 +3246,524 @@ var ts; } ts.createScanner = createScanner; })(ts || (ts = {})); +/// +var ts; +(function (ts) { + ts.bindTime = 0; + (function (ModuleInstanceState) { + ModuleInstanceState[ModuleInstanceState["NonInstantiated"] = 0] = "NonInstantiated"; + ModuleInstanceState[ModuleInstanceState["Instantiated"] = 1] = "Instantiated"; + ModuleInstanceState[ModuleInstanceState["ConstEnumOnly"] = 2] = "ConstEnumOnly"; + })(ts.ModuleInstanceState || (ts.ModuleInstanceState = {})); + var ModuleInstanceState = ts.ModuleInstanceState; + function getModuleInstanceState(node) { + if (node.kind === 202 || node.kind === 203) { + return 0; + } + else if (ts.isConstEnumDeclaration(node)) { + return 2; + } + else if ((node.kind === 209 || node.kind === 208) && !(node.flags & 1)) { + return 0; + } + else if (node.kind === 206) { + var state = 0; + ts.forEachChild(node, function (n) { + switch (getModuleInstanceState(n)) { + case 0: + return false; + case 2: + state = 2; + return false; + case 1: + state = 1; + return true; + } + }); + return state; + } + else if (node.kind === 205) { + return getModuleInstanceState(node.body); + } + else { + return 1; + } + } + ts.getModuleInstanceState = getModuleInstanceState; + function bindSourceFile(file) { + var start = new Date().getTime(); + bindSourceFileWorker(file); + ts.bindTime += new Date().getTime() - start; + } + ts.bindSourceFile = bindSourceFile; + function bindSourceFileWorker(file) { + var parent; + var container; + var blockScopeContainer; + var lastContainer; + var symbolCount = 0; + var Symbol = ts.objectAllocator.getSymbolConstructor(); + if (!file.locals) { + file.locals = {}; + container = file; + setBlockScopeContainer(file, false); + bind(file); + file.symbolCount = symbolCount; + } + function createSymbol(flags, name) { + symbolCount++; + return new Symbol(flags, name); + } + function setBlockScopeContainer(node, cleanLocals) { + blockScopeContainer = node; + if (cleanLocals) { + blockScopeContainer.locals = undefined; + } + } + function addDeclarationToSymbol(symbol, node, symbolKind) { + symbol.flags |= symbolKind; + if (!symbol.declarations) + symbol.declarations = []; + symbol.declarations.push(node); + if (symbolKind & 1952 && !symbol.exports) + symbol.exports = {}; + if (symbolKind & 6240 && !symbol.members) + symbol.members = {}; + node.symbol = symbol; + if (symbolKind & 107455 && !symbol.valueDeclaration) + symbol.valueDeclaration = node; + } + function getDeclarationName(node) { + if (node.name) { + if (node.kind === 205 && node.name.kind === 8) { + return '"' + node.name.text + '"'; + } + if (node.name.kind === 127) { + var nameExpression = node.name.expression; + ts.Debug.assert(ts.isWellKnownSymbolSyntactically(nameExpression)); + return ts.getPropertyNameForKnownSymbolName(nameExpression.name.text); + } + return node.name.text; + } + switch (node.kind) { + case 143: + case 135: + return "__constructor"; + case 142: + case 138: + return "__call"; + case 139: + return "__new"; + case 140: + return "__index"; + case 215: + return "__export"; + case 214: + return node.isExportEquals ? "export=" : "default"; + case 200: + case 201: + return node.flags & 256 ? "default" : undefined; + } + } + function getDisplayName(node) { + return node.name ? ts.declarationNameToString(node.name) : getDeclarationName(node); + } + function declareSymbol(symbols, parent, node, includes, excludes) { + ts.Debug.assert(!ts.hasDynamicName(node)); + var name = node.flags & 256 && parent ? "default" : getDeclarationName(node); + var symbol; + if (name !== undefined) { + symbol = ts.hasProperty(symbols, name) ? symbols[name] : (symbols[name] = createSymbol(0, name)); + if (symbol.flags & excludes) { + if (node.name) { + node.name.parent = node; + } + var message = symbol.flags & 2 + ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 + : ts.Diagnostics.Duplicate_identifier_0; + ts.forEach(symbol.declarations, function (declaration) { + file.bindDiagnostics.push(ts.createDiagnosticForNode(declaration.name || declaration, message, getDisplayName(declaration))); + }); + file.bindDiagnostics.push(ts.createDiagnosticForNode(node.name || node, message, getDisplayName(node))); + symbol = createSymbol(0, name); + } + } + else { + symbol = createSymbol(0, "__missing"); + } + addDeclarationToSymbol(symbol, node, includes); + symbol.parent = parent; + if ((node.kind === 201 || node.kind === 174) && symbol.exports) { + var prototypeSymbol = createSymbol(4 | 134217728, "prototype"); + if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { + if (node.name) { + node.name.parent = node; + } + file.bindDiagnostics.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); + } + symbol.exports[prototypeSymbol.name] = prototypeSymbol; + prototypeSymbol.parent = symbol; + } + return symbol; + } + function declareModuleMember(node, symbolKind, symbolExcludes) { + var hasExportModifier = ts.getCombinedNodeFlags(node) & 1; + if (symbolKind & 8388608) { + if (node.kind === 217 || (node.kind === 208 && hasExportModifier)) { + declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); + } + else { + declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); + } + } + else { + if (hasExportModifier || container.flags & 32768) { + var exportKind = (symbolKind & 107455 ? 1048576 : 0) | + (symbolKind & 793056 ? 2097152 : 0) | + (symbolKind & 1536 ? 4194304 : 0); + var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); + local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); + node.localSymbol = local; + } + else { + declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); + } + } + } + function bindChildren(node, symbolKind, isBlockScopeContainer) { + if (symbolKind & 255504) { + node.locals = {}; + } + var saveParent = parent; + var saveContainer = container; + var savedBlockScopeContainer = blockScopeContainer; + parent = node; + if (symbolKind & 262128) { + container = node; + if (lastContainer) { + lastContainer.nextContainer = container; + } + lastContainer = container; + } + if (isBlockScopeContainer) { + setBlockScopeContainer(node, (symbolKind & 255504) === 0 && node.kind !== 227); + } + ts.forEachChild(node, bind); + container = saveContainer; + parent = saveParent; + blockScopeContainer = savedBlockScopeContainer; + } + function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) { + switch (container.kind) { + case 205: + declareModuleMember(node, symbolKind, symbolExcludes); + break; + case 227: + if (ts.isExternalModule(container)) { + declareModuleMember(node, symbolKind, symbolExcludes); + break; + } + case 142: + case 143: + case 138: + case 139: + case 140: + case 134: + case 133: + case 135: + case 136: + case 137: + case 200: + case 162: + case 163: + declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); + break; + case 174: + case 201: + if (node.flags & 128) { + declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); + break; + } + case 145: + case 154: + case 202: + declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes); + break; + case 204: + declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); + break; + } + bindChildren(node, symbolKind, isBlockScopeContainer); + } + function isAmbientContext(node) { + while (node) { + if (node.flags & 2) + return true; + node = node.parent; + } + return false; + } + function hasExportDeclarations(node) { + var body = node.kind === 227 ? node : node.body; + if (body.kind === 227 || body.kind === 206) { + for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { + var stat = _a[_i]; + if (stat.kind === 215 || stat.kind === 214) { + return true; + } + } + } + return false; + } + function setExportContextFlag(node) { + if (isAmbientContext(node) && !hasExportDeclarations(node)) { + node.flags |= 32768; + } + else { + node.flags &= ~32768; + } + } + function bindModuleDeclaration(node) { + setExportContextFlag(node); + if (node.name.kind === 8) { + bindDeclaration(node, 512, 106639, true); + } + else { + var state = getModuleInstanceState(node); + if (state === 0) { + bindDeclaration(node, 1024, 0, true); + } + else { + bindDeclaration(node, 512, 106639, true); + var currentModuleIsConstEnumOnly = state === 2; + if (node.symbol.constEnumOnlyModule === undefined) { + node.symbol.constEnumOnlyModule = currentModuleIsConstEnumOnly; + } + else { + node.symbol.constEnumOnlyModule = node.symbol.constEnumOnlyModule && currentModuleIsConstEnumOnly; + } + } + } + } + function bindFunctionOrConstructorType(node) { + // For a given function symbol "<...>(...) => T" we want to generate a symbol identical + // to the one we would get for: { <...>(...): T } + // + // We do that by making an anonymous type literal symbol, and then setting the function + // symbol as its sole member. To the rest of the system, this symbol will be indistinguishable + // from an actual type literal symbol you would have gotten had you used the long form. + var symbol = createSymbol(131072, getDeclarationName(node)); + addDeclarationToSymbol(symbol, node, 131072); + bindChildren(node, 131072, false); + var typeLiteralSymbol = createSymbol(2048, "__type"); + addDeclarationToSymbol(typeLiteralSymbol, node, 2048); + typeLiteralSymbol.members = {}; + typeLiteralSymbol.members[node.kind === 142 ? "__call" : "__new"] = symbol; + } + function bindAnonymousDeclaration(node, symbolKind, name, isBlockScopeContainer) { + var symbol = createSymbol(symbolKind, name); + addDeclarationToSymbol(symbol, node, symbolKind); + bindChildren(node, symbolKind, isBlockScopeContainer); + } + function bindCatchVariableDeclaration(node) { + bindChildren(node, 0, true); + } + function bindBlockScopedVariableDeclaration(node) { + switch (blockScopeContainer.kind) { + case 205: + declareModuleMember(node, 2, 107455); + break; + case 227: + if (ts.isExternalModule(container)) { + declareModuleMember(node, 2, 107455); + break; + } + default: + if (!blockScopeContainer.locals) { + blockScopeContainer.locals = {}; + } + declareSymbol(blockScopeContainer.locals, undefined, node, 2, 107455); + } + bindChildren(node, 2, false); + } + function getDestructuringParameterName(node) { + return "__" + ts.indexOf(node.parent.parameters, node); + } + function bind(node) { + node.parent = parent; + switch (node.kind) { + case 128: + bindDeclaration(node, 262144, 530912, false); + break; + case 129: + bindParameter(node); + break; + case 198: + case 152: + if (ts.isBindingPattern(node.name)) { + bindChildren(node, 0, false); + } + else if (ts.isBlockOrCatchScoped(node)) { + bindBlockScopedVariableDeclaration(node); + } + else { + bindDeclaration(node, 1, 107454, false); + } + break; + case 132: + case 131: + bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 107455, false); + break; + case 224: + case 225: + bindPropertyOrMethodOrAccessor(node, 4, 107455, false); + break; + case 226: + bindPropertyOrMethodOrAccessor(node, 8, 107455, false); + break; + case 138: + case 139: + case 140: + bindDeclaration(node, 131072, 0, false); + break; + case 134: + case 133: + bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 107455 : 99263, true); + break; + case 200: + bindDeclaration(node, 16, 106927, true); + break; + case 135: + bindDeclaration(node, 16384, 0, true); + break; + case 136: + bindPropertyOrMethodOrAccessor(node, 32768, 41919, true); + break; + case 137: + bindPropertyOrMethodOrAccessor(node, 65536, 74687, true); + break; + case 142: + case 143: + bindFunctionOrConstructorType(node); + break; + case 145: + bindAnonymousDeclaration(node, 2048, "__type", false); + break; + case 154: + bindAnonymousDeclaration(node, 4096, "__object", false); + break; + case 162: + case 163: + bindAnonymousDeclaration(node, 16, "__function", true); + break; + case 174: + bindAnonymousDeclaration(node, 32, "__class", false); + break; + case 223: + bindCatchVariableDeclaration(node); + break; + case 201: + bindDeclaration(node, 32, 899583, false); + break; + case 202: + bindDeclaration(node, 64, 792992, false); + break; + case 203: + bindDeclaration(node, 524288, 793056, false); + break; + case 204: + if (ts.isConst(node)) { + bindDeclaration(node, 128, 899967, false); + } + else { + bindDeclaration(node, 256, 899327, false); + } + break; + case 205: + bindModuleDeclaration(node); + break; + case 208: + case 211: + case 213: + case 217: + bindDeclaration(node, 8388608, 8388608, false); + break; + case 210: + if (node.name) { + bindDeclaration(node, 8388608, 8388608, false); + } + else { + bindChildren(node, 0, false); + } + break; + case 215: + if (!node.exportClause) { + declareSymbol(container.symbol.exports, container.symbol, node, 1073741824, 0); + } + bindChildren(node, 0, false); + break; + case 214: + if (node.expression && node.expression.kind === 65) { + declareSymbol(container.symbol.exports, container.symbol, node, 8388608, 107455 | 8388608); + } + else { + declareSymbol(container.symbol.exports, container.symbol, node, 4, 107455 | 8388608); + } + bindChildren(node, 0, false); + break; + case 227: + setExportContextFlag(node); + if (ts.isExternalModule(node)) { + bindAnonymousDeclaration(node, 512, '"' + ts.removeFileExtension(node.fileName) + '"', true); + break; + } + case 179: + bindChildren(node, 0, !ts.isFunctionLike(node.parent)); + break; + case 223: + case 186: + case 187: + case 188: + case 207: + bindChildren(node, 0, true); + break; + default: + var saveParent = parent; + parent = node; + ts.forEachChild(node, bind); + parent = saveParent; + } + } + function bindParameter(node) { + if (ts.isBindingPattern(node.name)) { + bindAnonymousDeclaration(node, 1, getDestructuringParameterName(node), false); + } + else { + bindDeclaration(node, 1, 107455, false); + } + if (node.flags & 112 && + node.parent.kind === 135 && + (node.parent.parent.kind === 201 || node.parent.parent.kind === 174)) { + var classDeclaration = node.parent.parent; + declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4, 107455); + } + } + function bindPropertyOrMethodOrAccessor(node, symbolKind, symbolExcludes, isBlockScopeContainer) { + if (ts.hasDynamicName(node)) { + bindAnonymousDeclaration(node, symbolKind, "__computed", isBlockScopeContainer); + } + else { + bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer); + } + } + } +})(ts || (ts = {})); +/// var ts; (function (ts) { function getDeclarationOfKind(symbol, kind) { var declarations = symbol.declarations; - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; if (declaration.kind === kind) { return declaration; @@ -3200,21 +3807,21 @@ var ts; ts.getFullWidth = getFullWidth; function containsParseError(node) { aggregateChildData(node); - return (node.parserContextFlags & 32) !== 0; + return (node.parserContextFlags & 64) !== 0; } ts.containsParseError = containsParseError; function aggregateChildData(node) { - if (!(node.parserContextFlags & 64)) { - var thisNodeOrAnySubNodesHasError = ((node.parserContextFlags & 16) !== 0) || + if (!(node.parserContextFlags & 128)) { + var thisNodeOrAnySubNodesHasError = ((node.parserContextFlags & 32) !== 0) || ts.forEachChild(node, containsParseError); if (thisNodeOrAnySubNodesHasError) { - node.parserContextFlags |= 32; + node.parserContextFlags |= 64; } - node.parserContextFlags |= 64; + node.parserContextFlags |= 128; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 221) { + while (node && node.kind !== 227) { node = node.parent; } return node; @@ -3296,15 +3903,15 @@ var ts; return current; } switch (current.kind) { - case 221: - case 202: - case 217: - case 200: - case 181: - case 182: - case 183: + case 227: + case 207: + case 223: + case 205: + case 186: + case 187: + case 188: return current; - case 174: + case 179: if (!isFunctionLike(current.parent)) { return current; } @@ -3315,9 +3922,9 @@ var ts; ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; function isCatchClauseVariableDeclaration(declaration) { return declaration && - declaration.kind === 193 && + declaration.kind === 198 && declaration.parent && - declaration.parent.kind === 217; + declaration.parent.kind === 223; } ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration; function declarationNameToString(name) { @@ -3354,15 +3961,22 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 193: - case 150: - case 196: - case 197: + case 227: + var pos_1 = ts.skipTrivia(sourceFile.text, 0, false); + if (pos_1 === sourceFile.text.length) { + return createTextSpan(0, 0); + } + return getSpanOfTokenAtPosition(sourceFile, pos_1); + case 198: + case 152: + case 201: + case 174: + case 202: + case 205: + case 204: + case 226: case 200: - case 199: - case 220: - case 195: - case 160: + case 162: errorNode = node.name; break; } @@ -3384,11 +3998,11 @@ var ts; } ts.isDeclarationFile = isDeclarationFile; function isConstEnumDeclaration(node) { - return node.kind === 199 && isConst(node); + return node.kind === 204 && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 150 || isBindingPattern(node))) { + while (node && (node.kind === 152 || isBindingPattern(node))) { node = node.parent; } return node; @@ -3396,14 +4010,14 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 193) { + if (node.kind === 198) { node = node.parent; } - if (node && node.kind === 194) { + if (node && node.kind === 199) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 175) { + if (node && node.kind === 180) { flags |= node.flags; } return flags; @@ -3418,12 +4032,11 @@ var ts; } ts.isLet = isLet; function isPrologueDirective(node) { - return node.kind === 177 && node.expression.kind === 8; + return node.kind === 182 && node.expression.kind === 8; } ts.isPrologueDirective = isPrologueDirective; function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { - sourceFileOfNode = sourceFileOfNode || getSourceFileOfNode(node); - if (node.kind === 128 || node.kind === 127) { + if (node.kind === 129 || node.kind === 128) { return ts.concatenate(ts.getTrailingCommentRanges(sourceFileOfNode.text, node.pos), ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos)); } else { @@ -3445,23 +4058,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 186: + case 191: return visitor(node); - case 202: - case 174: - case 178: + case 207: case 179: - case 180: - case 181: - case 182: case 183: + case 184: + case 185: + case 186: case 187: case 188: - case 214: - case 215: - case 189: - case 191: - case 217: + case 192: + case 193: + case 220: + case 221: + case 194: + case 196: + case 223: return ts.forEachChild(node, traverse); } } @@ -3470,14 +4083,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 150: - case 220: - case 128: - case 218: - case 130: + case 152: + case 226: case 129: - case 219: - case 193: + case 224: + case 132: + case 131: + case 225: + case 198: return true; } } @@ -3487,22 +4100,22 @@ var ts; function isFunctionLike(node) { if (node) { switch (node.kind) { - case 133: - case 160: - case 195: - case 161: - case 132: - case 131: - case 134: case 135: + case 162: + case 200: + case 163: + case 134: + case 133: case 136: case 137: case 138: + case 139: case 140: - case 141: - case 160: - case 161: - case 195: + case 142: + case 143: + case 162: + case 163: + case 200: return true; } } @@ -3510,11 +4123,11 @@ var ts; } ts.isFunctionLike = isFunctionLike; function isFunctionBlock(node) { - return node && node.kind === 174 && isFunctionLike(node.parent); + return node && node.kind === 179 && isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 132 && node.parent.kind === 152; + return node && node.kind === 134 && node.parent.kind === 154; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function getContainingFunction(node) { @@ -3533,28 +4146,28 @@ var ts; return undefined; } switch (node.kind) { - case 126: - if (node.parent.parent.kind === 196) { + case 127: + if (node.parent.parent.kind === 201) { return node; } node = node.parent; break; - case 161: + case 163: if (!includeArrowFunctions) { continue; } - case 195: - case 160: case 200: - case 130: - case 129: + case 162: + case 205: case 132: case 131: - case 133: case 134: + case 133: case 135: - case 199: - case 221: + case 136: + case 137: + case 204: + case 227: return node; } } @@ -3566,47 +4179,104 @@ var ts; if (!node) return node; switch (node.kind) { - case 126: - if (node.parent.parent.kind === 196) { + case 127: + if (node.parent.parent.kind === 201) { return node; } node = node.parent; break; - case 195: - case 160: - case 161: + case 200: + case 162: + case 163: if (!includeFunctions) { continue; } - case 130: - case 129: case 132: case 131: - case 133: case 134: + case 133: case 135: + case 136: + case 137: return node; } } } ts.getSuperContainer = getSuperContainer; function getInvokedExpression(node) { - if (node.kind === 157) { + if (node.kind === 159) { return node.tag; } return node.expression; } ts.getInvokedExpression = getInvokedExpression; + function nodeCanBeDecorated(node) { + switch (node.kind) { + case 201: + return true; + case 132: + return node.parent.kind === 201; + case 129: + return node.parent.body && node.parent.parent.kind === 201; + case 136: + case 137: + case 134: + return node.body && node.parent.kind === 201; + } + return false; + } + ts.nodeCanBeDecorated = nodeCanBeDecorated; + function nodeIsDecorated(node) { + switch (node.kind) { + case 201: + if (node.decorators) { + return true; + } + return false; + case 132: + case 129: + if (node.decorators) { + return true; + } + return false; + case 136: + if (node.body && node.decorators) { + return true; + } + return false; + case 134: + case 137: + if (node.body && node.decorators) { + return true; + } + return false; + } + return false; + } + ts.nodeIsDecorated = nodeIsDecorated; + function childIsDecorated(node) { + switch (node.kind) { + case 201: + return ts.forEach(node.members, nodeOrChildIsDecorated); + case 134: + case 137: + return ts.forEach(node.parameters, nodeIsDecorated); + } + return false; + } + ts.childIsDecorated = childIsDecorated; + function nodeOrChildIsDecorated(node) { + return nodeIsDecorated(node) || childIsDecorated(node); + } + ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function isExpression(node) { switch (node.kind) { - case 92: - case 90: - case 88: - case 94: - case 79: + case 93: + case 91: + case 89: + case 95: + case 80: case 9: - case 151: - case 152: case 153: case 154: case 155: @@ -3616,68 +4286,71 @@ var ts; case 159: case 160: case 161: - case 164: case 162: + case 174: case 163: - case 165: case 166: + case 164: + case 165: case 167: case 168: - case 171: case 169: + case 170: + case 173: + case 171: case 10: - case 172: + case 175: return true; - case 125: - while (node.parent.kind === 125) { + case 126: + while (node.parent.kind === 126) { node = node.parent; } - return node.parent.kind === 142; - case 64: - if (node.parent.kind === 142) { + return node.parent.kind === 144; + case 65: + if (node.parent.kind === 144) { return true; } case 7: case 8: - var _parent = node.parent; - switch (_parent.kind) { - case 193: - case 128: - case 130: + var parent_1 = node.parent; + switch (parent_1.kind) { + case 198: case 129: - case 220: - case 218: - case 150: - return _parent.initializer === node; - case 177: - case 178: - case 179: - case 180: - case 186: - case 187: - case 188: - case 214: - case 190: - case 188: - return _parent.expression === node; - case 181: - var forStatement = _parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 194) || - forStatement.condition === node || - forStatement.iterator === node; + case 132: + case 131: + case 226: + case 224: + case 152: + return parent_1.initializer === node; case 182: case 183: - var forInStatement = _parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 194) || + case 184: + case 185: + case 191: + case 192: + case 193: + case 220: + case 195: + case 193: + 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: + case 188: + var forInStatement = parent_1; + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 199) || forInStatement.expression === node; - case 158: - return node === _parent.expression; - case 173: - return node === _parent.expression; - case 126: - return node === _parent.expression; + case 160: + return node === parent_1.expression; + case 176: + return node === parent_1.expression; + case 127: + return node === parent_1.expression; default: - if (isExpression(_parent)) { + if (isExpression(parent_1)) { return true; } } @@ -3692,7 +4365,7 @@ var ts; } ts.isInstantiatedModule = isInstantiatedModule; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 203 && node.moduleReference.kind === 213; + return node.kind === 208 && node.moduleReference.kind === 219; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -3701,41 +4374,41 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 203 && node.moduleReference.kind !== 213; + return node.kind === 208 && node.moduleReference.kind !== 219; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function getExternalModuleName(node) { - if (node.kind === 204) { + if (node.kind === 209) { return node.moduleSpecifier; } - if (node.kind === 203) { + if (node.kind === 208) { var reference = node.moduleReference; - if (reference.kind === 213) { + if (reference.kind === 219) { return reference.expression; } } - if (node.kind === 210) { + if (node.kind === 215) { return node.moduleSpecifier; } } ts.getExternalModuleName = getExternalModuleName; function hasDotDotDotToken(node) { - return node && node.kind === 128 && node.dotDotDotToken !== undefined; + return node && node.kind === 129 && node.dotDotDotToken !== undefined; } ts.hasDotDotDotToken = hasDotDotDotToken; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 128: + case 129: return node.questionToken !== undefined; + case 134: + case 133: + return node.questionToken !== undefined; + case 225: + case 224: case 132: case 131: return node.questionToken !== undefined; - case 219: - case 218: - case 130: - case 129: - return node.questionToken !== undefined; } } return false; @@ -3758,7 +4431,7 @@ var ts; } ts.isTemplateLiteralKind = isTemplateLiteralKind; function isBindingPattern(node) { - return !!node && (node.kind === 149 || node.kind === 148); + return !!node && (node.kind === 151 || node.kind === 150); } ts.isBindingPattern = isBindingPattern; function isInAmbientContext(node) { @@ -3773,33 +4446,33 @@ var ts; ts.isInAmbientContext = isInAmbientContext; function isDeclaration(node) { switch (node.kind) { - case 161: - case 150: - case 196: - case 133: - case 199: - case 220: - case 212: - case 195: - case 160: - case 134: - case 205: - case 203: + 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 197: + case 213: + case 202: + case 134: + case 133: + case 205: + case 211: + case 129: + case 224: case 132: case 131: - case 200: - case 206: + case 137: + case 225: + case 203: case 128: - case 218: - case 130: - case 129: - case 135: - case 219: case 198: - case 127: - case 193: return true; } return false; @@ -3807,65 +4480,88 @@ var ts; ts.isDeclaration = isDeclaration; function isStatement(n) { switch (n.kind) { - case 185: - case 184: - case 192: - case 179: - case 177: - case 176: - case 182: - case 183: - case 181: - case 178: + case 190: case 189: - case 186: - case 188: - case 93: - case 191: - case 175: - case 180: + case 197: + case 184: + case 182: + case 181: case 187: - case 209: + case 188: + case 186: + case 183: + case 194: + case 191: + case 193: + case 94: + case 196: + case 180: + case 185: + case 192: + case 214: return true; default: return false; } } ts.isStatement = isStatement; + function isClassElement(n) { + switch (n.kind) { + case 135: + case 132: + case 134: + case 136: + case 137: + case 140: + return true; + default: + return false; + } + } + ts.isClassElement = isClassElement; function isDeclarationName(name) { - if (name.kind !== 64 && name.kind !== 8 && name.kind !== 7) { + if (name.kind !== 65 && name.kind !== 8 && name.kind !== 7) { return false; } - var _parent = name.parent; - if (_parent.kind === 208 || _parent.kind === 212) { - if (_parent.propertyName) { + var parent = name.parent; + if (parent.kind === 213 || parent.kind === 217) { + if (parent.propertyName) { return true; } } - if (isDeclaration(_parent)) { - return _parent.name === name; + if (isDeclaration(parent)) { + return parent.name === name; } return false; } ts.isDeclarationName = isDeclarationName; - function getClassBaseTypeNode(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 78); + 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; + } + ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; + function getClassExtendsHeritageClauseElement(node) { + var heritageClause = getHeritageClause(node.heritageClauses, 79); return heritageClause && heritageClause.types.length > 0 ? heritageClause.types[0] : undefined; } - ts.getClassBaseTypeNode = getClassBaseTypeNode; - function getClassImplementedTypeNodes(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 102); + ts.getClassExtendsHeritageClauseElement = getClassExtendsHeritageClauseElement; + function getClassImplementsHeritageClauseElements(node) { + var heritageClause = getHeritageClause(node.heritageClauses, 103); return heritageClause ? heritageClause.types : undefined; } - ts.getClassImplementedTypeNodes = getClassImplementedTypeNodes; + ts.getClassImplementsHeritageClauseElements = getClassImplementsHeritageClauseElements; function getInterfaceBaseTypeNodes(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 78); + var heritageClause = getHeritageClause(node.heritageClauses, 79); return heritageClause ? heritageClause.types : undefined; } ts.getInterfaceBaseTypeNodes = getInterfaceBaseTypeNodes; function getHeritageClause(clauses, kind) { if (clauses) { - for (var _i = 0, _n = clauses.length; _i < _n; _i++) { + for (var _i = 0; _i < clauses.length; _i++) { var clause = clauses[_i]; if (clause.token === kind) { return clause; @@ -3928,7 +4624,7 @@ var ts; } ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; function isKeyword(token) { - return 65 <= token && token <= 124; + return 66 <= token && token <= 125; } ts.isKeyword = isKeyword; function isTrivia(token) { @@ -3937,19 +4633,19 @@ var ts; ts.isTrivia = isTrivia; function hasDynamicName(declaration) { return declaration.name && - declaration.name.kind === 126 && + declaration.name.kind === 127 && !isWellKnownSymbolSyntactically(declaration.name.expression); } ts.hasDynamicName = hasDynamicName; function isWellKnownSymbolSyntactically(node) { - return node.kind === 153 && isESSymbolIdentifier(node.expression); + return node.kind === 155 && isESSymbolIdentifier(node.expression); } ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically; function getPropertyNameForPropertyNameNode(name) { - if (name.kind === 64 || name.kind === 8 || name.kind === 7) { + if (name.kind === 65 || name.kind === 8 || name.kind === 7) { return name.text; } - if (name.kind === 126) { + if (name.kind === 127) { var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { var rightHandSideName = nameExpression.name.text; @@ -3964,19 +4660,19 @@ var ts; } ts.getPropertyNameForKnownSymbolName = getPropertyNameForKnownSymbolName; function isESSymbolIdentifier(node) { - return node.kind === 64 && node.text === "Symbol"; + return node.kind === 65 && node.text === "Symbol"; } ts.isESSymbolIdentifier = isESSymbolIdentifier; function isModifier(token) { switch (token) { - case 108: - case 106: - case 107: case 109: - case 77: - case 114: - case 69: - case 72: + case 107: + case 108: + case 110: + case 78: + case 115: + case 70: + case 73: return true; } return false; @@ -4092,7 +4788,7 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function nodeStartsNewLexicalEnvironment(n) { - return isFunctionLike(n) || n.kind === 200 || n.kind === 221; + return isFunctionLike(n) || n.kind === 205 || n.kind === 227; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(node) { @@ -4107,26 +4803,6 @@ var ts; return node; } ts.createSynthesizedNode = createSynthesizedNode; - function generateUniqueName(baseName, isExistingName) { - if (baseName.charCodeAt(0) !== 95) { - baseName = "_" + baseName; - if (!isExistingName(baseName)) { - return baseName; - } - } - if (baseName.charCodeAt(baseName.length - 1) !== 95) { - baseName += "_"; - } - var i = 1; - while (true) { - var _name = baseName + i; - if (!isExistingName(_name)) { - return _name; - } - i++; - } - } - ts.generateUniqueName = generateUniqueName; function createDiagnosticCollection() { var nonFileDiagnostics = []; var fileDiagnostics = {}; @@ -4227,10 +4903,291 @@ var ts; s; } ts.escapeNonAsciiCharacters = escapeNonAsciiCharacters; + var indentStrings = ["", " "]; + function getIndentString(level) { + if (indentStrings[level] === undefined) { + indentStrings[level] = getIndentString(level - 1) + indentStrings[1]; + } + return indentStrings[level]; + } + ts.getIndentString = getIndentString; + function getIndentSize() { + return indentStrings[1].length; + } + ts.getIndentSize = getIndentSize; + function createTextWriter(newLine) { + var output = ""; + var indent = 0; + var lineStart = true; + var lineCount = 0; + var linePos = 0; + function write(s) { + if (s && s.length) { + if (lineStart) { + output += getIndentString(indent); + lineStart = false; + } + output += s; + } + } + function rawWrite(s) { + if (s !== undefined) { + if (lineStart) { + lineStart = false; + } + output += s; + } + } + function writeLiteral(s) { + if (s && s.length) { + write(s); + var lineStartsOfS = ts.computeLineStarts(s); + if (lineStartsOfS.length > 1) { + lineCount = lineCount + lineStartsOfS.length - 1; + linePos = output.length - s.length + lineStartsOfS[lineStartsOfS.length - 1]; + } + } + } + function writeLine() { + if (!lineStart) { + output += newLine; + lineCount++; + linePos = output.length; + lineStart = true; + } + } + function writeTextOfNode(sourceFile, node) { + write(getSourceTextOfNodeFromSourceFile(sourceFile, node)); + } + return { + write: write, + rawWrite: rawWrite, + writeTextOfNode: writeTextOfNode, + writeLiteral: writeLiteral, + writeLine: writeLine, + increaseIndent: function () { return indent++; }, + decreaseIndent: function () { return indent--; }, + getIndent: function () { return indent; }, + getTextPos: function () { return output.length; }, + getLine: function () { return lineCount + 1; }, + getColumn: function () { return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; }, + getText: function () { return output; } + }; + } + ts.createTextWriter = createTextWriter; + function getOwnEmitOutputFilePath(sourceFile, host, extension) { + var compilerOptions = host.getCompilerOptions(); + var emitOutputFilePathWithoutExtension; + if (compilerOptions.outDir) { + emitOutputFilePathWithoutExtension = ts.removeFileExtension(getSourceFilePathInNewDir(sourceFile, host, compilerOptions.outDir)); + } + else { + emitOutputFilePathWithoutExtension = ts.removeFileExtension(sourceFile.fileName); + } + return emitOutputFilePathWithoutExtension + extension; + } + ts.getOwnEmitOutputFilePath = getOwnEmitOutputFilePath; + function getSourceFilePathInNewDir(sourceFile, host, newDirPath) { + var sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.fileName, host.getCurrentDirectory()); + sourceFilePath = sourceFilePath.replace(host.getCommonSourceDirectory(), ""); + return ts.combinePaths(newDirPath, sourceFilePath); + } + ts.getSourceFilePathInNewDir = getSourceFilePathInNewDir; + function writeFile(host, diagnostics, fileName, data, writeByteOrderMark) { + host.writeFile(fileName, data, writeByteOrderMark, function (hostErrorMessage) { + diagnostics.push(ts.createCompilerDiagnostic(ts.Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage)); + }); + } + ts.writeFile = writeFile; + function getLineOfLocalPosition(currentSourceFile, pos) { + return ts.getLineAndCharacterOfPosition(currentSourceFile, pos).line; + } + ts.getLineOfLocalPosition = getLineOfLocalPosition; + function getFirstConstructorWithBody(node) { + return ts.forEach(node.members, function (member) { + if (member.kind === 135 && nodeIsPresent(member.body)) { + return member; + } + }); + } + ts.getFirstConstructorWithBody = getFirstConstructorWithBody; + function shouldEmitToOwnFile(sourceFile, compilerOptions) { + if (!isDeclarationFile(sourceFile)) { + if ((isExternalModule(sourceFile) || !compilerOptions.out) && !ts.fileExtensionIs(sourceFile.fileName, ".js")) { + return true; + } + return false; + } + return false; + } + ts.shouldEmitToOwnFile = shouldEmitToOwnFile; + function getAllAccessorDeclarations(declarations, accessor) { + var firstAccessor; + var secondAccessor; + var getAccessor; + var setAccessor; + if (hasDynamicName(accessor)) { + firstAccessor = accessor; + if (accessor.kind === 136) { + getAccessor = accessor; + } + else if (accessor.kind === 137) { + setAccessor = accessor; + } + else { + ts.Debug.fail("Accessor has wrong kind"); + } + } + else { + ts.forEach(declarations, function (member) { + if ((member.kind === 136 || member.kind === 137) + && (member.flags & 128) === (accessor.flags & 128)) { + var memberName = getPropertyNameForPropertyNameNode(member.name); + var accessorName = getPropertyNameForPropertyNameNode(accessor.name); + if (memberName === accessorName) { + if (!firstAccessor) { + firstAccessor = member; + } + else if (!secondAccessor) { + secondAccessor = member; + } + if (member.kind === 136 && !getAccessor) { + getAccessor = member; + } + if (member.kind === 137 && !setAccessor) { + setAccessor = member; + } + } + } + }); + } + return { + firstAccessor: firstAccessor, + secondAccessor: secondAccessor, + getAccessor: getAccessor, + setAccessor: setAccessor + }; + } + ts.getAllAccessorDeclarations = getAllAccessorDeclarations; + function emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments) { + if (leadingComments && leadingComments.length && node.pos !== leadingComments[0].pos && + getLineOfLocalPosition(currentSourceFile, node.pos) !== getLineOfLocalPosition(currentSourceFile, leadingComments[0].pos)) { + writer.writeLine(); + } + } + ts.emitNewLineBeforeLeadingComments = emitNewLineBeforeLeadingComments; + function emitComments(currentSourceFile, writer, comments, trailingSeparator, newLine, writeComment) { + var emitLeadingSpace = !trailingSeparator; + ts.forEach(comments, function (comment) { + if (emitLeadingSpace) { + writer.write(" "); + emitLeadingSpace = false; + } + writeComment(currentSourceFile, writer, comment, newLine); + if (comment.hasTrailingNewLine) { + writer.writeLine(); + } + else if (trailingSeparator) { + writer.write(" "); + } + else { + emitLeadingSpace = true; + } + }); + } + ts.emitComments = emitComments; + function writeCommentRange(currentSourceFile, writer, comment, newLine) { + if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42) { + var firstCommentLineAndCharacter = ts.getLineAndCharacterOfPosition(currentSourceFile, comment.pos); + var lineCount = ts.getLineStarts(currentSourceFile).length; + var firstCommentLineIndent; + for (var pos = comment.pos, currentLine = firstCommentLineAndCharacter.line; pos < comment.end; currentLine++) { + var nextLineStart = (currentLine + 1) === lineCount + ? currentSourceFile.text.length + 1 + : getStartPositionOfLine(currentLine + 1, currentSourceFile); + if (pos !== comment.pos) { + if (firstCommentLineIndent === undefined) { + firstCommentLineIndent = calculateIndent(getStartPositionOfLine(firstCommentLineAndCharacter.line, currentSourceFile), comment.pos); + } + var currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); + var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(pos, nextLineStart); + if (spacesToEmit > 0) { + var numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); + var indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); + writer.rawWrite(indentSizeSpaceString); + while (numberOfSingleSpacesToEmit) { + writer.rawWrite(" "); + numberOfSingleSpacesToEmit--; + } + } + else { + writer.rawWrite(""); + } + } + writeTrimmedCurrentLine(pos, nextLineStart); + pos = nextLineStart; + } + } + else { + writer.write(currentSourceFile.text.substring(comment.pos, comment.end)); + } + function writeTrimmedCurrentLine(pos, nextLineStart) { + var end = Math.min(comment.end, nextLineStart - 1); + var currentLineText = currentSourceFile.text.substring(pos, end).replace(/^\s+|\s+$/g, ''); + if (currentLineText) { + writer.write(currentLineText); + if (end !== comment.end) { + writer.writeLine(); + } + } + else { + writer.writeLiteral(newLine); + } + } + function calculateIndent(pos, end) { + var currentLineIndent = 0; + for (; pos < end && ts.isWhiteSpace(currentSourceFile.text.charCodeAt(pos)); pos++) { + if (currentSourceFile.text.charCodeAt(pos) === 9) { + currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); + } + else { + currentLineIndent++; + } + } + return currentLineIndent; + } + } + ts.writeCommentRange = writeCommentRange; + function isSupportedHeritageClauseElement(node) { + return isSupportedHeritageClauseElementExpression(node.expression); + } + ts.isSupportedHeritageClauseElement = isSupportedHeritageClauseElement; + function isSupportedHeritageClauseElementExpression(node) { + if (node.kind === 65) { + return true; + } + else if (node.kind === 155) { + return isSupportedHeritageClauseElementExpression(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); + } + ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; + function getLocalSymbolForExportDefault(symbol) { + return symbol && symbol.valueDeclaration && (symbol.valueDeclaration.flags & 256) ? symbol.valueDeclaration.localSymbol : undefined; + } + ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; })(ts || (ts = {})); +/// +/// var ts; (function (ts) { - var nodeConstructors = new Array(223); + var nodeConstructors = new Array(229); ts.parseTime = 0; function getNodeConstructor(kind) { return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); @@ -4252,7 +5209,7 @@ var ts; } function visitEachNode(cbNode, nodes) { if (nodes) { - for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + for (var _i = 0; _i < nodes.length; _i++) { var node = nodes[_i]; var result = cbNode(node); if (result) { @@ -4268,249 +5225,272 @@ var ts; var visitNodes = cbNodeArray ? visitNodeArray : visitEachNode; var cbNodes = cbNodeArray || cbNode; switch (node.kind) { - case 125: + case 126: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 127: + case 128: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.expression); - case 128: - case 130: case 129: - case 218: - case 219: - case 193: - case 150: - return visitNodes(cbNodes, node.modifiers) || + case 132: + case 131: + case 224: + case 225: + case 198: + case 152: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 140: - case 141: - case 136: - case 137: + case 142: + case 143: case 138: - return visitNodes(cbNodes, node.modifiers) || + case 139: + case 140: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 132: - case 131: - case 133: case 134: + case 133: case 135: - case 160: - case 195: - case 161: - return visitNodes(cbNodes, node.modifiers) || + case 136: + case 137: + case 162: + case 200: + case 163: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type) || + visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 139: + case 141: return visitNode(cbNode, node.typeName) || visitNodes(cbNodes, node.typeArguments); - case 142: - return visitNode(cbNode, node.exprName); - case 143: - return visitNodes(cbNodes, node.members); case 144: - return visitNode(cbNode, node.elementType); + return visitNode(cbNode, node.exprName); case 145: - return visitNodes(cbNodes, node.elementTypes); + return visitNodes(cbNodes, node.members); case 146: - return visitNodes(cbNodes, node.types); + return visitNode(cbNode, node.elementType); case 147: - return visitNode(cbNode, node.type); + return visitNodes(cbNodes, node.elementTypes); case 148: + return visitNodes(cbNodes, node.types); case 149: - return visitNodes(cbNodes, node.elements); + return visitNode(cbNode, node.type); + case 150: case 151: return visitNodes(cbNodes, node.elements); - case 152: - return visitNodes(cbNodes, node.properties); case 153: + return visitNodes(cbNodes, node.elements); + case 154: + return visitNodes(cbNodes, node.properties); + case 155: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.dotToken) || visitNode(cbNode, node.name); - case 154: + case 156: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 155: - case 156: + case 157: + case 158: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments) || visitNodes(cbNodes, node.arguments); - case 157: + case 159: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 158: + case 160: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 159: - return visitNode(cbNode, node.expression); - case 162: - return visitNode(cbNode, node.expression); - case 163: + case 161: return visitNode(cbNode, node.expression); case 164: 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 170: + case 172: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 166: + case 168: return visitNode(cbNode, node.operand); - case 167: + case 169: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 168: + case 170: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 171: + case 173: return visitNode(cbNode, node.expression); - case 174: - case 201: + case 179: + case 206: return visitNodes(cbNodes, node.statements); - case 221: + case 227: return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 175: - return visitNodes(cbNodes, node.modifiers) || + case 180: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 194: + case 199: return visitNodes(cbNodes, node.declarations); - case 177: + case 182: return visitNode(cbNode, node.expression); - case 178: + case 183: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 179: + case 184: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 180: + case 185: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 181: + case 186: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.iterator) || visitNode(cbNode, node.statement); - case 182: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); - case 183: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); - case 184: - case 185: - return visitNode(cbNode, node.label); - case 186: - return visitNode(cbNode, node.expression); case 187: - return visitNode(cbNode, node.expression) || + return visitNode(cbNode, node.initializer) || + visitNode(cbNode, node.expression) || 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) || + visitNode(cbNode, node.statement); + case 193: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 202: + case 207: return visitNodes(cbNodes, node.clauses); - case 214: + case 220: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.statements); - case 215: + case 221: return visitNodes(cbNodes, node.statements); - case 189: + case 194: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 190: + case 195: return visitNode(cbNode, node.expression); - case 191: + case 196: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 217: + case 223: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 196: - return visitNodes(cbNodes, node.modifiers) || + case 130: + 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 197: - return visitNodes(cbNodes, node.modifiers) || + case 202: + 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 198: - return visitNodes(cbNodes, node.modifiers) || + case 203: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.type); - case 199: - return visitNodes(cbNodes, node.modifiers) || + case 204: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.members); - case 220: + case 226: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 200: - return visitNodes(cbNodes, node.modifiers) || + case 205: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 203: - return visitNodes(cbNodes, node.modifiers) || + case 208: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 204: - return visitNodes(cbNodes, node.modifiers) || + case 209: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 205: + case 210: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 206: - return visitNode(cbNode, node.name); - case 207: case 211: + return visitNode(cbNode, node.name); + case 212: + case 216: return visitNodes(cbNodes, node.elements); - case 210: - return visitNodes(cbNodes, node.modifiers) || + case 215: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 208: - case 212: + case 213: + case 217: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 209: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.expression); - case 169: + case 214: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.expression) || + visitNode(cbNode, node.type); + case 171: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); - case 173: + case 176: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 126: + case 127: return visitNode(cbNode, node.expression); - case 216: + case 222: return visitNodes(cbNodes, node.types); - case 213: + case 177: + return visitNode(cbNode, node.expression) || + visitNodes(cbNodes, node.typeArguments); + case 219: return visitNode(cbNode, node.expression); + case 218: + return visitNodes(cbNodes, node.decorators); } } ts.forEachChild = forEachChild; @@ -4524,7 +5504,7 @@ var ts; ParsingContext[ParsingContext["TypeMembers"] = 5] = "TypeMembers"; ParsingContext[ParsingContext["ClassMembers"] = 6] = "ClassMembers"; ParsingContext[ParsingContext["EnumMembers"] = 7] = "EnumMembers"; - ParsingContext[ParsingContext["TypeReferences"] = 8] = "TypeReferences"; + ParsingContext[ParsingContext["HeritageClauseElement"] = 8] = "HeritageClauseElement"; ParsingContext[ParsingContext["VariableDeclarations"] = 9] = "VariableDeclarations"; ParsingContext[ParsingContext["ObjectBindingElements"] = 10] = "ObjectBindingElements"; ParsingContext[ParsingContext["ArrayBindingElements"] = 11] = "ArrayBindingElements"; @@ -4555,7 +5535,7 @@ var ts; case 5: return ts.Diagnostics.Property_or_signature_expected; case 6: return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; case 7: return ts.Diagnostics.Enum_member_expected; - case 8: return ts.Diagnostics.Type_reference_expected; + case 8: return ts.Diagnostics.Expression_expected; case 9: return ts.Diagnostics.Variable_declaration_expected; case 10: return ts.Diagnostics.Property_destructuring_pattern_expected; case 11: return ts.Diagnostics.Array_element_destructuring_pattern_expected; @@ -4573,29 +5553,33 @@ var ts; ; function modifierToFlag(token) { switch (token) { - case 109: return 128; - case 108: return 16; - case 107: return 64; - case 106: return 32; - case 77: return 1; - case 114: return 2; - case 69: return 8192; - case 72: return 256; + case 110: return 128; + case 109: return 16; + case 108: return 64; + case 107: return 32; + case 78: return 1; + case 115: return 2; + case 70: return 8192; + case 73: return 256; } return 0; } ts.modifierToFlag = modifierToFlag; function fixupParentReferences(sourceFile) { - var _parent = sourceFile; + // normally parent references are set during binding. However, for clients that only need + // a syntax tree, and no semantic features, then the binding process is an unnecessary + // overhead. This functions allows us to set all the parents, without all the expense of + // binding. + var parent = sourceFile; forEachChild(sourceFile, visitNode); return; function visitNode(n) { - if (n.parent !== _parent) { - n.parent = _parent; - var saveParent = _parent; - _parent = n; + if (n.parent !== parent) { + n.parent = parent; + var saveParent = parent; + parent = n; forEachChild(n, visitNode); - _parent = saveParent; + parent = saveParent; } } } @@ -4603,7 +5587,7 @@ var ts; switch (node.kind) { case 8: case 7: - case 64: + case 65: return true; } return false; @@ -4633,7 +5617,7 @@ var ts; array._children = undefined; array.pos += delta; array.end += delta; - for (var _i = 0, _n = array.length; _i < _n; _i++) { + for (var _i = 0; _i < array.length; _i++) { var node = array[_i]; visitNode(node); } @@ -4697,7 +5681,7 @@ var ts; array.intersectsChange = true; array._children = undefined; adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); - for (var _i = 0, _n = array.length; _i < _n; _i++) { + for (var _i = 0; _i < array.length; _i++) { var node = array[_i]; visitNode(node); } @@ -4813,7 +5797,7 @@ var ts; } ts.updateSourceFile = updateSourceFile; function isEvalOrArgumentsIdentifier(node) { - return node.kind === 64 && + return node.kind === 65 && (node.text === "eval" || node.text === "arguments"); } ts.isEvalOrArgumentsIdentifier = isEvalOrArgumentsIdentifier; @@ -4895,12 +5879,13 @@ var ts; ts.createSourceFile = createSourceFile; function parseSourceFile(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes) { if (setParentNodes === void 0) { setParentNodes = false; } + var disallowInAndDecoratorContext = 2 | 16; var parsingContext = 0; var identifiers = {}; var identifierCount = 0; var nodeCount = 0; var token; - var sourceFile = createNode(221, 0); + var sourceFile = createNode(227, 0); sourceFile.pos = 0; sourceFile.end = sourceText.length; sourceFile.text = sourceText; @@ -4946,6 +5931,19 @@ var ts; function setGeneratorParameterContext(val) { setContextFlag(val, 8); } + function setDecoratorContext(val) { + setContextFlag(val, 16); + } + function doOutsideOfContext(flags, func) { + var currentContextFlags = contextFlags & flags; + if (currentContextFlags) { + setContextFlag(false, currentContextFlags); + var result = func(); + setContextFlag(true, currentContextFlags); + return result; + } + return func(); + } function allowInAnd(func) { if (contextFlags & 2) { setDisallowInContext(false); @@ -4982,6 +5980,15 @@ var ts; } return func(); } + function doInDecoratorContext(func) { + if (contextFlags & 16) { + return func(); + } + setDecoratorContext(true); + var result = func(); + setDecoratorContext(false); + return result; + } function inYieldContext() { return (contextFlags & 4) !== 0; } @@ -4994,10 +6001,13 @@ var ts; function inDisallowInContext() { return (contextFlags & 2) !== 0; } + function inDecoratorContext() { + return (contextFlags & 16) !== 0; + } function parseErrorAtCurrentToken(message, arg0) { var start = scanner.getTokenPos(); - var _length = scanner.getTextPos() - start; - parseErrorAtPosition(start, _length, message, arg0); + var length = scanner.getTextPos() - start; + parseErrorAtPosition(start, length, message, arg0); } function parseErrorAtPosition(start, length, message, arg0) { var lastError = ts.lastOrUndefined(sourceFile.parseDiagnostics); @@ -5054,13 +6064,13 @@ var ts; return speculationHelper(callback, false); } function isIdentifier() { - if (token === 64) { + if (token === 65) { return true; } - if (token === 110 && inYieldContext()) { + if (token === 111 && inYieldContext()) { return false; } - return inStrictModeContext() ? token > 110 : token > 100; + return inStrictModeContext() ? token > 111 : token > 101; } function parseExpected(kind, diagnosticMessage) { if (token === kind) { @@ -5131,7 +6141,7 @@ var ts; } if (parseErrorBeforeNextFinishedNode) { parseErrorBeforeNextFinishedNode = false; - node.parserContextFlags |= 16; + node.parserContextFlags |= 32; } return node; } @@ -5153,12 +6163,12 @@ var ts; function createIdentifier(isIdentifier, diagnosticMessage) { identifierCount++; if (isIdentifier) { - var node = createNode(64); + var node = createNode(65); node.text = internIdentifier(scanner.getTokenValue()); nextToken(); return finishNode(node); } - return createMissingNode(64, false, diagnosticMessage || ts.Diagnostics.Identifier_expected); + return createMissingNode(65, false, diagnosticMessage || ts.Diagnostics.Identifier_expected); } function parseIdentifier(diagnosticMessage) { return createIdentifier(isIdentifier(), diagnosticMessage); @@ -5181,7 +6191,7 @@ var ts; return parseIdentifierName(); } function parseComputedPropertyName() { - var node = createNode(126); + var node = createNode(127); parseExpected(18); var yieldContext = inYieldContext(); if (inGeneratorParameterContext()) { @@ -5205,17 +6215,17 @@ var ts; return ts.isModifier(token) && tryParse(nextTokenCanFollowContextualModifier); } function nextTokenCanFollowContextualModifier() { - if (token === 69) { - return nextToken() === 76; + if (token === 70) { + return nextToken() === 77; } - if (token === 77) { + if (token === 78) { nextToken(); - if (token === 72) { + if (token === 73) { return lookAhead(nextTokenIsClassOrFunction); } return token !== 35 && token !== 14 && canFollowModifier(); } - if (token === 72) { + if (token === 73) { return nextTokenIsClassOrFunction(); } nextToken(); @@ -5229,7 +6239,7 @@ var ts; } function nextTokenIsClassOrFunction() { nextToken(); - return token === 68 || token === 82; + return token === 69 || token === 83; } function isListElement(parsingContext, inErrorRecovery) { var node = currentNode(parsingContext); @@ -5244,11 +6254,11 @@ var ts; case 4: return isStartOfStatement(inErrorRecovery); case 3: - return token === 66 || token === 72; + return token === 67 || token === 73; case 5: return isStartOfTypeMember(); case 6: - return lookAhead(isClassMemberStart); + return lookAhead(isClassMemberStart) || (token === 22 && !inErrorRecovery); case 7: return token === 18 || isLiteralPropertyName(); case 13: @@ -5256,7 +6266,15 @@ var ts; case 10: return isLiteralPropertyName(); case 8: - return isIdentifier() && !isNotHeritageClauseTypeName(); + if (token === 14) { + return lookAhead(isValidHeritageClauseObjectLiteral); + } + if (!inErrorRecovery) { + return isStartOfLeftHandSideExpression() && !isHeritageClauseExtendsOrImplementsKeyword(); + } + else { + return isIdentifier() && !isHeritageClauseExtendsOrImplementsKeyword(); + } case 9: return isIdentifierOrPattern(); case 11: @@ -5278,17 +6296,29 @@ var ts; } ts.Debug.fail("Non-exhaustive case in 'isListElement'."); } + function isValidHeritageClauseObjectLiteral() { + ts.Debug.assert(token === 14); + if (nextToken() === 15) { + var next = nextToken(); + return next === 23 || next === 14 || next === 79 || next === 103; + } + return true; + } function nextTokenIsIdentifier() { nextToken(); return isIdentifier(); } - function isNotHeritageClauseTypeName() { - if (token === 102 || - token === 78) { - return lookAhead(nextTokenIsIdentifier); + function isHeritageClauseExtendsOrImplementsKeyword() { + if (token === 103 || + token === 79) { + return lookAhead(nextTokenIsStartOfExpression); } return false; } + function nextTokenIsStartOfExpression() { + nextToken(); + return isStartOfExpression(); + } function isListTerminator(kind) { if (token === 1) { return true; @@ -5305,13 +6335,13 @@ var ts; case 20: return token === 15; case 4: - return token === 15 || token === 66 || token === 72; + return token === 15 || token === 67 || token === 73; case 8: - return token === 14 || token === 78 || token === 102; + return token === 14 || token === 79 || token === 103; case 9: return isVariableDeclaratorListTerminator(); case 16: - return token === 25 || token === 16 || token === 14 || token === 78 || token === 102; + return token === 25 || token === 16 || token === 14 || token === 79 || token === 103; case 12: return token === 17 || token === 22; case 14: @@ -5404,7 +6434,7 @@ var ts; if (ts.containsParseError(node)) { return undefined; } - var nodeContextFlags = node.parserContextFlags & 31; + var nodeContextFlags = node.parserContextFlags & 63; if (nodeContextFlags !== contextFlags) { return undefined; } @@ -5438,26 +6468,26 @@ var ts; case 15: return isReusableParameter(node); case 19: - case 8: case 16: case 18: case 17: case 12: case 13: + case 8: } return false; } function isReusableModuleElement(node) { if (node) { switch (node.kind) { - case 204: - case 203: - case 210: case 209: - case 196: - case 197: - case 200: - case 199: + case 208: + case 215: + case 214: + case 201: + case 202: + case 205: + case 204: return true; } return isReusableStatement(node); @@ -5467,12 +6497,13 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 133: - case 138: - case 132: - case 134: case 135: - case 130: + case 140: + case 134: + case 136: + case 137: + case 132: + case 178: return true; } } @@ -5481,8 +6512,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 214: - case 215: + case 220: + case 221: return true; } } @@ -5491,56 +6522,56 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 195: - case 175: - case 174: - case 178: - case 177: - case 190: - case 186: - case 188: - case 185: - case 184: - case 182: - case 183: - case 181: + case 200: case 180: - case 187: - case 176: - case 191: - case 189: case 179: + case 183: + case 182: + case 195: + case 191: + case 193: + case 190: + case 189: + case 187: + case 188: + case 186: + case 185: case 192: + case 181: + case 196: + case 194: + case 184: + case 197: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 220; + return node.kind === 226; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 137: + case 139: + case 133: + case 140: case 131: case 138: - case 129: - case 136: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 193) { + if (node.kind !== 198) { return false; } var variableDeclarator = node; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 128) { + if (node.kind !== 129) { return false; } var parameter = node; @@ -5609,7 +6640,7 @@ var ts; function parseEntityName(allowReservedWords, diagnosticMessage) { var entity = parseIdentifier(diagnosticMessage); while (parseOptional(20)) { - var node = createNode(125, entity.pos); + var node = createNode(126, entity.pos); node.left = entity; node.right = parseRightSideOfDot(allowReservedWords); entity = finishNode(node); @@ -5620,13 +6651,13 @@ var ts; if (scanner.hasPrecedingLineBreak() && scanner.isReservedWord()) { var matchesPattern = lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); if (matchesPattern) { - return createMissingNode(64, true, ts.Diagnostics.Identifier_expected); + return createMissingNode(65, true, ts.Diagnostics.Identifier_expected); } } return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(169); + var template = createNode(171); template.head = parseLiteralNode(); ts.Debug.assert(template.head.kind === 11, "Template head has wrong token kind"); var templateSpans = []; @@ -5639,7 +6670,7 @@ var ts; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(173); + var span = createNode(176); span.expression = allowInAnd(parseExpression); var literal; if (token === 15) { @@ -5673,7 +6704,7 @@ var ts; return node; } function parseTypeReference() { - var node = createNode(139); + var node = createNode(141); node.typeName = parseEntityName(false, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && token === 24) { node.typeArguments = parseBracketedList(17, parseType, 24, 25); @@ -5681,15 +6712,15 @@ var ts; return finishNode(node); } function parseTypeQuery() { - var node = createNode(142); - parseExpected(96); + var node = createNode(144); + parseExpected(97); node.exprName = parseEntityName(true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(127); + var node = createNode(128); node.name = parseIdentifier(); - if (parseOptional(78)) { + if (parseOptional(79)) { if (isStartOfType() || !isStartOfExpression()) { node.constraint = parseType(); } @@ -5713,7 +6744,7 @@ var ts; return undefined; } function isStartOfParameter() { - return token === 21 || isIdentifierOrPattern() || ts.isModifier(token); + return token === 21 || isIdentifierOrPattern() || ts.isModifier(token) || token === 52; } function setModifiers(node, modifiers) { if (modifiers) { @@ -5722,7 +6753,8 @@ var ts; } } function parseParameter() { - var node = createNode(128); + var node = createNode(129); + node.decorators = parseDecorators(); setModifiers(node, parseModifiers()); node.dotDotDotToken = parseOptionalToken(21); node.name = inGeneratorParameterContext() ? doInYieldContext(parseIdentifierOrPattern) : parseIdentifierOrPattern(); @@ -5773,8 +6805,8 @@ var ts; } function parseSignatureMember(kind) { var node = createNode(kind); - if (kind === 137) { - parseExpected(87); + if (kind === 139) { + parseExpected(88); } fillSignature(51, false, false, node); parseTypeMemberSemicolon(); @@ -5812,9 +6844,9 @@ var ts; nextToken(); return token === 51 || token === 23 || token === 19; } - function parseIndexSignatureDeclaration(modifiers) { - var fullStart = modifiers ? modifiers.pos : scanner.getStartPos(); - var node = createNode(138, fullStart); + function parseIndexSignatureDeclaration(fullStart, decorators, modifiers) { + var node = createNode(140, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); node.parameters = parseBracketedList(15, parseParameter, 18, 19); node.type = parseTypeAnnotation(); @@ -5823,19 +6855,19 @@ var ts; } function parsePropertyOrMethodSignature() { var fullStart = scanner.getStartPos(); - var _name = parsePropertyName(); + var name = parsePropertyName(); var questionToken = parseOptionalToken(50); if (token === 16 || token === 24) { - var method = createNode(131, fullStart); - method.name = _name; + var method = createNode(133, fullStart); + method.name = name; method.questionToken = questionToken; fillSignature(51, false, false, method); parseTypeMemberSemicolon(); return finishNode(method); } else { - var property = createNode(129, fullStart); - property.name = _name; + var property = createNode(131, fullStart); + property.name = name; property.questionToken = questionToken; property.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -5876,14 +6908,14 @@ var ts; switch (token) { case 16: case 24: - return parseSignatureMember(136); + return parseSignatureMember(138); case 18: return isIndexSignature() - ? parseIndexSignatureDeclaration(undefined) + ? parseIndexSignatureDeclaration(scanner.getStartPos(), undefined, undefined) : parsePropertyOrMethodSignature(); - case 87: + case 88: if (lookAhead(isStartOfConstructSignature)) { - return parseSignatureMember(137); + return parseSignatureMember(139); } case 8: case 7: @@ -5901,9 +6933,11 @@ var ts; } } function parseIndexSignatureWithModifiers() { + var fullStart = scanner.getStartPos(); + var decorators = parseDecorators(); var modifiers = parseModifiers(); return isIndexSignature() - ? parseIndexSignatureDeclaration(modifiers) + ? parseIndexSignatureDeclaration(fullStart, decorators, modifiers) : undefined; } function isStartOfConstructSignature() { @@ -5911,7 +6945,7 @@ var ts; return token === 16 || token === 24; } function parseTypeLiteral() { - var node = createNode(143); + var node = createNode(145); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -5927,12 +6961,12 @@ var ts; return members; } function parseTupleType() { - var node = createNode(145); + var node = createNode(147); node.elementTypes = parseBracketedList(18, parseType, 18, 19); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(147); + var node = createNode(149); parseExpected(16); node.type = parseType(); parseExpected(17); @@ -5940,8 +6974,8 @@ var ts; } function parseFunctionOrConstructorType(kind) { var node = createNode(kind); - if (kind === 141) { - parseExpected(87); + if (kind === 143) { + parseExpected(88); } fillSignature(32, false, false, node); return finishNode(node); @@ -5952,16 +6986,16 @@ var ts; } function parseNonArrayType() { switch (token) { - case 111: - case 120: - case 118: case 112: case 121: + case 119: + case 113: + case 122: var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReference(); - case 98: + case 99: return parseTokenNode(); - case 96: + case 97: return parseTypeQuery(); case 14: return parseTypeLiteral(); @@ -5975,17 +7009,17 @@ var ts; } function isStartOfType() { switch (token) { - case 111: - case 120: - case 118: case 112: case 121: - case 98: - case 96: + case 119: + case 113: + case 122: + case 99: + case 97: case 14: case 18: case 24: - case 87: + case 88: return true; case 16: return lookAhead(isStartOfParenthesizedOrFunctionType); @@ -6001,7 +7035,7 @@ var ts; var type = parseNonArrayType(); while (!scanner.hasPrecedingLineBreak() && parseOptional(18)) { parseExpected(19); - var node = createNode(144, type.pos); + var node = createNode(146, type.pos); node.elementType = type; type = finishNode(node); } @@ -6016,7 +7050,7 @@ var ts; types.push(parseArrayTypeOrHigher()); } types.end = getNodeEnd(); - var node = createNode(146, type.pos); + var node = createNode(148, type.pos); node.types = types; type = finishNode(node); } @@ -6036,7 +7070,7 @@ var ts; if (isIdentifier() || ts.isModifier(token)) { nextToken(); if (token === 51 || token === 23 || - token === 50 || token === 52 || + token === 50 || token === 53 || isIdentifier() || ts.isModifier(token)) { return true; } @@ -6061,23 +7095,23 @@ var ts; } function parseTypeWorker() { if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(140); + return parseFunctionOrConstructorType(142); } - if (token === 87) { - return parseFunctionOrConstructorType(141); + if (token === 88) { + return parseFunctionOrConstructorType(143); } return parseUnionTypeOrHigher(); } function parseTypeAnnotation() { return parseOptional(51) ? parseType() : undefined; } - function isStartOfExpression() { + function isStartOfLeftHandSideExpression() { switch (token) { - case 92: - case 90: - case 88: - case 94: - case 79: + case 93: + case 91: + case 89: + case 95: + case 80: case 7: case 8: case 10: @@ -6085,22 +7119,33 @@ var ts; case 16: case 18: case 14: - case 82: - case 87: + case 83: + case 69: + case 88: case 36: - case 56: + case 57: + case 65: + return true; + default: + return isIdentifier(); + } + } + function isStartOfExpression() { + if (isStartOfLeftHandSideExpression()) { + return true; + } + switch (token) { case 33: case 34: case 47: case 46: - case 73: - case 96: - case 98: + case 74: + case 97: + case 99: case 38: case 39: case 24: - case 64: - case 110: + case 111: return true; default: if (isBinaryOperator()) { @@ -6110,26 +7155,49 @@ var ts; } } function isStartOfExpressionStatement() { - return token !== 14 && token !== 82 && isStartOfExpression(); + return token !== 14 && + token !== 83 && + token !== 69 && + token !== 52 && + isStartOfExpression(); } function parseExpression() { + // Expression[in]: + // AssignmentExpression[in] + // Expression[in] , AssignmentExpression[in] + var saveDecoratorContext = inDecoratorContext(); + if (saveDecoratorContext) { + setDecoratorContext(false); + } var expr = parseAssignmentExpressionOrHigher(); var operatorToken; while ((operatorToken = parseOptionalToken(23))) { expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher()); } + if (saveDecoratorContext) { + setDecoratorContext(true); + } return expr; } function parseInitializer(inParameter) { - if (token !== 52) { + if (token !== 53) { if (scanner.hasPrecedingLineBreak() || (inParameter && token === 14) || !isStartOfExpression()) { return undefined; } } - parseExpected(52); + parseExpected(53); return parseAssignmentExpressionOrHigher(); } function parseAssignmentExpressionOrHigher() { + // AssignmentExpression[in,yield]: + // 1) ConditionalExpression[?in,?yield] + // 2) LeftHandSideExpression = AssignmentExpression[?in,?yield] + // 3) LeftHandSideExpression AssignmentOperator AssignmentExpression[?in,?yield] + // 4) ArrowFunctionExpression[?in,?yield] + // 5) [+Yield] YieldExpression[?In] + // + // Note: for ease of implementation we treat productions '2' and '3' as the same thing. + // (i.e. they're both BinaryExpressions with an assignment operator in it). if (isYieldExpression()) { return parseYieldExpression(); } @@ -6138,7 +7206,7 @@ var ts; return arrowExpression; } var expr = parseBinaryExpressionOrHigher(0); - if (expr.kind === 64 && token === 32) { + if (expr.kind === 65 && token === 32) { return parseSimpleArrowFunctionExpression(expr); } if (isLeftHandSideExpression(expr) && isAssignmentOperator(reScanGreaterToken())) { @@ -6147,7 +7215,7 @@ var ts; return parseConditionalExpressionRest(expr); } function isYieldExpression() { - if (token === 110) { + if (token === 111) { if (inYieldContext()) { return true; } @@ -6168,7 +7236,7 @@ var ts; (isIdentifier() || token === 14 || token === 18); } function parseYieldExpression() { - var node = createNode(170); + var node = createNode(172); nextToken(); if (!scanner.hasPrecedingLineBreak() && (token === 35 || isStartOfExpression())) { @@ -6182,14 +7250,14 @@ var ts; } function parseSimpleArrowFunctionExpression(identifier) { ts.Debug.assert(token === 32, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); - var node = createNode(161, identifier.pos); - var parameter = createNode(128, identifier.pos); + var node = createNode(163, identifier.pos); + var parameter = createNode(129, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = [parameter]; node.parameters.pos = parameter.pos; node.parameters.end = parameter.end; - parseExpected(32); + node.equalsGreaterThanToken = parseExpectedToken(32, false, ts.Diagnostics._0_expected, "=>"); node.body = parseArrowFunctionExpressionBody(); return finishNode(node); } @@ -6204,12 +7272,11 @@ var ts; if (!arrowFunction) { return undefined; } - if (parseExpected(32) || token === 14) { - arrowFunction.body = parseArrowFunctionExpressionBody(); - } - else { - arrowFunction.body = parseIdentifier(); - } + var lastToken = token; + arrowFunction.equalsGreaterThanToken = parseExpectedToken(32, false, ts.Diagnostics._0_expected, "=>"); + arrowFunction.body = (lastToken === 32 || lastToken === 14) + ? parseArrowFunctionExpressionBody() + : parseIdentifier(); return finishNode(arrowFunction); } function isParenthesizedArrowFunctionExpression() { @@ -6259,7 +7326,7 @@ var ts; return parseParenthesizedArrowFunctionExpressionHead(false); } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNode(161); + var node = createNode(163); fillSignature(51, false, !allowAmbiguity, node); if (!node.parameters) { return undefined; @@ -6273,7 +7340,10 @@ var ts; if (token === 14) { return parseFunctionBlock(false, false); } - if (isStartOfStatement(true) && !isStartOfExpressionStatement() && token !== 82) { + if (isStartOfStatement(true) && + !isStartOfExpressionStatement() && + token !== 83 && + token !== 69) { return parseFunctionBlock(false, true); } return parseAssignmentExpressionOrHigher(); @@ -6283,10 +7353,10 @@ var ts; if (!questionToken) { return leftOperand; } - var node = createNode(168, leftOperand.pos); + var node = createNode(170, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; - node.whenTrue = allowInAnd(parseAssignmentExpressionOrHigher); + node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); node.colonToken = parseExpectedToken(51, false, ts.Diagnostics._0_expected, ts.tokenToString(51)); node.whenFalse = parseAssignmentExpressionOrHigher(); return finishNode(node); @@ -6296,7 +7366,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 85 || t === 124; + return t === 86 || t === 125; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -6305,7 +7375,7 @@ var ts; if (newPrecedence <= precedence) { break; } - if (token === 85 && inDisallowInContext()) { + if (token === 86 && inDisallowInContext()) { break; } leftOperand = makeBinaryExpression(leftOperand, parseTokenNode(), parseBinaryExpressionOrHigher(newPrecedence)); @@ -6313,7 +7383,7 @@ var ts; return leftOperand; } function isBinaryOperator() { - if (inDisallowInContext() && token === 85) { + if (inDisallowInContext() && token === 86) { return false; } return getBinaryOperatorPrecedence() > 0; @@ -6339,8 +7409,8 @@ var ts; case 25: case 26: case 27: + case 87: case 86: - case 85: return 7; case 40: case 41: @@ -6357,33 +7427,33 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(167, left.pos); + var node = createNode(169, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(165); + var node = createNode(167); node.operator = token; nextToken(); node.operand = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(162); + var node = createNode(164); nextToken(); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(163); + var node = createNode(165); nextToken(); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(164); + var node = createNode(166); nextToken(); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); @@ -6397,11 +7467,11 @@ var ts; case 38: case 39: return parsePrefixUnaryExpression(); - case 73: + case 74: return parseDeleteExpression(); - case 96: + case 97: return parseTypeOfExpression(); - case 98: + case 99: return parseVoidExpression(); case 24: return parseTypeAssertion(); @@ -6413,7 +7483,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(isLeftHandSideExpression(expression)); if ((token === 38 || token === 39) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(166, expression.pos); + var node = createNode(168, expression.pos); node.operand = expression; node.operator = token; nextToken(); @@ -6422,7 +7492,7 @@ var ts; return expression; } function parseLeftHandSideExpressionOrHigher() { - var expression = token === 90 + var expression = token === 91 ? parseSuperExpression() : parseMemberExpressionOrHigher(); return parseCallExpressionRest(expression); @@ -6436,14 +7506,14 @@ var ts; if (token === 16 || token === 20) { return expression; } - var node = createNode(153, expression.pos); + var node = createNode(155, 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(158); + var node = createNode(160); parseExpected(24); node.type = parseType(); parseExpected(25); @@ -6454,15 +7524,15 @@ var ts; while (true) { var dotToken = parseOptionalToken(20); if (dotToken) { - var propertyAccess = createNode(153, expression.pos); + var propertyAccess = createNode(155, expression.pos); propertyAccess.expression = expression; propertyAccess.dotToken = dotToken; propertyAccess.name = parseRightSideOfDot(true); expression = finishNode(propertyAccess); continue; } - if (parseOptional(18)) { - var indexedAccess = createNode(154, expression.pos); + if (!inDecoratorContext() && parseOptional(18)) { + var indexedAccess = createNode(156, expression.pos); indexedAccess.expression = expression; if (token !== 19) { indexedAccess.argumentExpression = allowInAnd(parseExpression); @@ -6476,7 +7546,7 @@ var ts; continue; } if (token === 10 || token === 11) { - var tagExpression = createNode(157, expression.pos); + var tagExpression = createNode(159, expression.pos); tagExpression.tag = expression; tagExpression.template = token === 10 ? parseLiteralNode() @@ -6495,7 +7565,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(155, expression.pos); + var callExpr = createNode(157, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -6503,10 +7573,10 @@ var ts; continue; } else if (token === 16) { - var _callExpr = createNode(155, expression.pos); - _callExpr.expression = expression; - _callExpr.arguments = parseArgumentList(); - expression = finishNode(_callExpr); + var callExpr = createNode(157, expression.pos); + callExpr.expression = expression; + callExpr.arguments = parseArgumentList(); + expression = finishNode(callExpr); continue; } return expression; @@ -6538,7 +7608,6 @@ var ts; case 19: case 51: case 22: - case 23: case 50: case 28: case 30: @@ -6552,6 +7621,8 @@ var ts; case 15: case 1: return true; + case 23: + case 14: default: return false; } @@ -6562,11 +7633,11 @@ var ts; case 8: case 10: return parseLiteralNode(); - case 92: - case 90: - case 88: - case 94: - case 79: + case 93: + case 91: + case 89: + case 95: + case 80: return parseTokenNode(); case 16: return parseParenthesizedExpression(); @@ -6574,12 +7645,14 @@ var ts; return parseArrayLiteralExpression(); case 14: return parseObjectLiteralExpression(); - case 82: + case 69: + return parseClassExpression(); + case 83: return parseFunctionExpression(); - case 87: + case 88: return parseNewExpression(); case 36: - case 56: + case 57: if (reScanSlashToken() === 9) { return parseLiteralNode(); } @@ -6590,28 +7663,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNode(159); + var node = createNode(161); parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); return finishNode(node); } function parseSpreadElement() { - var node = createNode(171); + var node = createNode(173); parseExpected(21); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token === 21 ? parseSpreadElement() : - token === 23 ? createNode(172) : + token === 23 ? createNode(175) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { - return allowInAnd(parseArgumentOrArrayLiteralElement); + return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(151); + var node = createNode(153); parseExpected(18); if (scanner.hasPrecedingLineBreak()) node.flags |= 512; @@ -6619,19 +7692,20 @@ var ts; parseExpected(19); return finishNode(node); } - function tryParseAccessorDeclaration(fullStart, modifiers) { - if (parseContextualModifier(115)) { - return parseAccessorDeclaration(134, fullStart, modifiers); + function tryParseAccessorDeclaration(fullStart, decorators, modifiers) { + if (parseContextualModifier(116)) { + return parseAccessorDeclaration(136, fullStart, decorators, modifiers); } - else if (parseContextualModifier(119)) { - return parseAccessorDeclaration(135, fullStart, modifiers); + else if (parseContextualModifier(120)) { + return parseAccessorDeclaration(137, fullStart, decorators, modifiers); } return undefined; } function parseObjectLiteralElement() { var fullStart = scanner.getStartPos(); + var decorators = parseDecorators(); var modifiers = parseModifiers(); - var accessor = tryParseAccessorDeclaration(fullStart, modifiers); + var accessor = tryParseAccessorDeclaration(fullStart, decorators, modifiers); if (accessor) { return accessor; } @@ -6641,16 +7715,16 @@ var ts; var propertyName = parsePropertyName(); var questionToken = parseOptionalToken(50); if (asteriskToken || token === 16 || token === 24) { - return parseMethodDeclaration(fullStart, modifiers, asteriskToken, propertyName, questionToken); + return parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, propertyName, questionToken); } if ((token === 23 || token === 15) && tokenIsIdentifier) { - var shorthandDeclaration = createNode(219, fullStart); + var shorthandDeclaration = createNode(225, fullStart); shorthandDeclaration.name = propertyName; shorthandDeclaration.questionToken = questionToken; return finishNode(shorthandDeclaration); } else { - var propertyAssignment = createNode(218, fullStart); + var propertyAssignment = createNode(224, fullStart); propertyAssignment.name = propertyName; propertyAssignment.questionToken = questionToken; parseExpected(51); @@ -6659,7 +7733,7 @@ var ts; } } function parseObjectLiteralExpression() { - var node = createNode(152); + var node = createNode(154); parseExpected(14); if (scanner.hasPrecedingLineBreak()) { node.flags |= 512; @@ -6669,20 +7743,27 @@ var ts; return finishNode(node); } function parseFunctionExpression() { - var node = createNode(160); - parseExpected(82); + var saveDecoratorContext = inDecoratorContext(); + if (saveDecoratorContext) { + setDecoratorContext(false); + } + var node = createNode(162); + parseExpected(83); node.asteriskToken = parseOptionalToken(35); node.name = node.asteriskToken ? doInYieldContext(parseOptionalIdentifier) : parseOptionalIdentifier(); fillSignature(51, !!node.asteriskToken, false, node); node.body = parseFunctionBlock(!!node.asteriskToken, false); + if (saveDecoratorContext) { + setDecoratorContext(true); + } return finishNode(node); } function parseOptionalIdentifier() { return isIdentifier() ? parseIdentifier() : undefined; } function parseNewExpression() { - var node = createNode(156); - parseExpected(87); + var node = createNode(158); + parseExpected(88); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); if (node.typeArguments || token === 16) { @@ -6691,7 +7772,7 @@ var ts; return finishNode(node); } function parseBlock(ignoreMissingOpenBrace, checkForStrictMode, diagnosticMessage) { - var node = createNode(174); + var node = createNode(179); if (parseExpected(14, diagnosticMessage) || ignoreMissingOpenBrace) { node.statements = parseList(2, checkForStrictMode, parseStatement); parseExpected(15); @@ -6704,30 +7785,37 @@ var ts; function parseFunctionBlock(allowYield, ignoreMissingOpenBrace, diagnosticMessage) { var savedYieldContext = inYieldContext(); setYieldContext(allowYield); + var saveDecoratorContext = inDecoratorContext(); + if (saveDecoratorContext) { + setDecoratorContext(false); + } var block = parseBlock(ignoreMissingOpenBrace, true, diagnosticMessage); + if (saveDecoratorContext) { + setDecoratorContext(true); + } setYieldContext(savedYieldContext); return block; } function parseEmptyStatement() { - var node = createNode(176); + var node = createNode(181); parseExpected(22); return finishNode(node); } function parseIfStatement() { - var node = createNode(178); - parseExpected(83); + var node = createNode(183); + parseExpected(84); parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); node.thenStatement = parseStatement(); - node.elseStatement = parseOptional(75) ? parseStatement() : undefined; + node.elseStatement = parseOptional(76) ? parseStatement() : undefined; return finishNode(node); } function parseDoStatement() { - var node = createNode(179); - parseExpected(74); + var node = createNode(184); + parseExpected(75); node.statement = parseStatement(); - parseExpected(99); + parseExpected(100); parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); @@ -6735,8 +7823,8 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(180); - parseExpected(99); + var node = createNode(185); + parseExpected(100); parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); @@ -6745,11 +7833,11 @@ var ts; } function parseForOrForInOrForOfStatement() { var pos = getNodePos(); - parseExpected(81); + parseExpected(82); parseExpected(16); var initializer = undefined; if (token !== 22) { - if (token === 97 || token === 104 || token === 69) { + if (token === 98 || token === 105 || token === 70) { initializer = parseVariableDeclarationList(true); } else { @@ -6757,22 +7845,22 @@ var ts; } } var forOrForInOrForOfStatement; - if (parseOptional(85)) { - var forInStatement = createNode(182, pos); + if (parseOptional(86)) { + var forInStatement = createNode(187, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(17); forOrForInOrForOfStatement = forInStatement; } - else if (parseOptional(124)) { - var forOfStatement = createNode(183, pos); + else if (parseOptional(125)) { + var forOfStatement = createNode(188, pos); forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(17); forOrForInOrForOfStatement = forOfStatement; } else { - var forStatement = createNode(181, pos); + var forStatement = createNode(186, pos); forStatement.initializer = initializer; parseExpected(22); if (token !== 22 && token !== 17) { @@ -6790,7 +7878,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 185 ? 65 : 70); + parseExpected(kind === 190 ? 66 : 71); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -6798,8 +7886,8 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(186); - parseExpected(89); + var node = createNode(191); + parseExpected(90); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); } @@ -6807,8 +7895,8 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(187); - parseExpected(100); + var node = createNode(192); + parseExpected(101); parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); @@ -6816,30 +7904,30 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(214); - parseExpected(66); + var node = createNode(220); + parseExpected(67); node.expression = allowInAnd(parseExpression); parseExpected(51); node.statements = parseList(4, false, parseStatement); return finishNode(node); } function parseDefaultClause() { - var node = createNode(215); - parseExpected(72); + var node = createNode(221); + parseExpected(73); parseExpected(51); node.statements = parseList(4, false, parseStatement); return finishNode(node); } function parseCaseOrDefaultClause() { - return token === 66 ? parseCaseClause() : parseDefaultClause(); + return token === 67 ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(188); - parseExpected(91); + var node = createNode(193); + parseExpected(92); parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); - var caseBlock = createNode(202, scanner.getStartPos()); + var caseBlock = createNode(207, scanner.getStartPos()); parseExpected(14); caseBlock.clauses = parseList(3, false, parseCaseOrDefaultClause); parseExpected(15); @@ -6847,26 +7935,28 @@ var ts; return finishNode(node); } function parseThrowStatement() { - var node = createNode(190); - parseExpected(93); + // ThrowStatement[Yield] : + // throw [no LineTerminator here]Expression[In, ?Yield]; + var node = createNode(195); + parseExpected(94); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); return finishNode(node); } function parseTryStatement() { - var node = createNode(191); - parseExpected(95); + var node = createNode(196); + parseExpected(96); node.tryBlock = parseBlock(false, false); - node.catchClause = token === 67 ? parseCatchClause() : undefined; - if (!node.catchClause || token === 80) { - parseExpected(80); + node.catchClause = token === 68 ? parseCatchClause() : undefined; + if (!node.catchClause || token === 81) { + parseExpected(81); node.finallyBlock = parseBlock(false, false); } return finishNode(node); } function parseCatchClause() { - var result = createNode(217); - parseExpected(67); + var result = createNode(223); + parseExpected(68); if (parseExpected(16)) { result.variableDeclaration = parseVariableDeclaration(); } @@ -6875,22 +7965,22 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(192); - parseExpected(71); + var node = createNode(197); + parseExpected(72); parseSemicolon(); return finishNode(node); } function parseExpressionOrLabeledStatement() { var fullStart = scanner.getStartPos(); var expression = allowInAnd(parseExpression); - if (expression.kind === 64 && parseOptional(51)) { - var labeledStatement = createNode(189, fullStart); + if (expression.kind === 65 && parseOptional(51)) { + var labeledStatement = createNode(194, fullStart); labeledStatement.label = expression; labeledStatement.statement = parseStatement(); return finishNode(labeledStatement); } else { - var expressionStatement = createNode(177, fullStart); + var expressionStatement = createNode(182, fullStart); expressionStatement.expression = expression; parseSemicolon(); return finishNode(expressionStatement); @@ -6898,7 +7988,7 @@ var ts; } function isStartOfStatement(inErrorRecovery) { if (ts.isModifier(token)) { - var result = lookAhead(parseVariableStatementOrFunctionDeclarationWithModifiers); + var result = lookAhead(parseVariableStatementOrFunctionDeclarationOrClassDeclarationWithDecoratorsOrModifiers); if (result) { return true; } @@ -6907,39 +7997,39 @@ var ts; case 22: return !inErrorRecovery; case 14: - case 97: - case 104: - case 82: + case 98: + case 105: case 83: - case 74: - case 99: - case 81: - case 70: - case 65: - case 89: - case 100: - case 91: - case 93: - case 95: - case 71: - case 67: - case 80: - return true; case 69: + case 84: + case 75: + case 100: + case 82: + case 71: + case 66: + case 90: + case 101: + case 92: + case 94: + case 96: + case 72: + case 68: + case 81: + return true; + case 70: var isConstEnum = lookAhead(nextTokenIsEnumKeyword); return !isConstEnum; - case 103: - case 68: - case 116: - case 76: - case 122: + case 104: + case 117: + case 77: + case 123: if (isDeclarationStart()) { return false; } - case 108: - case 106: - case 107: case 109: + case 107: + case 108: + case 110: if (lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine)) { return false; } @@ -6949,7 +8039,7 @@ var ts; } function nextTokenIsEnumKeyword() { nextToken(); - return token === 76; + return token === 77; } function nextTokenIsIdentifierOrKeywordOnSameLine() { nextToken(); @@ -6959,46 +8049,48 @@ var ts; switch (token) { case 14: return parseBlock(false, false); - case 97: + case 98: + case 70: + return parseVariableStatement(scanner.getStartPos(), undefined, undefined); + case 83: + return parseFunctionDeclaration(scanner.getStartPos(), undefined, undefined); case 69: - return parseVariableStatement(scanner.getStartPos(), undefined); - case 82: - return parseFunctionDeclaration(scanner.getStartPos(), undefined); + return parseClassDeclaration(scanner.getStartPos(), undefined, undefined); case 22: return parseEmptyStatement(); - case 83: + case 84: return parseIfStatement(); - case 74: + case 75: return parseDoStatement(); - case 99: - return parseWhileStatement(); - case 81: - return parseForOrForInOrForOfStatement(); - case 70: - return parseBreakOrContinueStatement(184); - case 65: - return parseBreakOrContinueStatement(185); - case 89: - return parseReturnStatement(); case 100: - return parseWithStatement(); - case 91: - return parseSwitchStatement(); - case 93: - return parseThrowStatement(); - case 95: - case 67: - case 80: - return parseTryStatement(); + return parseWhileStatement(); + case 82: + return parseForOrForInOrForOfStatement(); case 71: + return parseBreakOrContinueStatement(189); + case 66: + return parseBreakOrContinueStatement(190); + case 90: + return parseReturnStatement(); + case 101: + return parseWithStatement(); + case 92: + return parseSwitchStatement(); + case 94: + return parseThrowStatement(); + case 96: + case 68: + case 81: + return parseTryStatement(); + case 72: return parseDebuggerStatement(); - case 104: + case 105: if (isLetDeclaration()) { - return parseVariableStatement(scanner.getStartPos(), undefined); + return parseVariableStatement(scanner.getStartPos(), undefined, undefined); } default: - if (ts.isModifier(token)) { - var result = tryParse(parseVariableStatementOrFunctionDeclarationWithModifiers); + if (ts.isModifier(token) || token === 52) { + var result = tryParse(parseVariableStatementOrFunctionDeclarationOrClassDeclarationWithDecoratorsOrModifiers); if (result) { return result; } @@ -7006,25 +8098,28 @@ var ts; return parseExpressionOrLabeledStatement(); } } - function parseVariableStatementOrFunctionDeclarationWithModifiers() { + function parseVariableStatementOrFunctionDeclarationOrClassDeclarationWithDecoratorsOrModifiers() { var start = scanner.getStartPos(); + var decorators = parseDecorators(); var modifiers = parseModifiers(); switch (token) { - case 69: + case 70: var nextTokenIsEnum = lookAhead(nextTokenIsEnumKeyword); if (nextTokenIsEnum) { return undefined; } - return parseVariableStatement(start, modifiers); - case 104: + return parseVariableStatement(start, decorators, modifiers); + case 105: if (!isLetDeclaration()) { return undefined; } - return parseVariableStatement(start, modifiers); - case 97: - return parseVariableStatement(start, modifiers); - case 82: - return parseFunctionDeclaration(start, modifiers); + return parseVariableStatement(start, decorators, modifiers); + case 98: + return parseVariableStatement(start, decorators, modifiers); + case 83: + return parseFunctionDeclaration(start, decorators, modifiers); + case 69: + return parseClassDeclaration(start, decorators, modifiers); } return undefined; } @@ -7037,18 +8132,18 @@ var ts; } function parseArrayBindingElement() { if (token === 23) { - return createNode(172); + return createNode(175); } - var node = createNode(150); + var node = createNode(152); node.dotDotDotToken = parseOptionalToken(21); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(false); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(150); + var node = createNode(152); var id = parsePropertyName(); - if (id.kind === 64 && token !== 51) { + if (id.kind === 65 && token !== 51) { node.name = id; } else { @@ -7060,14 +8155,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(148); + var node = createNode(150); parseExpected(14); node.elements = parseDelimitedList(10, parseObjectBindingElement); parseExpected(15); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(149); + var node = createNode(151); parseExpected(18); node.elements = parseDelimitedList(11, parseArrayBindingElement); parseExpected(19); @@ -7086,7 +8181,7 @@ var ts; return parseIdentifier(); } function parseVariableDeclaration() { - var node = createNode(193); + var node = createNode(198); node.name = parseIdentifierOrPattern(); node.type = parseTypeAnnotation(); if (!isInOrOfKeyword(token)) { @@ -7095,21 +8190,21 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(194); + var node = createNode(199); switch (token) { - case 97: + case 98: break; - case 104: + case 105: node.flags |= 4096; break; - case 69: + case 70: node.flags |= 8192; break; default: ts.Debug.fail(); } nextToken(); - if (token === 124 && lookAhead(canFollowContextualOfKeyword)) { + if (token === 125 && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -7123,33 +8218,37 @@ var ts; function canFollowContextualOfKeyword() { return nextTokenIsIdentifier() && nextToken() === 17; } - function parseVariableStatement(fullStart, modifiers) { - var node = createNode(175, fullStart); + function parseVariableStatement(fullStart, decorators, modifiers) { + var node = createNode(180, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); node.declarationList = parseVariableDeclarationList(false); parseSemicolon(); return finishNode(node); } - function parseFunctionDeclaration(fullStart, modifiers) { - var node = createNode(195, fullStart); + function parseFunctionDeclaration(fullStart, decorators, modifiers) { + var node = createNode(200, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(82); + parseExpected(83); node.asteriskToken = parseOptionalToken(35); node.name = node.flags & 256 ? parseOptionalIdentifier() : parseIdentifier(); fillSignature(51, !!node.asteriskToken, false, node); node.body = parseFunctionBlockOrSemicolon(!!node.asteriskToken, ts.Diagnostics.or_expected); return finishNode(node); } - function parseConstructorDeclaration(pos, modifiers) { - var node = createNode(133, pos); + function parseConstructorDeclaration(pos, decorators, modifiers) { + var node = createNode(135, pos); + node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(113); + parseExpected(114); fillSignature(51, false, false, node); node.body = parseFunctionBlockOrSemicolon(false, ts.Diagnostics.or_expected); return finishNode(node); } - function parseMethodDeclaration(fullStart, modifiers, asteriskToken, name, questionToken, diagnosticMessage) { - var method = createNode(132, fullStart); + function parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, diagnosticMessage) { + var method = createNode(134, fullStart); + method.decorators = decorators; setModifiers(method, modifiers); method.asteriskToken = asteriskToken; method.name = name; @@ -7158,29 +8257,34 @@ var ts; method.body = parseFunctionBlockOrSemicolon(!!asteriskToken, diagnosticMessage); return finishNode(method); } - function parsePropertyOrMethodDeclaration(fullStart, modifiers) { + function parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken) { + var property = createNode(132, fullStart); + property.decorators = decorators; + setModifiers(property, modifiers); + property.name = name; + property.questionToken = questionToken; + property.type = parseTypeAnnotation(); + property.initializer = allowInAnd(parseNonParameterInitializer); + parseSemicolon(); + return finishNode(property); + } + function parsePropertyOrMethodDeclaration(fullStart, decorators, modifiers) { var asteriskToken = parseOptionalToken(35); - var _name = parsePropertyName(); + var name = parsePropertyName(); var questionToken = parseOptionalToken(50); if (asteriskToken || token === 16 || token === 24) { - return parseMethodDeclaration(fullStart, modifiers, asteriskToken, _name, questionToken, ts.Diagnostics.or_expected); + return parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, ts.Diagnostics.or_expected); } else { - var property = createNode(130, fullStart); - setModifiers(property, modifiers); - property.name = _name; - property.questionToken = questionToken; - property.type = parseTypeAnnotation(); - property.initializer = allowInAnd(parseNonParameterInitializer); - parseSemicolon(); - return finishNode(property); + return parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken); } } function parseNonParameterInitializer() { return parseInitializer(false); } - function parseAccessorDeclaration(kind, fullStart, modifiers) { + function parseAccessorDeclaration(kind, fullStart, decorators, modifiers) { var node = createNode(kind, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); node.name = parsePropertyName(); fillSignature(51, false, false, node); @@ -7189,6 +8293,9 @@ var ts; } function isClassMemberStart() { var idToken; + if (token === 52) { + return true; + } while (ts.isModifier(token)) { idToken = token; nextToken(); @@ -7204,14 +8311,14 @@ var ts; return true; } if (idToken !== undefined) { - if (!ts.isKeyword(idToken) || idToken === 119 || idToken === 115) { + if (!ts.isKeyword(idToken) || idToken === 120 || idToken === 116) { return true; } switch (token) { case 16: case 24: case 51: - case 52: + case 53: case 50: return true; default: @@ -7220,6 +8327,26 @@ var ts; } return false; } + function parseDecorators() { + var decorators; + while (true) { + var decoratorStart = getNodePos(); + if (!parseOptional(52)) { + break; + } + if (!decorators) { + decorators = []; + decorators.pos = scanner.getStartPos(); + } + var decorator = createNode(130, decoratorStart); + decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); + decorators.push(finishNode(decorator)); + } + if (decorators) { + decorators.end = getNodeEnd(); + } + return decorators; + } function parseModifiers() { var flags = 0; var modifiers; @@ -7243,31 +8370,52 @@ var ts; return modifiers; } function parseClassElement() { + if (token === 22) { + var result = createNode(178); + nextToken(); + return finishNode(result); + } var fullStart = getNodePos(); + var decorators = parseDecorators(); var modifiers = parseModifiers(); - var accessor = tryParseAccessorDeclaration(fullStart, modifiers); + var accessor = tryParseAccessorDeclaration(fullStart, decorators, modifiers); if (accessor) { return accessor; } - if (token === 113) { - return parseConstructorDeclaration(fullStart, modifiers); + if (token === 114) { + return parseConstructorDeclaration(fullStart, decorators, modifiers); } if (isIndexSignature()) { - return parseIndexSignatureDeclaration(modifiers); + return parseIndexSignatureDeclaration(fullStart, decorators, modifiers); } if (isIdentifierOrKeyword() || token === 8 || token === 7 || token === 35 || token === 18) { - return parsePropertyOrMethodDeclaration(fullStart, modifiers); + return parsePropertyOrMethodDeclaration(fullStart, decorators, modifiers); + } + if (decorators) { + var name_3 = createMissingNode(65, true, ts.Diagnostics.Declaration_expected); + return parsePropertyDeclaration(fullStart, decorators, modifiers, name_3, undefined); } ts.Debug.fail("Should not have attempted to parse class member declaration."); } - function parseClassDeclaration(fullStart, modifiers) { - var node = createNode(196, fullStart); + function parseClassExpression() { + return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 174); + } + function parseClassDeclaration(fullStart, decorators, modifiers) { + return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 201); + } + function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) { + var savedStrictModeContext = inStrictModeContext(); + if (languageVersion >= 2) { + setStrictModeContext(true); + } + var node = createNode(kind, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(68); + parseExpected(69); node.name = node.flags & 256 ? parseOptionalIdentifier() : parseIdentifier(); node.typeParameters = parseTypeParameters(); node.heritageClauses = parseHeritageClauses(true); @@ -7280,9 +8428,14 @@ var ts; else { node.members = createMissingList(); } - return finishNode(node); + var finishedNode = finishNode(node); + setStrictModeContext(savedStrictModeContext); + return finishedNode; } function parseHeritageClauses(isClassHeritageClause) { + // ClassTail[Yield,GeneratorParameter] : See 14.5 + // [~GeneratorParameter]ClassHeritage[?Yield]opt { ClassBody[?Yield]opt } + // [+GeneratorParameter] ClassHeritageopt { ClassBodyopt } if (isHeritageClause()) { return isClassHeritageClause && inGeneratorParameterContext() ? doOutsideOfYieldContext(parseHeritageClausesWorker) @@ -7294,51 +8447,62 @@ var ts; return parseList(19, false, parseHeritageClause); } function parseHeritageClause() { - if (token === 78 || token === 102) { - var node = createNode(216); + if (token === 79 || token === 103) { + var node = createNode(222); node.token = token; nextToken(); - node.types = parseDelimitedList(8, parseTypeReference); + node.types = parseDelimitedList(8, parseHeritageClauseElement); return finishNode(node); } return undefined; } + function parseHeritageClauseElement() { + var node = createNode(177); + node.expression = parseLeftHandSideExpressionOrHigher(); + if (token === 24) { + node.typeArguments = parseBracketedList(17, parseType, 24, 25); + } + return finishNode(node); + } function isHeritageClause() { - return token === 78 || token === 102; + return token === 79 || token === 103; } function parseClassMembers() { return parseList(6, false, parseClassElement); } - function parseInterfaceDeclaration(fullStart, modifiers) { - var node = createNode(197, fullStart); + function parseInterfaceDeclaration(fullStart, decorators, modifiers) { + var node = createNode(202, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(103); + parseExpected(104); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); node.heritageClauses = parseHeritageClauses(false); node.members = parseObjectTypeMembers(); return finishNode(node); } - function parseTypeAliasDeclaration(fullStart, modifiers) { - var node = createNode(198, fullStart); + function parseTypeAliasDeclaration(fullStart, decorators, modifiers) { + var node = createNode(203, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(122); + parseExpected(123); node.name = parseIdentifier(); - parseExpected(52); + parseExpected(53); node.type = parseType(); parseSemicolon(); return finishNode(node); } function parseEnumMember() { - var node = createNode(220, scanner.getStartPos()); + var node = createNode(226, scanner.getStartPos()); node.name = parsePropertyName(); node.initializer = allowInAnd(parseNonParameterInitializer); return finishNode(node); } - function parseEnumDeclaration(fullStart, modifiers) { - var node = createNode(199, fullStart); + function parseEnumDeclaration(fullStart, decorators, modifiers) { + var node = createNode(204, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(76); + parseExpected(77); node.name = parseIdentifier(); if (parseExpected(14)) { node.members = parseDelimitedList(7, parseEnumMember); @@ -7350,7 +8514,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(201, scanner.getStartPos()); + var node = createNode(206, scanner.getStartPos()); if (parseExpected(14)) { node.statements = parseList(1, false, parseModuleElement); parseExpected(15); @@ -7360,31 +8524,33 @@ var ts; } return finishNode(node); } - function parseInternalModuleTail(fullStart, modifiers, flags) { - var node = createNode(200, fullStart); + function parseInternalModuleTail(fullStart, decorators, modifiers, flags) { + var node = createNode(205, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); node.flags |= flags; node.name = parseIdentifier(); node.body = parseOptional(20) - ? parseInternalModuleTail(getNodePos(), undefined, 1) + ? parseInternalModuleTail(getNodePos(), undefined, undefined, 1) : parseModuleBlock(); return finishNode(node); } - function parseAmbientExternalModuleDeclaration(fullStart, modifiers) { - var node = createNode(200, fullStart); + function parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) { + var node = createNode(205, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); node.name = parseLiteralNode(true); node.body = parseModuleBlock(); return finishNode(node); } - function parseModuleDeclaration(fullStart, modifiers) { - parseExpected(116); + function parseModuleDeclaration(fullStart, decorators, modifiers) { + parseExpected(117); return token === 8 - ? parseAmbientExternalModuleDeclaration(fullStart, modifiers) - : parseInternalModuleTail(fullStart, modifiers, modifiers ? modifiers.flags : 0); + ? parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) + : parseInternalModuleTail(fullStart, decorators, modifiers, modifiers ? modifiers.flags : 0); } function isExternalModuleReference() { - return token === 117 && + return token === 118 && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -7393,44 +8559,52 @@ var ts; function nextTokenIsCommaOrFromKeyword() { nextToken(); return token === 23 || - token === 123; + token === 124; } - function parseImportDeclarationOrImportEqualsDeclaration(fullStart, modifiers) { - parseExpected(84); + function parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers) { + parseExpected(85); var afterImportPos = scanner.getStartPos(); var identifier; if (isIdentifier()) { identifier = parseIdentifier(); - if (token !== 23 && token !== 123) { - var importEqualsDeclaration = createNode(203, fullStart); + if (token !== 23 && token !== 124) { + var importEqualsDeclaration = createNode(208, fullStart); + importEqualsDeclaration.decorators = decorators; setModifiers(importEqualsDeclaration, modifiers); importEqualsDeclaration.name = identifier; - parseExpected(52); + parseExpected(53); importEqualsDeclaration.moduleReference = parseModuleReference(); parseSemicolon(); return finishNode(importEqualsDeclaration); } } - var importDeclaration = createNode(204, fullStart); + var importDeclaration = createNode(209, fullStart); + importDeclaration.decorators = decorators; setModifiers(importDeclaration, modifiers); if (identifier || token === 35 || token === 14) { importDeclaration.importClause = parseImportClause(identifier, afterImportPos); - parseExpected(123); + parseExpected(124); } importDeclaration.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); return finishNode(importDeclaration); } function parseImportClause(identifier, fullStart) { - var importClause = createNode(205, fullStart); + //ImportClause: + // ImportedDefaultBinding + // NameSpaceImport + // NamedImports + // ImportedDefaultBinding, NameSpaceImport + // ImportedDefaultBinding, NamedImports + var importClause = createNode(210, fullStart); if (identifier) { importClause.name = identifier; } if (!importClause.name || parseOptional(23)) { - importClause.namedBindings = token === 35 ? parseNamespaceImport() : parseNamedImportsOrExports(207); + importClause.namedBindings = token === 35 ? parseNamespaceImport() : parseNamedImportsOrExports(212); } return finishNode(importClause); } @@ -7440,8 +8614,8 @@ var ts; : parseEntityName(false); } function parseExternalModuleReference() { - var node = createNode(213); - parseExpected(117); + var node = createNode(219); + parseExpected(118); parseExpected(16); node.expression = parseModuleSpecifier(); parseExpected(17); @@ -7455,107 +8629,116 @@ var ts; return result; } function parseNamespaceImport() { - var namespaceImport = createNode(206); + var namespaceImport = createNode(211); parseExpected(35); - parseExpected(101); + parseExpected(102); namespaceImport.name = parseIdentifier(); return finishNode(namespaceImport); } function parseNamedImportsOrExports(kind) { var node = createNode(kind); - node.elements = parseBracketedList(20, kind === 207 ? parseImportSpecifier : parseExportSpecifier, 14, 15); + node.elements = parseBracketedList(20, kind === 212 ? parseImportSpecifier : parseExportSpecifier, 14, 15); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(212); + return parseImportOrExportSpecifier(217); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(208); + return parseImportOrExportSpecifier(213); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); - var isFirstIdentifierNameNotAnIdentifier = ts.isKeyword(token) && !isIdentifier(); - var start = scanner.getTokenPos(); + var checkIdentifierIsKeyword = ts.isKeyword(token) && !isIdentifier(); + var checkIdentifierStart = scanner.getTokenPos(); + var checkIdentifierEnd = scanner.getTextPos(); var identifierName = parseIdentifierName(); - if (token === 101) { + if (token === 102) { node.propertyName = identifierName; - parseExpected(101); - if (isIdentifier()) { - node.name = parseIdentifierName(); - } - else { - parseErrorAtCurrentToken(ts.Diagnostics.Identifier_expected); - } + parseExpected(102); + checkIdentifierIsKeyword = ts.isKeyword(token) && !isIdentifier(); + checkIdentifierStart = scanner.getTokenPos(); + checkIdentifierEnd = scanner.getTextPos(); + node.name = parseIdentifierName(); } else { node.name = identifierName; - if (isFirstIdentifierNameNotAnIdentifier) { - parseErrorAtPosition(start, identifierName.end - start, ts.Diagnostics.Identifier_expected); - } + } + if (kind === 213 && checkIdentifierIsKeyword) { + parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } - function parseExportDeclaration(fullStart, modifiers) { - var node = createNode(210, fullStart); + function parseExportDeclaration(fullStart, decorators, modifiers) { + var node = createNode(215, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); if (parseOptional(35)) { - parseExpected(123); + parseExpected(124); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(211); - if (parseOptional(123)) { + node.exportClause = parseNamedImportsOrExports(216); + if (parseOptional(124)) { node.moduleSpecifier = parseModuleSpecifier(); } } parseSemicolon(); return finishNode(node); } - function parseExportAssignment(fullStart, modifiers) { - var node = createNode(209, fullStart); + function parseExportAssignment(fullStart, decorators, modifiers) { + var node = createNode(214, fullStart); + node.decorators = decorators; setModifiers(node, modifiers); - if (parseOptional(52)) { + if (parseOptional(53)) { node.isExportEquals = true; + node.expression = parseAssignmentExpressionOrHigher(); } else { - parseExpected(72); + parseExpected(73); + if (parseOptional(51)) { + node.type = parseType(); + } + else { + node.expression = parseAssignmentExpressionOrHigher(); + } } - node.expression = parseAssignmentExpressionOrHigher(); parseSemicolon(); return finishNode(node); } function isLetDeclaration() { return inStrictModeContext() || lookAhead(nextTokenIsIdentifierOrStartOfDestructuringOnTheSameLine); } - function isDeclarationStart() { + function isDeclarationStart(followsModifier) { switch (token) { - case 97: - case 69: - case 82: + case 98: + case 70: + case 83: return true; - case 104: + case 105: return isLetDeclaration(); - case 68: - case 103: - case 76: - case 122: - return lookAhead(nextTokenIsIdentifierOrKeyword); - case 84: - return lookAhead(nextTokenCanFollowImportKeyword); - case 116: - return lookAhead(nextTokenIsIdentifierOrKeywordOrStringLiteral); + case 69: + case 104: case 77: + case 123: + return lookAhead(nextTokenIsIdentifierOrKeyword); + case 85: + return lookAhead(nextTokenCanFollowImportKeyword); + case 117: + return lookAhead(nextTokenIsIdentifierOrKeywordOrStringLiteral); + case 78: return lookAhead(nextTokenCanFollowExportKeyword); - case 114: - case 108: - case 106: - case 107: + case 115: case 109: + case 107: + case 108: + case 110: return lookAhead(nextTokenIsDeclarationStart); + case 52: + return !followsModifier; } } function isIdentifierOrKeyword() { - return token >= 64; + return token >= 65; } function nextTokenIsIdentifierOrKeyword() { nextToken(); @@ -7572,48 +8755,56 @@ var ts; } function nextTokenCanFollowExportKeyword() { nextToken(); - return token === 52 || token === 35 || - token === 14 || token === 72 || isDeclarationStart(); + return token === 53 || token === 35 || + token === 14 || token === 73 || isDeclarationStart(true); } function nextTokenIsDeclarationStart() { nextToken(); - return isDeclarationStart(); + return isDeclarationStart(true); } function nextTokenIsAsKeyword() { - return nextToken() === 101; + return nextToken() === 102; } function parseDeclaration() { var fullStart = getNodePos(); + var decorators = parseDecorators(); var modifiers = parseModifiers(); - if (token === 77) { + if (token === 78) { nextToken(); - if (token === 72 || token === 52) { - return parseExportAssignment(fullStart, modifiers); + if (token === 73 || token === 53) { + return parseExportAssignment(fullStart, decorators, modifiers); } if (token === 35 || token === 14) { - return parseExportDeclaration(fullStart, modifiers); + return parseExportDeclaration(fullStart, decorators, modifiers); } } switch (token) { - case 97: - case 104: + case 98: + case 105: + case 70: + return parseVariableStatement(fullStart, decorators, modifiers); + case 83: + return parseFunctionDeclaration(fullStart, decorators, modifiers); case 69: - return parseVariableStatement(fullStart, modifiers); - case 82: - return parseFunctionDeclaration(fullStart, modifiers); - case 68: - return parseClassDeclaration(fullStart, modifiers); - case 103: - return parseInterfaceDeclaration(fullStart, modifiers); - case 122: - return parseTypeAliasDeclaration(fullStart, modifiers); - case 76: - return parseEnumDeclaration(fullStart, modifiers); - case 116: - return parseModuleDeclaration(fullStart, modifiers); - case 84: - return parseImportDeclarationOrImportEqualsDeclaration(fullStart, modifiers); + return parseClassDeclaration(fullStart, decorators, modifiers); + case 104: + return parseInterfaceDeclaration(fullStart, decorators, modifiers); + case 123: + return parseTypeAliasDeclaration(fullStart, decorators, modifiers); + case 77: + return parseEnumDeclaration(fullStart, decorators, modifiers); + case 117: + return parseModuleDeclaration(fullStart, decorators, modifiers); + case 85: + return parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers); default: + if (decorators) { + var node = createMissingNode(218, true, ts.Diagnostics.Declaration_expected); + node.pos = fullStart; + node.decorators = decorators; + setModifiers(node, modifiers); + return finishNode(node); + } ts.Debug.fail("Mismatch between isDeclarationStart and parseDeclaration"); } } @@ -7688,10 +8879,10 @@ var ts; function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { return node.flags & 1 - || node.kind === 203 && node.moduleReference.kind === 213 - || node.kind === 204 + || node.kind === 208 && node.moduleReference.kind === 219 || node.kind === 209 - || node.kind === 210 + || node.kind === 214 + || node.kind === 215 ? node : undefined; }); @@ -7700,26 +8891,27 @@ var ts; function isLeftHandSideExpression(expr) { if (expr) { switch (expr.kind) { - case 153: - case 154: - case 156: case 155: + case 156: + case 158: case 157: - case 151: case 159: - case 152: - case 160: - case 64: + case 153: + case 161: + case 154: + case 174: + case 162: + case 65: case 9: case 7: case 8: case 10: - case 169: - case 79: - case 88: - case 92: - case 94: - case 90: + case 171: + case 80: + case 89: + case 93: + case 95: + case 91: return true; } } @@ -7727,494 +8919,30 @@ var ts; } ts.isLeftHandSideExpression = isLeftHandSideExpression; function isAssignmentOperator(token) { - return token >= 52 && token <= 63; + return token >= 53 && token <= 64; } ts.isAssignmentOperator = isAssignmentOperator; })(ts || (ts = {})); -var ts; -(function (ts) { - ts.bindTime = 0; - (function (ModuleInstanceState) { - ModuleInstanceState[ModuleInstanceState["NonInstantiated"] = 0] = "NonInstantiated"; - ModuleInstanceState[ModuleInstanceState["Instantiated"] = 1] = "Instantiated"; - ModuleInstanceState[ModuleInstanceState["ConstEnumOnly"] = 2] = "ConstEnumOnly"; - })(ts.ModuleInstanceState || (ts.ModuleInstanceState = {})); - var ModuleInstanceState = ts.ModuleInstanceState; - function getModuleInstanceState(node) { - if (node.kind === 197 || node.kind === 198) { - return 0; - } - else if (ts.isConstEnumDeclaration(node)) { - return 2; - } - else if ((node.kind === 204 || node.kind === 203) && !(node.flags & 1)) { - return 0; - } - else if (node.kind === 201) { - var state = 0; - ts.forEachChild(node, function (n) { - switch (getModuleInstanceState(n)) { - case 0: - return false; - case 2: - state = 2; - return false; - case 1: - state = 1; - return true; - } - }); - return state; - } - else if (node.kind === 200) { - return getModuleInstanceState(node.body); - } - else { - return 1; - } - } - ts.getModuleInstanceState = getModuleInstanceState; - function bindSourceFile(file) { - var start = new Date().getTime(); - bindSourceFileWorker(file); - ts.bindTime += new Date().getTime() - start; - } - ts.bindSourceFile = bindSourceFile; - function bindSourceFileWorker(file) { - var _parent; - var container; - var blockScopeContainer; - var lastContainer; - var symbolCount = 0; - var Symbol = ts.objectAllocator.getSymbolConstructor(); - if (!file.locals) { - file.locals = {}; - container = file; - setBlockScopeContainer(file, false); - bind(file); - file.symbolCount = symbolCount; - } - function createSymbol(flags, name) { - symbolCount++; - return new Symbol(flags, name); - } - function setBlockScopeContainer(node, cleanLocals) { - blockScopeContainer = node; - if (cleanLocals) { - blockScopeContainer.locals = undefined; - } - } - function addDeclarationToSymbol(symbol, node, symbolKind) { - symbol.flags |= symbolKind; - if (!symbol.declarations) - symbol.declarations = []; - symbol.declarations.push(node); - if (symbolKind & 1952 && !symbol.exports) - symbol.exports = {}; - if (symbolKind & 6240 && !symbol.members) - symbol.members = {}; - node.symbol = symbol; - if (symbolKind & 107455 && !symbol.valueDeclaration) - symbol.valueDeclaration = node; - } - function getDeclarationName(node) { - if (node.name) { - if (node.kind === 200 && node.name.kind === 8) { - return '"' + node.name.text + '"'; - } - if (node.name.kind === 126) { - var nameExpression = node.name.expression; - ts.Debug.assert(ts.isWellKnownSymbolSyntactically(nameExpression)); - return ts.getPropertyNameForKnownSymbolName(nameExpression.name.text); - } - return node.name.text; - } - switch (node.kind) { - case 141: - case 133: - return "__constructor"; - case 140: - case 136: - return "__call"; - case 137: - return "__new"; - case 138: - return "__index"; - case 210: - return "__export"; - case 209: - return "default"; - case 195: - case 196: - return node.flags & 256 ? "default" : undefined; - } - } - function getDisplayName(node) { - return node.name ? ts.declarationNameToString(node.name) : getDeclarationName(node); - } - function declareSymbol(symbols, parent, node, includes, excludes) { - ts.Debug.assert(!ts.hasDynamicName(node)); - var _name = node.flags & 256 && parent ? "default" : getDeclarationName(node); - var symbol; - if (_name !== undefined) { - symbol = ts.hasProperty(symbols, _name) ? symbols[_name] : (symbols[_name] = createSymbol(0, _name)); - if (symbol.flags & excludes) { - if (node.name) { - node.name.parent = node; - } - var message = symbol.flags & 2 - ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 - : ts.Diagnostics.Duplicate_identifier_0; - ts.forEach(symbol.declarations, function (declaration) { - file.bindDiagnostics.push(ts.createDiagnosticForNode(declaration.name || declaration, message, getDisplayName(declaration))); - }); - file.bindDiagnostics.push(ts.createDiagnosticForNode(node.name || node, message, getDisplayName(node))); - symbol = createSymbol(0, _name); - } - } - else { - symbol = createSymbol(0, "__missing"); - } - addDeclarationToSymbol(symbol, node, includes); - symbol.parent = parent; - if (node.kind === 196 && symbol.exports) { - var prototypeSymbol = createSymbol(4 | 134217728, "prototype"); - if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { - if (node.name) { - node.name.parent = node; - } - file.bindDiagnostics.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); - } - symbol.exports[prototypeSymbol.name] = prototypeSymbol; - prototypeSymbol.parent = symbol; - } - return symbol; - } - function isAmbientContext(node) { - while (node) { - if (node.flags & 2) - return true; - node = node.parent; - } - return false; - } - function declareModuleMember(node, symbolKind, symbolExcludes) { - var hasExportModifier = ts.getCombinedNodeFlags(node) & 1; - if (symbolKind & 8388608) { - if (node.kind === 212 || (node.kind === 203 && hasExportModifier)) { - declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); - } - else { - declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); - } - } - else { - if (hasExportModifier || isAmbientContext(container)) { - var exportKind = (symbolKind & 107455 ? 1048576 : 0) | - (symbolKind & 793056 ? 2097152 : 0) | - (symbolKind & 1536 ? 4194304 : 0); - var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); - local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); - node.localSymbol = local; - } - else { - declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); - } - } - } - function bindChildren(node, symbolKind, isBlockScopeContainer) { - if (symbolKind & 255504) { - node.locals = {}; - } - var saveParent = _parent; - var saveContainer = container; - var savedBlockScopeContainer = blockScopeContainer; - _parent = node; - if (symbolKind & 262128) { - container = node; - if (lastContainer) { - lastContainer.nextContainer = container; - } - lastContainer = container; - } - if (isBlockScopeContainer) { - setBlockScopeContainer(node, (symbolKind & 255504) === 0 && node.kind !== 221); - } - ts.forEachChild(node, bind); - container = saveContainer; - _parent = saveParent; - blockScopeContainer = savedBlockScopeContainer; - } - function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) { - switch (container.kind) { - case 200: - declareModuleMember(node, symbolKind, symbolExcludes); - break; - case 221: - if (ts.isExternalModule(container)) { - declareModuleMember(node, symbolKind, symbolExcludes); - break; - } - case 140: - case 141: - case 136: - case 137: - case 138: - case 132: - case 131: - case 133: - case 134: - case 135: - case 195: - case 160: - case 161: - declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); - break; - case 196: - if (node.flags & 128) { - declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); - break; - } - case 143: - case 152: - case 197: - declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes); - break; - case 199: - declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); - break; - } - bindChildren(node, symbolKind, isBlockScopeContainer); - } - function bindModuleDeclaration(node) { - if (node.name.kind === 8) { - bindDeclaration(node, 512, 106639, true); - } - else { - var state = getModuleInstanceState(node); - if (state === 0) { - bindDeclaration(node, 1024, 0, true); - } - else { - bindDeclaration(node, 512, 106639, true); - if (state === 2) { - node.symbol.constEnumOnlyModule = true; - } - else if (node.symbol.constEnumOnlyModule) { - node.symbol.constEnumOnlyModule = false; - } - } - } - } - function bindFunctionOrConstructorType(node) { - var symbol = createSymbol(131072, getDeclarationName(node)); - addDeclarationToSymbol(symbol, node, 131072); - bindChildren(node, 131072, false); - var typeLiteralSymbol = createSymbol(2048, "__type"); - addDeclarationToSymbol(typeLiteralSymbol, node, 2048); - typeLiteralSymbol.members = {}; - typeLiteralSymbol.members[node.kind === 140 ? "__call" : "__new"] = symbol; - } - function bindAnonymousDeclaration(node, symbolKind, name, isBlockScopeContainer) { - var symbol = createSymbol(symbolKind, name); - addDeclarationToSymbol(symbol, node, symbolKind); - bindChildren(node, symbolKind, isBlockScopeContainer); - } - function bindCatchVariableDeclaration(node) { - bindChildren(node, 0, true); - } - function bindBlockScopedVariableDeclaration(node) { - switch (blockScopeContainer.kind) { - case 200: - declareModuleMember(node, 2, 107455); - break; - case 221: - if (ts.isExternalModule(container)) { - declareModuleMember(node, 2, 107455); - break; - } - default: - if (!blockScopeContainer.locals) { - blockScopeContainer.locals = {}; - } - declareSymbol(blockScopeContainer.locals, undefined, node, 2, 107455); - } - bindChildren(node, 2, false); - } - function getDestructuringParameterName(node) { - return "__" + ts.indexOf(node.parent.parameters, node); - } - function bind(node) { - node.parent = _parent; - switch (node.kind) { - case 127: - bindDeclaration(node, 262144, 530912, false); - break; - case 128: - bindParameter(node); - break; - case 193: - case 150: - if (ts.isBindingPattern(node.name)) { - bindChildren(node, 0, false); - } - else if (ts.isBlockOrCatchScoped(node)) { - bindBlockScopedVariableDeclaration(node); - } - else { - bindDeclaration(node, 1, 107454, false); - } - break; - case 130: - case 129: - bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 107455, false); - break; - case 218: - case 219: - bindPropertyOrMethodOrAccessor(node, 4, 107455, false); - break; - case 220: - bindPropertyOrMethodOrAccessor(node, 8, 107455, false); - break; - case 136: - case 137: - case 138: - bindDeclaration(node, 131072, 0, false); - break; - case 132: - case 131: - bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 107455 : 99263, true); - break; - case 195: - bindDeclaration(node, 16, 106927, true); - break; - case 133: - bindDeclaration(node, 16384, 0, true); - break; - case 134: - bindPropertyOrMethodOrAccessor(node, 32768, 41919, true); - break; - case 135: - bindPropertyOrMethodOrAccessor(node, 65536, 74687, true); - break; - case 140: - case 141: - bindFunctionOrConstructorType(node); - break; - case 143: - bindAnonymousDeclaration(node, 2048, "__type", false); - break; - case 152: - bindAnonymousDeclaration(node, 4096, "__object", false); - break; - case 160: - case 161: - bindAnonymousDeclaration(node, 16, "__function", true); - break; - case 217: - bindCatchVariableDeclaration(node); - break; - case 196: - bindDeclaration(node, 32, 899583, false); - break; - case 197: - bindDeclaration(node, 64, 792992, false); - break; - case 198: - bindDeclaration(node, 524288, 793056, false); - break; - case 199: - if (ts.isConst(node)) { - bindDeclaration(node, 128, 899967, false); - } - else { - bindDeclaration(node, 256, 899327, false); - } - break; - case 200: - bindModuleDeclaration(node); - break; - case 203: - case 206: - case 208: - case 212: - bindDeclaration(node, 8388608, 8388608, false); - break; - case 205: - if (node.name) { - bindDeclaration(node, 8388608, 8388608, false); - } - else { - bindChildren(node, 0, false); - } - break; - case 210: - if (!node.exportClause) { - declareSymbol(container.symbol.exports, container.symbol, node, 1073741824, 0); - } - bindChildren(node, 0, false); - break; - case 209: - if (node.expression.kind === 64) { - declareSymbol(container.symbol.exports, container.symbol, node, 8388608, 8388608); - } - else { - declareSymbol(container.symbol.exports, container.symbol, node, 4, 107455); - } - bindChildren(node, 0, false); - break; - case 221: - if (ts.isExternalModule(node)) { - bindAnonymousDeclaration(node, 512, '"' + ts.removeFileExtension(node.fileName) + '"', true); - break; - } - case 174: - bindChildren(node, 0, !ts.isFunctionLike(node.parent)); - break; - case 217: - case 181: - case 182: - case 183: - case 202: - bindChildren(node, 0, true); - break; - default: - var saveParent = _parent; - _parent = node; - ts.forEachChild(node, bind); - _parent = saveParent; - } - } - function bindParameter(node) { - if (ts.isBindingPattern(node.name)) { - bindAnonymousDeclaration(node, 1, getDestructuringParameterName(node), false); - } - else { - bindDeclaration(node, 1, 107455, false); - } - if (node.flags & 112 && - node.parent.kind === 133 && - node.parent.parent.kind === 196) { - var classDeclaration = node.parent.parent; - declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4, 107455); - } - } - function bindPropertyOrMethodOrAccessor(node, symbolKind, symbolExcludes, isBlockScopeContainer) { - if (ts.hasDynamicName(node)) { - bindAnonymousDeclaration(node, symbolKind, "__computed", isBlockScopeContainer); - } - else { - bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer); - } - } - } -})(ts || (ts = {})); +/// var ts; (function (ts) { var nextSymbolId = 1; var nextNodeId = 1; var nextMergeId = 1; + function getNodeId(node) { + if (!node.id) + node.id = nextNodeId++; + return node.id; + } + ts.getNodeId = getNodeId; ts.checkTime = 0; + function getSymbolId(symbol) { + if (!symbol.id) { + symbol.id = nextSymbolId++; + } + return symbol.id; + } + ts.getSymbolId = getSymbolId; function createTypeChecker(host, produceDiagnostics) { var Symbol = ts.objectAllocator.getSymbolConstructor(); var Type = ts.objectAllocator.getTypeConstructor(); @@ -8278,7 +9006,6 @@ var ts; 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); - var inferenceFailureType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anySignature = createSignature(undefined, undefined, emptyArray, anyType, 0, false, false); var unknownSignature = createSignature(undefined, undefined, emptyArray, unknownType, 0, false, false); var globals = {}; @@ -8295,10 +9022,16 @@ var ts; var globalESSymbolType; var globalIterableType; var anyArrayType; + var globalTypedPropertyDescriptorType; + var globalClassDecoratorType; + var globalParameterDecoratorType; + var globalPropertyDecoratorType; + var globalMethodDecoratorType; var tupleTypes = {}; var unionTypes = {}; var stringLiteralTypes = {}; var emitExtends = false; + var emitDecorate = false; var mergedSymbols = []; var symbolLinks = []; var nodeLinks = []; @@ -8453,20 +9186,18 @@ var ts; function getSymbolLinks(symbol) { if (symbol.flags & 67108864) return symbol; - if (!symbol.id) - symbol.id = nextSymbolId++; - return symbolLinks[symbol.id] || (symbolLinks[symbol.id] = {}); + var id = getSymbolId(symbol); + return symbolLinks[id] || (symbolLinks[id] = {}); } function getNodeLinks(node) { - if (!node.id) - node.id = nextNodeId++; - return nodeLinks[node.id] || (nodeLinks[node.id] = {}); + var nodeId = getNodeId(node); + return nodeLinks[nodeId] || (nodeLinks[nodeId] = {}); } function getSourceFile(node) { - return ts.getAncestor(node, 221); + return ts.getAncestor(node, 227); } function isGlobalSourceFile(node) { - return node.kind === 221 && !ts.isExternalModule(node); + return node.kind === 227 && !ts.isExternalModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { @@ -8500,6 +9231,7 @@ var ts; var lastLocation; var propertyWithInvalidInitializer; var errorLocation = location; + var grandparent; loop: while (location) { if (location.locals && !isGlobalSourceFile(location)) { if (result = getSymbol(location.locals, name, meaning)) { @@ -8507,25 +9239,33 @@ var ts; } } switch (location.kind) { - case 221: + case 227: if (!ts.isExternalModule(location)) break; - case 200: + case 205: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8914931)) { - if (!(result.flags & 8388608 && getDeclarationOfAliasSymbol(result).kind === 212)) { + if (result.flags & meaning || !(result.flags & 8388608 && getDeclarationOfAliasSymbol(result).kind === 217)) { + break loop; + } + result = undefined; + } + else if (location.kind === 227) { + result = getSymbol(getSymbolOfNode(location).exports, "default", meaning & 8914931); + var localSymbol = ts.getLocalSymbolForExportDefault(result); + if (result && (result.flags & meaning) && localSymbol && localSymbol.name === name) { break loop; } result = undefined; } break; - case 199: + case 204: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8)) { break loop; } break; - case 130: - case 129: - if (location.parent.kind === 196 && !(location.flags & 128)) { + case 132: + case 131: + if (location.parent.kind === 201 && !(location.flags & 128)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { if (getSymbol(ctor.locals, name, meaning & 107455)) { @@ -8534,8 +9274,8 @@ var ts; } } break; - case 196: - case 197: + case 201: + case 202: 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); @@ -8544,38 +9284,53 @@ var ts; break loop; } break; - case 126: - var grandparent = location.parent.parent; - if (grandparent.kind === 196 || grandparent.kind === 197) { + case 127: + grandparent = location.parent.parent; + if (grandparent.kind === 201 || grandparent.kind === 202) { 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 132: - case 131: - case 133: case 134: + case 133: case 135: - case 195: - case 161: + case 136: + case 137: + case 200: + case 163: if (name === "arguments") { result = argumentsSymbol; break loop; } break; - case 160: + case 162: if (name === "arguments") { result = argumentsSymbol; break loop; } - var id = location.name; - if (id && name === id.text) { + var functionName = location.name; + if (functionName && name === functionName.text) { result = location.symbol; break loop; } break; + case 174: + var className = location.name; + if (className && name === className.text) { + result = location.symbol; + break loop; + } + break; + case 130: + if (location.parent && location.parent.kind === 129) { + location = location.parent; + } + if (location.parent && ts.isClassElement(location.parent)) { + location = location.parent; + } + break; } lastLocation = location; location = location.parent; @@ -8607,14 +9362,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, 193); + var variableDeclaration = ts.getAncestor(declaration, 198); var container = ts.getEnclosingBlockScopeContainer(variableDeclaration); - if (variableDeclaration.parent.parent.kind === 175 || - variableDeclaration.parent.parent.kind === 181) { + if (variableDeclaration.parent.parent.kind === 180 || + variableDeclaration.parent.parent.kind === 186) { isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, variableDeclaration, container); } - else if (variableDeclaration.parent.parent.kind === 183 || - variableDeclaration.parent.parent.kind === 182) { + else if (variableDeclaration.parent.parent.kind === 188 || + variableDeclaration.parent.parent.kind === 187) { var expression = variableDeclaration.parent.parent.expression; isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, expression, container); } @@ -8634,49 +9389,94 @@ var ts; } return false; } - function isAliasSymbolDeclaration(node) { - return node.kind === 203 || - node.kind === 205 && !!node.name || - node.kind === 206 || - node.kind === 208 || - node.kind === 212 || - node.kind === 209; + function getAnyImportSyntax(node) { + if (ts.isAliasSymbolDeclaration(node)) { + if (node.kind === 208) { + return node; + } + while (node && node.kind !== 209) { + node = node.parent; + } + return node; + } } function getDeclarationOfAliasSymbol(symbol) { - return ts.forEach(symbol.declarations, function (d) { return isAliasSymbolDeclaration(d) ? d : undefined; }); + return ts.forEach(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; }); } function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 213) { - var moduleSymbol = resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)); - var exportAssignmentSymbol = moduleSymbol && getResolvedExportAssignmentSymbol(moduleSymbol); - return exportAssignmentSymbol || moduleSymbol; + if (node.moduleReference.kind === 219) { + return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, node); } function getTargetOfImportClause(node) { var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); if (moduleSymbol) { - var exportAssignmentSymbol = getResolvedExportAssignmentSymbol(moduleSymbol); - if (!exportAssignmentSymbol) { - error(node.name, ts.Diagnostics.External_module_0_has_no_default_export_or_export_assignment, symbolToString(moduleSymbol)); + var exportDefaultSymbol = resolveSymbol(moduleSymbol.exports["default"]); + if (!exportDefaultSymbol) { + error(node.name, ts.Diagnostics.External_module_0_has_no_default_export, symbolToString(moduleSymbol)); } - return exportAssignmentSymbol; + return exportDefaultSymbol; } } function getTargetOfNamespaceImport(node) { - return resolveExternalModuleName(node, node.parent.parent.moduleSpecifier); + var moduleSpecifier = node.parent.parent.moduleSpecifier; + return resolveESModuleSymbol(resolveExternalModuleName(node, moduleSpecifier), moduleSpecifier); + } + function getMemberOfModuleVariable(moduleSymbol, name) { + if (moduleSymbol.flags & 3) { + var typeAnnotation = moduleSymbol.valueDeclaration.type; + if (typeAnnotation) { + return getPropertyOfType(getTypeFromTypeNodeOrHeritageClauseElement(typeAnnotation), name); + } + } + } + function combineValueAndTypeSymbols(valueSymbol, typeSymbol) { + if (valueSymbol.flags & (793056 | 1536)) { + return valueSymbol; + } + var result = createSymbol(valueSymbol.flags | typeSymbol.flags, valueSymbol.name); + result.declarations = ts.concatenate(valueSymbol.declarations, typeSymbol.declarations); + result.parent = valueSymbol.parent || typeSymbol.parent; + if (valueSymbol.valueDeclaration) + result.valueDeclaration = valueSymbol.valueDeclaration; + if (typeSymbol.members) + result.members = typeSymbol.members; + if (valueSymbol.exports) + result.exports = valueSymbol.exports; + return result; + } + function getExportOfModule(symbol, name) { + if (symbol.flags & 1536) { + var exports = getExportsOfSymbol(symbol); + if (ts.hasProperty(exports, name)) { + return resolveSymbol(exports[name]); + } + } + } + function getPropertyOfVariable(symbol, name) { + if (symbol.flags & 3) { + var typeAnnotation = symbol.valueDeclaration.type; + if (typeAnnotation) { + return resolveSymbol(getPropertyOfType(getTypeFromTypeNodeOrHeritageClauseElement(typeAnnotation), name)); + } + } } function getExternalModuleMember(node, specifier) { var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); - if (moduleSymbol) { - var _name = specifier.propertyName || specifier.name; - if (_name.text) { - var symbol = getSymbol(getExportsOfSymbol(moduleSymbol), _name.text, 107455 | 793056 | 1536); + var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier); + if (targetSymbol) { + var name_4 = specifier.propertyName || specifier.name; + if (name_4.text) { + var symbolFromModule = getExportOfModule(targetSymbol, name_4.text); + var symbolFromVariable = getPropertyOfVariable(targetSymbol, name_4.text); + var symbol = symbolFromModule && symbolFromVariable ? + combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) : + symbolFromModule || symbolFromVariable; if (!symbol) { - error(_name, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(_name)); - return; + error(name_4, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name_4)); } - return symbol.flags & (107455 | 793056 | 1536) ? symbol : resolveAlias(symbol); + return symbol; } } } @@ -8689,31 +9489,34 @@ var ts; resolveEntityName(node.propertyName || node.name, 107455 | 793056 | 1536); } function getTargetOfExportAssignment(node) { - return resolveEntityName(node.expression, 107455 | 793056 | 1536); + return node.expression && resolveEntityName(node.expression, 107455 | 793056 | 1536); } - function getTargetOfImportDeclaration(node) { + function getTargetOfAliasDeclaration(node) { switch (node.kind) { - case 203: - return getTargetOfImportEqualsDeclaration(node); - case 205: - return getTargetOfImportClause(node); - case 206: - return getTargetOfNamespaceImport(node); case 208: + return getTargetOfImportEqualsDeclaration(node); + case 210: + return getTargetOfImportClause(node); + case 211: + return getTargetOfNamespaceImport(node); + case 213: return getTargetOfImportSpecifier(node); - case 212: + case 217: return getTargetOfExportSpecifier(node); - case 209: + case 214: return getTargetOfExportAssignment(node); } } + function resolveSymbol(symbol) { + return symbol && symbol.flags & 8388608 && !(symbol.flags & (107455 | 793056 | 1536)) ? resolveAlias(symbol) : symbol; + } function resolveAlias(symbol) { ts.Debug.assert((symbol.flags & 8388608) !== 0, "Should only get Alias here."); var links = getSymbolLinks(symbol); if (!links.target) { links.target = resolvingSymbol; var node = getDeclarationOfAliasSymbol(symbol); - var target = getTargetOfImportDeclaration(node); + var target = getTargetOfAliasDeclaration(node); if (links.target === resolvingSymbol) { links.target = target || unknownSymbol; } @@ -8729,8 +9532,12 @@ var ts; function markExportAsReferenced(node) { var symbol = getSymbolOfNode(node); var target = resolveAlias(symbol); - if (target && target !== unknownSymbol && target.flags & 107455 && !isConstEnumOrConstEnumOnlyModule(target)) { - markAliasSymbolAsReferenced(symbol); + if (target) { + var markAlias = (target === unknownSymbol && compilerOptions.separateCompilation) || + (target !== unknownSymbol && (target.flags & 107455) && !isConstEnumOrConstEnumOnlyModule(target)); + if (markAlias) { + markAliasSymbolAsReferenced(symbol); + } } } function markAliasSymbolAsReferenced(symbol) { @@ -8738,10 +9545,10 @@ var ts; if (!links.referenced) { links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); - if (node.kind === 209) { + if (node.kind === 214 && node.expression) { checkExpressionCached(node.expression); } - else if (node.kind === 212) { + else if (node.kind === 217) { checkExpressionCached(node.propertyName || node.name); } else if (ts.isInternalModuleImportEqualsDeclaration(node)) { @@ -8751,17 +9558,17 @@ var ts; } function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 203); + importDeclaration = ts.getAncestor(entityName, 208); ts.Debug.assert(importDeclaration !== undefined); } - if (entityName.kind === 64 && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { + if (entityName.kind === 65 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 64 || entityName.parent.kind === 125) { + if (entityName.kind === 65 || entityName.parent.kind === 126) { return resolveEntityName(entityName, 1536); } else { - ts.Debug.assert(entityName.parent.kind === 203); + ts.Debug.assert(entityName.parent.kind === 208); return resolveEntityName(entityName, 107455 | 793056 | 1536); } } @@ -8769,28 +9576,32 @@ var ts; return symbol.parent ? getFullyQualifiedName(symbol.parent) + "." + symbolToString(symbol) : symbolToString(symbol); } function resolveEntityName(name, meaning) { - if (ts.getFullWidth(name) === 0) { + if (ts.nodeIsMissing(name)) { return undefined; } var symbol; - if (name.kind === 64) { + if (name.kind === 65) { symbol = resolveName(name, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, name); if (!symbol) { return undefined; } } - else if (name.kind === 125) { - var namespace = resolveEntityName(name.left, 1536); - if (!namespace || namespace === unknownSymbol || ts.getFullWidth(name.right) === 0) { + 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; + var namespace = resolveEntityName(left, 1536); + if (!namespace || namespace === unknownSymbol || ts.nodeIsMissing(right)) { return undefined; } - var right = name.right; symbol = getSymbol(getExportsOfSymbol(namespace), right.text, meaning); if (!symbol) { error(right, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), ts.declarationNameToString(right)); return undefined; } } + else { + ts.Debug.fail("Unknown entity name kind."); + } ts.Debug.assert((symbol.flags & 16777216) === 0, "Should never get an instantiated symbol here."); return symbol.flags & meaning ? symbol : resolveAlias(symbol); } @@ -8835,22 +9646,22 @@ var ts; } error(moduleReferenceLiteral, ts.Diagnostics.Cannot_find_external_module_0, moduleName); } - function getExportAssignmentSymbol(moduleSymbol) { - return moduleSymbol.exports["default"]; + function resolveExternalModuleSymbol(moduleSymbol) { + return moduleSymbol && resolveSymbol(moduleSymbol.exports["export="]) || moduleSymbol; } - function getResolvedExportAssignmentSymbol(moduleSymbol) { - var symbol = getExportAssignmentSymbol(moduleSymbol); - if (symbol) { - if (symbol.flags & (107455 | 793056 | 1536)) { - return symbol; - } - if (symbol.flags & 8388608) { - return resolveAlias(symbol); - } + 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)); + symbol = undefined; } + return symbol; + } + function getExportAssignmentSymbol(moduleSymbol) { + return moduleSymbol.exports["export="]; } function getExportsOfSymbol(symbol) { - return symbol.flags & 1536 ? getExportsOfModule(symbol) : symbol.exports; + return symbol.flags & 1536 ? getExportsOfModule(symbol) : symbol.exports || emptySymbols; } function getExportsOfModule(moduleSymbol) { var links = getSymbolLinks(moduleSymbol); @@ -8864,20 +9675,12 @@ var ts; } } function getExportsForModule(moduleSymbol) { - if (compilerOptions.target < 2) { - var defaultSymbol = getExportAssignmentSymbol(moduleSymbol); - if (defaultSymbol) { - return { - "default": defaultSymbol - }; - } - } var result; var visitedSymbols = []; visit(moduleSymbol); return result || moduleSymbol.exports; function visit(symbol) { - if (!ts.contains(visitedSymbols, symbol)) { + if (symbol.flags & 1952 && !ts.contains(visitedSymbols, symbol)) { visitedSymbols.push(symbol); if (symbol !== moduleSymbol) { if (!result) { @@ -8887,9 +9690,10 @@ var ts; } var exportStars = symbol.exports["__export"]; if (exportStars) { - ts.forEach(exportStars.declarations, function (node) { + for (var _i = 0, _a = exportStars.declarations; _i < _a.length; _i++) { + var node = _a[_i]; visit(resolveExternalModuleName(node, node.moduleSpecifier)); - }); + } } } } @@ -8923,9 +9727,9 @@ var ts; } function findConstructorDeclaration(node) { var members = node.members; - for (var _i = 0, _n = members.length; _i < _n; _i++) { + for (var _i = 0; _i < members.length; _i++) { var member = members[_i]; - if (member.kind === 133 && ts.nodeIsPresent(member.body)) { + if (member.kind === 135 && ts.nodeIsPresent(member.body)) { return member; } } @@ -8983,25 +9787,25 @@ var ts; } function forEachSymbolTableInScope(enclosingDeclaration, callback) { var result; - for (var _location = enclosingDeclaration; _location; _location = _location.parent) { - if (_location.locals && !isGlobalSourceFile(_location)) { - if (result = callback(_location.locals)) { + for (var location_1 = enclosingDeclaration; location_1; location_1 = location_1.parent) { + if (location_1.locals && !isGlobalSourceFile(location_1)) { + if (result = callback(location_1.locals)) { return result; } } - switch (_location.kind) { - case 221: - if (!ts.isExternalModule(_location)) { + switch (location_1.kind) { + case 227: + if (!ts.isExternalModule(location_1)) { break; } - case 200: - if (result = callback(getSymbolOfNode(_location).exports)) { + case 205: + if (result = callback(getSymbolOfNode(location_1).exports)) { return result; } break; - case 196: - case 197: - if (result = callback(getSymbolOfNode(_location).members)) { + case 201: + case 202: + if (result = callback(getSymbolOfNode(location_1).members)) { return result; } break; @@ -9031,7 +9835,7 @@ var ts; return [symbol]; } return ts.forEachValue(symbols, function (symbolFromSymbolTable) { - if (symbolFromSymbolTable.flags & 8388608) { + if (symbolFromSymbolTable.flags & 8388608 && symbolFromSymbolTable.name !== "export=") { if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); @@ -9115,8 +9919,8 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 200 && declaration.name.kind === 8) || - (declaration.kind === 221 && ts.isExternalModule(declaration)); + return (declaration.kind === 205 && declaration.name.kind === 8) || + (declaration.kind === 227 && ts.isExternalModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -9126,17 +9930,18 @@ var ts; return { accessibility: 0, aliasesToMakeVisible: aliasesToMakeVisible }; function getIsDeclarationVisible(declaration) { if (!isDeclarationVisible(declaration)) { - if (declaration.kind === 203 && - !(declaration.flags & 1) && - isDeclarationVisible(declaration.parent)) { + var anyImportSyntax = getAnyImportSyntax(declaration); + if (anyImportSyntax && + !(anyImportSyntax.flags & 1) && + isDeclarationVisible(anyImportSyntax.parent)) { getNodeLinks(declaration).isVisible = true; if (aliasesToMakeVisible) { - if (!ts.contains(aliasesToMakeVisible, declaration)) { - aliasesToMakeVisible.push(declaration); + if (!ts.contains(aliasesToMakeVisible, anyImportSyntax)) { + aliasesToMakeVisible.push(anyImportSyntax); } } else { - aliasesToMakeVisible = [declaration]; + aliasesToMakeVisible = [anyImportSyntax]; } return true; } @@ -9147,11 +9952,11 @@ var ts; } function isEntityNameVisible(entityName, enclosingDeclaration) { var meaning; - if (entityName.parent.kind === 142) { + if (entityName.parent.kind === 144) { meaning = 107455 | 1048576; } - else if (entityName.kind === 125 || - entityName.parent.kind === 203) { + else if (entityName.kind === 126 || entityName.kind === 155 || + entityName.parent.kind === 208) { meaning = 1536; } else { @@ -9195,10 +10000,10 @@ var ts; function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048) { var node = type.symbol.declarations[0].parent; - while (node.kind === 147) { + while (node.kind === 149) { node = node.parent; } - if (node.kind === 198) { + if (node.kind === 203) { return getSymbolOfNode(node); } } @@ -9242,7 +10047,7 @@ var ts; walkSymbol(getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol), getQualifiedLeftMeaning(meaning)); } if (accessibleSymbolChain) { - for (var _i = 0, _n = accessibleSymbolChain.length; _i < _n; _i++) { + for (var _i = 0; _i < accessibleSymbolChain.length; _i++) { var accessibleSymbol = accessibleSymbolChain[_i]; appendParentTypeArgumentsAndSymbolName(accessibleSymbol); } @@ -9352,7 +10157,7 @@ var ts; buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, 793056, 0, flags); } else { - writeKeyword(writer, 111); + writeKeyword(writer, 112); } } else { @@ -9370,7 +10175,7 @@ var ts; var isNonLocalFunctionSymbol = !!(type.symbol.flags & 16) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { - return declaration.parent.kind === 221 || declaration.parent.kind === 201; + return declaration.parent.kind === 227 || declaration.parent.kind === 206; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return !!(flags & 2) || @@ -9380,7 +10185,7 @@ var ts; } } function writeTypeofSymbol(type, typeFormatFlags) { - writeKeyword(writer, 96); + writeKeyword(writer, 97); writeSpace(writer); buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 107455, 0, typeFormatFlags); } @@ -9414,7 +10219,7 @@ var ts; if (flags & 64) { writePunctuation(writer, 16); } - writeKeyword(writer, 87); + writeKeyword(writer, 88); writeSpace(writer); buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8, typeStack); if (flags & 64) { @@ -9426,17 +10231,17 @@ var ts; writePunctuation(writer, 14); writer.writeLine(); writer.increaseIndent(); - for (var _i = 0, _a = resolved.callSignatures, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = resolved.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); writePunctuation(writer, 22); writer.writeLine(); } - for (var _b = 0, _c = resolved.constructSignatures, _d = _c.length; _b < _d; _b++) { - var _signature = _c[_b]; - writeKeyword(writer, 87); + for (var _b = 0, _c = resolved.constructSignatures; _b < _c.length; _b++) { + var signature = _c[_b]; + writeKeyword(writer, 88); writeSpace(writer); - buildSignatureDisplay(_signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); + buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); writePunctuation(writer, 22); writer.writeLine(); } @@ -9445,7 +10250,7 @@ var ts; writer.writeParameter(getIndexerParameterName(resolved, 0, "x")); writePunctuation(writer, 51); writeSpace(writer); - writeKeyword(writer, 120); + writeKeyword(writer, 121); writePunctuation(writer, 19); writePunctuation(writer, 51); writeSpace(writer); @@ -9458,7 +10263,7 @@ var ts; writer.writeParameter(getIndexerParameterName(resolved, 1, "x")); writePunctuation(writer, 51); writeSpace(writer); - writeKeyword(writer, 118); + writeKeyword(writer, 119); writePunctuation(writer, 19); writePunctuation(writer, 51); writeSpace(writer); @@ -9466,18 +10271,18 @@ var ts; writePunctuation(writer, 22); writer.writeLine(); } - for (var _e = 0, _f = resolved.properties, _g = _f.length; _e < _g; _e++) { - var p = _f[_e]; + for (var _d = 0, _e = resolved.properties; _d < _e.length; _d++) { + var p = _e[_d]; var t = getTypeOfSymbol(p); if (p.flags & (16 | 8192) && !getPropertiesOfObjectType(t).length) { var signatures = getSignaturesOfType(t, 0); - for (var _h = 0, _j = signatures.length; _h < _j; _h++) { - var _signature_1 = signatures[_h]; + for (var _f = 0; _f < signatures.length; _f++) { + var signature = signatures[_f]; buildSymbolDisplay(p, writer); if (p.flags & 536870912) { writePunctuation(writer, 50); } - buildSignatureDisplay(_signature_1, writer, enclosingDeclaration, globalFlagsToPass, typeStack); + buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); writePunctuation(writer, 22); writer.writeLine(); } @@ -9509,7 +10314,7 @@ var ts; var constraint = getConstraintOfTypeParameter(tp); if (constraint) { writeSpace(writer); - writeKeyword(writer, 78); + writeKeyword(writer, 79); writeSpace(writer); buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, typeStack); } @@ -9602,12 +10407,12 @@ var ts; function isDeclarationVisible(node) { function getContainingExternalModule(node) { for (; node; node = node.parent) { - if (node.kind === 200) { + if (node.kind === 205) { if (node.name.kind === 8) { return node; } } - else if (node.kind === 221) { + else if (node.kind === 227) { return ts.isExternalModule(node) ? node : undefined; } } @@ -9650,48 +10455,59 @@ var ts; } function determineIfDeclarationIsVisible() { switch (node.kind) { - case 193: - case 150: - case 200: - case 196: - case 197: + case 152: + return isDeclarationVisible(node.parent.parent); case 198: - case 195: - case 199: - case 203: - var _parent = getDeclarationContainer(node); - if (!(ts.getCombinedNodeFlags(node) & 1) && - !(node.kind !== 203 && _parent.kind !== 221 && ts.isInAmbientContext(_parent))) { - return isGlobalSourceFile(_parent) || isUsedInExportAssignment(node); + if (ts.isBindingPattern(node.name) && + !node.name.elements.length) { + return false; } - return isDeclarationVisible(_parent); - case 130: - case 129: - case 134: - case 135: + case 205: + case 201: + case 202: + case 203: + case 200: + case 204: + case 208: + var parent_2 = getDeclarationContainer(node); + if (!(ts.getCombinedNodeFlags(node) & 1) && + !(node.kind !== 208 && parent_2.kind !== 227 && ts.isInAmbientContext(parent_2))) { + return isGlobalSourceFile(parent_2); + } + return isDeclarationVisible(parent_2); case 132: case 131: + case 136: + case 137: + case 134: + case 133: if (node.flags & (32 | 64)) { return false; } - case 133: - case 137: - case 136: - case 138: - case 128: - case 201: - case 140: - case 141: - case 143: + case 135: case 139: - case 144: + case 138: + case 140: + case 129: + case 206: + case 142: + case 143: case 145: + case 141: case 146: case 147: + case 148: + case 149: return isDeclarationVisible(node.parent); - case 127: - case 221: + case 210: + case 211: + case 213: + return false; + case 128: + case 227: return true; + case 214: + return false; default: ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); } @@ -9704,15 +10520,44 @@ var ts; return links.isVisible; } } + function collectLinkedAliases(node) { + var exportSymbol; + if (node.parent && node.parent.kind === 214) { + exportSymbol = resolveName(node.parent, node.text, 107455 | 793056 | 1536, ts.Diagnostics.Cannot_find_name_0, node); + } + else if (node.parent.kind === 217) { + exportSymbol = getTargetOfExportSpecifier(node.parent); + } + var result = []; + if (exportSymbol) { + buildVisibleNodeList(exportSymbol.declarations); + } + return result; + function buildVisibleNodeList(declarations) { + ts.forEach(declarations, function (declaration) { + getNodeLinks(declaration).isVisible = true; + var resultNode = getAnyImportSyntax(declaration) || declaration; + if (!ts.contains(result, resultNode)) { + result.push(resultNode); + } + if (ts.isInternalModuleImportEqualsDeclaration(declaration)) { + var internalModuleReference = declaration.moduleReference; + var firstIdentifier = getFirstIdentifier(internalModuleReference); + var importSymbol = resolveName(declaration, firstIdentifier.text, 107455 | 793056 | 1536, ts.Diagnostics.Cannot_find_name_0, firstIdentifier); + buildVisibleNodeList(importSymbol.declarations); + } + }); + } + } function getRootDeclaration(node) { - while (node.kind === 150) { + while (node.kind === 152) { node = node.parent.parent; } return node; } function getDeclarationContainer(node) { node = getRootDeclaration(node); - return node.kind === 193 ? node.parent.parent.parent : node.parent; + return node.kind === 198 ? node.parent.parent.parent : node.parent; } function getTypeOfPrototypeProperty(prototype) { var classType = getDeclaredTypeOfSymbol(prototype.parent); @@ -9735,13 +10580,13 @@ var ts; return parentType; } var type; - if (pattern.kind === 148) { - var _name = declaration.propertyName || declaration.name; - type = getTypeOfPropertyOfType(parentType, _name.text) || - isNumericLiteralName(_name.text) && getIndexTypeOfType(parentType, 1) || + if (pattern.kind === 150) { + var name_5 = declaration.propertyName || declaration.name; + type = getTypeOfPropertyOfType(parentType, name_5.text) || + isNumericLiteralName(name_5.text) && getIndexTypeOfType(parentType, 1) || getIndexTypeOfType(parentType, 0); if (!type) { - error(_name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(_name)); + error(name_5, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name_5)); return unknownType; } } @@ -9770,22 +10615,22 @@ var ts; return type; } function getTypeForVariableLikeDeclaration(declaration) { - if (declaration.parent.parent.kind === 182) { + if (declaration.parent.parent.kind === 187) { return anyType; } - if (declaration.parent.parent.kind === 183) { + if (declaration.parent.parent.kind === 188) { return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType; } if (ts.isBindingPattern(declaration.parent)) { return getTypeForBindingElement(declaration); } if (declaration.type) { - return getTypeFromTypeNode(declaration.type); + return getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); } - if (declaration.kind === 128) { + if (declaration.kind === 129) { var func = declaration.parent; - if (func.kind === 135 && !ts.hasDynamicName(func)) { - var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 134); + if (func.kind === 137 && !ts.hasDynamicName(func)) { + var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 136); if (getter) { return getReturnTypeOfSignature(getSignatureFromDeclaration(getter)); } @@ -9798,7 +10643,7 @@ var ts; if (declaration.initializer) { return checkExpressionCached(declaration.initializer); } - if (declaration.kind === 219) { + if (declaration.kind === 225) { return checkIdentifier(declaration.name); } return undefined; @@ -9816,8 +10661,8 @@ var ts; var members = {}; ts.forEach(pattern.elements, function (e) { var flags = 4 | 67108864 | (e.initializer ? 536870912 : 0); - var _name = e.propertyName || e.name; - var symbol = createSymbol(flags, _name.text); + var name = e.propertyName || e.name; + var symbol = createSymbol(flags, name.text); symbol.type = getTypeFromBindingElement(e); members[symbol.name] = symbol; }); @@ -9827,7 +10672,7 @@ var ts; var hasSpreadElement = false; var elementTypes = []; ts.forEach(pattern.elements, function (e) { - elementTypes.push(e.kind === 172 || e.dotDotDotToken ? anyType : getTypeFromBindingElement(e)); + elementTypes.push(e.kind === 175 || e.dotDotDotToken ? anyType : getTypeFromBindingElement(e)); if (e.dotDotDotToken) { hasSpreadElement = true; } @@ -9835,7 +10680,7 @@ var ts; return !elementTypes.length ? anyArrayType : hasSpreadElement ? createArrayType(getUnionType(elementTypes)) : createTupleType(elementTypes); } function getTypeFromBindingPattern(pattern) { - return pattern.kind === 148 + return pattern.kind === 150 ? getTypeFromObjectBindingPattern(pattern) : getTypeFromArrayBindingPattern(pattern); } @@ -9845,7 +10690,7 @@ var ts; if (reportErrors) { reportErrorsFromWidening(declaration, type); } - return declaration.kind !== 218 ? getWidenedType(type) : type; + return declaration.kind !== 224 ? getWidenedType(type) : type; } if (ts.isBindingPattern(declaration.name)) { return getTypeFromBindingPattern(declaration.name); @@ -9853,7 +10698,7 @@ var ts; type = declaration.dotDotDotToken ? anyArrayType : anyType; if (reportErrors && compilerOptions.noImplicitAny) { var root = getRootDeclaration(declaration); - if (!isPrivateWithinAmbient(root) && !(root.kind === 128 && isPrivateWithinAmbient(root.parent))) { + if (!isPrivateWithinAmbient(root) && !(root.kind === 129 && isPrivateWithinAmbient(root.parent))) { reportImplicitAnyError(declaration, type); } } @@ -9866,11 +10711,20 @@ var ts; return links.type = getTypeOfPrototypeProperty(symbol); } var declaration = symbol.valueDeclaration; - if (declaration.parent.kind === 217) { + if (declaration.parent.kind === 223) { return links.type = anyType; } - if (declaration.kind === 209) { - return links.type = checkExpression(declaration.expression); + if (declaration.kind === 214) { + var exportAssignment = declaration; + if (exportAssignment.expression) { + return links.type = checkExpression(exportAssignment.expression); + } + else if (exportAssignment.type) { + return links.type = getTypeFromTypeNodeOrHeritageClauseElement(exportAssignment.type); + } + else { + return links.type = anyType; + } } links.type = resolvingType; var type = getWidenedTypeForVariableLikeDeclaration(declaration, true); @@ -9894,12 +10748,12 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 134) { - return accessor.type && getTypeFromTypeNode(accessor.type); + if (accessor.kind === 136) { + return accessor.type && getTypeFromTypeNodeOrHeritageClauseElement(accessor.type); } else { var setterTypeAnnotation = getSetAccessorTypeAnnotationNode(accessor); - return setterTypeAnnotation && getTypeFromTypeNode(setterTypeAnnotation); + return setterTypeAnnotation && getTypeFromTypeNodeOrHeritageClauseElement(setterTypeAnnotation); } } return undefined; @@ -9913,8 +10767,8 @@ var ts; links = links || getSymbolLinks(symbol); if (!links.type) { links.type = resolvingType; - var getter = ts.getDeclarationOfKind(symbol, 134); - var setter = ts.getDeclarationOfKind(symbol, 135); + var getter = ts.getDeclarationOfKind(symbol, 136); + var setter = ts.getDeclarationOfKind(symbol, 137); var type; var getterReturnType = getAnnotatedAccessorType(getter); if (getterReturnType) { @@ -9944,8 +10798,8 @@ var ts; else if (links.type === resolvingType) { links.type = anyType; if (compilerOptions.noImplicitAny) { - var _getter = ts.getDeclarationOfKind(symbol, 134); - 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)); + 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)); } } } @@ -10011,7 +10865,7 @@ var ts; function getTypeParametersOfClassOrInterface(symbol) { var result; ts.forEach(symbol.declarations, function (node) { - if (node.kind === 197 || node.kind === 196) { + if (node.kind === 202 || node.kind === 201) { var declaration = node; if (declaration.typeParameters && declaration.typeParameters.length) { ts.forEach(declaration.typeParameters, function (node) { @@ -10042,10 +10896,10 @@ var ts; type.typeArguments = type.typeParameters; } type.baseTypes = []; - var declaration = ts.getDeclarationOfKind(symbol, 196); - var baseTypeNode = ts.getClassBaseTypeNode(declaration); + var declaration = ts.getDeclarationOfKind(symbol, 201); + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(declaration); if (baseTypeNode) { - var baseType = getTypeFromTypeReferenceNode(baseTypeNode); + var baseType = getTypeFromHeritageClauseElement(baseTypeNode); if (baseType !== unknownType) { if (getTargetType(baseType).flags & 1024) { if (type !== baseType && !hasBaseType(baseType, type)) { @@ -10083,9 +10937,9 @@ var ts; } type.baseTypes = []; ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 197 && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 202 && ts.getInterfaceBaseTypeNodes(declaration)) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), function (node) { - var baseType = getTypeFromTypeReferenceNode(node); + var baseType = getTypeFromHeritageClauseElement(node); if (baseType !== unknownType) { if (getTargetType(baseType).flags & (1024 | 2048)) { if (type !== baseType && !hasBaseType(baseType, type)) { @@ -10114,16 +10968,16 @@ var ts; var links = getSymbolLinks(symbol); if (!links.declaredType) { links.declaredType = resolvingType; - var declaration = ts.getDeclarationOfKind(symbol, 198); - var type = getTypeFromTypeNode(declaration.type); + var declaration = ts.getDeclarationOfKind(symbol, 203); + var type = getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); if (links.declaredType === resolvingType) { links.declaredType = type; } } else if (links.declaredType === resolvingType) { links.declaredType = unknownType; - var _declaration = ts.getDeclarationOfKind(symbol, 198); - error(_declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); + var declaration = ts.getDeclarationOfKind(symbol, 203); + error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); } return links.declaredType; } @@ -10141,7 +10995,7 @@ var ts; if (!links.declaredType) { var type = createType(512); type.symbol = symbol; - if (!ts.getDeclarationOfKind(symbol, 127).constraint) { + if (!ts.getDeclarationOfKind(symbol, 128).constraint) { type.constraint = noConstraintType; } links.declaredType = type; @@ -10179,7 +11033,7 @@ var ts; } function createSymbolTable(symbols) { var result = {}; - for (var _i = 0, _n = symbols.length; _i < _n; _i++) { + for (var _i = 0; _i < symbols.length; _i++) { var symbol = symbols[_i]; result[symbol.name] = symbol; } @@ -10187,14 +11041,14 @@ var ts; } function createInstantiatedSymbolTable(symbols, mapper) { var result = {}; - for (var _i = 0, _n = symbols.length; _i < _n; _i++) { + for (var _i = 0; _i < symbols.length; _i++) { var symbol = symbols[_i]; result[symbol.name] = instantiateSymbol(symbol, mapper); } return result; } function addInheritedMembers(symbols, baseSymbols) { - for (var _i = 0, _n = baseSymbols.length; _i < _n; _i++) { + for (var _i = 0; _i < baseSymbols.length; _i++) { var s = baseSymbols[_i]; if (!ts.hasProperty(symbols, s.name)) { symbols[s.name] = s; @@ -10203,7 +11057,7 @@ var ts; } function addInheritedSignatures(signatures, baseSignatures) { if (baseSignatures) { - for (var _i = 0, _n = baseSignatures.length; _i < _n; _i++) { + for (var _i = 0; _i < baseSignatures.length; _i++) { var signature = baseSignatures[_i]; signatures.push(signature); } @@ -10302,14 +11156,14 @@ var ts; function getUnionSignatures(types, kind) { var signatureLists = ts.map(types, function (t) { return getSignaturesOfType(t, kind); }); var signatures = signatureLists[0]; - for (var _i = 0, _n = signatures.length; _i < _n; _i++) { + for (var _i = 0; _i < signatures.length; _i++) { var signature = signatures[_i]; if (signature.typeParameters) { return emptyArray; } } - for (var _i_1 = 1; _i_1 < signatureLists.length; _i_1++) { - if (!signatureListsIdentical(signatures, signatureLists[_i_1])) { + for (var i_1 = 1; i_1 < signatureLists.length; i_1++) { + if (!signatureListsIdentical(signatures, signatureLists[i_1])) { return emptyArray; } } @@ -10323,7 +11177,7 @@ var ts; } function getUnionIndexType(types, kind) { var indexTypes = []; - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var type = types[_i]; var indexType = getIndexTypeOfType(type, kind); if (!indexType) { @@ -10459,7 +11313,7 @@ var ts; function createUnionProperty(unionType, name) { var types = unionType.types; var props; - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var current = types[_i]; var type = getApparentType(current); if (type !== unknownType) { @@ -10477,12 +11331,12 @@ var ts; } var propTypes = []; var declarations = []; - for (var _a = 0, _b = props.length; _a < _b; _a++) { - var _prop = props[_a]; - if (_prop.declarations) { - declarations.push.apply(declarations, _prop.declarations); + for (var _a = 0; _a < props.length; _a++) { + var prop = props[_a]; + if (prop.declarations) { + declarations.push.apply(declarations, prop.declarations); } - propTypes.push(getTypeOfSymbol(_prop)); + propTypes.push(getTypeOfSymbol(prop)); } var result = createSymbol(4 | 67108864 | 268435456, name); result.unionType = unionType; @@ -10519,9 +11373,9 @@ var ts; } } if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { - var _symbol = getPropertyOfObjectType(globalFunctionType, name); - if (_symbol) - return _symbol; + var symbol = getPropertyOfObjectType(globalFunctionType, name); + if (symbol) + return symbol; } return getPropertyOfObjectType(globalObjectType, name); } @@ -10554,20 +11408,29 @@ var ts; }); return result; } + function symbolsToArray(symbols) { + var result = []; + for (var id in symbols) { + if (!isReservedMemberName(id)) { + result.push(symbols[id]); + } + } + return result; + } function getExportsOfExternalModule(node) { if (!node.moduleSpecifier) { return emptyArray; } var module = resolveExternalModuleName(node, node.moduleSpecifier); - if (!module || !module.exports) { + if (!module) { return emptyArray; } - return ts.mapToArray(getExportsOfModule(module)); + return symbolsToArray(getExportsOfModule(module)); } function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { - var classType = declaration.kind === 133 ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; + var classType = declaration.kind === 135 ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; var typeParameters = classType ? classType.typeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; var parameters = []; @@ -10593,11 +11456,11 @@ var ts; returnType = classType; } else if (declaration.type) { - returnType = getTypeFromTypeNode(declaration.type); + returnType = getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); } else { - if (declaration.kind === 134 && !ts.hasDynamicName(declaration)) { - var setter = ts.getDeclarationOfKind(declaration.symbol, 135); + if (declaration.kind === 136 && !ts.hasDynamicName(declaration)) { + var setter = ts.getDeclarationOfKind(declaration.symbol, 137); returnType = getAnnotatedAccessorType(setter); } if (!returnType && ts.nodeIsMissing(declaration.body)) { @@ -10615,19 +11478,19 @@ var ts; for (var i = 0, len = symbol.declarations.length; i < len; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 140: - case 141: - case 195: - case 132: - case 131: + case 142: + case 143: + case 200: + case 134: case 133: + case 135: + case 138: + case 139: + case 140: case 136: case 137: - case 138: - case 134: - case 135: - case 160: - case 161: + case 162: + case 163: if (i > 0 && node.body) { var previous = symbol.declarations[i - 1]; if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { @@ -10697,7 +11560,7 @@ var ts; } function getOrCreateTypeFromSignature(signature) { if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 133 || signature.declaration.kind === 137; + var isConstructor = signature.declaration.kind === 135 || signature.declaration.kind === 139; var type = createObjectType(32768 | 65536); type.members = emptySymbols; type.properties = emptyArray; @@ -10711,11 +11574,11 @@ var ts; return symbol.members["__index"]; } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 ? 118 : 120; + var syntaxKind = kind === 1 ? 119 : 121; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { var len = indexSymbol.declarations.length; - for (var _i = 0, _a = indexSymbol.declarations, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; var node = decl; if (node.parameters.length === 1) { @@ -10731,7 +11594,7 @@ var ts; function getIndexTypeOfSymbol(symbol, kind) { var declaration = getIndexDeclarationOfSymbol(symbol, kind); return declaration - ? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType + ? declaration.type ? getTypeFromTypeNodeOrHeritageClauseElement(declaration.type) : anyType : undefined; } function getConstraintOfTypeParameter(type) { @@ -10741,7 +11604,7 @@ var ts; type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNode(ts.getDeclarationOfKind(type.symbol, 127).constraint); + type.constraint = getTypeFromTypeNodeOrHeritageClauseElement(ts.getDeclarationOfKind(type.symbol, 128).constraint); } } return type.constraint === noConstraintType ? undefined : type.constraint; @@ -10765,7 +11628,7 @@ var ts; } function getWideningFlagsOfTypes(types) { var result = 0; - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var type = types[_i]; result |= type.flags; } @@ -10791,13 +11654,13 @@ var ts; while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) { currentNode = currentNode.parent; } - links.isIllegalTypeReferenceInConstraint = currentNode.kind === 127; + links.isIllegalTypeReferenceInConstraint = currentNode.kind === 128; return links.isIllegalTypeReferenceInConstraint; } function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter) { var typeParameterSymbol; function check(n) { - if (n.kind === 139 && n.typeName.kind === 64) { + if (n.kind === 141 && n.typeName.kind === 65) { var links = getNodeLinks(n); if (links.isIllegalTypeReferenceInConstraint === undefined) { var symbol = resolveName(typeParameter, n.typeName.text, 793056, undefined, undefined); @@ -10816,31 +11679,42 @@ var ts; check(typeParameter.constraint); } } - function getTypeFromTypeReferenceNode(node) { + function getTypeFromTypeReference(node) { + return getTypeFromTypeReferenceOrHeritageClauseElement(node); + } + function getTypeFromHeritageClauseElement(node) { + return getTypeFromTypeReferenceOrHeritageClauseElement(node); + } + function getTypeFromTypeReferenceOrHeritageClauseElement(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - var symbol = resolveEntityName(node.typeName, 793056); var type; - if (symbol) { - if ((symbol.flags & 262144) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { - type = unknownType; - } - else { - type = getDeclaredTypeOfSymbol(symbol); - if (type.flags & (1024 | 2048) && type.flags & 4096) { - var typeParameters = type.typeParameters; - if (node.typeArguments && node.typeArguments.length === typeParameters.length) { - type = createTypeReference(type, ts.map(node.typeArguments, getTypeFromTypeNode)); - } - else { - error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, undefined, 1), typeParameters.length); - type = undefined; - } + if (node.kind !== 177 || ts.isSupportedHeritageClauseElement(node)) { + var typeNameOrExpression = node.kind === 141 + ? node.typeName + : node.expression; + var symbol = resolveEntityName(typeNameOrExpression, 793056); + if (symbol) { + if ((symbol.flags & 262144) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { + type = unknownType; } else { - if (node.typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); - type = undefined; + type = getDeclaredTypeOfSymbol(symbol); + if (type.flags & (1024 | 2048) && type.flags & 4096) { + var typeParameters = type.typeParameters; + if (node.typeArguments && node.typeArguments.length === typeParameters.length) { + type = createTypeReference(type, ts.map(node.typeArguments, getTypeFromTypeNodeOrHeritageClauseElement)); + } + else { + error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, undefined, 1), typeParameters.length); + type = undefined; + } + } + else { + if (node.typeArguments) { + error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); + type = undefined; + } } } } @@ -10859,12 +11733,12 @@ var ts; function getTypeOfGlobalSymbol(symbol, arity) { function getTypeDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; switch (declaration.kind) { - case 196: - case 197: - case 199: + case 201: + case 202: + case 204: return declaration; } } @@ -10906,7 +11780,7 @@ var ts; function getTypeFromArrayTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = createArrayType(getTypeFromTypeNode(node.elementType)); + links.resolvedType = createArrayType(getTypeFromTypeNodeOrHeritageClauseElement(node.elementType)); } return links.resolvedType; } @@ -10922,7 +11796,7 @@ var ts; function getTypeFromTupleTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = createTupleType(ts.map(node.elementTypes, getTypeFromTypeNode)); + links.resolvedType = createTupleType(ts.map(node.elementTypes, getTypeFromTypeNodeOrHeritageClauseElement)); } return links.resolvedType; } @@ -10942,13 +11816,13 @@ var ts; } } function addTypesToSortedSet(sortedTypes, types) { - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var type = types[_i]; addTypeToSortedSet(sortedTypes, type); } } function isSubtypeOfAny(candidate, types) { - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var type = types[_i]; if (candidate !== type && isTypeSubtypeOf(candidate, type)) { return true; @@ -10966,7 +11840,7 @@ var ts; } } function containsAnyType(types) { - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var type = types[_i]; if (type.flags & 1) { return true; @@ -11013,7 +11887,7 @@ var ts; function getTypeFromUnionTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNode), true); + links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNodeOrHeritageClauseElement), true); } return links.resolvedType; } @@ -11039,40 +11913,42 @@ var ts; } return links.resolvedType; } - function getTypeFromTypeNode(node) { + function getTypeFromTypeNodeOrHeritageClauseElement(node) { switch (node.kind) { - case 111: - return anyType; - case 120: - return stringType; - case 118: - return numberType; case 112: - return booleanType; + return anyType; case 121: + return stringType; + case 119: + return numberType; + case 113: + return booleanType; + case 122: return esSymbolType; - case 98: + case 99: return voidType; case 8: return getTypeFromStringLiteral(node); - case 139: - return getTypeFromTypeReferenceNode(node); - case 142: - return getTypeFromTypeQueryNode(node); - case 144: - return getTypeFromArrayTypeNode(node); - case 145: - return getTypeFromTupleTypeNode(node); - case 146: - return getTypeFromUnionTypeNode(node); - case 147: - return getTypeFromTypeNode(node.type); - case 140: 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 getTypeFromTypeNodeOrHeritageClauseElement(node.type); + case 142: case 143: + case 145: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 64: - case 125: + case 65: + case 126: var symbol = getSymbolInfo(node); return symbol && getDeclaredTypeOfSymbol(symbol); default: @@ -11082,7 +11958,7 @@ var ts; function instantiateList(items, mapper, instantiator) { if (items && items.length) { var result = []; - for (var _i = 0, _n = items.length; _i < _n; _i++) { + for (var _i = 0; _i < items.length; _i++) { var v = items[_i]; result.push(instantiator(v, mapper)); } @@ -11122,7 +11998,7 @@ var ts; case 2: return createBinaryTypeEraser(sources[0], sources[1]); } return function (t) { - for (var _i = 0, _n = sources.length; _i < _n; _i++) { + for (var _i = 0; _i < sources.length; _i++) { var source = sources[_i]; if (t === source) { return anyType; @@ -11135,6 +12011,7 @@ var ts; return function (t) { for (var i = 0; i < context.typeParameters.length; i++) { if (t === context.typeParameters[i]) { + context.inferences[i].isFixed = true; return getInferredType(context, i); } } @@ -11222,27 +12099,27 @@ var ts; return type; } function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 132 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 160: - case 161: + case 162: + case 163: return isContextSensitiveFunctionLikeDeclaration(node); - case 152: + case 154: return ts.forEach(node.properties, isContextSensitive); - case 151: + case 153: return ts.forEach(node.elements, isContextSensitive); - case 168: + case 170: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 167: + case 169: return node.operatorToken.kind === 49 && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 218: + case 224: return isContextSensitive(node.initializer); - case 132: - case 131: + case 134: + case 133: return isContextSensitiveFunctionLikeDeclaration(node); - case 159: + case 161: return isContextSensitive(node.expression); } return false; @@ -11298,6 +12175,7 @@ var ts; var expandingFlags; var depth = 0; var overflow = false; + var elaborateErrors = false; ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); var result = isRelatedTo(source, target, errorNode !== undefined, headMessage); if (overflow) { @@ -11306,7 +12184,8 @@ var ts; else if (errorInfo) { if (errorInfo.next === undefined) { errorInfo = undefined; - isRelatedTo(source, target, errorNode !== undefined, headMessage, true); + elaborateErrors = true; + isRelatedTo(source, target, errorNode !== undefined, headMessage); } if (containingMessageChain) { errorInfo = ts.concatenateDiagnosticMessageChains(containingMessageChain, errorInfo); @@ -11317,9 +12196,8 @@ var ts; function reportError(message, arg0, arg1, arg2) { errorInfo = ts.chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2); } - function isRelatedTo(source, target, reportErrors, headMessage, elaborateErrors) { - if (elaborateErrors === void 0) { elaborateErrors = false; } - var _result; + function isRelatedTo(source, target, reportErrors, headMessage) { + var result; if (source === target) return -1; if (relation !== identityRelation) { @@ -11343,54 +12221,54 @@ var ts; if (source.flags & 16384 || target.flags & 16384) { if (relation === identityRelation) { if (source.flags & 16384 && target.flags & 16384) { - if (_result = unionTypeRelatedToUnionType(source, target)) { - if (_result &= unionTypeRelatedToUnionType(target, source)) { - return _result; + if (result = unionTypeRelatedToUnionType(source, target)) { + if (result &= unionTypeRelatedToUnionType(target, source)) { + return result; } } } else if (source.flags & 16384) { - if (_result = unionTypeRelatedToType(source, target, reportErrors)) { - return _result; + if (result = unionTypeRelatedToType(source, target, reportErrors)) { + return result; } } else { - if (_result = unionTypeRelatedToType(target, source, reportErrors)) { - return _result; + if (result = unionTypeRelatedToType(target, source, reportErrors)) { + return result; } } } else { if (source.flags & 16384) { - if (_result = unionTypeRelatedToType(source, target, reportErrors)) { - return _result; + if (result = unionTypeRelatedToType(source, target, reportErrors)) { + return result; } } else { - if (_result = typeRelatedToUnionType(source, target, reportErrors)) { - return _result; + if (result = typeRelatedToUnionType(source, target, reportErrors)) { + return result; } } } } else if (source.flags & 512 && target.flags & 512) { - if (_result = typeParameterRelatedTo(source, target, reportErrors)) { - return _result; + if (result = typeParameterRelatedTo(source, target, reportErrors)) { + return result; } } else { var saveErrorInfo = errorInfo; if (source.flags & 4096 && target.flags & 4096 && source.target === target.target) { - if (_result = typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { - return _result; + if (result = typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { + return result; } } var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; var sourceOrApparentType = relation === identityRelation ? source : getApparentType(source); if (sourceOrApparentType.flags & 48128 && target.flags & 48128 && - (_result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors, elaborateErrors))) { + (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors))) { errorInfo = saveErrorInfo; - return _result; + return result; } } if (reportErrors) { @@ -11406,17 +12284,17 @@ var ts; return 0; } function unionTypeRelatedToUnionType(source, target) { - var _result = -1; + var result = -1; var sourceTypes = source.types; - for (var _i = 0, _n = sourceTypes.length; _i < _n; _i++) { + for (var _i = 0; _i < sourceTypes.length; _i++) { var sourceType = sourceTypes[_i]; var related = typeRelatedToUnionType(sourceType, target, false); if (!related) { return 0; } - _result &= related; + result &= related; } - return _result; + return result; } function typeRelatedToUnionType(source, target, reportErrors) { var targetTypes = target.types; @@ -11429,28 +12307,28 @@ var ts; return 0; } function unionTypeRelatedToType(source, target, reportErrors) { - var _result = -1; + var result = -1; var sourceTypes = source.types; - for (var _i = 0, _n = sourceTypes.length; _i < _n; _i++) { + for (var _i = 0; _i < sourceTypes.length; _i++) { var sourceType = sourceTypes[_i]; var related = isRelatedTo(sourceType, target, reportErrors); if (!related) { return 0; } - _result &= related; + result &= related; } - return _result; + return result; } function typesRelatedTo(sources, targets, reportErrors) { - var _result = -1; + var result = -1; for (var i = 0, len = sources.length; i < len; i++) { var related = isRelatedTo(sources[i], targets[i], reportErrors); if (!related) { return 0; } - _result &= related; + result &= related; } - return _result; + return result; } function typeParameterRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { @@ -11477,8 +12355,7 @@ var ts; return 0; } } - function objectTypeRelatedTo(source, target, reportErrors, elaborateErrors) { - if (elaborateErrors === void 0) { elaborateErrors = false; } + function objectTypeRelatedTo(source, target, reportErrors) { if (overflow) { return 0; } @@ -11516,20 +12393,20 @@ var ts; expandingFlags |= 1; if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack)) expandingFlags |= 2; - var _result; + var result; if (expandingFlags === 3) { - _result = 1; + result = 1; } else { - _result = propertiesRelatedTo(source, target, reportErrors); - if (_result) { - _result &= signaturesRelatedTo(source, target, 0, reportErrors); - if (_result) { - _result &= signaturesRelatedTo(source, target, 1, reportErrors); - if (_result) { - _result &= stringIndexTypesRelatedTo(source, target, reportErrors); - if (_result) { - _result &= numberIndexTypesRelatedTo(source, target, reportErrors); + result = propertiesRelatedTo(source, target, reportErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 0, reportErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 1, reportErrors); + if (result) { + result &= stringIndexTypesRelatedTo(source, target, reportErrors); + if (result) { + result &= numberIndexTypesRelatedTo(source, target, reportErrors); } } } @@ -11537,23 +12414,23 @@ var ts; } expandingFlags = saveExpandingFlags; depth--; - if (_result) { + if (result) { var maybeCache = maybeStack[depth]; - var destinationCache = (_result === -1 || depth === 0) ? relation : maybeStack[depth - 1]; + var destinationCache = (result === -1 || depth === 0) ? relation : maybeStack[depth - 1]; ts.copyMap(maybeCache, destinationCache); } else { relation[id] = reportErrors ? 3 : 2; } - return _result; + return result; } function isDeeplyNestedGeneric(type, stack) { if (type.flags & 4096 && depth >= 10) { - var _target = type.target; + var target_1 = type.target; var count = 0; for (var i = 0; i < depth; i++) { var t = stack[i]; - if (t.flags & 4096 && t.target === _target) { + if (t.flags & 4096 && t.target === target_1) { count++; if (count >= 10) return true; @@ -11566,10 +12443,10 @@ var ts; if (relation === identityRelation) { return propertiesIdenticalTo(source, target); } - var _result = -1; + var result = -1; var properties = getPropertiesOfObjectType(target); var requireOptionalProperties = relation === subtypeRelation && !(source.flags & 131072); - for (var _i = 0, _n = properties.length; _i < _n; _i++) { + for (var _i = 0; _i < properties.length; _i++) { var targetProp = properties[_i]; var sourceProp = getPropertyOfType(source, targetProp.name); if (sourceProp !== targetProp) { @@ -11621,7 +12498,7 @@ var ts; } return 0; } - _result &= related; + result &= related; if (sourceProp.flags & 536870912 && !(targetProp.flags & 536870912)) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); @@ -11631,7 +12508,7 @@ var ts; } } } - return _result; + return result; } function propertiesIdenticalTo(source, target) { var sourceProperties = getPropertiesOfObjectType(source); @@ -11639,8 +12516,8 @@ var ts; if (sourceProperties.length !== targetProperties.length) { return 0; } - var _result = -1; - for (var _i = 0, _n = sourceProperties.length; _i < _n; _i++) { + var result = -1; + for (var _i = 0; _i < sourceProperties.length; _i++) { var sourceProp = sourceProperties[_i]; var targetProp = getPropertyOfObjectType(target, sourceProp.name); if (!targetProp) { @@ -11650,9 +12527,9 @@ var ts; if (!related) { return 0; } - _result &= related; + result &= related; } - return _result; + return result; } function signaturesRelatedTo(source, target, kind, reportErrors) { if (relation === identityRelation) { @@ -11663,18 +12540,18 @@ var ts; } var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); - var _result = -1; + var result = -1; var saveErrorInfo = errorInfo; - outer: for (var _i = 0, _n = targetSignatures.length; _i < _n; _i++) { + outer: for (var _i = 0; _i < targetSignatures.length; _i++) { var t = targetSignatures[_i]; if (!t.hasStringLiterals || target.flags & 65536) { var localErrors = reportErrors; - for (var _a = 0, _b = sourceSignatures.length; _a < _b; _a++) { + for (var _a = 0; _a < sourceSignatures.length; _a++) { var s = sourceSignatures[_a]; if (!s.hasStringLiterals || source.flags & 65536) { var related = signatureRelatedTo(s, t, localErrors); if (related) { - _result &= related; + result &= related; errorInfo = saveErrorInfo; continue outer; } @@ -11684,7 +12561,7 @@ var ts; return 0; } } - return _result; + return result; } function signatureRelatedTo(source, target, reportErrors) { if (source === target) { @@ -11714,14 +12591,14 @@ var ts; } source = getErasedSignature(source); target = getErasedSignature(target); - var _result = -1; + var result = -1; for (var i = 0; i < checkCount; i++) { - var _s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); - var _t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); + var s_1 = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); + var t_1 = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); var saveErrorInfo = errorInfo; - var related = isRelatedTo(_s, _t, reportErrors); + var related = isRelatedTo(s_1, t_1, reportErrors); if (!related) { - related = isRelatedTo(_t, _s, false); + related = isRelatedTo(t_1, s_1, false); if (!related) { if (reportErrors) { reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); @@ -11730,13 +12607,13 @@ var ts; } errorInfo = saveErrorInfo; } - _result &= related; + result &= related; } var t = getReturnTypeOfSignature(target); if (t === voidType) - return _result; + return result; var s = getReturnTypeOfSignature(source); - return _result & isRelatedTo(s, t, reportErrors); + return result & isRelatedTo(s, t, reportErrors); } function signaturesIdenticalTo(source, target, kind) { var sourceSignatures = getSignaturesOfType(source, kind); @@ -11744,15 +12621,15 @@ var ts; if (sourceSignatures.length !== targetSignatures.length) { return 0; } - var _result = -1; + var result = -1; for (var i = 0, len = sourceSignatures.length; i < len; ++i) { var related = compareSignatures(sourceSignatures[i], targetSignatures[i], true, isRelatedTo); if (!related) { return 0; } - _result &= related; + result &= related; } - return _result; + return result; } function stringIndexTypesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { @@ -11872,14 +12749,14 @@ var ts; } source = getErasedSignature(source); target = getErasedSignature(target); - for (var _i = 0, _len = source.parameters.length; _i < _len; _i++) { - var s = source.hasRestParameter && _i === _len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[_i]); - var t = target.hasRestParameter && _i === _len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[_i]); - var _related = compareTypes(s, t); - if (!_related) { + for (var i = 0, len = source.parameters.length; i < len; i++) { + var s = source.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); + var t = target.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]); + var related = compareTypes(s, t); + if (!related) { return 0; } - result &= _related; + result &= related; } if (compareReturnTypes) { result &= compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); @@ -11887,7 +12764,7 @@ var ts; return result; } function isSupertypeOfEach(candidate, types) { - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var type = types[_i]; if (candidate !== type && !isTypeSubtypeOf(type, candidate)) return false; @@ -11912,6 +12789,7 @@ var ts; downfallType = types[j]; } } + ts.Debug.assert(!!downfallType, "If there is no common supertype, each type should have a downfallType"); if (score > bestSupertypeScore) { bestSupertype = types[i]; bestSupertypeDownfallType = downfallType; @@ -11992,17 +12870,17 @@ var ts; return reportWideningErrorsInType(type.typeArguments[0]); } if (type.flags & 131072) { - var _errorReported = false; + var errorReported = false; ts.forEach(getPropertiesOfObjectType(type), function (p) { var t = getTypeOfSymbol(p); if (t.flags & 262144) { if (!reportWideningErrorsInType(t)) { error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, p.name, typeToString(getWidenedType(t))); } - _errorReported = true; + errorReported = true; } }); - return _errorReported; + return errorReported; } return false; } @@ -12010,22 +12888,22 @@ var ts; var typeAsString = typeToString(getWidenedType(type)); var diagnostic; switch (declaration.kind) { - case 130: - case 129: + case 132: + case 131: diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 128: + case 129: diagnostic = declaration.dotDotDotToken ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; - case 195: - case 132: - case 131: + case 200: case 134: - case 135: - case 160: - case 161: + case 133: + case 136: + case 137: + case 162: + case 163: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; @@ -12072,14 +12950,13 @@ var ts; } function createInferenceContext(typeParameters, inferUnionTypes) { var inferences = []; - for (var _i = 0, _n = typeParameters.length; _i < _n; _i++) { + for (var _i = 0; _i < typeParameters.length; _i++) { var unused = typeParameters[_i]; - inferences.push({ primary: undefined, secondary: undefined }); + inferences.push({ primary: undefined, secondary: undefined, isFixed: false }); } return { typeParameters: typeParameters, inferUnionTypes: inferUnionTypes, - inferenceCount: 0, inferences: inferences, inferredTypes: new Array(typeParameters.length) }; @@ -12100,11 +12977,11 @@ var ts; } function isWithinDepthLimit(type, stack) { if (depth >= 5) { - var _target = type.target; + var target_2 = type.target; var count = 0; for (var i = 0; i < depth; i++) { var t = stack[i]; - if (t.flags & 4096 && t.target === _target) { + if (t.flags & 4096 && t.target === target_2) { count++; } } @@ -12121,28 +12998,31 @@ var ts; for (var i = 0; i < typeParameters.length; i++) { if (target === typeParameters[i]) { var inferences = context.inferences[i]; - var candidates = inferiority ? - inferences.secondary || (inferences.secondary = []) : - inferences.primary || (inferences.primary = []); - if (!ts.contains(candidates, source)) - candidates.push(source); - break; + if (!inferences.isFixed) { + var candidates = inferiority ? + inferences.secondary || (inferences.secondary = []) : + inferences.primary || (inferences.primary = []); + if (!ts.contains(candidates, source)) { + candidates.push(source); + } + } + return; } } } else if (source.flags & 4096 && target.flags & 4096 && source.target === target.target) { var sourceTypes = source.typeArguments; var targetTypes = target.typeArguments; - for (var _i = 0; _i < sourceTypes.length; _i++) { - inferFromTypes(sourceTypes[_i], targetTypes[_i]); + for (var i = 0; i < sourceTypes.length; i++) { + inferFromTypes(sourceTypes[i], targetTypes[i]); } } else if (target.flags & 16384) { - var _targetTypes = target.types; + var targetTypes = target.types; var typeParameterCount = 0; var typeParameter; - for (var _a = 0, _n = _targetTypes.length; _a < _n; _a++) { - var t = _targetTypes[_a]; + for (var _i = 0; _i < targetTypes.length; _i++) { + var t = targetTypes[_i]; if (t.flags & 512 && ts.contains(context.typeParameters, t)) { typeParameter = t; typeParameterCount++; @@ -12158,9 +13038,9 @@ var ts; } } else if (source.flags & 16384) { - var _sourceTypes = source.types; - for (var _b = 0, _c = _sourceTypes.length; _b < _c; _b++) { - var sourceType = _sourceTypes[_b]; + var sourceTypes = source.types; + for (var _a = 0; _a < sourceTypes.length; _a++) { + var sourceType = sourceTypes[_a]; inferFromTypes(sourceType, target); } } @@ -12186,7 +13066,7 @@ var ts; } function inferFromProperties(source, target) { var properties = getPropertiesOfObjectType(target); - for (var _i = 0, _n = properties.length; _i < _n; _i++) { + for (var _i = 0; _i < properties.length; _i++) { var targetProp = properties[_i]; var sourceProp = getPropertyOfObjectType(source, targetProp.name); if (sourceProp) { @@ -12224,19 +13104,25 @@ var ts; } function getInferredType(context, index) { var inferredType = context.inferredTypes[index]; + var inferenceSucceeded; if (!inferredType) { var inferences = getInferenceCandidates(context, index); if (inferences.length) { var unionOrSuperType = context.inferUnionTypes ? getUnionType(inferences) : getCommonSupertype(inferences); - inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : inferenceFailureType; + inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : unknownType; + inferenceSucceeded = !!unionOrSuperType; } else { inferredType = emptyObjectType; + inferenceSucceeded = true; } - if (inferredType !== inferenceFailureType) { + if (inferenceSucceeded) { var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); inferredType = constraint && !isTypeAssignableTo(inferredType, constraint) ? constraint : inferredType; } + else if (context.failedTypeParameterIndex === undefined || context.failedTypeParameterIndex > index) { + context.failedTypeParameterIndex = index; + } context.inferredTypes[index] = inferredType; } return inferredType; @@ -12253,17 +13139,17 @@ var ts; function getResolvedSymbol(node) { var links = getNodeLinks(node); if (!links.resolvedSymbol) { - links.resolvedSymbol = (ts.getFullWidth(node) > 0 && resolveName(node, node.text, 107455 | 1048576, ts.Diagnostics.Cannot_find_name_0, node)) || unknownSymbol; + links.resolvedSymbol = (!ts.nodeIsMissing(node) && resolveName(node, node.text, 107455 | 1048576, ts.Diagnostics.Cannot_find_name_0, node)) || unknownSymbol; } return links.resolvedSymbol; } function isInTypeQuery(node) { while (node) { switch (node.kind) { - case 142: + case 144: return true; - case 64: - case 125: + case 65: + case 126: node = node.parent; continue; default: @@ -12303,12 +13189,12 @@ var ts; } return links.assignmentChecks[symbol.id] = isAssignedIn(node); function isAssignedInBinaryExpression(node) { - if (node.operatorToken.kind >= 52 && node.operatorToken.kind <= 63) { + if (node.operatorToken.kind >= 53 && node.operatorToken.kind <= 64) { var n = node.left; - while (n.kind === 159) { + while (n.kind === 161) { n = n.expression; } - if (n.kind === 64 && getResolvedSymbol(n) === symbol) { + if (n.kind === 65 && getResolvedSymbol(n) === symbol) { return true; } } @@ -12322,46 +13208,46 @@ var ts; } function isAssignedIn(node) { switch (node.kind) { - case 167: + case 169: return isAssignedInBinaryExpression(node); - case 193: - case 150: - return isAssignedInVariableDeclaration(node); - case 148: - case 149: - case 151: + case 198: case 152: + return isAssignedInVariableDeclaration(node); + case 150: + case 151: case 153: case 154: case 155: case 156: + case 157: case 158: - case 159: - case 165: - case 162: - case 163: + case 160: + case 161: + case 167: case 164: + case 165: case 166: case 168: - case 171: - case 174: - case 175: - case 177: - case 178: + case 170: + case 173: case 179: case 180: - case 181: case 182: case 183: + case 184: + case 185: case 186: case 187: case 188: - case 214: - case 215: - case 189: - case 190: case 191: - case 217: + case 192: + case 193: + case 220: + case 221: + case 194: + case 195: + case 196: + case 223: return ts.forEachChild(node, isAssignedIn); } return false; @@ -12369,10 +13255,10 @@ var ts; } function resolveLocation(node) { var containerNodes = []; - for (var _parent = node.parent; _parent; _parent = _parent.parent) { - if ((ts.isExpression(_parent) || ts.isObjectLiteralMethod(node)) && - isContextSensitive(_parent)) { - containerNodes.unshift(_parent); + for (var parent_3 = node.parent; parent_3; parent_3 = parent_3.parent) { + if ((ts.isExpression(parent_3) || ts.isObjectLiteralMethod(node)) && + isContextSensitive(parent_3)) { + containerNodes.unshift(parent_3); } } ts.forEach(containerNodes, function (node) { getTypeOfNode(node); }); @@ -12397,17 +13283,17 @@ var ts; node = node.parent; var narrowedType = type; switch (node.kind) { - case 178: + case 183: if (child !== node.expression) { narrowedType = narrowType(type, node.expression, child === node.thenStatement); } break; - case 168: + case 170: if (child !== node.condition) { narrowedType = narrowType(type, node.condition, child === node.whenTrue); } break; - case 167: + case 169: if (child === node.right) { if (node.operatorToken.kind === 48) { narrowedType = narrowType(type, node.left, true); @@ -12417,14 +13303,14 @@ var ts; } } break; - case 221: + case 227: + case 205: case 200: - case 195: - case 132: - case 131: case 134: - case 135: case 133: + case 136: + case 137: + case 135: break loop; } if (narrowedType !== type) { @@ -12437,12 +13323,12 @@ var ts; } return type; function narrowTypeByEquality(type, expr, assumeTrue) { - if (expr.left.kind !== 163 || expr.right.kind !== 8) { + if (expr.left.kind !== 165 || expr.right.kind !== 8) { return type; } var left = expr.left; var right = expr.right; - if (left.expression.kind !== 64 || getResolvedSymbol(left.expression) !== symbol) { + if (left.expression.kind !== 65 || getResolvedSymbol(left.expression) !== symbol) { return type; } var typeInfo = primitiveTypeInfo[right.text]; @@ -12488,7 +13374,7 @@ var ts; } } function narrowTypeByInstanceof(type, expr, assumeTrue) { - if (type.flags & 1 || !assumeTrue || expr.left.kind !== 64 || getResolvedSymbol(expr.left) !== symbol) { + if (type.flags & 1 || !assumeTrue || expr.left.kind !== 65 || getResolvedSymbol(expr.left) !== symbol) { return type; } var rightType = checkExpression(expr.right); @@ -12510,9 +13396,9 @@ var ts; } function narrowType(type, expr, assumeTrue) { switch (expr.kind) { - case 159: + case 161: return narrowType(type, expr.expression, assumeTrue); - case 167: + case 169: var operator = expr.operatorToken.kind; if (operator === 30 || operator === 31) { return narrowTypeByEquality(type, expr, assumeTrue); @@ -12523,11 +13409,11 @@ var ts; else if (operator === 49) { return narrowTypeByOr(type, expr, assumeTrue); } - else if (operator === 86) { + else if (operator === 87) { return narrowTypeByInstanceof(type, expr, assumeTrue); } break; - case 165: + case 167: if (expr.operator === 46) { return narrowType(type, expr.operand, !assumeTrue); } @@ -12538,7 +13424,7 @@ var ts; } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); - if (symbol === argumentsSymbol && ts.getContainingFunction(node).kind === 161) { + if (symbol === argumentsSymbol && ts.getContainingFunction(node).kind === 163) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression); } if (symbol.flags & 8388608 && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { @@ -12562,15 +13448,15 @@ var ts; function checkBlockScopedBindingCapturedInLoop(node, symbol) { if (languageVersion >= 2 || (symbol.flags & 2) === 0 || - symbol.valueDeclaration.parent.kind === 217) { + symbol.valueDeclaration.parent.kind === 223) { return; } var container = symbol.valueDeclaration; - while (container.kind !== 194) { + while (container.kind !== 199) { container = container.parent; } container = container.parent; - if (container.kind === 175) { + if (container.kind === 180) { container = container.parent; } var inFunction = isInsideFunction(node.parent, container); @@ -12587,9 +13473,9 @@ var ts; } } function captureLexicalThis(node, container) { - var classNode = container.parent && container.parent.kind === 196 ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 201 ? container.parent : undefined; getNodeLinks(node).flags |= 2; - if (container.kind === 130 || container.kind === 133) { + if (container.kind === 132 || container.kind === 135) { getNodeLinks(classNode).flags |= 4; } else { @@ -12599,36 +13485,36 @@ var ts; function checkThisExpression(node) { var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; - if (container.kind === 161) { + if (container.kind === 163) { container = ts.getThisContainer(container, false); needToCaptureLexicalThis = (languageVersion < 2); } switch (container.kind) { - case 200: + case 205: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_body); break; - case 199: + case 204: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); break; - case 133: + case 135: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; - case 130: - case 129: + case 132: + case 131: if (container.flags & 128) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } break; - case 126: + case 127: 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 === 196 ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 201 ? container.parent : undefined; if (classNode) { var symbol = getSymbolOfNode(classNode); return container.flags & 128 ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); @@ -12637,17 +13523,17 @@ var ts; } function isInConstructorArgumentInitializer(node, constructorDecl) { for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 128) { + if (n.kind === 129) { return true; } } return false; } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 155 && node.parent.expression === node; - var enclosingClass = ts.getAncestor(node, 196); + var isCallExpression = node.parent.kind === 157 && node.parent.expression === node; + var enclosingClass = ts.getAncestor(node, 201); var baseClass; - if (enclosingClass && ts.getClassBaseTypeNode(enclosingClass)) { + if (enclosingClass && ts.getClassExtendsHeritageClauseElement(enclosingClass)) { var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); baseClass = classType.baseTypes.length && classType.baseTypes[0]; } @@ -12660,31 +13546,31 @@ var ts; var canUseSuperExpression = false; var needToCaptureLexicalThis; if (isCallExpression) { - canUseSuperExpression = container.kind === 133; + canUseSuperExpression = container.kind === 135; } else { needToCaptureLexicalThis = false; - while (container && container.kind === 161) { + while (container && container.kind === 163) { container = ts.getSuperContainer(container, true); needToCaptureLexicalThis = true; } - if (container && container.parent && container.parent.kind === 196) { + if (container && container.parent && container.parent.kind === 201) { if (container.flags & 128) { canUseSuperExpression = - container.kind === 132 || - container.kind === 131 || - container.kind === 134 || - container.kind === 135; + container.kind === 134 || + container.kind === 133 || + container.kind === 136 || + container.kind === 137; } else { canUseSuperExpression = - container.kind === 132 || + container.kind === 134 || + container.kind === 133 || + container.kind === 136 || + container.kind === 137 || + container.kind === 132 || container.kind === 131 || - container.kind === 134 || - container.kind === 135 || - container.kind === 130 || - container.kind === 129 || - container.kind === 133; + container.kind === 135; } } } @@ -12698,7 +13584,7 @@ var ts; getNodeLinks(node).flags |= 16; returnType = baseClass; } - if (container.kind === 133 && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 135 && isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); returnType = unknownType; } @@ -12708,7 +13594,7 @@ var ts; return returnType; } } - if (container.kind === 126) { + if (container.kind === 127) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { @@ -12744,9 +13630,9 @@ var ts; var declaration = node.parent; if (node === declaration.initializer) { if (declaration.type) { - return getTypeFromTypeNode(declaration.type); + return getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); } - if (declaration.kind === 128) { + if (declaration.kind === 129) { var type = getContextuallyTypedParameterType(declaration); if (type) { return type; @@ -12761,7 +13647,7 @@ var ts; function getContextualTypeForReturnExpression(node) { var func = ts.getContainingFunction(node); if (func) { - if (func.type || func.kind === 133 || func.kind === 134 && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(func.symbol, 135))) { + if (func.type || func.kind === 135 || func.kind === 136 && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(func.symbol, 137))) { return getReturnTypeOfSignature(getSignatureFromDeclaration(func)); } var signature = getContextualSignatureForFunctionLikeDeclaration(func); @@ -12781,7 +13667,7 @@ var ts; return undefined; } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 157) { + if (template.parent.kind === 159) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -12789,7 +13675,7 @@ var ts; function getContextualTypeForBinaryOperand(node) { var binaryExpression = node.parent; var operator = binaryExpression.operatorToken.kind; - if (operator >= 52 && operator <= 63) { + if (operator >= 53 && operator <= 64) { if (node === binaryExpression.right) { return checkExpression(binaryExpression.left); } @@ -12810,7 +13696,7 @@ var ts; var types = type.types; var mappedType; var mappedTypes; - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var current = types[_i]; var t = mapper(current); if (t) { @@ -12887,35 +13773,35 @@ var ts; if (node.contextualType) { return node.contextualType; } - var _parent = node.parent; - switch (_parent.kind) { - case 193: - case 128: - case 130: + var parent = node.parent; + switch (parent.kind) { + case 198: case 129: - case 150: + case 132: + case 131: + case 152: return getContextualTypeForInitializerExpression(node); - case 161: - case 186: + case 163: + case 191: return getContextualTypeForReturnExpression(node); - case 155: - case 156: - return getContextualTypeForArgument(_parent, node); + case 157: case 158: - return getTypeFromTypeNode(_parent.type); - case 167: + return getContextualTypeForArgument(parent, node); + case 160: + return getTypeFromTypeNodeOrHeritageClauseElement(parent.type); + case 169: return getContextualTypeForBinaryOperand(node); - case 218: - return getContextualTypeForObjectLiteralElement(_parent); - case 151: + case 224: + return getContextualTypeForObjectLiteralElement(parent); + case 153: return getContextualTypeForElementExpression(node); - case 168: + case 170: return getContextualTypeForConditionalOperand(node); - case 173: - ts.Debug.assert(_parent.parent.kind === 169); - return getContextualTypeForSubstitutionExpression(_parent.parent, node); - case 159: - return getContextualType(_parent); + case 176: + ts.Debug.assert(parent.parent.kind === 171); + return getContextualTypeForSubstitutionExpression(parent.parent, node); + case 161: + return getContextualType(parent); } return undefined; } @@ -12929,13 +13815,13 @@ var ts; } } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 160 || node.kind === 161; + return node.kind === 162 || node.kind === 163; } function getContextualSignatureForFunctionLikeDeclaration(node) { return isFunctionExpressionOrArrowFunction(node) ? getContextualSignature(node) : undefined; } function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 132 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); var type = ts.isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node) : getContextualType(node); @@ -12947,7 +13833,7 @@ var ts; } var signatureList; var types = type.types; - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var current = types[_i]; if (signatureList && getSignaturesOfObjectOrUnionType(current, 0).length > 1) { @@ -12978,15 +13864,15 @@ var ts; return mapper && mapper !== identityMapper; } function isAssignmentTarget(node) { - var _parent = node.parent; - if (_parent.kind === 167 && _parent.operatorToken.kind === 52 && _parent.left === node) { + var parent = node.parent; + if (parent.kind === 169 && parent.operatorToken.kind === 53 && parent.left === node) { return true; } - if (_parent.kind === 218) { - return isAssignmentTarget(_parent.parent); + if (parent.kind === 224) { + return isAssignmentTarget(parent.parent); } - if (_parent.kind === 151) { - return isAssignmentTarget(_parent); + if (parent.kind === 153) { + return isAssignmentTarget(parent); } return false; } @@ -13007,7 +13893,7 @@ var ts; var elementTypes = []; ts.forEach(elements, function (e) { var type = checkExpression(e, contextualMapper); - if (e.kind === 171) { + if (e.kind === 173) { elementTypes.push(getIndexTypeOfType(type, 1) || anyType); hasSpreadElement = true; } @@ -13024,7 +13910,7 @@ var ts; return createArrayType(getUnionType(elementTypes)); } function isNumericName(name) { - return name.kind === 126 ? isNumericComputedName(name) : isNumericLiteralName(name.text); + return name.kind === 127 ? isNumericComputedName(name) : isNumericLiteralName(name.text); } function isNumericComputedName(name) { return allConstituentTypesHaveKind(checkComputedPropertyName(name), 1 | 132); @@ -13051,22 +13937,22 @@ var ts; var propertiesArray = []; var contextualType = getContextualType(node); var typeFlags; - for (var _i = 0, _a = node.properties, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var memberDecl = _a[_i]; var member = memberDecl.symbol; - if (memberDecl.kind === 218 || - memberDecl.kind === 219 || + if (memberDecl.kind === 224 || + memberDecl.kind === 225 || ts.isObjectLiteralMethod(memberDecl)) { var type = void 0; - if (memberDecl.kind === 218) { + if (memberDecl.kind === 224) { type = checkPropertyAssignment(memberDecl, contextualMapper); } - else if (memberDecl.kind === 132) { + else if (memberDecl.kind === 134) { type = checkObjectLiteralMethod(memberDecl, contextualMapper); } else { - ts.Debug.assert(memberDecl.kind === 219); - type = memberDecl.name.kind === 126 + ts.Debug.assert(memberDecl.kind === 225); + type = memberDecl.name.kind === 127 ? unknownType : checkExpression(memberDecl.name, contextualMapper); } @@ -13082,7 +13968,7 @@ var ts; member = prop; } else { - ts.Debug.assert(memberDecl.kind === 134 || memberDecl.kind === 135); + ts.Debug.assert(memberDecl.kind === 136 || memberDecl.kind === 137); checkAccessorDeclaration(memberDecl); } if (!ts.hasDynamicName(memberDecl)) { @@ -13101,21 +13987,21 @@ var ts; for (var i = 0; i < propertiesArray.length; i++) { var propertyDecl = node.properties[i]; if (kind === 0 || isNumericName(propertyDecl.name)) { - var _type = getTypeOfSymbol(propertiesArray[i]); - if (!ts.contains(propTypes, _type)) { - propTypes.push(_type); + var type = getTypeOfSymbol(propertiesArray[i]); + if (!ts.contains(propTypes, type)) { + propTypes.push(type); } } } - var _result = propTypes.length ? getUnionType(propTypes) : undefinedType; - typeFlags |= _result.flags; - return _result; + var result_1 = propTypes.length ? getUnionType(propTypes) : undefinedType; + typeFlags |= result_1.flags; + return result_1; } return undefined; } } function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 130; + return s.valueDeclaration ? s.valueDeclaration.kind : 132; } function getDeclarationFlagsFromSymbol(s) { return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : s.flags & 134217728 ? 16 | 128 : 0; @@ -13125,7 +14011,7 @@ var ts; if (!(flags & (32 | 64))) { return; } - var enclosingClassDeclaration = ts.getAncestor(node, 196); + var enclosingClassDeclaration = ts.getAncestor(node, 201); var enclosingClass = enclosingClassDeclaration ? getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClassDeclaration)) : undefined; var declaringClass = getDeclaredTypeOfSymbol(prop.parent); if (flags & 32) { @@ -13134,7 +14020,7 @@ var ts; } return; } - if (left.kind === 90) { + if (left.kind === 91) { return; } if (!enclosingClass || !hasBaseType(enclosingClass, declaringClass)) { @@ -13172,7 +14058,7 @@ var ts; } getNodeLinks(node).resolvedSymbol = prop; if (prop.parent && prop.parent.flags & 32) { - if (left.kind === 90 && getDeclarationKindFromSymbol(prop) !== 132) { + if (left.kind === 91 && getDeclarationKindFromSymbol(prop) !== 134) { error(right, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); } else { @@ -13184,14 +14070,14 @@ var ts; return anyType; } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 153 + var left = node.kind === 155 ? 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 === 90 && getDeclarationKindFromSymbol(prop) !== 132) { + if (left.kind === 91 && getDeclarationKindFromSymbol(prop) !== 134) { return false; } else { @@ -13206,15 +14092,15 @@ var ts; function checkIndexedAccess(node) { if (!node.argumentExpression) { var sourceFile = getSourceFile(node); - if (node.parent.kind === 156 && node.parent.expression === node) { + if (node.parent.kind === 158 && 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); } else { - var _start = node.end - "]".length; - var _end = node.end; - grammarErrorAtPos(sourceFile, _start, _end - _start, ts.Diagnostics.Expression_expected); + var start = node.end - "]".length; + var end = node.end; + grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Expression_expected); } } var objectType = getApparentType(checkExpression(node.expression)); @@ -13229,15 +14115,15 @@ var ts; return unknownType; } if (node.argumentExpression) { - var _name = getPropertyNameForIndexedAccess(node.argumentExpression, indexType); - if (_name !== undefined) { - var prop = getPropertyOfType(objectType, _name); + var name_6 = getPropertyNameForIndexedAccess(node.argumentExpression, indexType); + if (name_6 !== undefined) { + var prop = getPropertyOfType(objectType, name_6); if (prop) { getNodeLinks(node).resolvedSymbol = prop; return getTypeOfSymbol(prop); } else if (isConstEnum) { - error(node.argumentExpression, ts.Diagnostics.Property_0_does_not_exist_on_const_enum_1, _name, symbolToString(objectType.symbol)); + error(node.argumentExpression, ts.Diagnostics.Property_0_does_not_exist_on_const_enum_1, name_6, symbolToString(objectType.symbol)); return unknownType; } } @@ -13302,7 +14188,7 @@ var ts; return true; } function resolveUntypedCall(node) { - if (node.kind === 157) { + if (node.kind === 159) { checkExpression(node.template); } else { @@ -13324,22 +14210,22 @@ var ts; var specializedIndex = -1; var spliceIndex; ts.Debug.assert(!result.length); - for (var _i = 0, _n = signatures.length; _i < _n; _i++) { + for (var _i = 0; _i < signatures.length; _i++) { var signature = signatures[_i]; var symbol = signature.declaration && getSymbolOfNode(signature.declaration); - var _parent = signature.declaration && signature.declaration.parent; + var parent_4 = signature.declaration && signature.declaration.parent; if (!lastSymbol || symbol === lastSymbol) { - if (lastParent && _parent === lastParent) { + if (lastParent && parent_4 === lastParent) { index++; } else { - lastParent = _parent; + lastParent = parent_4; index = cutoffIndex; } } else { index = cutoffIndex = result.length; - lastParent = _parent; + lastParent = parent_4; } lastSymbol = symbol; if (signature.hasStringLiterals) { @@ -13355,7 +14241,7 @@ var ts; } function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { - if (args[i].kind === 171) { + if (args[i].kind === 173) { return i; } } @@ -13365,15 +14251,15 @@ var ts; var adjustedArgCount; var typeArguments; var callIsIncomplete; - if (node.kind === 157) { + if (node.kind === 159) { var tagExpression = node; adjustedArgCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === 169) { + if (tagExpression.template.kind === 171) { var templateExpression = tagExpression.template; var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans); ts.Debug.assert(lastSpan !== undefined); - callIsIncomplete = ts.getFullWidth(lastSpan.literal) === 0 || !!lastSpan.literal.isUnterminated; + callIsIncomplete = ts.nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated; } else { var templateLiteral = tagExpression.template; @@ -13384,7 +14270,7 @@ var ts; else { var callExpression = node; if (!callExpression.arguments) { - ts.Debug.assert(callExpression.kind === 156); + ts.Debug.assert(callExpression.kind === 158); return signature.minArgumentCount === 0; } adjustedArgCount = callExpression.arguments.hasTrailingComma ? args.length + 1 : args.length; @@ -13423,16 +14309,23 @@ var ts; }); return getSignatureInstantiation(signature, getInferredTypes(context)); } - function inferTypeArguments(signature, args, excludeArgument) { + function inferTypeArguments(signature, args, excludeArgument, context) { var typeParameters = signature.typeParameters; - var context = createInferenceContext(typeParameters, false); var inferenceMapper = createInferenceMapper(context); + for (var i = 0; i < typeParameters.length; i++) { + if (!context.inferences[i].isFixed) { + context.inferredTypes[i] = undefined; + } + } + if (context.failedTypeParameterIndex !== undefined && !context.inferences[context.failedTypeParameterIndex].isFixed) { + context.failedTypeParameterIndex = undefined; + } for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg.kind !== 172) { - var paramType = getTypeAtPosition(signature, arg.kind === 171 ? -1 : i); + if (arg.kind !== 175) { + var paramType = getTypeAtPosition(signature, arg.kind === 173 ? -1 : i); var argType = void 0; - if (i === 0 && args[i].parent.kind === 157) { + if (i === 0 && args[i].parent.kind === 159) { argType = globalTemplateStringsArrayType; } else { @@ -13443,29 +14336,22 @@ var ts; } } if (excludeArgument) { - for (var _i = 0; _i < args.length; _i++) { - if (excludeArgument[_i] === false) { - var _arg = args[_i]; - var _paramType = getTypeAtPosition(signature, _arg.kind === 171 ? -1 : _i); - inferTypes(context, checkExpressionWithContextualType(_arg, _paramType, inferenceMapper), _paramType); + for (var i = 0; i < args.length; i++) { + if (excludeArgument[i] === false) { + var arg = args[i]; + var paramType = getTypeAtPosition(signature, arg.kind === 173 ? -1 : i); + inferTypes(context, checkExpressionWithContextualType(arg, paramType, inferenceMapper), paramType); } } } - var inferredTypes = getInferredTypes(context); - context.failedTypeParameterIndex = ts.indexOf(inferredTypes, inferenceFailureType); - for (var _i_1 = 0; _i_1 < inferredTypes.length; _i_1++) { - if (inferredTypes[_i_1] === inferenceFailureType) { - inferredTypes[_i_1] = unknownType; - } - } - return context; + getInferredTypes(context); } function checkTypeArguments(signature, typeArguments, typeArgumentResultTypes, reportErrors) { var typeParameters = signature.typeParameters; var typeArgumentsAreAssignable = true; for (var i = 0; i < typeParameters.length; i++) { var typeArgNode = typeArguments[i]; - var typeArgument = getTypeFromTypeNode(typeArgNode); + var typeArgument = getTypeFromTypeNodeOrHeritageClauseElement(typeArgNode); typeArgumentResultTypes[i] = typeArgument; if (typeArgumentsAreAssignable) { var constraint = getConstraintOfTypeParameter(typeParameters[i]); @@ -13479,9 +14365,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 !== 172) { - var paramType = getTypeAtPosition(signature, arg.kind === 171 ? -1 : i); - var argType = i === 0 && node.kind === 157 ? globalTemplateStringsArrayType : + if (arg.kind !== 175) { + var paramType = getTypeAtPosition(signature, arg.kind === 173 ? -1 : i); + var argType = i === 0 && node.kind === 159 ? globalTemplateStringsArrayType : arg.kind === 8 && !reportErrors ? getStringLiteralType(arg) : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); if (!checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1)) { @@ -13493,10 +14379,10 @@ var ts; } function getEffectiveCallArguments(node) { var args; - if (node.kind === 157) { + if (node.kind === 159) { var template = node.template; args = [template]; - if (template.kind === 169) { + if (template.kind === 171) { ts.forEach(template.templateSpans, function (span) { args.push(span.expression); }); @@ -13508,9 +14394,9 @@ var ts; return args; } function getEffectiveTypeArguments(callExpression) { - if (callExpression.expression.kind === 90) { - var containingClass = ts.getAncestor(callExpression, 196); - var baseClassTypeNode = containingClass && ts.getClassBaseTypeNode(containingClass); + if (callExpression.expression.kind === 91) { + var containingClass = ts.getAncestor(callExpression, 201); + var baseClassTypeNode = containingClass && ts.getClassExtendsHeritageClauseElement(containingClass); return baseClassTypeNode && baseClassTypeNode.typeArguments; } else { @@ -13518,11 +14404,11 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray) { - var isTaggedTemplate = node.kind === 157; + var isTaggedTemplate = node.kind === 159; var typeArguments; if (!isTaggedTemplate) { typeArguments = getEffectiveTypeArguments(node); - if (node.expression.kind !== 90) { + if (node.expression.kind !== 91) { ts.forEach(typeArguments, checkSourceElement); } } @@ -13577,7 +14463,7 @@ var ts; error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); } if (!produceDiagnostics) { - for (var _i = 0, _n = candidates.length; _i < _n; _i++) { + for (var _i = 0; _i < candidates.length; _i++) { var candidate = candidates[_i]; if (hasCorrectArity(node, args, candidate)) { return candidate; @@ -13586,56 +14472,57 @@ var ts; } return resolveErrorCall(node); function chooseOverload(candidates, relation) { - for (var _a = 0, _b = candidates.length; _a < _b; _a++) { - var current = candidates[_a]; - if (!hasCorrectArity(node, args, current)) { + for (var _i = 0; _i < candidates.length; _i++) { + var originalCandidate = candidates[_i]; + if (!hasCorrectArity(node, args, originalCandidate)) { continue; } - var originalCandidate = current; - var inferenceResult = void 0; - var _candidate = void 0; + var candidate = void 0; var typeArgumentsAreValid = void 0; + var inferenceContext = originalCandidate.typeParameters + ? createInferenceContext(originalCandidate.typeParameters, false) + : undefined; while (true) { - _candidate = originalCandidate; - if (_candidate.typeParameters) { + candidate = originalCandidate; + if (candidate.typeParameters) { var typeArgumentTypes = void 0; if (typeArguments) { - typeArgumentTypes = new Array(_candidate.typeParameters.length); - typeArgumentsAreValid = checkTypeArguments(_candidate, typeArguments, typeArgumentTypes, false); + typeArgumentTypes = new Array(candidate.typeParameters.length); + typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, false); } else { - inferenceResult = inferTypeArguments(_candidate, args, excludeArgument); - typeArgumentsAreValid = inferenceResult.failedTypeParameterIndex < 0; - typeArgumentTypes = inferenceResult.inferredTypes; + inferTypeArguments(candidate, args, excludeArgument, inferenceContext); + typeArgumentsAreValid = inferenceContext.failedTypeParameterIndex === undefined; + typeArgumentTypes = inferenceContext.inferredTypes; } if (!typeArgumentsAreValid) { break; } - _candidate = getSignatureInstantiation(_candidate, typeArgumentTypes); + candidate = getSignatureInstantiation(candidate, typeArgumentTypes); } - if (!checkApplicableSignature(node, args, _candidate, relation, excludeArgument, false)) { + if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, false)) { break; } var index = excludeArgument ? ts.indexOf(excludeArgument, true) : -1; if (index < 0) { - return _candidate; + return candidate; } excludeArgument[index] = false; } if (originalCandidate.typeParameters) { - var instantiatedCandidate = _candidate; + var instantiatedCandidate = candidate; if (typeArgumentsAreValid) { candidateForArgumentError = instantiatedCandidate; } else { candidateForTypeArgumentError = originalCandidate; if (!typeArguments) { - resultOfFailedInference = inferenceResult; + resultOfFailedInference = inferenceContext; } } } else { - ts.Debug.assert(originalCandidate === _candidate); + ts.Debug.assert(originalCandidate === candidate); candidateForArgumentError = originalCandidate; } } @@ -13643,7 +14530,7 @@ var ts; } } function resolveCallExpression(node, candidatesOutArray) { - if (node.expression.kind === 90) { + if (node.expression.kind === 91) { var superType = checkSuperExpression(node.expression); if (superType !== unknownType) { return resolveCall(node, getSignaturesOfType(superType, 1), candidatesOutArray); @@ -13727,13 +14614,13 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - if (node.kind === 155) { + if (node.kind === 157) { links.resolvedSignature = resolveCallExpression(node, candidatesOutArray); } - else if (node.kind === 156) { + else if (node.kind === 158) { links.resolvedSignature = resolveNewExpression(node, candidatesOutArray); } - else if (node.kind === 157) { + else if (node.kind === 159) { links.resolvedSignature = resolveTaggedTemplateExpression(node, candidatesOutArray); } else { @@ -13745,15 +14632,15 @@ var ts; function checkCallExpression(node) { checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node, node.arguments); var signature = getResolvedSignature(node); - if (node.expression.kind === 90) { + if (node.expression.kind === 91) { return voidType; } - if (node.kind === 156) { + if (node.kind === 158) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 133 && - declaration.kind !== 137 && - declaration.kind !== 141) { + declaration.kind !== 135 && + declaration.kind !== 139 && + declaration.kind !== 143) { if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } @@ -13767,7 +14654,7 @@ var ts; } function checkTypeAssertion(node) { var exprType = checkExpression(node.expression); - var targetType = getTypeFromTypeNode(node.type); + var targetType = getTypeFromTypeNodeOrHeritageClauseElement(node.type); if (produceDiagnostics && targetType !== unknownType) { var widenedType = getWidenedType(exprType); if (!(isTypeAssignableTo(targetType, widenedType))) { @@ -13794,9 +14681,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 _links = getSymbolLinks(_parameter); - _links.type = instantiateType(getTypeOfSymbol(context.parameters[context.parameters.length - 1]), mapper); + var parameter = signature.parameters[signature.parameters.length - 1]; + var links = getSymbolLinks(parameter); + links.type = instantiateType(getTypeOfSymbol(context.parameters[context.parameters.length - 1]), mapper); } } function getReturnTypeFromBody(func, contextualMapper) { @@ -13805,7 +14692,7 @@ var ts; return unknownType; } var type; - if (func.body.kind !== 174) { + if (func.body.kind !== 179) { type = checkExpressionCached(func.body, contextualMapper); } else { @@ -13843,7 +14730,7 @@ var ts; }); } function bodyContainsSingleThrowStatement(body) { - return (body.statements.length === 1) && (body.statements[0].kind === 190); + return (body.statements.length === 1) && (body.statements[0].kind === 195); } function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func, returnType) { if (!produceDiagnostics) { @@ -13852,7 +14739,7 @@ var ts; if (returnType === voidType || returnType === anyType) { return; } - if (ts.nodeIsMissing(func.body) || func.body.kind !== 174) { + if (ts.nodeIsMissing(func.body) || func.body.kind !== 179) { return; } var bodyBlock = func.body; @@ -13865,9 +14752,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 !== 132 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 160) { + if (!hasGrammarError && node.kind === 162) { checkGrammarFunctionName(node.name) || checkGrammarForGenerator(node); } if (contextualMapper === identityMapper && isContextSensitive(node)) { @@ -13895,25 +14782,25 @@ var ts; checkSignatureDeclaration(node); } } - if (produceDiagnostics && node.kind !== 132 && node.kind !== 131) { + if (produceDiagnostics && node.kind !== 134 && node.kind !== 133) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); } return type; } function checkFunctionExpressionOrObjectLiteralMethodBody(node) { - ts.Debug.assert(node.kind !== 132 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); if (node.type) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); + checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type)); } if (node.body) { - if (node.body.kind === 174) { + if (node.body.kind === 179) { checkSourceElement(node.body); } else { var exprType = checkExpression(node.body); if (node.type) { - checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, undefined); + checkTypeAssignableTo(exprType, getTypeFromTypeNodeOrHeritageClauseElement(node.type), node.body, undefined); } checkFunctionExpressionBodies(node.body); } @@ -13933,17 +14820,17 @@ var ts; } function isReferenceOrErrorExpression(n) { switch (n.kind) { - case 64: { + case 65: { var symbol = findSymbol(n); return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3) !== 0; } - case 153: { - var _symbol = findSymbol(n); - return !_symbol || _symbol === unknownSymbol || (_symbol.flags & ~8) !== 0; + case 155: { + var symbol = findSymbol(n); + return !symbol || symbol === unknownSymbol || (symbol.flags & ~8) !== 0; } - case 154: + case 156: return true; - case 159: + case 161: return isReferenceOrErrorExpression(n.expression); default: return false; @@ -13951,22 +14838,22 @@ var ts; } function isConstVariableReference(n) { switch (n.kind) { - case 64: - case 153: { + case 65: + case 155: { var symbol = findSymbol(n); return symbol && (symbol.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 8192) !== 0; } - case 154: { + case 156: { var index = n.argumentExpression; - var _symbol = findSymbol(n.expression); - if (_symbol && index && index.kind === 8) { - var _name = index.text; - var prop = getPropertyOfType(getTypeOfSymbol(_symbol), _name); + var symbol = findSymbol(n.expression); + if (symbol && index && index.kind === 8) { + var name_7 = index.text; + var prop = getPropertyOfType(getTypeOfSymbol(symbol), name_7); return prop && (prop.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(prop) & 8192) !== 0; } return false; } - case 159: + case 161: return isConstVariableReference(n.expression); default: return false; @@ -13983,7 +14870,7 @@ var ts; return true; } function checkDeleteExpression(node) { - if (node.parserContextFlags & 1 && node.expression.kind === 64) { + if (node.parserContextFlags & 1 && node.expression.kind === 65) { grammarErrorOnNode(node.expression, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode); } var operandType = checkExpression(node.expression); @@ -14037,7 +14924,7 @@ var ts; } if (type.flags & 16384) { var types = type.types; - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var current = types[_i]; if (current.flags & kind) { return true; @@ -14053,7 +14940,7 @@ var ts; } if (type.flags & 16384) { var types = type.types; - for (var _i = 0, _n = types.length; _i < _n; _i++) { + for (var _i = 0; _i < types.length; _i++) { var current = types[_i]; if (!(current.flags & kind)) { return false; @@ -14089,19 +14976,19 @@ var ts; } function checkObjectLiteralAssignment(node, sourceType, contextualMapper) { var properties = node.properties; - for (var _i = 0, _n = properties.length; _i < _n; _i++) { + for (var _i = 0; _i < properties.length; _i++) { var p = properties[_i]; - if (p.kind === 218 || p.kind === 219) { - var _name = p.name; + if (p.kind === 224 || p.kind === 225) { + var name_8 = p.name; var type = sourceType.flags & 1 ? sourceType : - getTypeOfPropertyOfType(sourceType, _name.text) || - isNumericLiteralName(_name.text) && getIndexTypeOfType(sourceType, 1) || + getTypeOfPropertyOfType(sourceType, name_8.text) || + isNumericLiteralName(name_8.text) && getIndexTypeOfType(sourceType, 1) || getIndexTypeOfType(sourceType, 0); if (type) { - checkDestructuringAssignment(p.initializer || _name, type); + checkDestructuringAssignment(p.initializer || name_8, type); } else { - error(_name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(sourceType), ts.declarationNameToString(_name)); + error(name_8, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(sourceType), ts.declarationNameToString(name_8)); } } else { @@ -14118,8 +15005,8 @@ var ts; var elements = node.elements; for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 172) { - if (e.kind !== 171) { + if (e.kind !== 175) { + if (e.kind !== 173) { var propName = "" + i; var type = sourceType.flags & 1 ? sourceType : isTupleLikeType(sourceType) ? getTypeOfPropertyOfType(sourceType, propName) : @@ -14149,14 +15036,14 @@ var ts; return sourceType; } function checkDestructuringAssignment(target, sourceType, contextualMapper) { - if (target.kind === 167 && target.operatorToken.kind === 52) { + if (target.kind === 169 && target.operatorToken.kind === 53) { checkBinaryExpression(target, contextualMapper); target = target.left; } - if (target.kind === 152) { + if (target.kind === 154) { return checkObjectLiteralAssignment(target, sourceType, contextualMapper); } - if (target.kind === 151) { + if (target.kind === 153) { return checkArrayLiteralAssignment(target, sourceType, contextualMapper); } return checkReferenceAssignment(target, sourceType, contextualMapper); @@ -14173,32 +15060,32 @@ var ts; checkGrammarEvalOrArgumentsInStrictMode(node, node.left); } var operator = node.operatorToken.kind; - if (operator === 52 && (node.left.kind === 152 || node.left.kind === 151)) { + if (operator === 53 && (node.left.kind === 154 || node.left.kind === 153)) { return checkDestructuringAssignment(node.left, checkExpression(node.right, contextualMapper), contextualMapper); } var leftType = checkExpression(node.left, contextualMapper); var rightType = checkExpression(node.right, contextualMapper); switch (operator) { case 35: - case 55: - case 36: case 56: - case 37: + case 36: case 57: - case 34: - case 54: - case 40: + case 37: case 58: - case 41: + case 34: + case 55: + case 40: case 59: - case 42: + case 41: case 60: - case 44: - case 62: - case 45: - case 63: - case 43: + case 42: case 61: + case 44: + case 63: + case 45: + case 64: + case 43: + case 62: if (leftType.flags & (32 | 64)) leftType = rightType; if (rightType.flags & (32 | 64)) @@ -14218,7 +15105,7 @@ var ts; } return numberType; case 33: - case 53: + case 54: if (leftType.flags & (32 | 64)) leftType = rightType; if (rightType.flags & (32 | 64)) @@ -14242,7 +15129,7 @@ var ts; reportOperatorError(); return anyType; } - if (operator === 53) { + if (operator === 54) { checkAssignmentOperator(resultType); } return resultType; @@ -14261,15 +15148,15 @@ var ts; reportOperatorError(); } return booleanType; - case 86: + case 87: return checkInstanceOfExpression(node, leftType, rightType); - case 85: + case 86: return checkInExpression(node, leftType, rightType); case 48: return rightType; case 49: return getUnionType([leftType, rightType]); - case 52: + case 53: checkAssignmentOperator(rightType); return rightType; case 23: @@ -14288,20 +15175,20 @@ var ts; function getSuggestedBooleanOperator(operator) { switch (operator) { case 44: - case 62: + case 63: return 49; case 45: - case 63: + case 64: return 31; case 43: - case 61: + case 62: return 48; default: return undefined; } } function checkAssignmentOperator(valueType) { - if (produceDiagnostics && operator >= 52 && operator <= 63) { + if (produceDiagnostics && operator >= 53 && operator <= 64) { var ok = checkReferenceExpression(node.left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression, ts.Diagnostics.Left_hand_side_of_assignment_expression_cannot_be_a_constant); if (ok) { checkTypeAssignableTo(valueType, leftType, node.left, undefined); @@ -14347,14 +15234,14 @@ var ts; return links.resolvedType; } function checkPropertyAssignment(node, contextualMapper) { - if (node.name.kind === 126) { + if (node.name.kind === 127) { checkComputedPropertyName(node.name); } return checkExpression(node.initializer, contextualMapper); } function checkObjectLiteralMethod(node, contextualMapper) { checkGrammarMethod(node); - if (node.name.kind === 126) { + if (node.name.kind === 127) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); @@ -14380,7 +15267,7 @@ var ts; } function checkExpressionOrQualifiedName(node, contextualMapper) { var type; - if (node.kind == 125) { + if (node.kind == 126) { type = checkQualifiedName(node); } else { @@ -14388,9 +15275,9 @@ var ts; type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); } if (isConstEnumObjectType(type)) { - var ok = (node.parent.kind === 153 && node.parent.expression === node) || - (node.parent.kind === 154 && node.parent.expression === node) || - ((node.kind === 64 || node.kind === 125) && isInRightSideOfImportOrExportAssignment(node)); + 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)); 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); } @@ -14403,65 +15290,67 @@ var ts; } function checkExpressionWorker(node, contextualMapper) { switch (node.kind) { - case 64: + case 65: return checkIdentifier(node); - case 92: + case 93: return checkThisExpression(node); - case 90: + case 91: return checkSuperExpression(node); - case 88: + case 89: return nullType; - case 94: - case 79: + case 95: + case 80: return booleanType; case 7: return checkNumericLiteral(node); - case 169: + case 171: return checkTemplateExpression(node); case 8: case 10: return stringType; case 9: return globalRegExpType; - case 151: - return checkArrayLiteral(node, contextualMapper); - case 152: - return checkObjectLiteral(node, contextualMapper); case 153: - return checkPropertyAccessExpression(node); + return checkArrayLiteral(node, contextualMapper); case 154: - return checkIndexedAccess(node); + return checkObjectLiteral(node, contextualMapper); case 155: + return checkPropertyAccessExpression(node); case 156: - return checkCallExpression(node); + return checkIndexedAccess(node); case 157: - return checkTaggedTemplateExpression(node); case 158: - return checkTypeAssertion(node); + return checkCallExpression(node); case 159: - return checkExpression(node.expression, contextualMapper); + return checkTaggedTemplateExpression(node); case 160: + return checkTypeAssertion(node); case 161: - return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - case 163: - return checkTypeOfExpression(node); + return checkExpression(node.expression, contextualMapper); + case 174: + return checkClassExpression(node); case 162: - return checkDeleteExpression(node); - case 164: - return checkVoidExpression(node); + case 163: + return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); case 165: - return checkPrefixUnaryExpression(node); + return checkTypeOfExpression(node); + case 164: + return checkDeleteExpression(node); case 166: - return checkPostfixUnaryExpression(node); + return checkVoidExpression(node); case 167: - return checkBinaryExpression(node, contextualMapper); + return checkPrefixUnaryExpression(node); case 168: - return checkConditionalExpression(node, contextualMapper); - case 171: - return checkSpreadElementExpression(node, contextualMapper); - case 172: - return undefinedType; + return checkPostfixUnaryExpression(node); + case 169: + return checkBinaryExpression(node, contextualMapper); case 170: + return checkConditionalExpression(node, contextualMapper); + case 173: + return checkSpreadElementExpression(node, contextualMapper); + case 175: + return undefinedType; + case 172: checkYieldExpression(node); return unknownType; } @@ -14478,12 +15367,18 @@ var ts; } } function checkParameter(node) { - checkGrammarModifiers(node) || checkGrammarEvalOrArgumentsInStrictMode(node, node.name); + // Grammar checking + // It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs as the + // Identifier in a PropertySetParameterList of a PropertyAssignment that is contained in strict code + // or if its FunctionBody is strict code(11.1.5). + // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a + // strict mode FunctionLikeDeclaration or FunctionExpression(13.1) + checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarEvalOrArgumentsInStrictMode(node, node.name); checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (node.flags & 112) { func = ts.getContainingFunction(node); - if (!(func.kind === 133 && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 135 && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -14497,12 +15392,12 @@ var ts; } } function checkSignatureDeclaration(node) { - if (node.kind === 138) { + if (node.kind === 140) { checkGrammarIndexSignature(node); } - else if (node.kind === 140 || node.kind === 195 || node.kind === 141 || - node.kind === 136 || node.kind === 133 || - node.kind === 137) { + else if (node.kind === 142 || node.kind === 200 || node.kind === 143 || + node.kind === 138 || node.kind === 135 || + node.kind === 139) { checkGrammarFunctionLikeDeclaration(node); } checkTypeParameters(node.typeParameters); @@ -14514,10 +15409,10 @@ var ts; checkCollisionWithArgumentsInGeneratedCode(node); if (compilerOptions.noImplicitAny && !node.type) { switch (node.kind) { - case 137: + case 139: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 136: + case 138: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -14526,7 +15421,7 @@ var ts; checkSpecializedSignatureDeclaration(node); } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 197) { + if (node.kind === 202) { var nodeSymbol = getSymbolOfNode(node); if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -14536,12 +15431,12 @@ var ts; if (indexSymbol) { var seenNumericIndexer = false; var seenStringIndexer = false; - for (var _i = 0, _a = indexSymbol.declarations, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 120: + case 121: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -14549,7 +15444,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 118: + case 119: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -14563,7 +15458,7 @@ var ts; } } function checkPropertyDeclaration(node) { - checkGrammarModifiers(node) || checkGrammarProperty(node) || checkGrammarComputedPropertyName(node.name); + checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarProperty(node) || checkGrammarComputedPropertyName(node.name); checkVariableLikeDeclaration(node); } function checkMethodDeclaration(node) { @@ -14586,40 +15481,40 @@ var ts; return; } function isSuperCallExpression(n) { - return n.kind === 155 && n.expression.kind === 90; + return n.kind === 157 && n.expression.kind === 91; } function containsSuperCall(n) { if (isSuperCallExpression(n)) { return true; } switch (n.kind) { - case 160: - case 195: - case 161: - case 152: return false; + case 162: + case 200: + case 163: + case 154: return false; default: return ts.forEachChild(n, containsSuperCall); } } function markThisReferencesAsErrors(n) { - if (n.kind === 92) { + if (n.kind === 93) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 160 && n.kind !== 195) { + else if (n.kind !== 162 && n.kind !== 200) { ts.forEachChild(n, markThisReferencesAsErrors); } } function isInstancePropertyWithInitializer(n) { - return n.kind === 130 && + return n.kind === 132 && !(n.flags & 128) && !!n.initializer; } - if (ts.getClassBaseTypeNode(node.parent)) { + if (ts.getClassExtendsHeritageClauseElement(node.parent)) { if (containsSuperCall(node.body)) { var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || 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 !== 177 || !isSuperCallExpression(statements[0].expression)) { + if (!statements.length || statements[0].kind !== 182 || !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 { @@ -14635,13 +15530,13 @@ var ts; function checkAccessorDeclaration(node) { if (produceDiagnostics) { checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name); - if (node.kind === 134) { + if (node.kind === 136) { 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 === 134 ? 135 : 134; + var otherKind = node.kind === 136 ? 137 : 136; var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { if (((node.flags & 112) !== (otherAccessor.flags & 112))) { @@ -14660,9 +15555,18 @@ var ts; } checkFunctionLikeDeclaration(node); } - function checkTypeReference(node) { + function checkMissingDeclaration(node) { + checkDecorators(node); + } + function checkTypeReferenceNode(node) { + return checkTypeReferenceOrHeritageClauseElement(node); + } + function checkHeritageClauseElement(node) { + return checkTypeReferenceOrHeritageClauseElement(node); + } + function checkTypeReferenceOrHeritageClauseElement(node) { checkGrammarTypeArguments(node, node.typeArguments); - var type = getTypeFromTypeReferenceNode(node); + var type = getTypeFromTypeReferenceOrHeritageClauseElement(node); if (type !== unknownType && node.typeArguments) { var len = node.typeArguments.length; for (var i = 0; i < len; i++) { @@ -14715,9 +15619,9 @@ var ts; return; } var signaturesToCheck; - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 197) { - ts.Debug.assert(signatureDeclarationNode.kind === 136 || signatureDeclarationNode.kind === 137); - var signatureKind = signatureDeclarationNode.kind === 136 ? 0 : 1; + 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; var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); var containingType = getDeclaredTypeOfSymbol(containingSymbol); signaturesToCheck = getSignaturesOfType(containingType, signatureKind); @@ -14725,7 +15629,7 @@ var ts; else { signaturesToCheck = getSignaturesOfSymbol(getSymbolOfNode(signatureDeclarationNode)); } - for (var _i = 0, _n = signaturesToCheck.length; _i < _n; _i++) { + for (var _i = 0; _i < signaturesToCheck.length; _i++) { var otherSignature = signaturesToCheck[_i]; if (!otherSignature.hasStringLiterals && isSignatureAssignableTo(signature, otherSignature)) { return; @@ -14735,7 +15639,7 @@ var ts; } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = ts.getCombinedNodeFlags(n); - if (n.parent.kind !== 197 && ts.isInAmbientContext(n)) { + if (n.parent.kind !== 202 && ts.isInAmbientContext(n)) { if (!(flags & 2)) { flags |= 1; } @@ -14792,7 +15696,7 @@ var ts; var declarations = symbol.declarations; var isConstructor = (symbol.flags & 16384) !== 0; function reportImplementationExpectedError(node) { - if (node.name && ts.getFullWidth(node.name) === 0) { + if (node.name && ts.nodeIsMissing(node.name)) { return; } var seen = false; @@ -14806,16 +15710,16 @@ var ts; }); if (subsequentNode) { if (subsequentNode.kind === node.kind) { - var _errorNode = subsequentNode.name || subsequentNode; + var errorNode_1 = subsequentNode.name || subsequentNode; if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - ts.Debug.assert(node.kind === 132 || node.kind === 131); + ts.Debug.assert(node.kind === 134 || node.kind === 133); 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, diagnostic); + error(errorNode_1, diagnostic); return; } else if (ts.nodeIsPresent(subsequentNode.body)) { - error(_errorNode, ts.Diagnostics.Function_implementation_name_must_be_0, ts.declarationNameToString(node.name)); + error(errorNode_1, ts.Diagnostics.Function_implementation_name_must_be_0, ts.declarationNameToString(node.name)); return; } } @@ -14831,15 +15735,15 @@ var ts; var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & 1536; var duplicateFunctionDeclaration = false; var multipleConstructorImplementation = false; - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + for (var _i = 0; _i < declarations.length; _i++) { var current = declarations[_i]; var node = current; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 197 || node.parent.kind === 143 || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 202 || node.parent.kind === 145 || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = undefined; } - if (node.kind === 195 || node.kind === 132 || node.kind === 131 || node.kind === 133) { + if (node.kind === 200 || node.kind === 134 || node.kind === 133 || node.kind === 135) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -14890,7 +15794,7 @@ var ts; var signatures = getSignaturesOfSymbol(symbol); var bodySignature = getSignatureFromDeclaration(bodyDeclaration); if (!bodySignature.hasStringLiterals) { - for (var _a = 0, _b = signatures.length; _a < _b; _a++) { + for (var _a = 0; _a < signatures.length; _a++) { var signature = signatures[_a]; if (!signature.hasStringLiterals && !isSignatureAssignableTo(bodySignature, signature)) { error(signature.declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation); @@ -14936,16 +15840,16 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 197: + case 202: return 2097152; - case 200: + case 205: return d.name.kind === 8 || ts.getModuleInstanceState(d) !== 0 ? 4194304 | 1048576 : 4194304; - case 196: - case 199: + case 201: + case 204: return 2097152 | 1048576; - case 203: + case 208: var result = 0; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result |= getDeclarationSpaces(d); }); @@ -14955,6 +15859,49 @@ var ts; } } } + function checkDecorator(node) { + var expression = node.expression; + var exprType = checkExpression(expression); + switch (node.parent.kind) { + case 201: + var classSymbol = getSymbolOfNode(node.parent); + var classConstructorType = getTypeOfSymbol(classSymbol); + var classDecoratorType = instantiateSingleCallFunctionType(globalClassDecoratorType, [classConstructorType]); + checkTypeAssignableTo(exprType, classDecoratorType, node); + break; + case 132: + checkTypeAssignableTo(exprType, globalPropertyDecoratorType, node); + break; + case 134: + case 136: + case 137: + var methodType = getTypeOfNode(node.parent); + var methodDecoratorType = instantiateSingleCallFunctionType(globalMethodDecoratorType, [methodType]); + checkTypeAssignableTo(exprType, methodDecoratorType, node); + break; + case 129: + checkTypeAssignableTo(exprType, globalParameterDecoratorType, node); + break; + } + } + function checkDecorators(node) { + if (!node.decorators) { + return; + } + switch (node.kind) { + case 201: + case 134: + case 136: + case 137: + case 132: + case 129: + emitDecorate = true; + break; + default: + return; + } + ts.forEach(node.decorators, checkDecorator); + } function checkFunctionDeclaration(node) { if (produceDiagnostics) { checkFunctionLikeDeclaration(node) || @@ -14967,8 +15914,9 @@ var ts; } } function checkFunctionLikeDeclaration(node) { + checkDecorators(node); checkSignatureDeclaration(node); - if (node.name && node.name.kind === 126) { + if (node.name && node.name.kind === 127) { checkComputedPropertyName(node.name); } if (!ts.hasDynamicName(node)) { @@ -14986,18 +15934,18 @@ var ts; } checkSourceElement(node.body); if (node.type && !isAccessor(node.kind)) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); + checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type)); } if (compilerOptions.noImplicitAny && ts.nodeIsMissing(node.body) && !node.type && !isPrivateWithinAmbient(node)) { reportImplicitAnyError(node, anyType); } } function checkBlock(node) { - if (node.kind === 174) { + if (node.kind === 179) { checkGrammarStatementInAmbientContext(node); } ts.forEach(node.statements, checkSourceElement); - if (ts.isFunctionBlock(node) || node.kind === 201) { + if (ts.isFunctionBlock(node) || node.kind === 206) { checkFunctionExpressionBodies(node); } } @@ -15015,19 +15963,19 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 130 || - node.kind === 129 || - node.kind === 132 || + if (node.kind === 132 || node.kind === 131 || node.kind === 134 || - node.kind === 135) { + node.kind === 133 || + node.kind === 136 || + node.kind === 137) { return false; } if (ts.isInAmbientContext(node)) { return false; } var root = getRootDeclaration(node); - if (root.kind === 128 && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 129 && ts.nodeIsMissing(root.parent.body)) { return false; } return true; @@ -15041,8 +15989,8 @@ var ts; var current = node; while (current) { if (getNodeCheckFlags(current) & 4) { - var _isDeclaration = node.kind !== 64; - if (_isDeclaration) { + var isDeclaration_1 = node.kind !== 65; + if (isDeclaration_1) { error(node.name, ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference); } else { @@ -15057,13 +16005,13 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "_super")) { return; } - var enclosingClass = ts.getAncestor(node, 196); + var enclosingClass = ts.getAncestor(node, 201); if (!enclosingClass || ts.isInAmbientContext(enclosingClass)) { return; } - if (ts.getClassBaseTypeNode(enclosingClass)) { - var _isDeclaration = node.kind !== 64; - if (_isDeclaration) { + if (ts.getClassExtendsHeritageClauseElement(enclosingClass)) { + var isDeclaration_2 = node.kind !== 65; + if (isDeclaration_2) { error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); } else { @@ -15075,56 +16023,65 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { return; } - if (node.kind === 200 && ts.getModuleInstanceState(node) !== 1) { + if (node.kind === 205 && ts.getModuleInstanceState(node) !== 1) { return; } - var _parent = getDeclarationContainer(node); - if (_parent.kind === 221 && ts.isExternalModule(_parent)) { + 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)); } } function checkVarDeclaredNamesNotShadowed(node) { - if (node.initializer && (ts.getCombinedNodeFlags(node) & 12288) === 0) { - var symbol = getSymbolOfNode(node); - if (symbol.flags & 1) { - var localDeclarationSymbol = resolveName(node, node.name.text, 3, undefined, undefined); - if (localDeclarationSymbol && - localDeclarationSymbol !== symbol && - localDeclarationSymbol.flags & 2) { - if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 12288) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 194); - var container = varDeclList.parent.kind === 175 && - varDeclList.parent.parent; - var namesShareScope = container && - (container.kind === 174 && ts.isFunctionLike(container.parent) || - (container.kind === 201 && container.kind === 200) || - container.kind === 221); - if (!namesShareScope) { - var _name = symbolToString(localDeclarationSymbol); - error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, _name, _name); - } + // - ScriptBody : StatementList + // It is a Syntax Error if any element of the LexicallyDeclaredNames of StatementList + // also occurs in the VarDeclaredNames of StatementList. + if ((ts.getCombinedNodeFlags(node) & 12288) !== 0 || isParameterDeclaration(node)) { + return; + } + if (node.kind === 198 && !node.initializer) { + return; + } + var symbol = getSymbolOfNode(node); + if (symbol.flags & 1) { + var localDeclarationSymbol = resolveName(node, node.name.text, 3, undefined, undefined); + if (localDeclarationSymbol && + 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 + ? varDeclList.parent.parent + : undefined; + var namesShareScope = container && + (container.kind === 179 && ts.isFunctionLike(container.parent) || + container.kind === 206 || + container.kind === 205 || + container.kind === 227); + 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); } } } } } function isParameterDeclaration(node) { - while (node.kind === 150) { + while (node.kind === 152) { node = node.parent.parent; } - return node.kind === 128; + return node.kind === 129; } function checkParameterInitializer(node) { - if (getRootDeclaration(node).kind !== 128) { + if (getRootDeclaration(node).kind !== 129) { return; } var func = ts.getContainingFunction(node); visit(node.initializer); function visit(n) { - if (n.kind === 64) { + if (n.kind === 65) { var referencedSymbol = getNodeLinks(n).resolvedSymbol; if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(func.locals, referencedSymbol.name, 107455) === referencedSymbol) { - if (referencedSymbol.valueDeclaration.kind === 128) { + if (referencedSymbol.valueDeclaration.kind === 129) { if (referencedSymbol.valueDeclaration === node) { error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.declarationNameToString(node.name)); return; @@ -15142,8 +16099,9 @@ var ts; } } function checkVariableLikeDeclaration(node) { + checkDecorators(node); checkSourceElement(node.type); - if (node.name.kind === 126) { + if (node.name.kind === 127) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); @@ -15152,7 +16110,7 @@ var ts; if (ts.isBindingPattern(node.name)) { ts.forEach(node.name.elements, checkSourceElement); } - if (node.initializer && getRootDeclaration(node).kind === 128 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && getRootDeclaration(node).kind === 129 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } @@ -15180,9 +16138,9 @@ var ts; checkTypeAssignableTo(checkExpressionCached(node.initializer), declarationType, node, undefined); } } - if (node.kind !== 130 && node.kind !== 129) { + if (node.kind !== 132 && node.kind !== 131) { checkExportsOnMergedDeclarations(node); - if (node.kind === 193 || node.kind === 150) { + if (node.kind === 198 || node.kind === 152) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); @@ -15199,7 +16157,7 @@ var ts; return checkVariableLikeDeclaration(node); } function checkVariableStatement(node) { - checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || checkGrammarModifiers(node) || checkGrammarVariableDeclarationList(node.declarationList) || checkGrammarForDisallowedLetOrConstStatement(node); + checkGrammarDecorators(node) || checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || checkGrammarModifiers(node) || checkGrammarVariableDeclarationList(node.declarationList) || checkGrammarForDisallowedLetOrConstStatement(node); ts.forEach(node.declarationList.declarations, checkSourceElement); } function checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) { @@ -15211,7 +16169,7 @@ var ts; } function inBlockOrObjectLiteralExpression(node) { while (node) { - if (node.kind === 174 || node.kind === 152) { + if (node.kind === 179 || node.kind === 154) { return true; } node = node.parent; @@ -15239,12 +16197,12 @@ var ts; } function checkForStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind == 194) { + if (node.initializer && node.initializer.kind == 199) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 194) { + if (node.initializer.kind === 199) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -15259,13 +16217,13 @@ var ts; } function checkForOfStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.initializer.kind === 194) { + if (node.initializer.kind === 199) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression); - if (varExpr.kind === 151 || varExpr.kind === 152) { + if (varExpr.kind === 153 || varExpr.kind === 154) { checkDestructuringAssignment(varExpr, iteratedType || unknownType); } else { @@ -15280,7 +16238,7 @@ var ts; } function checkForInStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.initializer.kind === 194) { + if (node.initializer.kind === 199) { 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); @@ -15290,7 +16248,7 @@ var ts; else { var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 151 || varExpr.kind === 152) { + if (varExpr.kind === 153 || varExpr.kind === 154) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!allConstituentTypesHaveKind(leftType, 1 | 258)) { @@ -15330,6 +16288,31 @@ var ts; } return iteratedType; function getIteratedType(iterable, expressionForError) { + // We want to treat type as an iterable, and get the type it is an iterable of. The iterable + // must have the following structure (annotated with the names of the variables below): + // + // { // iterable + // [Symbol.iterator]: { // iteratorFunction + // (): { // iterator + // next: { // iteratorNextFunction + // (): { // iteratorNextResult + // value: T // iteratorNextValue + // } + // } + // } + // } + // } + // + // T is the type we are after. At every level that involves analyzing return types + // of signatures, we union the return types of all the signatures. + // + // Another thing to note is that at any step of this process, we could run into a dead end, + // meaning either the property is missing, or we run into the anyType. If either of these things + // happens, we return undefined to signal that we could not find the iterated type. If a property + // is missing, and the previous step did not result in 'any', then we also give an error if the + // caller requested it. Then the caller can decide what to do in the case where there is no iterated + // type. This is different from returning anyType, because that would signify that we have matched the + // whole pattern and that T (above) is 'any'. if (allConstituentTypesHaveKind(iterable, 1)) { return undefined; } @@ -15409,7 +16392,7 @@ var ts; checkGrammarStatementInAmbientContext(node) || checkGrammarBreakOrContinueStatement(node); } function isGetAccessorWithAnnotatatedSetAccessor(node) { - return !!(node.kind === 134 && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 135))); + return !!(node.kind === 136 && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 137))); } function checkReturnStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { @@ -15423,11 +16406,11 @@ var ts; if (func) { var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func)); var exprType = checkExpressionCached(node.expression); - if (func.kind === 135) { + if (func.kind === 137) { error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); } else { - if (func.kind === 133) { + if (func.kind === 135) { if (!isTypeAssignableTo(exprType, returnType)) { error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -15454,7 +16437,7 @@ var ts; var hasDuplicateDefaultClause = false; var expressionType = checkExpression(node.expression); ts.forEach(node.caseBlock.clauses, function (clause) { - if (clause.kind === 215 && !hasDuplicateDefaultClause) { + if (clause.kind === 221 && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -15466,7 +16449,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 214) { + if (produceDiagnostics && clause.kind === 220) { var caseClause = clause; var caseType = checkExpression(caseClause.expression); if (!isTypeAssignableTo(expressionType, caseType)) { @@ -15483,7 +16466,7 @@ var ts; if (ts.isFunctionLike(current)) { break; } - if (current.kind === 189 && current.label.text === node.label.text) { + if (current.kind === 194 && 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; @@ -15509,7 +16492,7 @@ var ts; var catchClause = node.catchClause; if (catchClause) { if (catchClause.variableDeclaration) { - if (catchClause.variableDeclaration.name.kind !== 64) { + if (catchClause.variableDeclaration.name.kind !== 65) { grammarErrorOnFirstToken(catchClause.variableDeclaration.name, ts.Diagnostics.Catch_clause_variable_name_must_be_an_identifier); } else if (catchClause.variableDeclaration.type) { @@ -15547,9 +16530,9 @@ var ts; checkIndexConstraintForProperty(prop, propType, type, declaredStringIndexer, stringIndexType, 0); checkIndexConstraintForProperty(prop, propType, type, declaredNumberIndexer, numberIndexType, 1); }); - if (type.flags & 1024 && type.symbol.valueDeclaration.kind === 196) { + if (type.flags & 1024 && type.symbol.valueDeclaration.kind === 201) { var classDeclaration = type.symbol.valueDeclaration; - for (var _i = 0, _a = classDeclaration.members, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = classDeclaration.members; _i < _a.length; _i++) { var member = _a[_i]; if (!(member.flags & 128) && ts.hasDynamicName(member)) { var propType = getTypeOfSymbol(member.symbol); @@ -15577,22 +16560,22 @@ var ts; if (indexKind === 1 && !isNumericName(prop.valueDeclaration.name)) { return; } - var _errorNode; - if (prop.valueDeclaration.name.kind === 126 || prop.parent === containingType.symbol) { - _errorNode = prop.valueDeclaration; + var errorNode; + if (prop.valueDeclaration.name.kind === 127 || prop.parent === containingType.symbol) { + errorNode = prop.valueDeclaration; } else if (indexDeclaration) { - _errorNode = indexDeclaration; + errorNode = indexDeclaration; } else if (containingType.flags & 2048) { var someBaseClassHasBothPropertyAndIndexer = ts.forEach(containingType.baseTypes, function (base) { return getPropertyOfObjectType(base, prop.name) && getIndexTypeOfType(base, indexKind); }); - _errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : containingType.symbol.declarations[0]; + errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : containingType.symbol.declarations[0]; } - if (_errorNode && !isTypeAssignableTo(propertyType, indexType)) { + if (errorNode && !isTypeAssignableTo(propertyType, indexType)) { var errorMessage = indexKind === 0 ? ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_string_index_type_2 : ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2; - error(_errorNode, errorMessage, symbolToString(prop), typeToString(propertyType), typeToString(indexType)); + error(errorNode, errorMessage, symbolToString(prop), typeToString(propertyType), typeToString(indexType)); } } } @@ -15622,8 +16605,17 @@ var ts; } } } + function checkClassExpression(node) { + grammarErrorOnNode(node, ts.Diagnostics.class_expressions_are_not_currently_supported); + ts.forEach(node.members, checkSourceElement); + return unknownType; + } function checkClassDeclaration(node) { + if (node.parent.kind !== 206 && node.parent.kind !== 227) { + grammarErrorOnNode(node, ts.Diagnostics.class_declarations_are_only_supported_directly_inside_a_module_or_as_a_top_level_declaration); + } checkGrammarClassDeclarationHeritageClauses(node); + checkDecorators(node); if (node.name) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Class_name_cannot_be_0); checkCollisionWithCapturedThisVariable(node, node.name); @@ -15634,10 +16626,13 @@ var ts; var symbol = getSymbolOfNode(node); var type = getDeclaredTypeOfSymbol(symbol); var staticType = getTypeOfSymbol(symbol); - var baseTypeNode = ts.getClassBaseTypeNode(node); + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { + if (!ts.isSupportedHeritageClauseElement(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); - checkTypeReference(baseTypeNode); + checkHeritageClauseElement(baseTypeNode); } if (type.baseTypes.length) { if (produceDiagnostics) { @@ -15645,19 +16640,24 @@ var ts; checkTypeAssignableTo(type, baseType, node.name || node, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); var staticBaseType = getTypeOfSymbol(baseType.symbol); checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name || node, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); - if (baseType.symbol !== resolveEntityName(baseTypeNode.typeName, 107455)) { + if (baseType.symbol !== resolveEntityName(baseTypeNode.expression, 107455)) { error(baseTypeNode, ts.Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType)); } checkKindsOfPropertyMemberOverrides(type, baseType); } - checkExpressionOrQualifiedName(baseTypeNode.typeName); } - var implementedTypeNodes = ts.getClassImplementedTypeNodes(node); + if (type.baseTypes.length || (baseTypeNode && compilerOptions.separateCompilation)) { + checkExpressionOrQualifiedName(baseTypeNode.expression); + } + var implementedTypeNodes = ts.getClassImplementsHeritageClauseElements(node); if (implementedTypeNodes) { ts.forEach(implementedTypeNodes, function (typeRefNode) { - checkTypeReference(typeRefNode); + if (!ts.isSupportedHeritageClauseElement(typeRefNode)) { + error(typeRefNode.expression, ts.Diagnostics.A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments); + } + checkHeritageClauseElement(typeRefNode); if (produceDiagnostics) { - var t = getTypeFromTypeReferenceNode(typeRefNode); + var t = getTypeFromHeritageClauseElement(typeRefNode); if (t !== unknownType) { var declaredType = (t.flags & 4096) ? t.target : t; if (declaredType.flags & (1024 | 2048)) { @@ -15680,8 +16680,21 @@ var ts; return s.flags & 16777216 ? getSymbolLinks(s).target : s; } function checkKindsOfPropertyMemberOverrides(type, baseType) { + // TypeScript 1.0 spec (April 2014): 8.2.3 + // A derived class inherits all members from its base class it doesn't override. + // Inheritance means that a derived class implicitly contains all non - overridden members of the base class. + // Both public and private property members are inherited, but only public property members can be overridden. + // A property member in a derived class is said to override a property member in a base class + // when the derived class property member has the same name and kind(instance or static) + // as the base class property member. + // The type of an overriding property member must be assignable(section 3.8.4) + // to the type of the overridden property member, or otherwise a compile - time error occurs. + // Base class instance member functions can be overridden by derived class instance member functions, + // but not by other kinds of members. + // Base class instance member variables and accessors can be overridden by + // derived class instance member variables and accessors, but not by other kinds of members. var baseProperties = getPropertiesOfObjectType(baseType); - for (var _i = 0, _n = baseProperties.length; _i < _n; _i++) { + for (var _i = 0; _i < baseProperties.length; _i++) { var baseProperty = baseProperties[_i]; var base = getTargetSymbol(baseProperty); if (base.flags & 134217728) { @@ -15724,7 +16737,7 @@ var ts; } } function isAccessor(kind) { - return kind === 134 || kind === 135; + return kind === 136 || kind === 137; } function areTypeParametersIdentical(list1, list2) { if (!list1 && !list2) { @@ -15745,7 +16758,7 @@ var ts; if (!tp1.constraint || !tp2.constraint) { return false; } - if (!isTypeIdenticalTo(getTypeFromTypeNode(tp1.constraint), getTypeFromTypeNode(tp2.constraint))) { + if (!isTypeIdenticalTo(getTypeFromTypeNodeOrHeritageClauseElement(tp1.constraint), getTypeFromTypeNodeOrHeritageClauseElement(tp2.constraint))) { return false; } } @@ -15758,10 +16771,10 @@ var ts; var seen = {}; ts.forEach(type.declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; }); var ok = true; - for (var _i = 0, _a = type.baseTypes, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = type.baseTypes; _i < _a.length; _i++) { var base = _a[_i]; var properties = getPropertiesOfObjectType(base); - for (var _b = 0, _c = properties.length; _b < _c; _b++) { + for (var _b = 0; _b < properties.length; _b++) { var prop = properties[_b]; if (!ts.hasProperty(seen, prop.name)) { seen[prop.name] = { prop: prop, containingType: base }; @@ -15783,13 +16796,13 @@ var ts; return ok; } function checkInterfaceDeclaration(node) { - checkGrammarModifiers(node) || checkGrammarInterfaceDeclaration(node); + checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarInterfaceDeclaration(node); checkTypeParameters(node.typeParameters); if (produceDiagnostics) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 197); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 202); 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); @@ -15805,32 +16818,37 @@ var ts; } } } - ts.forEach(ts.getInterfaceBaseTypeNodes(node), checkTypeReference); + ts.forEach(ts.getInterfaceBaseTypeNodes(node), function (heritageElement) { + if (!ts.isSupportedHeritageClauseElement(heritageElement)) { + error(heritageElement.expression, ts.Diagnostics.An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments); + } + checkHeritageClauseElement(heritageElement); + }); ts.forEach(node.members, checkSourceElement); if (produceDiagnostics) { checkTypeForDuplicateIndexSignatures(node); } } function checkTypeAliasDeclaration(node) { - checkGrammarModifiers(node); + checkGrammarDecorators(node) || checkGrammarModifiers(node); checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_alias_name_cannot_be_0); checkSourceElement(node.type); } function computeEnumMemberValues(node) { - var _nodeLinks = getNodeLinks(node); - if (!(_nodeLinks.flags & 128)) { + var nodeLinks = getNodeLinks(node); + if (!(nodeLinks.flags & 128)) { var enumSymbol = getSymbolOfNode(node); var enumType = getDeclaredTypeOfSymbol(enumSymbol); var autoValue = 0; var ambient = ts.isInAmbientContext(node); var enumIsConst = ts.isConst(node); ts.forEach(node.members, function (member) { - if (member.name.kind !== 126 && isNumericLiteralName(member.name.text)) { + if (member.name.kind !== 127 && isNumericLiteralName(member.name.text)) { error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name); } var initializer = member.initializer; if (initializer) { - autoValue = getConstantValueForEnumMemberInitializer(initializer, enumIsConst); + autoValue = getConstantValueForEnumMemberInitializer(initializer); if (autoValue === undefined) { if (enumIsConst) { error(initializer, ts.Diagnostics.In_const_enum_declarations_member_initializer_must_be_constant_expression); @@ -15855,13 +16873,13 @@ var ts; getNodeLinks(member).enumMemberValue = autoValue++; } }); - _nodeLinks.flags |= 128; + nodeLinks.flags |= 128; } - function getConstantValueForEnumMemberInitializer(initializer, enumIsConst) { + function getConstantValueForEnumMemberInitializer(initializer) { return evalConstant(initializer); function evalConstant(e) { switch (e.kind) { - case 165: + case 167: var value = evalConstant(e.operand); if (value === undefined) { return undefined; @@ -15869,13 +16887,10 @@ var ts; switch (e.operator) { case 33: return value; case 34: return -value; - case 47: return enumIsConst ? ~value : undefined; + case 47: return ~value; } return undefined; - case 167: - if (!enumIsConst) { - return undefined; - } + case 169: var left = evalConstant(e.left); if (left === undefined) { return undefined; @@ -15900,43 +16915,54 @@ var ts; return undefined; case 7: return +e.text; - case 159: - return enumIsConst ? evalConstant(e.expression) : undefined; - case 64: - case 154: - case 153: - if (!enumIsConst) { - return undefined; - } + case 161: + return evalConstant(e.expression); + case 65: + case 156: + case 155: var member = initializer.parent; var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); - var _enumType; + var enumType; var propertyName; - if (e.kind === 64) { - _enumType = currentType; + if (e.kind === 65) { + enumType = currentType; propertyName = e.text; } else { - if (e.kind === 154) { + var expression; + if (e.kind === 156) { if (e.argumentExpression === undefined || e.argumentExpression.kind !== 8) { return undefined; } - _enumType = getTypeOfNode(e.expression); + expression = e.expression; propertyName = e.argumentExpression.text; } else { - _enumType = getTypeOfNode(e.expression); + expression = e.expression; propertyName = e.name.text; } - if (_enumType !== currentType) { + var current = expression; + while (current) { + if (current.kind === 65) { + break; + } + else if (current.kind === 155) { + current = current.expression; + } + else { + return undefined; + } + } + enumType = checkExpression(expression); + if (!(enumType.symbol && (enumType.symbol.flags & 384))) { return undefined; } } if (propertyName === undefined) { return undefined; } - var property = getPropertyOfObjectType(_enumType, propertyName); + var property = getPropertyOfObjectType(enumType, propertyName); if (!property || !(property.flags & 8)) { return undefined; } @@ -15956,17 +16982,20 @@ var ts; if (!produceDiagnostics) { return; } - checkGrammarModifiers(node) || checkGrammarEnumDeclaration(node); + checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarEnumDeclaration(node); checkTypeNameIsReserved(node.name, ts.Diagnostics.Enum_name_cannot_be_0); checkCollisionWithCapturedThisVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); computeEnumMemberValues(node); + var enumIsConst = ts.isConst(node); + if (compilerOptions.separateCompilation && enumIsConst && ts.isInAmbientContext(node)) { + error(node.name, ts.Diagnostics.Ambient_const_enums_are_not_allowed_when_the_separateCompilation_flag_is_provided); + } var enumSymbol = getSymbolOfNode(node); var firstDeclaration = ts.getDeclarationOfKind(enumSymbol, node.kind); if (node === firstDeclaration) { if (enumSymbol.declarations.length > 1) { - var enumIsConst = ts.isConst(node); ts.forEach(enumSymbol.declarations, function (decl) { if (ts.isConstEnumDeclaration(decl) !== enumIsConst) { error(decl.name, ts.Diagnostics.Enum_declarations_must_all_be_const_or_non_const); @@ -15975,7 +17004,7 @@ var ts; } var seenEnumMissingInitialInitializer = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 199) { + if (declaration.kind !== 204) { return false; } var enumDeclaration = declaration; @@ -15996,9 +17025,9 @@ var ts; } function getFirstNonAmbientClassOrFunctionDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; - if ((declaration.kind === 196 || (declaration.kind === 195 && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { + if ((declaration.kind === 201 || (declaration.kind === 200 && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { return declaration; } } @@ -16006,7 +17035,7 @@ var ts; } function checkModuleDeclaration(node) { if (produceDiagnostics) { - if (!checkGrammarModifiers(node)) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node)) { if (!ts.isInAmbientContext(node) && node.name.kind === 8) { grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names); } @@ -16018,7 +17047,7 @@ var ts; if (symbol.flags & 512 && symbol.declarations.length > 1 && !ts.isInAmbientContext(node) - && ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums)) { + && ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation)) { var classOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (classOrFunc) { if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(classOrFunc)) { @@ -16041,20 +17070,29 @@ var ts; checkSourceElement(node.body); } function getFirstIdentifier(node) { - while (node.kind === 125) { - node = node.left; + while (true) { + if (node.kind === 126) { + node = node.left; + } + else if (node.kind === 155) { + node = node.expression; + } + else { + break; + } } + ts.Debug.assert(node.kind === 65); return node; } function checkExternalImportOrExportDeclaration(node) { var moduleName = ts.getExternalModuleName(node); - if (ts.getFullWidth(moduleName) !== 0 && moduleName.kind !== 8) { + if (!ts.nodeIsMissing(moduleName) && moduleName.kind !== 8) { error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 201 && node.parent.parent.name.kind === 8; - if (node.parent.kind !== 221 && !inAmbientExternalModule) { - error(moduleName, node.kind === 210 ? + 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); return false; @@ -16073,7 +17111,7 @@ var ts; (symbol.flags & 793056 ? 793056 : 0) | (symbol.flags & 1536 ? 1536 : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 212 ? + var message = node.kind === 217 ? 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)); @@ -16086,7 +17124,7 @@ var ts; checkAliasSymbol(node); } function checkImportDeclaration(node) { - if (!checkGrammarModifiers(node) && (node.flags & 499)) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_import_declaration_cannot_have_modifiers); } if (checkExternalImportOrExportDeclaration(node)) { @@ -16096,7 +17134,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 206) { + if (importClause.namedBindings.kind === 211) { checkImportBinding(importClause.namedBindings); } else { @@ -16107,7 +17145,7 @@ var ts; } } function checkImportEqualsDeclaration(node) { - checkGrammarModifiers(node); + checkGrammarDecorators(node) || checkGrammarModifiers(node); if (ts.isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) { checkImportBinding(node); if (node.flags & 1) { @@ -16127,15 +17165,30 @@ var ts; } } } + else { + if (languageVersion >= 2) { + grammarErrorOnNode(node, ts.Diagnostics.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); + } + } } } function checkExportDeclaration(node) { - if (!checkGrammarModifiers(node) && (node.flags & 499)) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_declaration_cannot_have_modifiers); } 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); + } + } + 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)); + } } } } @@ -16146,67 +17199,58 @@ var ts; } } function checkExportAssignment(node) { - var container = node.parent.kind === 221 ? node.parent : node.parent.parent; - if (container.kind === 200 && container.name.kind === 64) { + 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); return; } - if (!checkGrammarModifiers(node) && (node.flags & 499)) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_assignment_cannot_have_modifiers); } - if (node.expression.kind === 64) { - markExportAsReferenced(node); + if (node.expression) { + if (node.expression.kind === 65) { + markExportAsReferenced(node); + } + else { + checkExpressionCached(node.expression); + } } - else { - checkExpressionCached(node.expression); + if (node.type) { + checkSourceElement(node.type); + if (!ts.isInAmbientContext(node)) { + grammarErrorOnFirstToken(node.type, ts.Diagnostics.A_type_annotation_on_an_export_statement_is_only_allowed_in_an_ambient_external_module_declaration); + } } 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); + } } function getModuleStatements(node) { - if (node.kind === 221) { + if (node.kind === 227) { return node.statements; } - if (node.kind === 200 && node.body.kind === 201) { + if (node.kind === 205 && node.body.kind === 206) { return node.body.statements; } return emptyArray; } function hasExportedMembers(moduleSymbol) { - var declarations = moduleSymbol.declarations; - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { - var current = declarations[_i]; - var statements = getModuleStatements(current); - for (var _a = 0, _b = statements.length; _a < _b; _a++) { - var node = statements[_a]; - if (node.kind === 210) { - var exportClause = node.exportClause; - if (!exportClause) { - return true; - } - var specifiers = exportClause.elements; - for (var _c = 0, _d = specifiers.length; _c < _d; _c++) { - var specifier = specifiers[_c]; - if (!(specifier.propertyName && specifier.name && specifier.name.text === "default")) { - return true; - } - } - } - else if (node.kind !== 209 && node.flags & 1 && !(node.flags & 256)) { - return true; - } + for (var id in moduleSymbol.exports) { + if (id !== "export=") { + return true; } } + return false; } function checkExternalModuleExports(node) { var moduleSymbol = getSymbolOfNode(node); var links = getSymbolLinks(moduleSymbol); if (!links.exportsChecked) { - var defaultSymbol = getExportAssignmentSymbol(moduleSymbol); - if (defaultSymbol) { - if (hasExportedMembers(moduleSymbol)) { - var declaration = getDeclarationOfAliasSymbol(defaultSymbol) || defaultSymbol.valueDeclaration; - error(declaration, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); - } + var exportEqualsSymbol = moduleSymbol.exports["export="]; + if (exportEqualsSymbol && hasExportedMembers(moduleSymbol)) { + var declaration = getDeclarationOfAliasSymbol(exportEqualsSymbol) || exportEqualsSymbol.valueDeclaration; + error(declaration, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); } links.exportsChecked = true; } @@ -16215,185 +17259,187 @@ var ts; if (!node) return; switch (node.kind) { - case 127: - return checkTypeParameter(node); case 128: - return checkParameter(node); - case 130: + return checkTypeParameter(node); case 129: - return checkPropertyDeclaration(node); - case 140: - case 141: - case 136: - case 137: - return checkSignatureDeclaration(node); - case 138: - return checkSignatureDeclaration(node); + return checkParameter(node); case 132: case 131: - return checkMethodDeclaration(node); - case 133: - return checkConstructorDeclaration(node); - case 134: - case 135: - return checkAccessorDeclaration(node); - case 139: - return checkTypeReference(node); + return checkPropertyDeclaration(node); case 142: - return checkTypeQuery(node); case 143: - return checkTypeLiteral(node); + case 138: + 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 checkTypeReferenceNode(node); case 144: - return checkArrayType(node); + return checkTypeQuery(node); case 145: - return checkTupleType(node); + return checkTypeLiteral(node); case 146: - return checkUnionType(node); + return checkArrayType(node); case 147: + return checkTupleType(node); + case 148: + return checkUnionType(node); + case 149: return checkSourceElement(node.type); - case 195: - return checkFunctionDeclaration(node); - case 174: - case 201: - return checkBlock(node); - case 175: - return checkVariableStatement(node); - case 177: - return checkExpressionStatement(node); - case 178: - return checkIfStatement(node); - case 179: - return checkDoStatement(node); - case 180: - return checkWhileStatement(node); - case 181: - return checkForStatement(node); - case 182: - return checkForInStatement(node); - case 183: - return checkForOfStatement(node); - case 184: - case 185: - return checkBreakOrContinueStatement(node); - case 186: - return checkReturnStatement(node); - case 187: - return checkWithStatement(node); - case 188: - return checkSwitchStatement(node); - case 189: - return checkLabeledStatement(node); - case 190: - return checkThrowStatement(node); - case 191: - return checkTryStatement(node); - case 193: - return checkVariableDeclaration(node); - case 150: - return checkBindingElement(node); - case 196: - return checkClassDeclaration(node); - case 197: - return checkInterfaceDeclaration(node); - case 198: - return checkTypeAliasDeclaration(node); - case 199: - return checkEnumDeclaration(node); case 200: - return checkModuleDeclaration(node); - case 204: - return checkImportDeclaration(node); - case 203: - return checkImportEqualsDeclaration(node); - case 210: - return checkExportDeclaration(node); - case 209: - return checkExportAssignment(node); - case 176: - checkGrammarStatementInAmbientContext(node); - return; + 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); + case 181: checkGrammarStatementInAmbientContext(node); return; + case 197: + checkGrammarStatementInAmbientContext(node); + return; + case 218: + return checkMissingDeclaration(node); } } function checkFunctionExpressionBodies(node) { switch (node.kind) { - case 160: - case 161: + case 162: + case 163: ts.forEach(node.parameters, checkFunctionExpressionBodies); checkFunctionExpressionOrObjectLiteralMethodBody(node); break; - case 132: - case 131: + case 134: + case 133: ts.forEach(node.parameters, checkFunctionExpressionBodies); if (ts.isObjectLiteralMethod(node)) { checkFunctionExpressionOrObjectLiteralMethodBody(node); } break; - case 133: - case 134: case 135: - case 195: + case 136: + case 137: + case 200: ts.forEach(node.parameters, checkFunctionExpressionBodies); break; - case 187: + case 192: checkFunctionExpressionBodies(node.expression); break; - case 128: - case 130: case 129: - case 148: - case 149: + case 132: + case 131: case 150: case 151: case 152: - case 218: case 153: case 154: + case 224: case 155: case 156: case 157: - case 169: - case 173: case 158: case 159: - case 163: - case 164: - case 162: + case 171: + case 176: + case 160: + case 161: case 165: case 166: + case 164: case 167: case 168: - case 171: - case 174: - case 201: - case 175: - case 177: - case 178: + case 169: + case 170: + case 173: case 179: + case 206: case 180: - case 181: case 182: case 183: case 184: case 185: case 186: + case 187: case 188: - case 202: - case 214: - case 215: case 189: case 190: case 191: - case 217: case 193: - case 194: - case 196: - case 199: + case 207: case 220: - case 209: case 221: + case 194: + case 195: + case 196: + case 223: + case 198: + case 199: + case 201: + case 204: + case 226: + case 214: + case 227: ts.forEachChild(node, checkFunctionExpressionBodies); break; } @@ -16421,6 +17467,9 @@ var ts; if (emitExtends) { links.flags |= 8; } + if (emitDecorate) { + links.flags |= 512; + } links.flags |= 1; } } @@ -16445,7 +17494,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 187 && node.parent.statement === node) { + if (node.parent.kind === 192 && node.parent.statement === node) { return true; } node = node.parent; @@ -16456,6 +17505,44 @@ var ts; function getSymbolsInScope(location, meaning) { var symbols = {}; var memberFlags = 0; + if (isInsideWithStatementBody(location)) { + return []; + } + populateSymbols(); + return symbolsToArray(symbols); + function populateSymbols() { + while (location) { + if (location.locals && !isGlobalSourceFile(location)) { + copySymbols(location.locals, meaning); + } + switch (location.kind) { + case 227: + if (!ts.isExternalModule(location)) { + break; + } + case 205: + copySymbols(getSymbolOfNode(location).exports, meaning & 8914931); + break; + case 204: + copySymbols(getSymbolOfNode(location).exports, meaning & 8); + break; + case 201: + case 202: + if (!(memberFlags & 128)) { + copySymbols(getSymbolOfNode(location).members, meaning & 793056); + } + break; + case 162: + if (location.name) { + copySymbol(location.symbol, meaning); + } + break; + } + memberFlags = location.flags; + location = location.parent; + } + copySymbols(globals, meaning); + } function copySymbol(symbol, meaning) { if (symbol.flags & meaning) { var id = symbol.name; @@ -16481,22 +17568,22 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 221: + case 227: if (!ts.isExternalModule(location)) break; - case 200: + case 205: copySymbols(getSymbolOfNode(location).exports, meaning & 8914931); break; - case 199: + case 204: copySymbols(getSymbolOfNode(location).exports, meaning & 8); break; - case 196: - case 197: + case 201: + case 202: if (!(memberFlags & 128)) { copySymbols(getSymbolOfNode(location).members, meaning & 793056); } break; - case 160: + case 162: if (location.name) { copySymbol(location.symbol, meaning); } @@ -16506,97 +17593,113 @@ var ts; location = location.parent; } copySymbols(globals, meaning); - return ts.mapToArray(symbols); + return symbolsToArray(symbols); } function isTypeDeclarationName(name) { - return name.kind == 64 && + return name.kind == 65 && isTypeDeclaration(name.parent) && name.parent.name === name; } function isTypeDeclaration(node) { switch (node.kind) { - case 127: - case 196: - case 197: - case 198: - case 199: + case 128: + case 201: + case 202: + case 203: + case 204: return true; } } function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 125) + while (node.parent && node.parent.kind === 126) { node = node.parent; - return node.parent && node.parent.kind === 139; + } + return node.parent && node.parent.kind === 141; } - function isTypeNode(node) { - if (139 <= node.kind && node.kind <= 147) { + function isHeritageClauseElementIdentifier(entityName) { + var node = entityName; + while (node.parent && node.parent.kind === 155) { + node = node.parent; + } + return node.parent && node.parent.kind === 177; + } + function isTypeNodeOrHeritageClauseElement(node) { + if (141 <= node.kind && node.kind <= 149) { return true; } switch (node.kind) { - case 111: - case 118: - case 120: case 112: + case 119: case 121: + case 113: + case 122: return true; - case 98: - return node.parent.kind !== 164; + case 99: + return node.parent.kind !== 166; case 8: - return node.parent.kind === 128; - case 64: - if (node.parent.kind === 125 && node.parent.right === node) { + return node.parent.kind === 129; + case 177: + return true; + case 65: + if (node.parent.kind === 126 && node.parent.right === node) { node = node.parent; } - case 125: - ts.Debug.assert(node.kind === 64 || node.kind === 125, "'node' was expected to be a qualified name or identifier in 'isTypeNode'."); - var _parent = node.parent; - if (_parent.kind === 142) { + else if (node.parent.kind === 155 && 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'."); + var parent_5 = node.parent; + if (parent_5.kind === 144) { return false; } - if (139 <= _parent.kind && _parent.kind <= 147) { + if (141 <= parent_5.kind && parent_5.kind <= 149) { return true; } - switch (_parent.kind) { - case 127: - return node === _parent.constraint; - case 130: - case 129: + switch (parent_5.kind) { + case 177: + return true; case 128: - case 193: - return node === _parent.type; - case 195: - case 160: - case 161: - case 133: + return node === parent_5.constraint; case 132: case 131: - case 134: + case 129: + case 198: + return node === parent_5.type; + case 200: + case 162: + case 163: case 135: - return node === _parent.type; + case 134: + case 133: case 136: case 137: + return node === parent_5.type; case 138: - return node === _parent.type; - case 158: - return node === _parent.type; - case 155: - case 156: - return _parent.typeArguments && ts.indexOf(_parent.typeArguments, node) >= 0; + case 139: + case 140: + return node === parent_5.type; + case 160: + return node === parent_5.type; case 157: + case 158: + return parent_5.typeArguments && ts.indexOf(parent_5.typeArguments, node) >= 0; + case 159: return false; } } return false; } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 125) { + while (nodeOnRightSide.parent.kind === 126) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 203) { + if (nodeOnRightSide.parent.kind === 208) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 209) { + if (nodeOnRightSide.parent.kind === 214) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -16604,52 +17707,53 @@ var ts; function isInRightSideOfImportOrExportAssignment(node) { return getLeftSideOfImportEqualsOrExportAssignment(node) !== undefined; } - function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 125 && node.parent.right === node) || - (node.parent.kind === 153 && node.parent.name === node); - } function getSymbolOfEntityNameOrPropertyAccessExpression(entityName) { if (ts.isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 209) { + if (entityName.parent.kind === 214) { return resolveEntityName(entityName, 107455 | 793056 | 1536 | 8388608); } - if (entityName.kind !== 153) { + if (entityName.kind !== 155) { if (isInRightSideOfImportOrExportAssignment(entityName)) { return getSymbolOfPartOfRightHandSideOfImportEquals(entityName); } } - if (isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { + if (ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (ts.isExpression(entityName)) { - if (ts.getFullWidth(entityName) === 0) { + if (isHeritageClauseElementIdentifier(entityName)) { + var meaning = entityName.parent.kind === 177 ? 793056 : 1536; + meaning |= 8388608; + return resolveEntityName(entityName, meaning); + } + else if (ts.isExpression(entityName)) { + if (ts.nodeIsMissing(entityName)) { return undefined; } - if (entityName.kind === 64) { + if (entityName.kind === 65) { var meaning = 107455 | 8388608; return resolveEntityName(entityName, meaning); } - else if (entityName.kind === 153) { + else if (entityName.kind === 155) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccessExpression(entityName); } return getNodeLinks(entityName).resolvedSymbol; } - else if (entityName.kind === 125) { - var _symbol = getNodeLinks(entityName).resolvedSymbol; - if (!_symbol) { + else if (entityName.kind === 126) { + var symbol = getNodeLinks(entityName).resolvedSymbol; + if (!symbol) { checkQualifiedName(entityName); } return getNodeLinks(entityName).resolvedSymbol; } } else if (isTypeReferenceIdentifier(entityName)) { - var _meaning = entityName.parent.kind === 139 ? 793056 : 1536; - _meaning |= 8388608; - return resolveEntityName(entityName, _meaning); + var meaning = entityName.parent.kind === 141 ? 793056 : 1536; + meaning |= 8388608; + return resolveEntityName(entityName, meaning); } return undefined; } @@ -16660,23 +17764,23 @@ var ts; if (ts.isDeclarationName(node)) { return getSymbolOfNode(node.parent); } - if (node.kind === 64 && isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 209 + if (node.kind === 65 && isInRightSideOfImportOrExportAssignment(node)) { + return node.parent.kind === 214 ? getSymbolOfEntityNameOrPropertyAccessExpression(node) : getSymbolOfPartOfRightHandSideOfImportEquals(node); } switch (node.kind) { - case 64: - case 153: - case 125: + case 65: + case 155: + case 126: return getSymbolOfEntityNameOrPropertyAccessExpression(node); - case 92: - case 90: + case 93: + case 91: var type = checkExpression(node); return type.symbol; - case 113: + case 114: var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 133) { + if (constructorDeclaration && constructorDeclaration.kind === 135) { return constructorDeclaration.parent.symbol; } return undefined; @@ -16684,12 +17788,12 @@ var ts; var moduleName; if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 204 || node.parent.kind === 210) && + ((node.parent.kind === 209 || node.parent.kind === 215) && node.parent.moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } case 7: - if (node.parent.kind == 154 && node.parent.argumentExpression === node) { + if (node.parent.kind == 156 && node.parent.argumentExpression === node) { var objectType = checkExpression(node.parent.expression); if (objectType === unknownType) return undefined; @@ -16703,7 +17807,7 @@ var ts; return undefined; } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 219) { + if (location && location.kind === 225) { return resolveEntityName(location.name, 107455); } return undefined; @@ -16712,37 +17816,37 @@ var ts; if (isInsideWithStatementBody(node)) { return unknownType; } + if (isTypeNodeOrHeritageClauseElement(node)) { + return getTypeFromTypeNodeOrHeritageClauseElement(node); + } if (ts.isExpression(node)) { return getTypeOfExpression(node); } - if (isTypeNode(node)) { - return getTypeFromTypeNode(node); - } if (isTypeDeclaration(node)) { var symbol = getSymbolOfNode(node); return getDeclaredTypeOfSymbol(symbol); } if (isTypeDeclarationName(node)) { - var _symbol = getSymbolInfo(node); - return _symbol && getDeclaredTypeOfSymbol(_symbol); + var symbol = getSymbolInfo(node); + return symbol && getDeclaredTypeOfSymbol(symbol); } if (ts.isDeclaration(node)) { - var _symbol_1 = getSymbolOfNode(node); - return getTypeOfSymbol(_symbol_1); + var symbol = getSymbolOfNode(node); + return getTypeOfSymbol(symbol); } if (ts.isDeclarationName(node)) { - var _symbol_2 = getSymbolInfo(node); - return _symbol_2 && getTypeOfSymbol(_symbol_2); + var symbol = getSymbolInfo(node); + return symbol && getTypeOfSymbol(symbol); } if (isInRightSideOfImportOrExportAssignment(node)) { - var _symbol_3 = getSymbolInfo(node); - var declaredType = _symbol_3 && getDeclaredTypeOfSymbol(_symbol_3); - return declaredType !== unknownType ? declaredType : getTypeOfSymbol(_symbol_3); + var symbol = getSymbolInfo(node); + var declaredType = symbol && getDeclaredTypeOfSymbol(symbol); + return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); } return unknownType; } function getTypeOfExpression(expr) { - if (isRightSideOfQualifiedNameOrPropertyAccess(expr)) { + if (ts.isRightSideOfQualifiedNameOrPropertyAccess(expr)) { expr = expr.parent; } return checkExpression(expr); @@ -16762,9 +17866,9 @@ var ts; function getRootSymbols(symbol) { if (symbol.flags & 268435456) { var symbols = []; - var _name = symbol.name; + var name_10 = symbol.name; ts.forEach(getSymbolLinks(symbol).unionType.types, function (t) { - symbols.push(getPropertyOfType(t, _name)); + symbols.push(getPropertyOfType(t, name_10)); }); return symbols; } @@ -16777,179 +17881,99 @@ var ts; return [symbol]; } function isExternalModuleSymbol(symbol) { - return symbol.flags & 512 && symbol.declarations.length === 1 && symbol.declarations[0].kind === 221; + return symbol.flags & 512 && symbol.declarations.length === 1 && symbol.declarations[0].kind === 227; } - function isNodeDescendentOf(node, ancestor) { - while (node) { - if (node === ancestor) - return true; - node = node.parent; + function getAliasNameSubstitution(symbol, getGeneratedNameForNode) { + if (languageVersion >= 2) { + return undefined; } - return false; - } - function isUniqueLocalName(name, container) { - for (var node = container; isNodeDescendentOf(node, container); node = node.nextContainer) { - if (node.locals && ts.hasProperty(node.locals, name)) { - if (node.locals[name].flags & (107455 | 1048576 | 8388608)) { - return false; - } + var node = getDeclarationOfAliasSymbol(symbol); + if (node) { + if (node.kind === 210) { + return getGeneratedNameForNode(node.parent) + ".default"; } - } - return true; - } - function getGeneratedNamesForSourceFile(sourceFile) { - var links = getNodeLinks(sourceFile); - var generatedNames = links.generatedNames; - if (!generatedNames) { - generatedNames = links.generatedNames = {}; - generateNames(sourceFile); - } - return generatedNames; - function generateNames(node) { - switch (node.kind) { - case 195: - case 196: - generateNameForFunctionOrClassDeclaration(node); - break; - case 200: - generateNameForModuleOrEnum(node); - generateNames(node.body); - break; - case 199: - generateNameForModuleOrEnum(node); - break; - case 204: - generateNameForImportDeclaration(node); - break; - case 210: - generateNameForExportDeclaration(node); - break; - case 209: - generateNameForExportAssignment(node); - break; - case 221: - case 201: - ts.forEach(node.statements, generateNames); - break; - } - } - function isExistingName(name) { - return ts.hasProperty(globals, name) || ts.hasProperty(sourceFile.identifiers, name) || ts.hasProperty(generatedNames, name); - } - function makeUniqueName(baseName) { - var _name = ts.generateUniqueName(baseName, isExistingName); - return generatedNames[_name] = _name; - } - function assignGeneratedName(node, name) { - getNodeLinks(node).generatedName = ts.unescapeIdentifier(name); - } - function generateNameForFunctionOrClassDeclaration(node) { - if (!node.name) { - assignGeneratedName(node, makeUniqueName("default")); - } - } - function generateNameForModuleOrEnum(node) { - if (node.name.kind === 64) { - var _name = node.name.text; - assignGeneratedName(node, isUniqueLocalName(_name, node) ? _name : makeUniqueName(_name)); - } - } - function generateNameForImportOrExportDeclaration(node) { - var expr = ts.getExternalModuleName(node); - var baseName = expr.kind === 8 ? - ts.escapeIdentifier(ts.makeIdentifierFromModuleName(expr.text)) : "module"; - assignGeneratedName(node, makeUniqueName(baseName)); - } - function generateNameForImportDeclaration(node) { - if (node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 207) { - generateNameForImportOrExportDeclaration(node); - } - } - function generateNameForExportDeclaration(node) { - if (node.moduleSpecifier) { - generateNameForImportOrExportDeclaration(node); - } - } - function generateNameForExportAssignment(node) { - if (node.expression.kind !== 64) { - assignGeneratedName(node, makeUniqueName("default")); + if (node.kind === 213) { + var moduleName = getGeneratedNameForNode(node.parent.parent.parent); + var propertyName = node.propertyName || node.name; + return moduleName + "." + ts.unescapeIdentifier(propertyName.text); } } } - function getGeneratedNameForNode(node) { - var links = getNodeLinks(node); - if (!links.generatedName) { - getGeneratedNamesForSourceFile(getSourceFile(node)); - } - return links.generatedName; - } - function getLocalNameOfContainer(container) { - return getGeneratedNameForNode(container); - } - function getLocalNameForImportDeclaration(node) { - return getGeneratedNameForNode(node); - } - function getAliasNameSubstitution(symbol) { - var declaration = getDeclarationOfAliasSymbol(symbol); - if (declaration && declaration.kind === 208) { - var moduleName = getGeneratedNameForNode(declaration.parent.parent.parent); - var propertyName = declaration.propertyName || declaration.name; - return moduleName + "." + ts.unescapeIdentifier(propertyName.text); - } - } - function getExportNameSubstitution(symbol, location) { + function getExportNameSubstitution(symbol, location, getGeneratedNameForNode) { if (isExternalModuleSymbol(symbol.parent)) { + if (languageVersion >= 2) { + return undefined; + } return "exports." + ts.unescapeIdentifier(symbol.name); } var node = location; var containerSymbol = getParentOfSymbol(symbol); while (node) { - if ((node.kind === 200 || node.kind === 199) && getSymbolOfNode(node) === containerSymbol) { + if ((node.kind === 205 || node.kind === 204) && getSymbolOfNode(node) === containerSymbol) { return getGeneratedNameForNode(node) + "." + ts.unescapeIdentifier(symbol.name); } node = node.parent; } } - function getExpressionNameSubstitution(node) { - var symbol = getNodeLinks(node).resolvedSymbol; + function getExpressionNameSubstitution(node, getGeneratedNameForNode) { + var symbol = getNodeLinks(node).resolvedSymbol || (ts.isDeclarationName(node) ? getSymbolOfNode(node.parent) : undefined); if (symbol) { if (symbol.parent) { - return getExportNameSubstitution(symbol, node.parent); + return getExportNameSubstitution(symbol, node.parent, getGeneratedNameForNode); } var exportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); if (symbol !== exportSymbol && !(exportSymbol.flags & 944)) { - return getExportNameSubstitution(exportSymbol, node.parent); + return getExportNameSubstitution(exportSymbol, node.parent, getGeneratedNameForNode); } if (symbol.flags & 8388608) { - return getAliasNameSubstitution(symbol); + return getAliasNameSubstitution(symbol, getGeneratedNameForNode); } } } - function hasExportDefaultValue(node) { - var symbol = getResolvedExportAssignmentSymbol(getSymbolOfNode(node)); - return symbol && symbol !== unknownSymbol && symbolIsValue(symbol) && !isConstEnumSymbol(symbol); + function isValueAliasDeclaration(node) { + switch (node.kind) { + case 208: + case 210: + case 211: + case 213: + case 217: + return isAliasResolvedToValue(getSymbolOfNode(node)); + case 215: + var exportClause = node.exportClause; + return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); + case 214: + return node.expression && node.expression.kind === 65 ? isAliasResolvedToValue(getSymbolOfNode(node)) : true; + } + return false; } function isTopLevelValueImportEqualsWithEntityName(node) { - if (node.parent.kind !== 221 || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node.parent.kind !== 227 || !ts.isInternalModuleImportEqualsDeclaration(node)) { return false; } - return isAliasResolvedToValue(getSymbolOfNode(node)); + var isValue = isAliasResolvedToValue(getSymbolOfNode(node)); + return isValue && node.moduleReference && !ts.nodeIsMissing(node.moduleReference); } function isAliasResolvedToValue(symbol) { var target = resolveAlias(symbol); - return target !== unknownSymbol && target.flags & 107455 && !isConstEnumOrConstEnumOnlyModule(target); + if (target === unknownSymbol && compilerOptions.separateCompilation) { + return true; + } + return target !== unknownSymbol && target && target.flags & 107455 && !isConstEnumOrConstEnumOnlyModule(target); } function isConstEnumOrConstEnumOnlyModule(s) { return isConstEnumSymbol(s) || s.constEnumOnlyModule; } - function isReferencedAliasDeclaration(node) { - if (isAliasSymbolDeclaration(node)) { + function isReferencedAliasDeclaration(node, checkChildren) { + if (ts.isAliasSymbolDeclaration(node)) { var symbol = getSymbolOfNode(node); if (getSymbolLinks(symbol).referenced) { return true; } } - return ts.forEachChild(node, isReferencedAliasDeclaration); + if (checkChildren) { + return ts.forEachChild(node, function (node) { return isReferencedAliasDeclaration(node, checkChildren); }); + } + return false; } function isImplementationOfOverload(node) { if (ts.nodeIsPresent(node.body)) { @@ -16968,15 +17992,13 @@ var ts; return getNodeLinks(node).enumMemberValue; } function getConstantValue(node) { - if (node.kind === 220) { + if (node.kind === 226) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; if (symbol && (symbol.flags & 8)) { - var declaration = symbol.valueDeclaration; - var constantValue; - if (declaration.kind === 220) { - return getEnumMemberValue(declaration); + if (ts.isConstEnumDeclaration(symbol.valueDeclaration.parent)) { + return getEnumMemberValue(symbol.valueDeclaration); } } return undefined; @@ -16992,42 +18014,48 @@ var ts; var signature = getSignatureFromDeclaration(signatureDeclaration); getSymbolDisplayBuilder().buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags); } - function isUnknownIdentifier(location, name) { - ts.Debug.assert(!ts.nodeIsSynthesized(location), "isUnknownIdentifier called with a synthesized location"); - return !resolveName(location, name, 107455, undefined, undefined) && - !ts.hasProperty(getGeneratedNamesForSourceFile(getSourceFile(location)), name); + function writeTypeOfExpression(expr, enclosingDeclaration, flags, writer) { + var type = getTypeOfExpression(expr); + getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); + } + function hasGlobalName(name) { + return ts.hasProperty(globals, name); + } + function resolvesToSomeValue(location, name) { + ts.Debug.assert(!ts.nodeIsSynthesized(location), "resolvesToSomeValue called with a synthesized location"); + return !!resolveName(location, name, 107455, undefined, undefined); } function getBlockScopedVariableId(n) { ts.Debug.assert(!ts.nodeIsSynthesized(n)); - if (n.parent.kind === 153 && - n.parent.name === n) { - return undefined; - } - if (n.parent.kind === 150 && - n.parent.propertyName === n) { - return undefined; - } - var declarationSymbol = (n.parent.kind === 193 && n.parent.name === n) || - n.parent.kind === 150 - ? getSymbolOfNode(n.parent) - : undefined; - var symbol = declarationSymbol || + var isVariableDeclarationOrBindingElement = n.parent.kind === 152 || (n.parent.kind === 198 && 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 !== 217; + symbol.valueDeclaration.parent.kind !== 223; if (isLetOrConst) { getSymbolLinks(symbol); return symbol.id; } return undefined; } + function instantiateSingleCallFunctionType(functionType, typeArguments) { + if (functionType === unknownType) { + return unknownType; + } + var signature = getSingleCallSignature(functionType); + if (!signature) { + return unknownType; + } + var instantiatedSignature = getSignatureInstantiation(signature, typeArguments); + return getOrCreateTypeFromSignature(instantiatedSignature); + } function createResolver() { return { - getGeneratedNameForNode: getGeneratedNameForNode, getExpressionNameSubstitution: getExpressionNameSubstitution, - hasExportDefaultValue: hasExportDefaultValue, + isValueAliasDeclaration: isValueAliasDeclaration, + hasGlobalName: hasGlobalName, isReferencedAliasDeclaration: isReferencedAliasDeclaration, getNodeCheckFlags: getNodeCheckFlags, isTopLevelValueImportEqualsWithEntityName: isTopLevelValueImportEqualsWithEntityName, @@ -17035,10 +18063,12 @@ var ts; isImplementationOfOverload: isImplementationOfOverload, writeTypeOfDeclaration: writeTypeOfDeclaration, writeReturnTypeOfSignatureDeclaration: writeReturnTypeOfSignatureDeclaration, + writeTypeOfExpression: writeTypeOfExpression, isSymbolAccessible: isSymbolAccessible, isEntityNameVisible: isEntityNameVisible, getConstantValue: getConstantValue, - isUnknownIdentifier: isUnknownIdentifier, + resolvesToSomeValue: resolvesToSomeValue, + collectLinkedAliases: collectLinkedAliases, getBlockScopedVariableId: getBlockScopedVariableId }; } @@ -17063,6 +18093,11 @@ var ts; globalNumberType = getGlobalType("Number"); globalBooleanType = getGlobalType("Boolean"); globalRegExpType = getGlobalType("RegExp"); + globalTypedPropertyDescriptorType = getTypeOfGlobalSymbol(getGlobalTypeSymbol("TypedPropertyDescriptor"), 1); + globalClassDecoratorType = getGlobalType("ClassDecorator"); + globalPropertyDecoratorType = getGlobalType("PropertyDecorator"); + globalMethodDecoratorType = getGlobalType("MethodDecorator"); + globalParameterDecoratorType = getGlobalType("ParameterDecorator"); if (languageVersion >= 2) { globalTemplateStringsArrayType = getGlobalType("TemplateStringsArray"); globalESSymbolType = getGlobalType("Symbol"); @@ -17076,28 +18111,46 @@ var ts; } anyArrayType = createArrayType(anyType); } + function checkGrammarDecorators(node) { + if (!node.decorators) { + return false; + } + if (!ts.nodeCanBeDecorated(node)) { + return grammarErrorOnNode(node, ts.Diagnostics.Decorators_are_not_valid_here); + } + else if (languageVersion < 1) { + return grammarErrorOnNode(node, ts.Diagnostics.Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher); + } + else if (node.kind === 136 || node.kind === 137) { + var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); + if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { + return grammarErrorOnNode(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); + } + } + return false; + } function checkGrammarModifiers(node) { switch (node.kind) { - case 134: + case 136: + case 137: case 135: - case 133: - case 130: - case 129: case 132: case 131: - case 138: - case 196: - case 197: - case 200: - case 199: - case 175: - case 195: - case 198: + case 134: + case 133: + case 140: + case 201: + case 202: + case 205: case 204: + case 180: + case 200: case 203: - case 210: case 209: - case 128: + case 208: + case 215: + case 214: + case 129: break; default: return false; @@ -17107,17 +18160,17 @@ var ts; } var lastStatic, lastPrivate, lastProtected, lastDeclare; var flags = 0; - for (var _i = 0, _a = node.modifiers, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; switch (modifier.kind) { + case 109: case 108: case 107: - case 106: var text = void 0; - if (modifier.kind === 108) { + if (modifier.kind === 109) { text = "public"; } - else if (modifier.kind === 107) { + else if (modifier.kind === 108) { text = "protected"; lastProtected = modifier; } @@ -17131,50 +18184,50 @@ var ts; else if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); } - else if (node.parent.kind === 201 || node.parent.kind === 221) { + else if (node.parent.kind === 206 || node.parent.kind === 227) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); } flags |= ts.modifierToFlag(modifier.kind); break; - case 109: + case 110: if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static"); } - else if (node.parent.kind === 201 || node.parent.kind === 221) { + else if (node.parent.kind === 206 || node.parent.kind === 227) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); } - else if (node.kind === 128) { + else if (node.kind === 129) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } flags |= 128; lastStatic = modifier; break; - case 77: + case 78: if (flags & 1) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "export"); } else if (flags & 2) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); } - else if (node.parent.kind === 196) { + else if (node.parent.kind === 201) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 128) { + else if (node.kind === 129) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1; break; - case 114: + case 115: if (flags & 2) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); } - else if (node.parent.kind === 196) { + else if (node.parent.kind === 201) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 128) { + else if (node.kind === 129) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 201) { + else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 206) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 2; @@ -17182,7 +18235,7 @@ var ts; break; } } - if (node.kind === 133) { + if (node.kind === 135) { if (flags & 128) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -17193,13 +18246,13 @@ var ts; return grammarErrorOnNode(lastPrivate, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); } } - else if ((node.kind === 204 || node.kind === 203) && flags & 2) { + else if ((node.kind === 209 || node.kind === 208) && flags & 2) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 197 && flags & 2) { + else if (node.kind === 202 && flags & 2) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); } - else if (node.kind === 128 && (flags & 112) && ts.isBindingPattern(node.name)) { + else if (node.kind === 129 && (flags & 112) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_a_binding_pattern); } } @@ -17211,15 +18264,14 @@ var ts; return grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Trailing_comma_not_allowed); } } - function checkGrammarTypeParameterList(node, typeParameters) { + function checkGrammarTypeParameterList(node, typeParameters, file) { if (checkGrammarForDisallowedTrailingComma(typeParameters)) { return true; } if (typeParameters && typeParameters.length === 0) { var start = typeParameters.pos - "<".length; - var sourceFile = ts.getSourceFileOfNode(node); - var end = ts.skipTrivia(sourceFile.text, typeParameters.end) + ">".length; - return grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Type_parameter_list_cannot_be_empty); + var end = ts.skipTrivia(file.text, typeParameters.end) + ">".length; + return grammarErrorAtPos(file, start, end - start, ts.Diagnostics.Type_parameter_list_cannot_be_empty); } } function checkGrammarParameterList(parameters) { @@ -17255,7 +18307,20 @@ var ts; } } function checkGrammarFunctionLikeDeclaration(node) { - return checkGrammarModifiers(node) || checkGrammarTypeParameterList(node, node.typeParameters) || checkGrammarParameterList(node.parameters); + var file = ts.getSourceFileOfNode(node); + return checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarTypeParameterList(node, node.typeParameters, file) || + checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file); + } + function checkGrammarArrowFunction(node, file) { + if (node.kind === 163) { + var arrowFunction = node; + var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; + var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; + if (startLine !== endLine) { + return grammarErrorOnNode(arrowFunction.equalsGreaterThanToken, ts.Diagnostics.Line_terminator_not_permitted_before_arrow); + } + } + return false; } function checkGrammarIndexSignatureParameters(node) { var parameter = node.parameters[0]; @@ -17282,7 +18347,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 !== 120 && parameter.type.kind !== 118) { + if (parameter.type.kind !== 121 && parameter.type.kind !== 119) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); } if (!node.type) { @@ -17295,7 +18360,7 @@ var ts; } } function checkGrammarIndexSignature(node) { - checkGrammarModifiers(node) || checkGrammarIndexSignatureParameters(node) || checkGrammarForIndexSignatureModifier(node); + return checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarIndexSignatureParameters(node) || checkGrammarForIndexSignatureModifier(node); } function checkGrammarForAtLeastOneTypeArgument(node, typeArguments) { if (typeArguments && typeArguments.length === 0) { @@ -17312,9 +18377,9 @@ var ts; function checkGrammarForOmittedArgument(node, arguments) { if (arguments) { var sourceFile = ts.getSourceFileOfNode(node); - for (var _i = 0, _n = arguments.length; _i < _n; _i++) { + for (var _i = 0; _i < arguments.length; _i++) { var arg = arguments[_i]; - if (arg.kind === 172) { + if (arg.kind === 175) { return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -17338,10 +18403,10 @@ var ts; function checkGrammarClassDeclarationHeritageClauses(node) { var seenExtendsClause = false; var seenImplementsClause = false; - if (!checkGrammarModifiers(node) && node.heritageClauses) { - for (var _i = 0, _a = node.heritageClauses, _n = _a.length; _i < _n; _i++) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && node.heritageClauses) { + for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) { var heritageClause = _a[_i]; - if (heritageClause.token === 78) { + if (heritageClause.token === 79) { if (seenExtendsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen); } @@ -17354,7 +18419,7 @@ var ts; seenExtendsClause = true; } else { - ts.Debug.assert(heritageClause.token === 102); + ts.Debug.assert(heritageClause.token === 103); if (seenImplementsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.implements_clause_already_seen); } @@ -17367,16 +18432,16 @@ var ts; function checkGrammarInterfaceDeclaration(node) { var seenExtendsClause = false; if (node.heritageClauses) { - for (var _i = 0, _a = node.heritageClauses, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) { var heritageClause = _a[_i]; - if (heritageClause.token === 78) { + if (heritageClause.token === 79) { if (seenExtendsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen); } seenExtendsClause = true; } else { - ts.Debug.assert(heritageClause.token === 102); + ts.Debug.assert(heritageClause.token === 103); return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.Interface_declaration_cannot_have_implements_clause); } checkGrammarHeritageClause(heritageClause); @@ -17385,11 +18450,11 @@ var ts; return false; } function checkGrammarComputedPropertyName(node) { - if (node.kind !== 126) { + if (node.kind !== 127) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 167 && computedPropertyName.expression.operatorToken.kind === 23) { + if (computedPropertyName.expression.kind === 169 && computedPropertyName.expression.operatorToken.kind === 23) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } @@ -17413,54 +18478,54 @@ var ts; var SetAccesor = 4; var GetOrSetAccessor = GetAccessor | SetAccesor; var inStrictMode = (node.parserContextFlags & 1) !== 0; - for (var _i = 0, _a = node.properties, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - var _name = prop.name; - if (prop.kind === 172 || - _name.kind === 126) { - checkGrammarComputedPropertyName(_name); + var name_11 = prop.name; + if (prop.kind === 175 || + name_11.kind === 127) { + checkGrammarComputedPropertyName(name_11); continue; } var currentKind = void 0; - if (prop.kind === 218 || prop.kind === 219) { + if (prop.kind === 224 || prop.kind === 225) { checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); - if (_name.kind === 7) { - checkGrammarNumbericLiteral(_name); + if (name_11.kind === 7) { + checkGrammarNumbericLiteral(name_11); } currentKind = Property; } - else if (prop.kind === 132) { + else if (prop.kind === 134) { currentKind = Property; } - else if (prop.kind === 134) { + else if (prop.kind === 136) { currentKind = GetAccessor; } - else if (prop.kind === 135) { + else if (prop.kind === 137) { currentKind = SetAccesor; } else { ts.Debug.fail("Unexpected syntax kind:" + prop.kind); } - if (!ts.hasProperty(seen, _name.text)) { - seen[_name.text] = currentKind; + if (!ts.hasProperty(seen, name_11.text)) { + seen[name_11.text] = currentKind; } else { - var existingKind = seen[_name.text]; + var existingKind = seen[name_11.text]; if (currentKind === Property && existingKind === Property) { if (inStrictMode) { - grammarErrorOnNode(_name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); + grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); } } else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[_name.text] = currentKind | existingKind; + seen[name_11.text] = currentKind | existingKind; } else { - return grammarErrorOnNode(_name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + return grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); } } else { - return grammarErrorOnNode(_name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + return grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); } } } @@ -17469,27 +18534,27 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.initializer.kind === 194) { + if (forInOrOfStatement.initializer.kind === 199) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { if (variableList.declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 182 + var diagnostic = forInOrOfStatement.kind === 187 ? 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 === 182 + var diagnostic = forInOrOfStatement.kind === 187 ? 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); + return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var _diagnostic_1 = forInOrOfStatement.kind === 182 + var diagnostic = forInOrOfStatement.kind === 187 ? 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_1); + return grammarErrorOnNode(firstDeclaration, diagnostic); } } } @@ -17509,10 +18574,10 @@ var ts; else if (accessor.typeParameters) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } - else if (kind === 134 && accessor.parameters.length) { + else if (kind === 136 && accessor.parameters.length) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); } - else if (kind === 135) { + else if (kind === 137) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -17537,7 +18602,7 @@ var ts; } } function checkGrammarForNonSymbolComputedProperty(node, message) { - if (node.kind === 126 && !ts.isWellKnownSymbolSyntactically(node.expression)) { + if (node.kind === 127 && !ts.isWellKnownSymbolSyntactically(node.expression)) { return grammarErrorOnNode(node, message); } } @@ -17547,7 +18612,7 @@ var ts; checkGrammarForGenerator(node)) { return true; } - if (node.parent.kind === 152) { + if (node.parent.kind === 154) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { return true; } @@ -17555,7 +18620,7 @@ var ts; return grammarErrorAtPos(getSourceFile(node), node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } } - if (node.parent.kind === 196) { + if (node.parent.kind === 201) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { return true; } @@ -17566,22 +18631,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 === 197) { + else if (node.parent.kind === 202) { 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 === 143) { + else if (node.parent.kind === 145) { 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 181: - case 182: - case 183: - case 179: - case 180: + case 186: + case 187: + case 188: + case 184: + case 185: return true; - case 189: + case 194: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -17593,9 +18658,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 189: + case 194: if (node.label && current.label.text === node.label.text) { - var isMisplacedContinueLabel = node.kind === 184 + var isMisplacedContinueLabel = node.kind === 189 && !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); @@ -17603,8 +18668,8 @@ var ts; return false; } break; - case 188: - if (node.kind === 185 && !node.label) { + case 193: + if (node.kind === 190 && !node.label) { return false; } break; @@ -17617,16 +18682,16 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 185 + var message = node.kind === 190 ? 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 === 185 + var message = node.kind === 190 ? 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); + return grammarErrorOnNode(node, message); } } function checkGrammarBindingElement(node) { @@ -17642,11 +18707,8 @@ var ts; return checkGrammarEvalOrArgumentsInStrictMode(node, node.name); } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 182 && node.parent.parent.kind !== 183) { + if (node.parent.parent.kind !== 187 && node.parent.parent.kind !== 188) { if (ts.isInAmbientContext(node)) { - if (ts.isBindingPattern(node.name)) { - return grammarErrorOnNode(node, ts.Diagnostics.Destructuring_declarations_are_not_allowed_in_ambient_contexts); - } if (node.initializer) { var equalsTokenLength = "=".length; return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.initializer.pos - equalsTokenLength, equalsTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); @@ -17666,14 +18728,14 @@ var ts; checkGrammarEvalOrArgumentsInStrictMode(node, node.name); } function checkGrammarNameInLetOrConstDeclarations(name) { - if (name.kind === 64) { + if (name.kind === 65) { if (name.text === "let") { return grammarErrorOnNode(name, ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations); } } else { var elements = name.elements; - for (var _i = 0, _n = elements.length; _i < _n; _i++) { + for (var _i = 0; _i < elements.length; _i++) { var element = elements[_i]; checkGrammarNameInLetOrConstDeclarations(element.name); } @@ -17690,15 +18752,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 178: - case 179: - case 180: - case 187: - case 181: - case 182: case 183: + case 184: + case 185: + case 192: + case 186: + case 187: + case 188: return false; - case 189: + case 194: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -17714,7 +18776,7 @@ var ts; } } function isIntegerLiteral(expression) { - if (expression.kind === 165) { + if (expression.kind === 167) { var unaryExpression = expression; if (unaryExpression.operator === 33 || unaryExpression.operator === 34) { expression = unaryExpression.operand; @@ -17731,9 +18793,9 @@ var ts; if (!enumIsConst) { var inConstantEnumMemberSection = true; var inAmbientContext = ts.isInAmbientContext(enumDecl); - for (var _i = 0, _a = enumDecl.members, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = enumDecl.members; _i < _a.length; _i++) { var node = _a[_i]; - if (node.name.kind === 126) { + if (node.name.kind === 127) { hasError = grammarErrorOnNode(node.name, ts.Diagnostics.Computed_property_names_are_not_allowed_in_enums); } else if (inAmbientContext) { @@ -17776,7 +18838,7 @@ var ts; } } function checkGrammarEvalOrArgumentsInStrictMode(contextNode, name) { - if (name && name.kind === 64) { + if (name && name.kind === 65) { var identifier = name; if (contextNode && (contextNode.parserContextFlags & 1) && ts.isEvalOrArgumentsIdentifier(identifier)) { var nameText = ts.declarationNameToString(identifier); @@ -17795,18 +18857,18 @@ var ts; } } function checkGrammarProperty(node) { - if (node.parent.kind === 196) { + if (node.parent.kind === 201) { 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 === 197) { + else if (node.parent.kind === 202) { 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 === 143) { + else if (node.parent.kind === 145) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)) { return true; } @@ -17816,20 +18878,21 @@ var ts; } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 197 || - node.kind === 204 || - node.kind === 203 || - node.kind === 210 || + if (node.kind === 202 || node.kind === 209 || - (node.flags & 2)) { + node.kind === 208 || + node.kind === 215 || + node.kind === 214 || + (node.flags & 2) || + (node.flags & (1 | 256))) { return false; } return grammarErrorOnFirstToken(node, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); } function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { - for (var _i = 0, _a = file.statements, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 175) { + if (ts.isDeclaration(decl) || decl.kind === 180) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -17848,10 +18911,10 @@ 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 === 174 || node.parent.kind === 201 || node.parent.kind === 221) { - var _links = getNodeLinks(node.parent); - if (!_links.hasReportedStatementInAmbientContext) { - return _links.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); + if (node.parent.kind === 179 || node.parent.kind === 206 || node.parent.kind === 227) { + 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); } } else { @@ -17881,251 +18944,16 @@ var ts; } ts.createTypeChecker = createTypeChecker; })(ts || (ts = {})); +/// var ts; (function (ts) { - var indentStrings = ["", " "]; - function getIndentString(level) { - if (indentStrings[level] === undefined) { - indentStrings[level] = getIndentString(level - 1) + indentStrings[1]; - } - return indentStrings[level]; - } - ts.getIndentString = getIndentString; - function getIndentSize() { - return indentStrings[1].length; - } - function shouldEmitToOwnFile(sourceFile, compilerOptions) { - if (!ts.isDeclarationFile(sourceFile)) { - if ((ts.isExternalModule(sourceFile) || !compilerOptions.out) && !ts.fileExtensionIs(sourceFile.fileName, ".js")) { - return true; - } - return false; - } - return false; - } - ts.shouldEmitToOwnFile = shouldEmitToOwnFile; - function isExternalModuleOrDeclarationFile(sourceFile) { - return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); - } - ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; - function createTextWriter(newLine) { - var output = ""; - var indent = 0; - var lineStart = true; - var lineCount = 0; - var linePos = 0; - function write(s) { - if (s && s.length) { - if (lineStart) { - output += getIndentString(indent); - lineStart = false; - } - output += s; - } - } - function rawWrite(s) { - if (s !== undefined) { - if (lineStart) { - lineStart = false; - } - output += s; - } - } - function writeLiteral(s) { - if (s && s.length) { - write(s); - var lineStartsOfS = ts.computeLineStarts(s); - if (lineStartsOfS.length > 1) { - lineCount = lineCount + lineStartsOfS.length - 1; - linePos = output.length - s.length + lineStartsOfS[lineStartsOfS.length - 1]; - } - } - } - function writeLine() { - if (!lineStart) { - output += newLine; - lineCount++; - linePos = output.length; - lineStart = true; - } - } - function writeTextOfNode(sourceFile, node) { - write(ts.getSourceTextOfNodeFromSourceFile(sourceFile, node)); - } - return { - write: write, - rawWrite: rawWrite, - writeTextOfNode: writeTextOfNode, - writeLiteral: writeLiteral, - writeLine: writeLine, - increaseIndent: function () { return indent++; }, - decreaseIndent: function () { return indent--; }, - getIndent: function () { return indent; }, - getTextPos: function () { return output.length; }, - getLine: function () { return lineCount + 1; }, - getColumn: function () { return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; }, - getText: function () { return output; } - }; - } - function getLineOfLocalPosition(currentSourceFile, pos) { - return ts.getLineAndCharacterOfPosition(currentSourceFile, pos).line; - } - function emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments) { - if (leadingComments && leadingComments.length && node.pos !== leadingComments[0].pos && - getLineOfLocalPosition(currentSourceFile, node.pos) !== getLineOfLocalPosition(currentSourceFile, leadingComments[0].pos)) { - writer.writeLine(); - } - } - function emitComments(currentSourceFile, writer, comments, trailingSeparator, newLine, writeComment) { - var emitLeadingSpace = !trailingSeparator; - ts.forEach(comments, function (comment) { - if (emitLeadingSpace) { - writer.write(" "); - emitLeadingSpace = false; - } - writeComment(currentSourceFile, writer, comment, newLine); - if (comment.hasTrailingNewLine) { - writer.writeLine(); - } - else if (trailingSeparator) { - writer.write(" "); - } - else { - emitLeadingSpace = true; - } - }); - } - function writeCommentRange(currentSourceFile, writer, comment, newLine) { - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42) { - var firstCommentLineAndCharacter = ts.getLineAndCharacterOfPosition(currentSourceFile, comment.pos); - var lineCount = ts.getLineStarts(currentSourceFile).length; - var firstCommentLineIndent; - for (var pos = comment.pos, currentLine = firstCommentLineAndCharacter.line; pos < comment.end; currentLine++) { - var nextLineStart = (currentLine + 1) === lineCount - ? currentSourceFile.text.length + 1 - : ts.getStartPositionOfLine(currentLine + 1, currentSourceFile); - if (pos !== comment.pos) { - if (firstCommentLineIndent === undefined) { - firstCommentLineIndent = calculateIndent(ts.getStartPositionOfLine(firstCommentLineAndCharacter.line, currentSourceFile), comment.pos); - } - var currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); - var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(pos, nextLineStart); - if (spacesToEmit > 0) { - var numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); - var indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); - writer.rawWrite(indentSizeSpaceString); - while (numberOfSingleSpacesToEmit) { - writer.rawWrite(" "); - numberOfSingleSpacesToEmit--; - } - } - else { - writer.rawWrite(""); - } - } - writeTrimmedCurrentLine(pos, nextLineStart); - pos = nextLineStart; - } - } - else { - writer.write(currentSourceFile.text.substring(comment.pos, comment.end)); - } - function writeTrimmedCurrentLine(pos, nextLineStart) { - var end = Math.min(comment.end, nextLineStart - 1); - var currentLineText = currentSourceFile.text.substring(pos, end).replace(/^\s+|\s+$/g, ''); - if (currentLineText) { - writer.write(currentLineText); - if (end !== comment.end) { - writer.writeLine(); - } - } - else { - writer.writeLiteral(newLine); - } - } - function calculateIndent(pos, end) { - var currentLineIndent = 0; - for (; pos < end && ts.isWhiteSpace(currentSourceFile.text.charCodeAt(pos)); pos++) { - if (currentSourceFile.text.charCodeAt(pos) === 9) { - currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); - } - else { - currentLineIndent++; - } - } - return currentLineIndent; - } - } - function getFirstConstructorWithBody(node) { - return ts.forEach(node.members, function (member) { - if (member.kind === 133 && ts.nodeIsPresent(member.body)) { - return member; - } - }); - } - function getAllAccessorDeclarations(declarations, accessor) { - var firstAccessor; - var getAccessor; - var setAccessor; - if (ts.hasDynamicName(accessor)) { - firstAccessor = accessor; - if (accessor.kind === 134) { - getAccessor = accessor; - } - else if (accessor.kind === 135) { - setAccessor = accessor; - } - else { - ts.Debug.fail("Accessor has wrong kind"); - } - } - else { - ts.forEach(declarations, function (member) { - if ((member.kind === 134 || member.kind === 135) - && (member.flags & 128) === (accessor.flags & 128)) { - var memberName = ts.getPropertyNameForPropertyNameNode(member.name); - var accessorName = ts.getPropertyNameForPropertyNameNode(accessor.name); - if (memberName === accessorName) { - if (!firstAccessor) { - firstAccessor = member; - } - if (member.kind === 134 && !getAccessor) { - getAccessor = member; - } - if (member.kind === 135 && !setAccessor) { - setAccessor = member; - } - } - } - }); - } - return { - firstAccessor: firstAccessor, - getAccessor: getAccessor, - setAccessor: setAccessor - }; - } - function getSourceFilePathInNewDir(sourceFile, host, newDirPath) { - var sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.fileName, host.getCurrentDirectory()); - sourceFilePath = sourceFilePath.replace(host.getCommonSourceDirectory(), ""); - return ts.combinePaths(newDirPath, sourceFilePath); - } - function getOwnEmitOutputFilePath(sourceFile, host, extension) { - var compilerOptions = host.getCompilerOptions(); - var emitOutputFilePathWithoutExtension; - if (compilerOptions.outDir) { - emitOutputFilePathWithoutExtension = ts.removeFileExtension(getSourceFilePathInNewDir(sourceFile, host, compilerOptions.outDir)); - } - else { - emitOutputFilePathWithoutExtension = ts.removeFileExtension(sourceFile.fileName); - } - return emitOutputFilePathWithoutExtension + extension; - } - function writeFile(host, diagnostics, fileName, data, writeByteOrderMark) { - host.writeFile(fileName, data, writeByteOrderMark, function (hostErrorMessage) { - diagnostics.push(ts.createCompilerDiagnostic(ts.Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage)); - }); + function getDeclarationDiagnostics(host, resolver, targetSourceFile) { + var diagnostics = []; + var jsFilePath = ts.getOwnEmitOutputFilePath(targetSourceFile, host, ".js"); + emitDeclarations(host, resolver, diagnostics, jsFilePath, targetSourceFile); + return diagnostics; } + ts.getDeclarationDiagnostics = getDeclarationDiagnostics; function emitDeclarations(host, resolver, diagnostics, jsFilePath, root) { var newLine = host.getNewLine(); var compilerOptions = host.getCompilerOptions(); @@ -18141,7 +18969,8 @@ var ts; var reportedDeclarationError = false; var emitJsDocComments = compilerOptions.removeComments ? function (declaration) { } : writeJsDocComments; var emit = compilerOptions.stripInternal ? stripInternal : emitNode; - var aliasDeclarationEmitInfo = []; + var moduleElementDeclarationEmitInfo = []; + var asynchronousSubModuleDeclarationEmitInfo; var referencePathsOutput = ""; if (root) { if (!compilerOptions.noResolve) { @@ -18149,25 +18978,38 @@ var ts; ts.forEach(root.referencedFiles, function (fileReference) { var referencedFile = ts.tryResolveScriptReference(host, root, fileReference); if (referencedFile && ((referencedFile.flags & 2048) || - shouldEmitToOwnFile(referencedFile, compilerOptions) || + ts.shouldEmitToOwnFile(referencedFile, compilerOptions) || !addedGlobalFileReference)) { writeReferencePath(referencedFile); - if (!isExternalModuleOrDeclarationFile(referencedFile)) { + if (!ts.isExternalModuleOrDeclarationFile(referencedFile)) { addedGlobalFileReference = true; } } }); } emitSourceFile(root); + if (moduleElementDeclarationEmitInfo.length) { + var oldWriter = writer; + ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { + if (aliasEmitInfo.isVisible) { + ts.Debug.assert(aliasEmitInfo.node.kind === 209); + createAndSetNewTextWriterWithSymbolWriter(); + ts.Debug.assert(aliasEmitInfo.indent === 0); + writeImportDeclaration(aliasEmitInfo.node); + aliasEmitInfo.asynchronousOutput = writer.getText(); + } + }); + setWriter(oldWriter); + } } 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); @@ -18180,7 +19022,7 @@ var ts; } return { reportedDeclarationError: reportedDeclarationError, - aliasDeclarationEmitInfo: aliasDeclarationEmitInfo, + moduleElementDeclarationEmitInfo: moduleElementDeclarationEmitInfo, synchronousDeclarationOutput: writer.getText(), referencePathsOutput: referencePathsOutput }; @@ -18199,17 +19041,17 @@ var ts; } } function createAndSetNewTextWriterWithSymbolWriter() { - var _writer = createTextWriter(newLine); - _writer.trackSymbol = trackSymbol; - _writer.writeKeyword = _writer.write; - _writer.writeOperator = _writer.write; - _writer.writePunctuation = _writer.write; - _writer.writeSpace = _writer.write; - _writer.writeStringLiteral = _writer.writeLiteral; - _writer.writeParameter = _writer.write; - _writer.writeSymbol = _writer.write; - setWriter(_writer); - return _writer; + var writer = ts.createTextWriter(newLine); + writer.trackSymbol = trackSymbol; + writer.writeKeyword = writer.write; + writer.writeOperator = writer.write; + writer.writePunctuation = writer.write; + writer.writeSpace = writer.write; + writer.writeStringLiteral = writer.writeLiteral; + writer.writeParameter = writer.write; + writer.writeSymbol = writer.write; + setWriter(writer); + return writer; } function setWriter(newWriter) { writer = newWriter; @@ -18219,17 +19061,43 @@ var ts; increaseIndent = newWriter.increaseIndent; decreaseIndent = newWriter.decreaseIndent; } - function writeAsychronousImportEqualsDeclarations(importEqualsDeclarations) { + function writeAsynchronousModuleElements(nodes) { var oldWriter = writer; - ts.forEach(importEqualsDeclarations, function (aliasToWrite) { - var aliasEmitInfo = ts.forEach(aliasDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.declaration === aliasToWrite ? declEmitInfo : undefined; }); - if (aliasEmitInfo) { - createAndSetNewTextWriterWithSymbolWriter(); - for (var declarationIndent = aliasEmitInfo.indent; declarationIndent; declarationIndent--) { - increaseIndent(); + ts.forEach(nodes, function (declaration) { + var nodeToCheck; + if (declaration.kind === 198) { + nodeToCheck = declaration.parent.parent; + } + else if (declaration.kind === 212 || declaration.kind === 213 || declaration.kind === 210) { + ts.Debug.fail("We should be getting ImportDeclaration instead to write"); + } + else { + nodeToCheck = declaration; + } + var moduleElementEmitInfo = ts.forEach(moduleElementDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.node === nodeToCheck ? declEmitInfo : undefined; }); + if (!moduleElementEmitInfo && asynchronousSubModuleDeclarationEmitInfo) { + moduleElementEmitInfo = ts.forEach(asynchronousSubModuleDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.node === nodeToCheck ? declEmitInfo : undefined; }); + } + if (moduleElementEmitInfo) { + if (moduleElementEmitInfo.node.kind === 209) { + moduleElementEmitInfo.isVisible = true; + } + else { + createAndSetNewTextWriterWithSymbolWriter(); + for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { + increaseIndent(); + } + if (nodeToCheck.kind === 205) { + ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); + asynchronousSubModuleDeclarationEmitInfo = []; + } + writeModuleElement(nodeToCheck); + if (nodeToCheck.kind === 205) { + moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; + asynchronousSubModuleDeclarationEmitInfo = undefined; + } + moduleElementEmitInfo.asynchronousOutput = writer.getText(); } - writeImportEqualsDeclaration(aliasToWrite); - aliasEmitInfo.asynchronousOutput = writer.getText(); } }); setWriter(oldWriter); @@ -18237,7 +19105,7 @@ var ts; function handleSymbolAccessibilityError(symbolAccesibilityResult) { if (symbolAccesibilityResult.accessibility === 0) { if (symbolAccesibilityResult && symbolAccesibilityResult.aliasesToMakeVisible) { - writeAsychronousImportEqualsDeclarations(symbolAccesibilityResult.aliasesToMakeVisible); + writeAsynchronousModuleElements(symbolAccesibilityResult.aliasesToMakeVisible); } } else { @@ -18277,30 +19145,32 @@ var ts; } } function emitLines(nodes) { - for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + for (var _i = 0; _i < nodes.length; _i++) { var node = nodes[_i]; emit(node); } } - function emitSeparatedList(nodes, separator, eachNodeEmitFn) { + function emitSeparatedList(nodes, separator, eachNodeEmitFn, canEmitFn) { var currentWriterPos = writer.getTextPos(); - for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + for (var _i = 0; _i < nodes.length; _i++) { var node = nodes[_i]; - if (currentWriterPos !== writer.getTextPos()) { - write(separator); + if (!canEmitFn || canEmitFn(node)) { + if (currentWriterPos !== writer.getTextPos()) { + write(separator); + } + currentWriterPos = writer.getTextPos(); + eachNodeEmitFn(node); } - currentWriterPos = writer.getTextPos(); - eachNodeEmitFn(node); } } - function emitCommaList(nodes, eachNodeEmitFn) { - emitSeparatedList(nodes, ", ", eachNodeEmitFn); + function emitCommaList(nodes, eachNodeEmitFn, canEmitFn) { + emitSeparatedList(nodes, ", ", eachNodeEmitFn, canEmitFn); } function writeJsDocComments(declaration) { if (declaration) { var jsDocComments = ts.getJsDocComments(declaration, currentSourceFile); - emitNewLineBeforeLeadingComments(currentSourceFile, writer, declaration, jsDocComments); - emitComments(currentSourceFile, writer, jsDocComments, true, newLine, writeCommentRange); + ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, declaration, jsDocComments); + ts.emitComments(currentSourceFile, writer, jsDocComments, true, newLine, ts.writeCommentRange); } } function emitTypeWithNewGetSymbolAccessibilityDiagnostic(type, getSymbolAccessibilityDiagnostic) { @@ -18309,51 +19179,63 @@ var ts; } function emitType(type) { switch (type.kind) { - case 111: - case 120: - case 118: case 112: case 121: - case 98: + case 119: + case 113: + case 122: + case 99: case 8: return writeTextOfNode(currentSourceFile, type); - case 139: - return emitTypeReference(type); - case 142: - return emitTypeQuery(type); - case 144: - return emitArrayType(type); - case 145: - return emitTupleType(type); - case 146: - return emitUnionType(type); - case 147: - return emitParenType(type); - case 140: + case 177: + return emitHeritageClauseElement(type); case 141: - return emitSignatureDeclarationWithJsDocComments(type); + 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); + case 142: case 143: + return emitSignatureDeclarationWithJsDocComments(type); + case 145: return emitTypeLiteral(type); - case 64: + case 65: return emitEntityName(type); - case 125: + case 126: return emitEntityName(type); - default: - ts.Debug.fail("Unknown type annotation: " + type.kind); } function emitEntityName(entityName) { - var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 203 ? entityName.parent : enclosingDeclaration); + var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 208 ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); writeEntityName(entityName); function writeEntityName(entityName) { - if (entityName.kind === 64) { + if (entityName.kind === 65) { writeTextOfNode(currentSourceFile, entityName); } else { - var qualifiedName = entityName; - writeEntityName(qualifiedName.left); + var left = entityName.kind === 126 ? entityName.left : entityName.expression; + var right = entityName.kind === 126 ? entityName.right : entityName.name; + writeEntityName(left); write("."); - writeTextOfNode(currentSourceFile, qualifiedName.right); + writeTextOfNode(currentSourceFile, right); + } + } + } + function emitHeritageClauseElement(node) { + if (ts.isSupportedHeritageClauseElement(node)) { + ts.Debug.assert(node.expression.kind === 65 || node.expression.kind === 155); + emitEntityName(node.expression); + if (node.typeArguments) { + write("<"); + emitCommaList(node.typeArguments, emitType); + write(">"); } } } @@ -18404,16 +19286,100 @@ var ts; } function emitExportAssignment(node) { write(node.isExportEquals ? "export = " : "export default "); - writeTextOfNode(currentSourceFile, node.expression); + if (node.expression.kind === 65) { + writeTextOfNode(currentSourceFile, node.expression); + } + else { + write(": "); + if (node.type) { + emitType(node.type); + } + else { + writer.getSymbolAccessibilityDiagnostic = getDefaultExportAccessibilityDiagnostic; + resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, 2, writer); + } + } write(";"); writeLine(); + if (node.expression.kind === 65) { + var nodes = resolver.collectLinkedAliases(node.expression); + writeAsynchronousModuleElements(nodes); + } + function getDefaultExportAccessibilityDiagnostic(diagnostic) { + return { + diagnosticMessage: ts.Diagnostics.Default_export_of_the_module_has_or_is_using_private_name_0, + errorNode: node + }; + } + } + function isModuleElementVisible(node) { + return resolver.isDeclarationVisible(node); + } + function emitModuleElement(node, isModuleElementVisible) { + if (isModuleElementVisible) { + writeModuleElement(node); + } + else if (node.kind === 208 || + (node.parent.kind === 227 && ts.isExternalModule(currentSourceFile))) { + var isVisible; + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 227) { + asynchronousSubModuleDeclarationEmitInfo.push({ + node: node, + outputPos: writer.getTextPos(), + indent: writer.getIndent(), + isVisible: isVisible + }); + } + else { + if (node.kind === 209) { + var importDeclaration = node; + if (importDeclaration.importClause) { + isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || + isVisibleNamedBinding(importDeclaration.importClause.namedBindings); + } + } + moduleElementDeclarationEmitInfo.push({ + node: node, + outputPos: writer.getTextPos(), + indent: writer.getIndent(), + isVisible: isVisible + }); + } + } + } + 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); + case 203: + return writeTypeAliasDeclaration(node); + case 204: + return writeEnumDeclaration(node); + case 205: + return writeModuleDeclaration(node); + case 208: + return writeImportEqualsDeclaration(node); + case 209: + return writeImportDeclaration(node); + default: + ts.Debug.fail("Unknown symbol kind"); + } } function emitModuleElementDeclarationFlags(node) { if (node.parent === currentSourceFile) { if (node.flags & 1) { write("export "); } - if (node.kind !== 197) { + if (node.flags & 256) { + write("default "); + } + else if (node.kind !== 202) { write("declare "); } } @@ -18429,18 +19395,6 @@ var ts; write("static "); } } - function emitImportEqualsDeclaration(node) { - var nodeEmitInfo = { - declaration: node, - outputPos: writer.getTextPos(), - indent: writer.getIndent(), - hasWritten: resolver.isDeclarationVisible(node) - }; - aliasDeclarationEmitInfo.push(nodeEmitInfo); - if (nodeEmitInfo.hasWritten) { - writeImportEqualsDeclaration(node); - } - } function writeImportEqualsDeclaration(node) { emitJsDocComments(node); if (node.flags & 1) { @@ -18467,40 +19421,110 @@ var ts; }; } } - function emitModuleDeclaration(node) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - write("module "); - writeTextOfNode(currentSourceFile, node.name); - while (node.body.kind !== 201) { - node = node.body; - write("."); - writeTextOfNode(currentSourceFile, node.name); + function isVisibleNamedBinding(namedBindings) { + if (namedBindings) { + if (namedBindings.kind === 211) { + return resolver.isDeclarationVisible(namedBindings); + } + else { + return ts.forEach(namedBindings.elements, function (namedImport) { return resolver.isDeclarationVisible(namedImport); }); } - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - write(" {"); - writeLine(); - increaseIndent(); - emitLines(node.body.statements); - decreaseIndent(); - write("}"); - writeLine(); - enclosingDeclaration = prevEnclosingDeclaration; } } - function emitTypeAliasDeclaration(node) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - write("type "); - writeTextOfNode(currentSourceFile, node.name); - write(" = "); - emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.type, getTypeAliasDeclarationVisibilityError); - write(";"); - writeLine(); + function writeImportDeclaration(node) { + if (!node.importClause && !(node.flags & 1)) { + return; } + emitJsDocComments(node); + if (node.flags & 1) { + write("export "); + } + write("import "); + if (node.importClause) { + var currentWriterPos = writer.getTextPos(); + if (node.importClause.name && resolver.isDeclarationVisible(node.importClause)) { + writeTextOfNode(currentSourceFile, node.importClause.name); + } + if (node.importClause.namedBindings && isVisibleNamedBinding(node.importClause.namedBindings)) { + if (currentWriterPos !== writer.getTextPos()) { + write(", "); + } + if (node.importClause.namedBindings.kind === 211) { + write("* as "); + writeTextOfNode(currentSourceFile, node.importClause.namedBindings.name); + } + else { + write("{ "); + emitCommaList(node.importClause.namedBindings.elements, emitImportOrExportSpecifier, resolver.isDeclarationVisible); + write(" }"); + } + } + write(" from "); + } + writeTextOfNode(currentSourceFile, node.moduleSpecifier); + write(";"); + writer.writeLine(); + } + function emitImportOrExportSpecifier(node) { + if (node.propertyName) { + writeTextOfNode(currentSourceFile, node.propertyName); + write(" as "); + } + writeTextOfNode(currentSourceFile, node.name); + } + function emitExportSpecifier(node) { + emitImportOrExportSpecifier(node); + var nodes = resolver.collectLinkedAliases(node.propertyName || node.name); + writeAsynchronousModuleElements(nodes); + } + function emitExportDeclaration(node) { + emitJsDocComments(node); + write("export "); + if (node.exportClause) { + write("{ "); + emitCommaList(node.exportClause.elements, emitExportSpecifier); + write(" }"); + } + else { + write("*"); + } + if (node.moduleSpecifier) { + write(" from "); + writeTextOfNode(currentSourceFile, node.moduleSpecifier); + } + write(";"); + writer.writeLine(); + } + function writeModuleDeclaration(node) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + write("module "); + writeTextOfNode(currentSourceFile, node.name); + while (node.body.kind !== 206) { + node = node.body; + write("."); + writeTextOfNode(currentSourceFile, node.name); + } + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node; + write(" {"); + writeLine(); + increaseIndent(); + emitLines(node.body.statements); + decreaseIndent(); + write("}"); + writeLine(); + enclosingDeclaration = prevEnclosingDeclaration; + } + function writeTypeAliasDeclaration(node) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + write("type "); + writeTextOfNode(currentSourceFile, node.name); + write(" = "); + emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.type, getTypeAliasDeclarationVisibilityError); + write(";"); + writeLine(); function getTypeAliasDeclarationVisibilityError(symbolAccesibilityResult) { return { diagnosticMessage: ts.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1, @@ -18509,23 +19533,21 @@ var ts; }; } } - function emitEnumDeclaration(node) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - if (ts.isConst(node)) { - write("const "); - } - write("enum "); - writeTextOfNode(currentSourceFile, node.name); - write(" {"); - writeLine(); - increaseIndent(); - emitLines(node.members); - decreaseIndent(); - write("}"); - writeLine(); + function writeEnumDeclaration(node) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + if (ts.isConst(node)) { + write("const "); } + write("enum "); + writeTextOfNode(currentSourceFile, node.name); + write(" {"); + writeLine(); + increaseIndent(); + emitLines(node.members); + decreaseIndent(); + write("}"); + writeLine(); } function emitEnumMemberDeclaration(node) { emitJsDocComments(node); @@ -18539,7 +19561,7 @@ var ts; writeLine(); } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 132 && (node.parent.flags & 32); + return node.parent.kind === 134 && (node.parent.flags & 32); } function emitTypeParameters(typeParameters) { function emitTypeParameter(node) { @@ -18549,15 +19571,15 @@ var ts; writeTextOfNode(currentSourceFile, node.name); if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); - if (node.parent.kind === 140 || - node.parent.kind === 141 || - (node.parent.parent && node.parent.parent.kind === 143)) { - ts.Debug.assert(node.parent.kind === 132 || - node.parent.kind === 131 || - node.parent.kind === 140 || - node.parent.kind === 141 || - node.parent.kind === 136 || - node.parent.kind === 137); + 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 || + node.parent.kind === 143 || + node.parent.kind === 138 || + node.parent.kind === 139); emitType(node.constraint); } else { @@ -18567,31 +19589,31 @@ var ts; function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.parent.kind) { - case 196: + case 201: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 197: + case 202: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 137: + case 139: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 136: + case 138: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 132: - case 131: + 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 === 196) { + else if (node.parent.parent.kind === 201) { 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 195: + case 200: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: @@ -18616,10 +19638,12 @@ var ts; emitCommaList(typeReferences, emitTypeOfTypeReference); } function emitTypeOfTypeReference(node) { - emitTypeWithNewGetSymbolAccessibilityDiagnostic(node, getHeritageClauseVisibilityError); + if (ts.isSupportedHeritageClauseElement(node)) { + emitTypeWithNewGetSymbolAccessibilityDiagnostic(node, getHeritageClauseVisibilityError); + } function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.parent.parent.kind === 196) { + if (node.parent.parent.kind === 201) { 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; @@ -18635,7 +19659,7 @@ var ts; } } } - function emitClassDeclaration(node) { + function writeClassDeclaration(node) { function emitParameterProperties(constructorDeclaration) { if (constructorDeclaration) { ts.forEach(constructorDeclaration.parameters, function (param) { @@ -18645,49 +19669,45 @@ var ts; }); } } - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - write("class "); - writeTextOfNode(currentSourceFile, node.name); - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - emitTypeParameters(node.typeParameters); - var baseTypeNode = ts.getClassBaseTypeNode(node); - if (baseTypeNode) { - emitHeritageClause([baseTypeNode], false); - } - emitHeritageClause(ts.getClassImplementedTypeNodes(node), true); - write(" {"); - writeLine(); - increaseIndent(); - emitParameterProperties(getFirstConstructorWithBody(node)); - emitLines(node.members); - decreaseIndent(); - write("}"); - writeLine(); - enclosingDeclaration = prevEnclosingDeclaration; + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + write("class "); + writeTextOfNode(currentSourceFile, node.name); + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node; + emitTypeParameters(node.typeParameters); + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); + if (baseTypeNode) { + emitHeritageClause([baseTypeNode], false); } + emitHeritageClause(ts.getClassImplementsHeritageClauseElements(node), true); + write(" {"); + writeLine(); + increaseIndent(); + emitParameterProperties(ts.getFirstConstructorWithBody(node)); + emitLines(node.members); + decreaseIndent(); + write("}"); + writeLine(); + enclosingDeclaration = prevEnclosingDeclaration; } - function emitInterfaceDeclaration(node) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - write("interface "); - writeTextOfNode(currentSourceFile, node.name); - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - emitTypeParameters(node.typeParameters); - emitHeritageClause(ts.getInterfaceBaseTypeNodes(node), false); - write(" {"); - writeLine(); - increaseIndent(); - emitLines(node.members); - decreaseIndent(); - write("}"); - writeLine(); - enclosingDeclaration = prevEnclosingDeclaration; - } + function writeInterfaceDeclaration(node) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + write("interface "); + writeTextOfNode(currentSourceFile, node.name); + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node; + emitTypeParameters(node.typeParameters); + emitHeritageClause(ts.getInterfaceBaseTypeNodes(node), false); + write(" {"); + writeLine(); + increaseIndent(); + emitLines(node.members); + decreaseIndent(); + write("}"); + writeLine(); + enclosingDeclaration = prevEnclosingDeclaration; } function emitPropertyDeclaration(node) { if (ts.hasDynamicName(node)) { @@ -18700,54 +19720,90 @@ var ts; writeLine(); } function emitVariableDeclaration(node) { - if (node.kind !== 193 || resolver.isDeclarationVisible(node)) { - writeTextOfNode(currentSourceFile, node.name); - if ((node.kind === 130 || node.kind === 129) && ts.hasQuestionToken(node)) { - write("?"); + if (node.kind !== 198 || resolver.isDeclarationVisible(node)) { + if (ts.isBindingPattern(node.name)) { + emitBindingPattern(node.name); } - if ((node.kind === 130 || node.kind === 129) && node.parent.kind === 143) { - emitTypeOfVariableDeclarationFromTypeLiteral(node); - } - else if (!(node.flags & 32)) { - writeTypeOfDeclaration(node, node.type, getVariableDeclarationTypeVisibilityError); + else { + writeTextOfNode(currentSourceFile, node.name); + if ((node.kind === 132 || node.kind === 131) && ts.hasQuestionToken(node)) { + write("?"); + } + if ((node.kind === 132 || node.kind === 131) && node.parent.kind === 145) { + emitTypeOfVariableDeclarationFromTypeLiteral(node); + } + else if (!(node.flags & 32)) { + writeTypeOfDeclaration(node, node.type, getVariableDeclarationTypeVisibilityError); + } } } - function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage; - if (node.kind === 193) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { + if (node.kind === 198) { + 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 === 130 || node.kind === 129) { + else if (node.kind === 132 || node.kind === 131) { if (node.flags & 128) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : 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 === 196) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + else if (node.parent.kind === 201) { + 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 : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; } else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + return symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; } } + } + function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult) { + var diagnosticMessage = getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult); return diagnosticMessage !== undefined ? { diagnosticMessage: diagnosticMessage, errorNode: node, typeName: node.name } : undefined; } + function emitBindingPattern(bindingPattern) { + var elements = []; + for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { + var element = _a[_i]; + if (element.kind !== 175) { + elements.push(element); + } + } + emitCommaList(elements, emitBindingElement); + } + function emitBindingElement(bindingElement) { + function getBindingElementTypeVisibilityError(symbolAccesibilityResult) { + var diagnosticMessage = getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult); + return diagnosticMessage !== undefined ? { + diagnosticMessage: diagnosticMessage, + errorNode: bindingElement, + typeName: bindingElement.name + } : undefined; + } + if (bindingElement.name) { + if (ts.isBindingPattern(bindingElement.name)) { + emitBindingPattern(bindingElement.name); + } + else { + writeTextOfNode(currentSourceFile, bindingElement.name); + writeTypeOfDeclaration(bindingElement, undefined, getBindingElementTypeVisibilityError); + } + } + } } function emitTypeOfVariableDeclarationFromTypeLiteral(node) { if (node.type) { @@ -18755,30 +19811,30 @@ var ts; emitType(node.type); } } - function emitVariableStatement(node) { - var hasDeclarationWithEmit = ts.forEach(node.declarationList.declarations, function (varDeclaration) { return resolver.isDeclarationVisible(varDeclaration); }); - if (hasDeclarationWithEmit) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - if (ts.isLet(node.declarationList)) { - write("let "); - } - else if (ts.isConst(node.declarationList)) { - write("const "); - } - else { - write("var "); - } - emitCommaList(node.declarationList.declarations, emitVariableDeclaration); - write(";"); - writeLine(); + function isVariableStatementVisible(node) { + return ts.forEach(node.declarationList.declarations, function (varDeclaration) { return resolver.isDeclarationVisible(varDeclaration); }); + } + function writeVariableStatement(node) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + if (ts.isLet(node.declarationList)) { + write("let "); } + else if (ts.isConst(node.declarationList)) { + write("const "); + } + else { + write("var "); + } + emitCommaList(node.declarationList.declarations, emitVariableDeclaration, resolver.isDeclarationVisible); + write(";"); + writeLine(); } function emitAccessorDeclaration(node) { if (ts.hasDynamicName(node)) { return; } - var accessors = getAllAccessorDeclarations(node.parent.members, node); + var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); var accessorWithTypeAnnotation; if (node === accessors.firstAccessor) { emitJsDocComments(accessors.getAccessor); @@ -18789,7 +19845,7 @@ var ts; accessorWithTypeAnnotation = node; var type = getTypeAnnotationFromAccessor(node); if (!type) { - var anotherAccessor = node.kind === 134 ? accessors.setAccessor : accessors.getAccessor; + var anotherAccessor = node.kind === 136 ? accessors.setAccessor : accessors.getAccessor; type = getTypeAnnotationFromAccessor(anotherAccessor); if (type) { accessorWithTypeAnnotation = anotherAccessor; @@ -18802,7 +19858,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 134 + return accessor.kind === 136 ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type @@ -18811,7 +19867,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (accessorWithTypeAnnotation.kind === 135) { + if (accessorWithTypeAnnotation.kind === 137) { 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 : @@ -18851,24 +19907,23 @@ var ts; } } } - function emitFunctionDeclaration(node) { + function writeFunctionDeclaration(node) { if (ts.hasDynamicName(node)) { return; } - if ((node.kind !== 195 || resolver.isDeclarationVisible(node)) && - !resolver.isImplementationOfOverload(node)) { + if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 195) { + if (node.kind === 200) { emitModuleElementDeclarationFlags(node); } - else if (node.kind === 132) { + else if (node.kind === 134) { emitClassMemberDeclarationFlags(node); } - if (node.kind === 195) { + if (node.kind === 200) { write("function "); writeTextOfNode(currentSourceFile, node.name); } - else if (node.kind === 133) { + else if (node.kind === 135) { write("constructor"); } else { @@ -18885,11 +19940,11 @@ var ts; emitSignatureDeclaration(node); } function emitSignatureDeclaration(node) { - if (node.kind === 137 || node.kind === 141) { + if (node.kind === 139 || node.kind === 143) { write("new "); } emitTypeParameters(node.typeParameters); - if (node.kind === 138) { + if (node.kind === 140) { write("["); } else { @@ -18898,20 +19953,20 @@ var ts; var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 138) { + if (node.kind === 140) { write("]"); } else { write(")"); } - var isFunctionTypeOrConstructorType = node.kind === 140 || node.kind === 141; - if (isFunctionTypeOrConstructorType || node.parent.kind === 143) { + var isFunctionTypeOrConstructorType = node.kind === 142 || node.kind === 143; + if (isFunctionTypeOrConstructorType || node.parent.kind === 145) { if (node.type) { write(isFunctionTypeOrConstructorType ? " => " : ": "); emitType(node.type); } } - else if (node.kind !== 133 && !(node.flags & 32)) { + else if (node.kind !== 135 && !(node.flags & 32)) { writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); } enclosingDeclaration = prevEnclosingDeclaration; @@ -18922,23 +19977,23 @@ var ts; function getReturnTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.kind) { - case 137: + case 139: 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 136: + case 138: 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 138: + case 140: 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 132: - case 131: + case 134: + case 133: if (node.flags & 128) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? @@ -18946,7 +20001,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 === 196) { + else if (node.parent.kind === 201) { 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 : @@ -18959,7 +20014,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 195: + case 200: 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 : @@ -18982,7 +20037,7 @@ var ts; write("..."); } if (ts.isBindingPattern(node.name)) { - write("_" + ts.indexOf(node.parent.parameters, node)); + emitBindingPattern(node.name); } else { writeTextOfNode(currentSourceFile, node.name); @@ -18991,129 +20046,204 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 140 || - node.parent.kind === 141 || - node.parent.parent.kind === 143) { + if (node.parent.kind === 142 || + node.parent.kind === 143 || + node.parent.parent.kind === 145) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!(node.parent.flags & 32)) { writeTypeOfDeclaration(node, node.type, getParameterDeclarationTypeVisibilityError); } function getParameterDeclarationTypeVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage; + var diagnosticMessage = getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult); + return diagnosticMessage !== undefined ? { + diagnosticMessage: diagnosticMessage, + errorNode: node, + typeName: node.name + } : undefined; + } + function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { switch (node.parent.kind) { - case 133: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + case 135: + 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; - break; - case 137: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + case 139: + 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; - break; - case 136: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + case 138: + 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; - break; - case 132: - case 131: + case 134: + case 133: if (node.parent.flags & 128) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : 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 === 196) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + else if (node.parent.parent.kind === 201) { + 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 : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + return symbolAccesibilityResult.errorModuleName ? 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; } - break; - case 195: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + case 200: + 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 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - break; default: ts.Debug.fail("This is unknown parent for parameter: " + node.parent.kind); } - return { - diagnosticMessage: diagnosticMessage, - errorNode: node, - typeName: node.name - }; + } + function emitBindingPattern(bindingPattern) { + if (bindingPattern.kind === 150) { + write("{"); + emitCommaList(bindingPattern.elements, emitBindingElement); + write("}"); + } + else if (bindingPattern.kind === 151) { + write("["); + var elements = bindingPattern.elements; + emitCommaList(elements, emitBindingElement); + if (elements && elements.hasTrailingComma) { + write(", "); + } + write("]"); + } + } + function emitBindingElement(bindingElement) { + function getBindingElementTypeVisibilityError(symbolAccesibilityResult) { + var diagnosticMessage = getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult); + return diagnosticMessage !== undefined ? { + diagnosticMessage: diagnosticMessage, + errorNode: bindingElement, + typeName: bindingElement.name + } : undefined; + } + if (bindingElement.kind === 175) { + write(" "); + } + else if (bindingElement.kind === 152) { + if (bindingElement.propertyName) { + writeTextOfNode(currentSourceFile, bindingElement.propertyName); + write(": "); + emitBindingPattern(bindingElement.name); + } + else if (bindingElement.name) { + if (ts.isBindingPattern(bindingElement.name)) { + emitBindingPattern(bindingElement.name); + } + else { + ts.Debug.assert(bindingElement.name.kind === 65); + if (bindingElement.dotDotDotToken) { + write("..."); + } + writeTextOfNode(currentSourceFile, bindingElement.name); + } + } + } } } 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 209: + return emitModuleElement(node, !node.importClause); + case 215: + return emitExportDeclaration(node); + case 135: + case 134: case 133: - case 195: + return writeFunctionDeclaration(node); + case 139: + case 138: + case 140: + return emitSignatureDeclarationWithJsDocComments(node); + case 136: + case 137: + return emitAccessorDeclaration(node); case 132: case 131: - return emitFunctionDeclaration(node); - case 137: - case 136: - case 138: - return emitSignatureDeclarationWithJsDocComments(node); - case 134: - case 135: - return emitAccessorDeclaration(node); - case 175: - return emitVariableStatement(node); - case 130: - case 129: return emitPropertyDeclaration(node); - case 197: - return emitInterfaceDeclaration(node); - case 196: - return emitClassDeclaration(node); - case 198: - return emitTypeAliasDeclaration(node); - case 220: + case 226: return emitEnumMemberDeclaration(node); - case 199: - return emitEnumDeclaration(node); - case 200: - return emitModuleDeclaration(node); - case 203: - return emitImportEqualsDeclaration(node); - case 209: + case 214: return emitExportAssignment(node); - case 221: + case 227: return emitSourceFile(node); } } function writeReferencePath(referencedFile) { var declFileName = referencedFile.flags & 2048 ? referencedFile.fileName - : shouldEmitToOwnFile(referencedFile, compilerOptions) - ? getOwnEmitOutputFilePath(referencedFile, host, ".d.ts") + : ts.shouldEmitToOwnFile(referencedFile, compilerOptions) + ? ts.getOwnEmitOutputFilePath(referencedFile, host, ".d.ts") : ts.removeFileExtension(compilerOptions.out) + ".d.ts"; declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(jsFilePath)), declFileName, host.getCurrentDirectory(), host.getCanonicalFileName, false); referencePathsOutput += "/// " + newLine; } } - function getDeclarationDiagnostics(host, resolver, targetSourceFile) { - var diagnostics = []; - var jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, host, ".js"); - emitDeclarations(host, resolver, diagnostics, jsFilePath, targetSourceFile); - return diagnostics; + function writeDeclarationFile(jsFilePath, sourceFile, host, resolver, diagnostics) { + var emitDeclarationResult = emitDeclarations(host, resolver, diagnostics, jsFilePath, sourceFile); + if (!emitDeclarationResult.reportedDeclarationError) { + var declarationOutput = emitDeclarationResult.referencePathsOutput + + getDeclarationOutput(emitDeclarationResult.synchronousDeclarationOutput, emitDeclarationResult.moduleElementDeclarationEmitInfo); + ts.writeFile(host, diagnostics, ts.removeFileExtension(jsFilePath) + ".d.ts", declarationOutput, host.getCompilerOptions().emitBOM); + } + function getDeclarationOutput(synchronousDeclarationOutput, moduleElementDeclarationEmitInfo) { + var appliedSyncOutputPos = 0; + var declarationOutput = ""; + ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { + if (aliasEmitInfo.asynchronousOutput) { + declarationOutput += synchronousDeclarationOutput.substring(appliedSyncOutputPos, aliasEmitInfo.outputPos); + declarationOutput += getDeclarationOutput(aliasEmitInfo.asynchronousOutput, aliasEmitInfo.subModuleElementDeclarationEmitInfo); + appliedSyncOutputPos = aliasEmitInfo.outputPos; + } + }); + declarationOutput += synchronousDeclarationOutput.substring(appliedSyncOutputPos); + return declarationOutput; + } } - ts.getDeclarationDiagnostics = getDeclarationDiagnostics; + ts.writeDeclarationFile = writeDeclarationFile; +})(ts || (ts = {})); +/// +/// +var ts; +(function (ts) { + function isExternalModuleOrDeclarationFile(sourceFile) { + return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); + } + ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; + var TempFlags; + (function (TempFlags) { + TempFlags[TempFlags["Auto"] = 0] = "Auto"; + TempFlags[TempFlags["CountMask"] = 268435455] = "CountMask"; + TempFlags[TempFlags["_i"] = 268435456] = "_i"; + TempFlags[TempFlags["_n"] = 536870912] = "_n"; + })(TempFlags || (TempFlags = {})); function emitFiles(resolver, host, targetSourceFile) { var compilerOptions = host.getCompilerOptions(); var languageVersion = compilerOptions.target || 0; @@ -19122,8 +20252,8 @@ var ts; var newLine = host.getNewLine(); if (targetSourceFile === undefined) { ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (shouldEmitToOwnFile(sourceFile, compilerOptions)) { - var jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, ".js"); + if (ts.shouldEmitToOwnFile(sourceFile, compilerOptions)) { + var jsFilePath = ts.getOwnEmitOutputFilePath(sourceFile, host, ".js"); emitFile(jsFilePath, sourceFile); } }); @@ -19132,8 +20262,8 @@ var ts; } } else { - if (shouldEmitToOwnFile(targetSourceFile, compilerOptions)) { - var jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, host, ".js"); + if (ts.shouldEmitToOwnFile(targetSourceFile, compilerOptions)) { + var jsFilePath = ts.getOwnEmitOutputFilePath(targetSourceFile, host, ".js"); emitFile(jsFilePath, targetSourceFile); } else if (!ts.isDeclarationFile(targetSourceFile) && compilerOptions.out) { @@ -19146,35 +20276,49 @@ var ts; diagnostics: diagnostics, sourceMaps: sourceMapDataList }; + function isNodeDescendentOf(node, ancestor) { + while (node) { + if (node === ancestor) + return true; + node = node.parent; + } + return false; + } + function isUniqueLocalName(name, container) { + for (var node = container; isNodeDescendentOf(node, container); node = node.nextContainer) { + if (node.locals && ts.hasProperty(node.locals, name)) { + if (node.locals[name].flags & (107455 | 1048576 | 8388608)) { + return false; + } + } + } + return true; + } function emitJavaScript(jsFilePath, root) { - var writer = createTextWriter(newLine); + var writer = ts.createTextWriter(newLine); var write = writer.write; var writeTextOfNode = writer.writeTextOfNode; var writeLine = writer.writeLine; var increaseIndent = writer.increaseIndent; var decreaseIndent = writer.decreaseIndent; - var preserveNewLines = compilerOptions.preserveNewLines || false; var currentSourceFile; - var lastFrame; - var currentScopeNames; - var generatedBlockScopeNames; + var generatedNameSet = {}; + var nodeToGeneratedName = []; + var blockScopedVariableToGeneratedName; + var computedPropertyNamesToGeneratedNames; var extendsEmitted = false; - var tempCount = 0; + var decorateEmitted = false; + var tempFlags = 0; var tempVariables; var tempParameters; var externalImports; var exportSpecifiers; - var exportDefault; + var exportEquals; + var hasExportStars; var writeEmittedFiles = writeJavaScriptFile; - var emitLeadingComments = compilerOptions.removeComments ? function (node) { } : emitLeadingDeclarationComments; - var emitTrailingComments = compilerOptions.removeComments ? function (node) { } : emitTrailingDeclarationComments; - var emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos) { } : emitLeadingCommentsOfLocalPosition; var detachedCommentsInfo; - var emitDetachedComments = compilerOptions.removeComments ? function (node) { } : emitDetachedCommentsAtPosition; - var writeComment = writeCommentRange; - var emitNodeWithoutSourceMap = compilerOptions.removeComments ? emitNodeWithoutSourceMapWithoutComments : emitNodeWithoutSourceMapWithComments; + var writeComment = ts.writeCommentRange; var emit = emitNodeWithoutSourceMap; - var emitWithoutComments = emitNodeWithoutSourceMapWithoutComments; var emitStart = function (node) { }; var emitEnd = function (node) { }; var emitToken = emitTokenText; @@ -19201,55 +20345,108 @@ var ts; currentSourceFile = sourceFile; emit(sourceFile); } - function enterNameScope() { - var names = currentScopeNames; - currentScopeNames = undefined; - if (names) { - lastFrame = { names: names, previous: lastFrame }; - return true; - } - return false; + function isUniqueName(name) { + return !resolver.hasGlobalName(name) && + !ts.hasProperty(currentSourceFile.identifiers, name) && + !ts.hasProperty(generatedNameSet, name); } - function exitNameScope(popFrame) { - if (popFrame) { - currentScopeNames = lastFrame.names; - lastFrame = lastFrame.previous; - } - else { - currentScopeNames = undefined; - } - } - function generateUniqueNameForLocation(location, baseName) { - var _name; - if (!isExistingName(location, baseName)) { - _name = baseName; - } - else { - _name = ts.generateUniqueName(baseName, function (n) { return isExistingName(location, n); }); - } - return recordNameInCurrentScope(_name); - } - function recordNameInCurrentScope(name) { - if (!currentScopeNames) { - currentScopeNames = {}; - } - return currentScopeNames[name] = name; - } - function isExistingName(location, name) { - if (!resolver.isUnknownIdentifier(location, name)) { - return true; - } - if (currentScopeNames && ts.hasProperty(currentScopeNames, name)) { - return true; - } - var frame = lastFrame; - while (frame) { - if (ts.hasProperty(frame.names, name)) { - return true; + function makeTempVariableName(flags) { + if (flags && !(tempFlags & flags)) { + var name = flags === 268435456 ? "_i" : "_n"; + if (isUniqueName(name)) { + tempFlags |= flags; + return name; } - frame = frame.previous; } - return false; + while (true) { + var count = tempFlags & 268435455; + tempFlags++; + if (count !== 8 && count !== 13) { + var name_12 = count < 26 ? "_" + String.fromCharCode(97 + count) : "_" + (count - 26); + if (isUniqueName(name_12)) { + return name_12; + } + } + } + } + function makeUniqueName(baseName) { + if (baseName.charCodeAt(baseName.length - 1) !== 95) { + baseName += "_"; + } + var i = 1; + while (true) { + var generatedName = baseName + i; + if (isUniqueName(generatedName)) { + return generatedNameSet[generatedName] = generatedName; + } + i++; + } + } + function assignGeneratedName(node, name) { + nodeToGeneratedName[ts.getNodeId(node)] = ts.unescapeIdentifier(name); + } + function generateNameForFunctionOrClassDeclaration(node) { + if (!node.name) { + assignGeneratedName(node, makeUniqueName("default")); + } + } + function generateNameForModuleOrEnum(node) { + if (node.name.kind === 65) { + var name_13 = node.name.text; + assignGeneratedName(node, isUniqueLocalName(name_13, node) ? name_13 : makeUniqueName(name_13)); + } + } + function generateNameForImportOrExportDeclaration(node) { + var expr = ts.getExternalModuleName(node); + var baseName = expr.kind === 8 ? + ts.escapeIdentifier(ts.makeIdentifierFromModuleName(expr.text)) : "module"; + assignGeneratedName(node, makeUniqueName(baseName)); + } + function generateNameForImportDeclaration(node) { + if (node.importClause) { + generateNameForImportOrExportDeclaration(node); + } + } + function generateNameForExportDeclaration(node) { + if (node.moduleSpecifier) { + generateNameForImportOrExportDeclaration(node); + } + } + function generateNameForExportAssignment(node) { + if (node.expression && node.expression.kind !== 65) { + assignGeneratedName(node, makeUniqueName("default")); + } + } + function generateNameForNode(node) { + switch (node.kind) { + case 200: + case 201: + generateNameForFunctionOrClassDeclaration(node); + break; + case 205: + generateNameForModuleOrEnum(node); + generateNameForNode(node.body); + break; + case 204: + generateNameForModuleOrEnum(node); + break; + case 209: + generateNameForImportDeclaration(node); + break; + case 215: + generateNameForExportDeclaration(node); + break; + case 214: + generateNameForExportAssignment(node); + break; + } + } + function getGeneratedNameForNode(node) { + var nodeId = ts.getNodeId(node); + if (!nodeToGeneratedName[nodeId]) { + generateNameForNode(node); + } + return nodeToGeneratedName[nodeId]; } function initializeEmitterWithSourceMaps() { var sourceMapDir; @@ -19375,8 +20572,8 @@ var ts; if (scopeName) { var parentIndex = getSourceMapNameIndex(); if (parentIndex !== -1) { - var _name = node.name; - if (!_name || _name.kind !== 126) { + var name_14 = node.name; + if (!name_14 || name_14.kind !== 127) { scopeName = "." + scopeName; } scopeName = sourceMapData.sourceMapNames[parentIndex] + scopeName; @@ -19393,19 +20590,19 @@ var ts; if (scopeName) { recordScopeNameStart(scopeName); } - else if (node.kind === 195 || - node.kind === 160 || - node.kind === 132 || - node.kind === 131 || + else if (node.kind === 200 || + node.kind === 162 || node.kind === 134 || - node.kind === 135 || - node.kind === 200 || - node.kind === 196 || - node.kind === 199) { + node.kind === 133 || + node.kind === 136 || + node.kind === 137 || + node.kind === 205 || + node.kind === 201 || + node.kind === 204) { if (node.name) { - var _name = node.name; - scopeName = _name.kind === 126 - ? ts.getTextOfNode(_name) + var name_15 = node.name; + scopeName = name_15.kind === 127 + ? ts.getTextOfNode(name_15) : node.name.text; } recordScopeNameStart(scopeName); @@ -19420,7 +20617,7 @@ var ts; ; function writeCommentRangeWithMap(curentSourceFile, writer, comment, newLine) { recordSourceMapSpan(comment.pos); - writeCommentRange(currentSourceFile, writer, comment, newLine); + ts.writeCommentRange(currentSourceFile, writer, comment, newLine); recordSourceMapSpan(comment.end); } function serializeSourceMapContents(version, file, sourceRoot, sources, names, mappings) { @@ -19448,7 +20645,7 @@ var ts; } function writeJavaScriptAndSourceMapFile(emitOutput, writeByteOrderMark) { encodeLastRecordedSourceMapSpan(); - writeFile(host, diagnostics, sourceMapData.sourceMapFilePath, serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings), false); + ts.writeFile(host, diagnostics, sourceMapData.sourceMapFilePath, serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings), false); sourceMapDataList.push(sourceMapData); writeJavaScriptFile(emitOutput + "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL, writeByteOrderMark); } @@ -19471,7 +20668,7 @@ var ts; if (compilerOptions.mapRoot) { sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); if (root) { - sourceMapDir = ts.getDirectoryPath(getSourceFilePathInNewDir(root, host, sourceMapDir)); + sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(root, host, sourceMapDir)); } if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir); @@ -19484,32 +20681,24 @@ var ts; else { sourceMapDir = ts.getDirectoryPath(ts.normalizePath(jsFilePath)); } - function emitNodeWithSourceMap(node) { + function emitNodeWithSourceMap(node, allowGeneratedIdentifiers) { if (node) { if (ts.nodeIsSynthesized(node)) { - return emitNodeWithoutSourceMap(node); + return emitNodeWithoutSourceMap(node, false); } - if (node.kind != 221) { + if (node.kind != 227) { recordEmitNodeStartSpan(node); - emitNodeWithoutSourceMap(node); + emitNodeWithoutSourceMap(node, allowGeneratedIdentifiers); recordEmitNodeEndSpan(node); } else { recordNewSourceFileStart(node); - emitNodeWithoutSourceMap(node); + emitNodeWithoutSourceMap(node, false); } } } - function emitNodeWithSourceMapWithoutComments(node) { - if (node) { - recordEmitNodeStartSpan(node); - emitNodeWithoutSourceMapWithoutComments(node); - recordEmitNodeEndSpan(node); - } - } writeEmittedFiles = writeJavaScriptAndSourceMapFile; emit = emitNodeWithSourceMap; - emitWithoutComments = emitNodeWithSourceMapWithoutComments; emitStart = recordEmitNodeStartSpan; emitEnd = recordEmitNodeEndSpan; emitToken = writeTextWithSpanRecord; @@ -19518,24 +20707,11 @@ var ts; writeComment = writeCommentRangeWithMap; } function writeJavaScriptFile(emitOutput, writeByteOrderMark) { - writeFile(host, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); + ts.writeFile(host, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); } - function createTempVariable(location, preferredName) { - for (var name = preferredName; !name || isExistingName(location, name); tempCount++) { - var char = 97 + tempCount; - if (char === 105 || char === 110) { - continue; - } - if (tempCount < 26) { - name = "_" + String.fromCharCode(char); - } - else { - name = "_" + (tempCount - 26); - } - } - recordNameInCurrentScope(name); - var result = ts.createSynthesizedNode(64); - result.text = name; + function createTempVariable(flags) { + var result = ts.createSynthesizedNode(65); + result.text = makeTempVariableName(flags); return result; } function recordTempDeclaration(name) { @@ -19544,8 +20720,8 @@ var ts; } tempVariables.push(name); } - function createAndRecordTempVariable(location, preferredName) { - var temp = createTempVariable(location, preferredName); + function createAndRecordTempVariable(flags) { + var temp = createTempVariable(flags); recordTempDeclaration(temp); return temp; } @@ -19595,7 +20771,7 @@ var ts; function emitLinePreservingList(parent, nodes, allowTrailingComma, spacesBetweenBraces) { ts.Debug.assert(nodes.length > 0); increaseIndent(); - if (preserveNewLines && nodeStartPositionsAreOnSameLine(parent, nodes[0])) { + if (nodeStartPositionsAreOnSameLine(parent, nodes[0])) { if (spacesBetweenBraces) { write(" "); } @@ -19605,7 +20781,7 @@ var ts; } for (var i = 0, n = nodes.length; i < n; i++) { if (i) { - if (preserveNewLines && nodeEndIsOnSameLineAsNodeStart(nodes[i - 1], nodes[i])) { + if (nodeEndIsOnSameLineAsNodeStart(nodes[i - 1], nodes[i])) { write(", "); } else { @@ -19619,7 +20795,7 @@ var ts; write(","); } decreaseIndent(); - if (preserveNewLines && nodeEndPositionsAreOnSameLine(parent, ts.lastOrUndefined(nodes))) { + if (nodeEndPositionsAreOnSameLine(parent, ts.lastOrUndefined(nodes))) { if (spacesBetweenBraces) { write(" "); } @@ -19737,7 +20913,7 @@ var ts; write("]"); } function emitDownlevelTaggedTemplate(node) { - var tempVariable = createAndRecordTempVariable(node); + var tempVariable = createAndRecordTempVariable(0); write("("); emit(tempVariable); write(" = "); @@ -19750,10 +20926,10 @@ var ts; emitParenthesizedIf(node.tag, needsParenthesisForPropertyAccessOrInvocation(node.tag)); write("("); emit(tempVariable); - if (node.template.kind === 169) { + if (node.template.kind === 171) { ts.forEach(node.template.templateSpans, function (templateSpan) { write(", "); - var needsParens = templateSpan.expression.kind === 167 + var needsParens = templateSpan.expression.kind === 169 && templateSpan.expression.operatorToken.kind === 23; emitParenthesizedIf(templateSpan.expression, needsParens); }); @@ -19777,7 +20953,7 @@ var ts; } for (var i = 0, n = node.templateSpans.length; i < n; i++) { var templateSpan = node.templateSpans[i]; - var needsParens = templateSpan.expression.kind !== 159 + var needsParens = templateSpan.expression.kind !== 161 && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1; if (i > 0 || headEmitted) { write(" + "); @@ -19792,16 +20968,29 @@ var ts; write(")"); } function shouldEmitTemplateHead() { + // If this expression has an empty head literal and the first template span has a non-empty + // literal, then emitting the empty head literal is not necessary. + // `${ foo } and ${ bar }` + // can be emitted as + // foo + " and " + bar + // This is because it is only required that one of the first two operands in the emit + // output must be a string literal, so that the other operand and all following operands + // are forced into strings. + // + // If the first template span has an empty literal, then the head must still be emitted. + // `${ foo }${ bar }` + // must still be emitted as + // "" + foo + bar ts.Debug.assert(node.templateSpans.length !== 0); return node.head.text.length !== 0 || node.templateSpans[0].literal.text.length === 0; } function templateNeedsParens(template, parent) { switch (parent.kind) { - case 155: - case 156: - return parent.expression === template; case 157: + case 158: + return parent.expression === template; case 159: + case 161: return false; default: return comparePrecedenceToBinaryPlus(parent) !== -1; @@ -19809,7 +20998,7 @@ var ts; } function comparePrecedenceToBinaryPlus(expression) { switch (expression.kind) { - case 167: + case 169: switch (expression.operatorToken.kind) { case 35: case 36: @@ -19821,7 +21010,7 @@ var ts; default: return -1; } - case 168: + case 170: return -1; default: return 1; @@ -19833,11 +21022,27 @@ var ts; emit(span.literal); } function emitExpressionForPropertyName(node) { - ts.Debug.assert(node.kind !== 150); + ts.Debug.assert(node.kind !== 152); if (node.kind === 8) { emitLiteral(node); } - else if (node.kind === 126) { + else if (node.kind === 127) { + if (ts.nodeIsDecorated(node.parent)) { + if (!computedPropertyNamesToGeneratedNames) { + computedPropertyNamesToGeneratedNames = []; + } + var generatedName = computedPropertyNamesToGeneratedNames[node.id]; + if (generatedName) { + write(generatedName); + return; + } + var generatedVariable = createTempVariable(0); + generatedName = generatedVariable.text; + recordTempDeclaration(generatedVariable); + computedPropertyNamesToGeneratedNames[node.id] = generatedName; + write(generatedName); + write(" = "); + } emit(node.expression); } else { @@ -19852,38 +21057,43 @@ var ts; } } function isNotExpressionIdentifier(node) { - var _parent = node.parent; - switch (_parent.kind) { - case 128: - case 193: - case 150: - case 130: + var parent = node.parent; + switch (parent.kind) { case 129: - case 218: - case 219: - case 220: + case 198: + case 152: case 132: case 131: - case 195: + case 224: + case 225: + case 226: case 134: - case 135: - case 160: - case 196: - case 197: - case 199: + case 133: case 200: - case 203: - return _parent.name === node; - case 185: - case 184: - case 209: - return false; + case 136: + case 137: + case 162: + case 201: + case 202: + case 204: + case 205: + case 208: + case 210: + case 211: + return parent.name === node; + case 213: + case 217: + return parent.name === node || parent.propertyName === node; + case 190: case 189: + case 214: + return false; + case 194: return node.parent.label === node; } } function emitExpressionIdentifier(node) { - var substitution = resolver.getExpressionNameSubstitution(node); + var substitution = resolver.getExpressionNameSubstitution(node, getGeneratedNameForNode); if (substitution) { write(substitution); } @@ -19891,15 +21101,21 @@ var ts; writeTextOfNode(currentSourceFile, node); } } - function getBlockScopedVariableId(node) { - return !ts.nodeIsSynthesized(node) && resolver.getBlockScopedVariableId(node); + function getGeneratedNameForIdentifier(node) { + if (ts.nodeIsSynthesized(node) || !blockScopedVariableToGeneratedName) { + return undefined; + } + var variableId = resolver.getBlockScopedVariableId(node); + if (variableId === undefined) { + return undefined; + } + return blockScopedVariableToGeneratedName[variableId]; } - function emitIdentifier(node) { - var variableId = getBlockScopedVariableId(node); - if (variableId !== undefined && generatedBlockScopeNames) { - var text = generatedBlockScopeNames[variableId]; - if (text) { - write(text); + function emitIdentifier(node, allowGeneratedIdentifiers) { + if (allowGeneratedIdentifiers) { + var generatedName = getGeneratedNameForIdentifier(node); + if (generatedName) { + write(generatedName); return; } } @@ -19922,15 +21138,17 @@ var ts; } } function emitSuper(node) { - var flags = resolver.getNodeCheckFlags(node); - if (flags & 16) { - write("_super.prototype"); - } - else if (flags & 32) { - write("_super"); + if (languageVersion >= 2) { + write("super"); } else { - write("super"); + var flags = resolver.getNodeCheckFlags(node); + if (flags & 16) { + write("_super.prototype"); + } + else { + write("_super"); + } } } function emitObjectBindingPattern(node) { @@ -19947,7 +21165,7 @@ var ts; } function emitBindingElement(node) { if (node.propertyName) { - emit(node.propertyName); + emit(node.propertyName, false); write(": "); } if (node.dotDotDotToken) { @@ -19967,12 +21185,12 @@ var ts; } function needsParenthesisForPropertyAccessOrInvocation(node) { switch (node.kind) { - case 64: - case 151: + case 65: case 153: - case 154: case 155: - case 159: + case 156: + case 157: + case 161: return false; } return true; @@ -19980,8 +21198,8 @@ var ts; function emitListWithSpread(elements, multiLine, trailingComma) { var pos = 0; var group = 0; - var _length = elements.length; - while (pos < _length) { + var length = elements.length; + while (pos < length) { if (group === 1) { write(".concat("); } @@ -19989,21 +21207,21 @@ var ts; write(", "); } var e = elements[pos]; - if (e.kind === 171) { + if (e.kind === 173) { e = e.expression; emitParenthesizedIf(e, group === 0 && needsParenthesisForPropertyAccessOrInvocation(e)); pos++; } else { var i = pos; - while (i < _length && elements[i].kind !== 171) { + while (i < length && elements[i].kind !== 173) { i++; } write("["); if (multiLine) { increaseIndent(); } - emitList(elements, pos, i - pos, multiLine, trailingComma && i === _length); + emitList(elements, pos, i - pos, multiLine, trailingComma && i === length); if (multiLine) { decreaseIndent(); } @@ -20017,7 +21235,7 @@ var ts; } } function isSpreadElementExpression(node) { - return node.kind === 171; + return node.kind === 173; } function emitArrayLiteral(node) { var elements = node.elements; @@ -20038,11 +21256,11 @@ var ts; return emit(parenthesizedObjectLiteral); } function createDownlevelObjectLiteralWithComputedProperties(originalObjectLiteral, firstComputedPropertyIndex) { - var tempVar = createAndRecordTempVariable(originalObjectLiteral); - var initialObjectLiteral = ts.createSynthesizedNode(152); + var tempVar = createAndRecordTempVariable(0); + var initialObjectLiteral = ts.createSynthesizedNode(154); initialObjectLiteral.properties = originalObjectLiteral.properties.slice(0, firstComputedPropertyIndex); initialObjectLiteral.flags |= 512; - var propertyPatches = createBinaryExpression(tempVar, 52, initialObjectLiteral); + var propertyPatches = createBinaryExpression(tempVar, 53, initialObjectLiteral); ts.forEach(originalObjectLiteral.properties, function (property) { var patchedProperty = tryCreatePatchingPropertyAssignment(originalObjectLiteral, tempVar, property); if (patchedProperty) { @@ -20060,33 +21278,33 @@ var ts; function tryCreatePatchingPropertyAssignment(objectLiteral, tempVar, property) { var leftHandSide = createMemberAccessForPropertyName(tempVar, property.name); var maybeRightHandSide = tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral, property); - return maybeRightHandSide && createBinaryExpression(leftHandSide, 52, maybeRightHandSide, true); + return maybeRightHandSide && createBinaryExpression(leftHandSide, 53, maybeRightHandSide, true); } function tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral, property) { switch (property.kind) { - case 218: + case 224: return property.initializer; - case 219: - return createIdentifier(resolver.getExpressionNameSubstitution(property.name)); - case 132: - return createFunctionExpression(property.parameters, property.body); + case 225: + return createIdentifier(resolver.getExpressionNameSubstitution(property.name, getGeneratedNameForNode)); case 134: - case 135: - var _a = getAllAccessorDeclarations(objectLiteral.properties, property), firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor; + return createFunctionExpression(property.parameters, property.body); + case 136: + case 137: + var _a = ts.getAllAccessorDeclarations(objectLiteral.properties, property), firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor; if (firstAccessor !== property) { return undefined; } - var propertyDescriptor = ts.createSynthesizedNode(152); + var propertyDescriptor = ts.createSynthesizedNode(154); var descriptorProperties = []; if (getAccessor) { - var _getProperty = createPropertyAssignment(createIdentifier("get"), createFunctionExpression(getAccessor.parameters, getAccessor.body)); - descriptorProperties.push(_getProperty); + var getProperty_1 = createPropertyAssignment(createIdentifier("get"), createFunctionExpression(getAccessor.parameters, getAccessor.body)); + descriptorProperties.push(getProperty_1); } if (setAccessor) { var setProperty = createPropertyAssignment(createIdentifier("set"), createFunctionExpression(setAccessor.parameters, setAccessor.body)); descriptorProperties.push(setProperty); } - var trueExpr = ts.createSynthesizedNode(94); + var trueExpr = ts.createSynthesizedNode(95); var enumerableTrue = createPropertyAssignment(createIdentifier("enumerable"), trueExpr); descriptorProperties.push(enumerableTrue); var configurableTrue = createPropertyAssignment(createIdentifier("configurable"), trueExpr); @@ -20099,14 +21317,14 @@ var ts; } } function createParenthesizedExpression(expression) { - var result = ts.createSynthesizedNode(159); + var result = ts.createSynthesizedNode(161); result.expression = expression; return result; } function createNodeArray() { var elements = []; - for (var _i = 0; _i < arguments.length; _i++) { - elements[_i - 0] = arguments[_i]; + for (var _a = 0; _a < arguments.length; _a++) { + elements[_a - 0] = arguments[_a]; } var result = elements; result.pos = -1; @@ -20114,25 +21332,25 @@ var ts; return result; } function createBinaryExpression(left, operator, right, startsOnNewLine) { - var result = ts.createSynthesizedNode(167, startsOnNewLine); + var result = ts.createSynthesizedNode(169, startsOnNewLine); result.operatorToken = ts.createSynthesizedNode(operator); result.left = left; result.right = right; return result; } function createExpressionStatement(expression) { - var result = ts.createSynthesizedNode(177); + var result = ts.createSynthesizedNode(182); result.expression = expression; return result; } function createMemberAccessForPropertyName(expression, memberName) { - if (memberName.kind === 64) { + if (memberName.kind === 65) { return createPropertyAccessExpression(expression, memberName); } else if (memberName.kind === 8 || memberName.kind === 7) { return createElementAccessExpression(expression, memberName); } - else if (memberName.kind === 126) { + else if (memberName.kind === 127) { return createElementAccessExpression(expression, memberName.expression); } else { @@ -20140,37 +21358,37 @@ var ts; } } function createPropertyAssignment(name, initializer) { - var result = ts.createSynthesizedNode(218); + var result = ts.createSynthesizedNode(224); result.name = name; result.initializer = initializer; return result; } function createFunctionExpression(parameters, body) { - var result = ts.createSynthesizedNode(160); + var result = ts.createSynthesizedNode(162); result.parameters = parameters; result.body = body; return result; } function createPropertyAccessExpression(expression, name) { - var result = ts.createSynthesizedNode(153); + var result = ts.createSynthesizedNode(155); result.expression = expression; result.dotToken = ts.createSynthesizedNode(20); result.name = name; return result; } function createElementAccessExpression(expression, argumentExpression) { - var result = ts.createSynthesizedNode(154); + var result = ts.createSynthesizedNode(156); result.expression = expression; result.argumentExpression = argumentExpression; return result; } function createIdentifier(name, startsOnNewLine) { - var result = ts.createSynthesizedNode(64, startsOnNewLine); + var result = ts.createSynthesizedNode(65, startsOnNewLine); result.text = name; return result; } function createCallExpression(invokedExpression, arguments) { - var result = ts.createSynthesizedNode(155); + var result = ts.createSynthesizedNode(157); result.expression = invokedExpression; result.arguments = arguments; return result; @@ -20181,7 +21399,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 === 126) { + if (properties[i].name.kind === 127) { numInitialNonComputedProperties = i; break; } @@ -20200,34 +21418,47 @@ var ts; } function emitComputedPropertyName(node) { write("["); - emit(node.expression); + emitExpressionForPropertyName(node); write("]"); } function emitMethod(node) { - emit(node.name); + emit(node.name, false); if (languageVersion < 2) { write(": function "); } emitSignatureAndBody(node); } function emitPropertyAssignment(node) { - emit(node.name); + emit(node.name, false); write(": "); emit(node.initializer); } function emitShorthandPropertyAssignment(node) { - emit(node.name); - if (languageVersion < 2 || resolver.getExpressionNameSubstitution(node.name)) { + emit(node.name, false); + if (languageVersion < 2) { + write(": "); + var generatedName = getGeneratedNameForIdentifier(node.name); + if (generatedName) { + write(generatedName); + } + else { + emitExpressionIdentifier(node.name); + } + } + else if (resolver.getExpressionNameSubstitution(node.name, getGeneratedNameForNode)) { write(": "); emitExpressionIdentifier(node.name); } } function tryEmitConstantValue(node) { + if (compilerOptions.separateCompilation) { + return false; + } var constantValue = resolver.getConstantValue(node); if (constantValue !== undefined) { write(constantValue.toString()); if (!compilerOptions.removeComments) { - var propertyName = node.kind === 153 ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); + var propertyName = node.kind === 155 ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); write(" /* " + propertyName + " */"); } return true; @@ -20235,7 +21466,7 @@ var ts; return false; } function indentIfOnDifferentLines(parent, node1, node2, valueToWriteWhenNotIndenting) { - var realNodesAreOnDifferentLines = preserveNewLines && !ts.nodeIsSynthesized(parent) && !nodeEndIsOnSameLineAsNodeStart(node1, node2); + var realNodesAreOnDifferentLines = !ts.nodeIsSynthesized(parent) && !nodeEndIsOnSameLineAsNodeStart(node1, node2); var synthesizedNodeIsOnDifferentLine = synthesizedNodeStartsOnNewLine(node2); if (realNodesAreOnDifferentLines || synthesizedNodeIsOnDifferentLine) { increaseIndent(); @@ -20257,7 +21488,7 @@ var ts; var indentedBeforeDot = indentIfOnDifferentLines(node, node.expression, node.dotToken); write("."); var indentedAfterDot = indentIfOnDifferentLines(node, node.dotToken, node.name); - emit(node.name); + emit(node.name, false); decreaseIndentIf(indentedBeforeDot, indentedAfterDot); } function emitQualifiedName(node) { @@ -20275,20 +21506,20 @@ var ts; write("]"); } function hasSpreadElement(elements) { - return ts.forEach(elements, function (e) { return e.kind === 171; }); + return ts.forEach(elements, function (e) { return e.kind === 173; }); } function skipParentheses(node) { - while (node.kind === 159 || node.kind === 158) { + while (node.kind === 161 || node.kind === 160) { node = node.expression; } return node; } function emitCallTarget(node) { - if (node.kind === 64 || node.kind === 92 || node.kind === 90) { + if (node.kind === 65 || node.kind === 93 || node.kind === 91) { emit(node); return node; } - var temp = createAndRecordTempVariable(node); + var temp = createAndRecordTempVariable(0); write("("); emit(temp); write(" = "); @@ -20299,18 +21530,18 @@ var ts; function emitCallWithSpread(node) { var target; var expr = skipParentheses(node.expression); - if (expr.kind === 153) { + if (expr.kind === 155) { target = emitCallTarget(expr.expression); write("."); emit(expr.name); } - else if (expr.kind === 154) { + else if (expr.kind === 156) { target = emitCallTarget(expr.expression); write("["); emit(expr.argumentExpression); write("]"); } - else if (expr.kind === 90) { + else if (expr.kind === 91) { target = expr; write("_super"); } @@ -20319,7 +21550,7 @@ var ts; } write(".apply("); if (target) { - if (target.kind === 90) { + if (target.kind === 91) { emitThis(target); } else { @@ -20339,15 +21570,15 @@ var ts; return; } var superCall = false; - if (node.expression.kind === 90) { - write("_super"); + if (node.expression.kind === 91) { + emitSuper(node.expression); superCall = true; } else { emit(node.expression); - superCall = node.expression.kind === 153 && node.expression.expression.kind === 90; + superCall = node.expression.kind === 155 && node.expression.expression.kind === 91; } - if (superCall) { + if (superCall && languageVersion < 2) { write(".call("); emitThis(node.expression); if (node.arguments.length) { @@ -20372,7 +21603,7 @@ var ts; } } function emitTaggedTemplateExpression(node) { - if (compilerOptions.target >= 2) { + if (languageVersion >= 2) { emit(node.tag); write(" "); emit(node.template); @@ -20382,20 +21613,20 @@ var ts; } } function emitParenExpression(node) { - if (!node.parent || node.parent.kind !== 161) { - if (node.expression.kind === 158) { + if (!node.parent || node.parent.kind !== 163) { + if (node.expression.kind === 160) { var operand = node.expression.expression; - while (operand.kind == 158) { + while (operand.kind == 160) { operand = operand.expression; } - if (operand.kind !== 165 && - operand.kind !== 164 && - operand.kind !== 163 && - operand.kind !== 162 && + if (operand.kind !== 167 && operand.kind !== 166 && - operand.kind !== 156 && - !(operand.kind === 155 && node.parent.kind === 156) && - !(operand.kind === 160 && node.parent.kind === 155)) { + 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)) { emit(operand); return; } @@ -20406,23 +21637,23 @@ var ts; write(")"); } function emitDeleteExpression(node) { - write(ts.tokenToString(73)); + write(ts.tokenToString(74)); write(" "); emit(node.expression); } function emitVoidExpression(node) { - write(ts.tokenToString(98)); + write(ts.tokenToString(99)); write(" "); emit(node.expression); } function emitTypeOfExpression(node) { - write(ts.tokenToString(96)); + write(ts.tokenToString(97)); write(" "); emit(node.expression); } function emitPrefixUnaryExpression(node) { write(ts.tokenToString(node.operator)); - if (node.operand.kind === 165) { + if (node.operand.kind === 167) { var operand = node.operand; if (node.operator === 33 && (operand.operator === 33 || operand.operator === 38)) { write(" "); @@ -20438,9 +21669,9 @@ var ts; write(ts.tokenToString(node.operator)); } function emitBinaryExpression(node) { - if (languageVersion < 2 && node.operatorToken.kind === 52 && - (node.left.kind === 152 || node.left.kind === 151)) { - emitDestructuring(node, node.parent.kind === 177); + if (languageVersion < 2 && node.operatorToken.kind === 53 && + (node.left.kind === 154 || node.left.kind === 153)) { + emitDestructuring(node, node.parent.kind === 182); } else { emit(node.left); @@ -20476,13 +21707,13 @@ var ts; } } function isSingleLineEmptyBlock(node) { - if (node && node.kind === 174) { + if (node && node.kind === 179) { var block = node; return block.statements.length === 0 && nodeEndIsOnSameLineAsNodeStart(block, block); } } function emitBlock(node) { - if (preserveNewLines && isSingleLineEmptyBlock(node)) { + if (isSingleLineEmptyBlock(node)) { emitToken(14, node.pos); write(" "); emitToken(15, node.statements.end); @@ -20491,12 +21722,12 @@ var ts; emitToken(14, node.pos); increaseIndent(); scopeEmitStart(node.parent); - if (node.kind === 201) { - ts.Debug.assert(node.parent.kind === 200); + if (node.kind === 206) { + ts.Debug.assert(node.parent.kind === 205); emitCaptureThisForNodeIfNecessary(node.parent); } emitLines(node.statements); - if (node.kind === 201) { + if (node.kind === 206) { emitTempDeclarations(true); } decreaseIndent(); @@ -20505,7 +21736,7 @@ var ts; scopeEmitEnd(); } function emitEmbeddedStatement(node) { - if (node.kind === 174) { + if (node.kind === 179) { write(" "); emit(node); } @@ -20517,11 +21748,11 @@ var ts; } } function emitExpressionStatement(node) { - emitParenthesizedIf(node.expression, node.expression.kind === 161); + emitParenthesizedIf(node.expression, node.expression.kind === 163); write(";"); } function emitIfStatement(node) { - var endPos = emitToken(83, node.pos); + var endPos = emitToken(84, node.pos); write(" "); endPos = emitToken(16, endPos); emit(node.expression); @@ -20529,8 +21760,8 @@ var ts; emitEmbeddedStatement(node.thenStatement); if (node.elseStatement) { writeLine(); - emitToken(75, node.thenStatement.end); - if (node.elseStatement.kind === 178) { + emitToken(76, node.thenStatement.end); + if (node.elseStatement.kind === 183) { write(" "); emit(node.elseStatement); } @@ -20542,7 +21773,7 @@ var ts; function emitDoStatement(node) { write("do"); emitEmbeddedStatement(node.statement); - if (node.statement.kind === 174) { + if (node.statement.kind === 179) { write(" "); } else { @@ -20559,13 +21790,13 @@ var ts; emitEmbeddedStatement(node.statement); } function emitStartOfVariableDeclarationList(decl, startPos) { - var tokenKind = 97; + var tokenKind = 98; if (decl && languageVersion >= 2) { if (ts.isLet(decl)) { - tokenKind = 104; + tokenKind = 105; } else if (ts.isConst(decl)) { - tokenKind = 69; + tokenKind = 70; } } if (startPos !== undefined) { @@ -20573,20 +21804,20 @@ var ts; } else { switch (tokenKind) { - case 97: + case 98: return write("var "); - case 104: + case 105: return write("let "); - case 69: + case 70: return write("const "); } } } function emitForStatement(node) { - var endPos = emitToken(81, node.pos); + var endPos = emitToken(82, node.pos); write(" "); endPos = emitToken(16, endPos); - if (node.initializer && node.initializer.kind === 194) { + if (node.initializer && node.initializer.kind === 199) { var variableDeclarationList = node.initializer; var declarations = variableDeclarationList.declarations; emitStartOfVariableDeclarationList(declarations[0], endPos); @@ -20604,13 +21835,13 @@ var ts; emitEmbeddedStatement(node.statement); } function emitForInOrForOfStatement(node) { - if (languageVersion < 2 && node.kind === 183) { + if (languageVersion < 2 && node.kind === 188) { return emitDownLevelForOfStatement(node); } - var endPos = emitToken(81, node.pos); + var endPos = emitToken(82, node.pos); write(" "); endPos = emitToken(16, endPos); - if (node.initializer.kind === 194) { + if (node.initializer.kind === 199) { var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length >= 1) { var decl = variableDeclarationList.declarations[0]; @@ -20622,7 +21853,7 @@ var ts; else { emit(node.initializer); } - if (node.kind === 182) { + if (node.kind === 187) { write(" in "); } else { @@ -20633,13 +21864,32 @@ var ts; emitEmbeddedStatement(node.statement); } function emitDownLevelForOfStatement(node) { - var endPos = emitToken(81, node.pos); + // The following ES6 code: + // + // for (let v of expr) { } + // + // should be emitted as + // + // for (let _i = 0, _a = expr; _i < _a.length; _i++) { + // let v = _a[_i]; + // } + // + // where _a and _i are temps emitted to capture the RHS and the counter, + // respectively. + // When the left hand side is an expression instead of a let declaration, + // the "let v" is not emitted. + // When the left hand side is a let/const, the v is renamed if there is + // another v in scope. + // Note that all assignments to the LHS are emitted in the body, including + // all destructuring. + // Note also that because an extra statement is needed to assign to the LHS, + // for-of bodies are always emitted as blocks. + var endPos = emitToken(82, node.pos); write(" "); endPos = emitToken(16, endPos); - var rhsIsIdentifier = node.expression.kind === 64; - var counter = createTempVariable(node, "_i"); - var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(node); - var cachedLength = compilerOptions.cacheDownlevelForOfLength ? createTempVariable(node, "_n") : undefined; + var rhsIsIdentifier = node.expression.kind === 65; + var counter = createTempVariable(268435456); + var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(0); emitStart(node.expression); write("var "); emitNodeWithoutSourceMap(counter); @@ -20653,24 +21903,12 @@ var ts; emitNodeWithoutSourceMap(node.expression); emitEnd(node.expression); } - if (cachedLength) { - write(", "); - emitNodeWithoutSourceMap(cachedLength); - write(" = "); - emitNodeWithoutSourceMap(rhsReference); - write(".length"); - } write("; "); emitStart(node.initializer); emitNodeWithoutSourceMap(counter); write(" < "); - if (cachedLength) { - emitNodeWithoutSourceMap(cachedLength); - } - else { - emitNodeWithoutSourceMap(rhsReference); - write(".length"); - } + emitNodeWithoutSourceMap(rhsReference); + write(".length"); emitEnd(node.initializer); write("; "); emitStart(node.initializer); @@ -20683,7 +21921,7 @@ var ts; increaseIndent(); var rhsIterationValue = createElementAccessExpression(rhsReference, counter); emitStart(node.initializer); - if (node.initializer.kind === 194) { + if (node.initializer.kind === 199) { write("var "); var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -20698,14 +21936,14 @@ var ts; } } else { - emitNodeWithoutSourceMap(createTempVariable(node)); + emitNodeWithoutSourceMap(createTempVariable(0)); write(" = "); emitNodeWithoutSourceMap(rhsIterationValue); } } else { - var assignmentExpression = createBinaryExpression(node.initializer, 52, rhsIterationValue, false); - if (node.initializer.kind === 151 || node.initializer.kind === 152) { + var assignmentExpression = createBinaryExpression(node.initializer, 53, rhsIterationValue, false); + if (node.initializer.kind === 153 || node.initializer.kind === 154) { emitDestructuring(assignmentExpression, true, undefined, node); } else { @@ -20714,7 +21952,7 @@ var ts; } emitEnd(node.initializer); write(";"); - if (node.statement.kind === 174) { + if (node.statement.kind === 179) { emitLines(node.statement.statements); } else { @@ -20726,12 +21964,12 @@ var ts; write("}"); } function emitBreakOrContinueStatement(node) { - emitToken(node.kind === 185 ? 65 : 70, node.pos); + emitToken(node.kind === 190 ? 66 : 71, node.pos); emitOptional(" ", node.label); write(";"); } function emitReturnStatement(node) { - emitToken(89, node.pos); + emitToken(90, node.pos); emitOptional(" ", node.expression); write(";"); } @@ -20742,7 +21980,7 @@ var ts; emitEmbeddedStatement(node.statement); } function emitSwitchStatement(node) { - var endPos = emitToken(91, node.pos); + var endPos = emitToken(92, node.pos); write(" "); emitToken(16, endPos); emit(node.expression); @@ -20759,19 +21997,19 @@ var ts; emitToken(15, node.clauses.end); } function nodeStartPositionsAreOnSameLine(node1, node2) { - return getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node1.pos)) === - getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); + return ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node1.pos)) === + ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); } function nodeEndPositionsAreOnSameLine(node1, node2) { - return getLineOfLocalPosition(currentSourceFile, node1.end) === - getLineOfLocalPosition(currentSourceFile, node2.end); + return ts.getLineOfLocalPosition(currentSourceFile, node1.end) === + ts.getLineOfLocalPosition(currentSourceFile, node2.end); } function nodeEndIsOnSameLineAsNodeStart(node1, node2) { - return getLineOfLocalPosition(currentSourceFile, node1.end) === - getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); + return ts.getLineOfLocalPosition(currentSourceFile, node1.end) === + ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 214) { + if (node.kind === 220) { write("case "); emit(node.expression); write(":"); @@ -20779,7 +22017,7 @@ var ts; else { write("default:"); } - if (preserveNewLines && node.statements.length === 1 && nodeStartPositionsAreOnSameLine(node, node.statements[0])) { + if (node.statements.length === 1 && nodeStartPositionsAreOnSameLine(node, node.statements[0])) { write(" "); emit(node.statements[0]); } @@ -20806,7 +22044,7 @@ var ts; } function emitCatchClause(node) { writeLine(); - var endPos = emitToken(67, node.pos); + var endPos = emitToken(68, node.pos); write(" "); emitToken(16, endPos); emit(node.variableDeclaration); @@ -20815,7 +22053,7 @@ var ts; emitBlock(node.block); } function emitDebuggerStatement(node) { - emitToken(71, node.pos); + emitToken(72, node.pos); write(";"); } function emitLabelledStatement(node) { @@ -20826,18 +22064,24 @@ var ts; function getContainingModule(node) { do { node = node.parent; - } while (node && node.kind !== 200); + } while (node && node.kind !== 205); return node; } function emitContainingModuleName(node) { var container = getContainingModule(node); - write(container ? resolver.getGeneratedNameForNode(container) : "exports"); + write(container ? getGeneratedNameForNode(container) : "exports"); } function emitModuleMemberName(node) { emitStart(node.name); if (ts.getCombinedNodeFlags(node) & 1) { - emitContainingModuleName(node); - write("."); + var container = getContainingModule(node); + if (container) { + write(getGeneratedNameForNode(container)); + write("."); + } + else if (languageVersion < 2) { + write("exports."); + } } emitNodeWithoutSourceMap(node.name); emitEnd(node.name); @@ -20845,13 +22089,30 @@ var ts; function createVoidZero() { var zero = ts.createSynthesizedNode(7); zero.text = "0"; - var result = ts.createSynthesizedNode(164); + var result = ts.createSynthesizedNode(166); result.expression = zero; return result; } + function emitExportMemberAssignment(node) { + if (node.flags & 1) { + writeLine(); + emitStart(node); + if (node.flags & 256) { + write("exports.default"); + } + else { + emitModuleMemberName(node); + } + write(" = "); + emitDeclarationName(node); + emitEnd(node); + write(";"); + } + } function emitExportMemberAssignments(name) { - if (!exportDefault && exportSpecifiers && ts.hasProperty(exportSpecifiers, name.text)) { - ts.forEach(exportSpecifiers[name.text], function (specifier) { + if (!exportEquals && exportSpecifiers && ts.hasProperty(exportSpecifiers, name.text)) { + for (var _a = 0, _b = exportSpecifiers[name.text]; _a < _b.length; _a++) { + var specifier = _b[_a]; writeLine(); emitStart(specifier.name); emitContainingModuleName(specifier); @@ -20859,15 +22120,15 @@ var ts; emitNodeWithoutSourceMap(specifier.name); emitEnd(specifier.name); write(" = "); - emitNodeWithoutSourceMap(name); + emitExpressionIdentifier(name); write(";"); - }); + } } } function emitDestructuring(root, isAssignmentExpressionStatement, value, lowestNonSynthesizedAncestor) { var emitCount = 0; - var _isDeclaration = (root.kind === 193 && !(ts.getCombinedNodeFlags(root) & 1)) || root.kind === 128; - if (root.kind === 167) { + var isDeclaration = (root.kind === 198 && !(ts.getCombinedNodeFlags(root) & 1)) || root.kind === 129; + if (root.kind === 169) { emitAssignmentExpression(root); } else { @@ -20879,7 +22140,7 @@ var ts; write(", "); } renameNonTopLevelLetAndConst(name); - if (name.parent && (name.parent.kind === 193 || name.parent.kind === 150)) { + if (name.parent && (name.parent.kind === 198 || name.parent.kind === 152)) { emitModuleMemberName(name.parent); } else { @@ -20889,9 +22150,9 @@ var ts; emit(value); } function ensureIdentifier(expr) { - if (expr.kind !== 64) { - var identifier = createTempVariable(lowestNonSynthesizedAncestor || root); - if (!_isDeclaration) { + if (expr.kind !== 65) { + var identifier = createTempVariable(0); + if (!isDeclaration) { recordTempDeclaration(identifier); } emitAssignment(identifier, expr); @@ -20901,14 +22162,14 @@ var ts; } function createDefaultValueCheck(value, defaultValue) { value = ensureIdentifier(value); - var equals = ts.createSynthesizedNode(167); + var equals = ts.createSynthesizedNode(169); 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(168); + var cond = ts.createSynthesizedNode(170); cond.condition = condition; cond.questionToken = ts.createSynthesizedNode(50); cond.whenTrue = whenTrue; @@ -20922,21 +22183,21 @@ var ts; return node; } function parenthesizeForAccess(expr) { - if (expr.kind === 64 || expr.kind === 153 || expr.kind === 154) { + if (expr.kind === 65 || expr.kind === 155 || expr.kind === 156) { return expr; } - var node = ts.createSynthesizedNode(159); + var node = ts.createSynthesizedNode(161); node.expression = expr; return node; } function createPropertyAccess(object, propName) { - if (propName.kind !== 64) { + if (propName.kind !== 65) { return createElementAccess(object, propName); } return createPropertyAccessExpression(parenthesizeForAccess(object), propName); } function createElementAccess(object, index) { - var node = ts.createSynthesizedNode(154); + var node = ts.createSynthesizedNode(156); node.expression = parenthesizeForAccess(object); node.argumentExpression = index; return node; @@ -20946,9 +22207,9 @@ var ts; if (properties.length !== 1) { value = ensureIdentifier(value); } - for (var _i = 0, _n = properties.length; _i < _n; _i++) { - var p = properties[_i]; - if (p.kind === 218 || p.kind === 219) { + for (var _a = 0; _a < properties.length; _a++) { + var p = properties[_a]; + if (p.kind === 224 || p.kind === 225) { var propName = (p.name); emitDestructuringAssignment(p.initializer || propName, createPropertyAccess(value, propName)); } @@ -20961,8 +22222,8 @@ var ts; } for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 172) { - if (e.kind !== 171) { + if (e.kind !== 175) { + if (e.kind !== 173) { emitDestructuringAssignment(e, createElementAccess(value, createNumericLiteral(i))); } else { @@ -20976,14 +22237,14 @@ var ts; } } function emitDestructuringAssignment(target, value) { - if (target.kind === 167 && target.operatorToken.kind === 52) { + if (target.kind === 169 && target.operatorToken.kind === 53) { value = createDefaultValueCheck(value, target.right); target = target.left; } - if (target.kind === 152) { + if (target.kind === 154) { emitObjectLiteralAssignment(target, value); } - else if (target.kind === 151) { + else if (target.kind === 153) { emitArrayLiteralAssignment(target, value); } else { @@ -20992,19 +22253,19 @@ var ts; } function emitAssignmentExpression(root) { var target = root.left; - var _value = root.right; + var value = root.right; if (isAssignmentExpressionStatement) { - emitDestructuringAssignment(target, _value); + emitDestructuringAssignment(target, value); } else { - if (root.parent.kind !== 159) { + if (root.parent.kind !== 161) { write("("); } - _value = ensureIdentifier(_value); - emitDestructuringAssignment(target, _value); + value = ensureIdentifier(value); + emitDestructuringAssignment(target, value); write(", "); - emit(_value); - if (root.parent.kind !== 159) { + emit(value); + if (root.parent.kind !== 161) { write(")"); } } @@ -21024,11 +22285,11 @@ var ts; } for (var i = 0; i < elements.length; i++) { var element = elements[i]; - if (pattern.kind === 148) { + if (pattern.kind === 150) { var propName = element.propertyName || element.name; emitBindingElement(element, createPropertyAccess(value, propName)); } - else if (element.kind !== 172) { + else if (element.kind !== 175) { if (!element.dotDotDotToken) { emitBindingElement(element, createElementAccess(value, createNumericLiteral(i))); } @@ -21065,8 +22326,8 @@ var ts; var isUninitializedLet = (resolver.getNodeCheckFlags(node) & 256) && (getCombinedFlagsForIdentifier(node.name) & 4096); if (isUninitializedLet && - node.parent.parent.kind !== 182 && - node.parent.parent.kind !== 183) { + node.parent.parent.kind !== 187 && + node.parent.parent.kind !== 188) { initializer = createVoidZero(); } } @@ -21074,16 +22335,19 @@ var ts; } } function emitExportVariableAssignments(node) { - var _name = node.name; - if (_name.kind === 64) { - emitExportMemberAssignments(_name); + if (node.kind === 175) { + return; } - else if (ts.isBindingPattern(_name)) { - ts.forEach(_name.elements, emitExportVariableAssignments); + var name = node.name; + if (name.kind === 65) { + emitExportMemberAssignments(name); + } + else if (ts.isBindingPattern(name)) { + ts.forEach(name.elements, emitExportVariableAssignments); } } function getCombinedFlagsForIdentifier(node) { - if (!node.parent || (node.parent.kind !== 193 && node.parent.kind !== 150)) { + if (!node.parent || (node.parent.kind !== 198 && node.parent.kind !== 152)) { return 0; } return ts.getCombinedNodeFlags(node.parent); @@ -21091,33 +22355,49 @@ var ts; function renameNonTopLevelLetAndConst(node) { if (languageVersion >= 2 || ts.nodeIsSynthesized(node) || - node.kind !== 64 || - (node.parent.kind !== 193 && node.parent.kind !== 150)) { + node.kind !== 65 || + (node.parent.kind !== 198 && node.parent.kind !== 152)) { return; } var combinedFlags = getCombinedFlagsForIdentifier(node); if (((combinedFlags & 12288) === 0) || combinedFlags & 1) { return; } - var list = ts.getAncestor(node, 194); - if (list.parent.kind === 175 && list.parent.parent.kind === 221) { - 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); + if (isSourceFileLevelBinding || isModuleLevelBinding || isFunctionLevelBinding) { + return; + } } var blockScopeContainer = ts.getEnclosingBlockScopeContainer(node); - var _parent = blockScopeContainer.kind === 221 + var parent = blockScopeContainer.kind === 227 ? blockScopeContainer : blockScopeContainer.parent; - var generatedName = generateUniqueNameForLocation(_parent, node.text); - var variableId = resolver.getBlockScopedVariableId(node); - if (!generatedBlockScopeNames) { - generatedBlockScopeNames = []; + if (resolver.resolvesToSomeValue(parent, node.text)) { + var variableId = resolver.getBlockScopedVariableId(node); + if (!blockScopedVariableToGeneratedName) { + blockScopedVariableToGeneratedName = []; + } + var generatedName = makeUniqueName(node.text); + blockScopedVariableToGeneratedName[variableId] = generatedName; } - generatedBlockScopeNames[variableId] = generatedName; + } + function isES6ExportedDeclaration(node) { + return !!(node.flags & 1) && + languageVersion >= 2 && + node.parent.kind === 227; } function emitVariableStatement(node) { if (!(node.flags & 1)) { emitStartOfVariableDeclarationList(node.declarationList); } + else if (isES6ExportedDeclaration(node)) { + write("export "); + emitStartOfVariableDeclarationList(node.declarationList); + } emitCommaList(node.declarationList.declarations); write(";"); if (languageVersion < 2 && node.parent === currentSourceFile) { @@ -21127,12 +22407,12 @@ var ts; function emitParameter(node) { if (languageVersion < 2) { if (ts.isBindingPattern(node.name)) { - var _name = createTempVariable(node); + var name_16 = createTempVariable(0); if (!tempParameters) { tempParameters = []; } - tempParameters.push(_name); - emit(_name); + tempParameters.push(name_16); + emit(name_16); } else { emit(node.name); @@ -21179,7 +22459,7 @@ var ts; if (languageVersion < 2 && ts.hasRestParameters(node)) { var restIndex = node.parameters.length - 1; var restParam = node.parameters[restIndex]; - var tempName = createTempVariable(node, "_i").text; + var tempName = createTempVariable(268435456).text; writeLine(); emitLeadingComments(restParam); emitStart(restParam); @@ -21214,39 +22494,53 @@ var ts; } } function emitAccessor(node) { - write(node.kind === 134 ? "get " : "set "); - emit(node.name); + write(node.kind === 136 ? "get " : "set "); + emit(node.name, false); emitSignatureAndBody(node); } function shouldEmitAsArrowFunction(node) { - return node.kind === 161 && languageVersion >= 2; + return node.kind === 163 && languageVersion >= 2; } function emitDeclarationName(node) { if (node.name) { emitNodeWithoutSourceMap(node.name); } else { - write(resolver.getGeneratedNameForNode(node)); + write(getGeneratedNameForNode(node)); + } + } + function shouldEmitFunctionName(node) { + if (node.kind === 162) { + return !!node.name; + } + if (node.kind === 200) { + return !!node.name || languageVersion < 2; } } function emitFunctionDeclaration(node) { if (ts.nodeIsMissing(node.body)) { - return emitPinnedOrTripleSlashComments(node); + return emitOnlyPinnedOrTripleSlashComments(node); } - if (node.kind !== 132 && node.kind !== 131) { + if (node.kind !== 134 && node.kind !== 133) { emitLeadingComments(node); } if (!shouldEmitAsArrowFunction(node)) { + if (isES6ExportedDeclaration(node)) { + write("export "); + if (node.flags & 256) { + write("default "); + } + } write("function "); } - if (node.kind === 195 || (node.kind === 160 && node.name)) { + if (shouldEmitFunctionName(node)) { emitDeclarationName(node); } emitSignatureAndBody(node); - if (languageVersion < 2 && node.kind === 195 && node.parent === currentSourceFile && node.name) { + if (languageVersion < 2 && node.kind === 200 && node.parent === currentSourceFile && node.name) { emitExportMemberAssignments(node.name); } - if (node.kind !== 132 && node.kind !== 131) { + if (node.kind !== 134 && node.kind !== 133) { emitTrailingComments(node); } } @@ -21277,13 +22571,12 @@ var ts; emitSignatureParameters(node); } function emitSignatureAndBody(node) { - var saveTempCount = tempCount; + var saveTempFlags = tempFlags; var saveTempVariables = tempVariables; var saveTempParameters = tempParameters; - tempCount = 0; + tempFlags = 0; tempVariables = undefined; tempParameters = undefined; - var popFrame = enterNameScope(); if (shouldEmitAsArrowFunction(node)) { emitSignatureParametersForArrow(node); write(" =>"); @@ -21294,23 +22587,16 @@ var ts; if (!node.body) { write(" { }"); } - else if (node.body.kind === 174) { + else if (node.body.kind === 179) { emitBlockFunctionBody(node, node.body); } else { emitExpressionFunctionBody(node, node.body); } - if (node.flags & 1 && !(node.flags & 256)) { - writeLine(); - emitStart(node); - emitModuleMemberName(node); - write(" = "); - emitDeclarationName(node); - emitEnd(node); - write(";"); + if (!isES6ExportedDeclaration(node)) { + emitExportMemberAssignment(node); } - exitNameScope(popFrame); - tempCount = saveTempCount; + tempFlags = saveTempFlags; tempVariables = saveTempVariables; tempParameters = saveTempParameters; } @@ -21326,10 +22612,10 @@ var ts; } write(" "); var current = body; - while (current.kind === 158) { + while (current.kind === 160) { current = current.expression; } - emitParenthesizedIf(body, current.kind === 152); + emitParenthesizedIf(body, current.kind === 154); } function emitDownLevelExpressionFunctionBody(node, body) { write(" {"); @@ -21340,11 +22626,11 @@ var ts; emitFunctionBodyPreamble(node); var preambleEmitted = writer.getTextPos() !== outPos; decreaseIndent(); - if (preserveNewLines && !preambleEmitted && nodeStartPositionsAreOnSameLine(node, body)) { + if (!preambleEmitted && nodeStartPositionsAreOnSameLine(node, body)) { write(" "); emitStart(body); write("return "); - emitWithoutComments(body); + emit(body); emitEnd(body); write(";"); emitTempDeclarations(false); @@ -21355,7 +22641,7 @@ var ts; writeLine(); emitLeadingComments(node.body); write("return "); - emitWithoutComments(node.body); + emit(body); write(";"); emitTrailingComments(node.body); emitTempDeclarations(true); @@ -21377,9 +22663,9 @@ var ts; emitFunctionBodyPreamble(node); decreaseIndent(); var preambleEmitted = writer.getTextPos() !== initialTextPos; - if (preserveNewLines && !preambleEmitted && nodeEndIsOnSameLineAsNodeStart(body, body)) { - for (var _i = 0, _a = body.statements, _n = _a.length; _i < _n; _i++) { - var statement = _a[_i]; + if (!preambleEmitted && nodeEndIsOnSameLineAsNodeStart(body, body)) { + for (var _a = 0, _b = body.statements; _a < _b.length; _a++) { + var statement = _b[_a]; write(" "); emit(statement); } @@ -21401,11 +22687,11 @@ var ts; function findInitialSuperCall(ctor) { if (ctor.body) { var statement = ctor.body.statements[0]; - if (statement && statement.kind === 177) { + if (statement && statement.kind === 182) { var expr = statement.expression; - if (expr && expr.kind === 155) { + if (expr && expr.kind === 157) { var func = expr.expression; - if (func && func.kind === 90) { + if (func && func.kind === 91) { return statement; } } @@ -21434,7 +22720,7 @@ var ts; emitNodeWithoutSourceMap(memberName); write("]"); } - else if (memberName.kind === 126) { + else if (memberName.kind === 127) { emitComputedPropertyName(memberName); } else { @@ -21444,7 +22730,7 @@ var ts; } function emitMemberAssignments(node, staticFlag) { ts.forEach(node.members, function (member) { - if (member.kind === 130 && (member.flags & 128) === staticFlag && member.initializer) { + if (member.kind === 132 && (member.flags & 128) === staticFlag && member.initializer) { writeLine(); emitLeadingComments(member); emitStart(member); @@ -21465,20 +22751,21 @@ var ts; } }); } - function emitMemberFunctions(node) { + function emitMemberFunctionsForES5AndLower(node) { ts.forEach(node.members, function (member) { - if (member.kind === 132 || node.kind === 131) { + if (member.kind === 178) { + writeLine(); + write(";"); + } + else if (member.kind === 134 || node.kind === 133) { if (!member.body) { - return emitPinnedOrTripleSlashComments(member); + return emitOnlyPinnedOrTripleSlashComments(member); } writeLine(); emitLeadingComments(member); emitStart(member); emitStart(member.name); - emitDeclarationName(node); - if (!(member.flags & 128)) { - write(".prototype"); - } + emitClassMemberPrefix(node, member); emitMemberAccessForPropertyName(member.name); emitEnd(member.name); write(" = "); @@ -21489,17 +22776,14 @@ var ts; write(";"); emitTrailingComments(member); } - else if (member.kind === 134 || member.kind === 135) { - var accessors = getAllAccessorDeclarations(node.members, member); + else if (member.kind === 136 || member.kind === 137) { + var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { writeLine(); emitStart(member); write("Object.defineProperty("); emitStart(member.name); - emitDeclarationName(node); - if (!(member.flags & 128)) { - write(".prototype"); - } + emitClassMemberPrefix(node, member); write(", "); emitExpressionForPropertyName(member.name); emitEnd(member.name); @@ -21539,15 +22823,240 @@ 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) { + emitOnlyPinnedOrTripleSlashComments(member); + } + else if (member.kind === 134 || + member.kind === 136 || + member.kind === 137) { + writeLine(); + emitLeadingComments(member); + emitStart(member); + if (member.flags & 128) { + write("static "); + } + if (member.kind === 136) { + write("get "); + } + else if (member.kind === 137) { + write("set "); + } + emit(member.name); + emitSignatureAndBody(member); + emitEnd(member); + emitTrailingComments(member); + } + else if (member.kind === 178) { + writeLine(); + write(";"); + } + } + } + function emitConstructor(node, baseTypeElement) { + var saveTempFlags = tempFlags; + var saveTempVariables = tempVariables; + var saveTempParameters = tempParameters; + tempFlags = 0; + tempVariables = undefined; + tempParameters = undefined; + var hasInstancePropertyWithInitializer = false; + ts.forEach(node.members, function (member) { + if (member.kind === 135 && !member.body) { + emitOnlyPinnedOrTripleSlashComments(member); + } + if (member.kind === 132 && member.initializer && (member.flags & 128) === 0) { + hasInstancePropertyWithInitializer = true; + } + }); + var ctor = ts.getFirstConstructorWithBody(node); + if (languageVersion >= 2 && !ctor && !hasInstancePropertyWithInitializer) { + return; + } + if (ctor) { + emitLeadingComments(ctor); + } + emitStart(ctor || node); + if (languageVersion < 2) { + write("function "); + emitDeclarationName(node); + emitSignatureParameters(ctor); + } + else { + write("constructor"); + if (ctor) { + emitSignatureParameters(ctor); + } + else { + if (baseTypeElement) { + write("(...args)"); + } + else { + write("()"); + } + } + } + write(" {"); + scopeEmitStart(node, "constructor"); + increaseIndent(); + if (ctor) { + emitDetachedComments(ctor.body.statements); + } + emitCaptureThisForNodeIfNecessary(node); + if (ctor) { + emitDefaultValueAssignments(ctor); + emitRestParameter(ctor); + if (baseTypeElement) { + var superCall = findInitialSuperCall(ctor); + if (superCall) { + writeLine(); + emit(superCall); + } + } + emitParameterPropertyAssignments(ctor); + } + else { + if (baseTypeElement) { + writeLine(); + emitStart(baseTypeElement); + if (languageVersion < 2) { + write("_super.apply(this, arguments);"); + } + else { + write("super(...args);"); + } + emitEnd(baseTypeElement); + } + } + emitMemberAssignments(node, 0); + if (ctor) { + var statements = ctor.body.statements; + if (superCall) { + statements = statements.slice(1); + } + emitLines(statements); + } + emitTempDeclarations(true); + writeLine(); + if (ctor) { + emitLeadingCommentsOfPosition(ctor.body.statements.end); + } + decreaseIndent(); + emitToken(15, ctor ? ctor.body.statements.end : node.members.end); + scopeEmitEnd(); + emitEnd(ctor || node); + if (ctor) { + emitTrailingComments(ctor); + } + tempFlags = saveTempFlags; + tempVariables = saveTempVariables; + tempParameters = saveTempParameters; + } + function emitClassExpression(node) { + return emitClassLikeDeclaration(node); + } function emitClassDeclaration(node) { - write("var "); - emitDeclarationName(node); - write(" = (function ("); - var baseTypeNode = ts.getClassBaseTypeNode(node); + return emitClassLikeDeclaration(node); + } + function emitClassLikeDeclaration(node) { + if (languageVersion < 2) { + emitClassLikeDeclarationBelowES6(node); + } + else { + emitClassLikeDeclarationForES6AndHigher(node); + } + } + function emitClassLikeDeclarationForES6AndHigher(node) { + var thisNodeIsDecorated = ts.nodeIsDecorated(node); + if (node.kind === 201) { + if (thisNodeIsDecorated) { + if (isES6ExportedDeclaration(node) && !(node.flags & 256)) { + write("export "); + } + write("let "); + emitDeclarationName(node); + write(" = "); + } + else if (isES6ExportedDeclaration(node)) { + write("export "); + if (node.flags & 256) { + write("default "); + } + } + } + write("class"); + if ((node.name || !(node.flags & 256)) && !thisNodeIsDecorated) { + write(" "); + emitDeclarationName(node); + } + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); + if (baseTypeNode) { + write(" extends "); + emit(baseTypeNode.expression); + } + write(" {"); + increaseIndent(); + scopeEmitStart(node); + writeLine(); + emitConstructor(node, baseTypeNode); + emitMemberFunctionsForES6AndHigher(node); + decreaseIndent(); + writeLine(); + emitToken(15, node.members.end); + scopeEmitEnd(); + if (thisNodeIsDecorated) { + write(";"); + if (node.name) { + writeLine(); + write("Object.defineProperty("); + emitDeclarationName(node); + write(", \"name\", { value: \""); + emitDeclarationName(node); + write("\", configurable: true });"); + writeLine(); + } + } + writeLine(); + emitMemberAssignments(node, 128); + emitDecoratorsOfClass(node); + if (!isES6ExportedDeclaration(node) && (node.flags & 1)) { + writeLine(); + emitStart(node); + emitModuleMemberName(node); + write(" = "); + emitDeclarationName(node); + emitEnd(node); + write(";"); + } + else if (isES6ExportedDeclaration(node) && (node.flags & 256) && thisNodeIsDecorated) { + writeLine(); + write("export default "); + emitDeclarationName(node); + write(";"); + } + } + function emitClassLikeDeclarationBelowES6(node) { + if (node.kind === 201) { + write("var "); + emitDeclarationName(node); + write(" = "); + } + write("(function ("); + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { write("_super"); } write(") {"); + var saveTempFlags = tempFlags; + var saveTempVariables = tempVariables; + var saveTempParameters = tempParameters; + var saveComputedPropertyNamesToGeneratedNames = computedPropertyNamesToGeneratedNames; + tempFlags = 0; + tempVariables = undefined; + tempParameters = undefined; + computedPropertyNamesToGeneratedNames = undefined; increaseIndent(); scopeEmitStart(node); if (baseTypeNode) { @@ -21559,15 +23068,22 @@ var ts; emitEnd(baseTypeNode); } writeLine(); - emitConstructorOfClass(); - emitMemberFunctions(node); + emitConstructor(node, baseTypeNode); + emitMemberFunctionsForES5AndLower(node); emitMemberAssignments(node, 128); writeLine(); + emitDecoratorsOfClass(node); + writeLine(); emitToken(15, node.members.end, function () { write("return "); emitDeclarationName(node); }); write(";"); + emitTempDeclarations(true); + tempFlags = saveTempFlags; + tempVariables = saveTempVariables; + tempParameters = saveTempParameters; + computedPropertyNamesToGeneratedNames = saveComputedPropertyNamesToGeneratedNames; decreaseIndent(); writeLine(); emitToken(15, node.members.end); @@ -21575,109 +23091,170 @@ var ts; emitStart(node); write(")("); if (baseTypeNode) { - emit(baseTypeNode.typeName); + emit(baseTypeNode.expression); } - write(");"); - emitEnd(node); - if (node.flags & 1 && !(node.flags & 256)) { - writeLine(); - emitStart(node); - emitModuleMemberName(node); - write(" = "); - emitDeclarationName(node); - emitEnd(node); + write(")"); + if (node.kind === 201) { write(";"); } + emitEnd(node); + if (node.kind === 201) { + emitExportMemberAssignment(node); + } if (languageVersion < 2 && node.parent === currentSourceFile && node.name) { emitExportMemberAssignments(node.name); } - function emitConstructorOfClass() { - var saveTempCount = tempCount; - var saveTempVariables = tempVariables; - var saveTempParameters = tempParameters; - tempCount = 0; - tempVariables = undefined; - tempParameters = undefined; - var popFrame = enterNameScope(); - ts.forEach(node.members, function (member) { - if (member.kind === 133 && !member.body) { - emitPinnedOrTripleSlashComments(member); - } - }); - var ctor = getFirstConstructorWithBody(node); - if (ctor) { - emitLeadingComments(ctor); - } - emitStart(ctor || node); - write("function "); - emitDeclarationName(node); - emitSignatureParameters(ctor); - write(" {"); - scopeEmitStart(node, "constructor"); - increaseIndent(); - if (ctor) { - emitDetachedComments(ctor.body.statements); - } - emitCaptureThisForNodeIfNecessary(node); - var superCall; - if (ctor) { - emitDefaultValueAssignments(ctor); - emitRestParameter(ctor); - if (baseTypeNode) { - superCall = findInitialSuperCall(ctor); - if (superCall) { - writeLine(); - emit(superCall); - } - } - emitParameterPropertyAssignments(ctor); - } - else { - if (baseTypeNode) { - writeLine(); - emitStart(baseTypeNode); - write("_super.apply(this, arguments);"); - emitEnd(baseTypeNode); - } - } - emitMemberAssignments(node, 0); - if (ctor) { - var statements = ctor.body.statements; - if (superCall) - statements = statements.slice(1); - emitLines(statements); - } - emitTempDeclarations(true); - writeLine(); - if (ctor) { - emitLeadingCommentsOfPosition(ctor.body.statements.end); - } - decreaseIndent(); - emitToken(15, ctor ? ctor.body.statements.end : node.members.end); - scopeEmitEnd(); - emitEnd(ctor || node); - if (ctor) { - emitTrailingComments(ctor); - } - exitNameScope(popFrame); - tempCount = saveTempCount; - tempVariables = saveTempVariables; - tempParameters = saveTempParameters; + } + function emitClassMemberPrefix(node, member) { + emitDeclarationName(node); + if (!(member.flags & 128)) { + write(".prototype"); } } + function emitDecoratorsOfClass(node) { + emitDecoratorsOfMembers(node, 0); + emitDecoratorsOfMembers(node, 128); + emitDecoratorsOfConstructor(node); + } + function emitDecoratorsOfConstructor(node) { + var constructor = ts.getFirstConstructorWithBody(node); + if (constructor) { + emitDecoratorsOfParameters(node, constructor); + } + if (!ts.nodeIsDecorated(node)) { + return; + } + writeLine(); + emitStart(node); + emitDeclarationName(node); + write(" = "); + emitDecorateStart(node.decorators); + emitDeclarationName(node); + write(");"); + emitEnd(node); + writeLine(); + } + function emitDecoratorsOfMembers(node, staticFlag) { + ts.forEach(node.members, function (member) { + if ((member.flags & 128) !== staticFlag) { + return; + } + var decorators; + switch (member.kind) { + case 134: + emitDecoratorsOfParameters(node, member); + decorators = member.decorators; + break; + case 136: + case 137: + var accessors = ts.getAllAccessorDeclarations(node.members, member); + if (member !== accessors.firstAccessor) { + return; + } + if (accessors.setAccessor) { + emitDecoratorsOfParameters(node, accessors.setAccessor); + } + decorators = accessors.firstAccessor.decorators; + if (!decorators && accessors.secondAccessor) { + decorators = accessors.secondAccessor.decorators; + } + break; + case 132: + decorators = member.decorators; + break; + default: + return; + } + if (!decorators) { + return; + } + writeLine(); + emitStart(member); + if (member.kind !== 132) { + write("Object.defineProperty("); + emitStart(member.name); + emitClassMemberPrefix(node, member); + write(", "); + emitExpressionForPropertyName(member.name); + emitEnd(member.name); + write(", "); + } + emitDecorateStart(decorators); + emitStart(member.name); + emitClassMemberPrefix(node, member); + write(", "); + emitExpressionForPropertyName(member.name); + emitEnd(member.name); + if (member.kind !== 132) { + write(", Object.getOwnPropertyDescriptor("); + emitStart(member.name); + emitClassMemberPrefix(node, member); + write(", "); + emitExpressionForPropertyName(member.name); + emitEnd(member.name); + write("))"); + } + write(");"); + emitEnd(member); + writeLine(); + }); + } + function emitDecoratorsOfParameters(node, member) { + ts.forEach(member.parameters, function (parameter, parameterIndex) { + if (!ts.nodeIsDecorated(parameter)) { + return; + } + writeLine(); + emitStart(parameter); + emitDecorateStart(parameter.decorators); + emitStart(parameter.name); + if (member.kind === 135) { + emitDeclarationName(node); + write(", void 0"); + } + else { + emitClassMemberPrefix(node, member); + write(", "); + emitExpressionForPropertyName(member.name); + } + write(", "); + write(String(parameterIndex)); + emitEnd(parameter.name); + write(");"); + emitEnd(parameter); + writeLine(); + }); + } + function emitDecorateStart(decorators) { + write("__decorate(["); + var decoratorCount = decorators.length; + for (var i = 0; i < decoratorCount; i++) { + if (i > 0) { + write(", "); + } + var decorator = decorators[i]; + emitStart(decorator); + emit(decorator.expression); + emitEnd(decorator); + } + write("], "); + } function emitInterfaceDeclaration(node) { - emitPinnedOrTripleSlashComments(node); + emitOnlyPinnedOrTripleSlashComments(node); } function shouldEmitEnumDeclaration(node) { var isConstEnum = ts.isConst(node); - return !isConstEnum || compilerOptions.preserveConstEnums; + return !isConstEnum || compilerOptions.preserveConstEnums || compilerOptions.separateCompilation; } function emitEnumDeclaration(node) { if (!shouldEmitEnumDeclaration(node)) { return; } - if (!(node.flags & 1)) { + if (!(node.flags & 1) || isES6ExportedDeclaration(node)) { emitStart(node); + if (isES6ExportedDeclaration(node)) { + write("export "); + } write("var "); emit(node.name); emitEnd(node); @@ -21687,7 +23264,7 @@ var ts; emitStart(node); write("(function ("); emitStart(node.name); - write(resolver.getGeneratedNameForNode(node)); + write(getGeneratedNameForNode(node)); emitEnd(node.name); write(") {"); increaseIndent(); @@ -21703,7 +23280,7 @@ var ts; emitModuleMemberName(node); write(" = {}));"); emitEnd(node); - if (node.flags & 1) { + if (!isES6ExportedDeclaration(node) && node.flags & 1) { writeLine(); emitStart(node); write("var "); @@ -21720,9 +23297,9 @@ var ts; function emitEnumMember(node) { var enumParent = node.parent; emitStart(node); - write(resolver.getGeneratedNameForNode(enumParent)); + write(getGeneratedNameForNode(enumParent)); write("["); - write(resolver.getGeneratedNameForNode(enumParent)); + write(getGeneratedNameForNode(enumParent)); write("["); emitExpressionForPropertyName(node.name); write("] = "); @@ -21733,14 +23310,12 @@ var ts; write(";"); } function writeEnumMemberDeclarationValue(member) { - if (!member.initializer || ts.isConst(member.parent)) { - var value = resolver.getConstantValue(member); - if (value !== undefined) { - write(value.toString()); - return; - } + var value = resolver.getConstantValue(member); + if (value !== undefined) { + write(value.toString()); + return; } - if (member.initializer) { + else if (member.initializer) { emit(member.initializer); } else { @@ -21748,20 +23323,23 @@ var ts; } } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 200) { + if (moduleDeclaration.body.kind === 205) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } } function shouldEmitModuleDeclaration(node) { - return ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums); + return ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation); } function emitModuleDeclaration(node) { var shouldEmit = shouldEmitModuleDeclaration(node); if (!shouldEmit) { - return emitPinnedOrTripleSlashComments(node); + return emitOnlyPinnedOrTripleSlashComments(node); } emitStart(node); + if (isES6ExportedDeclaration(node)) { + write("export "); + } write("var "); emit(node.name); write(";"); @@ -21770,18 +23348,16 @@ var ts; emitStart(node); write("(function ("); emitStart(node.name); - write(resolver.getGeneratedNameForNode(node)); + write(getGeneratedNameForNode(node)); emitEnd(node.name); write(") "); - if (node.body.kind === 201) { - var saveTempCount = tempCount; + if (node.body.kind === 206) { + var saveTempFlags = tempFlags; var saveTempVariables = tempVariables; - tempCount = 0; + tempFlags = 0; tempVariables = undefined; - var popFrame = enterNameScope(); emit(node.body); - exitNameScope(popFrame); - tempCount = saveTempCount; + tempFlags = saveTempFlags; tempVariables = saveTempVariables; } else { @@ -21798,7 +23374,7 @@ var ts; scopeEmitEnd(); } write(")("); - if (node.flags & 1) { + if ((node.flags & 1) && !isES6ExportedDeclaration(node)) { emit(node.name); write(" = "); } @@ -21807,7 +23383,7 @@ var ts; emitModuleMemberName(node); write(" = {}));"); emitEnd(node); - if (languageVersion < 2 && node.name.kind === 64 && node.parent === currentSourceFile) { + if (!isES6ExportedDeclaration(node) && node.name.kind === 65 && node.parent === currentSourceFile) { emitExportMemberAssignments(node.name); } } @@ -21818,199 +23394,303 @@ var ts; emitLiteral(moduleName); emitEnd(moduleName); emitToken(17, moduleName.end); - write(";"); } else { - write("require();"); + write("require()"); } } + function getNamespaceDeclarationNode(node) { + if (node.kind === 208) { + return node; + } + var importClause = node.importClause; + if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 211) { + return importClause.namedBindings; + } + } + function isDefaultImport(node) { + return node.kind === 209 && node.importClause && !!node.importClause.name; + } + function emitExportImportAssignments(node) { + if (ts.isAliasSymbolDeclaration(node) && resolver.isValueAliasDeclaration(node)) { + emitExportMemberAssignments(node.name); + } + ts.forEachChild(node, emitExportImportAssignments); + } function emitImportDeclaration(node) { - var info = getExternalImportInfo(node); - if (info) { - var declarationNode = info.declarationNode; - var namedImports = info.namedImports; + if (languageVersion < 2) { + return emitExternalImportDeclaration(node); + } + if (node.importClause) { + var shouldEmitDefaultBindings = resolver.isReferencedAliasDeclaration(node.importClause); + var shouldEmitNamedBindings = node.importClause.namedBindings && resolver.isReferencedAliasDeclaration(node.importClause.namedBindings, true); + if (shouldEmitDefaultBindings || shouldEmitNamedBindings) { + write("import "); + emitStart(node.importClause); + if (shouldEmitDefaultBindings) { + emit(node.importClause.name); + if (shouldEmitNamedBindings) { + write(", "); + } + } + if (shouldEmitNamedBindings) { + emitLeadingComments(node.importClause.namedBindings); + emitStart(node.importClause.namedBindings); + if (node.importClause.namedBindings.kind === 211) { + write("* as "); + emit(node.importClause.namedBindings.name); + } + else { + write("{ "); + emitExportOrImportSpecifierList(node.importClause.namedBindings.elements, resolver.isReferencedAliasDeclaration); + write(" }"); + } + emitEnd(node.importClause.namedBindings); + emitTrailingComments(node.importClause.namedBindings); + } + emitEnd(node.importClause); + write(" from "); + emit(node.moduleSpecifier); + write(";"); + } + } + else { + write("import "); + emit(node.moduleSpecifier); + write(";"); + } + } + function emitExternalImportDeclaration(node) { + if (ts.contains(externalImports, node)) { + var isExportedImport = node.kind === 208 && (node.flags & 1) !== 0; + var namespaceDeclaration = getNamespaceDeclarationNode(node); if (compilerOptions.module !== 2) { emitLeadingComments(node); emitStart(node); - var moduleName = ts.getExternalModuleName(node); - if (declarationNode) { - if (!(declarationNode.flags & 1)) + if (namespaceDeclaration && !isDefaultImport(node)) { + if (!isExportedImport) write("var "); - emitModuleMemberName(declarationNode); + emitModuleMemberName(namespaceDeclaration); write(" = "); - emitRequire(moduleName); - } - else if (namedImports) { - write("var "); - write(resolver.getGeneratedNameForNode(node)); - write(" = "); - emitRequire(moduleName); } else { - emitRequire(moduleName); + var isNakedImport = 209 && !node.importClause; + if (!isNakedImport) { + write("var "); + write(getGeneratedNameForNode(node)); + write(" = "); + } } + emitRequire(ts.getExternalModuleName(node)); + if (namespaceDeclaration && isDefaultImport(node)) { + write(", "); + emitModuleMemberName(namespaceDeclaration); + write(" = "); + write(getGeneratedNameForNode(node)); + } + write(";"); emitEnd(node); + emitExportImportAssignments(node); emitTrailingComments(node); } else { - if (declarationNode) { - if (declarationNode.flags & 1) { - emitModuleMemberName(declarationNode); - write(" = "); - emit(declarationNode.name); - write(";"); - } + if (isExportedImport) { + emitModuleMemberName(namespaceDeclaration); + write(" = "); + emit(namespaceDeclaration.name); + write(";"); } + else if (namespaceDeclaration && isDefaultImport(node)) { + write("var "); + emitModuleMemberName(namespaceDeclaration); + write(" = "); + write(getGeneratedNameForNode(node)); + write(";"); + } + emitExportImportAssignments(node); } } } function emitImportEqualsDeclaration(node) { if (ts.isExternalModuleImportEqualsDeclaration(node)) { - emitImportDeclaration(node); + emitExternalImportDeclaration(node); return; } if (resolver.isReferencedAliasDeclaration(node) || (!ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportEqualsWithEntityName(node))) { emitLeadingComments(node); emitStart(node); - if (!(node.flags & 1)) + if (isES6ExportedDeclaration(node)) { + write("export "); write("var "); + } + else if (!(node.flags & 1)) { + write("var "); + } emitModuleMemberName(node); write(" = "); emit(node.moduleReference); write(";"); emitEnd(node); + emitExportImportAssignments(node); emitTrailingComments(node); } } function emitExportDeclaration(node) { - if (node.moduleSpecifier) { - emitStart(node); - var generatedName = resolver.getGeneratedNameForNode(node); - if (compilerOptions.module !== 2) { - write("var "); - write(generatedName); - write(" = "); - emitRequire(ts.getExternalModuleName(node)); - } - if (node.exportClause) { - ts.forEach(node.exportClause.elements, function (specifier) { + if (languageVersion < 2) { + if (node.moduleSpecifier && (!node.exportClause || resolver.isValueAliasDeclaration(node))) { + emitStart(node); + var generatedName = getGeneratedNameForNode(node); + if (node.exportClause) { + if (compilerOptions.module !== 2) { + write("var "); + write(generatedName); + write(" = "); + emitRequire(ts.getExternalModuleName(node)); + write(";"); + } + for (var _a = 0, _b = node.exportClause.elements; _a < _b.length; _a++) { + var specifier = _b[_a]; + if (resolver.isValueAliasDeclaration(specifier)) { + writeLine(); + emitStart(specifier); + emitContainingModuleName(specifier); + write("."); + emitNodeWithoutSourceMap(specifier.name); + write(" = "); + write(generatedName); + write("."); + emitNodeWithoutSourceMap(specifier.propertyName || specifier.name); + write(";"); + emitEnd(specifier); + } + } + } + else { writeLine(); - emitStart(specifier); - emitContainingModuleName(specifier); - write("."); - emitNodeWithoutSourceMap(specifier.name); - write(" = "); - write(generatedName); - write("."); - emitNodeWithoutSourceMap(specifier.propertyName || specifier.name); + write("__export("); + if (compilerOptions.module !== 2) { + emitRequire(ts.getExternalModuleName(node)); + } + else { + write(generatedName); + } + write(");"); + } + emitEnd(node); + } + } + else { + if (!node.exportClause || resolver.isValueAliasDeclaration(node)) { + emitStart(node); + write("export "); + if (node.exportClause) { + write("{ "); + emitExportOrImportSpecifierList(node.exportClause.elements, resolver.isValueAliasDeclaration); + write(" }"); + } + else { + write("*"); + } + if (node.moduleSpecifier) { + write(" from "); + emitNodeWithoutSourceMap(node.moduleSpecifier); + } + write(";"); + emitEnd(node); + } + } + } + function emitExportOrImportSpecifierList(specifiers, shouldEmit) { + ts.Debug.assert(languageVersion >= 2); + var needsComma = false; + for (var _a = 0; _a < specifiers.length; _a++) { + var specifier = specifiers[_a]; + if (shouldEmit(specifier)) { + if (needsComma) { + write(", "); + } + emitStart(specifier); + if (specifier.propertyName) { + emitNodeWithoutSourceMap(specifier.propertyName); + write(" as "); + } + emitNodeWithoutSourceMap(specifier.name); + emitEnd(specifier); + needsComma = true; + } + } + } + function emitExportAssignment(node) { + if (!node.isExportEquals && resolver.isValueAliasDeclaration(node)) { + if (languageVersion >= 2) { + writeLine(); + emitStart(node); + write("export default "); + var expression = node.expression; + emit(expression); + if (expression.kind !== 200 && + expression.kind !== 201) { write(";"); - emitEnd(specifier); - }); + } + emitEnd(node); } else { - var tempName = createTempVariable(node).text; writeLine(); - write("for (var " + tempName + " in " + generatedName + ") if (!"); + emitStart(node); emitContainingModuleName(node); - write(".hasOwnProperty(" + tempName + ")) "); - emitContainingModuleName(node); - write("[" + tempName + "] = " + generatedName + "[" + tempName + "];"); - } - emitEnd(node); - } - } - function createExternalImportInfo(node) { - if (node.kind === 203) { - if (node.moduleReference.kind === 213) { - return { - rootNode: node, - declarationNode: node - }; - } - } - else if (node.kind === 204) { - var importClause = node.importClause; - if (importClause) { - if (importClause.name) { - return { - rootNode: node, - declarationNode: importClause - }; - } - if (importClause.namedBindings.kind === 206) { - return { - rootNode: node, - declarationNode: importClause.namedBindings - }; - } - return { - rootNode: node, - namedImports: importClause.namedBindings, - localName: resolver.getGeneratedNameForNode(node) - }; - } - return { - rootNode: node - }; - } - else if (node.kind === 210) { - if (node.moduleSpecifier) { - return { - rootNode: node - }; + write(".default = "); + emit(node.expression); + write(";"); + emitEnd(node); } } } - function createExternalModuleInfo(sourceFile) { + function collectExternalModuleInfo(sourceFile) { externalImports = []; exportSpecifiers = {}; - exportDefault = undefined; - ts.forEach(sourceFile.statements, function (node) { - if (node.kind === 210 && !node.moduleSpecifier) { - ts.forEach(node.exportClause.elements, function (specifier) { - if (specifier.name.text === "default") { - exportDefault = exportDefault || specifier; + exportEquals = undefined; + hasExportStars = false; + for (var _a = 0, _b = sourceFile.statements; _a < _b.length; _a++) { + var node = _b[_a]; + switch (node.kind) { + case 209: + if (!node.importClause || + resolver.isReferencedAliasDeclaration(node.importClause, true)) { + externalImports.push(node); } - var _name = (specifier.propertyName || specifier.name).text; - (exportSpecifiers[_name] || (exportSpecifiers[_name] = [])).push(specifier); - }); - } - else if (node.kind === 209) { - exportDefault = exportDefault || node; - } - else if (node.kind === 195 || node.kind === 196) { - if (node.flags & 1 && node.flags & 256) { - exportDefault = exportDefault || node; - } - } - else { - var info = createExternalImportInfo(node); - if (info) { - if ((!info.declarationNode && !info.namedImports) || resolver.isReferencedAliasDeclaration(node)) { - externalImports.push(info); + break; + case 208: + if (node.moduleReference.kind === 219 && resolver.isReferencedAliasDeclaration(node)) { + externalImports.push(node); } - } - } - }); - } - function getExternalImportInfo(node) { - if (externalImports) { - for (var _i = 0, _n = externalImports.length; _i < _n; _i++) { - var info = externalImports[_i]; - if (info.rootNode === node) { - return info; - } + break; + case 215: + if (node.moduleSpecifier) { + if (!node.exportClause) { + externalImports.push(node); + hasExportStars = true; + } + else if (resolver.isValueAliasDeclaration(node)) { + externalImports.push(node); + } + } + else { + for (var _c = 0, _d = node.exportClause.elements; _c < _d.length; _c++) { + var specifier = _d[_c]; + var name_17 = (specifier.propertyName || specifier.name).text; + (exportSpecifiers[name_17] || (exportSpecifiers[name_17] = [])).push(specifier); + } + } + break; + case 214: + if (node.isExportEquals && !exportEquals) { + exportEquals = node; + } + break; } } } - function getFirstExportAssignment(sourceFile) { - return ts.forEach(sourceFile.statements, function (node) { - if (node.kind === 209) { - return node; - } - }); - } function sortAMDModules(amdModules) { return amdModules.sort(function (moduleA, moduleB) { if (moduleA.name === moduleB.name) { @@ -22024,7 +23704,20 @@ var ts; } }); } + function emitExportStarHelper() { + if (hasExportStars) { + writeLine(); + write("function __export(m) {"); + increaseIndent(); + writeLine(); + write("for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];"); + decreaseIndent(); + writeLine(); + write("}"); + } + } function emitAMDModule(node, startIndex) { + collectExternalModuleInfo(node); writeLine(); write("define("); sortAMDModules(node.amdDependencies); @@ -22032,69 +23725,78 @@ var ts; write("\"" + node.amdModuleName + "\", "); } write("[\"require\", \"exports\""); - ts.forEach(externalImports, function (info) { + for (var _a = 0; _a < externalImports.length; _a++) { + var importNode = externalImports[_a]; write(", "); - var moduleName = ts.getExternalModuleName(info.rootNode); + var moduleName = ts.getExternalModuleName(importNode); if (moduleName.kind === 8) { emitLiteral(moduleName); } else { write("\"\""); } - }); - ts.forEach(node.amdDependencies, function (amdDependency) { + } + for (var _b = 0, _c = node.amdDependencies; _b < _c.length; _b++) { + var amdDependency = _c[_b]; var text = "\"" + amdDependency.path + "\""; write(", "); write(text); - }); + } write("], function (require, exports"); - ts.forEach(externalImports, function (info) { + for (var _d = 0; _d < externalImports.length; _d++) { + var importNode = externalImports[_d]; write(", "); - if (info.declarationNode) { - emit(info.declarationNode.name); + var namespaceDeclaration = getNamespaceDeclarationNode(importNode); + if (namespaceDeclaration && !isDefaultImport(importNode)) { + emit(namespaceDeclaration.name); } else { - write(resolver.getGeneratedNameForNode(info.rootNode)); + write(getGeneratedNameForNode(importNode)); } - }); - ts.forEach(node.amdDependencies, function (amdDependency) { + } + for (var _e = 0, _f = node.amdDependencies; _e < _f.length; _e++) { + var amdDependency = _f[_e]; if (amdDependency.name) { write(", "); write(amdDependency.name); } - }); + } write(") {"); increaseIndent(); + emitExportStarHelper(); emitCaptureThisForNodeIfNecessary(node); emitLinesStartingAt(node.statements, startIndex); emitTempDeclarations(true); - emitExportDefault(node, true); + emitExportEquals(true); decreaseIndent(); writeLine(); write("});"); } function emitCommonJSModule(node, startIndex) { + collectExternalModuleInfo(node); + emitExportStarHelper(); emitCaptureThisForNodeIfNecessary(node); emitLinesStartingAt(node.statements, startIndex); emitTempDeclarations(true); - emitExportDefault(node, false); + emitExportEquals(false); } - function emitExportDefault(sourceFile, emitAsReturn) { - if (exportDefault && resolver.hasExportDefaultValue(sourceFile)) { + function emitES6Module(node, startIndex) { + externalImports = undefined; + exportSpecifiers = undefined; + exportEquals = undefined; + hasExportStars = false; + emitCaptureThisForNodeIfNecessary(node); + emitLinesStartingAt(node.statements, startIndex); + emitTempDeclarations(true); + } + function emitExportEquals(emitAsReturn) { + if (exportEquals && resolver.isValueAliasDeclaration(exportEquals)) { writeLine(); - emitStart(exportDefault); + emitStart(exportEquals); write(emitAsReturn ? "return " : "module.exports = "); - if (exportDefault.kind === 209) { - emit(exportDefault.expression); - } - else if (exportDefault.kind === 212) { - emit(exportDefault.propertyName); - } - else { - emitDeclarationName(exportDefault); - } + emit(exportEquals.expression); write(";"); - emitEnd(exportDefault); + emitEnd(exportEquals); } } function emitDirectivePrologues(statements, startWithNewLine) { @@ -22111,11 +23813,21 @@ var ts; } return statements.length; } + function writeHelper(text) { + var lines = text.split(/\r\n|\r|\n/g); + for (var i = 0; i < lines.length; ++i) { + var line = lines[i]; + if (line.length) { + writeLine(); + write(line); + } + } + } function emitSourceFileNode(node) { writeLine(); emitDetachedComments(node); var startIndex = emitDirectivePrologues(node.statements, false); - if (!extendsEmitted && resolver.getNodeCheckFlags(node) & 8) { + if ((languageVersion < 2) && (!extendsEmitted && resolver.getNodeCheckFlags(node) & 8)) { writeLine(); write("var __extends = this.__extends || function (d, b) {"); increaseIndent(); @@ -22132,9 +23844,15 @@ var ts; write("};"); extendsEmitted = true; } + if (!decorateEmitted && resolver.getNodeCheckFlags(node) & 512) { + writeHelper("\nvar __decorate = this.__decorate || function (decorators, target, key, value) {\n var kind = typeof (arguments.length == 2 ? value = target : value);\n for (var i = decorators.length - 1; i >= 0; --i) {\n var decorator = decorators[i];\n switch (kind) {\n case \"function\": value = decorator(value) || value; break;\n case \"number\": decorator(target, key, value); break;\n case \"undefined\": decorator(target, key); break;\n case \"object\": value = decorator(target, key, value) || value; break;\n }\n }\n return value;\n};"); + decorateEmitted = true; + } if (ts.isExternalModule(node)) { - createExternalModuleInfo(node); - if (compilerOptions.module === 2) { + if (languageVersion >= 2) { + emitES6Module(node, startIndex); + } + else if (compilerOptions.module === 2) { emitAMDModule(node, startIndex); } else { @@ -22144,75 +23862,75 @@ var ts; else { externalImports = undefined; exportSpecifiers = undefined; - exportDefault = undefined; + exportEquals = undefined; + hasExportStars = false; emitCaptureThisForNodeIfNecessary(node); emitLinesStartingAt(node.statements, startIndex); emitTempDeclarations(true); } emitLeadingComments(node.endOfFileToken); } - function emitNodeWithoutSourceMapWithComments(node) { + function emitNodeWithoutSourceMap(node, allowGeneratedIdentifiers) { if (!node) { return; } if (node.flags & 2) { - return emitPinnedOrTripleSlashComments(node); + return emitOnlyPinnedOrTripleSlashComments(node); } - var _emitComments = shouldEmitLeadingAndTrailingComments(node); - if (_emitComments) { + var emitComments = shouldEmitLeadingAndTrailingComments(node); + if (emitComments) { emitLeadingComments(node); } - emitJavaScriptWorker(node); - if (_emitComments) { + emitJavaScriptWorker(node, allowGeneratedIdentifiers); + if (emitComments) { emitTrailingComments(node); } } - function emitNodeWithoutSourceMapWithoutComments(node) { - if (!node) { - return; - } - if (node.flags & 2) { - return emitPinnedOrTripleSlashComments(node); - } - emitJavaScriptWorker(node); - } function shouldEmitLeadingAndTrailingComments(node) { switch (node.kind) { - case 197: - case 195: - case 204: - case 203: - case 198: - case 209: - return false; + case 202: case 200: + case 209: + case 208: + case 203: + case 214: + return false; + case 205: return shouldEmitModuleDeclaration(node); - case 199: + case 204: return shouldEmitEnumDeclaration(node); } + if (node.kind !== 179 && + node.parent && + node.parent.kind === 163 && + node.parent.body === node && + compilerOptions.target <= 1) { + return false; + } return true; } - function emitJavaScriptWorker(node) { + function emitJavaScriptWorker(node, allowGeneratedIdentifiers) { + if (allowGeneratedIdentifiers === void 0) { allowGeneratedIdentifiers = true; } switch (node.kind) { - case 64: - return emitIdentifier(node); - case 128: + case 65: + return emitIdentifier(node, allowGeneratedIdentifiers); + case 129: return emitParameter(node); - case 132: - case 131: - return emitMethod(node); case 134: - case 135: + case 133: + return emitMethod(node); + case 136: + case 137: return emitAccessor(node); - case 92: + case 93: return emitThis(node); - case 90: + case 91: return emitSuper(node); - case 88: + case 89: return write("null"); - case 94: + case 95: return write("true"); - case 79: + case 80: return write("false"); case 7: case 8: @@ -22222,125 +23940,129 @@ var ts; case 12: case 13: return emitLiteral(node); - case 169: - return emitTemplateExpression(node); - case 173: - return emitTemplateSpan(node); - case 125: - return emitQualifiedName(node); - case 148: - return emitObjectBindingPattern(node); - case 149: - return emitArrayBindingPattern(node); - case 150: - return emitBindingElement(node); - case 151: - return emitArrayLiteral(node); - case 152: - return emitObjectLiteral(node); - case 218: - return emitPropertyAssignment(node); - case 219: - return emitShorthandPropertyAssignment(node); - case 126: - return emitComputedPropertyName(node); - case 153: - return emitPropertyAccess(node); - case 154: - return emitIndexedAccess(node); - case 155: - return emitCallExpression(node); - case 156: - return emitNewExpression(node); - case 157: - return emitTaggedTemplateExpression(node); - case 158: - return emit(node.expression); - case 159: - return emitParenExpression(node); - case 195: - case 160: - case 161: - return emitFunctionDeclaration(node); - case 162: - return emitDeleteExpression(node); - case 163: - return emitTypeOfExpression(node); - case 164: - return emitVoidExpression(node); - case 165: - return emitPrefixUnaryExpression(node); - case 166: - return emitPostfixUnaryExpression(node); - case 167: - return emitBinaryExpression(node); - case 168: - return emitConditionalExpression(node); case 171: - return emitSpreadElementExpression(node); - case 172: - return; - case 174: - case 201: - return emitBlock(node); - case 175: - return emitVariableStatement(node); + return emitTemplateExpression(node); case 176: - return write(";"); - case 177: - return emitExpressionStatement(node); - case 178: - return emitIfStatement(node); - case 179: - return emitDoStatement(node); - case 180: - return emitWhileStatement(node); - case 181: - return emitForStatement(node); - case 183: - case 182: - return emitForInOrForOfStatement(node); - case 184: - case 185: - return emitBreakOrContinueStatement(node); - case 186: - return emitReturnStatement(node); - case 187: - return emitWithStatement(node); - case 188: - return emitSwitchStatement(node); - case 214: - case 215: - return emitCaseOrDefaultClause(node); - case 189: - return emitLabelledStatement(node); - case 190: - return emitThrowStatement(node); - case 191: - return emitTryStatement(node); - case 217: - return emitCatchClause(node); - case 192: - return emitDebuggerStatement(node); - case 193: - return emitVariableDeclaration(node); - case 196: - return emitClassDeclaration(node); - case 197: - return emitInterfaceDeclaration(node); - case 199: - return emitEnumDeclaration(node); - case 220: - return emitEnumMember(node); + 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: - return emitModuleDeclaration(node); - case 204: - return emitImportDeclaration(node); - case 203: - return emitImportEqualsDeclaration(node); - case 210: - return emitExportDeclaration(node); + 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 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); + case 226: + return emitEnumMember(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); + case 227: return emitSourceFileNode(node); } } @@ -22357,34 +24079,50 @@ var ts; } return leadingComments; } + function filterComments(ranges, onlyPinnedOrTripleSlashComments) { + if (ranges && onlyPinnedOrTripleSlashComments) { + ranges = ts.filter(ranges, isPinnedOrTripleSlashComment); + if (ranges.length === 0) { + return undefined; + } + } + return ranges; + } function getLeadingCommentsToEmit(node) { if (node.parent) { - if (node.parent.kind === 221 || node.pos !== node.parent.pos) { - var leadingComments; + if (node.parent.kind === 227 || node.pos !== node.parent.pos) { if (hasDetachedComments(node.pos)) { - leadingComments = getLeadingCommentsWithoutDetachedComments(); + return getLeadingCommentsWithoutDetachedComments(); } else { - leadingComments = ts.getLeadingCommentRangesOfNode(node, currentSourceFile); + return ts.getLeadingCommentRangesOfNode(node, currentSourceFile); } - return leadingComments; } } } - function emitLeadingDeclarationComments(node) { - var leadingComments = getLeadingCommentsToEmit(node); - emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); - emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); - } - function emitTrailingDeclarationComments(node) { + function getTrailingCommentsToEmit(node) { if (node.parent) { - if (node.parent.kind === 221 || node.end !== node.parent.end) { - var trailingComments = ts.getTrailingCommentRanges(currentSourceFile.text, node.end); - emitComments(currentSourceFile, writer, trailingComments, false, newLine, writeComment); + if (node.parent.kind === 227 || node.end !== node.parent.end) { + return ts.getTrailingCommentRanges(currentSourceFile.text, node.end); } } } - function emitLeadingCommentsOfLocalPosition(pos) { + function emitOnlyPinnedOrTripleSlashComments(node) { + emitLeadingCommentsWorker(node, true); + } + function emitLeadingComments(node) { + return emitLeadingCommentsWorker(node, compilerOptions.removeComments); + } + function emitLeadingCommentsWorker(node, onlyPinnedOrTripleSlashComments) { + var leadingComments = filterComments(getLeadingCommentsToEmit(node), onlyPinnedOrTripleSlashComments); + ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); + ts.emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); + } + function emitTrailingComments(node) { + var trailingComments = filterComments(getTrailingCommentsToEmit(node), compilerOptions.removeComments); + ts.emitComments(currentSourceFile, writer, trailingComments, false, newLine, writeComment); + } + function emitLeadingCommentsOfPosition(pos) { var leadingComments; if (hasDetachedComments(pos)) { leadingComments = getLeadingCommentsWithoutDetachedComments(); @@ -22392,18 +24130,19 @@ var ts; else { leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, pos); } - emitNewLineBeforeLeadingComments(currentSourceFile, writer, { pos: pos, end: pos }, leadingComments); - emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); + leadingComments = filterComments(leadingComments, compilerOptions.removeComments); + ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, { pos: pos, end: pos }, leadingComments); + ts.emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); } - function emitDetachedCommentsAtPosition(node) { + function emitDetachedComments(node) { var leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, node.pos); if (leadingComments) { var detachedComments = []; var lastComment; ts.forEach(leadingComments, function (comment) { if (lastComment) { - var lastCommentLine = getLineOfLocalPosition(currentSourceFile, lastComment.end); - var commentLine = getLineOfLocalPosition(currentSourceFile, comment.pos); + var lastCommentLine = ts.getLineOfLocalPosition(currentSourceFile, lastComment.end); + var commentLine = ts.getLineOfLocalPosition(currentSourceFile, comment.pos); if (commentLine >= lastCommentLine + 2) { return detachedComments; } @@ -22412,11 +24151,11 @@ var ts; lastComment = comment; }); if (detachedComments.length) { - var lastCommentLine = getLineOfLocalPosition(currentSourceFile, detachedComments[detachedComments.length - 1].end); - var nodeLine = getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node.pos)); + var lastCommentLine = ts.getLineOfLocalPosition(currentSourceFile, detachedComments[detachedComments.length - 1].end); + var nodeLine = ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node.pos)); if (nodeLine >= lastCommentLine + 2) { - emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); - emitComments(currentSourceFile, writer, detachedComments, true, newLine, writeComment); + 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 }; if (detachedCommentsInfo) { detachedCommentsInfo.push(currentDetachedCommentInfo); @@ -22428,54 +24167,53 @@ var ts; } } } - function emitPinnedOrTripleSlashComments(node) { - var pinnedComments = ts.filter(getLeadingCommentsToEmit(node), isPinnedOrTripleSlashComment); - function isPinnedOrTripleSlashComment(comment) { - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42) { - return currentSourceFile.text.charCodeAt(comment.pos + 2) === 33; - } - else if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 47 && - comment.pos + 2 < comment.end && - currentSourceFile.text.charCodeAt(comment.pos + 2) === 47 && - currentSourceFile.text.substring(comment.pos, comment.end).match(ts.fullTripleSlashReferencePathRegEx)) { - return true; - } + function isPinnedOrTripleSlashComment(comment) { + if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42) { + return currentSourceFile.text.charCodeAt(comment.pos + 2) === 33; + } + else if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 47 && + comment.pos + 2 < comment.end && + currentSourceFile.text.charCodeAt(comment.pos + 2) === 47 && + currentSourceFile.text.substring(comment.pos, comment.end).match(ts.fullTripleSlashReferencePathRegEx)) { + return true; } - emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, pinnedComments); - emitComments(currentSourceFile, writer, pinnedComments, true, newLine, writeComment); - } - } - function writeDeclarationFile(jsFilePath, sourceFile) { - var emitDeclarationResult = emitDeclarations(host, resolver, diagnostics, jsFilePath, sourceFile); - if (!emitDeclarationResult.reportedDeclarationError) { - var declarationOutput = emitDeclarationResult.referencePathsOutput; - var appliedSyncOutputPos = 0; - ts.forEach(emitDeclarationResult.aliasDeclarationEmitInfo, function (aliasEmitInfo) { - if (aliasEmitInfo.asynchronousOutput) { - declarationOutput += emitDeclarationResult.synchronousDeclarationOutput.substring(appliedSyncOutputPos, aliasEmitInfo.outputPos); - declarationOutput += aliasEmitInfo.asynchronousOutput; - appliedSyncOutputPos = aliasEmitInfo.outputPos; - } - }); - declarationOutput += emitDeclarationResult.synchronousDeclarationOutput.substring(appliedSyncOutputPos); - writeFile(host, diagnostics, ts.removeFileExtension(jsFilePath) + ".d.ts", declarationOutput, compilerOptions.emitBOM); } } function emitFile(jsFilePath, sourceFile) { emitJavaScript(jsFilePath, sourceFile); if (compilerOptions.declaration) { - writeDeclarationFile(jsFilePath, sourceFile); + ts.writeDeclarationFile(jsFilePath, sourceFile, host, resolver, diagnostics); } } } ts.emitFiles = emitFiles; })(ts || (ts = {})); +/// +/// var ts; (function (ts) { + ts.programTime = 0; ts.emitTime = 0; ts.ioReadTime = 0; - ts.version = "1.5.0.0"; - function createCompilerHost(options) { + ts.ioWriteTime = 0; + ts.version = "1.5.0"; + function findConfigFile(searchPath) { + var fileName = "tsconfig.json"; + while (true) { + if (ts.sys.fileExists(fileName)) { + return fileName; + } + var parentPath = ts.getDirectoryPath(searchPath); + if (parentPath === searchPath) { + break; + } + searchPath = parentPath; + fileName = "../" + fileName; + } + return undefined; + } + ts.findConfigFile = findConfigFile; + function createCompilerHost(options, setParentNodes) { var currentDirectory; var existingDirectories = {}; function getCanonicalFileName(fileName) { @@ -22497,29 +24235,31 @@ var ts; } text = ""; } - return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion) : undefined; + return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion, setParentNodes) : undefined; + } + function directoryExists(directoryPath) { + if (ts.hasProperty(existingDirectories, directoryPath)) { + return true; + } + if (ts.sys.directoryExists(directoryPath)) { + existingDirectories[directoryPath] = true; + return true; + } + return false; + } + function ensureDirectoriesExist(directoryPath) { + if (directoryPath.length > ts.getRootLength(directoryPath) && !directoryExists(directoryPath)) { + var parentDirectory = ts.getDirectoryPath(directoryPath); + ensureDirectoriesExist(parentDirectory); + ts.sys.createDirectory(directoryPath); + } } function writeFile(fileName, data, writeByteOrderMark, onError) { - function directoryExists(directoryPath) { - if (ts.hasProperty(existingDirectories, directoryPath)) { - return true; - } - if (ts.sys.directoryExists(directoryPath)) { - existingDirectories[directoryPath] = true; - return true; - } - return false; - } - function ensureDirectoriesExist(directoryPath) { - if (directoryPath.length > ts.getRootLength(directoryPath) && !directoryExists(directoryPath)) { - var parentDirectory = ts.getDirectoryPath(directoryPath); - ensureDirectoriesExist(parentDirectory); - ts.sys.createDirectory(directoryPath); - } - } try { + var start = new Date().getTime(); ensureDirectoriesExist(ts.getDirectoryPath(ts.normalizePath(fileName))); ts.sys.writeFile(fileName, data, writeByteOrderMark); + ts.ioWriteTime += new Date().getTime() - start; } catch (e) { if (onError) { @@ -22540,6 +24280,9 @@ var ts; ts.createCompilerHost = createCompilerHost; function getPreEmitDiagnostics(program) { var diagnostics = program.getSyntacticDiagnostics().concat(program.getGlobalDiagnostics()).concat(program.getSemanticDiagnostics()); + if (program.getCompilerOptions().declaration) { + diagnostics.concat(program.getDeclarationDiagnostics()); + } return ts.sortAndDeduplicateDiagnostics(diagnostics); } ts.getPreEmitDiagnostics = getPreEmitDiagnostics; @@ -22573,14 +24316,16 @@ var ts; var diagnostics = ts.createDiagnosticCollection(); var seenNoDefaultLib = options.noLib; var commonSourceDirectory; + var diagnosticsProducingTypeChecker; + var noDiagnosticsTypeChecker; + var start = new Date().getTime(); host = host || createCompilerHost(options); ts.forEach(rootNames, function (name) { return processRootFile(name, false); }); if (!seenNoDefaultLib) { processRootFile(host.getDefaultLibFileName(options), true); } verifyCompilerOptions(); - var diagnosticsProducingTypeChecker; - var noDiagnosticsTypeChecker; + ts.programTime += new Date().getTime() - start; program = { getSourceFile: getSourceFile, getSourceFiles: function () { return files; }, @@ -22618,10 +24363,6 @@ var ts; function getTypeChecker() { return noDiagnosticsTypeChecker || (noDiagnosticsTypeChecker = ts.createTypeChecker(program, false)); } - function getDeclarationDiagnostics(targetSourceFile) { - var resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(targetSourceFile); - return ts.getDeclarationDiagnostics(getEmitHost(), resolver, targetSourceFile); - } function emit(sourceFile, writeFileCallback) { if (options.noEmitOnError && getPreEmitDiagnostics(this).length > 0) { return { diagnostics: [], sourceMaps: undefined, emitSkipped: true }; @@ -22652,6 +24393,9 @@ var ts; function getSemanticDiagnostics(sourceFile) { return getDiagnosticsHelper(sourceFile, getSemanticDiagnosticsForFile); } + function getDeclarationDiagnostics(sourceFile) { + return getDiagnosticsHelper(sourceFile, getDeclarationDiagnosticsForFile); + } function getSyntacticDiagnosticsForFile(sourceFile) { return sourceFile.parseDiagnostics; } @@ -22663,6 +24407,13 @@ var ts; var programDiagnostics = diagnostics.getDiagnostics(sourceFile.fileName); return bindDiagnostics.concat(checkDiagnostics).concat(programDiagnostics); } + function getDeclarationDiagnosticsForFile(sourceFile) { + if (!ts.isDeclarationFile(sourceFile)) { + var resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile); + var writeFile = function () { }; + return ts.getDeclarationDiagnostics(getEmitHost(writeFile), resolver, sourceFile); + } + } function getGlobalDiagnostics() { var typeChecker = getDiagnosticsProducingTypeChecker(); var allDiagnostics = []; @@ -22678,10 +24429,10 @@ var ts; } function processSourceFile(fileName, isDefaultLib, refFile, refPos, refEnd) { var start; - var _length; + var length; if (refEnd !== undefined && refPos !== undefined) { start = refPos; - _length = refEnd - refPos; + length = refEnd - refPos; } var diagnostic; if (hasExtension(fileName)) { @@ -22706,7 +24457,7 @@ var ts; } if (diagnostic) { if (refFile) { - diagnostics.add(ts.createFileDiagnostic(refFile, start, _length, diagnostic, fileName)); + diagnostics.add(ts.createFileDiagnostic(refFile, start, length, diagnostic, fileName)); } else { diagnostics.add(ts.createCompilerDiagnostic(diagnostic, fileName)); @@ -22750,14 +24501,14 @@ var ts; return file; } function getSourceFileFromCache(fileName, canonicalName, useAbsolutePath) { - var _file = filesByName[canonicalName]; - if (_file && host.useCaseSensitiveFileNames()) { - var sourceFileName = useAbsolutePath ? ts.getNormalizedAbsolutePath(_file.fileName, host.getCurrentDirectory()) : _file.fileName; + var file = filesByName[canonicalName]; + if (file && host.useCaseSensitiveFileNames()) { + var sourceFileName = useAbsolutePath ? ts.getNormalizedAbsolutePath(file.fileName, host.getCurrentDirectory()) : file.fileName; if (canonicalName !== sourceFileName) { diagnostics.add(ts.createFileDiagnostic(refFile, refStart, refLength, ts.Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, fileName, sourceFileName)); } } - return _file; + return file; } } function processReferencedFiles(file, basePath) { @@ -22768,7 +24519,7 @@ var ts; } function processImportedModules(file, basePath) { ts.forEach(file.statements, function (node) { - if (node.kind === 204 || node.kind === 203 || node.kind === 210) { + if (node.kind === 209 || node.kind === 208 || node.kind === 215) { var moduleNameExpr = ts.getExternalModuleName(node); if (moduleNameExpr && moduleNameExpr.kind === 8) { var moduleNameText = moduleNameExpr.text; @@ -22788,17 +24539,17 @@ var ts; } } } - else if (node.kind === 200 && node.name.kind === 8 && (node.flags & 2 || ts.isDeclarationFile(file))) { + else if (node.kind === 205 && 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) { var nameLiteral = ts.getExternalModuleImportEqualsDeclarationExpression(node); var moduleName = nameLiteral.text; if (moduleName) { - var _searchName = ts.normalizePath(ts.combinePaths(basePath, moduleName)); - var tsFile = findModuleSourceFile(_searchName + ".ts", nameLiteral); + var searchName = ts.normalizePath(ts.combinePaths(basePath, moduleName)); + var tsFile = findModuleSourceFile(searchName + ".ts", nameLiteral); if (!tsFile) { - findModuleSourceFile(_searchName + ".d.ts", nameLiteral); + findModuleSourceFile(searchName + ".d.ts", nameLiteral); } } } @@ -22810,6 +24561,20 @@ var ts; } } function verifyCompilerOptions() { + if (options.separateCompilation) { + if (options.sourceMap) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_sourceMap_cannot_be_specified_with_option_separateCompilation)); + } + if (options.declaration) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_declaration_cannot_be_specified_with_option_separateCompilation)); + } + if (options.noEmitOnError) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_noEmitOnError_cannot_be_specified_with_option_separateCompilation)); + } + if (options.out) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_out_cannot_be_specified_with_option_separateCompilation)); + } + } 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)); @@ -22819,11 +24584,25 @@ var ts; } return; } + var languageVersion = options.target || 0; var firstExternalModuleSourceFile = ts.forEach(files, function (f) { return ts.isExternalModule(f) ? f : undefined; }); - if (firstExternalModuleSourceFile && !options.module) { + if (options.separateCompilation) { + if (!options.module && languageVersion < 2) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_separateCompilation_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher)); + } + 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)); + } + } + 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)); } + if (options.module && languageVersion >= 2) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher)); + } if (options.outDir || options.sourceRoot || (options.mapRoot && @@ -22871,6 +24650,10 @@ var ts; } ts.createProgram = createProgram; })(ts || (ts = {})); +/// +/// +/// +/// var ts; (function (ts) { ts.optionDeclarations = [ @@ -22878,10 +24661,6 @@ var ts; name: "charset", type: "string" }, - { - name: "codepage", - type: "number" - }, { name: "declaration", shortName: "d", @@ -22947,10 +24726,6 @@ var ts; name: "noLib", type: "boolean" }, - { - name: "noLibCheck", - type: "boolean" - }, { name: "noResolve", type: "boolean" @@ -22986,6 +24761,10 @@ var ts; type: "boolean", description: ts.Diagnostics.Do_not_emit_comments_to_output }, + { + name: "separateCompilation", + type: "boolean" + }, { name: "sourceMap", type: "boolean", @@ -23009,18 +24788,6 @@ var ts; description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, experimental: true }, - { - name: "preserveNewLines", - type: "boolean", - description: ts.Diagnostics.Preserve_new_lines_when_emitting_code, - experimental: true - }, - { - name: "cacheDownlevelForOfLength", - type: "boolean", - description: "Cache length access when downlevel emitting for-of statements", - experimental: true - }, { name: "target", shortName: "t", @@ -23221,6 +24988,20 @@ var ts; } ts.parseConfigFile = parseConfigFile; })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// var ts; (function (ts) { var OutliningElementsCollector; @@ -23240,7 +25021,7 @@ var ts; } } function autoCollapse(node) { - return ts.isFunctionBlock(node) && node.parent.kind !== 161; + return ts.isFunctionBlock(node) && node.parent.kind !== 163; } var depth = 0; var maxDepth = 20; @@ -23249,30 +25030,30 @@ var ts; return; } switch (n.kind) { - case 174: + case 179: if (!ts.isFunctionBlock(n)) { - var _parent = n.parent; + var parent_6 = n.parent; var openBrace = ts.findChildOfKind(n, 14, sourceFile); var closeBrace = ts.findChildOfKind(n, 15, sourceFile); - if (_parent.kind === 179 || - _parent.kind === 182 || - _parent.kind === 183 || - _parent.kind === 181 || - _parent.kind === 178 || - _parent.kind === 180 || - _parent.kind === 187 || - _parent.kind === 217) { - addOutliningSpan(_parent, openBrace, closeBrace, autoCollapse(n)); + if (parent_6.kind === 184 || + parent_6.kind === 187 || + parent_6.kind === 188 || + parent_6.kind === 186 || + parent_6.kind === 183 || + parent_6.kind === 185 || + parent_6.kind === 192 || + parent_6.kind === 223) { + addOutliningSpan(parent_6, openBrace, closeBrace, autoCollapse(n)); break; } - if (_parent.kind === 191) { - var tryStatement = _parent; + if (parent_6.kind === 196) { + var tryStatement = parent_6; if (tryStatement.tryBlock === n) { - addOutliningSpan(_parent, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(parent_6, openBrace, closeBrace, autoCollapse(n)); break; } else if (tryStatement.finallyBlock === n) { - var finallyKeyword = ts.findChildOfKind(tryStatement, 80, sourceFile); + var finallyKeyword = ts.findChildOfKind(tryStatement, 81, sourceFile); if (finallyKeyword) { addOutliningSpan(finallyKeyword, openBrace, closeBrace, autoCollapse(n)); break; @@ -23288,23 +25069,23 @@ var ts; }); break; } - case 201: { - var _openBrace = ts.findChildOfKind(n, 14, sourceFile); - var _closeBrace = ts.findChildOfKind(n, 15, sourceFile); - addOutliningSpan(n.parent, _openBrace, _closeBrace, autoCollapse(n)); + case 206: { + var openBrace = ts.findChildOfKind(n, 14, sourceFile); + var closeBrace = ts.findChildOfKind(n, 15, sourceFile); + addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); break; } - case 196: - case 197: - case 199: - case 152: - case 202: { - var _openBrace_1 = ts.findChildOfKind(n, 14, sourceFile); - var _closeBrace_1 = ts.findChildOfKind(n, 15, sourceFile); - addOutliningSpan(n, _openBrace_1, _closeBrace_1, autoCollapse(n)); + case 201: + case 202: + case 204: + case 154: + case 207: { + var openBrace = ts.findChildOfKind(n, 14, sourceFile); + var closeBrace = ts.findChildOfKind(n, 15, sourceFile); + addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); break; } - case 151: + case 153: var openBracket = ts.findChildOfKind(n, 18, sourceFile); var closeBracket = ts.findChildOfKind(n, 19, sourceFile); addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); @@ -23330,7 +25111,7 @@ var ts; ts.forEach(program.getSourceFiles(), function (sourceFile) { cancellationToken.throwIfCancellationRequested(); var declarations = sourceFile.getNamedDeclarations(); - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; var name = getDeclarationName(declaration); if (name !== undefined) { @@ -23362,7 +25143,7 @@ var ts; return items; function allMatchesAreCaseSensitive(matches) { ts.Debug.assert(matches.length > 0); - for (var _i = 0, _n = matches.length; _i < _n; _i++) { + for (var _i = 0; _i < matches.length; _i++) { var match = matches[_i]; if (!match.isCaseSensitive) { return false; @@ -23375,9 +25156,9 @@ var ts; if (result !== undefined) { return result; } - if (declaration.name.kind === 126) { + if (declaration.name.kind === 127) { var expr = declaration.name.expression; - if (expr.kind === 153) { + if (expr.kind === 155) { return expr.name.text; } return getTextOfIdentifierOrLiteral(expr); @@ -23385,7 +25166,7 @@ var ts; return undefined; } function getTextOfIdentifierOrLiteral(node) { - if (node.kind === 64 || + if (node.kind === 65 || node.kind === 8 || node.kind === 7) { return node.text; @@ -23398,7 +25179,7 @@ var ts; if (text !== undefined) { containers.unshift(text); } - else if (declaration.name.kind === 126) { + else if (declaration.name.kind === 127) { return tryAddComputedPropertyName(declaration.name.expression, containers, true); } else { @@ -23415,7 +25196,7 @@ var ts; } return true; } - if (expression.kind === 153) { + if (expression.kind === 155) { var propertyAccess = expression; if (includeLastPortion) { containers.unshift(propertyAccess.name.text); @@ -23426,7 +25207,7 @@ var ts; } function getContainers(declaration) { var containers = []; - if (declaration.name.kind === 126) { + if (declaration.name.kind === 127) { if (!tryAddComputedPropertyName(declaration.name.expression, containers, false)) { return undefined; } @@ -23442,15 +25223,15 @@ var ts; } function bestMatchKind(matches) { ts.Debug.assert(matches.length > 0); - var _bestMatchKind = 3; - for (var _i = 0, _n = matches.length; _i < _n; _i++) { + var bestMatchKind = ts.PatternMatchKind.camelCase; + for (var _i = 0; _i < matches.length; _i++) { var match = matches[_i]; var kind = match.kind; - if (kind < _bestMatchKind) { - _bestMatchKind = kind; + if (kind < bestMatchKind) { + bestMatchKind = kind; } } - return _bestMatchKind; + return bestMatchKind; } var baseSensitivity = { sensitivity: "base" }; function compareNavigateToItems(i1, i2) { @@ -23477,6 +25258,7 @@ var ts; NavigateTo.getNavigateToItems = getNavigateToItems; })(NavigateTo = ts.NavigateTo || (ts.NavigateTo = {})); })(ts || (ts = {})); +/// var ts; (function (ts) { var NavigationBar; @@ -23489,14 +25271,14 @@ var ts; var current = node.parent; while (current) { switch (current.kind) { - case 200: + case 205: do { current = current.parent; - } while (current.kind === 200); - case 196: - case 199: - case 197: - case 195: + } while (current.kind === 205); + case 201: + case 204: + case 202: + case 200: indent++; } current = current.parent; @@ -23507,26 +25289,26 @@ var ts; var childNodes = []; function visit(node) { switch (node.kind) { - case 175: + case 180: ts.forEach(node.declarationList.declarations, visit); break; - case 148: - case 149: + case 150: + case 151: ts.forEach(node.elements, visit); break; - case 210: + case 215: if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 204: + case 209: var importClause = node.importClause; if (importClause) { if (importClause.name) { childNodes.push(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 206) { + if (importClause.namedBindings.kind === 211) { childNodes.push(importClause.namedBindings); } else { @@ -23535,20 +25317,20 @@ var ts; } } break; - case 150: - case 193: + case 152: + case 198: if (ts.isBindingPattern(node.name)) { visit(node.name); break; } - case 196: - case 199: - case 197: + case 201: + case 204: + case 202: + case 205: case 200: - case 195: - case 203: case 208: - case 212: + case 213: + case 217: childNodes.push(node); break; } @@ -23580,20 +25362,20 @@ var ts; } function addTopLevelNodes(nodes, topLevelNodes) { nodes = sortNodes(nodes); - for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + for (var _i = 0; _i < nodes.length; _i++) { var node = nodes[_i]; switch (node.kind) { - case 196: - case 199: - case 197: + case 201: + case 204: + case 202: topLevelNodes.push(node); break; - case 200: + case 205: var moduleDeclaration = node; topLevelNodes.push(node); addTopLevelNodes(getInnermostModule(moduleDeclaration).body.statements, topLevelNodes); break; - case 195: + case 200: var functionDeclaration = node; if (isTopLevelFunctionDeclaration(functionDeclaration)) { topLevelNodes.push(node); @@ -23604,9 +25386,9 @@ var ts; } } function isTopLevelFunctionDeclaration(functionDeclaration) { - if (functionDeclaration.kind === 195) { - if (functionDeclaration.body && functionDeclaration.body.kind === 174) { - if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 195 && !isEmpty(s.name.text); })) { + 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); })) { return true; } if (!ts.isFunctionBlock(functionDeclaration.parent)) { @@ -23619,19 +25401,19 @@ var ts; function getItemsWorker(nodes, createItem) { var items = []; var keyToItem = {}; - for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + for (var _i = 0; _i < nodes.length; _i++) { var child = nodes[_i]; - var _item = createItem(child); - if (_item !== undefined) { - if (_item.text.length > 0) { - var key = _item.text + "-" + _item.kind + "-" + _item.indent; + var item_3 = createItem(child); + if (item_3 !== undefined) { + if (item_3.text.length > 0) { + var key = item_3.text + "-" + item_3.kind + "-" + item_3.indent; var itemWithSameName = keyToItem[key]; if (itemWithSameName) { - merge(itemWithSameName, _item); + merge(itemWithSameName, item_3); } else { - keyToItem[key] = _item; - items.push(_item); + keyToItem[key] = item_3; + items.push(item_3); } } } @@ -23644,9 +25426,9 @@ var ts; if (!target.childItems) { target.childItems = []; } - outer: for (var _i = 0, _a = source.childItems, _n = _a.length; _i < _n; _i++) { + outer: for (var _i = 0, _a = source.childItems; _i < _a.length; _i++) { var sourceChild = _a[_i]; - for (var _b = 0, _c = target.childItems, _d = _c.length; _b < _d; _b++) { + for (var _b = 0, _c = target.childItems; _b < _c.length; _b++) { var targetChild = _c[_b]; if (targetChild.text === sourceChild.text && targetChild.kind === sourceChild.kind) { merge(targetChild, sourceChild); @@ -23659,7 +25441,7 @@ var ts; } function createChildItem(node) { switch (node.kind) { - case 128: + case 129: if (ts.isBindingPattern(node.name)) { break; } @@ -23667,34 +25449,34 @@ var ts; return undefined; } return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); + 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); + 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.memberFunctionElement); - case 134: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberGetAccessorElement); - case 135: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberSetAccessorElement); - case 138: - return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement); - case 220: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 136: - return createItem(node, "()", ts.ScriptElementKind.callSignatureElement); - case 137: - return createItem(node, "new()", ts.ScriptElementKind.constructSignatureElement); - case 130: - case 129: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 195: + case 200: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.functionElement); - case 193: - case 150: + case 198: + case 152: var variableDeclarationNode; - var _name; - if (node.kind === 150) { - _name = node.name; + var name_18; + if (node.kind === 152) { + name_18 = node.name; variableDeclarationNode = node; - while (variableDeclarationNode && variableDeclarationNode.kind !== 193) { + while (variableDeclarationNode && variableDeclarationNode.kind !== 198) { variableDeclarationNode = variableDeclarationNode.parent; } ts.Debug.assert(variableDeclarationNode !== undefined); @@ -23702,24 +25484,24 @@ var ts; else { ts.Debug.assert(!ts.isBindingPattern(node.name)); variableDeclarationNode = node; - _name = node.name; + name_18 = node.name; } if (ts.isConst(variableDeclarationNode)) { - return createItem(node, getTextOfNode(_name), ts.ScriptElementKind.constElement); + return createItem(node, getTextOfNode(name_18), ts.ScriptElementKind.constElement); } else if (ts.isLet(variableDeclarationNode)) { - return createItem(node, getTextOfNode(_name), ts.ScriptElementKind.letElement); + return createItem(node, getTextOfNode(name_18), ts.ScriptElementKind.letElement); } else { - return createItem(node, getTextOfNode(_name), ts.ScriptElementKind.variableElement); + return createItem(node, getTextOfNode(name_18), ts.ScriptElementKind.variableElement); } - case 133: + case 135: return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); - case 212: + case 217: + case 213: case 208: - case 203: - case 205: - case 206: + case 210: + case 211: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.alias); } return undefined; @@ -23749,17 +25531,17 @@ var ts; } function createTopLevelItem(node) { switch (node.kind) { - case 221: + case 227: return createSourceFileItem(node); - case 196: + case 201: return createClassItem(node); - case 199: + case 204: return createEnumItem(node); - case 197: + case 202: return createIterfaceItem(node); - case 200: + case 205: return createModuleItem(node); - case 195: + case 200: return createFunctionItem(node); } return undefined; @@ -23769,7 +25551,7 @@ var ts; } var result = []; result.push(moduleDeclaration.name.text); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 200) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 205) { moduleDeclaration = moduleDeclaration.body; result.push(moduleDeclaration.name.text); } @@ -23781,9 +25563,9 @@ var ts; return getNavigationBarItem(moduleName, ts.ScriptElementKind.moduleElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } function createFunctionItem(node) { - if (node.name && node.body && node.body.kind === 174) { + if ((node.name || node.flags & 256) && node.body && node.body.kind === 179) { var childItems = getItemsWorker(sortNodes(node.body.statements), createChildItem); - return getNavigationBarItem(node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); + return getNavigationBarItem((!node.name && node.flags & 256) ? "default" : node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } return undefined; } @@ -23799,13 +25581,10 @@ var ts; return getNavigationBarItem(rootName, ts.ScriptElementKind.moduleElement, ts.ScriptElementKindModifier.none, [getNodeSpan(node)], childItems); } function createClassItem(node) { - if (!node.name) { - return undefined; - } var childItems; if (node.members) { var constructor = ts.forEach(node.members, function (member) { - return member.kind === 133 && member; + return member.kind === 135 && member; }); var nodes = removeDynamicallyNamedProperties(node); if (constructor) { @@ -23813,7 +25592,8 @@ var ts; } childItems = getItemsWorker(sortNodes(nodes), createChildItem); } - return getNavigationBarItem(node.name.text, ts.ScriptElementKind.classElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); + var nodeName = !node.name && (node.flags & 256) ? "default" : node.name.text; + return getNavigationBarItem(nodeName, ts.ScriptElementKind.classElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } function createEnumItem(node) { var childItems = getItemsWorker(sortNodes(removeComputedProperties(node)), createChildItem); @@ -23825,19 +25605,19 @@ var ts; } } function removeComputedProperties(node) { - return ts.filter(node.members, function (member) { return member.name === undefined || member.name.kind !== 126; }); + return ts.filter(node.members, function (member) { return member.name === undefined || member.name.kind !== 127; }); } function removeDynamicallyNamedProperties(node) { return ts.filter(node.members, function (member) { return !ts.hasDynamicName(member); }); } function getInnermostModule(node) { - while (node.body.kind === 200) { + while (node.body.kind === 205) { node = node.body; } return node; } function getNodeSpan(node) { - return node.kind === 221 + return node.kind === 227 ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) : ts.createTextSpanFromBounds(node.getStart(), node.getEnd()); } @@ -23919,27 +25699,27 @@ var ts; var index = indexOfIgnoringCase(candidate, chunk.textLowerCase); if (index === 0) { if (chunk.text.length === candidate.length) { - return createPatternMatch(0, punctuationStripped, candidate === chunk.text); + return createPatternMatch(PatternMatchKind.exact, punctuationStripped, candidate === chunk.text); } else { - return createPatternMatch(1, punctuationStripped, startsWith(candidate, chunk.text)); + return createPatternMatch(PatternMatchKind.prefix, punctuationStripped, startsWith(candidate, chunk.text)); } } var isLowercase = chunk.isLowerCase; if (isLowercase) { if (index > 0) { var wordSpans = getWordSpans(candidate); - for (var _i = 0, _n = wordSpans.length; _i < _n; _i++) { + for (var _i = 0; _i < wordSpans.length; _i++) { var span = wordSpans[_i]; if (partStartsWith(candidate, span, chunk.text, true)) { - return createPatternMatch(2, punctuationStripped, partStartsWith(candidate, span, chunk.text, false)); + return createPatternMatch(PatternMatchKind.substring, punctuationStripped, partStartsWith(candidate, span, chunk.text, false)); } } } } else { if (candidate.indexOf(chunk.text) > 0) { - return createPatternMatch(2, punctuationStripped, true); + return createPatternMatch(PatternMatchKind.substring, punctuationStripped, true); } } if (!isLowercase) { @@ -23947,18 +25727,18 @@ var ts; var candidateParts = getWordSpans(candidate); var camelCaseWeight = tryCamelCaseMatch(candidate, candidateParts, chunk, false); if (camelCaseWeight !== undefined) { - return createPatternMatch(3, punctuationStripped, true, camelCaseWeight); + return createPatternMatch(PatternMatchKind.camelCase, punctuationStripped, true, camelCaseWeight); } camelCaseWeight = tryCamelCaseMatch(candidate, candidateParts, chunk, true); if (camelCaseWeight !== undefined) { - return createPatternMatch(3, punctuationStripped, false, camelCaseWeight); + return createPatternMatch(PatternMatchKind.camelCase, punctuationStripped, false, camelCaseWeight); } } } if (isLowercase) { if (chunk.text.length < candidate.length) { if (index > 0 && isUpperCaseLetter(candidate.charCodeAt(index))) { - return createPatternMatch(2, punctuationStripped, false); + return createPatternMatch(PatternMatchKind.substring, punctuationStripped, false); } } } @@ -23982,7 +25762,7 @@ var ts; } var subWordTextChunks = segment.subWordTextChunks; var matches = undefined; - for (var _i = 0, _n = subWordTextChunks.length; _i < _n; _i++) { + for (var _i = 0; _i < subWordTextChunks.length; _i++) { var subWordTextChunk = subWordTextChunks[_i]; var result = matchTextChunk(candidate, subWordTextChunk, true); if (!result) { @@ -24009,10 +25789,10 @@ var ts; } } else { - for (var _i = 0; _i < patternPartLength; _i++) { - var _ch1 = pattern.charCodeAt(patternPartStart + _i); - var _ch2 = candidate.charCodeAt(candidateSpan.start + _i); - if (_ch1 !== _ch2) { + for (var i = 0; i < patternPartLength; i++) { + var ch1 = pattern.charCodeAt(patternPartStart + i); + var ch2 = candidate.charCodeAt(candidateSpan.start + i); + if (ch1 !== ch2) { return false; } } @@ -24087,7 +25867,7 @@ var ts; return result1.kind - result2.kind; } function compareCamelCase(result1, result2) { - if (result1.kind === 3 && result2.kind === 3) { + if (result1.kind === PatternMatchKind.camelCase && result2.kind === PatternMatchKind.camelCase) { return result2.camelCaseWeight - result1.camelCaseWeight; } return 0; @@ -24299,6 +26079,7 @@ var ts; return transition; } })(ts || (ts = {})); +/// var ts; (function (ts) { var SignatureHelp; @@ -24329,7 +26110,7 @@ var ts; } return createSignatureHelpItems(candidates, resolvedSignature, argumentInfo); function getImmediatelyContainingArgumentInfo(node) { - if (node.parent.kind === 155 || node.parent.kind === 156) { + if (node.parent.kind === 157 || node.parent.kind === 158) { var callExpression = node.parent; if (node.kind === 24 || node.kind === 16) { @@ -24346,50 +26127,50 @@ var ts; } var listItemInfo = ts.findListItemInfo(node); if (listItemInfo) { - var _list = listItemInfo.list; - var _isTypeArgList = callExpression.typeArguments && callExpression.typeArguments.pos === _list.pos; - var argumentIndex = getArgumentIndex(_list, node); - var argumentCount = getArgumentCount(_list); + var list = listItemInfo.list; + var isTypeArgList = callExpression.typeArguments && callExpression.typeArguments.pos === list.pos; + var argumentIndex = getArgumentIndex(list, node); + var argumentCount = getArgumentCount(list); ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); return { - kind: _isTypeArgList ? 0 : 1, + kind: isTypeArgList ? 0 : 1, invocation: callExpression, - argumentsSpan: getApplicableSpanForArguments(_list), + argumentsSpan: getApplicableSpanForArguments(list), argumentIndex: argumentIndex, argumentCount: argumentCount }; } } - else if (node.kind === 10 && node.parent.kind === 157) { + else if (node.kind === 10 && node.parent.kind === 159) { if (ts.isInsideTemplateLiteral(node, position)) { return getArgumentListInfoForTemplate(node.parent, 0); } } - else if (node.kind === 11 && node.parent.parent.kind === 157) { + else if (node.kind === 11 && node.parent.parent.kind === 159) { var templateExpression = node.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 169); - var _argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; - return getArgumentListInfoForTemplate(tagExpression, _argumentIndex); + ts.Debug.assert(templateExpression.kind === 171); + var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; + return getArgumentListInfoForTemplate(tagExpression, argumentIndex); } - else if (node.parent.kind === 173 && node.parent.parent.parent.kind === 157) { + else if (node.parent.kind === 176 && node.parent.parent.parent.kind === 159) { var templateSpan = node.parent; - var _templateExpression = templateSpan.parent; - var _tagExpression = _templateExpression.parent; - ts.Debug.assert(_templateExpression.kind === 169); + var templateExpression = templateSpan.parent; + var tagExpression = templateExpression.parent; + ts.Debug.assert(templateExpression.kind === 171); if (node.kind === 13 && !ts.isInsideTemplateLiteral(node, position)) { return undefined; } - var spanIndex = _templateExpression.templateSpans.indexOf(templateSpan); - var _argumentIndex_1 = getArgumentIndexForTemplatePiece(spanIndex, node); - return getArgumentListInfoForTemplate(_tagExpression, _argumentIndex_1); + var spanIndex = templateExpression.templateSpans.indexOf(templateSpan); + var argumentIndex = getArgumentIndexForTemplatePiece(spanIndex, node); + return getArgumentListInfoForTemplate(tagExpression, argumentIndex); } return undefined; } function getArgumentIndex(argumentsList, node) { var argumentIndex = 0; var listChildren = argumentsList.getChildren(); - for (var _i = 0, _n = listChildren.length; _i < _n; _i++) { + for (var _i = 0; _i < listChildren.length; _i++) { var child = listChildren[_i]; if (child === node) { break; @@ -24440,7 +26221,7 @@ var ts; var template = taggedTemplate.template; var applicableSpanStart = template.getStart(); var applicableSpanEnd = template.getEnd(); - if (template.kind === 169) { + if (template.kind === 171) { var lastSpan = ts.lastOrUndefined(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, false); @@ -24449,16 +26230,16 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node) { - for (var n = node; n.kind !== 221; n = n.parent) { + for (var n = node; n.kind !== 227; n = n.parent) { if (ts.isFunctionBlock(n)) { return undefined; } if (n.pos < n.parent.pos || n.end > n.parent.end) { ts.Debug.fail("Node of kind " + n.kind + " is not a subspan of its parent of kind " + n.parent.kind); } - var _argumentInfo = getImmediatelyContainingArgumentInfo(n); - if (_argumentInfo) { - return _argumentInfo; + var argumentInfo_1 = getImmediatelyContainingArgumentInfo(n); + if (argumentInfo_1) { + return argumentInfo_1; } } return undefined; @@ -24621,6 +26402,129 @@ var ts; return start < end; } ts.startEndOverlapsWithStartEnd = startEndOverlapsWithStartEnd; + function positionBelongsToNode(candidate, position, sourceFile) { + return candidate.end > position || !isCompletedNode(candidate, sourceFile); + } + ts.positionBelongsToNode = positionBelongsToNode; + function isCompletedNode(n, sourceFile) { + if (ts.nodeIsMissing(n)) { + return false; + } + switch (n.kind) { + case 201: + case 202: + case 204: + case 154: + case 150: + case 145: + case 179: + case 206: + case 207: + return nodeEndsWith(n, 15, sourceFile); + case 223: + return isCompletedNode(n.block, sourceFile); + case 158: + if (!n.arguments) { + return true; + } + case 157: + case 161: + case 149: + return nodeEndsWith(n, 17, sourceFile); + case 142: + case 143: + return isCompletedNode(n.type, sourceFile); + case 135: + case 136: + case 137: + case 200: + case 162: + case 134: + case 133: + case 139: + case 138: + case 163: + if (n.body) { + return isCompletedNode(n.body, sourceFile); + } + if (n.type) { + return isCompletedNode(n.type, sourceFile); + } + return hasChildOfKind(n, 17, sourceFile); + case 205: + return n.body && isCompletedNode(n.body, sourceFile); + case 183: + if (n.elseStatement) { + return isCompletedNode(n.elseStatement, sourceFile); + } + return isCompletedNode(n.thenStatement, sourceFile); + case 182: + return isCompletedNode(n.expression, sourceFile); + case 153: + case 151: + case 156: + case 127: + case 147: + return nodeEndsWith(n, 19, sourceFile); + case 140: + if (n.type) { + return isCompletedNode(n.type, sourceFile); + } + return hasChildOfKind(n, 19, sourceFile); + case 220: + case 221: + return false; + case 186: + case 187: + case 188: + case 185: + return isCompletedNode(n.statement, sourceFile); + case 184: + var hasWhileKeyword = findChildOfKind(n, 100, sourceFile); + if (hasWhileKeyword) { + return nodeEndsWith(n, 17, sourceFile); + } + return isCompletedNode(n.statement, sourceFile); + case 144: + return isCompletedNode(n.exprName, sourceFile); + case 165: + case 164: + case 166: + case 172: + case 173: + var unaryWordExpression = n; + return isCompletedNode(unaryWordExpression.expression, sourceFile); + case 159: + return isCompletedNode(n.template, sourceFile); + case 171: + var lastSpan = ts.lastOrUndefined(n.templateSpans); + return isCompletedNode(lastSpan, sourceFile); + case 176: + return ts.nodeIsPresent(n.literal); + case 167: + return isCompletedNode(n.operand, sourceFile); + case 169: + return isCompletedNode(n.right, sourceFile); + case 170: + return isCompletedNode(n.whenFalse, sourceFile); + default: + return true; + } + } + ts.isCompletedNode = isCompletedNode; + function nodeEndsWith(n, expectedLastToken, sourceFile) { + var children = n.getChildren(sourceFile); + if (children.length) { + var last = children[children.length - 1]; + if (last.kind === expectedLastToken) { + return true; + } + else if (last.kind === 22 && children.length !== 1) { + return children[children.length - 2].kind === expectedLastToken; + } + } + return false; + } function findListItemInfo(node) { var list = findContainingList(node); if (!list) { @@ -24634,13 +26538,17 @@ var ts; }; } ts.findListItemInfo = findListItemInfo; + function hasChildOfKind(n, kind, sourceFile) { + return !!findChildOfKind(n, kind, sourceFile); + } + ts.hasChildOfKind = hasChildOfKind; function findChildOfKind(n, kind, sourceFile) { return ts.forEach(n.getChildren(sourceFile), function (c) { return c.kind === kind && c; }); } ts.findChildOfKind = findChildOfKind; function findContainingList(node) { var syntaxList = ts.forEach(node.parent.getChildren(), function (c) { - if (c.kind === 222 && c.pos <= node.pos && c.end >= node.end) { + if (c.kind === 228 && c.pos <= node.pos && c.end >= node.end) { return c; } }); @@ -24705,7 +26613,7 @@ var ts; return n; } var children = n.getChildren(); - for (var _i = 0, _n = children.length; _i < _n; _i++) { + for (var _i = 0; _i < children.length; _i++) { var child = children[_i]; var shouldDiveInChildNode = (child.pos <= previousToken.pos && child.end > previousToken.end) || (child.pos === previousToken.end); @@ -24746,10 +26654,10 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 221); + ts.Debug.assert(startNode !== undefined || n.kind === 227); if (children.length) { - var _candidate = findRightmostChildNodeWithTokens(children, children.length); - return _candidate && findRightmostToken(_candidate); + var candidate = findRightmostChildNodeWithTokens(children, children.length); + return candidate && findRightmostToken(candidate); } } function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) { @@ -24783,22 +26691,23 @@ var ts; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 139 || node.kind === 155) { + if (node.kind === 141 || node.kind === 157) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 196 || node.kind === 197) { + if (ts.isFunctionLike(node) || node.kind === 201 || node.kind === 202) { return node.typeParameters; } return undefined; } ts.getTypeArgumentOrTypeParameterList = getTypeArgumentOrTypeParameterList; function isToken(n) { - return n.kind >= 0 && n.kind <= 124; + return n.kind >= 0 && n.kind <= 125; } ts.isToken = isToken; function isWord(kind) { - return kind === 64 || ts.isKeyword(kind); + return kind === 65 || ts.isKeyword(kind); } + ts.isWord = isWord; function isPropertyName(kind) { return kind === 8 || kind === 7 || isWord(kind); } @@ -24807,7 +26716,7 @@ var ts; } ts.isComment = isComment; function isPunctuation(kind) { - return 14 <= kind && kind <= 63; + return 14 <= kind && kind <= 64; } ts.isPunctuation = isPunctuation; function isInsideTemplateLiteral(node, position) { @@ -24815,6 +26724,16 @@ var ts; && (node.getStart() < position && position < node.getEnd()) || (!!node.isUnterminated && position === node.getEnd()); } ts.isInsideTemplateLiteral = isInsideTemplateLiteral; + function isAccessibilityModifier(kind) { + switch (kind) { + case 109: + case 107: + case 108: + return true; + } + return false; + } + ts.isAccessibilityModifier = isAccessibilityModifier; function compareDataObjects(dst, src) { for (var e in dst) { if (typeof dst[e] === "object") { @@ -24835,7 +26754,7 @@ var ts; var ts; (function (ts) { function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 128; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 129; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -24846,12 +26765,12 @@ var ts; resetWriter(); return { displayParts: function () { return displayParts; }, - writeKeyword: function (text) { return writeKind(text, 5); }, - writeOperator: function (text) { return writeKind(text, 12); }, - writePunctuation: function (text) { return writeKind(text, 15); }, - writeSpace: function (text) { return writeKind(text, 16); }, - writeStringLiteral: function (text) { return writeKind(text, 8); }, - writeParameter: function (text) { return writeKind(text, 13); }, + writeKeyword: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.keyword); }, + writeOperator: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.operator); }, + writePunctuation: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.punctuation); }, + writeSpace: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.space); }, + writeStringLiteral: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.stringLiteral); }, + writeParameter: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.parameterName); }, writeSymbol: writeSymbol, writeLine: writeLine, increaseIndent: function () { indent++; }, @@ -24863,7 +26782,7 @@ var ts; if (lineStart) { var indentString = ts.getIndentString(indent); if (indentString) { - displayParts.push(displayPart(indentString, 16)); + displayParts.push(displayPart(indentString, ts.SymbolDisplayPartKind.space)); } lineStart = false; } @@ -24891,48 +26810,48 @@ var ts; function displayPartKind(symbol) { var flags = symbol.flags; if (flags & 3) { - return isFirstDeclarationOfSymbolParameter(symbol) ? 13 : 9; + return isFirstDeclarationOfSymbolParameter(symbol) ? ts.SymbolDisplayPartKind.parameterName : ts.SymbolDisplayPartKind.localName; } else if (flags & 4) { - return 14; + return ts.SymbolDisplayPartKind.propertyName; } else if (flags & 32768) { - return 14; + return ts.SymbolDisplayPartKind.propertyName; } else if (flags & 65536) { - return 14; + return ts.SymbolDisplayPartKind.propertyName; } else if (flags & 8) { - return 19; + return ts.SymbolDisplayPartKind.enumMemberName; } else if (flags & 16) { - return 20; + return ts.SymbolDisplayPartKind.functionName; } else if (flags & 32) { - return 1; + return ts.SymbolDisplayPartKind.className; } else if (flags & 64) { - return 4; + return ts.SymbolDisplayPartKind.interfaceName; } else if (flags & 384) { - return 2; + return ts.SymbolDisplayPartKind.enumName; } else if (flags & 1536) { - return 11; + return ts.SymbolDisplayPartKind.moduleName; } else if (flags & 8192) { - return 10; + return ts.SymbolDisplayPartKind.methodName; } else if (flags & 262144) { - return 18; + return ts.SymbolDisplayPartKind.typeParameterName; } else if (flags & 524288) { - return 0; + return ts.SymbolDisplayPartKind.aliasName; } else if (flags & 8388608) { - return 0; + return ts.SymbolDisplayPartKind.aliasName; } - return 17; + return ts.SymbolDisplayPartKind.text; } } ts.symbolPart = symbolPart; @@ -24944,27 +26863,34 @@ var ts; } ts.displayPart = displayPart; function spacePart() { - return displayPart(" ", 16); + return displayPart(" ", ts.SymbolDisplayPartKind.space); } ts.spacePart = spacePart; function keywordPart(kind) { - return displayPart(ts.tokenToString(kind), 5); + return displayPart(ts.tokenToString(kind), ts.SymbolDisplayPartKind.keyword); } ts.keywordPart = keywordPart; function punctuationPart(kind) { - return displayPart(ts.tokenToString(kind), 15); + return displayPart(ts.tokenToString(kind), ts.SymbolDisplayPartKind.punctuation); } ts.punctuationPart = punctuationPart; function operatorPart(kind) { - return displayPart(ts.tokenToString(kind), 12); + return displayPart(ts.tokenToString(kind), ts.SymbolDisplayPartKind.operator); } ts.operatorPart = operatorPart; + function textOrKeywordPart(text) { + var kind = ts.stringToToken(text); + return kind === undefined + ? textPart(text) + : keywordPart(kind); + } + ts.textOrKeywordPart = textOrKeywordPart; function textPart(text) { - return displayPart(text, 17); + return displayPart(text, ts.SymbolDisplayPartKind.text); } ts.textPart = textPart; function lineBreakPart() { - return displayPart("\n", 6); + return displayPart("\n", ts.SymbolDisplayPartKind.lineBreak); } ts.lineBreakPart = lineBreakPart; function mapToDisplayParts(writeDisplayParts) { @@ -24993,6 +26919,8 @@ var ts; } ts.signatureToDisplayParts = signatureToDisplayParts; })(ts || (ts = {})); +/// +/// var ts; (function (ts) { var formatting; @@ -25044,21 +26972,21 @@ var ts; var t; var pos = scanner.getStartPos(); while (pos < endPos) { - var _t = scanner.getToken(); - if (!ts.isTrivia(_t)) { + var t_2 = scanner.getToken(); + if (!ts.isTrivia(t_2)) { break; } scanner.scan(); - var _item = { + var item_4 = { pos: pos, end: scanner.getStartPos(), - kind: _t + kind: t_2 }; pos = scanner.getStartPos(); if (!leadingTrivia) { leadingTrivia = []; } - leadingTrivia.push(_item); + leadingTrivia.push(item_4); } savedPos = scanner.getStartPos(); } @@ -25066,8 +26994,8 @@ var ts; if (node) { switch (node.kind) { case 27: - case 59: case 60: + case 61: case 42: case 41: return true; @@ -25083,7 +27011,7 @@ var ts; container.kind === 13; } function startsWithSlashToken(t) { - return t === 36 || t === 56; + return t === 36 || t === 57; } function readTokenInfo(n) { if (!isOnToken()) { @@ -25162,8 +27090,8 @@ var ts; } function isOnToken() { var current = (lastTokenInfo && lastTokenInfo.token.kind) || scanner.getToken(); - var _startPos = (lastTokenInfo && lastTokenInfo.token.pos) || scanner.getStartPos(); - return _startPos < endPos && current !== 1 && !ts.isTrivia(current); + var startPos = (lastTokenInfo && lastTokenInfo.token.pos) || scanner.getStartPos(); + return startPos < endPos && current !== 1 && !ts.isTrivia(current); } function fixTokenKind(tokenInfo, container) { if (ts.isToken(container) && tokenInfo.token.kind !== container.kind) { @@ -25175,6 +27103,21 @@ var ts; formatting.getFormattingScanner = getFormattingScanner; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; @@ -25253,6 +27196,21 @@ var ts; formatting.FormattingContext = FormattingContext; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; @@ -25267,6 +27225,21 @@ var ts; var FormattingRequestKind = formatting.FormattingRequestKind; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; @@ -25288,6 +27261,21 @@ var ts; formatting.Rule = Rule; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; @@ -25301,6 +27289,21 @@ var ts; var RuleAction = formatting.RuleAction; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; @@ -25331,6 +27334,21 @@ var ts; formatting.RuleDescriptor = RuleDescriptor; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; @@ -25342,6 +27360,21 @@ var ts; var RuleFlags = formatting.RuleFlags; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; @@ -25369,6 +27402,21 @@ var ts; formatting.RuleOperation = RuleOperation; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; @@ -25388,7 +27436,7 @@ var ts; if (this.IsAny()) { return true; } - for (var _i = 0, _a = this.customContextChecks, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = this.customContextChecks; _i < _a.length; _i++) { var check = _a[_i]; if (!check(context)) { return false; @@ -25402,12 +27450,30 @@ var ts; formatting.RuleOperationContext = RuleOperationContext; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; (function (formatting) { var Rules = (function () { function Rules() { + /// + /// Common Rules + /// this.IgnoreBeforeComment = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.Comments), formatting.RuleOperation.create1(1)); this.IgnoreAfterLineComment = new formatting.Rule(formatting.RuleDescriptor.create3(2, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create1(1)); this.NoSpaceBeforeSemicolon = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 22), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); @@ -25418,8 +27484,8 @@ var ts; this.NoSpaceAfterQuestionMark = new formatting.Rule(formatting.RuleDescriptor.create3(50, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.SpaceAfterSemicolon = new formatting.Rule(formatting.RuleDescriptor.create3(22, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); this.SpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(15, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsAfterCodeBlockContext), 2)); - this.SpaceBetweenCloseBraceAndElse = new formatting.Rule(formatting.RuleDescriptor.create1(15, 75), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - this.SpaceBetweenCloseBraceAndWhile = new formatting.Rule(formatting.RuleDescriptor.create1(15, 99), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); + this.SpaceBetweenCloseBraceAndElse = new formatting.Rule(formatting.RuleDescriptor.create1(15, 76), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); + this.SpaceBetweenCloseBraceAndWhile = new formatting.Rule(formatting.RuleDescriptor.create1(15, 100), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); this.NoSpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(15, formatting.Shared.TokenRange.FromTokens([17, 19, 23, 22])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.NoSpaceBeforeDot = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.NoSpaceAfterDot = new formatting.Rule(formatting.RuleDescriptor.create3(20, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); @@ -25429,9 +27495,9 @@ var ts; this.NoSpaceAfterCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create3(19, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.FunctionOpenBraceLeftTokenRange = formatting.Shared.TokenRange.AnyIncludingMultilineComments; this.SpaceBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1); - this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([64, 3]); + this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([65, 3]); this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1); - this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([17, 3, 74, 95, 80, 75]); + this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([17, 3, 75, 96, 81, 76]); this.SpaceBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1); this.SpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(14, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2)); this.SpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2)); @@ -25450,25 +27516,25 @@ var ts; this.SpaceAfterSubtractWhenFollowedByUnaryMinus = new formatting.Rule(formatting.RuleDescriptor.create1(34, 34), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); this.SpaceAfterSubtractWhenFollowedByPredecrement = new formatting.Rule(formatting.RuleDescriptor.create1(34, 39), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); this.NoSpaceBeforeComma = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 23), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.SpaceAfterCertainKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([97, 93, 87, 73, 89, 96]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([104, 69]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2)); + this.SpaceAfterCertainKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([98, 94, 88, 74, 90, 97]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); + this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([105, 70]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2)); this.NoSpaceBeforeOpenParenInFuncCall = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionCallOrNewContext, Rules.IsPreviousTokenNotComma), 8)); - this.SpaceAfterFunctionInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create3(82, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); + this.SpaceAfterFunctionInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create3(83, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); this.NoSpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionDeclContext), 8)); - this.SpaceAfterVoidOperator = new formatting.Rule(formatting.RuleDescriptor.create3(98, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsVoidOpContext), 2)); - this.NoSpaceBetweenReturnAndSemicolon = new formatting.Rule(formatting.RuleDescriptor.create1(89, 22), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.SpaceBetweenStatements = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([17, 74, 75, 66]), 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([95, 80]), 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([115, 119]), 64), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); + this.SpaceAfterVoidOperator = new formatting.Rule(formatting.RuleDescriptor.create3(99, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsVoidOpContext), 2)); + 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.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(113, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([116, 117]), 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([68, 114, 76, 77, 78, 115, 102, 84, 103, 116, 106, 108, 119, 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([78, 102])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 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, 103, 85, 104, 117, 107, 109, 120, 110]), 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, 103])), 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)); - this.NoSpaceAfterEllipsis = new formatting.Rule(formatting.RuleDescriptor.create1(21, 64), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); + this.NoSpaceAfterEllipsis = new formatting.Rule(formatting.RuleDescriptor.create1(21, 65), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.NoSpaceAfterOptionalParameters = new formatting.Rule(formatting.RuleDescriptor.create3(50, formatting.Shared.TokenRange.FromTokens([17, 23])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8)); this.NoSpaceBeforeOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.TypeNames, 24), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); this.NoSpaceBetweenCloseParenAndAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create1(17, 24), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); @@ -25541,42 +27607,42 @@ var ts; this.NoSpaceBetweenParens = new formatting.Rule(formatting.RuleDescriptor.create1(16, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.NoSpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.NoSpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.SpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(82, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); - this.NoSpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(82, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 8)); + this.SpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(83, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); + this.NoSpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(83, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 8)); } Rules.prototype.getRuleName = function (rule) { var o = this; - for (var _name in o) { - if (o[_name] === rule) { - return _name; + for (var name_19 in o) { + if (o[name_19] === rule) { + return name_19; } } throw new Error("Unknown rule"); }; Rules.IsForContext = function (context) { - return context.contextNode.kind === 181; + return context.contextNode.kind === 186; }; Rules.IsNotForContext = function (context) { return !Rules.IsForContext(context); }; Rules.IsBinaryOpContext = function (context) { switch (context.contextNode.kind) { - case 167: - case 168: + case 169: + case 170: return true; - case 203: - case 193: - case 128: - case 220: - case 130: + case 208: + case 198: case 129: - return context.currentTokenSpan.kind === 52 || context.nextTokenSpan.kind === 52; - case 182: - return context.currentTokenSpan.kind === 85 || context.nextTokenSpan.kind === 85; - case 183: - return context.currentTokenSpan.kind === 124 || context.nextTokenSpan.kind === 124; - case 150: - return context.currentTokenSpan.kind === 52 || context.nextTokenSpan.kind === 52; + case 226: + 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 false; }; @@ -25584,9 +27650,25 @@ var ts; return !Rules.IsBinaryOpContext(context); }; Rules.IsConditionalOperatorContext = function (context) { - return context.contextNode.kind === 168; + return context.contextNode.kind === 170; }; Rules.IsSameLineTokenOrBeforeMultilineBlockContext = function (context) { + //// This check is mainly used inside SpaceBeforeOpenBraceInControl and SpaceBeforeOpenBraceInFunction. + //// + //// Ex: + //// if (1) { .... + //// * ) and { are on the same line so apply the rule. Here we don't care whether it's same or multi block context + //// + //// Ex: + //// if (1) + //// { ... } + //// * ) and { are on differnet lines. We only need to format if the block is multiline context. So in this case we don't format. + //// + //// Ex: + //// if (1) + //// { ... + //// } + //// * ) and { are on differnet lines. We only need to format if the block is multiline context. So in this case we format. return context.TokensAreOnSameLine() || Rules.IsBeforeMultilineBlockContext(context); }; Rules.IsBeforeMultilineBlockContext = function (context) { @@ -25609,26 +27691,26 @@ var ts; return true; } switch (node.kind) { - case 174: - case 202: - case 152: - case 201: + case 179: + case 207: + case 154: + case 206: return true; } return false; }; Rules.IsFunctionDeclContext = function (context) { switch (context.contextNode.kind) { - case 195: - case 132: - case 131: + case 200: case 134: - case 135: - case 136: - case 160: case 133: - case 161: - case 197: + case 136: + case 137: + case 138: + case 162: + case 135: + case 163: + case 202: return true; } return false; @@ -25638,53 +27720,53 @@ var ts; }; Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) { switch (node.kind) { - case 196: - case 197: - case 199: - case 143: - case 200: + case 201: + case 202: + case 204: + case 145: + case 205: return true; } return false; }; Rules.IsAfterCodeBlockContext = function (context) { switch (context.currentTokenParent.kind) { - case 196: - case 200: - case 199: - case 174: - case 217: case 201: - case 188: + case 205: + case 204: + case 179: + case 223: + case 206: + case 193: return true; } return false; }; Rules.IsControlDeclContext = function (context) { switch (context.contextNode.kind) { - case 178: - case 188: - case 181: - case 182: case 183: - case 180: - case 191: - case 179: + case 193: + case 186: case 187: - case 217: + case 188: + case 185: + case 196: + case 184: + case 192: + case 223: return true; default: return false; } }; Rules.IsObjectContext = function (context) { - return context.contextNode.kind === 152; + return context.contextNode.kind === 154; }; Rules.IsFunctionCallContext = function (context) { - return context.contextNode.kind === 155; + return context.contextNode.kind === 157; }; Rules.IsNewContext = function (context) { - return context.contextNode.kind === 156; + return context.contextNode.kind === 158; }; Rules.IsFunctionCallOrNewContext = function (context) { return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context); @@ -25696,35 +27778,35 @@ var ts; return context.TokensAreOnSameLine(); }; Rules.IsStartOfVariableDeclarationList = function (context) { - return context.currentTokenParent.kind === 194 && + return context.currentTokenParent.kind === 199 && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; }; Rules.IsNotFormatOnEnter = function (context) { return context.formattingRequestKind != 2; }; Rules.IsModuleDeclContext = function (context) { - return context.contextNode.kind === 200; + return context.contextNode.kind === 205; }; Rules.IsObjectTypeContext = function (context) { - return context.contextNode.kind === 143; + return context.contextNode.kind === 145; }; Rules.IsTypeArgumentOrParameter = function (token, parent) { if (token.kind !== 24 && token.kind !== 25) { return false; } switch (parent.kind) { + case 141: + case 201: + case 202: + case 200: + case 162: + case 163: + case 134: + case 133: + case 138: case 139: - case 196: - case 197: - case 195: - case 160: - case 161: - case 132: - case 131: - case 136: - case 137: - case 155: - case 156: + case 157: + case 158: return true; default: return false; @@ -25735,13 +27817,28 @@ var ts; Rules.IsTypeArgumentOrParameter(context.nextTokenSpan, context.nextTokenParent); }; Rules.IsVoidOpContext = function (context) { - return context.currentTokenSpan.kind === 98 && context.currentTokenParent.kind === 164; + return context.currentTokenSpan.kind === 99 && context.currentTokenParent.kind === 166; }; return Rules; })(); formatting.Rules = Rules; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; @@ -25757,7 +27854,7 @@ var ts; return result; }; RulesMap.prototype.Initialize = function (rules) { - this.mapRowLength = 124 + 1; + this.mapRowLength = 125 + 1; this.map = new Array(this.mapRowLength * this.mapRowLength); var rulesBucketConstructionStateList = new Array(this.map.length); this.FillRules(rules, rulesBucketConstructionStateList); @@ -25792,7 +27889,7 @@ var ts; var bucketIndex = this.GetRuleBucketIndex(context.currentTokenSpan.kind, context.nextTokenSpan.kind); var bucket = this.map[bucketIndex]; if (bucket != null) { - for (var _i = 0, _a = bucket.Rules(), _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = bucket.Rules(); _i < _a.length; _i++) { var rule = _a[_i]; if (rule.Operation.Context.InContext(context)) { return rule; @@ -25852,7 +27949,7 @@ var ts; var position; if (rule.Operation.Action == 1) { position = specificTokens ? - 0 : + RulesPosition.IgnoreRulesSpecific : RulesPosition.IgnoreRulesAny; } else if (!rule.Operation.Context.IsAny()) { @@ -25878,6 +27975,21 @@ var ts; formatting.RulesBucket = RulesBucket; })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; @@ -25933,7 +28045,7 @@ var ts; } TokenAllAccess.prototype.GetTokens = function () { var result = []; - for (var token = 0; token <= 124; token++) { + for (var token = 0; token <= 125; token++) { result.push(token); } return result; @@ -25975,23 +28087,64 @@ var ts; }; TokenRange.Any = TokenRange.AllTokens(); TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([3])); - TokenRange.Keywords = TokenRange.FromRange(65, 124); - TokenRange.BinaryOperators = TokenRange.FromRange(24, 63); - TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([85, 86, 124]); + TokenRange.Keywords = TokenRange.FromRange(66, 125); + TokenRange.BinaryOperators = TokenRange.FromRange(24, 64); + TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([86, 87, 125]); TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([38, 39, 47, 46]); - TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([7, 64, 16, 18, 14, 92, 87]); - TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([64, 16, 92, 87]); - TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([64, 17, 19, 87]); - TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([64, 16, 92, 87]); - TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([64, 17, 19, 87]); + TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([7, 65, 16, 18, 14, 93, 88]); + TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([65, 16, 93, 88]); + TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([65, 17, 19, 88]); + 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([64, 118, 120, 112, 121, 98, 111]); + TokenRange.TypeNames = TokenRange.FromTokens([65, 119, 121, 113, 122, 99, 112]); return TokenRange; })(); Shared.TokenRange = TokenRange; })(Shared = formatting.Shared || (formatting.Shared = {})); })(formatting = ts.formatting || (ts.formatting = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var ts; (function (ts) { var formatting; @@ -26077,6 +28230,10 @@ var ts; formatting.RulesProvider = RulesProvider; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); +/// +/// +/// +/// var ts; (function (ts) { var formatting; @@ -26122,13 +28279,13 @@ var ts; } formatting.formatSelection = formatSelection; function formatOutermostParent(position, expectedLastToken, sourceFile, options, rulesProvider, requestKind) { - var _parent = findOutermostParent(position, expectedLastToken, sourceFile); - if (!_parent) { + var parent = findOutermostParent(position, expectedLastToken, sourceFile); + if (!parent) { return []; } var span = { - pos: ts.getLineStartPositionForPosition(_parent.getStart(sourceFile), sourceFile), - end: _parent.end + pos: ts.getLineStartPositionForPosition(parent.getStart(sourceFile), sourceFile), + end: parent.end }; return formatSpan(span, sourceFile, options, rulesProvider, requestKind); } @@ -26150,17 +28307,17 @@ var ts; } function isListElement(parent, node) { switch (parent.kind) { - case 196: - case 197: - return ts.rangeContainsRange(parent.members, node); - case 200: - var body = parent.body; - return body && body.kind === 174 && ts.rangeContainsRange(body.statements, node); - case 221: - case 174: case 201: + case 202: + 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: return ts.rangeContainsRange(parent.statements, node); - case 217: + case 223: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -26265,10 +28422,10 @@ var ts; } } else { - var _startLine = sourceFile.getLineAndCharacterOfPosition(startPos).line; + var startLine = sourceFile.getLineAndCharacterOfPosition(startPos).line; var startLinePosition = ts.getLineStartPositionForPosition(startPos, sourceFile); var column = formatting.SmartIndenter.findFirstNonWhitespaceColumn(startLinePosition, startPos, sourceFile, options); - if (_startLine !== parentStartLine || startPos === column) { + if (startLine !== parentStartLine || startPos === column) { return column; } } @@ -26279,9 +28436,9 @@ var ts; if (indentation === -1) { if (isSomeBlock(node.kind)) { if (isSomeBlock(parent.kind) || - parent.kind === 221 || - parent.kind === 214 || - parent.kind === 215) { + parent.kind === 227 || + parent.kind === 220 || + parent.kind === 221) { indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); } else { @@ -26307,6 +28464,26 @@ var ts; delta: delta }; } + function getFirstNonDecoratorTokenOfNode(node) { + if (node.modifiers && node.modifiers.length) { + return node.modifiers[0].kind; + } + switch (node.kind) { + case 201: return 69; + case 202: return 104; + case 200: return 83; + case 204: return 204; + case 136: return 116; + case 137: return 120; + case 134: + if (node.asteriskToken) { + return 35; + } + case 132: + case 129: + return node.name.kind; + } + } function getDynamicIndentation(node, nodeStartLine, indentation, delta) { return { getIndentationForComment: function (kind) { @@ -26318,13 +28495,19 @@ var ts; return indentation; }, getIndentationForToken: function (line, kind) { + if (nodeStartLine !== line && node.decorators) { + if (kind === getFirstNonDecoratorTokenOfNode(node)) { + return indentation; + } + } switch (kind) { case 14: case 15: case 18: case 19: - case 75: - case 99: + case 76: + case 100: + case 52: return indentation; default: return nodeStartLine !== line ? indentation + delta : indentation; @@ -26385,19 +28568,19 @@ var ts; return inheritedIndentation; } while (formattingScanner.isOnToken()) { - var _tokenInfo = formattingScanner.readTokenInfo(node); - if (_tokenInfo.token.end > childStartPos) { + var tokenInfo = formattingScanner.readTokenInfo(node); + if (tokenInfo.token.end > childStartPos) { break; } - consumeTokenAndAdvanceScanner(_tokenInfo, node, parentDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); } if (!formattingScanner.isOnToken()) { return inheritedIndentation; } if (ts.isToken(child)) { - var _tokenInfo_1 = formattingScanner.readTokenInfo(child); - ts.Debug.assert(_tokenInfo_1.token.end === child.end); - consumeTokenAndAdvanceScanner(_tokenInfo_1, node, parentDynamicIndentation); + var tokenInfo = formattingScanner.readTokenInfo(child); + ts.Debug.assert(tokenInfo.token.end === child.end); + consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); return inheritedIndentation; } var childIndentation = computeIndentation(child, childStart.line, childIndentationAmount, node, parentDynamicIndentation, parentStartLine); @@ -26409,34 +28592,34 @@ var ts; var listStartToken = getOpenTokenForList(parent, nodes); var listEndToken = getCloseTokenForOpenToken(listStartToken); var listDynamicIndentation = parentDynamicIndentation; - var _startLine = parentStartLine; + var startLine = parentStartLine; if (listStartToken !== 0) { while (formattingScanner.isOnToken()) { - var _tokenInfo = formattingScanner.readTokenInfo(parent); - if (_tokenInfo.token.end > nodes.pos) { + var tokenInfo = formattingScanner.readTokenInfo(parent); + if (tokenInfo.token.end > nodes.pos) { break; } - else if (_tokenInfo.token.kind === listStartToken) { - _startLine = sourceFile.getLineAndCharacterOfPosition(_tokenInfo.token.pos).line; - var _indentation = computeIndentation(_tokenInfo.token, _startLine, -1, parent, parentDynamicIndentation, _startLine); - listDynamicIndentation = getDynamicIndentation(parent, parentStartLine, _indentation.indentation, _indentation.delta); - consumeTokenAndAdvanceScanner(_tokenInfo, parent, listDynamicIndentation); + else if (tokenInfo.token.kind === listStartToken) { + startLine = sourceFile.getLineAndCharacterOfPosition(tokenInfo.token.pos).line; + var indentation_1 = computeIndentation(tokenInfo.token, startLine, -1, parent, parentDynamicIndentation, startLine); + listDynamicIndentation = getDynamicIndentation(parent, parentStartLine, indentation_1.indentation, indentation_1.delta); + consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); } else { - consumeTokenAndAdvanceScanner(_tokenInfo, parent, parentDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, parent, parentDynamicIndentation); } } } var inheritedIndentation = -1; - for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + for (var _i = 0; _i < nodes.length; _i++) { var child = nodes[_i]; - inheritedIndentation = processChildNode(child, inheritedIndentation, node, listDynamicIndentation, _startLine, true); + inheritedIndentation = processChildNode(child, inheritedIndentation, node, listDynamicIndentation, startLine, true); } if (listEndToken !== 0) { if (formattingScanner.isOnToken()) { - var _tokenInfo_1 = formattingScanner.readTokenInfo(parent); - if (_tokenInfo_1.token.kind === listEndToken && ts.rangeContainsRange(parent, _tokenInfo_1.token)) { - consumeTokenAndAdvanceScanner(_tokenInfo_1, parent, listDynamicIndentation); + var tokenInfo = formattingScanner.readTokenInfo(parent); + if (tokenInfo.token.kind === listEndToken && ts.rangeContainsRange(parent, tokenInfo.token)) { + consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); } } } @@ -26473,7 +28656,7 @@ var ts; if (indentToken) { var indentNextTokenOrTrivia = true; if (currentTokenInfo.leadingTrivia) { - for (var _i = 0, _a = currentTokenInfo.leadingTrivia, _n = _a.length; _i < _n; _i++) { + for (var _i = 0, _a = currentTokenInfo.leadingTrivia; _i < _a.length; _i++) { var triviaItem = _a[_i]; if (!ts.rangeContainsRange(originalRange, triviaItem)) { continue; @@ -26487,8 +28670,8 @@ var ts; break; case 2: if (indentNextTokenOrTrivia) { - var _commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); - insertIndentation(triviaItem.pos, _commentIndentation, false); + var commentIndentation_1 = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); + insertIndentation(triviaItem.pos, commentIndentation_1, false); indentNextTokenOrTrivia = false; } break; @@ -26508,7 +28691,7 @@ var ts; } } function processTrivia(trivia, parent, contextNode, dynamicIndentation) { - for (var _i = 0, _n = trivia.length; _i < _n; _i++) { + for (var _i = 0; _i < trivia.length; _i++) { var triviaItem = trivia[_i]; if (ts.isComment(triviaItem.kind) && ts.rangeContainsRange(originalRange, triviaItem)) { var triviaItemStart = sourceFile.getLineAndCharacterOfPosition(triviaItem.pos); @@ -26580,10 +28763,10 @@ var ts; } } function indentMultilineComment(commentRange, indentation, firstLineIsIndented) { - var _startLine = sourceFile.getLineAndCharacterOfPosition(commentRange.pos).line; + var startLine = sourceFile.getLineAndCharacterOfPosition(commentRange.pos).line; var endLine = sourceFile.getLineAndCharacterOfPosition(commentRange.end).line; var parts; - if (_startLine === endLine) { + if (startLine === endLine) { if (!firstLineIsIndented) { insertIndentation(commentRange.pos, indentation, false); } @@ -26592,14 +28775,14 @@ var ts; else { parts = []; var startPos = commentRange.pos; - for (var line = _startLine; line < endLine; ++line) { + for (var line = startLine; line < endLine; ++line) { var endOfLine = ts.getEndLinePosition(line, sourceFile); parts.push({ pos: startPos, end: endOfLine }); startPos = ts.getStartPositionOfLine(line + 1, sourceFile); } parts.push({ pos: startPos, end: commentRange.end }); } - var startLinePos = ts.getStartPositionOfLine(_startLine, sourceFile); + var startLinePos = ts.getStartPositionOfLine(startLine, sourceFile); var nonWhitespaceColumnInFirstPart = formatting.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(startLinePos, parts[0].pos, sourceFile, options); if (indentation === nonWhitespaceColumnInFirstPart.column) { return; @@ -26607,21 +28790,21 @@ var ts; var startIndex = 0; if (firstLineIsIndented) { startIndex = 1; - _startLine++; + startLine++; } - var _delta = indentation - nonWhitespaceColumnInFirstPart.column; - for (var i = startIndex, len = parts.length; i < len; ++i, ++_startLine) { - var _startLinePos = ts.getStartPositionOfLine(_startLine, sourceFile); + var delta = indentation - nonWhitespaceColumnInFirstPart.column; + for (var i = startIndex, len = parts.length; i < len; ++i, ++startLine) { + var startLinePos_1 = ts.getStartPositionOfLine(startLine, sourceFile); var nonWhitespaceCharacterAndColumn = i === 0 ? nonWhitespaceColumnInFirstPart : formatting.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(parts[i].pos, parts[i].end, sourceFile, options); - var newIndentation = nonWhitespaceCharacterAndColumn.column + _delta; + var newIndentation = nonWhitespaceCharacterAndColumn.column + delta; if (newIndentation > 0) { var indentationString = getIndentationString(newIndentation, options); - recordReplace(_startLinePos, nonWhitespaceCharacterAndColumn.character, indentationString); + recordReplace(startLinePos_1, nonWhitespaceCharacterAndColumn.character, indentationString); } else { - recordDelete(_startLinePos, nonWhitespaceCharacterAndColumn.character); + recordDelete(startLinePos_1, nonWhitespaceCharacterAndColumn.character); } } } @@ -26688,20 +28871,20 @@ var ts; } function isSomeBlock(kind) { switch (kind) { - case 174: - case 201: + case 179: + case 206: return true; } return false; } function getOpenTokenForList(node, list) { switch (node.kind) { + case 135: + case 200: + case 162: + case 134: case 133: - case 195: - case 160: - case 132: - case 131: - case 161: + case 163: if (node.typeParameters === list) { return 24; } @@ -26709,8 +28892,8 @@ var ts; return 16; } break; - case 155: - case 156: + case 157: + case 158: if (node.typeArguments === list) { return 24; } @@ -26718,7 +28901,7 @@ var ts; return 16; } break; - case 139: + case 141: if (node.typeArguments === list) { return 24; } @@ -26734,9 +28917,15 @@ var ts; } return 0; } + var internedSizes; var internedTabsIndentation; var internedSpacesIndentation; function getIndentationString(indentation, options) { + var resetInternedStrings = !internedSizes || (internedSizes.tabSize !== options.TabSize || internedSizes.indentSize !== options.IndentSize); + if (resetInternedStrings) { + internedSizes = { tabSize: options.TabSize, indentSize: options.IndentSize }; + internedTabsIndentation = internedSpacesIndentation = undefined; + } if (!options.ConvertTabsToSpaces) { var tabs = Math.floor(indentation / options.TabSize); var spaces = indentation - tabs * options.TabSize; @@ -26779,6 +28968,7 @@ var ts; formatting.getIndentationString = getIndentationString; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); +/// var ts; (function (ts) { var formatting; @@ -26807,7 +28997,7 @@ var ts; return 0; } var lineAtPosition = sourceFile.getLineAndCharacterOfPosition(position).line; - if (precedingToken.kind === 23 && precedingToken.parent.kind !== 167) { + if (precedingToken.kind === 23 && precedingToken.parent.kind !== 169) { var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1) { return actualIndentation; @@ -26818,7 +29008,7 @@ var ts; var currentStart; var indentationDelta; while (current) { - if (positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode(current.kind, previous ? previous.kind : 0)) { + if (ts.positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode(current.kind, previous ? previous.kind : 0)) { currentStart = getStartLineAndCharacterForNode(current, sourceFile); if (nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile)) { indentationDelta = 0; @@ -26828,9 +29018,9 @@ var ts; } break; } - var _actualIndentation = getActualIndentationForListItem(current, sourceFile, options); - if (_actualIndentation !== -1) { - return _actualIndentation; + var actualIndentation = getActualIndentationForListItem(current, sourceFile, options); + if (actualIndentation !== -1) { + return actualIndentation; } previous = current; current = current.parent; @@ -26847,9 +29037,9 @@ var ts; } SmartIndenter.getIndentationForNode = getIndentationForNode; function getIndentationForNodeWorker(current, currentStart, ignoreActualIndentationRange, indentationDelta, sourceFile, options) { - var _parent = current.parent; + var parent = current.parent; var parentStart; - while (_parent) { + while (parent) { var useActualIndentation = true; if (ignoreActualIndentationRange) { var start = current.getStart(sourceFile); @@ -26861,21 +29051,21 @@ var ts; return actualIndentation + indentationDelta; } } - parentStart = getParentStart(_parent, current, sourceFile); + parentStart = getParentStart(parent, current, sourceFile); var parentAndChildShareLine = parentStart.line === currentStart.line || - childStartsOnTheSameLineWithElseInIfStatement(_parent, current, currentStart.line, sourceFile); + childStartsOnTheSameLineWithElseInIfStatement(parent, current, currentStart.line, sourceFile); if (useActualIndentation) { - var _actualIndentation = getActualIndentationForNode(current, _parent, currentStart, parentAndChildShareLine, sourceFile, options); - if (_actualIndentation !== -1) { - return _actualIndentation + indentationDelta; + var actualIndentation = getActualIndentationForNode(current, parent, currentStart, parentAndChildShareLine, sourceFile, options); + if (actualIndentation !== -1) { + return actualIndentation + indentationDelta; } } - if (shouldIndentChildNode(_parent.kind, current.kind) && !parentAndChildShareLine) { + if (shouldIndentChildNode(parent.kind, current.kind) && !parentAndChildShareLine) { indentationDelta += options.IndentSize; } - current = _parent; + current = parent; currentStart = parentStart; - _parent = current.parent; + parent = current.parent; } return indentationDelta; } @@ -26897,7 +29087,7 @@ var ts; } function getActualIndentationForNode(current, parent, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && - (parent.kind === 221 || !parentAndChildShareLine); + (parent.kind === 227 || !parentAndChildShareLine); if (!useActualIndentation) { return -1; } @@ -26920,12 +29110,9 @@ var ts; function getStartLineAndCharacterForNode(n, sourceFile) { return sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)); } - function positionBelongsToNode(candidate, position, sourceFile) { - return candidate.end > position || !isCompletedNode(candidate, sourceFile); - } function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 178 && parent.elseStatement === child) { - var elseKeyword = ts.findChildOfKind(parent, 75, sourceFile); + if (parent.kind === 183 && parent.elseStatement === child) { + var elseKeyword = ts.findChildOfKind(parent, 76, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; return elseKeywordStartLine === childStartLine; @@ -26936,23 +29123,23 @@ var ts; function getContainingList(node, sourceFile) { if (node.parent) { switch (node.parent.kind) { - case 139: + case 141: if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd())) { return node.parent.typeArguments; } break; - case 152: + case 154: return node.parent.properties; - case 151: + case 153: return node.parent.elements; - case 195: - case 160: - case 161: - case 132: - case 131: - case 136: - case 137: { + case 200: + case 162: + case 163: + case 134: + case 133: + case 138: + case 139: { var start = node.getStart(sourceFile); if (node.parent.typeParameters && ts.rangeContainsStartEnd(node.parent.typeParameters, start, node.getEnd())) { @@ -26963,15 +29150,15 @@ var ts; } break; } - case 156: - case 155: { - var _start = node.getStart(sourceFile); + case 158: + case 157: { + var start = node.getStart(sourceFile); if (node.parent.typeArguments && - ts.rangeContainsStartEnd(node.parent.typeArguments, _start, node.getEnd())) { + ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { return node.parent.typeArguments; } if (node.parent.arguments && - ts.rangeContainsStartEnd(node.parent.arguments, _start, node.getEnd())) { + ts.rangeContainsStartEnd(node.parent.arguments, start, node.getEnd())) { return node.parent.arguments; } break; @@ -27033,25 +29220,28 @@ var ts; SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; function nodeContentIsAlwaysIndented(kind) { switch (kind) { - case 196: - case 197: - case 199: - case 151: - case 174: case 201: - case 152: - case 143: case 202: - case 215: + case 204: + case 153: + case 179: + case 206: + 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 159: - case 155: - case 156: - case 175: - case 193: - case 209: - case 186: - case 168: + case 191: + case 170: + case 151: + case 150: return true; } return false; @@ -27061,106 +29251,46 @@ var ts; return true; } switch (parent) { - case 179: - case 180: - case 182: + case 184: + case 185: + case 187: + case 188: + case 186: case 183: - case 181: - case 178: - case 195: - case 160: - case 132: - case 131: - case 161: - case 133: + case 200: + case 162: case 134: + case 133: + case 138: + case 163: case 135: - return child !== 174; + case 136: + case 137: + return child !== 179; default: return false; } } SmartIndenter.shouldIndentChildNode = shouldIndentChildNode; - function nodeEndsWith(n, expectedLastToken, sourceFile) { - var children = n.getChildren(sourceFile); - if (children.length) { - var last = children[children.length - 1]; - if (last.kind === expectedLastToken) { - return true; - } - else if (last.kind === 22 && children.length !== 1) { - return children[children.length - 2].kind === expectedLastToken; - } - } - return false; - } - function isCompletedNode(n, sourceFile) { - if (n.getFullWidth() === 0) { - return false; - } - switch (n.kind) { - case 196: - case 197: - case 199: - case 152: - case 174: - case 201: - case 202: - return nodeEndsWith(n, 15, sourceFile); - case 217: - return isCompletedNode(n.block, sourceFile); - case 159: - case 136: - case 155: - case 137: - return nodeEndsWith(n, 17, sourceFile); - case 195: - case 160: - case 132: - case 131: - case 161: - return !n.body || isCompletedNode(n.body, sourceFile); - case 200: - return n.body && isCompletedNode(n.body, sourceFile); - case 178: - if (n.elseStatement) { - return isCompletedNode(n.elseStatement, sourceFile); - } - return isCompletedNode(n.thenStatement, sourceFile); - case 177: - return isCompletedNode(n.expression, sourceFile); - case 151: - return nodeEndsWith(n, 19, sourceFile); - case 214: - case 215: - return false; - case 181: - return isCompletedNode(n.statement, sourceFile); - case 182: - return isCompletedNode(n.statement, sourceFile); - case 183: - return isCompletedNode(n.statement, sourceFile); - case 180: - return isCompletedNode(n.statement, sourceFile); - case 179: - var hasWhileKeyword = ts.findChildOfKind(n, 99, sourceFile); - if (hasWhileKeyword) { - return nodeEndsWith(n, 17, sourceFile); - } - return isCompletedNode(n.statement, sourceFile); - default: - return true; - } - } })(SmartIndenter = formatting.SmartIndenter || (formatting.SmartIndenter = {})); })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); +/// var __extends = this.__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 ts; (function (ts) { ts.servicesVersion = "0.4"; @@ -27238,10 +29368,10 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(222, nodes.pos, nodes.end, 1024, this); + var list = createNode(228, nodes.pos, nodes.end, 1024, this); list._children = []; var pos = nodes.pos; - for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + for (var _i = 0; _i < nodes.length; _i++) { var node = nodes[_i]; if (pos < node.pos) { pos = this.addSyntheticNodes(list._children, pos, node.pos); @@ -27257,7 +29387,7 @@ var ts; NodeObject.prototype.createChildren = function (sourceFile) { var _this = this; var children; - if (this.kind >= 125) { + if (this.kind >= 126) { scanner.setText((sourceFile || this.getSourceFile()).text); children = []; var pos = this.pos; @@ -27300,9 +29430,9 @@ var ts; }; NodeObject.prototype.getFirstToken = function (sourceFile) { var children = this.getChildren(); - for (var _i = 0, _n = children.length; _i < _n; _i++) { + for (var _i = 0; _i < children.length; _i++) { var child = children[_i]; - if (child.kind < 125) { + if (child.kind < 126) { return child; } return child.getFirstToken(sourceFile); @@ -27312,7 +29442,7 @@ var ts; var children = this.getChildren(sourceFile); for (var i = children.length - 1; i >= 0; i--) { var child = children[i]; - if (child.kind < 125) { + if (child.kind < 126) { return child; } return child.getLastToken(sourceFile); @@ -27358,7 +29488,7 @@ var ts; ts.forEach(declarations, function (declaration, indexOfDeclaration) { if (ts.indexOf(declarations, declaration) === indexOfDeclaration) { var sourceFileOfDeclaration = ts.getSourceFileOfNode(declaration); - if (canUseParsedParamTagComments && declaration.kind === 128) { + if (canUseParsedParamTagComments && declaration.kind === 129) { ts.forEach(getJsDocCommentTextRange(declaration.parent, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedParamJsDocComment = getCleanedParamJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedParamJsDocComment) { @@ -27366,13 +29496,13 @@ var ts; } }); } - if (declaration.kind === 200 && declaration.body.kind === 200) { + if (declaration.kind === 205 && declaration.body.kind === 205) { return; } - while (declaration.kind === 200 && declaration.parent.kind === 200) { + while (declaration.kind === 205 && declaration.parent.kind === 205) { declaration = declaration.parent; } - ts.forEach(getJsDocCommentTextRange(declaration.kind === 193 ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { + ts.forEach(getJsDocCommentTextRange(declaration.kind === 198 ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedJsDocComment = getCleanedJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedJsDocComment) { jsDocCommentParts.push.apply(jsDocCommentParts, cleanedJsDocComment); @@ -27417,13 +29547,14 @@ var ts; return isName(pos, end, sourceFile, paramTag); } function pushDocCommentLineText(docComments, text, blankLineCount) { - while (blankLineCount--) + while (blankLineCount--) { docComments.push(ts.textPart("")); + } docComments.push(ts.textPart(text)); } function getCleanedJsDocComment(pos, end, sourceFile) { var spacesToRemoveAfterAsterisk; - var _docComments = []; + var docComments = []; var blankLineCount = 0; var isInParamTag = false; while (pos < end) { @@ -27458,14 +29589,14 @@ var ts; } pos = consumeLineBreaks(pos, end, sourceFile); if (docCommentTextOfLine) { - pushDocCommentLineText(_docComments, docCommentTextOfLine, blankLineCount); + pushDocCommentLineText(docComments, docCommentTextOfLine, blankLineCount); blankLineCount = 0; } - else if (!isInParamTag && _docComments.length) { + else if (!isInParamTag && docComments.length) { blankLineCount++; } } - return _docComments; + return docComments; } function getCleanedParamJsDocComment(pos, end, sourceFile) { var paramHelpStringMargin; @@ -27566,8 +29697,8 @@ var ts; } var consumedSpaces = pos - startOfLinePos; if (consumedSpaces < paramHelpStringMargin) { - var _ch = sourceFile.text.charCodeAt(pos); - if (_ch === 42) { + var ch = sourceFile.text.charCodeAt(pos); + if (ch === 42) { pos = consumeWhiteSpacesOnTheLine(pos + 1, end, sourceFile, paramHelpStringMargin - consumedSpaces - 1); } } @@ -27656,9 +29787,9 @@ var ts; var namedDeclarations = []; ts.forEachChild(sourceFile, function visit(node) { switch (node.kind) { - case 195: - case 132: - case 131: + case 200: + case 134: + case 133: var functionDeclaration = node; if (functionDeclaration.name && functionDeclaration.name.getFullWidth() > 0) { var lastDeclaration = namedDeclarations.length > 0 ? @@ -27675,64 +29806,64 @@ var ts; ts.forEachChild(node, visit); } break; - case 196: - case 197: - case 198: - case 199: - case 200: - case 203: - case 212: - case 208: + case 201: + case 202: case 203: + case 204: case 205: - case 206: - case 134: - case 135: - case 143: + case 208: + case 217: + case 213: + case 208: + case 210: + case 211: + case 136: + case 137: + case 145: if (node.name) { namedDeclarations.push(node); } - case 133: - case 175: - case 194: - case 148: - case 149: - case 201: + case 135: + case 180: + case 199: + case 150: + case 151: + case 206: ts.forEachChild(node, visit); break; - case 174: + case 179: if (ts.isFunctionBlock(node)) { ts.forEachChild(node, visit); } break; - case 128: + case 129: if (!(node.flags & 112)) { break; } - case 193: - case 150: + case 198: + case 152: if (ts.isBindingPattern(node.name)) { ts.forEachChild(node.name, visit); break; } - case 220: - case 130: - case 129: + case 226: + case 132: + case 131: namedDeclarations.push(node); break; - case 210: + case 215: if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 204: + case 209: var importClause = node.importClause; if (importClause) { if (importClause.name) { namedDeclarations.push(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 206) { + if (importClause.namedBindings.kind === 211) { namedDeclarations.push(importClause.namedBindings); } else { @@ -27887,14 +30018,14 @@ var ts; return false; } return ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 160) { + if (declaration.kind === 162) { return true; } - if (declaration.kind !== 193 && declaration.kind !== 195) { + if (declaration.kind !== 198 && declaration.kind !== 200) { return false; } - for (var _parent = declaration.parent; !ts.isFunctionBlock(_parent); _parent = _parent.parent) { - if (_parent.kind === 221 || _parent.kind === 201) { + for (var parent_7 = declaration.parent; !ts.isFunctionBlock(parent_7); parent_7 = parent_7.parent) { + if (parent_7.kind === 227 || parent_7.kind === 206) { return false; } } @@ -27935,7 +30066,7 @@ var ts; this.host = host; this.fileNameToEntry = {}; var rootFileNames = host.getScriptFileNames(); - for (var _i = 0, _n = rootFileNames.length; _i < _n; _i++) { + for (var _i = 0; _i < rootFileNames.length; _i++) { var fileName = rootFileNames[_i]; this.createEntry(fileName); } @@ -27996,17 +30127,17 @@ var ts; if (!scriptSnapshot) { throw new Error("Could not find file: '" + fileName + "'."); } - var _version = this.host.getScriptVersion(fileName); + var version = this.host.getScriptVersion(fileName); var sourceFile; if (this.currentFileName !== fileName) { - sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 2, _version, true); + sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 2, version, true); } - else if (this.currentFileVersion !== _version) { + else if (this.currentFileVersion !== version) { var editRange = scriptSnapshot.getChangeRange(this.currentFileScriptSnapshot); - sourceFile = updateLanguageServiceSourceFile(this.currentSourceFile, scriptSnapshot, _version, editRange); + sourceFile = updateLanguageServiceSourceFile(this.currentSourceFile, scriptSnapshot, version, editRange); } if (sourceFile) { - this.currentFileVersion = _version; + this.currentFileVersion = version; this.currentFileName = fileName; this.currentFileScriptSnapshot = scriptSnapshot; this.currentSourceFile = sourceFile; @@ -28019,6 +30150,37 @@ var ts; sourceFile.version = version; sourceFile.scriptSnapshot = scriptSnapshot; } + function transpile(input, compilerOptions, fileName, diagnostics) { + var options = compilerOptions ? ts.clone(compilerOptions) : getDefaultCompilerOptions(); + options.separateCompilation = true; + options.allowNonTsExtensions = true; + var inputFileName = fileName || "module.ts"; + var sourceFile = ts.createSourceFile(inputFileName, input, options.target); + if (diagnostics && sourceFile.parseDiagnostics) { + diagnostics.push.apply(diagnostics, sourceFile.parseDiagnostics); + } + var outputText; + var compilerHost = { + getSourceFile: function (fileName, target) { return fileName === inputFileName ? sourceFile : undefined; }, + writeFile: function (name, text, writeByteOrderMark) { + ts.Debug.assert(outputText === undefined, "Unexpected multiple outputs for the file: " + name); + outputText = text; + }, + getDefaultLibFileName: function () { return "lib.d.ts"; }, + useCaseSensitiveFileNames: function () { return false; }, + getCanonicalFileName: function (fileName) { return fileName; }, + getCurrentDirectory: function () { return ""; }, + getNewLine: function () { return "\r\n"; } + }; + var program = ts.createProgram([inputFileName], options, compilerHost); + if (diagnostics) { + diagnostics.push.apply(diagnostics, program.getGlobalDiagnostics()); + } + program.emit(); + ts.Debug.assert(outputText !== undefined, "Output generation failed"); + return outputText; + } + ts.transpile = transpile; function createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTarget, version, setNodeParents) { var sourceFile = ts.createSourceFile(fileName, scriptSnapshot.getText(0, scriptSnapshot.getLength()), scriptTarget, setNodeParents); setSourceFileFields(sourceFile, scriptSnapshot, version); @@ -28152,25 +30314,25 @@ var ts; scanner.setText(sourceText); var token = scanner.scan(); while (token !== 1) { - if (token === 84) { + if (token === 85) { token = scanner.scan(); if (token === 8) { recordModuleName(); continue; } else { - if (token === 64) { + if (token === 65) { token = scanner.scan(); - if (token === 123) { + if (token === 124) { token = scanner.scan(); if (token === 8) { recordModuleName(); continue; } } - else if (token === 52) { + else if (token === 53) { token = scanner.scan(); - if (token === 117) { + if (token === 118) { token = scanner.scan(); if (token === 16) { token = scanner.scan(); @@ -28195,7 +30357,7 @@ var ts; } if (token === 15) { token = scanner.scan(); - if (token === 123) { + if (token === 124) { token = scanner.scan(); if (token === 8) { recordModuleName(); @@ -28205,11 +30367,11 @@ var ts; } else if (token === 35) { token = scanner.scan(); - if (token === 101) { + if (token === 102) { token = scanner.scan(); - if (token === 64) { + if (token === 65) { token = scanner.scan(); - if (token === 123) { + if (token === 124) { token = scanner.scan(); if (token === 8) { recordModuleName(); @@ -28220,7 +30382,7 @@ var ts; } } } - else if (token === 77) { + else if (token === 78) { token = scanner.scan(); if (token === 14) { token = scanner.scan(); @@ -28229,7 +30391,7 @@ var ts; } if (token === 15) { token = scanner.scan(); - if (token === 123) { + if (token === 124) { token = scanner.scan(); if (token === 8) { recordModuleName(); @@ -28239,7 +30401,7 @@ var ts; } else if (token === 35) { token = scanner.scan(); - if (token === 123) { + if (token === 124) { token = scanner.scan(); if (token === 8) { recordModuleName(); @@ -28260,7 +30422,7 @@ var ts; ts.preProcessFile = preProcessFile; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 189 && referenceNode.label.text === labelName) { + if (referenceNode.kind === 194 && referenceNode.label.text === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -28268,17 +30430,17 @@ var ts; return undefined; } function isJumpStatementTarget(node) { - return node.kind === 64 && - (node.parent.kind === 185 || node.parent.kind === 184) && + return node.kind === 65 && + (node.parent.kind === 190 || node.parent.kind === 189) && node.parent.label === node; } function isLabelOfLabeledStatement(node) { - return node.kind === 64 && - node.parent.kind === 189 && + return node.kind === 65 && + node.parent.kind === 194 && node.parent.label === node; } function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 189; owner = owner.parent) { + for (var owner = node.parent; owner.kind === 194; owner = owner.parent) { if (owner.label.text === labelName) { return true; } @@ -28289,48 +30451,48 @@ var ts; return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node); } function isRightSideOfQualifiedName(node) { - return node.parent.kind === 125 && node.parent.right === node; + return node.parent.kind === 126 && node.parent.right === node; } function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 153 && node.parent.name === node; + return node && node.parent && node.parent.kind === 155 && node.parent.name === node; } function isCallExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 155 && node.parent.expression === node; + return node && node.parent && node.parent.kind === 157 && node.parent.expression === node; } function isNewExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 156 && node.parent.expression === node; + return node && node.parent && node.parent.kind === 158 && node.parent.expression === node; } function isNameOfModuleDeclaration(node) { - return node.parent.kind === 200 && node.parent.name === node; + return node.parent.kind === 205 && node.parent.name === node; } function isNameOfFunctionDeclaration(node) { - return node.kind === 64 && + return node.kind === 65 && ts.isFunctionLike(node.parent) && node.parent.name === node; } function isNameOfPropertyAssignment(node) { - return (node.kind === 64 || node.kind === 8 || node.kind === 7) && - (node.parent.kind === 218 || node.parent.kind === 219) && node.parent.name === node; + return (node.kind === 65 || node.kind === 8 || node.kind === 7) && + (node.parent.kind === 224 || node.parent.kind === 225) && node.parent.name === node; } function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { if (node.kind === 8 || node.kind === 7) { switch (node.parent.kind) { - case 130: - case 129: - case 218: - case 220: case 132: case 131: + case 224: + case 226: case 134: - case 135: - case 200: + case 133: + case 136: + case 137: + case 205: return node.parent.name === node; - case 154: + case 156: return node.parent.argumentExpression === node; } } @@ -28383,7 +30545,7 @@ var ts; BreakContinueSearchType[BreakContinueSearchType["All"] = 3] = "All"; })(BreakContinueSearchType || (BreakContinueSearchType = {})); var keywordCompletions = []; - for (var i = 65; i <= 124; i++) { + for (var i = 66; i <= 125; i++) { keywordCompletions.push({ name: ts.tokenToString(i), kind: ScriptElementKind.keyword, @@ -28397,17 +30559,17 @@ var ts; return undefined; } switch (node.kind) { - case 221: - case 132: - case 131: - case 195: - case 160: + case 227: case 134: - case 135: - case 196: - case 197: - case 199: + case 133: case 200: + case 162: + case 136: + case 137: + case 201: + case 202: + case 204: + case 205: return node; } } @@ -28415,38 +30577,38 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 200: return ScriptElementKind.moduleElement; - case 196: return ScriptElementKind.classElement; - case 197: return ScriptElementKind.interfaceElement; - case 198: return ScriptElementKind.typeElement; - case 199: return ScriptElementKind.enumElement; - case 193: + 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: return ts.isConst(node) ? ScriptElementKind.constElement : ts.isLet(node) ? ScriptElementKind.letElement : ScriptElementKind.variableElement; - case 195: return ScriptElementKind.functionElement; - case 134: return ScriptElementKind.memberGetAccessorElement; - case 135: return ScriptElementKind.memberSetAccessorElement; + case 200: return ScriptElementKind.functionElement; + case 136: return ScriptElementKind.memberGetAccessorElement; + case 137: return ScriptElementKind.memberSetAccessorElement; + case 134: + case 133: + return ScriptElementKind.memberFunctionElement; case 132: case 131: - return ScriptElementKind.memberFunctionElement; - case 130: - case 129: return ScriptElementKind.memberVariableElement; - case 138: return ScriptElementKind.indexSignatureElement; - case 137: return ScriptElementKind.constructSignatureElement; - case 136: return ScriptElementKind.callSignatureElement; - case 133: return ScriptElementKind.constructorImplementationElement; - case 127: return ScriptElementKind.typeParameterElement; - case 220: return ScriptElementKind.variableElement; - case 128: return (node.flags & 112) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; - case 203: + 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 205: - case 212: - case 206: + case 213: + case 210: + case 217: + case 211: return ScriptElementKind.alias; } return ScriptElementKind.unknown; @@ -28460,7 +30622,6 @@ var ts; var typeInfoResolver; var useCaseSensitivefileNames = false; var cancellationToken = new CancellationTokenObject(host.getCancellationToken && host.getCancellationToken()); - var activeCompletionSession; if (!ts.localizedDiagnosticMessages && host.getLocalizedDiagnosticMessages) { ts.localizedDiagnosticMessages = host.getLocalizedDiagnosticMessages(); } @@ -28507,7 +30668,7 @@ var ts; }); if (program) { var oldSourceFiles = program.getSourceFiles(); - for (var _i = 0, _n = oldSourceFiles.length; _i < _n; _i++) { + for (var _i = 0; _i < oldSourceFiles.length; _i++) { var oldSourceFile = oldSourceFiles[_i]; var fileName = oldSourceFile.fileName; if (!newProgram.getSourceFile(fileName) || changesInCompilationSettingsAffectSyntax) { @@ -28524,8 +30685,8 @@ var ts; return undefined; } if (!changesInCompilationSettingsAffectSyntax) { - var _oldSourceFile = program && program.getSourceFile(fileName); - if (_oldSourceFile) { + var oldSourceFile = program && program.getSourceFile(fileName); + if (oldSourceFile) { return documentRegistry.updateDocument(fileName, newSettings, hostFileInformation.scriptSnapshot, hostFileInformation.version); } } @@ -28542,9 +30703,9 @@ var ts; if (program.getSourceFiles().length !== rootFileNames.length) { return false; } - for (var _a = 0, _b = rootFileNames.length; _a < _b; _a++) { - var _fileName = rootFileNames[_a]; - if (!sourceFileUpToDate(program.getSourceFile(_fileName))) { + for (var _i = 0; _i < rootFileNames.length; _i++) { + var fileName = rootFileNames[_i]; + if (!sourceFileUpToDate(program.getSourceFile(fileName))) { return false; } } @@ -28579,35 +30740,48 @@ var ts; return semanticDiagnostics; } var declarationDiagnostics = program.getDeclarationDiagnostics(targetSourceFile); - return semanticDiagnostics.concat(declarationDiagnostics); + return ts.concatenate(semanticDiagnostics, declarationDiagnostics); } function getCompilerOptionsDiagnostics() { synchronizeHostData(); return program.getGlobalDiagnostics(); } - function getValidCompletionEntryDisplayName(symbol, target) { + function getCompletionEntryDisplayName(symbol, target, performCharacterChecks) { var displayName = symbol.getName(); - if (displayName && displayName.length > 0) { - var firstCharCode = displayName.charCodeAt(0); - if ((symbol.flags & 1536) && (firstCharCode === 39 || firstCharCode === 34)) { - return undefined; - } - if (displayName && displayName.length >= 2 && firstCharCode === displayName.charCodeAt(displayName.length - 1) && - (firstCharCode === 39 || firstCharCode === 34)) { - displayName = displayName.substring(1, displayName.length - 1); - } - var isValid = ts.isIdentifierStart(displayName.charCodeAt(0), target); - for (var _i = 1, n = displayName.length; isValid && _i < n; _i++) { - isValid = ts.isIdentifierPart(displayName.charCodeAt(_i), target); - } - if (isValid) { - return ts.unescapeIdentifier(displayName); + if (!displayName) { + return undefined; + } + if (displayName === "default") { + var localSymbol = ts.getLocalSymbolForExportDefault(symbol); + if (localSymbol && localSymbol.name) { + displayName = symbol.valueDeclaration.localSymbol.name; } } - return undefined; + var firstCharCode = displayName.charCodeAt(0); + if ((symbol.flags & 1536) && (firstCharCode === 39 || firstCharCode === 34)) { + return undefined; + } + if (displayName && displayName.length >= 2 && firstCharCode === displayName.charCodeAt(displayName.length - 1) && + (firstCharCode === 39 || firstCharCode === 34)) { + displayName = displayName.substring(1, displayName.length - 1); + } + if (!displayName) { + return undefined; + } + if (performCharacterChecks) { + if (!ts.isIdentifierStart(displayName.charCodeAt(0), target)) { + return undefined; + } + for (var i = 1, n = displayName.length; i < n; i++) { + if (!ts.isIdentifierPart(displayName.charCodeAt(i), target)) { + return undefined; + } + } + } + return ts.unescapeIdentifier(displayName); } function createCompletionEntry(symbol, typeChecker, location) { - var displayName = getValidCompletionEntryDisplayName(symbol, program.getCompilerOptions().target); + var displayName = getCompletionEntryDisplayName(symbol, program.getCompilerOptions().target, true); if (!displayName) { return undefined; } @@ -28617,63 +30791,53 @@ var ts; kindModifiers: getSymbolModifiers(symbol) }; } - function getCompletionsAtPosition(fileName, position) { - synchronizeHostData(); + function getCompletionData(fileName, position) { var syntacticStart = new Date().getTime(); var sourceFile = getValidSourceFile(fileName); var start = new Date().getTime(); var currentToken = ts.getTokenAtPosition(sourceFile, position); - log("getCompletionsAtPosition: Get current token: " + (new Date().getTime() - start)); + log("getCompletionData: Get current token: " + (new Date().getTime() - start)); start = new Date().getTime(); var insideComment = isInsideComment(sourceFile, currentToken, position); - log("getCompletionsAtPosition: Is inside comment: " + (new Date().getTime() - start)); + log("getCompletionData: Is inside comment: " + (new Date().getTime() - start)); if (insideComment) { log("Returning an empty list because completion was inside a comment."); return undefined; } start = new Date().getTime(); var previousToken = ts.findPrecedingToken(position, sourceFile); - log("getCompletionsAtPosition: Get previous token 1: " + (new Date().getTime() - start)); - if (previousToken && position <= previousToken.end && previousToken.kind === 64) { - var _start = new Date().getTime(); - previousToken = ts.findPrecedingToken(previousToken.pos, sourceFile); - log("getCompletionsAtPosition: Get previous token 2: " + (new Date().getTime() - _start)); + log("getCompletionData: Get previous token 1: " + (new Date().getTime() - start)); + var contextToken = previousToken; + if (contextToken && position <= contextToken.end && ts.isWord(contextToken.kind)) { + var start_1 = new Date().getTime(); + contextToken = ts.findPrecedingToken(contextToken.getFullStart(), sourceFile); + log("getCompletionData: Get previous token 2: " + (new Date().getTime() - start_1)); } - if (previousToken && isCompletionListBlocker(previousToken)) { + if (contextToken && isCompletionListBlocker(contextToken)) { log("Returning an empty list because completion was requested in an invalid position."); return undefined; } - var node; - var isRightOfDot; - if (previousToken && previousToken.kind === 20 && previousToken.parent.kind === 153) { - node = previousToken.parent.expression; + var node = currentToken; + var isRightOfDot = false; + if (contextToken && contextToken.kind === 20 && contextToken.parent.kind === 155) { + node = contextToken.parent.expression; isRightOfDot = true; } - else if (previousToken && previousToken.kind === 20 && previousToken.parent.kind === 125) { - node = previousToken.parent.left; + else if (contextToken && contextToken.kind === 20 && contextToken.parent.kind === 126) { + node = contextToken.parent.left; isRightOfDot = true; } - else { - node = currentToken; - isRightOfDot = false; - } - activeCompletionSession = { - fileName: fileName, - position: position, - entries: [], - symbols: {}, - typeChecker: typeInfoResolver - }; - log("getCompletionsAtPosition: Syntactic work: " + (new Date().getTime() - syntacticStart)); - var _location = ts.getTouchingPropertyName(sourceFile, position); + var location = ts.getTouchingPropertyName(sourceFile, position); + var target = program.getCompilerOptions().target; var semanticStart = new Date().getTime(); var isMemberCompletion; var isNewIdentifierLocation; + var symbols; if (isRightOfDot) { - var symbols = []; + symbols = []; isMemberCompletion = true; isNewIdentifierLocation = false; - if (node.kind === 64 || node.kind === 125 || node.kind === 153) { + if (node.kind === 65 || node.kind === 126 || node.kind === 155) { var symbol = typeInfoResolver.getSymbolAtLocation(node); if (symbol && symbol.flags & 8388608) { symbol = typeInfoResolver.getAliasedSymbol(symbol); @@ -28694,10 +30858,9 @@ var ts; } }); } - getCompletionEntriesFromSymbols(symbols, activeCompletionSession); } else { - var containingObjectLiteral = getContainingObjectLiteralApplicableForCompletion(previousToken); + var containingObjectLiteral = getContainingObjectLiteralApplicableForCompletion(contextToken); if (containingObjectLiteral) { isMemberCompletion = true; isNewIdentifierLocation = true; @@ -28707,65 +30870,54 @@ var ts; } var contextualTypeMembers = typeInfoResolver.getPropertiesOfType(contextualType); if (contextualTypeMembers && contextualTypeMembers.length > 0) { - var filteredMembers = filterContextualMembersList(contextualTypeMembers, containingObjectLiteral.properties); - getCompletionEntriesFromSymbols(filteredMembers, activeCompletionSession); + symbols = filterContextualMembersList(contextualTypeMembers, containingObjectLiteral.properties); } } - else if (ts.getAncestor(previousToken, 205)) { + else if (ts.getAncestor(contextToken, 210)) { isMemberCompletion = true; isNewIdentifierLocation = true; - if (showCompletionsInImportsClause(previousToken)) { - var importDeclaration = ts.getAncestor(previousToken, 204); + if (showCompletionsInImportsClause(contextToken)) { + var importDeclaration = ts.getAncestor(contextToken, 209); ts.Debug.assert(importDeclaration !== undefined); var exports = typeInfoResolver.getExportsOfExternalModule(importDeclaration); - var filteredExports = filterModuleExports(exports, importDeclaration); - getCompletionEntriesFromSymbols(filteredExports, activeCompletionSession); + symbols = filterModuleExports(exports, importDeclaration); } } else { isMemberCompletion = false; - isNewIdentifierLocation = isNewIdentifierDefinitionLocation(previousToken); + isNewIdentifierLocation = isNewIdentifierDefinitionLocation(contextToken); + if (previousToken !== contextToken) { + ts.Debug.assert(!!previousToken, "Expected 'contextToken' to be defined when different from 'previousToken'."); + } + var adjustedPosition = previousToken !== contextToken ? + previousToken.getStart() : + position; + var scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile; var symbolMeanings = 793056 | 107455 | 1536 | 8388608; - var _symbols = typeInfoResolver.getSymbolsInScope(node, symbolMeanings); - getCompletionEntriesFromSymbols(_symbols, activeCompletionSession); + symbols = typeInfoResolver.getSymbolsInScope(scopeNode, symbolMeanings); } } - if (!isMemberCompletion) { - Array.prototype.push.apply(activeCompletionSession.entries, keywordCompletions); - } - log("getCompletionsAtPosition: Semantic work: " + (new Date().getTime() - semanticStart)); - return { - isMemberCompletion: isMemberCompletion, - isNewIdentifierLocation: isNewIdentifierLocation, - isBuilder: isNewIdentifierDefinitionLocation, - entries: activeCompletionSession.entries - }; - function getCompletionEntriesFromSymbols(symbols, session) { - var _start_1 = new Date().getTime(); - ts.forEach(symbols, function (symbol) { - var entry = createCompletionEntry(symbol, session.typeChecker, _location); - if (entry) { - var id = ts.escapeIdentifier(entry.name); - if (!ts.lookUp(session.symbols, id)) { - session.entries.push(entry); - session.symbols[id] = symbol; - } - } - }); - log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (new Date().getTime() - _start_1)); + log("getCompletionData: Semantic work: " + (new Date().getTime() - semanticStart)); + return { symbols: symbols, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, location: location }; + function getScopeNode(initialToken, position, sourceFile) { + var scope = initialToken; + while (scope && !ts.positionBelongsToNode(scope, position, sourceFile)) { + scope = scope.parent; + } + return scope; } function isCompletionListBlocker(previousToken) { - var _start_1 = new Date().getTime(); + var start = new Date().getTime(); var result = isInStringOrRegularExpressionOrTemplateLiteral(previousToken) || isIdentifierDefinitionLocation(previousToken) || isRightOfIllegalDot(previousToken); - log("getCompletionsAtPosition: isCompletionListBlocker: " + (new Date().getTime() - _start_1)); + log("getCompletionsAtPosition: isCompletionListBlocker: " + (new Date().getTime() - start)); return result; } function showCompletionsInImportsClause(node) { if (node) { if (node.kind === 14 || node.kind === 23) { - return node.parent.kind === 207; + return node.parent.kind === 212; } } return false; @@ -28775,35 +30927,35 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 23: - return containingNodeKind === 155 - || containingNodeKind === 133 - || containingNodeKind === 156 - || containingNodeKind === 151 - || containingNodeKind === 167; + return containingNodeKind === 157 + || containingNodeKind === 135 + || containingNodeKind === 158 + || containingNodeKind === 153 + || containingNodeKind === 169; case 16: - return containingNodeKind === 155 - || containingNodeKind === 133 - || containingNodeKind === 156 - || containingNodeKind === 159; + return containingNodeKind === 157 + || containingNodeKind === 135 + || containingNodeKind === 158 + || containingNodeKind === 161; case 18: - return containingNodeKind === 151; - case 116: + return containingNodeKind === 153; + case 117: return true; case 20: - return containingNodeKind === 200; + return containingNodeKind === 205; case 14: - return containingNodeKind === 196; - case 52: - return containingNodeKind === 193 - || containingNodeKind === 167; + return containingNodeKind === 201; + case 53: + return containingNodeKind === 198 + || containingNodeKind === 169; case 11: - return containingNodeKind === 169; + return containingNodeKind === 171; case 12: - return containingNodeKind === 173; - case 108: - case 106: + return containingNodeKind === 176; + case 109: case 107: - return containingNodeKind === 130; + case 108: + return containingNodeKind === 132; } switch (previousToken.getText()) { case "public": @@ -28818,9 +30970,9 @@ var ts; if (previousToken.kind === 8 || previousToken.kind === 9 || ts.isTemplateLiteralKind(previousToken.kind)) { - var _start_1 = previousToken.getStart(); + var start_2 = previousToken.getStart(); var end = previousToken.getEnd(); - if (_start_1 < position && position < end) { + if (start_2 < position && position < end) { return true; } else if (position === end) { @@ -28830,13 +30982,14 @@ var ts; return false; } function getContainingObjectLiteralApplicableForCompletion(previousToken) { + // The locations in an object literal expression that are applicable for completion are property name definition locations. if (previousToken) { - var _parent = previousToken.parent; + var parent_8 = previousToken.parent; switch (previousToken.kind) { case 14: case 23: - if (_parent && _parent.kind === 152) { - return _parent; + if (parent_8 && parent_8.kind === 154) { + return parent_8; } break; } @@ -28845,16 +30998,16 @@ var ts; } function isFunction(kind) { switch (kind) { - case 160: - case 161: - case 195: - case 132: - case 131: + case 162: + case 163: + case 200: case 134: - case 135: + case 133: case 136: case 137: case 138: + case 139: + case 140: return true; } return false; @@ -28864,58 +31017,58 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 23: - return containingNodeKind === 193 || - containingNodeKind === 194 || - containingNodeKind === 175 || + return containingNodeKind === 198 || containingNodeKind === 199 || + containingNodeKind === 180 || + containingNodeKind === 204 || isFunction(containingNodeKind) || - containingNodeKind === 196 || - containingNodeKind === 195 || - containingNodeKind === 197 || - containingNodeKind === 149 || - containingNodeKind === 148; + containingNodeKind === 201 || + containingNodeKind === 200 || + containingNodeKind === 202 || + containingNodeKind === 151 || + containingNodeKind === 150; case 20: - return containingNodeKind === 149; + return containingNodeKind === 151; case 18: - return containingNodeKind === 149; + return containingNodeKind === 151; case 16: - return containingNodeKind === 217 || + return containingNodeKind === 223 || isFunction(containingNodeKind); case 14: - return containingNodeKind === 199 || - containingNodeKind === 197 || - containingNodeKind === 143 || - containingNodeKind === 148; + return containingNodeKind === 204 || + containingNodeKind === 202 || + containingNodeKind === 145 || + containingNodeKind === 150; case 22: - return containingNodeKind === 129 && - (previousToken.parent.parent.kind === 197 || - previousToken.parent.parent.kind === 143); + return containingNodeKind === 131 && + (previousToken.parent.parent.kind === 202 || + previousToken.parent.parent.kind === 145); case 24: - return containingNodeKind === 196 || - containingNodeKind === 195 || - containingNodeKind === 197 || + return containingNodeKind === 201 || + containingNodeKind === 200 || + containingNodeKind === 202 || isFunction(containingNodeKind); - case 109: - return containingNodeKind === 130; - case 21: - return containingNodeKind === 128 || - containingNodeKind === 133 || - (previousToken.parent.parent.kind === 149); - case 108: - case 106: - case 107: - return containingNodeKind === 128; - case 68: - case 76: - case 103: - case 82: - case 97: - case 115: - case 119: - case 84: - case 104: - case 69: case 110: + return containingNodeKind === 132; + case 21: + return containingNodeKind === 129 || + containingNodeKind === 135 || + (previousToken.parent.parent.kind === 151); + case 109: + case 107: + case 108: + return containingNodeKind === 129; + case 69: + case 77: + case 104: + case 83: + case 98: + case 116: + case 120: + case 85: + case 105: + case 70: + case 111: return true; } switch (previousToken.getText()) { @@ -28946,10 +31099,10 @@ var ts; return exports; } if (importDeclaration.importClause.namedBindings && - importDeclaration.importClause.namedBindings.kind === 207) { + importDeclaration.importClause.namedBindings.kind === 212) { ts.forEach(importDeclaration.importClause.namedBindings.elements, function (el) { - var _name = el.propertyName || el.name; - exisingImports[_name.text] = true; + var name = el.propertyName || el.name; + exisingImports[name.text] = true; }); } if (ts.isEmpty(exisingImports)) { @@ -28963,7 +31116,7 @@ var ts; } var existingMemberNames = {}; ts.forEach(existingMembers, function (m) { - if (m.kind !== 218 && m.kind !== 219) { + if (m.kind !== 224 && m.kind !== 225) { return; } if (m.getStart() <= position && position <= m.getEnd()) { @@ -28971,44 +31124,78 @@ var ts; } existingMemberNames[m.name.text] = true; }); - var _filteredMembers = []; + var filteredMembers = []; ts.forEach(contextualMemberSymbols, function (s) { if (!existingMemberNames[s.name]) { - _filteredMembers.push(s); + filteredMembers.push(s); } }); - return _filteredMembers; + return filteredMembers; + } + } + function getCompletionsAtPosition(fileName, position) { + synchronizeHostData(); + var completionData = getCompletionData(fileName, position); + if (!completionData) { + return undefined; + } + var symbols = completionData.symbols, isMemberCompletion = completionData.isMemberCompletion, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location; + if (!symbols || symbols.length === 0) { + return undefined; + } + var entries = getCompletionEntriesFromSymbols(symbols); + if (!isMemberCompletion) { + ts.addRange(entries, keywordCompletions); + } + return { isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; + function getCompletionEntriesFromSymbols(symbols) { + var start = new Date().getTime(); + var entries = []; + var nameToSymbol = {}; + for (var _i = 0; _i < symbols.length; _i++) { + var symbol = symbols[_i]; + var entry = createCompletionEntry(symbol, typeInfoResolver, location); + if (entry) { + var id = ts.escapeIdentifier(entry.name); + if (!ts.lookUp(nameToSymbol, id)) { + entries.push(entry); + nameToSymbol[id] = symbol; + } + } + } + log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (new Date().getTime() - start)); + return entries; } } function getCompletionEntryDetails(fileName, position, entryName) { - var sourceFile = getValidSourceFile(fileName); - var session = activeCompletionSession; - if (!session || session.fileName !== fileName || session.position !== position) { - return undefined; + synchronizeHostData(); + var completionData = getCompletionData(fileName, position); + if (completionData) { + var symbols = completionData.symbols, location_2 = completionData.location; + var target = program.getCompilerOptions().target; + var symbol = ts.forEach(symbols, function (s) { return getCompletionEntryDisplayName(s, target, false) === entryName ? s : undefined; }); + if (symbol) { + var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location_2, typeInfoResolver, location_2, 7); + return { + name: entryName, + kind: displayPartsDocumentationsAndSymbolKind.symbolKind, + kindModifiers: getSymbolModifiers(symbol), + displayParts: displayPartsDocumentationsAndSymbolKind.displayParts, + documentation: displayPartsDocumentationsAndSymbolKind.documentation + }; + } } - var symbol = ts.lookUp(activeCompletionSession.symbols, ts.escapeIdentifier(entryName)); - if (symbol) { - var _location = ts.getTouchingPropertyName(sourceFile, position); - var completionEntry = createCompletionEntry(symbol, session.typeChecker, _location); - ts.Debug.assert(session.typeChecker.getTypeOfSymbolAtLocation(symbol, _location) !== undefined, "Could not find type for symbol"); - var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), _location, session.typeChecker, _location, 7); - return { - name: entryName, - kind: displayPartsDocumentationsAndSymbolKind.symbolKind, - kindModifiers: completionEntry.kindModifiers, - displayParts: displayPartsDocumentationsAndSymbolKind.displayParts, - documentation: displayPartsDocumentationsAndSymbolKind.documentation - }; - } - else { + var keywordCompletion = ts.forEach(keywordCompletions, function (c) { return c.name === entryName; }); + if (keywordCompletion) { return { name: entryName, kind: ScriptElementKind.keyword, kindModifiers: ScriptElementKindModifier.none, - displayParts: [ts.displayPart(entryName, 5)], + displayParts: [ts.displayPart(entryName, SymbolDisplayPartKind.keyword)], documentation: undefined }; } + return undefined; } function getSymbolKind(symbol, typeResolver, location) { var flags = symbol.getFlags(); @@ -29122,14 +31309,14 @@ var ts; var signature; type = typeResolver.getTypeOfSymbolAtLocation(symbol, location); if (type) { - if (location.parent && location.parent.kind === 153) { + if (location.parent && location.parent.kind === 155) { var right = location.parent.name; if (right === location || (right && right.getFullWidth() === 0)) { location = location.parent; } } var callExpression; - if (location.kind === 155 || location.kind === 156) { + if (location.kind === 157 || location.kind === 158) { callExpression = location; } else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { @@ -29141,7 +31328,7 @@ var ts; if (!signature && candidateSignatures.length) { signature = candidateSignatures[0]; } - var useConstructSignatures = callExpression.kind === 156 || callExpression.expression.kind === 90; + var useConstructSignatures = callExpression.kind === 158 || callExpression.expression.kind === 91; var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target || signature)) { signature = allSignatures.length ? allSignatures[0] : undefined; @@ -29153,12 +31340,10 @@ var ts; } else if (symbolFlags & 8388608) { symbolKind = ScriptElementKind.alias; - displayParts.push(ts.punctuationPart(16)); - displayParts.push(ts.textPart(symbolKind)); - displayParts.push(ts.punctuationPart(17)); + pushTypePart(symbolKind); displayParts.push(ts.spacePart()); if (useConstructSignatures) { - displayParts.push(ts.keywordPart(87)); + displayParts.push(ts.keywordPart(88)); displayParts.push(ts.spacePart()); } addFullSymbolName(symbol); @@ -29176,7 +31361,7 @@ var ts; displayParts.push(ts.punctuationPart(51)); displayParts.push(ts.spacePart()); if (useConstructSignatures) { - displayParts.push(ts.keywordPart(87)); + displayParts.push(ts.keywordPart(88)); displayParts.push(ts.spacePart()); } if (!(type.flags & 32768)) { @@ -29191,64 +31376,64 @@ var ts; } } else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304)) || - (location.kind === 113 && location.parent.kind === 133)) { + (location.kind === 114 && location.parent.kind === 135)) { var functionDeclaration = location.parent; - var _allSignatures = functionDeclaration.kind === 133 ? type.getConstructSignatures() : type.getCallSignatures(); + var allSignatures = functionDeclaration.kind === 135 ? type.getConstructSignatures() : type.getCallSignatures(); if (!typeResolver.isImplementationOfOverload(functionDeclaration)) { signature = typeResolver.getSignatureFromDeclaration(functionDeclaration); } else { - signature = _allSignatures[0]; + signature = allSignatures[0]; } - if (functionDeclaration.kind === 133) { + if (functionDeclaration.kind === 135) { symbolKind = ScriptElementKind.constructorImplementationElement; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { - addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 136 && + addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 138 && !(type.symbol.flags & 2048 || type.symbol.flags & 4096) ? type.symbol : symbol, symbolKind); } - addSignatureDisplayParts(signature, _allSignatures); + addSignatureDisplayParts(signature, allSignatures); hasAddedSymbolInfo = true; } } } if (symbolFlags & 32 && !hasAddedSymbolInfo) { - displayParts.push(ts.keywordPart(68)); + displayParts.push(ts.keywordPart(69)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); } if ((symbolFlags & 64) && (semanticMeaning & 2)) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(103)); + displayParts.push(ts.keywordPart(104)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); } if (symbolFlags & 524288) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(122)); + displayParts.push(ts.keywordPart(123)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(52)); + displayParts.push(ts.operatorPart(53)); displayParts.push(ts.spacePart()); displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeResolver, typeResolver.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration)); } if (symbolFlags & 384) { addNewLineIfDisplayPartsExist(); if (ts.forEach(symbol.declarations, ts.isConstEnumDeclaration)) { - displayParts.push(ts.keywordPart(69)); + displayParts.push(ts.keywordPart(70)); displayParts.push(ts.spacePart()); } - displayParts.push(ts.keywordPart(76)); + displayParts.push(ts.keywordPart(77)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } if (symbolFlags & 1536) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(116)); + displayParts.push(ts.keywordPart(117)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } @@ -29260,60 +31445,60 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(85)); + displayParts.push(ts.keywordPart(86)); displayParts.push(ts.spacePart()); if (symbol.parent) { addFullSymbolName(symbol.parent, enclosingDeclaration); writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration); } else { - var signatureDeclaration = ts.getDeclarationOfKind(symbol, 127).parent; - var _signature = typeResolver.getSignatureFromDeclaration(signatureDeclaration); - if (signatureDeclaration.kind === 137) { - displayParts.push(ts.keywordPart(87)); + var signatureDeclaration = ts.getDeclarationOfKind(symbol, 128).parent; + var signature = typeResolver.getSignatureFromDeclaration(signatureDeclaration); + if (signatureDeclaration.kind === 139) { + displayParts.push(ts.keywordPart(88)); displayParts.push(ts.spacePart()); } - else if (signatureDeclaration.kind !== 136 && signatureDeclaration.name) { + else if (signatureDeclaration.kind !== 138 && signatureDeclaration.name) { addFullSymbolName(signatureDeclaration.symbol); } - displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeResolver, _signature, sourceFile, 32)); + displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeResolver, signature, sourceFile, 32)); } } if (symbolFlags & 8) { addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 220) { + if (declaration.kind === 226) { var constantValue = typeResolver.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(52)); + displayParts.push(ts.operatorPart(53)); displayParts.push(ts.spacePart()); - displayParts.push(ts.displayPart(constantValue.toString(), 7)); + displayParts.push(ts.displayPart(constantValue.toString(), SymbolDisplayPartKind.numericLiteral)); } } } if (symbolFlags & 8388608) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(84)); + displayParts.push(ts.keywordPart(85)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 203) { + if (declaration.kind === 208) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(52)); + displayParts.push(ts.operatorPart(53)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(117)); + displayParts.push(ts.keywordPart(118)); displayParts.push(ts.punctuationPart(16)); - displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), 8)); + displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), SymbolDisplayPartKind.stringLiteral)); displayParts.push(ts.punctuationPart(17)); } else { var internalAliasSymbol = typeResolver.getSymbolAtLocation(importEqualsDeclaration.moduleReference); if (internalAliasSymbol) { displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(52)); + displayParts.push(ts.operatorPart(53)); displayParts.push(ts.spacePart()); addFullSymbolName(internalAliasSymbol, enclosingDeclaration); } @@ -29347,8 +31532,8 @@ var ts; symbolFlags & 131072 || symbolFlags & 98304 || symbolKind === ScriptElementKind.memberFunctionElement) { - var _allSignatures_1 = type.getCallSignatures(); - addSignatureDisplayParts(_allSignatures_1[0], _allSignatures_1); + var allSignatures = type.getCallSignatures(); + addSignatureDisplayParts(allSignatures[0], allSignatures); } } } @@ -29372,20 +31557,34 @@ var ts; function addPrefixForAnyFunctionOrVar(symbol, symbolKind) { addNewLineIfDisplayPartsExist(); if (symbolKind) { - displayParts.push(ts.punctuationPart(16)); - displayParts.push(ts.textPart(symbolKind)); - displayParts.push(ts.punctuationPart(17)); + pushTypePart(symbolKind); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } } + function pushTypePart(symbolKind) { + switch (symbolKind) { + case ScriptElementKind.variableElement: + case ScriptElementKind.functionElement: + case ScriptElementKind.letElement: + case ScriptElementKind.constElement: + case ScriptElementKind.constructorImplementationElement: + displayParts.push(ts.textOrKeywordPart(symbolKind)); + return; + default: + displayParts.push(ts.punctuationPart(16)); + displayParts.push(ts.textOrKeywordPart(symbolKind)); + displayParts.push(ts.punctuationPart(17)); + return; + } + } function addSignatureDisplayParts(signature, allSignatures, flags) { displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeResolver, signature, enclosingDeclaration, flags | 32)); if (allSignatures.length > 1) { displayParts.push(ts.spacePart()); displayParts.push(ts.punctuationPart(16)); displayParts.push(ts.operatorPart(33)); - displayParts.push(ts.displayPart((allSignatures.length - 1).toString(), 7)); + displayParts.push(ts.displayPart((allSignatures.length - 1).toString(), SymbolDisplayPartKind.numericLiteral)); displayParts.push(ts.spacePart()); displayParts.push(ts.textPart(allSignatures.length === 2 ? "overload" : "overloads")); displayParts.push(ts.punctuationPart(17)); @@ -29393,10 +31592,10 @@ var ts; documentation = signature.getDocumentationComment(); } function writeTypeParametersOfSymbol(symbol, enclosingDeclaration) { - var _typeParameterParts = ts.mapToDisplayParts(function (writer) { + var typeParameterParts = ts.mapToDisplayParts(function (writer) { typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration); }); - displayParts.push.apply(displayParts, _typeParameterParts); + displayParts.push.apply(displayParts, typeParameterParts); } } function getQuickInfoAtPosition(fileName, position) { @@ -29409,11 +31608,11 @@ var ts; var symbol = typeInfoResolver.getSymbolAtLocation(node); if (!symbol) { switch (node.kind) { - case 64: - case 153: - case 125: - case 92: - case 90: + case 65: + case 155: + case 126: + case 93: + case 91: var type = typeInfoResolver.getTypeAtLocation(node); if (type) { return { @@ -29436,6 +31635,16 @@ var ts; documentation: displayPartsDocumentationsAndKind.documentation }; } + function createDefinitionInfo(node, symbolKind, symbolName, containerName) { + return { + fileName: node.getSourceFile().fileName, + textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()), + kind: symbolKind, + name: symbolName, + containerKind: undefined, + containerName: containerName + }; + } function getDefinitionAtPosition(fileName, position) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); @@ -29446,7 +31655,7 @@ var ts; if (isJumpStatementTarget(node)) { var labelName = node.text; var label = getTargetLabel(node.parent, node.text); - return label ? [getDefinitionInfo(label, ScriptElementKind.label, labelName, undefined)] : undefined; + return label ? [createDefinitionInfo(label, ScriptElementKind.label, labelName, undefined)] : undefined; } var comment = ts.forEach(sourceFile.referencedFiles, function (r) { return (r.pos <= position && position < r.end) ? r : undefined; }); if (comment) { @@ -29469,22 +31678,22 @@ var ts; } if (symbol.flags & 8388608) { var declaration = symbol.declarations[0]; - if (node.kind === 64 && node.parent === declaration) { + if (node.kind === 65 && node.parent === declaration) { symbol = typeInfoResolver.getAliasedSymbol(symbol); } } - var result = []; - if (node.parent.kind === 219) { + if (node.parent.kind === 225) { var shorthandSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); + if (!shorthandSymbol) { + return []; + } var shorthandDeclarations = shorthandSymbol.getDeclarations(); var shorthandSymbolKind = getSymbolKind(shorthandSymbol, typeInfoResolver, node); var shorthandSymbolName = typeInfoResolver.symbolToString(shorthandSymbol); var shorthandContainerName = typeInfoResolver.symbolToString(symbol.parent, node); - ts.forEach(shorthandDeclarations, function (declaration) { - result.push(getDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName)); - }); - return result; + return ts.map(shorthandDeclarations, function (declaration) { return createDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName); }); } + var result = []; var declarations = symbol.getDeclarations(); var symbolName = typeInfoResolver.symbolToString(symbol); var symbolKind = getSymbolKind(symbol, typeInfoResolver, node); @@ -29493,46 +31702,15 @@ var ts; if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { ts.forEach(declarations, function (declaration) { - result.push(getDefinitionInfo(declaration, symbolKind, symbolName, containerName)); + result.push(createDefinitionInfo(declaration, symbolKind, symbolName, containerName)); }); } return result; - function getDefinitionInfo(node, symbolKind, symbolName, containerName) { - return { - fileName: node.getSourceFile().fileName, - textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()), - kind: symbolKind, - name: symbolName, - containerKind: undefined, - containerName: containerName - }; - } - function tryAddSignature(signatureDeclarations, selectConstructors, symbolKind, symbolName, containerName, result) { - var _declarations = []; - var definition; - ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 133) || - (!selectConstructors && (d.kind === 195 || d.kind === 132 || d.kind === 131))) { - _declarations.push(d); - if (d.body) - definition = d; - } - }); - if (definition) { - result.push(getDefinitionInfo(definition, symbolKind, symbolName, containerName)); - return true; - } - else if (_declarations.length) { - result.push(getDefinitionInfo(_declarations[_declarations.length - 1], symbolKind, symbolName, containerName)); - return true; - } - return false; - } function tryAddConstructSignature(symbol, location, symbolKind, symbolName, containerName, result) { - if (isNewExpressionTarget(location) || location.kind === 113) { + if (isNewExpressionTarget(location) || location.kind === 114) { if (symbol.flags & 32) { var classDeclaration = symbol.getDeclarations()[0]; - ts.Debug.assert(classDeclaration && classDeclaration.kind === 196); + ts.Debug.assert(classDeclaration && classDeclaration.kind === 201); return tryAddSignature(classDeclaration.members, true, symbolKind, symbolName, containerName, result); } } @@ -29544,116 +31722,148 @@ var ts; } return false; } + 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 (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; + } } function getOccurrencesAtPosition(fileName, position) { + var results = getOccurrencesAtPositionCore(fileName, position); + if (results) { + var sourceFile = getCanonicalFileName(ts.normalizeSlashes(fileName)); + results.forEach(function (value) { + var targetFile = getCanonicalFileName(ts.normalizeSlashes(value.fileName)); + ts.Debug.assert(sourceFile == targetFile, "Unexpected file in results. Found results in " + targetFile + " expected only results in " + sourceFile + "."); + }); + } + return results; + } + function getOccurrencesAtPositionCore(fileName, position) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); var node = ts.getTouchingWord(sourceFile, position); if (!node) { return undefined; } - if (node.kind === 64 || node.kind === 92 || node.kind === 90 || + if (node.kind === 65 || node.kind === 93 || node.kind === 91 || isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { - return getReferencesForNode(node, [sourceFile], true, false, false); + return convertReferences(getReferencesForNode(node, [sourceFile], true, false, false)); } switch (node.kind) { - case 83: - case 75: - if (hasKind(node.parent, 178)) { + case 84: + case 76: + if (hasKind(node.parent, 183)) { return getIfElseOccurrences(node.parent); } break; - case 89: - if (hasKind(node.parent, 186)) { + case 90: + if (hasKind(node.parent, 191)) { return getReturnOccurrences(node.parent); } break; - case 93: - if (hasKind(node.parent, 190)) { + case 94: + if (hasKind(node.parent, 195)) { return getThrowOccurrences(node.parent); } break; - case 67: - if (hasKind(parent(parent(node)), 191)) { + case 68: + if (hasKind(parent(parent(node)), 196)) { return getTryCatchFinallyOccurrences(node.parent.parent); } break; - case 95: - case 80: - if (hasKind(parent(node), 191)) { + case 96: + case 81: + if (hasKind(parent(node), 196)) { return getTryCatchFinallyOccurrences(node.parent); } break; - case 91: - if (hasKind(node.parent, 188)) { + case 92: + if (hasKind(node.parent, 193)) { return getSwitchCaseDefaultOccurrences(node.parent); } break; - case 66: - case 72: - if (hasKind(parent(parent(parent(node))), 188)) { + case 67: + case 73: + if (hasKind(parent(parent(parent(node))), 193)) { return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); } break; - case 65: - case 70: - if (hasKind(node.parent, 185) || hasKind(node.parent, 184)) { + case 66: + case 71: + if (hasKind(node.parent, 190) || hasKind(node.parent, 189)) { return getBreakOrContinueStatementOccurences(node.parent); } break; - case 81: - if (hasKind(node.parent, 181) || - hasKind(node.parent, 182) || - hasKind(node.parent, 183)) { + case 82: + if (hasKind(node.parent, 186) || + hasKind(node.parent, 187) || + hasKind(node.parent, 188)) { return getLoopBreakContinueOccurrences(node.parent); } break; - case 99: - case 74: - if (hasKind(node.parent, 180) || hasKind(node.parent, 179)) { + case 100: + case 75: + if (hasKind(node.parent, 185) || hasKind(node.parent, 184)) { return getLoopBreakContinueOccurrences(node.parent); } break; - case 113: - if (hasKind(node.parent, 133)) { + case 114: + if (hasKind(node.parent, 135)) { return getConstructorOccurrences(node.parent); } break; - case 115: - case 119: - if (hasKind(node.parent, 134) || hasKind(node.parent, 135)) { + case 116: + case 120: + if (hasKind(node.parent, 136) || hasKind(node.parent, 137)) { return getGetAndSetOccurrences(node.parent); } default: if (ts.isModifier(node.kind) && node.parent && - (ts.isDeclaration(node.parent) || node.parent.kind === 175)) { + (ts.isDeclaration(node.parent) || node.parent.kind === 180)) { return getModifierOccurrences(node.kind, node.parent); } } return undefined; function getIfElseOccurrences(ifStatement) { var keywords = []; - while (hasKind(ifStatement.parent, 178) && ifStatement.parent.elseStatement === ifStatement) { + while (hasKind(ifStatement.parent, 183) && ifStatement.parent.elseStatement === ifStatement) { ifStatement = ifStatement.parent; } while (ifStatement) { var children = ifStatement.getChildren(); - pushKeywordIf(keywords, children[0], 83); - for (var _i = children.length - 1; _i >= 0; _i--) { - if (pushKeywordIf(keywords, children[_i], 75)) { + pushKeywordIf(keywords, children[0], 84); + for (var i = children.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, children[i], 76)) { break; } } - if (!hasKind(ifStatement.elseStatement, 178)) { + if (!hasKind(ifStatement.elseStatement, 183)) { break; } ifStatement = ifStatement.elseStatement; } var result = []; - for (var _i_1 = 0; _i_1 < keywords.length; _i_1++) { - if (keywords[_i_1].kind === 75 && _i_1 < keywords.length - 1) { - var elseKeyword = keywords[_i_1]; - var ifKeyword = keywords[_i_1 + 1]; + for (var i = 0; i < keywords.length; i++) { + if (keywords[i].kind === 76 && i < keywords.length - 1) { + var elseKeyword = keywords[i]; + var ifKeyword = keywords[i + 1]; var shouldHighlightNextKeyword = true; for (var j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { if (!ts.isWhiteSpace(sourceFile.text.charCodeAt(j))) { @@ -29667,25 +31877,25 @@ var ts; textSpan: ts.createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), isWriteAccess: false }); - _i_1++; + i++; continue; } } - result.push(getReferenceEntryFromNode(keywords[_i_1])); + result.push(getReferenceEntryFromNode(keywords[i])); } return result; } function getReturnOccurrences(returnStatement) { var func = ts.getContainingFunction(returnStatement); - if (!(func && hasKind(func.body, 174))) { + if (!(func && hasKind(func.body, 179))) { return undefined; } var keywords = []; ts.forEachReturnStatement(func.body, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 89); + pushKeywordIf(keywords, returnStatement.getFirstToken(), 90); }); ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 93); + pushKeywordIf(keywords, throwStatement.getFirstToken(), 94); }); return ts.map(keywords, getReferenceEntryFromNode); } @@ -29696,11 +31906,11 @@ var ts; } var keywords = []; ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 93); + pushKeywordIf(keywords, throwStatement.getFirstToken(), 94); }); if (ts.isFunctionBlock(owner)) { ts.forEachReturnStatement(owner, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 89); + pushKeywordIf(keywords, returnStatement.getFirstToken(), 90); }); } return ts.map(keywords, getReferenceEntryFromNode); @@ -29710,10 +31920,10 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 190) { + if (node.kind === 195) { statementAccumulator.push(node); } - else if (node.kind === 191) { + else if (node.kind === 196) { var tryStatement = node; if (tryStatement.catchClause) { aggregate(tryStatement.catchClause); @@ -29734,39 +31944,39 @@ var ts; function getThrowStatementOwner(throwStatement) { var child = throwStatement; while (child.parent) { - var _parent = child.parent; - if (ts.isFunctionBlock(_parent) || _parent.kind === 221) { - return _parent; + var parent_9 = child.parent; + if (ts.isFunctionBlock(parent_9) || parent_9.kind === 227) { + return parent_9; } - if (_parent.kind === 191) { - var tryStatement = _parent; + if (parent_9.kind === 196) { + var tryStatement = parent_9; if (tryStatement.tryBlock === child && tryStatement.catchClause) { return child; } } - child = _parent; + child = parent_9; } return undefined; } function getTryCatchFinallyOccurrences(tryStatement) { var keywords = []; - pushKeywordIf(keywords, tryStatement.getFirstToken(), 95); + pushKeywordIf(keywords, tryStatement.getFirstToken(), 96); if (tryStatement.catchClause) { - pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 67); + pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 68); } if (tryStatement.finallyBlock) { - var finallyKeyword = ts.findChildOfKind(tryStatement, 80, sourceFile); - pushKeywordIf(keywords, finallyKeyword, 80); + var finallyKeyword = ts.findChildOfKind(tryStatement, 81, sourceFile); + pushKeywordIf(keywords, finallyKeyword, 81); } return ts.map(keywords, getReferenceEntryFromNode); } function getLoopBreakContinueOccurrences(loopNode) { var keywords = []; - if (pushKeywordIf(keywords, loopNode.getFirstToken(), 81, 99, 74)) { - if (loopNode.kind === 179) { + if (pushKeywordIf(keywords, loopNode.getFirstToken(), 82, 100, 75)) { + if (loopNode.kind === 184) { var loopTokens = loopNode.getChildren(); - for (var _i = loopTokens.length - 1; _i >= 0; _i--) { - if (pushKeywordIf(keywords, loopTokens[_i], 99)) { + for (var i = loopTokens.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, loopTokens[i], 100)) { break; } } @@ -29775,20 +31985,20 @@ var ts; var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); ts.forEach(breaksAndContinues, function (statement) { if (ownsBreakOrContinueStatement(loopNode, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 65, 70); + pushKeywordIf(keywords, statement.getFirstToken(), 66, 71); } }); return ts.map(keywords, getReferenceEntryFromNode); } function getSwitchCaseDefaultOccurrences(switchStatement) { var keywords = []; - pushKeywordIf(keywords, switchStatement.getFirstToken(), 91); + pushKeywordIf(keywords, switchStatement.getFirstToken(), 92); ts.forEach(switchStatement.caseBlock.clauses, function (clause) { - pushKeywordIf(keywords, clause.getFirstToken(), 66, 72); + pushKeywordIf(keywords, clause.getFirstToken(), 67, 73); var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); ts.forEach(breaksAndContinues, function (statement) { if (ownsBreakOrContinueStatement(switchStatement, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 65); + pushKeywordIf(keywords, statement.getFirstToken(), 66); } }); }); @@ -29798,13 +32008,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 181: - case 182: - case 183: - case 179: - case 180: - return getLoopBreakContinueOccurrences(owner); + case 186: + case 187: case 188: + case 184: + case 185: + return getLoopBreakContinueOccurrences(owner); + case 193: return getSwitchCaseDefaultOccurrences(owner); } } @@ -29815,7 +32025,7 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 185 || node.kind === 184) { + if (node.kind === 190 || node.kind === 189) { statementAccumulator.push(node); } else if (!ts.isFunctionLike(node)) { @@ -29829,23 +32039,23 @@ var ts; return actualOwner && actualOwner === owner; } function getBreakOrContinueOwner(statement) { - for (var _node = statement.parent; _node; _node = _node.parent) { - switch (_node.kind) { - case 188: - if (statement.kind === 184) { + for (var node_1 = statement.parent; node_1; node_1 = node_1.parent) { + switch (node_1.kind) { + case 193: + if (statement.kind === 189) { continue; } - case 181: - case 182: - case 183: - case 180: - case 179: - if (!statement.label || isLabeledBy(_node, statement.label.text)) { - return _node; + case 186: + case 187: + case 188: + case 185: + case 184: + if (!statement.label || isLabeledBy(node_1, statement.label.text)) { + return node_1; } break; default: - if (ts.isFunctionLike(_node)) { + if (ts.isFunctionLike(node_1)) { return undefined; } break; @@ -29858,38 +32068,38 @@ var ts; var keywords = []; ts.forEach(declarations, function (declaration) { ts.forEach(declaration.getChildren(), function (token) { - return pushKeywordIf(keywords, token, 113); + return pushKeywordIf(keywords, token, 114); }); }); return ts.map(keywords, getReferenceEntryFromNode); } function getGetAndSetOccurrences(accessorDeclaration) { var keywords = []; - tryPushAccessorKeyword(accessorDeclaration.symbol, 134); - tryPushAccessorKeyword(accessorDeclaration.symbol, 135); + tryPushAccessorKeyword(accessorDeclaration.symbol, 136); + tryPushAccessorKeyword(accessorDeclaration.symbol, 137); return ts.map(keywords, getReferenceEntryFromNode); function tryPushAccessorKeyword(accessorSymbol, accessorKind) { var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); if (accessor) { - ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 115, 119); }); + ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 116, 120); }); } } } function getModifierOccurrences(modifier, declaration) { var container = declaration.parent; - if (declaration.flags & 112) { - if (!(container.kind === 196 || - (declaration.kind === 128 && hasKind(container, 133)))) { + if (ts.isAccessibilityModifier(modifier)) { + if (!(container.kind === 201 || + (declaration.kind === 129 && hasKind(container, 135)))) { return undefined; } } - else if (declaration.flags & 128) { - if (container.kind !== 196) { + else if (modifier === 110) { + if (container.kind !== 201) { return undefined; } } - else if (declaration.flags & (1 | 2)) { - if (!(container.kind === 201 || container.kind === 221)) { + else if (modifier === 78 || modifier === 115) { + if (!(container.kind === 206 || container.kind === 227)) { return undefined; } } @@ -29900,18 +32110,18 @@ var ts; var modifierFlag = getFlagFromModifier(modifier); var nodes; switch (container.kind) { - case 201: - case 221: + case 206: + case 227: nodes = container.statements; break; - case 133: + case 135: nodes = container.parameters.concat(container.parent.members); break; - case 196: + case 201: nodes = container.members; if (modifierFlag & 112) { var constructor = ts.forEach(container.members, function (member) { - return member.kind === 133 && member; + return member.kind === 135 && member; }); if (constructor) { nodes = nodes.concat(constructor.parameters); @@ -29929,17 +32139,17 @@ var ts; return ts.map(keywords, getReferenceEntryFromNode); function getFlagFromModifier(modifier) { switch (modifier) { - case 108: - return 16; - case 106: - return 32; - case 107: - return 64; case 109: + return 16; + case 107: + return 32; + case 108: + return 64; + case 110: return 128; - case 77: + case 78: return 1; - case 114: + case 115: return 2; default: ts.Debug.fail(); @@ -29964,46 +32174,63 @@ var ts; return false; } } + function convertReferences(referenceSymbols) { + if (!referenceSymbols) { + return undefined; + } + var referenceEntries = []; + for (var _i = 0; _i < referenceSymbols.length; _i++) { + var referenceSymbol = referenceSymbols[_i]; + ts.addRange(referenceEntries, referenceSymbol.references); + } + return referenceEntries; + } function findRenameLocations(fileName, position, findInStrings, findInComments) { - return findReferences(fileName, position, findInStrings, findInComments); + var referencedSymbols = findReferencedSymbols(fileName, position, findInStrings, findInComments); + return convertReferences(referencedSymbols); } function getReferencesAtPosition(fileName, position) { - return findReferences(fileName, position, false, false); + var referencedSymbols = findReferencedSymbols(fileName, position, false, false); + return convertReferences(referencedSymbols); } - function findReferences(fileName, position, findInStrings, findInComments) { + function findReferences(fileName, position) { + var referencedSymbols = findReferencedSymbols(fileName, position, false, false); + return ts.filter(referencedSymbols, function (rs) { return !!rs.definition; }); + } + function findReferencedSymbols(fileName, position, findInStrings, findInComments) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); var node = ts.getTouchingPropertyName(sourceFile, position); if (!node) { return undefined; } - if (node.kind !== 64 && + if (node.kind !== 65 && !isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && !isNameOfExternalModuleImportOrDeclaration(node)) { return undefined; } - ts.Debug.assert(node.kind === 64 || node.kind === 7 || node.kind === 8); + ts.Debug.assert(node.kind === 65 || node.kind === 7 || node.kind === 8); return getReferencesForNode(node, program.getSourceFiles(), false, findInStrings, findInComments); } function getReferencesForNode(node, sourceFiles, searchOnlyInCurrentFile, findInStrings, findInComments) { if (isLabelName(node)) { if (isJumpStatementTarget(node)) { var labelDefinition = getTargetLabel(node.parent, node.text); - return labelDefinition ? getLabelReferencesInNode(labelDefinition.parent, labelDefinition) : [getReferenceEntryFromNode(node)]; + return labelDefinition ? getLabelReferencesInNode(labelDefinition.parent, labelDefinition) : undefined; } else { return getLabelReferencesInNode(node.parent, node); } } - if (node.kind === 92) { + if (node.kind === 93) { return getReferencesForThisKeyword(node, sourceFiles); } - if (node.kind === 90) { + if (node.kind === 91) { return getReferencesForSuperKeyword(node); } var symbol = typeInfoResolver.getSymbolAtLocation(node); if (!symbol) { - return [getReferenceEntryFromNode(node)]; + return undefined; } var declarations = symbol.declarations; if (!declarations || !declarations.length) { @@ -30013,15 +32240,16 @@ var ts; var searchMeaning = getIntersectingMeaningFromDeclarations(getMeaningFromLocation(node), declarations); var declaredName = getDeclaredName(symbol, node); var scope = getSymbolScope(symbol); + var symbolToIndex = []; if (scope) { result = []; - getReferencesInNode(scope, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result); + getReferencesInNode(scope, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); } else { if (searchOnlyInCurrentFile) { ts.Debug.assert(sourceFiles.length === 1); result = []; - getReferencesInNode(sourceFiles[0], symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result); + getReferencesInNode(sourceFiles[0], symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); } else { var internedName = getInternedName(symbol, node, declarations); @@ -30030,48 +32258,64 @@ var ts; var nameTable = getNameTable(sourceFile); if (ts.lookUp(nameTable, internedName)) { result = result || []; - getReferencesInNode(sourceFile, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result); + getReferencesInNode(sourceFile, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); } }); } } return result; + function getDefinition(symbol) { + var info = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, node.getSourceFile(), getContainerNode(node), typeInfoResolver, node); + var name = ts.map(info.displayParts, function (p) { return p.text; }).join(""); + var declarations = symbol.declarations; + if (!declarations || declarations.length === 0) { + return undefined; + } + return { + containerKind: "", + containerName: "", + name: name, + kind: info.symbolKind, + fileName: declarations[0].getSourceFile().fileName, + textSpan: ts.createTextSpan(declarations[0].getStart(), 0) + }; + } function isImportOrExportSpecifierName(location) { return location.parent && - (location.parent.kind === 208 || location.parent.kind === 212) && + (location.parent.kind === 213 || location.parent.kind === 217) && location.parent.propertyName === location; } function isImportOrExportSpecifierImportSymbol(symbol) { return (symbol.flags & 8388608) && ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 208 || declaration.kind === 212; + return declaration.kind === 213 || declaration.kind === 217; }); } function getDeclaredName(symbol, location) { - var functionExpression = ts.forEach(symbol.declarations, function (d) { return d.kind === 160 ? d : undefined; }); - var _name; + var functionExpression = ts.forEach(symbol.declarations, function (d) { return d.kind === 162 ? d : undefined; }); + var name; if (functionExpression && functionExpression.name) { - _name = functionExpression.name.text; + name = functionExpression.name.text; } if (isImportOrExportSpecifierName(location)) { return location.getText(); } - _name = typeInfoResolver.symbolToString(symbol); - return stripQuotes(_name); + name = typeInfoResolver.symbolToString(symbol); + return stripQuotes(name); } function getInternedName(symbol, location, declarations) { if (isImportOrExportSpecifierName(location)) { return location.getText(); } - var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 160 ? d : undefined; }); - var _name = functionExpression && functionExpression.name + var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 162 ? d : undefined; }); + var name = functionExpression && functionExpression.name ? functionExpression.name.text : symbol.name; - return stripQuotes(_name); + return stripQuotes(name); } function stripQuotes(name) { - var _length = name.length; - if (_length >= 2 && name.charCodeAt(0) === 34 && name.charCodeAt(_length - 1) === 34) { - return name.substring(1, _length - 1); + var length = name.length; + if (length >= 2 && name.charCodeAt(0) === 34 && name.charCodeAt(length - 1) === 34) { + return name.substring(1, length - 1); } ; return name; @@ -30080,7 +32324,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, 196); + return ts.getAncestor(privateDeclaration, 201); } } if (symbol.flags & 8388608) { @@ -30089,25 +32333,25 @@ var ts; if (symbol.parent || (symbol.flags & 268435456)) { return undefined; } - var _scope = undefined; - var _declarations = symbol.getDeclarations(); - if (_declarations) { - for (var _i = 0, _n = _declarations.length; _i < _n; _i++) { - var declaration = _declarations[_i]; + var scope = undefined; + var declarations = symbol.getDeclarations(); + if (declarations) { + for (var _i = 0; _i < declarations.length; _i++) { + var declaration = declarations[_i]; var container = getContainerNode(declaration); if (!container) { return undefined; } - if (_scope && _scope !== container) { + if (scope && scope !== container) { return undefined; } - if (container.kind === 221 && !ts.isExternalModule(container)) { + if (container.kind === 227 && !ts.isExternalModule(container)) { return undefined; } - _scope = container; + scope = container; } } - return _scope; + return scope; } function getPossibleSymbolReferencePositions(sourceFile, symbolName, start, end) { var positions = []; @@ -30132,27 +32376,35 @@ var ts; return positions; } function getLabelReferencesInNode(container, targetLabel) { - var _result = []; + var references = []; var sourceFile = container.getSourceFile(); var labelName = targetLabel.text; var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, labelName, container.getStart(), container.getEnd()); ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); - var _node = ts.getTouchingWord(sourceFile, position); - if (!_node || _node.getWidth() !== labelName.length) { + var node = ts.getTouchingWord(sourceFile, position); + if (!node || node.getWidth() !== labelName.length) { return; } - if (_node === targetLabel || - (isJumpStatementTarget(_node) && getTargetLabel(_node, labelName) === targetLabel)) { - _result.push(getReferenceEntryFromNode(_node)); + if (node === targetLabel || + (isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel)) { + references.push(getReferenceEntryFromNode(node)); } }); - return _result; + var definition = { + containerKind: "", + containerName: "", + fileName: targetLabel.getSourceFile().fileName, + kind: ScriptElementKind.label, + name: labelName, + textSpan: ts.createTextSpanFromBounds(targetLabel.getStart(), targetLabel.getEnd()) + }; + return [{ definition: definition, references: references }]; } function isValidReferencePosition(node, searchSymbolName) { if (node) { switch (node.kind) { - case 64: + case 65: return node.getWidth() === searchSymbolName.length; case 8: if (isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || @@ -30169,7 +32421,7 @@ var ts; } return false; } - function getReferencesInNode(container, searchSymbol, searchText, searchLocation, searchMeaning, findInStrings, findInComments, result) { + function getReferencesInNode(container, searchSymbol, searchText, searchLocation, searchMeaning, findInStrings, findInComments, result, symbolToIndex) { var sourceFile = container.getSourceFile(); var tripleSlashDirectivePrefixRegex = /^\/\/\/\s*= 0) { - result.push(getReferenceEntryFromNode(referenceSymbolDeclaration.name)); + var referencedSymbol = getReferencedSymbol(shorthandValueSymbol); + referencedSymbol.references.push(getReferenceEntryFromNode(referenceSymbolDeclaration.name)); } } }); } + return; + function getReferencedSymbol(symbol) { + var symbolId = ts.getSymbolId(symbol); + var index = symbolToIndex[symbolId]; + if (index === undefined) { + index = result.length; + symbolToIndex[symbolId] = index; + result.push({ + definition: getDefinition(symbol), + references: [] + }); + } + return result[index]; + } function isInString(position) { var token = ts.getTokenAtPosition(sourceFile, position); return token && token.kind === 8 && position > token.getStart(); @@ -30232,105 +32504,116 @@ var ts; } var staticFlag = 128; switch (searchSpaceNode.kind) { - case 130: - case 129: case 132: case 131: - case 133: case 134: + case 133: case 135: + case 136: + case 137: staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; break; default: return undefined; } - var _result = []; + var references = []; var sourceFile = searchSpaceNode.getSourceFile(); var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "super", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); - var _node = ts.getTouchingWord(sourceFile, position); - if (!_node || _node.kind !== 90) { + var node = ts.getTouchingWord(sourceFile, position); + if (!node || node.kind !== 91) { return; } - var container = ts.getSuperContainer(_node, false); + var container = ts.getSuperContainer(node, false); if (container && (128 & container.flags) === staticFlag && container.parent.symbol === searchSpaceNode.symbol) { - _result.push(getReferenceEntryFromNode(_node)); + references.push(getReferenceEntryFromNode(node)); } }); - return _result; + var definition = getDefinition(searchSpaceNode.symbol); + return [{ definition: definition, references: references }]; } function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles) { var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, false); var staticFlag = 128; switch (searchSpaceNode.kind) { - case 132: - case 131: + case 134: + case 133: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } - case 130: - case 129: - case 133: - case 134: + case 132: + case 131: case 135: + case 136: + case 137: staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; break; - case 221: + case 227: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } - case 195: - case 160: + case 200: + case 162: break; default: return undefined; } - var _result = []; + var references = []; var possiblePositions; - if (searchSpaceNode.kind === 221) { + if (searchSpaceNode.kind === 227) { ts.forEach(sourceFiles, function (sourceFile) { possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); - getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, _result); + getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references); }); } else { var sourceFile = searchSpaceNode.getSourceFile(); possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); - getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, _result); + getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, references); } - return _result; + return [{ + definition: { + containerKind: "", + containerName: "", + fileName: node.getSourceFile().fileName, + kind: ScriptElementKind.variableElement, + name: "this", + textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()) + }, + references: references + }]; function getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, result) { ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); - var _node = ts.getTouchingWord(sourceFile, position); - if (!_node || _node.kind !== 92) { + var node = ts.getTouchingWord(sourceFile, position); + if (!node || node.kind !== 93) { return; } - var container = ts.getThisContainer(_node, false); + var container = ts.getThisContainer(node, false); switch (searchSpaceNode.kind) { - case 160: - case 195: + case 162: + case 200: if (searchSpaceNode.symbol === container.symbol) { - result.push(getReferenceEntryFromNode(_node)); + result.push(getReferenceEntryFromNode(node)); } break; - case 132: - case 131: + case 134: + case 133: if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { - result.push(getReferenceEntryFromNode(_node)); + result.push(getReferenceEntryFromNode(node)); } break; - case 196: + case 201: if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (container.flags & 128) === staticFlag) { - result.push(getReferenceEntryFromNode(_node)); + result.push(getReferenceEntryFromNode(node)); } break; - case 221: - if (container.kind === 221 && !ts.isExternalModule(container)) { - result.push(getReferenceEntryFromNode(_node)); + case 227: + if (container.kind === 227 && !ts.isExternalModule(container)) { + result.push(getReferenceEntryFromNode(node)); } break; } @@ -30338,37 +32621,37 @@ var ts; } } function populateSearchSymbolSet(symbol, location) { - var _result = [symbol]; + var result = [symbol]; if (isImportOrExportSpecifierImportSymbol(symbol)) { - _result.push(typeInfoResolver.getAliasedSymbol(symbol)); + result.push(typeInfoResolver.getAliasedSymbol(symbol)); } if (isNameOfPropertyAssignment(location)) { ts.forEach(getPropertySymbolsFromContextualType(location), function (contextualSymbol) { - _result.push.apply(_result, typeInfoResolver.getRootSymbols(contextualSymbol)); + result.push.apply(result, typeInfoResolver.getRootSymbols(contextualSymbol)); }); var shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(location.parent); if (shorthandValueSymbol) { - _result.push(shorthandValueSymbol); + result.push(shorthandValueSymbol); } } ts.forEach(typeInfoResolver.getRootSymbols(symbol), function (rootSymbol) { if (rootSymbol !== symbol) { - _result.push(rootSymbol); + result.push(rootSymbol); } if (rootSymbol.parent && rootSymbol.parent.flags & (32 | 64)) { - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), _result); + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result); } }); - return _result; + return result; } function getPropertySymbolsFromBaseTypes(symbol, propertyName, result) { if (symbol && symbol.flags & (32 | 64)) { ts.forEach(symbol.getDeclarations(), function (declaration) { - if (declaration.kind === 196) { - getPropertySymbolFromTypeReference(ts.getClassBaseTypeNode(declaration)); - ts.forEach(ts.getClassImplementedTypeNodes(declaration), getPropertySymbolFromTypeReference); + if (declaration.kind === 201) { + getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); + ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); } - else if (declaration.kind === 197) { + else if (declaration.kind === 202) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); } }); @@ -30387,57 +32670,59 @@ var ts; } } } - function isRelatableToSearchSet(searchSymbols, referenceSymbol, referenceLocation) { + function getRelatedSymbol(searchSymbols, referenceSymbol, referenceLocation) { if (searchSymbols.indexOf(referenceSymbol) >= 0) { - return true; + return referenceSymbol; } - if (isImportOrExportSpecifierImportSymbol(referenceSymbol) && - searchSymbols.indexOf(typeInfoResolver.getAliasedSymbol(referenceSymbol)) >= 0) { - return true; + if (isImportOrExportSpecifierImportSymbol(referenceSymbol)) { + var aliasedSymbol = typeInfoResolver.getAliasedSymbol(referenceSymbol); + if (searchSymbols.indexOf(aliasedSymbol) >= 0) { + return aliasedSymbol; + } } if (isNameOfPropertyAssignment(referenceLocation)) { return ts.forEach(getPropertySymbolsFromContextualType(referenceLocation), function (contextualSymbol) { - return ts.forEach(typeInfoResolver.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0; }); + return ts.forEach(typeInfoResolver.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); }); } return ts.forEach(typeInfoResolver.getRootSymbols(referenceSymbol), function (rootSymbol) { if (searchSymbols.indexOf(rootSymbol) >= 0) { - return true; + return rootSymbol; } if (rootSymbol.parent && rootSymbol.parent.flags & (32 | 64)) { - var _result = []; - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), _result); - return ts.forEach(_result, function (s) { return searchSymbols.indexOf(s) >= 0; }); + var result_2 = []; + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result_2); + return ts.forEach(result_2, function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); } - return false; + return undefined; }); } function getPropertySymbolsFromContextualType(node) { if (isNameOfPropertyAssignment(node)) { var objectLiteral = node.parent.parent; var contextualType = typeInfoResolver.getContextualType(objectLiteral); - var _name = node.text; + var name_20 = node.text; if (contextualType) { if (contextualType.flags & 16384) { - var unionProperty = contextualType.getProperty(_name); + var unionProperty = contextualType.getProperty(name_20); if (unionProperty) { return [unionProperty]; } else { - var _result = []; + var result_3 = []; ts.forEach(contextualType.types, function (t) { - var _symbol = t.getProperty(_name); - if (_symbol) { - _result.push(_symbol); + var symbol = t.getProperty(name_20); + if (symbol) { + result_3.push(symbol); } }); - return _result; + return result_3; } } else { - var _symbol = contextualType.getProperty(_name); - if (_symbol) { - return [_symbol]; + var symbol_1 = contextualType.getProperty(name_20); + if (symbol_1) { + return [symbol_1]; } } } @@ -30449,7 +32734,7 @@ var ts; var lastIterationMeaning; do { lastIterationMeaning = meaning; - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; var declarationMeaning = getMeaningFromDeclaration(declaration); if (declarationMeaning & meaning) { @@ -30475,17 +32760,17 @@ var ts; }; } function isWriteAccess(node) { - if (node.kind === 64 && ts.isDeclarationName(node)) { + if (node.kind === 65 && ts.isDeclarationName(node)) { return true; } - var _parent = node.parent; - if (_parent) { - if (_parent.kind === 166 || _parent.kind === 165) { + var parent = node.parent; + if (parent) { + if (parent.kind === 168 || parent.kind === 167) { return true; } - else if (_parent.kind === 167 && _parent.left === node) { - var operator = _parent.operatorToken.kind; - return 52 <= operator && operator <= 63; + else if (parent.kind === 169 && parent.left === node) { + var operator = parent.operatorToken.kind; + return 53 <= operator && operator <= 64; } } return false; @@ -30495,7 +32780,7 @@ var ts; return ts.NavigateTo.getNavigateToItems(program, cancellationToken, searchValue, maxResultCount); } function containErrors(diagnostics) { - return ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === 1; }); + return ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; }); } function getEmitOutput(fileName) { synchronizeHostData(); @@ -30516,33 +32801,33 @@ var ts; } function getMeaningFromDeclaration(node) { switch (node.kind) { - case 128: - case 193: - case 150: - case 130: case 129: - case 218: - case 219: - case 220: + case 198: + case 152: case 132: case 131: - case 133: + case 224: + case 225: + case 226: case 134: + case 133: case 135: - case 195: - case 160: - case 161: - case 217: - return 1; - case 127: - case 197: - case 198: - case 143: - return 2; - case 196: - case 199: - return 1 | 2; + 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 201: + case 204: + return 1 | 2; + case 205: if (node.name.kind === 8) { return 4 | 1; } @@ -30552,52 +32837,72 @@ var ts; else { return 4; } - case 207: + case 212: + case 213: case 208: - case 203: - case 204: case 209: - case 210: + case 214: + case 215: return 1 | 2 | 4; - case 221: + case 227: return 4 | 1; } return 1 | 2 | 4; ts.Debug.fail("Unknown declaration type"); } function isTypeReference(node) { - if (isRightSideOfQualifiedName(node)) { + if (ts.isRightSideOfQualifiedNameOrPropertyAccess(node)) { node = node.parent; } - return node.parent.kind === 139; + return node.parent.kind === 141 || node.parent.kind === 177; } function isNamespaceReference(node) { + return isQualifiedNameNamespaceReference(node) || isPropertyAccessNamespaceReference(node); + } + function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 125) { - while (root.parent && root.parent.kind === 125) + if (root.parent.kind === 155) { + while (root.parent && root.parent.kind === 155) { root = root.parent; + } + isLastClause = root.name === node; + } + if (!isLastClause && root.parent.kind === 177 && root.parent.parent.kind === 222) { + var decl = root.parent.parent.parent; + return (decl.kind === 201 && root.parent.parent.token === 103) || + (decl.kind === 202 && 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) { + root = root.parent; + } isLastClause = root.right === node; } - return root.parent.kind === 139 && !isLastClause; + return root.parent.kind === 141 && !isLastClause; } function isInRightSideOfImport(node) { - while (node.parent.kind === 125) { + while (node.parent.kind === 126) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; } function getMeaningFromRightHandSideOfImportEquals(node) { - ts.Debug.assert(node.kind === 64); - if (node.parent.kind === 125 && + ts.Debug.assert(node.kind === 65); + if (node.parent.kind === 126 && node.parent.right === node && - node.parent.parent.kind === 203) { + node.parent.parent.kind === 208) { return 1 | 2 | 4; } return 4; } function getMeaningFromLocation(node) { - if (node.parent.kind === 209) { + if (node.parent.kind === 214) { return 1 | 2 | 4; } else if (isInRightSideOfImport(node)) { @@ -30631,15 +32936,15 @@ var ts; return; } switch (node.kind) { - case 153: - case 125: + case 155: + case 126: case 8: - case 79: - case 94: - case 88: - case 90: - case 92: - case 64: + case 80: + case 95: + case 89: + case 91: + case 93: + case 65: break; default: return; @@ -30650,7 +32955,7 @@ var ts; nodeForStartPos = nodeForStartPos.parent; } else if (isNameOfModuleDeclaration(nodeForStartPos)) { - if (nodeForStartPos.parent.parent.kind === 200 && + if (nodeForStartPos.parent.parent.kind === 205 && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { nodeForStartPos = nodeForStartPos.parent.parent.name; } @@ -30706,13 +33011,13 @@ var ts; return undefined; function hasValueSideModule(symbol) { return ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 200 && ts.getModuleInstanceState(declaration) == 1; + return declaration.kind === 205 && ts.getModuleInstanceState(declaration) == 1; }); } } function processNode(node) { if (node && ts.textSpanIntersectsWith(span, node.getStart(), node.getWidth())) { - if (node.kind === 64 && node.getWidth() > 0) { + if (node.kind === 65 && node.getWidth() > 0) { var symbol = typeInfoResolver.getSymbolAtLocation(node); if (symbol) { var type = classifySymbol(symbol, getMeaningFromLocation(node)); @@ -30823,17 +33128,17 @@ var ts; } if (ts.isPunctuation(tokenKind)) { if (token) { - if (tokenKind === 52) { - if (token.parent.kind === 193 || - token.parent.kind === 130 || - token.parent.kind === 128) { + if (tokenKind === 53) { + if (token.parent.kind === 198 || + token.parent.kind === 132 || + token.parent.kind === 129) { return ClassificationTypeNames.operator; } } - if (token.parent.kind === 167 || - token.parent.kind === 165 || - token.parent.kind === 166 || - token.parent.kind === 168) { + if (token.parent.kind === 169 || + token.parent.kind === 167 || + token.parent.kind === 168 || + token.parent.kind === 170) { return ClassificationTypeNames.operator; } } @@ -30851,30 +33156,30 @@ var ts; else if (ts.isTemplateLiteralKind(tokenKind)) { return ClassificationTypeNames.stringLiteral; } - else if (tokenKind === 64) { + else if (tokenKind === 65) { if (token) { switch (token.parent.kind) { - case 196: + case 201: if (token.parent.name === token) { return ClassificationTypeNames.className; } return; - case 127: + case 128: if (token.parent.name === token) { return ClassificationTypeNames.typeParameterName; } return; - case 197: + case 202: if (token.parent.name === token) { return ClassificationTypeNames.interfaceName; } return; - case 199: + case 204: if (token.parent.name === token) { return ClassificationTypeNames.enumName; } return; - case 200: + case 205: if (token.parent.name === token) { return ClassificationTypeNames.moduleName; } @@ -30887,7 +33192,7 @@ var ts; function processElement(element) { if (ts.textSpanIntersectsWith(span, element.getFullStart(), element.getFullWidth())) { var children = element.getChildren(); - for (var _i = 0, _n = children.length; _i < _n; _i++) { + for (var _i = 0; _i < children.length; _i++) { var child = children[_i]; if (ts.isToken(child)) { classifyToken(child); @@ -30912,7 +33217,7 @@ var ts; if (matchKind) { var parentElement = token.parent; var childNodes = parentElement.getChildren(sourceFile); - for (var _i = 0, _n = childNodes.length; _i < _n; _i++) { + for (var _i = 0; _i < childNodes.length; _i++) { var current = childNodes[_i]; if (current.kind === matchKind) { var range1 = ts.createTextSpan(token.getStart(sourceFile), token.getWidth(sourceFile)); @@ -30993,9 +33298,9 @@ var ts; continue; } var descriptor = undefined; - for (var _i = 0, n = descriptors.length; _i < n; _i++) { - if (matchArray[_i + firstDescriptorCaptureIndex]) { - descriptor = descriptors[_i]; + for (var i = 0, n = descriptors.length; i < n; i++) { + if (matchArray[i + firstDescriptorCaptureIndex]) { + descriptor = descriptors[i]; } } ts.Debug.assert(descriptor !== undefined); @@ -31015,15 +33320,17 @@ var ts; return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); } function getTodoCommentsRegExp() { + // NOTE: ?: means 'non-capture group'. It allows us to have groups without having to + // filter them out later in the final result array. var singleLineCommentStart = /(?:\/\/+\s*)/.source; var multiLineCommentStart = /(?:\/\*+\s*)/.source; var anyNumberOfSpacesAndAsterixesAtStartOfLine = /(?:^(?:\s|\*)*)/.source; - var _preamble = "(" + anyNumberOfSpacesAndAsterixesAtStartOfLine + "|" + singleLineCommentStart + "|" + multiLineCommentStart + ")"; + var preamble = "(" + anyNumberOfSpacesAndAsterixesAtStartOfLine + "|" + singleLineCommentStart + "|" + multiLineCommentStart + ")"; var literals = "(?:" + ts.map(descriptors, function (d) { return "(" + escapeRegExp(d.text) + ")"; }).join("|") + ")"; var endOfLineOrEndOfComment = /(?:$|\*\/)/.source; var messageRemainder = /(?:.*?)/.source; var messagePortion = "(" + literals + messageRemainder + ")"; - var regExpString = _preamble + messagePortion + endOfLineOrEndOfComment; + var regExpString = preamble + messagePortion + endOfLineOrEndOfComment; return new RegExp(regExpString, "gim"); } function isLetterOrDigit(char) { @@ -31036,17 +33343,17 @@ var ts; synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); var node = ts.getTouchingWord(sourceFile, position); - if (node && node.kind === 64) { + if (node && node.kind === 65) { var symbol = typeInfoResolver.getSymbolAtLocation(node); if (symbol) { var declarations = symbol.getDeclarations(); if (declarations && declarations.length > 0) { var defaultLibFileName = host.getDefaultLibFileName(host.getCompilationSettings()); if (defaultLibFileName) { - for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + for (var _i = 0; _i < declarations.length; _i++) { var current = declarations[_i]; - var _sourceFile = current.getSourceFile(); - if (_sourceFile && getCanonicalFileName(ts.normalizePath(_sourceFile.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) { + var sourceFile_1 = current.getSourceFile(); + if (sourceFile_1 && getCanonicalFileName(ts.normalizePath(sourceFile_1.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) { return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library.key)); } } @@ -31093,6 +33400,7 @@ var ts; getQuickInfoAtPosition: getQuickInfoAtPosition, getDefinitionAtPosition: getDefinitionAtPosition, getReferencesAtPosition: getReferencesAtPosition, + findReferences: findReferences, getOccurrencesAtPosition: getOccurrencesAtPosition, getNameOrDottedNameSpan: getNameOrDottedNameSpan, getBreakpointStatementAtPosition: getBreakpointStatementAtPosition, @@ -31126,13 +33434,13 @@ var ts; sourceFile.nameTable = nameTable; function walk(node) { switch (node.kind) { - case 64: + case 65: nameTable[node.text] = node.text; break; case 8: case 7: if (ts.isDeclarationName(node) || - node.parent.kind === 213 || + node.parent.kind === 219 || isArgumentOfElementAccessExpression(node)) { nameTable[node.text] = node.text; } @@ -31145,40 +33453,31 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 154 && + node.parent.kind === 156 && node.parent.argumentExpression === node; } function createClassifier() { - var _scanner = ts.createScanner(2, false); + var scanner = ts.createScanner(2, false); var noRegexTable = []; - noRegexTable[64] = true; + noRegexTable[65] = true; noRegexTable[8] = true; noRegexTable[7] = true; noRegexTable[9] = true; - noRegexTable[92] = true; + noRegexTable[93] = true; noRegexTable[38] = true; noRegexTable[39] = true; noRegexTable[17] = true; noRegexTable[19] = true; noRegexTable[15] = true; - noRegexTable[94] = true; - noRegexTable[79] = true; + noRegexTable[95] = true; + noRegexTable[80] = true; var templateStack = []; - function isAccessibilityModifier(kind) { - switch (kind) { - case 108: - case 106: - case 107: - return true; - } - return false; - } function canFollow(keyword1, keyword2) { - if (isAccessibilityModifier(keyword1)) { - if (keyword2 === 115 || - keyword2 === 119 || - keyword2 === 113 || - keyword2 === 109) { + if (ts.isAccessibilityModifier(keyword1)) { + if (keyword2 === 116 || + keyword2 === 120 || + keyword2 === 114 || + keyword2 === 110) { return true; } return false; @@ -31216,40 +33515,40 @@ var ts; templateStack.push(11); break; } - _scanner.setText(text); + scanner.setText(text); var result = { finalLexState: 0, entries: [] }; var angleBracketStack = 0; do { - token = _scanner.scan(); + token = scanner.scan(); if (!ts.isTrivia(token)) { - if ((token === 36 || token === 56) && !noRegexTable[lastNonTriviaToken]) { - if (_scanner.reScanSlashToken() === 9) { + if ((token === 36 || token === 57) && !noRegexTable[lastNonTriviaToken]) { + if (scanner.reScanSlashToken() === 9) { token = 9; } } else if (lastNonTriviaToken === 20 && isKeyword(token)) { - token = 64; + token = 65; } else if (isKeyword(lastNonTriviaToken) && isKeyword(token) && !canFollow(lastNonTriviaToken, token)) { - token = 64; + token = 65; } - else if (lastNonTriviaToken === 64 && + else if (lastNonTriviaToken === 65 && token === 24) { angleBracketStack++; } else if (token === 25 && angleBracketStack > 0) { angleBracketStack--; } - else if (token === 111 || - token === 120 || - token === 118 || - token === 112 || - token === 121) { + else if (token === 112 || + token === 121 || + token === 119 || + token === 113 || + token === 122) { if (angleBracketStack > 0 && !syntacticClassifierAbsent) { - token = 64; + token = 65; } } else if (token === 11) { @@ -31264,7 +33563,7 @@ var ts; if (templateStack.length > 0) { var lastTemplateStackToken = ts.lastOrUndefined(templateStack); if (lastTemplateStackToken === 11) { - token = _scanner.reScanTemplateToken(); + token = scanner.reScanTemplateToken(); if (token === 13) { templateStack.pop(); } @@ -31284,13 +33583,13 @@ var ts; } while (token !== 1); return result; function processToken() { - var start = _scanner.getTokenPos(); - var end = _scanner.getTextPos(); + var start = scanner.getTokenPos(); + var end = scanner.getTextPos(); addResult(end - start, classFromKind(token)); if (end >= text.length) { if (token === 8) { - var tokenText = _scanner.getTokenText(); - if (_scanner.isUnterminated()) { + var tokenText = scanner.getTokenText(); + if (scanner.isUnterminated()) { var lastCharIndex = tokenText.length - 1; var numBackslashes = 0; while (tokenText.charCodeAt(lastCharIndex - numBackslashes) === 92) { @@ -31305,12 +33604,12 @@ var ts; } } else if (token === 3) { - if (_scanner.isUnterminated()) { + if (scanner.isUnterminated()) { result.finalLexState = 1; } } else if (ts.isTemplateLiteralKind(token)) { - if (_scanner.isUnterminated()) { + if (scanner.isUnterminated()) { if (token === 13) { result.finalLexState = 5; } @@ -31350,8 +33649,8 @@ var ts; case 25: case 26: case 27: + case 87: case 86: - case 85: case 28: case 29: case 30: @@ -31361,18 +33660,18 @@ var ts; case 44: case 48: case 49: - case 62: - case 61: case 63: - case 58: + case 62: + case 64: case 59: case 60: - case 53: + case 61: case 54: case 55: case 56: case 57: - case 52: + case 58: + case 53: case 23: return true; default: @@ -31393,38 +33692,38 @@ var ts; } } function isKeyword(token) { - return token >= 65 && token <= 124; + return token >= 66 && token <= 125; } function classFromKind(token) { if (isKeyword(token)) { - return 1; + return TokenClass.Keyword; } else if (isBinaryExpressionOperatorToken(token) || isPrefixUnaryExpressionOperatorToken(token)) { - return 2; + return TokenClass.Operator; } - else if (token >= 14 && token <= 63) { - return 0; + else if (token >= 14 && token <= 64) { + return TokenClass.Punctuation; } switch (token) { case 7: - return 6; + return TokenClass.NumberLiteral; case 8: - return 7; + return TokenClass.StringLiteral; case 9: - return 8; + return TokenClass.RegExpLiteral; case 6: case 3: case 2: - return 3; + return TokenClass.Comment; case 5: case 4: - return 4; - case 64: + return TokenClass.Whitespace; + case 65: default: if (ts.isTemplateLiteralKind(token)) { - return 7; + return TokenClass.StringLiteral; } - return 5; + return TokenClass.Identifier; } } return { getClassificationsForLine: getClassificationsForLine }; @@ -31442,7 +33741,7 @@ var ts; getNodeConstructor: function (kind) { function Node() { } - var proto = kind === 221 ? new SourceFileObject() : new NodeObject(); + var proto = kind === 227 ? new SourceFileObject() : new NodeObject(); proto.kind = kind; proto.pos = 0; proto.end = 0; @@ -31458,6 +33757,9 @@ var ts; } initializeServices(); })(ts || (ts = {})); +// Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. +// See LICENSE.txt in the project root for complete license information. +/// var ts; (function (ts) { var BreakpointResolver; @@ -31496,98 +33798,101 @@ var ts; function spanInNode(node) { if (node) { if (ts.isExpression(node)) { - if (node.parent.kind === 179) { + if (node.parent.kind === 184) { return spanInPreviousNode(node); } - if (node.parent.kind === 181) { + if (node.parent.kind === 186) { return textSpan(node); } - if (node.parent.kind === 167 && node.parent.operatorToken.kind === 23) { + if (node.parent.kind === 169 && node.parent.operatorToken.kind === 23) { return textSpan(node); } - if (node.parent.kind == 161 && node.parent.body == node) { + if (node.parent.kind == 163 && node.parent.body == node) { return textSpan(node); } } switch (node.kind) { - case 175: + case 180: return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 193: - case 130: - case 129: - return spanInVariableDeclaration(node); - case 128: - return spanInParameterDeclaration(node); - case 195: + case 198: case 132: case 131: + return spanInVariableDeclaration(node); + case 129: + return spanInParameterDeclaration(node); + case 200: case 134: - case 135: case 133: - case 160: - case 161: + case 136: + case 137: + case 135: + case 162: + case 163: return spanInFunctionDeclaration(node); - case 174: + case 179: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } - case 201: + case 206: return spanInBlock(node); - case 217: + case 223: return spanInBlock(node.block); - case 177: - return textSpan(node.expression); - case 186: - return textSpan(node.getChildAt(0), node.expression); - case 180: - return textSpan(node, ts.findNextToken(node.expression, node)); - case 179: - return spanInNode(node.statement); - case 192: - return textSpan(node.getChildAt(0)); - case 178: - return textSpan(node, ts.findNextToken(node.expression, node)); - case 189: - return spanInNode(node.statement); - case 185: - case 184: - return textSpan(node.getChildAt(0), node.label); - case 181: - return spanInForStatement(node); 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, 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 214: - case 215: + case 193: + return textSpan(node, ts.findNextToken(node.expression, node)); + case 220: + case 221: return spanInNode(node.statements[0]); - case 191: + case 196: return spanInBlock(node.tryBlock); - case 190: + case 195: return textSpan(node, node.expression); - case 209: + case 214: + if (!node.expression) { + return undefined; + } return textSpan(node, node.expression); - case 203: + case 208: return textSpan(node, node.moduleReference); - case 204: + case 209: return textSpan(node, node.moduleSpecifier); - case 210: + case 215: return textSpan(node, node.moduleSpecifier); - case 200: + case 205: if (ts.getModuleInstanceState(node) !== 1) { return undefined; } - case 196: - case 199: - case 220: - case 155: - case 156: + case 201: + case 204: + case 226: + case 157: + case 158: return textSpan(node); - case 187: + case 192: return spanInNode(node.statement); - case 197: - case 198: + case 202: + case 203: return undefined; case 22: case 1: @@ -31607,17 +33912,17 @@ var ts; case 25: case 24: return spanInGreaterThanOrLessThanToken(node); - case 99: + case 100: return spanInWhileKeyword(node); - case 75: - case 67: - case 80: + case 76: + case 68: + case 81: return spanInNextNode(node); default: - if (node.parent.kind === 218 && node.parent.name === node) { + if (node.parent.kind === 224 && node.parent.name === node) { return spanInNode(node.parent.initializer); } - if (node.parent.kind === 158 && node.parent.type === node) { + if (node.parent.kind === 160 && node.parent.type === node) { return spanInNode(node.parent.expression); } if (ts.isFunctionLike(node.parent) && node.parent.type === node) { @@ -31627,12 +33932,12 @@ var ts; } } function spanInVariableDeclaration(variableDeclaration) { - if (variableDeclaration.parent.parent.kind === 182 || - variableDeclaration.parent.parent.kind === 183) { + if (variableDeclaration.parent.parent.kind === 187 || + variableDeclaration.parent.parent.kind === 188) { return spanInNode(variableDeclaration.parent.parent); } - var isParentVariableStatement = variableDeclaration.parent.parent.kind === 175; - var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 181 && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); + var isParentVariableStatement = variableDeclaration.parent.parent.kind === 180; + var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 186 && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); var declarations = isParentVariableStatement ? variableDeclaration.parent.parent.declarationList.declarations : isDeclarationOfForStatement @@ -31678,7 +33983,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return !!(functionDeclaration.flags & 1) || - (functionDeclaration.parent.kind === 196 && functionDeclaration.kind !== 133); + (functionDeclaration.parent.kind === 201 && functionDeclaration.kind !== 135); } function spanInFunctionDeclaration(functionDeclaration) { if (!functionDeclaration.body) { @@ -31698,23 +34003,23 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 200: + case 205: if (ts.getModuleInstanceState(block.parent) !== 1) { return undefined; } - case 180: - case 178: - case 182: + case 185: case 183: + case 187: + case 188: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); - case 181: + case 186: 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 === 194) { + if (forStatement.initializer.kind === 199) { var variableDeclarationList = forStatement.initializer; if (variableDeclarationList.declarations.length > 0) { return spanInNode(variableDeclarationList.declarations[0]); @@ -31733,34 +34038,34 @@ var ts; } function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 199: + case 204: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 196: + case 201: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 202: + case 207: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } return spanInNode(node.parent); } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 201: + case 206: if (ts.getModuleInstanceState(node.parent.parent) !== 1) { return undefined; } - case 199: - case 196: + case 204: + case 201: return textSpan(node); - case 174: + case 179: if (ts.isFunctionBlock(node.parent)) { return textSpan(node); } - case 217: + case 223: return spanInNode(node.parent.statements[node.parent.statements.length - 1]); ; - case 202: + case 207: var caseBlock = node.parent; var lastClause = caseBlock.clauses[caseBlock.clauses.length - 1]; if (lastClause) { @@ -31772,24 +34077,24 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 179) { + if (node.parent.kind === 184) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInCloseParenToken(node) { switch (node.parent.kind) { - case 160: - case 195: - case 161: - case 132: - case 131: + case 162: + case 200: + case 163: case 134: - case 135: case 133: - case 180: - case 179: - case 181: + case 136: + case 137: + case 135: + case 185: + case 184: + case 186: return spanInPreviousNode(node); default: return spanInNode(node.parent); @@ -31797,19 +34102,19 @@ var ts; return spanInNode(node.parent); } function spanInColonToken(node) { - if (ts.isFunctionLike(node.parent) || node.parent.kind === 218) { + if (ts.isFunctionLike(node.parent) || node.parent.kind === 224) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 158) { + if (node.parent.kind === 160) { return spanInNode(node.parent.expression); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 179) { + if (node.parent.kind === 184) { return textSpan(node, ts.findNextToken(node.parent.expression, node.parent)); } return spanInNode(node.parent); @@ -31819,6 +34124,21 @@ var ts; BreakpointResolver.spanInSourceFileAtLocation = spanInSourceFileAtLocation; })(BreakpointResolver = ts.BreakpointResolver || (ts.BreakpointResolver = {})); })(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 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/// var debugObjectHost = this; var ts; (function (ts) { @@ -32103,6 +34423,12 @@ var ts; return _this.languageService.getReferencesAtPosition(fileName, position); }); }; + LanguageServiceShimObject.prototype.findReferences = function (fileName, position) { + var _this = this; + return this.forwardJSONCall("findReferences('" + fileName + "', " + position + ")", function () { + return _this.languageService.findReferences(fileName, position); + }); + }; LanguageServiceShimObject.prototype.getOccurrencesAtPosition = function (fileName, position) { var _this = this; return this.forwardJSONCall("getOccurrencesAtPosition('" + fileName + "', " + position + ")", function () { @@ -32312,3 +34638,4 @@ var TypeScript; Services.TypeScriptServicesFactory = ts.TypeScriptServicesFactory; })(Services = TypeScript.Services || (TypeScript.Services = {})); })(TypeScript || (TypeScript = {})); +var toolsVersion = "1.4"; diff --git a/bin/typescriptServices_internal.d.ts b/bin/typescriptServices_internal.d.ts index 7fba731f25e..f0f86ebfe02 100644 --- a/bin/typescriptServices_internal.d.ts +++ b/bin/typescriptServices_internal.d.ts @@ -41,6 +41,10 @@ declare module ts { */ function lastOrUndefined(array: T[]): T; function binarySearch(array: number[], value: number): number; + function reduceLeft(array: T[], f: (a: T, x: T) => T): T; + function reduceLeft(array: T[], f: (a: U, x: T) => U, initial: U): U; + function reduceRight(array: T[], f: (a: T, x: T) => T): T; + function reduceRight(array: T[], f: (a: U, x: T) => U, initial: U): U; function hasProperty(map: Map, key: string): boolean; function getProperty(map: Map, key: string): T; function isEmpty(map: Map): boolean; @@ -49,7 +53,6 @@ declare module ts { function forEachValue(map: Map, callback: (value: T) => U): U; function forEachKey(map: Map, callback: (key: string) => U): U; function lookUp(map: Map, key: string): T; - function mapToArray(map: Map): T[]; function copyMap(source: Map, target: Map): void; /** * Creates a map from the elements of an array. @@ -184,7 +187,7 @@ declare module ts { function isConst(node: Node): boolean; function isLet(node: Node): boolean; function isPrologueDirective(node: Node): boolean; - function getLeadingCommentRangesOfNode(node: Node, sourceFileOfNode?: SourceFile): CommentRange[]; + function getLeadingCommentRangesOfNode(node: Node, sourceFileOfNode: SourceFile): CommentRange[]; function getJsDocComments(node: Node, sourceFileOfNode: SourceFile): CommentRange[]; let fullTripleSlashReferencePathRegEx: RegExp; function forEachReturnStatement(body: Block, visitor: (stmt: ReturnStatement) => T): T; @@ -195,6 +198,10 @@ declare module ts { function getThisContainer(node: Node, includeArrowFunctions: boolean): Node; function getSuperContainer(node: Node, includeFunctions: boolean): Node; function getInvokedExpression(node: CallLikeExpression): Expression; + function nodeCanBeDecorated(node: Node): boolean; + function nodeIsDecorated(node: Node): boolean; + function childIsDecorated(node: Node): boolean; + function nodeOrChildIsDecorated(node: Node): boolean; function isExpression(node: Node): boolean; function isInstantiatedModule(node: ModuleDeclaration, preserveConstEnums: boolean): boolean; function isExternalModuleImportEqualsDeclaration(node: Node): boolean; @@ -211,10 +218,12 @@ declare module ts { function isInAmbientContext(node: Node): boolean; function isDeclaration(node: Node): boolean; function isStatement(n: Node): boolean; + function isClassElement(n: Node): boolean; function isDeclarationName(name: Node): boolean; - function getClassBaseTypeNode(node: ClassDeclaration): TypeReferenceNode; - function getClassImplementedTypeNodes(node: ClassDeclaration): NodeArray; - function getInterfaceBaseTypeNodes(node: InterfaceDeclaration): NodeArray; + function isAliasSymbolDeclaration(node: Node): boolean; + function getClassExtendsHeritageClauseElement(node: ClassLikeDeclaration): HeritageClauseElement; + function getClassImplementsHeritageClauseElements(node: ClassDeclaration): NodeArray; + function getInterfaceBaseTypeNodes(node: InterfaceDeclaration): NodeArray; function getHeritageClause(clauses: NodeArray, kind: SyntaxKind): HeritageClause; function tryResolveScriptReference(host: ScriptReferenceHost, sourceFile: SourceFile, reference: FileReference): SourceFile; function getAncestor(node: Node, kind: SyntaxKind): Node; @@ -270,7 +279,6 @@ declare module ts { function nodeStartsNewLexicalEnvironment(n: Node): boolean; function nodeIsSynthesized(node: Node): boolean; function createSynthesizedNode(kind: SyntaxKind, startsOnNewLine?: boolean): Node; - function generateUniqueName(baseName: string, isExistingName: (name: string) => boolean): string; /** * Based heavily on the abstract 'Quote'/'QuoteJSONString' operation from ECMA-262 (24.3.2.2), * but augmented for a few select characters (e.g. lineSeparator, paragraphSeparator, nextLine) @@ -278,11 +286,54 @@ declare module ts { */ function escapeString(s: string): string; function escapeNonAsciiCharacters(s: string): string; + interface EmitTextWriter { + write(s: string): void; + writeTextOfNode(sourceFile: SourceFile, node: Node): void; + writeLine(): void; + increaseIndent(): void; + decreaseIndent(): void; + getText(): string; + rawWrite(s: string): void; + writeLiteral(s: string): void; + getTextPos(): number; + getLine(): number; + getColumn(): number; + getIndent(): number; + } + function getIndentString(level: number): string; + function getIndentSize(): number; + function createTextWriter(newLine: String): EmitTextWriter; + function getOwnEmitOutputFilePath(sourceFile: SourceFile, host: EmitHost, extension: string): string; + function getSourceFilePathInNewDir(sourceFile: SourceFile, host: EmitHost, newDirPath: string): string; + function writeFile(host: EmitHost, diagnostics: Diagnostic[], fileName: string, data: string, writeByteOrderMark: boolean): void; + function getLineOfLocalPosition(currentSourceFile: SourceFile, pos: number): number; + function getFirstConstructorWithBody(node: ClassLikeDeclaration): ConstructorDeclaration; + function shouldEmitToOwnFile(sourceFile: SourceFile, compilerOptions: CompilerOptions): boolean; + function getAllAccessorDeclarations(declarations: NodeArray, accessor: AccessorDeclaration): { + firstAccessor: AccessorDeclaration; + secondAccessor: AccessorDeclaration; + getAccessor: AccessorDeclaration; + setAccessor: AccessorDeclaration; + }; + function emitNewLineBeforeLeadingComments(currentSourceFile: SourceFile, writer: EmitTextWriter, node: TextRange, leadingComments: CommentRange[]): void; + function emitComments(currentSourceFile: SourceFile, writer: EmitTextWriter, comments: CommentRange[], trailingSeparator: boolean, newLine: string, writeComment: (currentSourceFile: SourceFile, writer: EmitTextWriter, comment: CommentRange, newLine: string) => void): void; + function writeCommentRange(currentSourceFile: SourceFile, writer: EmitTextWriter, comment: CommentRange, newLine: string): void; + function isSupportedHeritageClauseElement(node: HeritageClauseElement): boolean; + function isRightSideOfQualifiedNameOrPropertyAccess(node: Node): boolean; + function getLocalSymbolForExportDefault(symbol: Symbol): Symbol; } declare module ts { - var optionDeclarations: CommandLineOption[]; - function parseCommandLine(commandLine: string[]): ParsedCommandLine; + /** + * Read tsconfig.json file + * @param fileName The path to the config file + */ function readConfigFile(fileName: string): any; + /** + * 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; } declare module ts { @@ -297,7 +348,10 @@ declare module ts { function rangeContainsStartEnd(range: TextRange, start: number, end: number): boolean; function rangeOverlapsWithStartEnd(r1: TextRange, start: number, end: number): boolean; function startEndOverlapsWithStartEnd(start1: number, end1: number, start2: number, end2: number): boolean; + function positionBelongsToNode(candidate: Node, position: number, sourceFile: SourceFile): boolean; + function isCompletedNode(n: Node, sourceFile: SourceFile): boolean; function findListItemInfo(node: Node): ListItemInfo; + function hasChildOfKind(n: Node, kind: SyntaxKind, sourceFile?: SourceFile): boolean; function findChildOfKind(n: Node, kind: SyntaxKind, sourceFile?: SourceFile): Node; function findContainingList(node: Node): Node; function getTouchingWord(sourceFile: SourceFile, position: number): Node; @@ -320,9 +374,11 @@ declare module ts { function getNodeModifiers(node: Node): string; function getTypeArgumentOrTypeParameterList(node: Node): NodeArray; function isToken(n: Node): boolean; + function isWord(kind: SyntaxKind): boolean; function isComment(kind: SyntaxKind): boolean; function isPunctuation(kind: SyntaxKind): boolean; function isInsideTemplateLiteral(node: LiteralExpression, position: number): boolean; + function isAccessibilityModifier(kind: SyntaxKind): boolean; function compareDataObjects(dst: any, src: any): boolean; } declare module ts { @@ -333,6 +389,7 @@ declare module ts { function keywordPart(kind: SyntaxKind): SymbolDisplayPart; function punctuationPart(kind: SyntaxKind): SymbolDisplayPart; function operatorPart(kind: SyntaxKind): SymbolDisplayPart; + function textOrKeywordPart(text: string): SymbolDisplayPart; function textPart(text: string): SymbolDisplayPart; function lineBreakPart(): SymbolDisplayPart; function mapToDisplayParts(writeDisplayParts: (writer: DisplayPartsSymbolWriter) => void): SymbolDisplayPart[]; diff --git a/bin/typescript_internal.d.ts b/bin/typescript_internal.d.ts index 2d5973e5877..6fc997c62d5 100644 --- a/bin/typescript_internal.d.ts +++ b/bin/typescript_internal.d.ts @@ -41,6 +41,10 @@ declare module "typescript" { */ function lastOrUndefined(array: T[]): T; function binarySearch(array: number[], value: number): number; + function reduceLeft(array: T[], f: (a: T, x: T) => T): T; + function reduceLeft(array: T[], f: (a: U, x: T) => U, initial: U): U; + function reduceRight(array: T[], f: (a: T, x: T) => T): T; + function reduceRight(array: T[], f: (a: U, x: T) => U, initial: U): U; function hasProperty(map: Map, key: string): boolean; function getProperty(map: Map, key: string): T; function isEmpty(map: Map): boolean; @@ -49,7 +53,6 @@ declare module "typescript" { function forEachValue(map: Map, callback: (value: T) => U): U; function forEachKey(map: Map, callback: (key: string) => U): U; function lookUp(map: Map, key: string): T; - function mapToArray(map: Map): T[]; function copyMap(source: Map, target: Map): void; /** * Creates a map from the elements of an array. @@ -184,7 +187,7 @@ declare module "typescript" { function isConst(node: Node): boolean; function isLet(node: Node): boolean; function isPrologueDirective(node: Node): boolean; - function getLeadingCommentRangesOfNode(node: Node, sourceFileOfNode?: SourceFile): CommentRange[]; + function getLeadingCommentRangesOfNode(node: Node, sourceFileOfNode: SourceFile): CommentRange[]; function getJsDocComments(node: Node, sourceFileOfNode: SourceFile): CommentRange[]; let fullTripleSlashReferencePathRegEx: RegExp; function forEachReturnStatement(body: Block, visitor: (stmt: ReturnStatement) => T): T; @@ -195,6 +198,10 @@ declare module "typescript" { function getThisContainer(node: Node, includeArrowFunctions: boolean): Node; function getSuperContainer(node: Node, includeFunctions: boolean): Node; function getInvokedExpression(node: CallLikeExpression): Expression; + function nodeCanBeDecorated(node: Node): boolean; + function nodeIsDecorated(node: Node): boolean; + function childIsDecorated(node: Node): boolean; + function nodeOrChildIsDecorated(node: Node): boolean; function isExpression(node: Node): boolean; function isInstantiatedModule(node: ModuleDeclaration, preserveConstEnums: boolean): boolean; function isExternalModuleImportEqualsDeclaration(node: Node): boolean; @@ -211,10 +218,12 @@ declare module "typescript" { function isInAmbientContext(node: Node): boolean; function isDeclaration(node: Node): boolean; function isStatement(n: Node): boolean; + function isClassElement(n: Node): boolean; function isDeclarationName(name: Node): boolean; - function getClassBaseTypeNode(node: ClassDeclaration): TypeReferenceNode; - function getClassImplementedTypeNodes(node: ClassDeclaration): NodeArray; - function getInterfaceBaseTypeNodes(node: InterfaceDeclaration): NodeArray; + function isAliasSymbolDeclaration(node: Node): boolean; + function getClassExtendsHeritageClauseElement(node: ClassLikeDeclaration): HeritageClauseElement; + function getClassImplementsHeritageClauseElements(node: ClassDeclaration): NodeArray; + function getInterfaceBaseTypeNodes(node: InterfaceDeclaration): NodeArray; function getHeritageClause(clauses: NodeArray, kind: SyntaxKind): HeritageClause; function tryResolveScriptReference(host: ScriptReferenceHost, sourceFile: SourceFile, reference: FileReference): SourceFile; function getAncestor(node: Node, kind: SyntaxKind): Node; @@ -270,7 +279,6 @@ declare module "typescript" { function nodeStartsNewLexicalEnvironment(n: Node): boolean; function nodeIsSynthesized(node: Node): boolean; function createSynthesizedNode(kind: SyntaxKind, startsOnNewLine?: boolean): Node; - function generateUniqueName(baseName: string, isExistingName: (name: string) => boolean): string; /** * Based heavily on the abstract 'Quote'/'QuoteJSONString' operation from ECMA-262 (24.3.2.2), * but augmented for a few select characters (e.g. lineSeparator, paragraphSeparator, nextLine) @@ -278,11 +286,54 @@ declare module "typescript" { */ function escapeString(s: string): string; function escapeNonAsciiCharacters(s: string): string; + interface EmitTextWriter { + write(s: string): void; + writeTextOfNode(sourceFile: SourceFile, node: Node): void; + writeLine(): void; + increaseIndent(): void; + decreaseIndent(): void; + getText(): string; + rawWrite(s: string): void; + writeLiteral(s: string): void; + getTextPos(): number; + getLine(): number; + getColumn(): number; + getIndent(): number; + } + function getIndentString(level: number): string; + function getIndentSize(): number; + function createTextWriter(newLine: String): EmitTextWriter; + function getOwnEmitOutputFilePath(sourceFile: SourceFile, host: EmitHost, extension: string): string; + function getSourceFilePathInNewDir(sourceFile: SourceFile, host: EmitHost, newDirPath: string): string; + function writeFile(host: EmitHost, diagnostics: Diagnostic[], fileName: string, data: string, writeByteOrderMark: boolean): void; + function getLineOfLocalPosition(currentSourceFile: SourceFile, pos: number): number; + function getFirstConstructorWithBody(node: ClassLikeDeclaration): ConstructorDeclaration; + function shouldEmitToOwnFile(sourceFile: SourceFile, compilerOptions: CompilerOptions): boolean; + function getAllAccessorDeclarations(declarations: NodeArray, accessor: AccessorDeclaration): { + firstAccessor: AccessorDeclaration; + secondAccessor: AccessorDeclaration; + getAccessor: AccessorDeclaration; + setAccessor: AccessorDeclaration; + }; + function emitNewLineBeforeLeadingComments(currentSourceFile: SourceFile, writer: EmitTextWriter, node: TextRange, leadingComments: CommentRange[]): void; + function emitComments(currentSourceFile: SourceFile, writer: EmitTextWriter, comments: CommentRange[], trailingSeparator: boolean, newLine: string, writeComment: (currentSourceFile: SourceFile, writer: EmitTextWriter, comment: CommentRange, newLine: string) => void): void; + function writeCommentRange(currentSourceFile: SourceFile, writer: EmitTextWriter, comment: CommentRange, newLine: string): void; + function isSupportedHeritageClauseElement(node: HeritageClauseElement): boolean; + function isRightSideOfQualifiedNameOrPropertyAccess(node: Node): boolean; + function getLocalSymbolForExportDefault(symbol: Symbol): Symbol; } declare module "typescript" { - var optionDeclarations: CommandLineOption[]; - function parseCommandLine(commandLine: string[]): ParsedCommandLine; + /** + * Read tsconfig.json file + * @param fileName The path to the config file + */ function readConfigFile(fileName: string): any; + /** + * 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; } declare module "typescript" { @@ -297,7 +348,10 @@ declare module "typescript" { function rangeContainsStartEnd(range: TextRange, start: number, end: number): boolean; function rangeOverlapsWithStartEnd(r1: TextRange, start: number, end: number): boolean; function startEndOverlapsWithStartEnd(start1: number, end1: number, start2: number, end2: number): boolean; + function positionBelongsToNode(candidate: Node, position: number, sourceFile: SourceFile): boolean; + function isCompletedNode(n: Node, sourceFile: SourceFile): boolean; function findListItemInfo(node: Node): ListItemInfo; + function hasChildOfKind(n: Node, kind: SyntaxKind, sourceFile?: SourceFile): boolean; function findChildOfKind(n: Node, kind: SyntaxKind, sourceFile?: SourceFile): Node; function findContainingList(node: Node): Node; function getTouchingWord(sourceFile: SourceFile, position: number): Node; @@ -320,9 +374,11 @@ declare module "typescript" { function getNodeModifiers(node: Node): string; function getTypeArgumentOrTypeParameterList(node: Node): NodeArray; function isToken(n: Node): boolean; + function isWord(kind: SyntaxKind): boolean; function isComment(kind: SyntaxKind): boolean; function isPunctuation(kind: SyntaxKind): boolean; function isInsideTemplateLiteral(node: LiteralExpression, position: number): boolean; + function isAccessibilityModifier(kind: SyntaxKind): boolean; function compareDataObjects(dst: any, src: any): boolean; } declare module "typescript" { @@ -333,6 +389,7 @@ declare module "typescript" { function keywordPart(kind: SyntaxKind): SymbolDisplayPart; function punctuationPart(kind: SyntaxKind): SymbolDisplayPart; function operatorPart(kind: SyntaxKind): SymbolDisplayPart; + function textOrKeywordPart(text: string): SymbolDisplayPart; function textPart(text: string): SymbolDisplayPart; function lineBreakPart(): SymbolDisplayPart; function mapToDisplayParts(writeDisplayParts: (writer: DisplayPartsSymbolWriter) => void): SymbolDisplayPart[]; diff --git a/doc/TypeScript Language Specification (Change Markup).docx b/doc/TypeScript Language Specification (Change Markup).docx index bc996cae590..fd2688234c3 100644 Binary files a/doc/TypeScript Language Specification (Change Markup).docx and b/doc/TypeScript Language Specification (Change Markup).docx differ diff --git a/doc/TypeScript Language Specification.docx b/doc/TypeScript Language Specification.docx index 6858fa905df..62604fa5bc4 100644 Binary files a/doc/TypeScript Language Specification.docx and b/doc/TypeScript Language Specification.docx differ diff --git a/doc/spec.md b/doc/spec.md index 66a622d9e73..cff436d5fc0 100644 --- a/doc/spec.md +++ b/doc/spec.md @@ -545,7 +545,7 @@ class CheckingAccount extends BankAccount { } ``` -In this example, the class 'CheckingAccount' *derives* from class 'BankAccount'. The constructor for 'CheckingAccount' calls the constructor for class 'BankAccount' using the 'super' keyword. In the emitted JavaScript code, the prototype of 'CheckingAccount' will chain to the prototype of 'BankingAccount'. +In this example, the class 'CheckingAccount' *derives* from class 'BankAccount'. The constructor for 'CheckingAccount' calls the constructor for class 'BankAccount' using the 'super' keyword. In the emitted JavaScript code, the prototype of 'CheckingAccount' will chain to the prototype of 'BankAccount'. TypeScript classes may also specify static members. Static class members become properties of the class constructor. diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 304777e0401..494570c85c1 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -168,7 +168,7 @@ module ts { addDeclarationToSymbol(symbol, node, includes); symbol.parent = parent; - if (node.kind === SyntaxKind.ClassDeclaration && symbol.exports) { + if ((node.kind === SyntaxKind.ClassDeclaration || node.kind === SyntaxKind.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. @@ -286,6 +286,7 @@ module ts { case SyntaxKind.ArrowFunction: declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); break; + case SyntaxKind.ClassExpression: case SyntaxKind.ClassDeclaration: if (node.flags & NodeFlags.Static) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); @@ -387,23 +388,28 @@ module ts { bindChildren(node, /*symbolKind:*/ 0, /*isBlockScopeContainer:*/ true); } - function bindBlockScopedVariableDeclaration(node: Declaration) { + function bindBlockScopedDeclaration(node: Declaration, symbolKind: SymbolFlags, symbolExcludes: SymbolFlags) { switch (blockScopeContainer.kind) { case SyntaxKind.ModuleDeclaration: - declareModuleMember(node, SymbolFlags.BlockScopedVariable, SymbolFlags.BlockScopedVariableExcludes); + declareModuleMember(node, symbolKind, symbolExcludes); break; case SyntaxKind.SourceFile: if (isExternalModule(container)) { - declareModuleMember(node, SymbolFlags.BlockScopedVariable, SymbolFlags.BlockScopedVariableExcludes); + declareModuleMember(node, symbolKind, symbolExcludes); break; } + // fall through. default: if (!blockScopeContainer.locals) { blockScopeContainer.locals = {}; } - declareSymbol(blockScopeContainer.locals, undefined, node, SymbolFlags.BlockScopedVariable, SymbolFlags.BlockScopedVariableExcludes); + declareSymbol(blockScopeContainer.locals, undefined, node, symbolKind, symbolExcludes); } - bindChildren(node, SymbolFlags.BlockScopedVariable, /*isBlockScopeContainer*/ false); + bindChildren(node, symbolKind, /*isBlockScopeContainer*/ false); + } + + function bindBlockScopedVariableDeclaration(node: Declaration) { + bindBlockScopedDeclaration(node, SymbolFlags.BlockScopedVariable, SymbolFlags.BlockScopedVariableExcludes); } function getDestructuringParameterName(node: Declaration) { @@ -485,11 +491,14 @@ module ts { case SyntaxKind.ArrowFunction: bindAnonymousDeclaration(node, SymbolFlags.Function, "__function", /*isBlockScopeContainer*/ true); break; + case SyntaxKind.ClassExpression: + bindAnonymousDeclaration(node, SymbolFlags.Class, "__class", /*isBlockScopeContainer*/ false); + break; case SyntaxKind.CatchClause: bindCatchVariableDeclaration(node); break; case SyntaxKind.ClassDeclaration: - bindDeclaration(node, SymbolFlags.Class, SymbolFlags.ClassExcludes, /*isBlockScopeContainer*/ false); + bindBlockScopedDeclaration(node, SymbolFlags.Class, SymbolFlags.ClassExcludes); break; case SyntaxKind.InterfaceDeclaration: bindDeclaration(node, SymbolFlags.Interface, SymbolFlags.InterfaceExcludes, /*isBlockScopeContainer*/ false); @@ -584,9 +593,9 @@ module ts { // containing class. if (node.flags & NodeFlags.AccessibilityModifier && node.parent.kind === SyntaxKind.Constructor && - node.parent.parent.kind === SyntaxKind.ClassDeclaration) { + (node.parent.parent.kind === SyntaxKind.ClassDeclaration || node.parent.parent.kind === SyntaxKind.ClassExpression)) { - let classDeclaration = node.parent.parent; + let classDeclaration = node.parent.parent; declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, SymbolFlags.Property, SymbolFlags.PropertyExcludes); } } diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 677361c196a..ea38a8f4b31 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -74,7 +74,7 @@ module ts { isImplementationOfOverload, getAliasedSymbol: resolveAlias, getEmitResolver, - getExportsOfExternalModule, + getExportsOfModule: getExportsOfModuleAsArray, }; let unknownSymbol = createSymbol(SymbolFlags.Property | SymbolFlags.Transient, "unknown"); @@ -126,6 +126,7 @@ module ts { let stringLiteralTypes: Map = {}; let emitExtends = false; let emitDecorate = false; + let emitParam = false; let mergedSymbols: Symbol[] = []; let symbolLinks: SymbolLinks[] = []; @@ -349,6 +350,14 @@ module ts { } result = undefined; } + else if (location.kind === SyntaxKind.SourceFile) { + result = getSymbol(getSymbolOfNode(location).exports, "default", meaning & SymbolFlags.ModuleMember); + let localSymbol = getLocalSymbolForExportDefault(result); + if (result && (result.flags & meaning) && localSymbol && localSymbol.name === name) { + break loop; + } + result = undefined; + } break; case SyntaxKind.EnumDeclaration: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & SymbolFlags.EnumMember)) { @@ -422,8 +431,15 @@ module ts { result = argumentsSymbol; break loop; } - let id = (location).name; - if (id && name === id.text) { + let functionName = (location).name; + if (functionName && name === functionName.text) { + result = location.symbol; + break loop; + } + break; + case SyntaxKind.ClassExpression: + let className = (location).name; + if (className && name === className.text) { result = location.symbol; break loop; } @@ -582,7 +598,7 @@ module ts { if (moduleSymbol.flags & SymbolFlags.Variable) { let typeAnnotation = (moduleSymbol.valueDeclaration).type; if (typeAnnotation) { - return getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name); + return getPropertyOfType(getTypeFromTypeNodeOrHeritageClauseElement(typeAnnotation), name); } } } @@ -631,7 +647,7 @@ module ts { if (symbol.flags & SymbolFlags.Variable) { var typeAnnotation = (symbol.valueDeclaration).type; if (typeAnnotation) { - return resolveSymbol(getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name)); + return resolveSymbol(getPropertyOfType(getTypeFromTypeNodeOrHeritageClauseElement(typeAnnotation), name)); } } } @@ -713,8 +729,14 @@ module ts { function markExportAsReferenced(node: ImportEqualsDeclaration | ExportAssignment | ExportSpecifier) { let symbol = getSymbolOfNode(node); let target = resolveAlias(symbol); - if (target && target !== unknownSymbol && target.flags & SymbolFlags.Value && !isConstEnumOrConstEnumOnlyModule(target)) { - markAliasSymbolAsReferenced(symbol); + if (target) { + let markAlias = + (target === unknownSymbol && compilerOptions.separateCompilation) || + (target !== unknownSymbol && (target.flags & SymbolFlags.Value) && !isConstEnumOrConstEnumOnlyModule(target)); + + if (markAlias) { + markAliasSymbolAsReferenced(symbol); + } } } @@ -773,8 +795,8 @@ module ts { } // Resolves a qualified name and any involved aliases - function resolveEntityName(name: EntityName, meaning: SymbolFlags): Symbol { - if (getFullWidth(name) === 0) { + function resolveEntityName(name: EntityName | Expression, meaning: SymbolFlags): Symbol { + if (nodeIsMissing(name)) { return undefined; } @@ -785,18 +807,23 @@ module ts { return undefined; } } - else if (name.kind === SyntaxKind.QualifiedName) { - let namespace = resolveEntityName((name).left, SymbolFlags.Namespace); - if (!namespace || namespace === unknownSymbol || getFullWidth((name).right) === 0) { + else if (name.kind === SyntaxKind.QualifiedName || name.kind === SyntaxKind.PropertyAccessExpression) { + let left = name.kind === SyntaxKind.QualifiedName ? (name).left : (name).expression; + let right = name.kind === SyntaxKind.QualifiedName ? (name).right : (name).name; + + let namespace = resolveEntityName(left, SymbolFlags.Namespace); + if (!namespace || namespace === unknownSymbol || nodeIsMissing(right)) { return undefined; } - let right = (name).right; symbol = getSymbol(getExportsOfSymbol(namespace), right.text, meaning); if (!symbol) { error(right, Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), declarationNameToString(right)); return undefined; } } + else { + Debug.fail("Unknown entity name kind."); + } Debug.assert((symbol.flags & SymbolFlags.Instantiated) === 0, "Should never get an instantiated symbol here."); return symbol.flags & meaning ? symbol : resolveAlias(symbol); } @@ -872,6 +899,10 @@ module ts { return moduleSymbol.exports["export="]; } + function getExportsOfModuleAsArray(moduleSymbol: Symbol): Symbol[] { + return symbolsToArray(getExportsOfModule(moduleSymbol)); + } + function getExportsOfSymbol(symbol: Symbol): SymbolTable { return symbol.flags & SymbolFlags.Module ? getExportsOfModule(symbol) : symbol.exports || emptySymbols; } @@ -898,7 +929,7 @@ module ts { // The ES6 spec permits export * declarations in a module to circularly reference the module itself. For example, // module 'a' can 'export * from "b"' and 'b' can 'export * from "a"' without error. function visit(symbol: Symbol) { - if (symbol.flags & SymbolFlags.HasExports && !contains(visitedSymbols, symbol)) { + if (symbol && symbol.flags & SymbolFlags.HasExports && !contains(visitedSymbols, symbol)) { visitedSymbols.push(symbol); if (symbol !== moduleSymbol) { if (!result) { @@ -1091,7 +1122,7 @@ module ts { // Check if symbol is any of the alias return forEachValue(symbols, symbolFromSymbolTable => { - if (symbolFromSymbolTable.flags & SymbolFlags.Alias) { + if (symbolFromSymbolTable.flags & SymbolFlags.Alias && symbolFromSymbolTable.name !== "export=") { if (!useOnlyExternalAliasing || // We can use any type of alias to get the name // Is this external alias, then use it to name ts.forEach(symbolFromSymbolTable.declarations, isExternalModuleImportEqualsDeclaration)) { @@ -1255,14 +1286,14 @@ module ts { } } - function isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult { + function isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult { // get symbol of the first identifier of the entityName let meaning: SymbolFlags; if (entityName.parent.kind === SyntaxKind.TypeQuery) { // Typeof value meaning = SymbolFlags.Value | SymbolFlags.ExportValue; } - else if (entityName.kind === SyntaxKind.QualifiedName || + else if (entityName.kind === SyntaxKind.QualifiedName || entityName.kind === SyntaxKind.PropertyAccessExpression || entityName.parent.kind === SyntaxKind.ImportEqualsDeclaration) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration @@ -1932,6 +1963,10 @@ module ts { case SyntaxKind.SourceFile: return true; + // Export assignements do not create name bindings outside the module + case SyntaxKind.ExportAssignment: + return false; + default: Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); } @@ -2093,7 +2128,7 @@ module ts { } // Use type from type annotation if one is present if (declaration.type) { - return getTypeFromTypeNode(declaration.type); + return getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); } if (declaration.kind === SyntaxKind.Parameter) { let func = declaration.parent; @@ -2257,7 +2292,7 @@ module ts { return links.type = checkExpression(exportAssignment.expression); } else if (exportAssignment.type) { - return links.type = getTypeFromTypeNode(exportAssignment.type); + return links.type = getTypeFromTypeNodeOrHeritageClauseElement(exportAssignment.type); } else { return links.type = anyType; @@ -2289,11 +2324,11 @@ module ts { function getAnnotatedAccessorType(accessor: AccessorDeclaration): Type { if (accessor) { if (accessor.kind === SyntaxKind.GetAccessor) { - return accessor.type && getTypeFromTypeNode(accessor.type); + return accessor.type && getTypeFromTypeNodeOrHeritageClauseElement(accessor.type); } else { let setterTypeAnnotation = getSetAccessorTypeAnnotationNode(accessor); - return setterTypeAnnotation && getTypeFromTypeNode(setterTypeAnnotation); + return setterTypeAnnotation && getTypeFromTypeNodeOrHeritageClauseElement(setterTypeAnnotation); } } return undefined; @@ -2459,9 +2494,9 @@ module ts { } type.baseTypes = []; let declaration = getDeclarationOfKind(symbol, SyntaxKind.ClassDeclaration); - let baseTypeNode = getClassBaseTypeNode(declaration); + let baseTypeNode = getClassExtendsHeritageClauseElement(declaration); if (baseTypeNode) { - let baseType = getTypeFromTypeReferenceNode(baseTypeNode); + let baseType = getTypeFromHeritageClauseElement(baseTypeNode); if (baseType !== unknownType) { if (getTargetType(baseType).flags & TypeFlags.Class) { if (type !== baseType && !hasBaseType(baseType, type)) { @@ -2502,7 +2537,8 @@ module ts { forEach(symbol.declarations, declaration => { if (declaration.kind === SyntaxKind.InterfaceDeclaration && getInterfaceBaseTypeNodes(declaration)) { forEach(getInterfaceBaseTypeNodes(declaration), node => { - let baseType = getTypeFromTypeReferenceNode(node); + let baseType = getTypeFromHeritageClauseElement(node); + if (baseType !== unknownType) { if (getTargetType(baseType).flags & (TypeFlags.Class | TypeFlags.Interface)) { if (type !== baseType && !hasBaseType(baseType, type)) { @@ -2533,7 +2569,7 @@ module ts { if (!links.declaredType) { links.declaredType = resolvingType; let declaration = getDeclarationOfKind(symbol, SyntaxKind.TypeAliasDeclaration); - let type = getTypeFromTypeNode(declaration.type); + let type = getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); if (links.declaredType === resolvingType) { links.declaredType = type; } @@ -2997,6 +3033,16 @@ module ts { return getSignaturesOfObjectOrUnionType(getApparentType(type), kind); } + function typeHasCallOrConstructSignatures(type: Type): boolean { + let apparentType = getApparentType(type); + if (apparentType.flags & (TypeFlags.ObjectType | TypeFlags.Union)) { + let resolved = resolveObjectOrUnionTypeMembers(type); + return resolved.callSignatures.length > 0 + || resolved.constructSignatures.length > 0; + } + return false; + } + function getIndexTypeOfObjectOrUnionType(type: Type, kind: IndexKind): Type { if (type.flags & (TypeFlags.ObjectType | TypeFlags.Union)) { let resolved = resolveObjectOrUnionTypeMembers(type); @@ -3033,17 +3079,6 @@ module ts { return result; } - function getExportsOfExternalModule(node: ImportDeclaration): Symbol[] { - if (!node.moduleSpecifier) { - return emptyArray; - } - let module = resolveExternalModuleName(node, node.moduleSpecifier); - if (!module) { - return emptyArray; - } - return symbolsToArray(getExportsOfModule(module)); - } - function getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature { let links = getNodeLinks(declaration); if (!links.resolvedSignature) { @@ -3075,7 +3110,7 @@ module ts { returnType = classType; } else if (declaration.type) { - returnType = getTypeFromTypeNode(declaration.type); + returnType = getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); } else { // TypeScript 1.0 spec (April 2014): @@ -3233,7 +3268,7 @@ module ts { function getIndexTypeOfSymbol(symbol: Symbol, kind: IndexKind): Type { let declaration = getIndexDeclarationOfSymbol(symbol, kind); return declaration - ? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType + ? declaration.type ? getTypeFromTypeNodeOrHeritageClauseElement(declaration.type) : anyType : undefined; } @@ -3244,7 +3279,7 @@ module ts { type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNode((getDeclarationOfKind(type.symbol, SyntaxKind.TypeParameter)).constraint); + type.constraint = getTypeFromTypeNodeOrHeritageClauseElement((getDeclarationOfKind(type.symbol, SyntaxKind.TypeParameter)).constraint); } } return type.constraint === noConstraintType ? undefined : type.constraint; @@ -3292,7 +3327,7 @@ module ts { return type; } - function isTypeParameterReferenceIllegalInConstraint(typeReferenceNode: TypeReferenceNode, typeParameterSymbol: Symbol): boolean { + function isTypeParameterReferenceIllegalInConstraint(typeReferenceNode: TypeReferenceNode | HeritageClauseElement, typeParameterSymbol: Symbol): boolean { let links = getNodeLinks(typeReferenceNode); if (links.isIllegalTypeReferenceInConstraint !== undefined) { return links.isIllegalTypeReferenceInConstraint; @@ -3341,39 +3376,57 @@ module ts { } } - function getTypeFromTypeReferenceNode(node: TypeReferenceNode): Type { + function getTypeFromTypeReference(node: TypeReferenceNode): Type { + return getTypeFromTypeReferenceOrHeritageClauseElement(node); + } + + function getTypeFromHeritageClauseElement(node: HeritageClauseElement): Type { + return getTypeFromTypeReferenceOrHeritageClauseElement(node); + } + + function getTypeFromTypeReferenceOrHeritageClauseElement(node: TypeReferenceNode | HeritageClauseElement): Type { let links = getNodeLinks(node); if (!links.resolvedType) { - let symbol = resolveEntityName(node.typeName, SymbolFlags.Type); let type: Type; - if (symbol) { - if ((symbol.flags & SymbolFlags.TypeParameter) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { - // TypeScript 1.0 spec (April 2014): 3.4.1 - // Type parameters declared in a particular type parameter list - // may not be referenced in constraints in that type parameter list - // Implementation: such type references are resolved to 'unknown' type that usually denotes error - type = unknownType; - } - else { - type = getDeclaredTypeOfSymbol(symbol); - if (type.flags & (TypeFlags.Class | TypeFlags.Interface) && type.flags & TypeFlags.Reference) { - let typeParameters = (type).typeParameters; - if (node.typeArguments && node.typeArguments.length === typeParameters.length) { - type = createTypeReference(type, map(node.typeArguments, getTypeFromTypeNode)); - } - else { - error(node, Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, /*enclosingDeclaration*/ undefined, TypeFormatFlags.WriteArrayAsGenericType), typeParameters.length); - type = undefined; - } + + // 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)) { + let typeNameOrExpression = node.kind === SyntaxKind.TypeReference + ? (node).typeName + : (node).expression; + + let symbol = resolveEntityName(typeNameOrExpression, SymbolFlags.Type); + if (symbol) { + if ((symbol.flags & SymbolFlags.TypeParameter) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { + // TypeScript 1.0 spec (April 2014): 3.4.1 + // Type parameters declared in a particular type parameter list + // may not be referenced in constraints in that type parameter list + // Implementation: such type references are resolved to 'unknown' type that usually denotes error + type = unknownType; } else { - if (node.typeArguments) { - error(node, Diagnostics.Type_0_is_not_generic, typeToString(type)); - type = undefined; + type = getDeclaredTypeOfSymbol(symbol); + if (type.flags & (TypeFlags.Class | TypeFlags.Interface) && type.flags & TypeFlags.Reference) { + let typeParameters = (type).typeParameters; + if (node.typeArguments && node.typeArguments.length === typeParameters.length) { + type = createTypeReference(type, map(node.typeArguments, getTypeFromTypeNodeOrHeritageClauseElement)); + } + else { + error(node, Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, /*enclosingDeclaration*/ undefined, TypeFormatFlags.WriteArrayAsGenericType), typeParameters.length); + type = undefined; + } + } + else { + if (node.typeArguments) { + error(node, Diagnostics.Type_0_is_not_generic, typeToString(type)); + type = undefined; + } } } } } + links.resolvedType = type || unknownType; } return links.resolvedType; @@ -3455,7 +3508,7 @@ module ts { function getTypeFromArrayTypeNode(node: ArrayTypeNode): Type { let links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = createArrayType(getTypeFromTypeNode(node.elementType)); + links.resolvedType = createArrayType(getTypeFromTypeNodeOrHeritageClauseElement(node.elementType)); } return links.resolvedType; } @@ -3473,7 +3526,7 @@ module ts { function getTypeFromTupleTypeNode(node: TupleTypeNode): Type { let links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = createTupleType(map(node.elementTypes, getTypeFromTypeNode)); + links.resolvedType = createTupleType(map(node.elementTypes, getTypeFromTypeNodeOrHeritageClauseElement)); } return links.resolvedType; } @@ -3569,7 +3622,7 @@ module ts { function getTypeFromUnionTypeNode(node: UnionTypeNode): Type { let links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = getUnionType(map(node.types, getTypeFromTypeNode), /*noSubtypeReduction*/ true); + links.resolvedType = getUnionType(map(node.types, getTypeFromTypeNodeOrHeritageClauseElement), /*noSubtypeReduction*/ true); } return links.resolvedType; } @@ -3601,7 +3654,7 @@ module ts { return links.resolvedType; } - function getTypeFromTypeNode(node: TypeNode | LiteralExpression): Type { + function getTypeFromTypeNodeOrHeritageClauseElement(node: TypeNode | LiteralExpression | HeritageClauseElement): Type { switch (node.kind) { case SyntaxKind.AnyKeyword: return anyType; @@ -3618,7 +3671,9 @@ module ts { case SyntaxKind.StringLiteral: return getTypeFromStringLiteral(node); case SyntaxKind.TypeReference: - return getTypeFromTypeReferenceNode(node); + return getTypeFromTypeReference(node); + case SyntaxKind.HeritageClauseElement: + return getTypeFromHeritageClauseElement(node); case SyntaxKind.TypeQuery: return getTypeFromTypeQueryNode(node); case SyntaxKind.ArrayType: @@ -3628,7 +3683,7 @@ module ts { case SyntaxKind.UnionType: return getTypeFromUnionTypeNode(node); case SyntaxKind.ParenthesizedType: - return getTypeFromTypeNode((node).type); + return getTypeFromTypeNodeOrHeritageClauseElement((node).type); case SyntaxKind.FunctionType: case SyntaxKind.ConstructorType: case SyntaxKind.TypeLiteral: @@ -4991,7 +5046,7 @@ module ts { function getResolvedSymbol(node: Identifier): Symbol { let links = getNodeLinks(node); if (!links.resolvedSymbol) { - links.resolvedSymbol = (getFullWidth(node) > 0 && resolveName(node, node.text, SymbolFlags.Value | SymbolFlags.ExportValue, Diagnostics.Cannot_find_name_0, node)) || unknownSymbol; + links.resolvedSymbol = (!nodeIsMissing(node) && resolveName(node, node.text, SymbolFlags.Value | SymbolFlags.ExportValue, Diagnostics.Cannot_find_name_0, node)) || unknownSymbol; } return links.resolvedSymbol; } @@ -5497,7 +5552,7 @@ module ts { let isCallExpression = node.parent.kind === SyntaxKind.CallExpression && (node.parent).expression === node; let enclosingClass = getAncestor(node, SyntaxKind.ClassDeclaration); let baseClass: Type; - if (enclosingClass && getClassBaseTypeNode(enclosingClass)) { + if (enclosingClass && getClassExtendsHeritageClauseElement(enclosingClass)) { let classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); baseClass = classType.baseTypes.length && classType.baseTypes[0]; } @@ -5581,7 +5636,7 @@ module ts { } } - if (container.kind === SyntaxKind.ComputedPropertyName) { + if (container && container.kind === SyntaxKind.ComputedPropertyName) { error(node, Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { @@ -5629,7 +5684,7 @@ module ts { let declaration = node.parent; if (node === declaration.initializer) { if (declaration.type) { - return getTypeFromTypeNode(declaration.type); + return getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); } if (declaration.kind === SyntaxKind.Parameter) { let type = getContextuallyTypedParameterType(declaration); @@ -5832,7 +5887,7 @@ module ts { case SyntaxKind.NewExpression: return getContextualTypeForArgument(parent, node); case SyntaxKind.TypeAssertionExpression: - return getTypeFromTypeNode((parent).type); + return getTypeFromTypeNodeOrHeritageClauseElement((parent).type); case SyntaxKind.BinaryExpression: return getContextualTypeForBinaryOperand(node); case SyntaxKind.PropertyAssignment: @@ -6486,7 +6541,7 @@ module ts { let templateExpression = tagExpression.template; let lastSpan = lastOrUndefined(templateExpression.templateSpans); Debug.assert(lastSpan !== undefined); // we should always have at least one span. - callIsIncomplete = getFullWidth(lastSpan.literal) === 0 || !!lastSpan.literal.isUnterminated; + callIsIncomplete = nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated; } else { // If the template didn't end in a backtick, or its beginning occurred right prior to EOF, @@ -6630,7 +6685,7 @@ module ts { let typeArgumentsAreAssignable = true; for (let i = 0; i < typeParameters.length; i++) { let typeArgNode = typeArguments[i]; - let typeArgument = getTypeFromTypeNode(typeArgNode); + let typeArgument = getTypeFromTypeNodeOrHeritageClauseElement(typeArgNode); // Do not push on this array! It has a preallocated length typeArgumentResultTypes[i] = typeArgument; if (typeArgumentsAreAssignable /* so far */) { @@ -6704,7 +6759,7 @@ module ts { function getEffectiveTypeArguments(callExpression: CallExpression): TypeNode[] { if (callExpression.expression.kind === SyntaxKind.SuperKeyword) { let containingClass = getAncestor(callExpression, SyntaxKind.ClassDeclaration); - let baseClassTypeNode = containingClass && getClassBaseTypeNode(containingClass); + let baseClassTypeNode = containingClass && getClassExtendsHeritageClauseElement(containingClass); return baseClassTypeNode && baseClassTypeNode.typeArguments; } else { @@ -7112,7 +7167,7 @@ module ts { function checkTypeAssertion(node: TypeAssertion): Type { let exprType = checkExpression(node.expression); - let targetType = getTypeFromTypeNode(node.type); + let targetType = getTypeFromTypeNodeOrHeritageClauseElement(node.type); if (produceDiagnostics && targetType !== unknownType) { let widenedType = getWidenedType(exprType); if (!(isTypeAssignableTo(targetType, widenedType))) { @@ -7286,7 +7341,7 @@ module ts { function checkFunctionExpressionOrObjectLiteralMethodBody(node: FunctionExpression | MethodDeclaration) { Debug.assert(node.kind !== SyntaxKind.MethodDeclaration || isObjectLiteralMethod(node)); if (node.type) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); + checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type)); } if (node.body) { @@ -7296,7 +7351,7 @@ module ts { else { let exprType = checkExpression(node.body); if (node.type) { - checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, /*headMessage*/ undefined); + checkTypeAssignableTo(exprType, getTypeFromTypeNodeOrHeritageClauseElement(node.type), node.body, /*headMessage*/ undefined); } checkFunctionExpressionBodies(node.body); } @@ -7376,23 +7431,6 @@ module ts { } } - function isImportedNameFromExternalModule(n: Node): boolean { - switch (n.kind) { - case SyntaxKind.ElementAccessExpression: - case SyntaxKind.PropertyAccessExpression: { - // all bindings for external module should be immutable - // so attempt to use a.b or a[b] as lhs will always fail - // no matter what b is - let symbol = findSymbol((n).expression); - return symbol && symbol.flags & SymbolFlags.Alias && isExternalModuleSymbol(resolveAlias(symbol)); - } - case SyntaxKind.ParenthesizedExpression: - return isImportedNameFromExternalModule((n).expression); - default: - return false; - } - } - if (!isReferenceOrErrorExpression(n)) { error(n, invalidReferenceMessage); return false; @@ -7403,10 +7441,6 @@ module ts { return false; } - if (isImportedNameFromExternalModule(n)) { - error(n, invalidReferenceMessage); - } - return true; } @@ -8002,6 +8036,8 @@ module ts { return checkTypeAssertion(node); case SyntaxKind.ParenthesizedExpression: return checkExpression((node).expression, contextualMapper); + case SyntaxKind.ClassExpression: + return checkClassExpression(node); case SyntaxKind.FunctionExpression: case SyntaxKind.ArrowFunction: return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); @@ -8229,7 +8265,7 @@ module ts { // TS 1.0 spec (April 2014): 8.3.2 // Constructors of classes with no extends clause may not contain super calls, whereas // constructors of derived classes must contain at least one super call somewhere in their function body. - if (getClassBaseTypeNode(node.parent)) { + if (getClassExtendsHeritageClauseElement(node.parent)) { if (containsSuperCall(node.body)) { // The first statement in the body of a constructor must be a super call if both of the following are true: @@ -8300,11 +8336,19 @@ module ts { checkDecorators(node); } - function checkTypeReference(node: TypeReferenceNode) { + function checkTypeReferenceNode(node: TypeReferenceNode) { + return checkTypeReferenceOrHeritageClauseElement(node); + } + + function checkHeritageClauseElement(node: HeritageClauseElement) { + return checkTypeReferenceOrHeritageClauseElement(node); + } + + function checkTypeReferenceOrHeritageClauseElement(node: TypeReferenceNode | HeritageClauseElement) { // Grammar checking checkGrammarTypeArguments(node, node.typeArguments); - let type = getTypeFromTypeReferenceNode(node); + let type = getTypeFromTypeReferenceOrHeritageClauseElement(node); if (type !== unknownType && node.typeArguments) { // Do type argument local checks only if referenced type is successfully resolved let len = node.typeArguments.length; @@ -8472,7 +8516,7 @@ module ts { let isConstructor = (symbol.flags & SymbolFlags.Constructor) !== 0; function reportImplementationExpectedError(node: FunctionLikeDeclaration): void { - if (node.name && getFullWidth(node.name) === 0) { + if (node.name && nodeIsMissing(node.name)) { return; } @@ -8722,24 +8766,92 @@ module ts { } } + /** Checks a type reference node as an expression. */ + function checkTypeNodeAsExpression(node: TypeNode | LiteralExpression) { + // 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 === SyntaxKind.TypeReference) { + let type = getTypeFromTypeNodeOrHeritageClauseElement(node); + let shouldCheckIfUnknownType = type === unknownType && compilerOptions.separateCompilation; + if (!type || (!shouldCheckIfUnknownType && type.flags & (TypeFlags.Intrinsic | TypeFlags.NumberLike | TypeFlags.StringLike))) { + return; + } + if (shouldCheckIfUnknownType || type.symbol.valueDeclaration) { + checkExpressionOrQualifiedName((node).typeName); + } + } + } + + /** + * Checks the type annotation of an accessor declaration or property declaration as + * an expression if it is a type reference to a type with a value declaration. + */ + function checkTypeAnnotationAsExpression(node: AccessorDeclaration | PropertyDeclaration | ParameterDeclaration | MethodDeclaration) { + switch (node.kind) { + case SyntaxKind.PropertyDeclaration: + checkTypeNodeAsExpression((node).type); + break; + case SyntaxKind.Parameter: checkTypeNodeAsExpression((node).type); + break; + case SyntaxKind.MethodDeclaration: + checkTypeNodeAsExpression((node).type); + break; + case SyntaxKind.GetAccessor: + checkTypeNodeAsExpression((node).type); + break; + case SyntaxKind.SetAccessor: + checkTypeNodeAsExpression(getSetAccessorTypeAnnotationNode(node)); + break; + } + } + + /** Checks the type annotation of the parameters of a function/method or the constructor of a class as expressions */ + function checkParameterTypeAnnotationsAsExpressions(node: FunctionLikeDeclaration) { + // ensure all type annotations with a value declaration are checked as an expression + for (let parameter of node.parameters) { + checkTypeAnnotationAsExpression(parameter); + } + } + /** Check the decorators of a node */ function checkDecorators(node: Node): void { if (!node.decorators) { return; - } + } - switch (node.kind) { - case SyntaxKind.ClassDeclaration: - case SyntaxKind.MethodDeclaration: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - case SyntaxKind.PropertyDeclaration: - case SyntaxKind.Parameter: - emitDecorate = true; - break; + // skip this check for nodes that cannot have decorators. These should have already had an error reported by + // checkGrammarDecorators. + if (!nodeCanBeDecorated(node)) { + return; + } - default: - return; + 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 SyntaxKind.ClassDeclaration: + var constructor = getFirstConstructorWithBody(node); + if (constructor) { + checkParameterTypeAnnotationsAsExpressions(constructor); + } + break; + + case SyntaxKind.MethodDeclaration: + checkParameterTypeAnnotationsAsExpressions(node); + // fall-through + + case SyntaxKind.SetAccessor: + case SyntaxKind.GetAccessor: + case SyntaxKind.PropertyDeclaration: + case SyntaxKind.Parameter: + checkTypeAnnotationAsExpression(node); + break; + } + } + + emitDecorate = true; + if (node.kind === SyntaxKind.Parameter) { + emitParam = true; } forEach(node.decorators, checkDecorator); @@ -8795,7 +8907,7 @@ module ts { checkSourceElement(node.body); if (node.type && !isAccessor(node.kind)) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); + checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type)); } // Report an implicit any error if there is no body, no explicit return type, and node is not a private method @@ -8895,7 +9007,7 @@ module ts { return; } - if (getClassBaseTypeNode(enclosingClass)) { + if (getClassExtendsHeritageClauseElement(enclosingClass)) { let isDeclaration = node.kind !== SyntaxKind.Identifier; if (isDeclaration) { error(node, Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); @@ -9761,8 +9873,22 @@ module ts { } } + function checkClassExpression(node: ClassExpression): Type { + grammarErrorOnNode(node, Diagnostics.class_expressions_are_not_currently_supported); + forEach(node.members, checkSourceElement); + return unknownType; + } + function checkClassDeclaration(node: ClassDeclaration) { // Grammar checking + if (node.parent.kind !== SyntaxKind.ModuleBlock && node.parent.kind !== SyntaxKind.SourceFile) { + grammarErrorOnNode(node, Diagnostics.class_declarations_are_only_supported_directly_inside_a_module_or_as_a_top_level_declaration); + } + + if (!node.name && !(node.flags & NodeFlags.Default)) { + grammarErrorOnFirstToken(node, Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name); + } + checkGrammarClassDeclarationHeritageClauses(node); checkDecorators(node); if (node.name) { @@ -9775,10 +9901,14 @@ module ts { let symbol = getSymbolOfNode(node); let type = getDeclaredTypeOfSymbol(symbol); let staticType = getTypeOfSymbol(symbol); - let baseTypeNode = getClassBaseTypeNode(node); + let baseTypeNode = getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { + if (!isSupportedHeritageClauseElement(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); - checkTypeReference(baseTypeNode); + checkHeritageClauseElement(baseTypeNode); } if (type.baseTypes.length) { if (produceDiagnostics) { @@ -9787,23 +9917,30 @@ module ts { let staticBaseType = getTypeOfSymbol(baseType.symbol); checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name || node, Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); - if (baseType.symbol !== resolveEntityName(baseTypeNode.typeName, SymbolFlags.Value)) { + + if (baseType.symbol !== resolveEntityName(baseTypeNode.expression, SymbolFlags.Value)) { error(baseTypeNode, Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType)); } checkKindsOfPropertyMemberOverrides(type, baseType); } - - // Check that base type can be evaluated as expression - checkExpressionOrQualifiedName(baseTypeNode.typeName); } - let implementedTypeNodes = getClassImplementedTypeNodes(node); + if (type.baseTypes.length || (baseTypeNode && compilerOptions.separateCompilation)) { + // Check that base type can be evaluated as expression + checkExpressionOrQualifiedName(baseTypeNode.expression); + } + + let implementedTypeNodes = getClassImplementsHeritageClauseElements(node); if (implementedTypeNodes) { forEach(implementedTypeNodes, typeRefNode => { - checkTypeReference(typeRefNode); + if (!isSupportedHeritageClauseElement(typeRefNode)) { + error(typeRefNode.expression, Diagnostics.A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments); + } + + checkHeritageClauseElement(typeRefNode); if (produceDiagnostics) { - let t = getTypeFromTypeReferenceNode(typeRefNode); + let t = getTypeFromHeritageClauseElement(typeRefNode); if (t !== unknownType) { let declaredType = (t.flags & TypeFlags.Reference) ? (t).target : t; if (declaredType.flags & (TypeFlags.Class | TypeFlags.Interface)) { @@ -9925,7 +10062,7 @@ module ts { if (!tp1.constraint || !tp2.constraint) { return false; } - if (!isTypeIdenticalTo(getTypeFromTypeNode(tp1.constraint), getTypeFromTypeNode(tp2.constraint))) { + if (!isTypeIdenticalTo(getTypeFromTypeNodeOrHeritageClauseElement(tp1.constraint), getTypeFromTypeNodeOrHeritageClauseElement(tp2.constraint))) { return false; } } @@ -9996,7 +10133,13 @@ module ts { } } } - forEach(getInterfaceBaseTypeNodes(node), checkTypeReference); + forEach(getInterfaceBaseTypeNodes(node), heritageElement => { + if (!isSupportedHeritageClauseElement(heritageElement)) { + error(heritageElement.expression, Diagnostics.An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments); + } + + checkHeritageClauseElement(heritageElement); + }); forEach(node.members, checkSourceElement); if (produceDiagnostics) { @@ -10197,6 +10340,11 @@ module ts { computeEnumMemberValues(node); + let enumIsConst = isConst(node); + if (compilerOptions.separateCompilation && enumIsConst && isInAmbientContext(node)) { + error(node.name, Diagnostics.Ambient_const_enums_are_not_allowed_when_the_separateCompilation_flag_is_provided); + } + // Spec 2014 - Section 9.3: // It isn't possible for one enum declaration to continue the automatic numbering sequence of another, // and when an enum type has multiple declarations, only one declaration is permitted to omit a value @@ -10207,7 +10355,6 @@ module ts { let firstDeclaration = getDeclarationOfKind(enumSymbol, node.kind); if (node === firstDeclaration) { if (enumSymbol.declarations.length > 1) { - let enumIsConst = isConst(node); // check that const is placed\omitted on all enum declarations forEach(enumSymbol.declarations, decl => { if (isConstEnumDeclaration(decl) !== enumIsConst) { @@ -10269,7 +10416,7 @@ module ts { if (symbol.flags & SymbolFlags.ValueModule && symbol.declarations.length > 1 && !isInAmbientContext(node) - && isInstantiatedModule(node, compilerOptions.preserveConstEnums)) { + && isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation)) { let classOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (classOrFunc) { if (getSourceFileOfNode(node) !== getSourceFileOfNode(classOrFunc)) { @@ -10294,16 +10441,25 @@ module ts { checkSourceElement(node.body); } - function getFirstIdentifier(node: EntityName): Identifier { - while (node.kind === SyntaxKind.QualifiedName) { - node = (node).left; + function getFirstIdentifier(node: EntityName | Expression): Identifier { + while (true) { + if (node.kind === SyntaxKind.QualifiedName) { + node = (node).left; + } + else if (node.kind === SyntaxKind.PropertyAccessExpression) { + node = (node).expression; + } + else { + break; + } } + Debug.assert(node.kind === SyntaxKind.Identifier); return node; } function checkExternalImportOrExportDeclaration(node: ImportDeclaration | ImportEqualsDeclaration | ExportDeclaration): boolean { let moduleName = getExternalModuleName(node); - if (getFullWidth(moduleName) !== 0 && moduleName.kind !== SyntaxKind.StringLiteral) { + if (!nodeIsMissing(moduleName) && moduleName.kind !== SyntaxKind.StringLiteral) { error(moduleName, Diagnostics.String_literal_expected); return false; } @@ -10524,7 +10680,7 @@ module ts { case SyntaxKind.SetAccessor: return checkAccessorDeclaration(node); case SyntaxKind.TypeReference: - return checkTypeReference(node); + return checkTypeReferenceNode(node); case SyntaxKind.TypeQuery: return checkTypeQuery(node); case SyntaxKind.TypeLiteral: @@ -10733,6 +10889,10 @@ module ts { links.flags |= NodeCheckFlags.EmitDecorate; } + if (emitParam) { + links.flags |= NodeCheckFlags.EmitParam; + } + links.flags |= NodeCheckFlags.TypeChecked; } } @@ -10900,11 +11060,23 @@ module ts { // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(entityName: EntityName): boolean { let node: Node = entityName; - while (node.parent && node.parent.kind === SyntaxKind.QualifiedName) node = node.parent; + while (node.parent && node.parent.kind === SyntaxKind.QualifiedName) { + node = node.parent; + } + return node.parent && node.parent.kind === SyntaxKind.TypeReference; } - function isTypeNode(node: Node): boolean { + function isHeritageClauseElementIdentifier(entityName: Node): boolean { + let node = entityName; + while (node.parent && node.parent.kind === SyntaxKind.PropertyAccessExpression) { + node = node.parent; + } + + return node.parent && node.parent.kind === SyntaxKind.HeritageClauseElement; + } + + function isTypeNodeOrHeritageClauseElement(node: Node): boolean { if (SyntaxKind.FirstTypeNode <= node.kind && node.kind <= SyntaxKind.LastTypeNode) { return true; } @@ -10921,6 +11093,8 @@ 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: + return true; // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container @@ -10929,10 +11103,15 @@ module ts { if (node.parent.kind === SyntaxKind.QualifiedName && (node.parent).right === node) { node = node.parent; } + else if (node.parent.kind === SyntaxKind.PropertyAccessExpression && (node.parent).name === node) { + node = node.parent; + } // fall through case SyntaxKind.QualifiedName: + case SyntaxKind.PropertyAccessExpression: // At this point, node is either a qualified name or an identifier - Debug.assert(node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName, "'node' was expected to be a qualified name or identifier in 'isTypeNode'."); + Debug.assert(node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName || node.kind === SyntaxKind.PropertyAccessExpression, + "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); let parent = node.parent; if (parent.kind === SyntaxKind.TypeQuery) { @@ -10948,6 +11127,8 @@ module ts { return true; } switch (parent.kind) { + case SyntaxKind.HeritageClauseElement: + return true; case SyntaxKind.TypeParameter: return node === (parent).constraint; case SyntaxKind.PropertyDeclaration: @@ -11002,11 +11183,6 @@ module ts { return getLeftSideOfImportEqualsOrExportAssignment(node) !== undefined; } - function isRightSideOfQualifiedNameOrPropertyAccess(node: Node) { - return (node.parent.kind === SyntaxKind.QualifiedName && (node.parent).right === node) || - (node.parent.kind === SyntaxKind.PropertyAccessExpression && (node.parent).name === node); - } - function getSymbolOfEntityNameOrPropertyAccessExpression(entityName: EntityName | PropertyAccessExpression): Symbol { if (isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); @@ -11028,8 +11204,13 @@ module ts { entityName = entityName.parent; } - if (isExpression(entityName)) { - if (getFullWidth(entityName) === 0) { + if (isHeritageClauseElementIdentifier(entityName)) { + let meaning = entityName.parent.kind === SyntaxKind.HeritageClauseElement ? SymbolFlags.Type : SymbolFlags.Namespace; + meaning |= SymbolFlags.Alias; + return resolveEntityName(entityName, meaning); + } + else if (isExpression(entityName)) { + if (nodeIsMissing(entityName)) { // Missing entity name. return undefined; } @@ -11144,12 +11325,12 @@ module ts { return unknownType; } - if (isExpression(node)) { - return getTypeOfExpression(node); + if (isTypeNodeOrHeritageClauseElement(node)) { + return getTypeFromTypeNodeOrHeritageClauseElement(node); } - if (isTypeNode(node)) { - return getTypeFromTypeNode(node); + if (isExpression(node)) { + return getTypeOfExpression(node); } if (isTypeDeclaration(node)) { @@ -11312,13 +11493,18 @@ module ts { // parent is not source file or it is not reference to internal module return false; } - return isAliasResolvedToValue(getSymbolOfNode(node)); + + var isValue = isAliasResolvedToValue(getSymbolOfNode(node)); + return isValue && node.moduleReference && !nodeIsMissing(node.moduleReference); } function isAliasResolvedToValue(symbol: Symbol): boolean { let target = resolveAlias(symbol); + if (target === unknownSymbol && compilerOptions.separateCompilation) { + return true; + } // const enums and modules that contain only const enums are not considered values from the emit perespective - return target !== unknownSymbol && target.flags & SymbolFlags.Value && !isConstEnumOrConstEnumOnlyModule(target); + return target !== unknownSymbol && target && target.flags & SymbolFlags.Value && !isConstEnumOrConstEnumOnlyModule(target); } function isConstEnumOrConstEnumOnlyModule(s: Symbol): boolean { @@ -11385,6 +11571,201 @@ module ts { return undefined; } + /** Serializes an EntityName (with substitutions) to an appropriate JS constructor value. Used by the __metadata decorator. */ + function serializeEntityName(node: EntityName, getGeneratedNameForNode: (Node: Node) => string, fallbackPath?: string[]): string { + if (node.kind === SyntaxKind.Identifier) { + var substitution = getExpressionNameSubstitution(node, getGeneratedNameForNode); + var text = substitution || (node).text; + if (fallbackPath) { + fallbackPath.push(text); + } + else { + return text; + } + } + else { + var left = serializeEntityName((node).left, getGeneratedNameForNode, fallbackPath); + var right = serializeEntityName((node).right, getGeneratedNameForNode, fallbackPath); + if (!fallbackPath) { + return left + "." + right; + } + } + } + + /** Serializes a TypeReferenceNode to an appropriate JS constructor value. Used by the __metadata decorator. */ + function serializeTypeReferenceNode(node: TypeReferenceNode, getGeneratedNameForNode: (Node: Node) => string): string | string[] { + // serialization of a TypeReferenceNode uses the following rules: + // + // * The serialized type of a TypeReference that is `void` is "void 0". + // * The serialized type of a TypeReference that is a `boolean` is "Boolean". + // * The serialized type of a TypeReference that is an enum or `number` is "Number". + // * The serialized type of a TypeReference that is a string literal or `string` is "String". + // * The serialized type of a TypeReference that is a tuple is "Array". + // * The serialized type of a TypeReference that is a `symbol` is "Symbol". + // * 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); + if (type.flags & TypeFlags.Void) { + return "void 0"; + } + else if (type.flags & TypeFlags.Boolean) { + return "Boolean"; + } + else if (type.flags & TypeFlags.NumberLike) { + return "Number"; + } + else if (type.flags & TypeFlags.StringLike) { + return "String"; + } + else if (type.flags & TypeFlags.Tuple) { + return "Array"; + } + else if (type.flags & TypeFlags.ESSymbol) { + return "Symbol"; + } + else if (type === unknownType) { + var fallbackPath: string[] = []; + serializeEntityName(node.typeName, getGeneratedNameForNode, fallbackPath); + return fallbackPath; + } + else if (type.symbol && type.symbol.valueDeclaration) { + return serializeEntityName(node.typeName, getGeneratedNameForNode); + } + else if (typeHasCallOrConstructSignatures(type)) { + return "Function"; + } + + return "Object"; + } + + /** Serializes a TypeNode to an appropriate JS constructor value. Used by the __metadata decorator. */ + function serializeTypeNode(node: TypeNode | LiteralExpression, getGeneratedNameForNode: (Node: Node) => string): string | string[] { + // serialization of a TypeNode uses the following rules: + // + // * The serialized type of `void` is "void 0" (undefined). + // * The serialized type of a parenthesized type is the serialized type of its nested type. + // * The serialized type of a Function or Constructor type is "Function". + // * The serialized type of an Array or Tuple type is "Array". + // * The serialized type of `boolean` is "Boolean". + // * The serialized type of `string` or a string-literal type is "String". + // * The serialized type of a type reference is handled by `serializeTypeReferenceNode`. + // * The serialized type of any other type node is "Object". + if (node) { + switch (node.kind) { + case SyntaxKind.VoidKeyword: + return "void 0"; + case SyntaxKind.ParenthesizedType: + return serializeTypeNode((node).type, getGeneratedNameForNode); + case SyntaxKind.FunctionType: + case SyntaxKind.ConstructorType: + return "Function"; + case SyntaxKind.ArrayType: + case SyntaxKind.TupleType: + return "Array"; + case SyntaxKind.BooleanKeyword: + return "Boolean"; + case SyntaxKind.StringKeyword: + case SyntaxKind.StringLiteral: + return "String"; + case SyntaxKind.NumberKeyword: + return "Number"; + case SyntaxKind.TypeReference: + return serializeTypeReferenceNode(node, getGeneratedNameForNode); + case SyntaxKind.TypeQuery: + case SyntaxKind.TypeLiteral: + case SyntaxKind.UnionType: + case SyntaxKind.AnyKeyword: + break; + default: + Debug.fail("Cannot serialize unexpected type node."); + break; + } + } + + return "Object"; + } + + /** Serializes the type of a declaration to an appropriate JS constructor value. Used by the __metadata decorator for a class member. */ + function serializeTypeOfNode(node: Node, getGeneratedNameForNode: (Node: Node) => string): string | string[] { + // serialization of the type of a declaration uses the following rules: + // + // * The serialized type of a ClassDeclaration is "Function" + // * The serialized type of a ParameterDeclaration is the serialized type of its type annotation. + // * The serialized type of a PropertyDeclaration is the serialized type of its type annotation. + // * The serialized type of an AccessorDeclaration is the serialized type of the return type annotation of its getter or parameter type annotation of its setter. + // * The serialized type of any other FunctionLikeDeclaration is "Function". + // * The serialized type of any other node is "void 0". + // + // For rules on serializing type annotations, see `serializeTypeNode`. + switch (node.kind) { + case SyntaxKind.ClassDeclaration: return "Function"; + case SyntaxKind.PropertyDeclaration: return serializeTypeNode((node).type, getGeneratedNameForNode); + case SyntaxKind.Parameter: return serializeTypeNode((node).type, getGeneratedNameForNode); + case SyntaxKind.GetAccessor: return serializeTypeNode((node).type, getGeneratedNameForNode); + case SyntaxKind.SetAccessor: return serializeTypeNode(getSetAccessorTypeAnnotationNode(node), getGeneratedNameForNode); + } + if (isFunctionLike(node)) { + return "Function"; + } + return "void 0"; + } + + /** Serializes the parameter types of a function or the constructor of a class. Used by the __metadata decorator for a method or set accessor. */ + function serializeParameterTypesOfNode(node: Node, getGeneratedNameForNode: (Node: Node) => string): (string | string[])[] { + // serialization of parameter types uses the following rules: + // + // * If the declaration is a class, the parameters of the first constructor with a body are used. + // * If the declaration is function-like and has a body, the parameters of the function are used. + // + // For the rules on serializing the type of each parameter declaration, see `serializeTypeOfDeclaration`. + if (node) { + var valueDeclaration: FunctionLikeDeclaration; + if (node.kind === SyntaxKind.ClassDeclaration) { + valueDeclaration = getFirstConstructorWithBody(node); + } + else if (isFunctionLike(node) && nodeIsPresent((node).body)) { + valueDeclaration = node; + } + if (valueDeclaration) { + var result: (string | string[])[]; + var parameters = valueDeclaration.parameters; + var parameterCount = parameters.length; + if (parameterCount > 0) { + result = new Array(parameterCount); + for (var i = 0; i < parameterCount; i++) { + if (parameters[i].dotDotDotToken) { + var parameterType = parameters[i].type; + if (parameterType.kind === SyntaxKind.ArrayType) { + parameterType = (parameterType).elementType; + } + else if (parameterType.kind === SyntaxKind.TypeReference && (parameterType).typeArguments && (parameterType).typeArguments.length === 1) { + parameterType = (parameterType).typeArguments[0]; + } + else { + parameterType = undefined; + } + result[i] = serializeTypeNode(parameterType, getGeneratedNameForNode); + } + else { + result[i] = serializeTypeOfNode(parameters[i], getGeneratedNameForNode); + } + } + return result; + } + } + } + return emptyArray; + } + + /** Serializes the return type of function. Used by the __metadata decorator for a method. */ + function serializeReturnTypeOfNode(node: Node, getGeneratedNameForNode: (Node: Node) => string): string | string[] { + if (node && isFunctionLike(node)) { + return serializeTypeNode((node).type, getGeneratedNameForNode); + } + return "void 0"; + } + function writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) { // Get type of the symbol if this is the valid symbol otherwise get type at location let symbol = getSymbolOfNode(declaration); @@ -11472,6 +11853,9 @@ module ts { resolvesToSomeValue, collectLinkedAliases, getBlockScopedVariableId, + serializeTypeOfNode, + serializeParameterTypesOfNode, + serializeReturnTypeOfNode, }; } @@ -11536,15 +11920,15 @@ module ts { return false; } if (!nodeCanBeDecorated(node)) { - return grammarErrorOnNode(node, Diagnostics.Decorators_are_not_valid_here); + return grammarErrorOnFirstToken(node, Diagnostics.Decorators_are_not_valid_here); } else if (languageVersion < ScriptTarget.ES5) { - return grammarErrorOnNode(node, Diagnostics.Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher); + return grammarErrorOnFirstToken(node, Diagnostics.Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher); } else if (node.kind === SyntaxKind.GetAccessor || node.kind === SyntaxKind.SetAccessor) { let accessors = getAllAccessorDeclarations((node.parent).members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { - return grammarErrorOnNode(node, Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); + return grammarErrorOnFirstToken(node, Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); } } return false; @@ -12219,9 +12603,6 @@ module ts { function checkGrammarVariableDeclaration(node: VariableDeclaration) { if (node.parent.parent.kind !== SyntaxKind.ForInStatement && node.parent.parent.kind !== SyntaxKind.ForOfStatement) { if (isInAmbientContext(node)) { - if (isBindingPattern(node.name)) { - return grammarErrorOnNode(node, Diagnostics.Destructuring_declarations_are_not_allowed_in_ambient_contexts); - } if (node.initializer) { // Error on equals token which immediate precedes the initializer let equalsTokenLength = "=".length; @@ -12261,7 +12642,9 @@ module ts { else { let elements = (name).elements; for (let element of elements) { - checkGrammarNameInLetOrConstDeclarations(element.name); + if (element.kind !== SyntaxKind.OmittedExpression) { + checkGrammarNameInLetOrConstDeclarations(element.name); + } } } } @@ -12391,7 +12774,16 @@ module ts { let identifier = name; if (contextNode && (contextNode.parserContextFlags & ParserContextFlags.StrictMode) && isEvalOrArgumentsIdentifier(identifier)) { let nameText = declarationNameToString(identifier); - return grammarErrorOnNode(identifier, Diagnostics.Invalid_use_of_0_in_strict_mode, nameText); + + // 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. + // This will be particularly helpful in the case of "arguments" as such case is very common mistake. + if (getAncestor(name, SyntaxKind.ClassDeclaration) || getAncestor(name, SyntaxKind.ClassExpression)) { + return grammarErrorOnNode(identifier, Diagnostics.Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode, nameText); + } + else { + return grammarErrorOnNode(identifier, Diagnostics.Invalid_use_of_0_in_strict_mode, nameText); + } } } } diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 269f23492e2..48817798d81 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -4,15 +4,12 @@ /// module ts { + /* @internal */ export var optionDeclarations: CommandLineOption[] = [ { name: "charset", type: "string", }, - { - name: "codepage", - type: "number", - }, { name: "declaration", shortName: "d", @@ -78,10 +75,6 @@ module ts { name: "noLib", type: "boolean", }, - { - name: "noLibCheck", - type: "boolean", - }, { name: "noResolve", type: "boolean", @@ -117,6 +110,10 @@ module ts { type: "boolean", description: Diagnostics.Do_not_emit_comments_to_output, }, + { + name: "separateCompilation", + type: "boolean", + }, { name: "sourceMap", type: "boolean", @@ -140,18 +137,6 @@ module ts { description: Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, experimental: true }, - { - name: "preserveNewLines", - type: "boolean", - description: Diagnostics.Preserve_new_lines_when_emitting_code, - experimental: true - }, - { - name: "cacheDownlevelForOfLength", - type: "boolean", - description: "Cache length access when downlevel emitting for-of statements", - experimental: true, - }, { name: "target", shortName: "t", @@ -171,9 +156,15 @@ module ts { shortName: "w", type: "boolean", description: Diagnostics.Watch_input_files, + }, + { + name: "emitDecoratorMetadata", + type: "boolean", + experimental: true } ]; - + + /* @internal */ export function parseCommandLine(commandLine: string[]): ParsedCommandLine { var options: CompilerOptions = {}; var fileNames: string[] = []; @@ -283,6 +274,10 @@ module ts { } } + /** + * Read tsconfig.json file + * @param fileName The path to the config file + */ export function readConfigFile(fileName: string): any { try { var text = sys.readFile(fileName); @@ -292,6 +287,12 @@ module ts { } } + /** + * 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 + */ export function parseConfigFile(json: any, basePath?: string): ParsedCommandLine { var errors: Diagnostic[] = []; diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index cf75467e1c5..7d41a72435f 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -314,12 +314,12 @@ module ts { } } - function emitTypeWithNewGetSymbolAccessibilityDiagnostic(type: TypeNode | EntityName, getSymbolAccessibilityDiagnostic: GetSymbolAccessibilityDiagnostic) { + function emitTypeWithNewGetSymbolAccessibilityDiagnostic(type: TypeNode | EntityName | HeritageClauseElement, getSymbolAccessibilityDiagnostic: GetSymbolAccessibilityDiagnostic) { writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic; emitType(type); } - function emitType(type: TypeNode | StringLiteralExpression | Identifier | QualifiedName) { + function emitType(type: TypeNode | StringLiteralExpression | Identifier | QualifiedName | HeritageClauseElement) { switch (type.kind) { case SyntaxKind.AnyKeyword: case SyntaxKind.StringKeyword: @@ -329,6 +329,8 @@ module ts { case SyntaxKind.VoidKeyword: case SyntaxKind.StringLiteral: return writeTextOfNode(currentSourceFile, type); + case SyntaxKind.HeritageClauseElement: + return emitHeritageClauseElement(type); case SyntaxKind.TypeReference: return emitTypeReference(type); case SyntaxKind.TypeQuery: @@ -350,11 +352,9 @@ module ts { return emitEntityName(type); case SyntaxKind.QualifiedName: return emitEntityName(type); - default: - Debug.fail("Unknown type annotation: " + type.kind); } - function emitEntityName(entityName: EntityName) { + function emitEntityName(entityName: EntityName | PropertyAccessExpression) { let visibilityResult = resolver.isEntityNameVisible(entityName, // Aliases can be written asynchronously so use correct enclosing declaration entityName.parent.kind === SyntaxKind.ImportEqualsDeclaration ? entityName.parent : enclosingDeclaration); @@ -362,15 +362,28 @@ module ts { handleSymbolAccessibilityError(visibilityResult); writeEntityName(entityName); - function writeEntityName(entityName: EntityName) { + function writeEntityName(entityName: EntityName | Expression) { if (entityName.kind === SyntaxKind.Identifier) { writeTextOfNode(currentSourceFile, entityName); } else { - let qualifiedName = entityName; - writeEntityName(qualifiedName.left); + let left = entityName.kind === SyntaxKind.QualifiedName ? (entityName).left : (entityName).expression; + let right = entityName.kind === SyntaxKind.QualifiedName ? (entityName).right : (entityName).name; + writeEntityName(left); write("."); - writeTextOfNode(currentSourceFile, qualifiedName.right); + writeTextOfNode(currentSourceFile, right); + } + } + } + + function emitHeritageClauseElement(node: HeritageClauseElement) { + if (isSupportedHeritageClauseElement(node)) { + Debug.assert(node.expression.kind === SyntaxKind.Identifier || node.expression.kind === SyntaxKind.PropertyAccessExpression); + emitEntityName(node.expression); + if (node.typeArguments) { + write("<"); + emitCommaList(node.typeArguments, emitType); + write(">"); } } } @@ -827,14 +840,16 @@ module ts { } } - function emitHeritageClause(typeReferences: TypeReferenceNode[], isImplementsList: boolean) { + function emitHeritageClause(typeReferences: HeritageClauseElement[], isImplementsList: boolean) { if (typeReferences) { write(isImplementsList ? " implements " : " extends "); emitCommaList(typeReferences, emitTypeOfTypeReference); } - function emitTypeOfTypeReference(node: TypeReferenceNode) { - emitTypeWithNewGetSymbolAccessibilityDiagnostic(node, getHeritageClauseVisibilityError); + function emitTypeOfTypeReference(node: HeritageClauseElement) { + if (isSupportedHeritageClauseElement(node)) { + emitTypeWithNewGetSymbolAccessibilityDiagnostic(node, getHeritageClauseVisibilityError); + } function getHeritageClauseVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { let diagnosticMessage: DiagnosticMessage; @@ -877,11 +892,11 @@ module ts { let prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; emitTypeParameters(node.typeParameters); - let baseTypeNode = getClassBaseTypeNode(node); + let baseTypeNode = getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { emitHeritageClause([baseTypeNode], /*isImplementsList*/ false); } - emitHeritageClause(getClassImplementedTypeNodes(node), /*isImplementsList*/ true); + emitHeritageClause(getClassImplementsHeritageClauseElements(node), /*isImplementsList*/ true); write(" {"); writeLine(); increaseIndent(); @@ -993,7 +1008,18 @@ module ts { } function emitBindingPattern(bindingPattern: BindingPattern) { - emitCommaList(bindingPattern.elements, emitBindingElement); + // Only select non-omitted expression from the bindingPattern's elements. + // We have to do this to avoid emitting trailing commas. + // For example: + // original: var [, c,,] = [ 2,3,4] + // emitted: declare var c: number; // instead of declare var c:number, ; + let elements: Node[] = []; + for (let element of bindingPattern.elements) { + if (element.kind !== SyntaxKind.OmittedExpression){ + elements.push(element); + } + } + emitCommaList(elements, emitBindingElement); } function emitBindingElement(bindingElement: BindingElement) { @@ -1291,7 +1317,10 @@ module ts { write("..."); } if (isBindingPattern(node.name)) { - write("_" + indexOf((node.parent).parameters, node)); + // For bindingPattern, we can't simply writeTextOfNode from the source file + // because we want to omit the initializer and using writeTextOfNode will result in initializer get emitted. + // Therefore, we will have to recursively emit each element in the bindingPattern. + emitBindingPattern(node.name); } else { writeTextOfNode(currentSourceFile, node.name); @@ -1311,41 +1340,46 @@ module ts { } function getParameterDeclarationTypeVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { - let diagnosticMessage: DiagnosticMessage; + let diagnosticMessage: DiagnosticMessage = getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult); + return diagnosticMessage !== undefined ? { + diagnosticMessage, + errorNode: node, + typeName: node.name + } : undefined; + } + + function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult: SymbolAccessiblityResult): DiagnosticMessage { switch (node.parent.kind) { case SyntaxKind.Constructor: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - break; case SyntaxKind.ConstructSignature: // Interfaces cannot have parameter types that cannot be named - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + return symbolAccesibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - break; case SyntaxKind.CallSignature: // Interfaces cannot have parameter types that cannot be named - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + return symbolAccesibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - break; case SyntaxKind.MethodDeclaration: case SyntaxKind.MethodSignature: if (node.parent.flags & NodeFlags.Static) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } else if (node.parent.parent.kind === SyntaxKind.ClassDeclaration) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : @@ -1353,30 +1387,99 @@ module ts { } else { // Interfaces cannot have parameter types that cannot be named - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + return symbolAccesibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - break; case SyntaxKind.FunctionDeclaration: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - break; default: Debug.fail("This is unknown parent for parameter: " + node.parent.kind); } - - return { - diagnosticMessage, - errorNode: node, - typeName: node.name - }; } + + function emitBindingPattern(bindingPattern: BindingPattern) { + // We have to explicitly emit square bracket and bracket because these tokens are not store inside the node. + if (bindingPattern.kind === SyntaxKind.ObjectBindingPattern) { + write("{"); + emitCommaList(bindingPattern.elements, emitBindingElement); + write("}"); + } + else if (bindingPattern.kind === SyntaxKind.ArrayBindingPattern) { + write("["); + let elements = bindingPattern.elements; + emitCommaList(elements, emitBindingElement); + if (elements && elements.hasTrailingComma) { + write(", "); + } + write("]"); + } + } + + function emitBindingElement(bindingElement: BindingElement) { + function getBindingElementTypeVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { + let diagnosticMessage = getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult); + return diagnosticMessage !== undefined ? { + diagnosticMessage, + errorNode: bindingElement, + typeName: bindingElement.name + } : undefined; + } + + if (bindingElement.kind === SyntaxKind.OmittedExpression) { + // If bindingElement is an omittedExpression (i.e. containing elision), + // we will emit blank space (although this may differ from users' original code, + // it allows emitSeparatedList to write separator appropriately) + // Example: + // original: function foo([, x, ,]) {} + // emit : function foo([ , x, , ]) {} + write(" "); + } + else if (bindingElement.kind === SyntaxKind.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" + // We have to explicitly emit the propertyName before descending into its binding elements. + // Example: + // original: function foo({y: [a,b,c]}) {} + // emit : declare function foo({y: [a, b, c]}: { y: [any, any, any] }) void; + writeTextOfNode(currentSourceFile, bindingElement.propertyName); + write(": "); + + // If bindingElement has propertyName property, then its name must be another bindingPattern of SyntaxKind.ObjectBindingPattern + emitBindingPattern(bindingElement.name); + } + else if (bindingElement.name) { + if (isBindingPattern(bindingElement.name)) { + // If it is a nested binding pattern, we will recursively descend into each element and emit each one separately. + // In the case of rest element, we will omit rest element. + // Example: + // original: function foo([a, [[b]], c] = [1,[["string"]], 3]) {} + // emit : declare function foo([a, [[b]], c]: [number, [[string]], number]): void; + // original with rest: function foo([a, ...c]) {} + // emit : declare function foo([a, ...c]): void; + emitBindingPattern(bindingElement.name); + } + else { + Debug.assert(bindingElement.name.kind === SyntaxKind.Identifier); + // If the node is just an identifier, we will simply emit the text associated with the node's name + // Example: + // original: function foo({y = 10, x}) {} + // emit : declare function foo({y, x}: {number, any}): void; + if (bindingElement.dotDotDotToken) { + write("..."); + } + writeTextOfNode(currentSourceFile, bindingElement.name); + } + } + } + } } function emitNode(node: Node) { diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index d19a5a28357..5062be5ed46 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -165,6 +165,10 @@ module ts { 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." }, + 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" }, 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." }, @@ -351,6 +355,8 @@ module ts { The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression: { code: 2496, category: DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an arrow function. 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 *'." }, + 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." }, 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}'." }, @@ -434,6 +440,11 @@ module ts { Option_noEmit_cannot_be_specified_with_option_out_or_outDir: { code: 5040, category: DiagnosticCategory.Error, key: "Option 'noEmit' cannot be specified with option 'out' or 'outDir'." }, Option_noEmit_cannot_be_specified_with_option_declaration: { code: 5041, category: DiagnosticCategory.Error, key: "Option 'noEmit' cannot be specified with option 'declaration'." }, Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { code: 5042, category: DiagnosticCategory.Error, key: "Option 'project' cannot be mixed with source files on a command line." }, + Option_sourceMap_cannot_be_specified_with_option_separateCompilation: { code: 5043, category: DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'separateCompilation'." }, + Option_declaration_cannot_be_specified_with_option_separateCompilation: { code: 5044, category: DiagnosticCategory.Error, key: "Option 'declaration' cannot be specified with option 'separateCompilation'." }, + 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." }, 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." }, @@ -496,7 +507,26 @@ module ts { 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." }, You_cannot_rename_this_element: { code: 8000, category: DiagnosticCategory.Error, key: "You cannot rename this element." }, You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: { code: 8001, category: DiagnosticCategory.Error, key: "You cannot rename elements that are defined in the standard TypeScript library." }, + import_can_only_be_used_in_a_ts_file: { code: 8002, category: DiagnosticCategory.Error, key: "'import ... =' can only be used in a .ts file." }, + export_can_only_be_used_in_a_ts_file: { code: 8003, category: DiagnosticCategory.Error, key: "'export=' can only be used in a .ts file." }, + type_parameter_declarations_can_only_be_used_in_a_ts_file: { code: 8004, category: DiagnosticCategory.Error, key: "'type parameter declarations' can only be used in a .ts file." }, + implements_clauses_can_only_be_used_in_a_ts_file: { code: 8005, category: DiagnosticCategory.Error, key: "'implements clauses' can only be used in a .ts file." }, + interface_declarations_can_only_be_used_in_a_ts_file: { code: 8006, category: DiagnosticCategory.Error, key: "'interface declarations' can only be used in a .ts file." }, + module_declarations_can_only_be_used_in_a_ts_file: { code: 8007, category: DiagnosticCategory.Error, key: "'module declarations' can only be used in a .ts file." }, + type_aliases_can_only_be_used_in_a_ts_file: { code: 8008, category: DiagnosticCategory.Error, key: "'type aliases' can only be used in a .ts file." }, + _0_can_only_be_used_in_a_ts_file: { code: 8009, category: DiagnosticCategory.Error, key: "'{0}' can only be used in a .ts file." }, + types_can_only_be_used_in_a_ts_file: { code: 8010, category: DiagnosticCategory.Error, key: "'types' can only be used in a .ts file." }, + type_arguments_can_only_be_used_in_a_ts_file: { code: 8011, category: DiagnosticCategory.Error, key: "'type arguments' can only be used in a .ts file." }, + parameter_modifiers_can_only_be_used_in_a_ts_file: { code: 8012, category: DiagnosticCategory.Error, key: "'parameter modifiers' can only be used in a .ts file." }, + can_only_be_used_in_a_ts_file: { code: 8013, category: DiagnosticCategory.Error, key: "'?' can only be used in a .ts file." }, + property_declarations_can_only_be_used_in_a_ts_file: { code: 8014, category: DiagnosticCategory.Error, key: "'property declarations' can only be used in a .ts file." }, + enum_declarations_can_only_be_used_in_a_ts_file: { code: 8015, category: DiagnosticCategory.Error, key: "'enum declarations' can only be used in a .ts file." }, + type_assertion_expressions_can_only_be_used_in_a_ts_file: { code: 8016, category: DiagnosticCategory.Error, key: "'type assertion expressions' can only be used in a .ts file." }, + decorators_can_only_be_used_in_a_ts_file: { code: 8017, category: DiagnosticCategory.Error, key: "'decorators' can only be used in a .ts file." }, yield_expressions_are_not_currently_supported: { code: 9000, category: DiagnosticCategory.Error, key: "'yield' expressions are not currently supported." }, Generators_are_not_currently_supported: { code: 9001, category: DiagnosticCategory.Error, key: "Generators are not currently supported." }, + Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clauses: { code: 9002, category: DiagnosticCategory.Error, key: "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses." }, + class_expressions_are_not_currently_supported: { code: 9003, category: DiagnosticCategory.Error, key: "'class' expressions are not currently supported." }, + class_declarations_are_only_supported_directly_inside_a_module_or_as_a_top_level_declaration: { code: 9004, category: DiagnosticCategory.Error, key: "'class' declarations are only supported directly inside a module or as a top level declaration." }, }; } \ No newline at end of file diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index a54e358be5a..4476b0cad4a 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -651,7 +651,22 @@ "category": "Error", "code": 1207 }, - + "Cannot compile non-external modules when the '--separateCompilation' flag is provided.": { + "category": "Error", + "code": 1208 + }, + "Ambient const enums are not allowed when the '--separateCompilation' flag is provided.": { + "category": "Error", + "code": 1209 + }, + "Invalid use of '{0}'. Class definitions are automatically in strict mode.": { + "category": "Error", + "code": 1210 + }, + "A class declaration without the 'default' modifier must have a name": { + "category": "Error", + "code": 1211 + }, "Duplicate identifier '{0}'.": { "category": "Error", "code": 2300 @@ -1396,6 +1411,14 @@ "category": "Error", "code": 2498 }, + "An interface can only extend an identifier/qualified-name with optional type arguments.": { + "category": "Error", + "code": 2499 + }, + "A class can only implement an identifier/qualified-name with optional type arguments.": { + "category": "Error", + "code": 2500 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", @@ -1729,6 +1752,26 @@ "category": "Error", "code": 5042 }, + "Option 'sourceMap' cannot be specified with option 'separateCompilation'.": { + "category": "Error", + "code": 5043 + }, + "Option 'declaration' cannot be specified with option 'separateCompilation'.": { + "category": "Error", + "code": 5044 + }, + "Option 'noEmitOnError' cannot be specified with option 'separateCompilation'.": { + "category": "Error", + "code": 5045 + }, + "Option 'out' cannot be specified with option 'separateCompilation'.": { + "category": "Error", + "code": 5046 + }, + "Option 'separateCompilation' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher.": { + "category": "Error", + "code": 5047 + }, "Concatenate and emit output to single file.": { "category": "Message", "code": 6001 @@ -1978,6 +2021,71 @@ "category": "Error", "code": 8001 }, + "'import ... =' can only be used in a .ts file.": { + "category": "Error", + "code": 8002 + }, + "'export=' can only be used in a .ts file.": { + "category": "Error", + "code": 8003 + }, + "'type parameter declarations' can only be used in a .ts file.": { + "category": "Error", + "code": 8004 + }, + "'implements clauses' can only be used in a .ts file.": { + "category": "Error", + "code": 8005 + }, + "'interface declarations' can only be used in a .ts file.": { + "category": "Error", + "code": 8006 + }, + "'module declarations' can only be used in a .ts file.": { + "category": "Error", + "code": 8007 + }, + "'type aliases' can only be used in a .ts file.": { + "category": "Error", + "code": 8008 + }, + "'{0}' can only be used in a .ts file.": { + "category": "Error", + "code": 8009 + }, + "'types' can only be used in a .ts file.": { + "category": "Error", + "code": 8010 + }, + "'type arguments' can only be used in a .ts file.": { + "category": "Error", + "code": 8011 + }, + "'parameter modifiers' can only be used in a .ts file.": { + "category": "Error", + "code": 8012 + }, + "'?' can only be used in a .ts file.": { + "category": "Error", + "code": 8013 + }, + "'property declarations' can only be used in a .ts file.": { + "category": "Error", + "code": 8014 + }, + "'enum declarations' can only be used in a .ts file.": { + "category": "Error", + "code": 8015 + }, + "'type assertion expressions' can only be used in a .ts file.": { + "category": "Error", + "code": 8016 + }, + "'decorators' can only be used in a .ts file.": { + "category": "Error", + "code": 8017 + }, + "'yield' expressions are not currently supported.": { "category": "Error", "code": 9000 @@ -1985,5 +2093,17 @@ "Generators are not currently supported.": { "category": "Error", "code": 9001 + }, + "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses.": { + "category": "Error", + "code": 9002 + }, + "'class' expressions are not currently supported.": { + "category": "Error", + "code": 9003 + }, + "'class' declarations are only supported directly inside a module or as a top level declaration.": { + "category": "Error", + "code": 9004 } } diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 03b30755cf2..940edf04191 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -12,17 +12,44 @@ module ts { return isExternalModule(sourceFile) || isDeclarationFile(sourceFile); } - // flag enum used to request and track usages of few dedicated temp variables - // enum values are used to set/check bit values and thus should not have bit collisions. - const enum TempVariableKind { - auto = 0, - _i = 1, - _n = 2, + // Flags enum to track count of temp variables and a few dedicated names + const enum TempFlags { + Auto = 0x00000000, // No preferred name + CountMask = 0x0FFFFFFF, // Temp variable counter + _i = 0x10000000, // Use/preference flag for '_i' + _n = 0x20000000, // Use/preference flag for '_n' } // @internal // targetSourceFile is when users only want one file in entire project to be emitted. This is used in compileOnSave feature 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) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +};`; + + // emit output for the __decorate helper function + const decorateHelper = ` +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +};`; + + // emit output for the __metadata helper function + const metadataHelper = ` +var __metadata = this.__metadata || (typeof Reflect === "object" && Reflect.metadata) || function () { };`; + + // emit output for the __param helper function + const paramHelper = ` +var __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } };`; + let compilerOptions = host.getCompilerOptions(); let languageVersion = compilerOptions.target || ScriptTarget.ES3; let sourceMapDataList: SourceMapData[] = compilerOptions.sourceMap ? [] : undefined; @@ -88,22 +115,21 @@ module ts { let writeLine = writer.writeLine; let increaseIndent = writer.increaseIndent; let decreaseIndent = writer.decreaseIndent; - let preserveNewLines = compilerOptions.preserveNewLines || false; let currentSourceFile: SourceFile; - let generatedNameSet: Map; - let nodeToGeneratedName: string[]; + let generatedNameSet: Map = {}; + let nodeToGeneratedName: string[] = []; let blockScopedVariableToGeneratedName: string[]; let computedPropertyNamesToGeneratedNames: string[]; let extendsEmitted = false; let decorateEmitted = false; - let tempCount = 0; + let paramEmitted = false; + let tempFlags = 0; let tempVariables: Identifier[]; let tempParameters: Identifier[]; let externalImports: (ImportDeclaration | ImportEqualsDeclaration | ExportDeclaration)[]; - let predefinedTempsInUse = TempVariableKind.auto; let exportSpecifiers: Map; let exportEquals: ExportAssignment; let hasExportStars: boolean; @@ -168,10 +194,103 @@ module ts { emit(sourceFile); } + function isUniqueName(name: string): boolean { + return !resolver.hasGlobalName(name) && + !hasProperty(currentSourceFile.identifiers, name) && + !hasProperty(generatedNameSet, name); + } + + // Return the next available name in the pattern _a ... _z, _0, _1, ... + // TempFlags._i or TempFlags._n may be used to express a preference for that dedicated name. + // Note that names generated by makeTempVariableName and makeUniqueName will never conflict. + function makeTempVariableName(flags: TempFlags): string { + if (flags && !(tempFlags & flags)) { + var name = flags === TempFlags._i ? "_i" : "_n" + if (isUniqueName(name)) { + tempFlags |= flags; + return name; + } + } + while (true) { + let count = tempFlags & TempFlags.CountMask; + tempFlags++; + // Skip over 'i' and 'n' + if (count !== 8 && count !== 13) { + let name = count < 26 ? "_" + String.fromCharCode(CharacterCodes.a + count) : "_" + (count - 26); + if (isUniqueName(name)) { + return name; + } + } + } + } + + // Generate a name that is unique within the current file and doesn't conflict with any names + // in global scope. The name is formed by adding an '_n' suffix to the specified base name, + // where n is a positive integer. Note that names generated by makeTempVariableName and + // makeUniqueName are guaranteed to never conflict. + function makeUniqueName(baseName: string): string { + // Find the first unique 'name_n', where n is a positive number + if (baseName.charCodeAt(baseName.length - 1) !== CharacterCodes._) { + baseName += "_"; + } + let i = 1; + while (true) { + let generatedName = baseName + i; + if (isUniqueName(generatedName)) { + return generatedNameSet[generatedName] = generatedName; + } + i++; + } + } + + function assignGeneratedName(node: Node, name: string) { + nodeToGeneratedName[getNodeId(node)] = unescapeIdentifier(name); + } + + function generateNameForFunctionOrClassDeclaration(node: Declaration) { + if (!node.name) { + assignGeneratedName(node, makeUniqueName("default")); + } + } + + function generateNameForModuleOrEnum(node: ModuleDeclaration | EnumDeclaration) { + if (node.name.kind === SyntaxKind.Identifier) { + let name = node.name.text; + // Use module/enum name itself if it is unique, otherwise make a unique variation + assignGeneratedName(node, isUniqueLocalName(name, node) ? name : makeUniqueName(name)); + } + } + + function generateNameForImportOrExportDeclaration(node: ImportDeclaration | ExportDeclaration) { + let expr = getExternalModuleName(node); + let baseName = expr.kind === SyntaxKind.StringLiteral ? + escapeIdentifier(makeIdentifierFromModuleName((expr).text)) : "module"; + assignGeneratedName(node, makeUniqueName(baseName)); + } + + function generateNameForImportDeclaration(node: ImportDeclaration) { + if (node.importClause) { + generateNameForImportOrExportDeclaration(node); + } + } + + function generateNameForExportDeclaration(node: ExportDeclaration) { + if (node.moduleSpecifier) { + generateNameForImportOrExportDeclaration(node); + } + } + + function generateNameForExportAssignment(node: ExportAssignment) { + if (node.expression && node.expression.kind !== SyntaxKind.Identifier) { + assignGeneratedName(node, makeUniqueName("default")); + } + } + function generateNameForNode(node: Node) { switch (node.kind) { case SyntaxKind.FunctionDeclaration: case SyntaxKind.ClassDeclaration: + case SyntaxKind.ClassExpression: generateNameForFunctionOrClassDeclaration(node); break; case SyntaxKind.ModuleDeclaration: @@ -190,175 +309,15 @@ module ts { case SyntaxKind.ExportAssignment: generateNameForExportAssignment(node); break; - case SyntaxKind.SourceFile: - case SyntaxKind.ModuleBlock: - forEach((node).statements, generateNameForNode); - break; - } - } - - function isUniqueName(name: string): boolean { - return !resolver.hasGlobalName(name) && - !hasProperty(currentSourceFile.identifiers, name) && - (!generatedNameSet || !hasProperty(generatedNameSet, name)) - } - - // in cases like - // for (var x of []) { - // _i; - // } - // we should be able to detect if let _i was shadowed by some temp variable that was allocated in scope - function nameConflictsWithSomeTempVariable(name: string): boolean { - // temp variable names always start with '_' - if (name.length < 2 || name.charCodeAt(0) !== CharacterCodes._) { - return false; - } - - if (name === "_i") { - return !!(predefinedTempsInUse & TempVariableKind._i); - } - - if (name === "_n") { - return !!(predefinedTempsInUse & TempVariableKind._n); - } - - if (name.length === 2 && name.charCodeAt(1) >= CharacterCodes.a && name.charCodeAt(1) <= CharacterCodes.z) { - // handles _a .. _z - let n = name.charCodeAt(1) - CharacterCodes.a; - return n < tempCount; - } - else { - // handles _1, _2... - let n = +name.substring(1); - return !isNaN(n) && n >= 0 && n < (tempCount - 26); - } - } - - // This function generates a name using the following pattern: - // _a .. _h, _j ... _z, _0, _1, ... - // It is guaranteed that generated name will not shadow any existing user-defined names, - // however it can hide another name generated by this function higher in the scope. - // NOTE: names generated by 'makeTempVariableName' and 'makeUniqueName' will never conflict. - // see comment for 'makeTempVariableName' for more information. - function makeTempVariableName(location: Node, tempVariableKind: TempVariableKind): string { - let tempName: string; - if (tempVariableKind !== TempVariableKind.auto && !(predefinedTempsInUse & tempVariableKind)) { - tempName = tempVariableKind === TempVariableKind._i ? "_i" : "_n"; - if (!resolver.resolvesToSomeValue(location, tempName)) { - predefinedTempsInUse |= tempVariableKind; - return tempName; - } - } - - do { - // Note: we avoid generating _i and _n as those are common names we want in other places. - var char = CharacterCodes.a + tempCount; - if (char !== CharacterCodes.i && char !== CharacterCodes.n) { - if (tempCount < 26) { - tempName = "_" + String.fromCharCode(char); - } - else { - tempName = "_" + (tempCount - 26); - } - } - - tempCount++; - } - while (resolver.resolvesToSomeValue(location, tempName)); - - return tempName; - } - - // Generates a name that is unique within current file and does not collide with - // any names in global scope. - // NOTE: names generated by 'makeTempVariableName' and 'makeUniqueName' will never conflict - // because of the way how these names are generated - // - makeUniqueName builds a name by picking a base name (which should not be empty string) - // and appending suffix '_' - // - makeTempVariableName creates a name using the following pattern: - // _a .. _h, _j ... _z, _0, _1, ... - // This means that names from 'makeTempVariableName' will have only one underscore at the beginning - // and names from 'makeUniqieName' will have at least one underscore in the middle - // so they will never collide. - function makeUniqueName(baseName: string): string { - Debug.assert(!!baseName); - - // Find the first unique 'name_n', where n is a positive number - if (baseName.charCodeAt(baseName.length - 1) !== CharacterCodes._) { - baseName += "_"; - } - - let i = 1; - let generatedName: string; - while (true) { - generatedName = baseName + i; - if (isUniqueName(generatedName)) { - break; - } - i++; - } - - if (!generatedNameSet) { - generatedNameSet = {}; - } - return generatedNameSet[generatedName] = generatedName; - } - - function renameNode(node: Node, name: string): string { - var nodeId = getNodeId(node); - - if (!nodeToGeneratedName) { - nodeToGeneratedName = []; - } - - return nodeToGeneratedName[nodeId] = unescapeIdentifier(name); - } - - function generateNameForFunctionOrClassDeclaration(node: Declaration) { - if (!node.name) { - renameNode(node, makeUniqueName("default")); - } - } - - function generateNameForModuleOrEnum(node: ModuleDeclaration | EnumDeclaration) { - if (node.name.kind === SyntaxKind.Identifier) { - let name = node.name.text; - // Use module/enum name itself if it is unique, otherwise make a unique variation - renameNode(node, isUniqueLocalName(name, node) ? name : makeUniqueName(name)); - } - } - - function generateNameForImportOrExportDeclaration(node: ImportDeclaration | ExportDeclaration) { - let expr = getExternalModuleName(node); - let baseName = expr.kind === SyntaxKind.StringLiteral ? - escapeIdentifier(makeIdentifierFromModuleName((expr).text)) : "module"; - renameNode(node, makeUniqueName(baseName)); - } - - function generateNameForImportDeclaration(node: ImportDeclaration) { - if (node.importClause) { - generateNameForImportOrExportDeclaration(node); - } - } - - function generateNameForExportDeclaration(node: ExportDeclaration) { - if (node.moduleSpecifier) { - generateNameForImportOrExportDeclaration(node); - } - } - - function generateNameForExportAssignment(node: ExportAssignment) { - if (node.expression && node.expression.kind !== SyntaxKind.Identifier) { - renameNode(node, makeUniqueName("default")); } } function getGeneratedNameForNode(node: Node) { let nodeId = getNodeId(node); - if (!nodeToGeneratedName || !nodeToGeneratedName[nodeId]) { + if (!nodeToGeneratedName[nodeId]) { generateNameForNode(node); } - return nodeToGeneratedName ? nodeToGeneratedName[nodeId] : undefined; + return nodeToGeneratedName[nodeId]; } function initializeEmitterWithSourceMaps() { @@ -726,9 +685,9 @@ module ts { } // Create a temporary variable with a unique unused name. - function createTempVariable(location: Node, tempVariableKind = TempVariableKind.auto): Identifier { + function createTempVariable(flags: TempFlags): Identifier { let result = createSynthesizedNode(SyntaxKind.Identifier); - result.text = makeTempVariableName(location, tempVariableKind); + result.text = makeTempVariableName(flags); return result; } @@ -739,8 +698,8 @@ module ts { tempVariables.push(name); } - function createAndRecordTempVariable(location: Node, tempVariableKind?: TempVariableKind): Identifier { - let temp = createTempVariable(location, tempVariableKind); + function createAndRecordTempVariable(flags: TempFlags): Identifier { + let temp = createTempVariable(flags); recordTempDeclaration(temp); return temp; @@ -799,7 +758,7 @@ module ts { increaseIndent(); - if (preserveNewLines && nodeStartPositionsAreOnSameLine(parent, nodes[0])) { + if (nodeStartPositionsAreOnSameLine(parent, nodes[0])) { if (spacesBetweenBraces) { write(" "); } @@ -810,7 +769,7 @@ module ts { for (let i = 0, n = nodes.length; i < n; i++) { if (i) { - if (preserveNewLines && nodeEndIsOnSameLineAsNodeStart(nodes[i - 1], nodes[i])) { + if (nodeEndIsOnSameLineAsNodeStart(nodes[i - 1], nodes[i])) { write(", "); } else { @@ -828,7 +787,7 @@ module ts { decreaseIndent(); - if (preserveNewLines && nodeEndPositionsAreOnSameLine(parent, lastOrUndefined(nodes))) { + if (nodeEndPositionsAreOnSameLine(parent, lastOrUndefined(nodes))) { if (spacesBetweenBraces) { write(" "); } @@ -838,27 +797,34 @@ module ts { } } - function emitList(nodes: Node[], start: number, count: number, multiLine: boolean, trailingComma: boolean) { + function emitList(nodes: TNode[], start: number, count: number, multiLine: boolean, trailingComma: boolean, leadingComma?: boolean, noTrailingNewLine?: boolean, emitNode?: (node: TNode) => void): number { + if (!emitNode) { + emitNode = emit; + } + for (let i = 0; i < count; i++) { if (multiLine) { - if (i) { + if (i || leadingComma) { write(","); } writeLine(); } else { - if (i) { + if (i || leadingComma) { write(", "); } } - emit(nodes[start + i]); + emitNode(nodes[start + i]); + leadingComma = true; } if (trailingComma) { write(","); } - if (multiLine) { + if (multiLine && !noTrailingNewLine) { writeLine(); } + + return count; } function emitCommaList(nodes: Node[]) { @@ -982,7 +948,7 @@ module ts { } function emitDownlevelTaggedTemplate(node: TaggedTemplateExpression) { - let tempVariable = createAndRecordTempVariable(node); + let tempVariable = createAndRecordTempVariable(TempFlags.Auto); write("("); emit(tempVariable); write(" = "); @@ -1170,18 +1136,16 @@ module ts { if (!computedPropertyNamesToGeneratedNames) { computedPropertyNamesToGeneratedNames = []; } - - let generatedName = computedPropertyNamesToGeneratedNames[node.id]; + + let generatedName = computedPropertyNamesToGeneratedNames[getNodeId(node)]; if (generatedName) { // we have already generated a variable for this node, write that value instead. write(generatedName); return; } - let generatedVariable = createTempVariable(node); - generatedName = generatedVariable.text; - recordTempDeclaration(generatedVariable); - computedPropertyNamesToGeneratedNames[node.id] = generatedName; + generatedName = createAndRecordTempVariable(TempFlags.Auto).text; + computedPropertyNamesToGeneratedNames[getNodeId(node)] = generatedName; write(generatedName); write(" = "); } @@ -1417,211 +1381,163 @@ module ts { } } - function emitDownlevelObjectLiteralWithComputedProperties(node: ObjectLiteralExpression, firstComputedPropertyIndex: number): void { - let parenthesizedObjectLiteral = createDownlevelObjectLiteralWithComputedProperties(node, firstComputedPropertyIndex); - return emit(parenthesizedObjectLiteral); + function emitObjectLiteralBody(node: ObjectLiteralExpression, numElements: number): void { + if (numElements === 0) { + write("{}"); + return; + } + + write("{"); + + if (numElements > 0) { + var properties = node.properties; + + // If we are not doing a downlevel transformation for object literals, + // then try to preserve the original shape of the object literal. + // Otherwise just try to preserve the formatting. + if (numElements === properties.length) { + emitLinePreservingList(node, properties, /* allowTrailingComma */ languageVersion >= ScriptTarget.ES5, /* spacesBetweenBraces */ true); + } + else { + let multiLine = (node.flags & NodeFlags.MultiLine) !== 0; + if (!multiLine) { + write(" "); + } + else { + increaseIndent(); + } + + emitList(properties, 0, numElements, /*multiLine*/ multiLine, /*trailingComma*/ false); + + if (!multiLine) { + write(" "); + } + else { + decreaseIndent(); + } + } + } + + write("}"); } - function createDownlevelObjectLiteralWithComputedProperties(originalObjectLiteral: ObjectLiteralExpression, firstComputedPropertyIndex: number): ParenthesizedExpression { + function emitDownlevelObjectLiteralWithComputedProperties(node: ObjectLiteralExpression, firstComputedPropertyIndex: number) { + let multiLine = (node.flags & NodeFlags.MultiLine) !== 0; + let properties = node.properties; + + write("("); + + if (multiLine) { + increaseIndent(); + } + // For computed properties, we need to create a unique handle to the object // literal so we can modify it without risking internal assignments tainting the object. - let tempVar = createAndRecordTempVariable(originalObjectLiteral); + let tempVar = createAndRecordTempVariable(TempFlags.Auto); - // Hold onto the initial non-computed properties in a new object literal, - // then create the rest through property accesses on the temp variable. - let initialObjectLiteral = createSynthesizedNode(SyntaxKind.ObjectLiteralExpression); - initialObjectLiteral.properties = >originalObjectLiteral.properties.slice(0, firstComputedPropertyIndex); - initialObjectLiteral.flags |= NodeFlags.MultiLine; + // Write out the first non-computed properties + // (or all properties if none of them are computed), + // then emit the rest through indexing on the temp variable. + emit(tempVar) + write(" = "); + emitObjectLiteralBody(node, firstComputedPropertyIndex); - // The comma expressions that will patch the object literal. - // This will end up being something like '_a = { ... }, _a.x = 10, _a.y = 20, _a'. - let propertyPatches = createBinaryExpression(tempVar, SyntaxKind.EqualsToken, initialObjectLiteral); + for (let i = firstComputedPropertyIndex, n = properties.length; i < n; i++) { + writeComma(); - ts.forEach(originalObjectLiteral.properties, property => { - let patchedProperty = tryCreatePatchingPropertyAssignment(originalObjectLiteral, tempVar, property); - if (patchedProperty) { - // TODO(drosen): Preserve comments - //let leadingComments = getLeadingCommentRanges(currentSourceFile.text, property.pos); - //let trailingComments = getTrailingCommentRanges(currentSourceFile.text, property.end); - //addCommentsToSynthesizedNode(patchedProperty, leadingComments, trailingComments); + let property = properties[i]; - propertyPatches = createBinaryExpression(propertyPatches, SyntaxKind.CommaToken, patchedProperty); + emitStart(property) + if (property.kind === SyntaxKind.GetAccessor || property.kind === SyntaxKind.SetAccessor) { + // TODO (drosen): Reconcile with 'emitMemberFunctions'. + let accessors = getAllAccessorDeclarations(node.properties, property); + if (property !== accessors.firstAccessor) { + continue; + } + write("Object.defineProperty("); + emit(tempVar); + write(", "); + emitStart(node.name); + emitExpressionForPropertyName(property.name); + emitEnd(property.name); + write(", {"); + increaseIndent(); + if (accessors.getAccessor) { + writeLine() + emitLeadingComments(accessors.getAccessor); + write("get: "); + emitStart(accessors.getAccessor); + write("function "); + emitSignatureAndBody(accessors.getAccessor); + emitEnd(accessors.getAccessor); + emitTrailingComments(accessors.getAccessor); + write(","); + } + if (accessors.setAccessor) { + writeLine(); + emitLeadingComments(accessors.setAccessor); + write("set: "); + emitStart(accessors.setAccessor); + write("function "); + emitSignatureAndBody(accessors.setAccessor); + emitEnd(accessors.setAccessor); + emitTrailingComments(accessors.setAccessor); + write(","); + } + writeLine(); + write("enumerable: true,"); + writeLine(); + write("configurable: true"); + decreaseIndent(); + writeLine(); + write("})"); + emitEnd(property); } - }); + else { + emitLeadingComments(property); + emitStart(property.name); + emit(tempVar); + emitMemberAccessForPropertyName(property.name); + emitEnd(property.name); - // Finally, return the temp variable. - propertyPatches = createBinaryExpression(propertyPatches, SyntaxKind.CommaToken, createIdentifier(tempVar.text, /*startsOnNewLine:*/ true)); + write(" = "); - let result = createParenthesizedExpression(propertyPatches); - - // TODO(drosen): Preserve comments - // let leadingComments = getLeadingCommentRanges(currentSourceFile.text, originalObjectLiteral.pos); - // let trailingComments = getTrailingCommentRanges(currentSourceFile.text, originalObjectLiteral.end); - //addCommentsToSynthesizedNode(result, leadingComments, trailingComments); - - return result; - } - - function addCommentsToSynthesizedNode(node: SynthesizedNode, leadingCommentRanges: CommentRange[], trailingCommentRanges: CommentRange[]): void { - node.leadingCommentRanges = leadingCommentRanges; - node.trailingCommentRanges = trailingCommentRanges; - } - - // Returns 'undefined' if a property has already been accounted for - // (e.g. a 'get' accessor which has already been emitted along with its 'set' accessor). - function tryCreatePatchingPropertyAssignment(objectLiteral: ObjectLiteralExpression, tempVar: Identifier, property: ObjectLiteralElement): Expression { - let leftHandSide = createMemberAccessForPropertyName(tempVar, property.name); - let maybeRightHandSide = tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral, property); - - return maybeRightHandSide && createBinaryExpression(leftHandSide, SyntaxKind.EqualsToken, maybeRightHandSide, /*startsOnNewLine:*/ true); - } - - function tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral: ObjectLiteralExpression, property: ObjectLiteralElement) { - switch (property.kind) { - case SyntaxKind.PropertyAssignment: - return (property).initializer; - - case SyntaxKind.ShorthandPropertyAssignment: - // TODO: (andersh) Technically it isn't correct to make an identifier here since getExpressionNamePrefix returns - // a string containing a dotted name. In general I'm not a fan of mini tree rewriters as this one, elsewhere we - // manage by just emitting strings (which is a lot more performant). - //let prefix = createIdentifier(resolver.getExpressionNamePrefix((property).name)); - //return createPropertyAccessExpression(prefix, (property).name); - return createIdentifier(resolver.getExpressionNameSubstitution((property).name, getGeneratedNameForNode)); - - case SyntaxKind.MethodDeclaration: - return createFunctionExpression((property).parameters, (property).body); - - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - let { firstAccessor, getAccessor, setAccessor } = getAllAccessorDeclarations(objectLiteral.properties, property); - - // Only emit the first accessor. - if (firstAccessor !== property) { - return undefined; + if (property.kind === SyntaxKind.PropertyAssignment) { + emit((property).initializer); } - - let propertyDescriptor = createSynthesizedNode(SyntaxKind.ObjectLiteralExpression); - - let descriptorProperties = >[]; - if (getAccessor) { - let getProperty = createPropertyAssignment(createIdentifier("get"), createFunctionExpression(getAccessor.parameters, getAccessor.body)); - descriptorProperties.push(getProperty); + else if (property.kind === SyntaxKind.ShorthandPropertyAssignment) { + emitExpressionIdentifier((property).name); } - if (setAccessor) { - let setProperty = createPropertyAssignment(createIdentifier("set"), createFunctionExpression(setAccessor.parameters, setAccessor.body)); - descriptorProperties.push(setProperty); + else if (property.kind === SyntaxKind.MethodDeclaration) { + emitFunctionDeclaration(property); } + else { + Debug.fail("ObjectLiteralElement type not accounted for: " + property.kind); + } + } - let trueExpr = createSynthesizedNode(SyntaxKind.TrueKeyword); - - let enumerableTrue = createPropertyAssignment(createIdentifier("enumerable"), trueExpr); - descriptorProperties.push(enumerableTrue); - - let configurableTrue = createPropertyAssignment(createIdentifier("configurable"), trueExpr); - descriptorProperties.push(configurableTrue); - - propertyDescriptor.properties = descriptorProperties; - - let objectDotDefineProperty = createPropertyAccessExpression(createIdentifier("Object"), createIdentifier("defineProperty")); - return createCallExpression(objectDotDefineProperty, createNodeArray(propertyDescriptor)); - - default: - Debug.fail(`ObjectLiteralElement kind ${property.kind} not accounted for.`); + emitEnd(property); } - } - function createParenthesizedExpression(expression: Expression) { - let result = createSynthesizedNode(SyntaxKind.ParenthesizedExpression); - result.expression = expression; + writeComma(); + emit(tempVar); - return result; - } - - function createNodeArray(...elements: T[]): NodeArray { - let result = >elements; - result.pos = -1; - result.end = -1; - - return result; - } - - function createBinaryExpression(left: Expression, operator: SyntaxKind, right: Expression, startsOnNewLine?: boolean): BinaryExpression { - let result = createSynthesizedNode(SyntaxKind.BinaryExpression, startsOnNewLine); - result.operatorToken = createSynthesizedNode(operator); - result.left = left; - result.right = right; - - return result; - } - - function createExpressionStatement(expression: Expression): ExpressionStatement { - let result = createSynthesizedNode(SyntaxKind.ExpressionStatement); - result.expression = expression; - return result; - } - - function createMemberAccessForPropertyName(expression: LeftHandSideExpression, memberName: DeclarationName): PropertyAccessExpression | ElementAccessExpression { - if (memberName.kind === SyntaxKind.Identifier) { - return createPropertyAccessExpression(expression, memberName); + if (multiLine) { + decreaseIndent(); + writeLine(); } - else if (memberName.kind === SyntaxKind.StringLiteral || memberName.kind === SyntaxKind.NumericLiteral) { - return createElementAccessExpression(expression, memberName); + + write(")"); + + function writeComma() { + if (multiLine) { + write(","); + writeLine(); + } + else { + write(", "); + } } - else if (memberName.kind === SyntaxKind.ComputedPropertyName) { - return createElementAccessExpression(expression, (memberName).expression); - } - else { - Debug.fail(`Kind '${memberName.kind}' not accounted for.`); - } - } - - function createPropertyAssignment(name: LiteralExpression | Identifier, initializer: Expression) { - let result = createSynthesizedNode(SyntaxKind.PropertyAssignment); - result.name = name; - result.initializer = initializer; - - return result; - } - - function createFunctionExpression(parameters: NodeArray, body: Block): FunctionExpression { - let result = createSynthesizedNode(SyntaxKind.FunctionExpression); - result.parameters = parameters; - result.body = body; - - return result; - } - - function createPropertyAccessExpression(expression: LeftHandSideExpression, name: Identifier): PropertyAccessExpression { - let result = createSynthesizedNode(SyntaxKind.PropertyAccessExpression); - result.expression = expression; - result.dotToken = createSynthesizedNode(SyntaxKind.DotToken); - result.name = name; - - return result; - } - - function createElementAccessExpression(expression: LeftHandSideExpression, argumentExpression: Expression): ElementAccessExpression { - let result = createSynthesizedNode(SyntaxKind.ElementAccessExpression); - result.expression = expression; - result.argumentExpression = argumentExpression; - - return result; - } - - function createIdentifier(name: string, startsOnNewLine?: boolean) { - let result = createSynthesizedNode(SyntaxKind.Identifier, startsOnNewLine); - result.text = name; - - return result; - } - - function createCallExpression(invokedExpression: MemberExpression, arguments: NodeArray) { - let result = createSynthesizedNode(SyntaxKind.CallExpression); - result.expression = invokedExpression; - result.arguments = arguments; - - return result; } function emitObjectLiteral(node: ObjectLiteralExpression): void { @@ -1649,13 +1565,33 @@ module ts { // Ordinary case: either the object has no computed properties // or we're compiling with an ES6+ target. - write("{"); + emitObjectLiteralBody(node, properties.length); + } - if (properties.length) { - emitLinePreservingList(node, properties, /*allowTrailingComma:*/ languageVersion >= ScriptTarget.ES5, /*spacesBetweenBraces:*/ true) - } + function createBinaryExpression(left: Expression, operator: SyntaxKind, right: Expression, startsOnNewLine?: boolean): BinaryExpression { + let result = createSynthesizedNode(SyntaxKind.BinaryExpression, startsOnNewLine); + result.operatorToken = createSynthesizedNode(operator); + result.left = left; + result.right = right; - write("}"); + return result; + } + + function createPropertyAccessExpression(expression: LeftHandSideExpression, name: Identifier): PropertyAccessExpression { + let result = createSynthesizedNode(SyntaxKind.PropertyAccessExpression); + result.expression = expression; + result.dotToken = createSynthesizedNode(SyntaxKind.DotToken); + result.name = name; + + return result; + } + + function createElementAccessExpression(expression: LeftHandSideExpression, argumentExpression: Expression): ElementAccessExpression { + let result = createSynthesizedNode(SyntaxKind.ElementAccessExpression); + result.expression = expression; + result.argumentExpression = argumentExpression; + + return result; } function emitComputedPropertyName(node: ComputedPropertyName) { @@ -1711,6 +1647,11 @@ module ts { } function tryEmitConstantValue(node: PropertyAccessExpression | ElementAccessExpression): boolean { + if (compilerOptions.separateCompilation) { + // do not inline enum values in separate compilation mode + return false; + } + let constantValue = resolver.getConstantValue(node); if (constantValue !== undefined) { write(constantValue.toString()); @@ -1727,7 +1668,7 @@ module ts { // If the code is not indented, an optional valueToWriteWhenNotIndenting will be // emitted instead. function indentIfOnDifferentLines(parent: Node, node1: Node, node2: Node, valueToWriteWhenNotIndenting?: string): boolean { - let realNodesAreOnDifferentLines = preserveNewLines && !nodeIsSynthesized(parent) && !nodeEndIsOnSameLineAsNodeStart(node1, node2); + let realNodesAreOnDifferentLines = !nodeIsSynthesized(parent) && !nodeEndIsOnSameLineAsNodeStart(node1, node2); // Always use a newline for synthesized code if the synthesizer desires it. let synthesizedNodeIsOnDifferentLine = synthesizedNodeStartsOnNewLine(node2); @@ -1790,7 +1731,7 @@ module ts { emit(node); return node; } - let temp = createAndRecordTempVariable(node); + let temp = createAndRecordTempVariable(TempFlags.Auto); write("("); emit(temp); @@ -2035,7 +1976,7 @@ module ts { } function emitBlock(node: Block) { - if (preserveNewLines && isSingleLineEmptyBlock(node)) { + if (isSingleLineEmptyBlock(node)) { emitToken(SyntaxKind.OpenBraceToken, node.pos); write(" "); emitToken(SyntaxKind.CloseBraceToken, node.statements.end); @@ -2234,10 +2175,8 @@ module ts { // // we don't want to emit a temporary variable for the RHS, just use it directly. let rhsIsIdentifier = node.expression.kind === SyntaxKind.Identifier; - let counter = createTempVariable(node, TempVariableKind._i); - let rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(node); - - var cachedLength = compilerOptions.cacheDownlevelForOfLength ? createTempVariable(node, TempVariableKind._n) : undefined; + let counter = createTempVariable(TempFlags._i); + let rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(TempFlags.Auto); // This is the let keyword for the counter and rhsReference. The let keyword for // the LHS will be emitted inside the body. @@ -2259,14 +2198,6 @@ module ts { emitEnd(node.expression); } - if (cachedLength) { - write(", "); - emitNodeWithoutSourceMap(cachedLength); - write(" = "); - emitNodeWithoutSourceMap(rhsReference); - write(".length"); - } - write("; "); // _i < _a.length; @@ -2274,13 +2205,8 @@ module ts { emitNodeWithoutSourceMap(counter); write(" < "); - if (cachedLength) { - emitNodeWithoutSourceMap(cachedLength); - } - else { - emitNodeWithoutSourceMap(rhsReference); - write(".length"); - } + emitNodeWithoutSourceMap(rhsReference); + write(".length"); emitEnd(node.initializer); write("; "); @@ -2322,7 +2248,7 @@ module ts { else { // It's an empty declaration list. This can only happen in an error case, if the user wrote // for (let of []) {} - emitNodeWithoutSourceMap(createTempVariable(node)); + emitNodeWithoutSourceMap(createTempVariable(TempFlags.Auto)); write(" = "); emitNodeWithoutSourceMap(rhsIterationValue); } @@ -2419,7 +2345,7 @@ module ts { write("default:"); } - if (preserveNewLines && node.statements.length === 1 && nodeStartPositionsAreOnSameLine(node, node.statements[0])) { + if (node.statements.length === 1 && nodeStartPositionsAreOnSameLine(node, node.statements[0])) { write(" "); emit(node.statements[0]); } @@ -2509,11 +2435,11 @@ module ts { if (node.flags & NodeFlags.Export) { writeLine(); emitStart(node); - if (node.name) { - emitModuleMemberName(node); + if (node.flags & NodeFlags.Default) { + write("exports.default"); } else { - write("exports.default"); + emitModuleMemberName(node); } write(" = "); emitDeclarationName(node); @@ -2581,7 +2507,7 @@ module ts { // In case the root is a synthesized node, we need to pass lowestNonSynthesizedAncestor // as the location for determining uniqueness of the variable we are about to // generate. - let identifier = createTempVariable(lowestNonSynthesizedAncestor || root); + let identifier = createTempVariable(TempFlags.Auto); if (!isDeclaration) { recordTempDeclaration(identifier); } @@ -2860,11 +2786,7 @@ module ts { ? blockScopeContainer : blockScopeContainer.parent; - var hasConflictsInEnclosingScope = - resolver.resolvesToSomeValue(parent, (node).text) || - nameConflictsWithSomeTempVariable((node).text); - - if (hasConflictsInEnclosingScope) { + if (resolver.resolvesToSomeValue(parent, (node).text)) { let variableId = resolver.getBlockScopedVariableId(node); if (!blockScopedVariableToGeneratedName) { blockScopedVariableToGeneratedName = []; @@ -2900,7 +2822,7 @@ module ts { function emitParameter(node: ParameterDeclaration) { if (languageVersion < ScriptTarget.ES6) { if (isBindingPattern(node.name)) { - let name = createTempVariable(node); + let name = createTempVariable(TempFlags.Auto); if (!tempParameters) { tempParameters = []; } @@ -2954,7 +2876,7 @@ module ts { if (languageVersion < ScriptTarget.ES6 && hasRestParameters(node)) { let restIndex = node.parameters.length - 1; let restParam = node.parameters[restIndex]; - let tempName = createTempVariable(node, TempVariableKind._i).text; + let tempName = createTempVariable(TempFlags._i).text; writeLine(); emitLeadingComments(restParam); emitStart(restParam); @@ -3008,16 +2930,14 @@ module ts { } } - function shouldEmitFunctionName(node: Declaration): boolean { - // Emit a declaration name for the function iff: - // it is a function expression with a name provided - // it is a function declaration with a name provided - // it is a function declaration is not the default export, and is missing a name (emit a generated name for it) + function shouldEmitFunctionName(node: FunctionLikeDeclaration) { if (node.kind === SyntaxKind.FunctionExpression) { + // Emit name if one is present return !!node.name; } - else if (node.kind === SyntaxKind.FunctionDeclaration) { - return !!node.name || (languageVersion >= ScriptTarget.ES6 && !(node.flags & NodeFlags.Default)); + if (node.kind === SyntaxKind.FunctionDeclaration) { + // Emit name if one is present, or emit generated name in down-level case (for export default case) + return !!node.name || languageVersion < ScriptTarget.ES6; } } @@ -3087,15 +3007,12 @@ module ts { } function emitSignatureAndBody(node: FunctionLikeDeclaration) { - let saveTempCount = tempCount; + let saveTempFlags = tempFlags; let saveTempVariables = tempVariables; let saveTempParameters = tempParameters; - let savePredefinedTempsInUse = predefinedTempsInUse; - - tempCount = 0; + tempFlags = 0; tempVariables = undefined; tempParameters = undefined; - predefinedTempsInUse = TempVariableKind.auto; // When targeting ES6, emit arrow function natively in ES6 if (shouldEmitAsArrowFunction(node)) { @@ -3122,8 +3039,7 @@ module ts { emitExportMemberAssignment(node); } - predefinedTempsInUse = savePredefinedTempsInUse; - tempCount = saveTempCount; + tempFlags = saveTempFlags; tempVariables = saveTempVariables; tempParameters = saveTempParameters; } @@ -3169,7 +3085,7 @@ module ts { // If we didn't have to emit any preamble code, then attempt to keep the arrow // function on one line. - if (preserveNewLines && !preambleEmitted && nodeStartPositionsAreOnSameLine(node, body)) { + if (!preambleEmitted && nodeStartPositionsAreOnSameLine(node, body)) { write(" "); emitStart(body); write("return "); @@ -3217,7 +3133,7 @@ module ts { let preambleEmitted = writer.getTextPos() !== initialTextPos; - if (preserveNewLines && !preambleEmitted && nodeEndIsOnSameLineAsNodeStart(body, body)) { + if (!preambleEmitted && nodeEndIsOnSameLineAsNodeStart(body, body)) { for (let statement of body.statements) { write(" "); emit(statement); @@ -3288,33 +3204,58 @@ module ts { } } - function emitMemberAssignments(node: ClassDeclaration, staticFlag: NodeFlags) { - forEach(node.members, member => { - if (member.kind === SyntaxKind.PropertyDeclaration && (member.flags & NodeFlags.Static) === staticFlag && (member).initializer) { - writeLine(); - emitLeadingComments(member); - emitStart(member); - emitStart((member).name); - if (staticFlag) { - emitDeclarationName(node); - } - else { - write("this"); - } - emitMemberAccessForPropertyName((member).name); - emitEnd((member).name); - write(" = "); - emit((member).initializer); - write(";"); - emitEnd(member); - emitTrailingComments(member); + function getInitializedProperties(node: ClassLikeDeclaration, static: boolean) { + let properties: PropertyDeclaration[] = []; + for (let member of node.members) { + if (member.kind === SyntaxKind.PropertyDeclaration && static === ((member.flags & NodeFlags.Static) !== 0) && (member).initializer) { + properties.push(member); } - }); + } + + return properties; } - function emitMemberFunctionsForES5AndLower(node: ClassDeclaration) { + function emitPropertyDeclarations(node: ClassLikeDeclaration, properties: PropertyDeclaration[]) { + for (let property of properties) { + emitPropertyDeclaration(node, property); + } + } + + function emitPropertyDeclaration(node: ClassLikeDeclaration, property: PropertyDeclaration, receiver?: Identifier, isExpression?: boolean) { + writeLine(); + emitLeadingComments(property); + emitStart(property); + emitStart(property.name); + if (receiver) { + emit(receiver); + } + else { + if (property.flags & NodeFlags.Static) { + emitDeclarationName(node); + } + else { + write("this"); + } + } + emitMemberAccessForPropertyName(property.name); + emitEnd(property.name); + write(" = "); + emit(property.initializer); + if (!isExpression) { + write(";"); + } + + emitEnd(property); + emitTrailingComments(property); + } + + function emitMemberFunctionsForES5AndLower(node: ClassLikeDeclaration) { forEach(node.members, member => { - if (member.kind === SyntaxKind.MethodDeclaration || node.kind === SyntaxKind.MethodSignature) { + if (member.kind === SyntaxKind.SemicolonClassElement) { + writeLine(); + write(";"); + } + else if (member.kind === SyntaxKind.MethodDeclaration || node.kind === SyntaxKind.MethodSignature) { if (!(member).body) { return emitOnlyPinnedOrTripleSlashComments(member); } @@ -3382,12 +3323,14 @@ module ts { }); } - function emitMemberFunctionsForES6AndHigher(node: ClassDeclaration) { + function emitMemberFunctionsForES6AndHigher(node: ClassLikeDeclaration) { for (let member of node.members) { if ((member.kind === SyntaxKind.MethodDeclaration || node.kind === SyntaxKind.MethodSignature) && !(member).body) { emitOnlyPinnedOrTripleSlashComments(member); } - else if (member.kind === SyntaxKind.MethodDeclaration || node.kind === SyntaxKind.MethodSignature || member.kind === SyntaxKind.GetAccessor || member.kind === SyntaxKind.SetAccessor) { + else if (member.kind === SyntaxKind.MethodDeclaration || + member.kind === SyntaxKind.GetAccessor || + member.kind === SyntaxKind.SetAccessor) { writeLine(); emitLeadingComments(member); emitStart(member); @@ -3406,19 +3349,29 @@ module ts { emitEnd(member); emitTrailingComments(member); } + else if (member.kind === SyntaxKind.SemicolonClassElement) { + writeLine(); + write(";"); + } } } - function emitConstructor(node: ClassDeclaration, baseTypeNode: TypeReferenceNode) { - let saveTempCount = tempCount; + function emitConstructor(node: ClassLikeDeclaration, baseTypeElement: HeritageClauseElement) { + let saveTempFlags = tempFlags; let saveTempVariables = tempVariables; let saveTempParameters = tempParameters; - let savePredefinedTempsInUse = predefinedTempsInUse; - tempCount = 0; + tempFlags = 0; tempVariables = undefined; tempParameters = undefined; - predefinedTempsInUse = TempVariableKind.auto; + emitConstructorWorker(node, baseTypeElement); + + tempFlags = saveTempFlags; + tempVariables = saveTempVariables; + tempParameters = saveTempParameters; + } + + function emitConstructorWorker(node: ClassLikeDeclaration, baseTypeElement: HeritageClauseElement) { // 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 @@ -3465,7 +3418,7 @@ module ts { // Let constructor be the result of parsing the String "constructor(... args){ super (...args);}" using the syntactic grammar with the goal symbol MethodDefinition. // Else, // Let constructor be the result of parsing the String "constructor( ){ }" using the syntactic grammar with the goal symbol MethodDefinition - if (baseTypeNode) { + if (baseTypeElement) { write("(...args)"); } else { @@ -3484,7 +3437,7 @@ module ts { if (ctor) { emitDefaultValueAssignments(ctor); emitRestParameter(ctor); - if (baseTypeNode) { + if (baseTypeElement) { var superCall = findInitialSuperCall(ctor); if (superCall) { writeLine(); @@ -3494,19 +3447,19 @@ module ts { emitParameterPropertyAssignments(ctor); } else { - if (baseTypeNode) { + if (baseTypeElement) { writeLine(); - emitStart(baseTypeNode); + emitStart(baseTypeElement); if (languageVersion < ScriptTarget.ES6) { write("_super.apply(this, arguments);"); } else { write("super(...args);"); } - emitEnd(baseTypeNode); + emitEnd(baseTypeElement); } } - emitMemberAssignments(node, /*staticFlag*/0); + emitPropertyDeclarations(node, getInitializedProperties(node, /*static:*/ false)); if (ctor) { var statements: Node[] = (ctor.body).statements; if (superCall) { @@ -3526,90 +3479,118 @@ module ts { if (ctor) { emitTrailingComments(ctor); } + } - predefinedTempsInUse = savePredefinedTempsInUse; - tempCount = saveTempCount; - tempVariables = saveTempVariables; - tempParameters = saveTempParameters; + function emitClassExpression(node: ClassExpression) { + return emitClassLikeDeclaration(node); } function emitClassDeclaration(node: ClassDeclaration) { + return emitClassLikeDeclaration(node); + } + + function emitClassLikeDeclaration(node: ClassLikeDeclaration) { if (languageVersion < ScriptTarget.ES6) { - emitClassDeclarationBelowES6(node); + emitClassLikeDeclarationBelowES6(node); } else { - emitClassDeclarationForES6AndHigher(node); + emitClassLikeDeclarationForES6AndHigher(node); } } - function emitClassDeclarationForES6AndHigher(node: ClassDeclaration) { + function emitClassLikeDeclarationForES6AndHigher(node: ClassLikeDeclaration) { let thisNodeIsDecorated = nodeIsDecorated(node); - 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: - // - // * For a local class declaration: - // - // @dec class C { - // } - // - // The emit should be: - // - // let C = class { - // }; - // Object.defineProperty(C, "name", { value: "C", configurable: true }); - // C = __decorate([dec], C); - // - // * For an exported class declaration: - // - // @dec export class C { - // } - // - // The emit should be: - // - // export let C = class { - // }; - // Object.defineProperty(C, "name", { value: "C", configurable: true }); - // C = __decorate([dec], C); - // - // * For a default export of a class declaration with a name: - // - // @dec default export class C { - // } - // - // The emit should be: - // - // let C = class { - // } - // Object.defineProperty(C, "name", { value: "C", configurable: true }); - // C = __decorate([dec], C); - // export default C; - // - // * For a default export of a class declaration without a name: - // - // @dec default export class { - // } - // - // The emit should be: - // - // let _default = class { - // } - // _default = __decorate([dec], _default); - // export default _default; - // - if (isES6ExportedDeclaration(node) && !(node.flags & NodeFlags.Default)) { - write("export "); - } + if (node.kind === SyntaxKind.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: + // + // * For a local class declaration: + // + // @dec class C { + // } + // + // The emit should be: + // + // let C = class { + // }; + // Object.defineProperty(C, "name", { value: "C", configurable: true }); + // C = __decorate([dec], C); + // + // * For an exported class declaration: + // + // @dec export class C { + // } + // + // The emit should be: + // + // export let C = class { + // }; + // Object.defineProperty(C, "name", { value: "C", configurable: true }); + // C = __decorate([dec], C); + // + // * For a default export of a class declaration with a name: + // + // @dec default export class C { + // } + // + // The emit should be: + // + // let C = class { + // } + // Object.defineProperty(C, "name", { value: "C", configurable: true }); + // C = __decorate([dec], C); + // export default C; + // + // * For a default export of a class declaration without a name: + // + // @dec default export class { + // } + // + // The emit should be: + // + // let _default = class { + // } + // _default = __decorate([dec], _default); + // export default _default; + // + if (isES6ExportedDeclaration(node) && !(node.flags & NodeFlags.Default)) { + write("export "); + } - write("let "); - emitDeclarationName(node); - write(" = "); - } - else if (isES6ExportedDeclaration(node)) { - write("export "); - if (node.flags & NodeFlags.Default) { - write("default "); + write("let "); + emitDeclarationName(node); + write(" = "); } + else if (isES6ExportedDeclaration(node)) { + write("export "); + if (node.flags & NodeFlags.Default) { + write("default "); + } + } + } + + // If the class has static properties, and it's a class expression, then we'll need + // to specialize the emit a bit. for a class expression of the form: + // + // class C { static a = 1; static b = 2; ... } + // + // We'll emit: + // + // (_temp = class C { ... }, _temp.a = 1, _temp.b = 2, _temp) + // + // This keeps the expression as an expression, while ensuring that the static parts + // of it have been initialized by the time it is used. + let staticProperties = getInitializedProperties(node, /*static:*/ true); + let isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === SyntaxKind.ClassExpression; + let tempVariable: Identifier; + + if (isClassExpressionWithStaticProperties) { + tempVariable = createAndRecordTempVariable(TempFlags.Auto); + write("("); + increaseIndent(); + emit(tempVariable); + write(" = ") } write("class"); @@ -3620,10 +3601,10 @@ module ts { emitDeclarationName(node); } - var baseTypeNode = getClassBaseTypeNode(node); + var baseTypeNode = getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { write(" extends "); - emit(baseTypeNode.typeName); + emit(baseTypeNode.expression); } write(" {"); @@ -3662,9 +3643,24 @@ module ts { // From ES6 specification: // HasLexicalDeclaration (N) : Determines if the argument identifier has a binding in this environment record that was created using // a lexical declaration such as a LexicalDeclaration or a ClassDeclaration. - writeLine(); - emitMemberAssignments(node, NodeFlags.Static); - emitDecoratorsOfClass(node); + + if (isClassExpressionWithStaticProperties) { + for (var property of staticProperties) { + write(","); + writeLine(); + emitPropertyDeclaration(node, property, /*receiver:*/ tempVariable, /*isExpression:*/ true); + } + write(","); + writeLine(); + emit(tempVariable); + decreaseIndent(); + write(")"); + } + else { + writeLine(); + emitPropertyDeclarations(node, staticProperties); + emitDecoratorsOfClass(node); + } // If this is an exported class, but not on the top level (i.e. on an internal // module), export it @@ -3686,20 +3682,24 @@ module ts { } } - function emitClassDeclarationBelowES6(node: ClassDeclaration) { - write("var "); - emitDeclarationName(node); - write(" = (function ("); - let baseTypeNode = getClassBaseTypeNode(node); + function emitClassLikeDeclarationBelowES6(node: ClassLikeDeclaration) { + if (node.kind === SyntaxKind.ClassDeclaration) { + write("var "); + emitDeclarationName(node); + write(" = "); + } + + write("(function ("); + let baseTypeNode = getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { write("_super"); } write(") {"); - let saveTempCount = tempCount; + let saveTempFlags = tempFlags; let saveTempVariables = tempVariables; let saveTempParameters = tempParameters; let saveComputedPropertyNamesToGeneratedNames = computedPropertyNamesToGeneratedNames; - tempCount = 0; + tempFlags = 0; tempVariables = undefined; tempParameters = undefined; computedPropertyNamesToGeneratedNames = undefined; @@ -3716,7 +3716,7 @@ module ts { writeLine(); emitConstructor(node, baseTypeNode); emitMemberFunctionsForES5AndLower(node); - emitMemberAssignments(node, NodeFlags.Static); + emitPropertyDeclarations(node, getInitializedProperties(node, /*static:*/ true)); writeLine(); emitDecoratorsOfClass(node); writeLine(); @@ -3726,7 +3726,7 @@ module ts { }); write(";"); emitTempDeclarations(/*newLine*/ true); - tempCount = saveTempCount; + tempFlags = saveTempFlags; tempVariables = saveTempVariables; tempParameters = saveTempParameters; computedPropertyNamesToGeneratedNames = saveComputedPropertyNamesToGeneratedNames; @@ -3737,38 +3737,43 @@ module ts { emitStart(node); write(")("); if (baseTypeNode) { - emit(baseTypeNode.typeName); + emit(baseTypeNode.expression); + } + write(")"); + if (node.kind === SyntaxKind.ClassDeclaration) { + write(";"); } - write(");"); emitEnd(node); - emitExportMemberAssignment(node); + if (node.kind === SyntaxKind.ClassDeclaration) { + emitExportMemberAssignment(node); + } if (languageVersion < ScriptTarget.ES6 && node.parent === currentSourceFile && node.name) { emitExportMemberAssignments(node.name); } } - function emitClassMemberPrefix(node: ClassDeclaration, member: Node) { + function emitClassMemberPrefix(node: ClassLikeDeclaration, member: Node) { emitDeclarationName(node); if (!(member.flags & NodeFlags.Static)) { write(".prototype"); } } - function emitDecoratorsOfClass(node: ClassDeclaration) { + function emitDecoratorsOfClass(node: ClassLikeDeclaration) { emitDecoratorsOfMembers(node, /*staticFlag*/ 0); emitDecoratorsOfMembers(node, NodeFlags.Static); emitDecoratorsOfConstructor(node); } - function emitDecoratorsOfConstructor(node: ClassDeclaration) { + function emitDecoratorsOfConstructor(node: ClassLikeDeclaration) { + let decorators = node.decorators; let constructor = getFirstConstructorWithBody(node); - if (constructor) { - emitDecoratorsOfParameters(node, constructor); - } + let hasDecoratedParameters = constructor && forEach(constructor.parameters, nodeIsDecorated); - if (!nodeIsDecorated(node)) { + // skip decoration of the constructor if neither it nor its parameters are decorated + if (!decorators && !hasDecoratedParameters) { return; } @@ -3786,81 +3791,104 @@ module ts { writeLine(); emitStart(node); emitDeclarationName(node); - write(" = "); - emitDecorateStart(node.decorators); + write(" = __decorate(["); + increaseIndent(); + writeLine(); + + let decoratorCount = decorators ? decorators.length : 0; + let argumentsWritten = emitList(decorators, 0, decoratorCount, /*multiLine*/ true, /*trailingComma*/ false, /*leadingComma*/ false, /*noTrailingNewLine*/ true, decorator => { + emitStart(decorator); + emit(decorator.expression); + emitEnd(decorator); + }); + + argumentsWritten += emitDecoratorsOfParameters(constructor, /*leadingComma*/ argumentsWritten > 0); + emitSerializedTypeMetadata(node, /*leadingComma*/ argumentsWritten >= 0); + + decreaseIndent(); + writeLine(); + write("], "); emitDeclarationName(node); write(");"); emitEnd(node); writeLine(); } - function emitDecoratorsOfMembers(node: ClassDeclaration, staticFlag: NodeFlags) { - forEach(node.members, member => { + function emitDecoratorsOfMembers(node: ClassLikeDeclaration, staticFlag: NodeFlags) { + for (let member of node.members) { + // only emit members in the correct group if ((member.flags & NodeFlags.Static) !== staticFlag) { - return; + continue; } + // skip members that cannot be decorated (such as the constructor) + if (!nodeCanBeDecorated(member)) { + continue; + } + + // skip a member if it or any of its parameters are not decorated + if (!nodeOrChildIsDecorated(member)) { + continue; + } + + // skip an accessor declaration if it is not the first accessor let decorators: NodeArray; - switch (member.kind) { - case SyntaxKind.MethodDeclaration: - // emit decorators of the method's parameters - emitDecoratorsOfParameters(node, member); - decorators = member.decorators; - break; + let functionLikeMember: FunctionLikeDeclaration; + if (isAccessor(member)) { + let accessors = getAllAccessorDeclarations(node.members, member); + if (member !== accessors.firstAccessor) { + continue; + } - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - let accessors = getAllAccessorDeclarations(node.members, member); - if (member !== accessors.firstAccessor) { - // skip the second accessor as we processed it with the first. - return; - } + // get the decorators from the first accessor with decorators + decorators = accessors.firstAccessor.decorators; + if (!decorators && accessors.secondAccessor) { + decorators = accessors.secondAccessor.decorators; + } - if (accessors.setAccessor) { - // emit decorators of the set accessor parameter - emitDecoratorsOfParameters(node, accessors.setAccessor); - } - - // get the decorators from the first decorated accessor. - decorators = accessors.firstAccessor.decorators; - if (!decorators && accessors.secondAccessor) { - decorators = accessors.secondAccessor.decorators; - } - break; - - case SyntaxKind.PropertyDeclaration: - decorators = member.decorators; - break; - - default: - // Constructor cannot be decorated, and its parameters are handled in emitDecoratorsOfConstructor - // Other members (i.e. IndexSignature) cannot be decorated. - return; + // we only decorate parameters of the set accessor + functionLikeMember = accessors.setAccessor; } + else { + decorators = member.decorators; - if (!decorators) { - return; + // we only decorate the parameters here if this is a method + if (member.kind === SyntaxKind.MethodDeclaration) { + functionLikeMember = member; + } } // Emit the call to __decorate. Given the following: // // class C { - // @dec method() {} + // @dec method(@dec2 x) {} // @dec get accessor() {} // @dec prop; // } // // The emit for a method is: // - // Object.defineProperty(C.prototype, "method", __decorate([dec], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); + // Object.defineProperty(C.prototype, "method", + // __decorate([ + // dec, + // __param(0, dec2), + // __metadata("design:type", Function), + // __metadata("design:paramtypes", [Object]), + // __metadata("design:returntype", void 0) + // ], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); // // The emit for an accessor is: // - // Object.defineProperty(C.prototype, "accessor", __decorate([dec], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor"))); + // Object.defineProperty(C.prototype, "accessor", + // __decorate([ + // dec + // ], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor"))); // // The emit for a property is: // - // __decorate([dec], C.prototype, "prop"); + // __decorate([ + // dec + // ], C.prototype, "prop"); // writeLine(); @@ -3872,10 +3900,28 @@ module ts { write(", "); emitExpressionForPropertyName(member.name); emitEnd(member.name); - write(", "); + write(","); + increaseIndent(); + writeLine(); } - emitDecorateStart(decorators); + write("__decorate(["); + increaseIndent(); + writeLine(); + + let decoratorCount = decorators ? decorators.length : 0; + let argumentsWritten = emitList(decorators, 0, decoratorCount, /*multiLine*/ true, /*trailingComma*/ false, /*leadingComma*/ false, /*noTrailingNewLine*/ true, decorator => { + emitStart(decorator); + emit(decorator.expression); + emitEnd(decorator); + }); + + argumentsWritten += emitDecoratorsOfParameters(functionLikeMember, argumentsWritten > 0); + emitSerializedTypeMetadata(member, argumentsWritten > 0); + + decreaseIndent(); + writeLine(); + write("], "); emitStart(member.name); emitClassMemberPrefix(node, member); write(", "); @@ -3890,78 +3936,150 @@ module ts { emitExpressionForPropertyName(member.name); emitEnd(member.name); write("))"); + decreaseIndent(); } write(");"); emitEnd(member); writeLine(); - }); - } - - function emitDecoratorsOfParameters(node: ClassDeclaration, member: FunctionLikeDeclaration) { - forEach(member.parameters, (parameter, parameterIndex) => { - if (!nodeIsDecorated(parameter)) { - return; - } - - // Emit the decorators for a parameter. Given the following: - // - // class C { - // constructor(@dec p) { } - // method(@dec p) { } - // set accessor(@dec value) { } - // } - // - // The emit for a constructor is: - // - // __decorate([dec], C, void 0, 0); - // - // The emit for a parameter is: - // - // __decorate([dec], C.prototype, "method", 0); - // - // The emit for an accessor is: - // - // __decorate([dec], C.prototype, "accessor", 0); - // - - writeLine(); - emitStart(parameter); - emitDecorateStart(parameter.decorators); - emitStart(parameter.name); - - if (member.kind === SyntaxKind.Constructor) { - emitDeclarationName(node); - write(", void 0"); - } - else { - emitClassMemberPrefix(node, member); - write(", "); - emitExpressionForPropertyName(member.name); - } - - write(", "); - write(String(parameterIndex)); - emitEnd(parameter.name); - write(");"); - emitEnd(parameter); - writeLine(); - }); - } - - function emitDecorateStart(decorators: Decorator[]): void { - write("__decorate(["); - let decoratorCount = decorators.length; - for (let i = 0; i < decoratorCount; i++) { - if (i > 0) { - write(", "); - } - let decorator = decorators[i]; - emitStart(decorator); - emit(decorator.expression); - emitEnd(decorator); } - write("], "); + } + + function emitDecoratorsOfParameters(node: FunctionLikeDeclaration, leadingComma: boolean): number { + let argumentsWritten = 0; + if (node) { + let parameterIndex = 0; + for (let parameter of node.parameters) { + if (nodeIsDecorated(parameter)) { + let decorators = parameter.decorators; + argumentsWritten += emitList(decorators, 0, decorators.length, /*multiLine*/ true, /*trailingComma*/ false, /*leadingComma*/ leadingComma, /*noTrailingNewLine*/ true, decorator => { + emitStart(decorator); + write(`__param(${parameterIndex}, `); + emit(decorator.expression); + write(")"); + emitEnd(decorator); + }); + leadingComma = true; + } + ++parameterIndex; + } + } + return argumentsWritten; + } + + function shouldEmitTypeMetadata(node: Declaration): boolean { + // This method determines whether to emit the "design:type" metadata based on the node's kind. + // The caller should have already tested whether the node has decorators and whether the emitDecoratorMetadata + // compiler option is set. + switch (node.kind) { + case SyntaxKind.MethodDeclaration: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.PropertyDeclaration: + return true; + } + + return false; + } + + function shouldEmitReturnTypeMetadata(node: Declaration): boolean { + // This method determines whether to emit the "design:returntype" metadata based on the node's kind. + // The caller should have already tested whether the node has decorators and whether the emitDecoratorMetadata + // compiler option is set. + switch (node.kind) { + case SyntaxKind.MethodDeclaration: + return true; + } + return false; + } + + function shouldEmitParamTypesMetadata(node: Declaration): boolean { + // This method determines whether to emit the "design:paramtypes" metadata based on the node's kind. + // The caller should have already tested whether the node has decorators and whether the emitDecoratorMetadata + // compiler option is set. + switch (node.kind) { + case SyntaxKind.ClassDeclaration: + case SyntaxKind.MethodDeclaration: + case SyntaxKind.SetAccessor: + return true; + } + return false; + } + + function emitSerializedTypeMetadata(node: Declaration, writeComma: boolean): number { + // This method emits the serialized type metadata for a decorator target. + // The caller should have already tested whether the node has decorators. + let argumentsWritten = 0; + if (compilerOptions.emitDecoratorMetadata) { + if (shouldEmitTypeMetadata(node)) { + var serializedType = resolver.serializeTypeOfNode(node, getGeneratedNameForNode); + if (serializedType) { + if (writeComma) { + write(", "); + } + writeLine(); + write("__metadata('design:type', "); + emitSerializedType(node, serializedType); + write(")"); + argumentsWritten++; + } + } + if (shouldEmitParamTypesMetadata(node)) { + var serializedTypes = resolver.serializeParameterTypesOfNode(node, getGeneratedNameForNode); + if (serializedTypes) { + if (writeComma || argumentsWritten) { + write(", "); + } + writeLine(); + write("__metadata('design:paramtypes', ["); + for (var i = 0; i < serializedTypes.length; ++i) { + if (i > 0) { + write(", "); + } + emitSerializedType(node, serializedTypes[i]); + } + write("])"); + argumentsWritten++; + } + } + if (shouldEmitReturnTypeMetadata(node)) { + var serializedType = resolver.serializeReturnTypeOfNode(node, getGeneratedNameForNode); + if (serializedType) { + if (writeComma || argumentsWritten) { + write(", "); + } + writeLine(); + write("__metadata('design:returntype', "); + emitSerializedType(node, serializedType); + write(")"); + argumentsWritten++; + } + } + } + return argumentsWritten; + } + + function serializeTypeNameSegment(location: Node, path: string[], index: number): string { + switch (index) { + case 0: + return `typeof ${path[index]} !== 'undefined' && ${path[index]}`; + case 1: + return `${serializeTypeNameSegment(location, path, index - 1) }.${path[index]}`; + default: + let temp = createAndRecordTempVariable(TempFlags.Auto).text; + return `(${temp} = ${serializeTypeNameSegment(location, path, index - 1) }) && ${temp}.${path[index]}`; + } + } + + function emitSerializedType(location: Node, name: string | string[]): void { + if (typeof name === "string") { + write(name); + return; + } + else { + Debug.assert(name.length > 0, "Invalid serialized type name"); + write(`(${serializeTypeNameSegment(location, name, name.length - 1) }) || Object`); + } } function emitInterfaceDeclaration(node: InterfaceDeclaration) { @@ -3970,7 +4088,7 @@ module ts { function shouldEmitEnumDeclaration(node: EnumDeclaration) { let isConstEnum = isConst(node); - return !isConstEnum || compilerOptions.preserveConstEnums; + return !isConstEnum || compilerOptions.preserveConstEnums || compilerOptions.separateCompilation; } function emitEnumDeclaration(node: EnumDeclaration) { @@ -4062,7 +4180,7 @@ module ts { } function shouldEmitModuleDeclaration(node: ModuleDeclaration) { - return isInstantiatedModule(node, compilerOptions.preserveConstEnums); + return isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation); } function emitModuleDeclaration(node: ModuleDeclaration) { @@ -4089,17 +4207,14 @@ module ts { emitEnd(node.name); write(") "); if (node.body.kind === SyntaxKind.ModuleBlock) { - let saveTempCount = tempCount; + let saveTempFlags = tempFlags; let saveTempVariables = tempVariables; - let savePredefinedTempsInUse = predefinedTempsInUse; - tempCount = 0; + tempFlags = 0; tempVariables = undefined; - predefinedTempsInUse = TempVariableKind.auto; emit(node.body); - predefinedTempsInUse = savePredefinedTempsInUse; - tempCount = saveTempCount; + tempFlags = saveTempFlags; tempVariables = saveTempVariables; } else { @@ -4597,7 +4712,7 @@ module ts { return statements.length; } - function writeHelper(text: string): void { + function writeLines(text: string): void { let lines = text.split(/\r\n|\r|\n/g); for (let i = 0; i < lines.length; ++i) { let line = lines[i]; @@ -4616,41 +4731,25 @@ module ts { // 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 if. + // For target ES6 and above, we can emit classDeclaration as is. if ((languageVersion < ScriptTarget.ES6) && (!extendsEmitted && resolver.getNodeCheckFlags(node) & NodeCheckFlags.EmitExtends)) { - writeLine(); - write("var __extends = this.__extends || function (d, b) {"); - increaseIndent(); - writeLine(); - write("for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];"); - writeLine(); - write("function __() { this.constructor = d; }"); - writeLine(); - write("__.prototype = b.prototype;"); - writeLine(); - write("d.prototype = new __();"); - decreaseIndent(); - writeLine(); - write("};"); + writeLines(extendsHelper); extendsEmitted = true; } + if (!decorateEmitted && resolver.getNodeCheckFlags(node) & NodeCheckFlags.EmitDecorate) { - writeHelper(` -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } - } - return value; -};`); + writeLines(decorateHelper); + if (compilerOptions.emitDecoratorMetadata) { + writeLines(metadataHelper); + } decorateEmitted = true; } + + if (!paramEmitted && resolver.getNodeCheckFlags(node) & NodeCheckFlags.EmitParam) { + writeLines(paramHelper); + paramEmitted = true; + } + if (isExternalModule(node)) { if (languageVersion >= ScriptTarget.ES6) { emitES6Module(node, startIndex); @@ -4869,6 +4968,8 @@ var __decorate = this.__decorate || function (decorators, target, key, value) { return emitDebuggerStatement(node); case SyntaxKind.VariableDeclaration: return emitVariableDeclaration(node); + case SyntaxKind.ClassExpression: + return emitClassExpression(node); case SyntaxKind.ClassDeclaration: return emitClassDeclaration(node); case SyntaxKind.InterfaceDeclaration: diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 14311ccbc52..bde4cec3f3f 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -237,12 +237,13 @@ module ts { case SyntaxKind.Decorator: return visitNode(cbNode, (node).expression); case SyntaxKind.ClassDeclaration: + case SyntaxKind.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); + visitNode(cbNode, (node).name) || + visitNodes(cbNodes, (node).typeParameters) || + visitNodes(cbNodes, (node).heritageClauses) || + visitNodes(cbNodes, (node).members); case SyntaxKind.InterfaceDeclaration: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || @@ -308,6 +309,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.ExternalModuleReference: return visitNode(cbNode, (node).expression); case SyntaxKind.MissingDeclaration: @@ -324,7 +328,7 @@ module ts { TypeMembers, // Members in interface or type literal ClassMembers, // Members in class declaration EnumMembers, // Members in enum declaration - TypeReferences, // Type references in extends or implements clause + HeritageClauseElement, // Elements in a heritage clause VariableDeclarations, // Variable declarations in variable statement ObjectBindingElements, // Binding elements in object binding list ArrayBindingElements, // Binding elements in array binding list @@ -356,7 +360,7 @@ module ts { case ParsingContext.TypeMembers: return Diagnostics.Property_or_signature_expected; case ParsingContext.ClassMembers: return Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; case ParsingContext.EnumMembers: return Diagnostics.Enum_member_expected; - case ParsingContext.TypeReferences: return Diagnostics.Type_reference_expected; + case ParsingContext.HeritageClauseElement: return Diagnostics.Expression_expected; case ParsingContext.VariableDeclarations: return Diagnostics.Variable_declaration_expected; case ParsingContext.ObjectBindingElements: return Diagnostics.Property_destructuring_pattern_expected; case ParsingContext.ArrayBindingElements: return Diagnostics.Array_element_destructuring_pattern_expected; @@ -824,7 +828,7 @@ module ts { // to reuse are already at the appropriate position in the new text. That way when we // reuse them, we don't have to figure out if they need to be adjusted. Second, it makes // it very easy to determine if we can reuse a node. If the node's position is at where - // we are in the text, then we can reuse it. Otherwise we can't. If hte node's position + // we are in the text, then we can reuse it. Otherwise we can't. If the node's position // is ahead of us, then we'll need to rescan tokens. If the node's position is behind // us, then we'll need to skip it or crumble it as appropriate // @@ -1029,7 +1033,7 @@ module ts { // that some tokens that would be considered identifiers may be considered keywords. // // When adding more parser context flags, consider which is the more common case that the - // flag will be in. This should be hte 'false' state for that flag. The reason for this is + // flag will be in. This should be the 'false' state for that flag. The reason for this is // that we don't store data in our nodes unless the value is in the *non-default* state. So, // for example, more often than code 'allows-in' (or doesn't 'disallow-in'). We opt for // 'disallow-in' set to 'false'. Otherwise, if we had 'allowsIn' set to 'true', then almost @@ -1040,7 +1044,7 @@ module ts { // // An important thing about these context concepts. By default they are effectively inherited // while parsing through every grammar production. i.e. if you don't change them, then when - // you parse a sub-production, it will have the same context values as hte parent production. + // you parse a sub-production, it will have the same context values as the parent production. // This is great most of the time. After all, consider all the 'expression' grammar productions // and how nearly all of them pass along the 'in' and 'yield' context values: // @@ -1605,7 +1609,11 @@ module ts { case ParsingContext.TypeMembers: return isStartOfTypeMember(); case ParsingContext.ClassMembers: - return lookAhead(isClassMemberStart); + // We allow semicolons as class elements (as specified by ES6) as long as we're + // not in error recovery. If we're in error recovery, we don't want an errant + // semicolon to be treated as a class member (since they're almost always used + // for statements. + return lookAhead(isClassMemberStart) || (token === SyntaxKind.SemicolonToken && !inErrorRecovery); case ParsingContext.EnumMembers: // Include open bracket computed properties. This technically also lets in indexers, // which would be a candidate for improved error reporting. @@ -1614,10 +1622,22 @@ module ts { return token === SyntaxKind.OpenBracketToken || token === SyntaxKind.AsteriskToken || isLiteralPropertyName(); case ParsingContext.ObjectBindingElements: return isLiteralPropertyName(); - case ParsingContext.TypeReferences: - // We want to make sure that the "extends" in "extends foo" or the "implements" in - // "implements foo" is not considered a type name. - return isIdentifier() && !isNotHeritageClauseTypeName(); + case ParsingContext.HeritageClauseElement: + // If we see { } then only consume it as an expression if it is followed by , or { + // That way we won't consume the body of a class in its heritage clause. + if (token === SyntaxKind.OpenBraceToken) { + return lookAhead(isValidHeritageClauseObjectLiteral); + } + + if (!inErrorRecovery) { + return isStartOfLeftHandSideExpression() && !isHeritageClauseExtendsOrImplementsKeyword(); + } + else { + // If we're in error recovery we tighten up what we're willing to match. + // That way we don't treat something like "this" as a valid heritage clause + // element during recovery. + return isIdentifier() && !isHeritageClauseExtendsOrImplementsKeyword(); + } case ParsingContext.VariableDeclarations: return isIdentifierOrPattern(); case ParsingContext.ArrayBindingElements: @@ -1641,21 +1661,44 @@ module ts { Debug.fail("Non-exhaustive case in 'isListElement'."); } + function isValidHeritageClauseObjectLiteral() { + Debug.assert(token === SyntaxKind.OpenBraceToken); + if (nextToken() === SyntaxKind.CloseBraceToken) { + // if we see "extends {}" then only treat the {} as what we're extending (and not + // the class body) if we have: + // + // extends {} { + // extends {}, + // extends {} extends + // extends {} implements + + let next = nextToken(); + return next === SyntaxKind.CommaToken || next === SyntaxKind.OpenBraceToken || next === SyntaxKind.ExtendsKeyword || next === SyntaxKind.ImplementsKeyword; + } + + return true; + } + function nextTokenIsIdentifier() { nextToken(); return isIdentifier(); } - function isNotHeritageClauseTypeName(): boolean { + function isHeritageClauseExtendsOrImplementsKeyword(): boolean { if (token === SyntaxKind.ImplementsKeyword || token === SyntaxKind.ExtendsKeyword) { - return lookAhead(nextTokenIsIdentifier); + return lookAhead(nextTokenIsStartOfExpression); } return false; } + function nextTokenIsStartOfExpression() { + nextToken(); + return isStartOfExpression(); + } + // True if positioned at a list terminator function isListTerminator(kind: ParsingContext): boolean { if (token === SyntaxKind.EndOfFileToken) { @@ -1676,7 +1719,7 @@ module ts { return token === SyntaxKind.CloseBraceToken; case ParsingContext.SwitchClauseStatements: return token === SyntaxKind.CloseBraceToken || token === SyntaxKind.CaseKeyword || token === SyntaxKind.DefaultKeyword; - case ParsingContext.TypeReferences: + case ParsingContext.HeritageClauseElement: return token === SyntaxKind.OpenBraceToken || token === SyntaxKind.ExtendsKeyword || token === SyntaxKind.ImplementsKeyword; case ParsingContext.VariableDeclarations: return isVariableDeclaratorListTerminator(); @@ -1793,7 +1836,7 @@ module ts { // some node, then we cannot get a node from the old source tree. This is because we // want to mark the next node we encounter as being unusable. // - // Note: This may be too conservative. Perhaps we could reuse hte node and set the bit + // Note: This may be too conservative. Perhaps we could reuse the node and set the bit // on it (or its leftmost child) as having the error. For now though, being conservative // is nice and likely won't ever affect perf. if (parseErrorBeforeNextFinishedNode) { @@ -1891,12 +1934,6 @@ module ts { // This would probably be safe to reuse. There is no speculative parsing with // heritage clauses. - case ParsingContext.TypeReferences: - // This would probably be safe to reuse. There is no speculative parsing with - // type names in a heritage clause. There can be generic names in the type - // name list. But because it is a type context, we never use speculative - // parsing on the type argument list. - case ParsingContext.TypeParameters: // This would probably be safe to reuse. There is no speculative parsing with // type parameters. Note that that's because type *parameters* only occur in @@ -1923,6 +1960,12 @@ module ts { // cases. i.e. a property assignment may end with an expression, and thus might // have lookahead far beyond it's old node. case ParsingContext.ObjectLiteralMembers: + + // This is probably not safe to reuse. There can be speculative parsing with + // type names in a heritage clause. There can be generic names in the type + // name list, and there can be left hand side expressions (which can have type + // arguments.) + case ParsingContext.HeritageClauseElement: } return false; @@ -1957,6 +2000,7 @@ module ts { case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: case SyntaxKind.PropertyDeclaration: + case SyntaxKind.SemicolonClassElement: return true; } } @@ -2846,8 +2890,7 @@ module ts { } // EXPRESSIONS - - function isStartOfExpression(): boolean { + function isStartOfLeftHandSideExpression(): boolean { switch (token) { case SyntaxKind.ThisKeyword: case SyntaxKind.SuperKeyword: @@ -2862,9 +2905,23 @@ module ts { case SyntaxKind.OpenBracketToken: case SyntaxKind.OpenBraceToken: case SyntaxKind.FunctionKeyword: + case SyntaxKind.ClassKeyword: case SyntaxKind.NewKeyword: case SyntaxKind.SlashToken: case SyntaxKind.SlashEqualsToken: + case SyntaxKind.Identifier: + return true; + default: + return isIdentifier(); + } + } + + function isStartOfExpression(): boolean { + if (isStartOfLeftHandSideExpression()) { + return true; + } + + switch (token) { case SyntaxKind.PlusToken: case SyntaxKind.MinusToken: case SyntaxKind.TildeToken: @@ -2875,7 +2932,6 @@ module ts { case SyntaxKind.PlusPlusToken: case SyntaxKind.MinusMinusToken: case SyntaxKind.LessThanToken: - case SyntaxKind.Identifier: case SyntaxKind.YieldKeyword: // Yield always starts an expression. Either it is an identifier (in which case // it is definitely an expression). Or it's a keyword (either because we're in @@ -2895,8 +2951,12 @@ module ts { } function isStartOfExpressionStatement(): boolean { - // As per the grammar, neither '{' nor 'function' can start an expression statement. - return token !== SyntaxKind.OpenBraceToken && token !== SyntaxKind.FunctionKeyword && token !== SyntaxKind.AtToken && isStartOfExpression(); + // As per the grammar, none of '{' or 'function' or 'class' can start an expression statement. + return token !== SyntaxKind.OpenBraceToken && + token !== SyntaxKind.FunctionKeyword && + token !== SyntaxKind.ClassKeyword && + token !== SyntaxKind.AtToken && + isStartOfExpression(); } function parseExpression(): Expression { @@ -3241,8 +3301,12 @@ module ts { return parseFunctionBlock(/*allowYield:*/ false, /* ignoreMissingOpenBrace */ false); } - if (isStartOfStatement(/*inErrorRecovery:*/ true) && !isStartOfExpressionStatement() && token !== SyntaxKind.FunctionKeyword) { - // Check if we got a plain statement (i.e. no expression-statements, no functions expressions/declarations) + if (isStartOfStatement(/*inErrorRecovery:*/ true) && + !isStartOfExpressionStatement() && + token !== SyntaxKind.FunctionKeyword && + token !== SyntaxKind.ClassKeyword) { + + // Check if we got a plain statement (i.e. no expression-statements, no function/class expressions/declarations) // // Here we try to recover from a potential error situation in the case where the // user meant to supply a block. For example, if the user wrote: @@ -3667,7 +3731,6 @@ module ts { case SyntaxKind.CloseBracketToken: // foo] case SyntaxKind.ColonToken: // foo: case SyntaxKind.SemicolonToken: // foo; - case SyntaxKind.CommaToken: // foo, case SyntaxKind.QuestionToken: // foo? case SyntaxKind.EqualsEqualsToken: // foo == case SyntaxKind.EqualsEqualsEqualsToken: // foo === @@ -3685,6 +3748,12 @@ module ts { // treat it as such. return true; + case SyntaxKind.CommaToken: // foo, + case SyntaxKind.OpenBraceToken: // foo { + // We don't want to treat these as type arguments. Otherwise we'll parse this + // as an invocation expression. Instead, we want to parse out the expression + // in isolation from the type arguments. + default: // Anything else treat as an expression. return false; @@ -3709,6 +3778,8 @@ module ts { return parseArrayLiteralExpression(); case SyntaxKind.OpenBraceToken: return parseObjectLiteralExpression(); + case SyntaxKind.ClassKeyword: + return parseClassExpression(); case SyntaxKind.FunctionKeyword: return parseFunctionExpression(); case SyntaxKind.NewKeyword: @@ -4129,13 +4200,14 @@ module ts { } function isStartOfStatement(inErrorRecovery: boolean): boolean { - // Functions and variable statements are allowed as a statement. But as per the grammar, - // they also allow modifiers. So we have to check for those statements that might be - // following modifiers.This ensures that things work properly when incrementally parsing - // as the parser will produce the same FunctionDeclaraiton or VariableStatement if it has - // the same text regardless of whether it is inside a block or not. + // Functions, variable statements and classes are allowed as a statement. But as per + // the grammar, they also allow modifiers. So we have to check for those statements + // that might be following modifiers.This ensures that things work properly when + // incrementally parsing as the parser will produce the same FunctionDeclaraiton, + // VariableStatement or ClassDeclaration, if it has the same text regardless of whether + // it is inside a block or not. if (isModifier(token)) { - let result = lookAhead(parseVariableStatementOrFunctionDeclarationWithDecoratorsOrModifiers); + let result = lookAhead(parseVariableStatementOrFunctionDeclarationOrClassDeclarationWithDecoratorsOrModifiers); if (result) { return true; } @@ -4154,6 +4226,7 @@ module ts { case SyntaxKind.VarKeyword: case SyntaxKind.LetKeyword: case SyntaxKind.FunctionKeyword: + case SyntaxKind.ClassKeyword: case SyntaxKind.IfKeyword: case SyntaxKind.DoKeyword: case SyntaxKind.WhileKeyword: @@ -4178,7 +4251,6 @@ module ts { let isConstEnum = lookAhead(nextTokenIsEnumKeyword); return !isConstEnum; case SyntaxKind.InterfaceKeyword: - case SyntaxKind.ClassKeyword: case SyntaxKind.ModuleKeyword: case SyntaxKind.EnumKeyword: case SyntaxKind.TypeKeyword: @@ -4222,6 +4294,8 @@ module ts { return parseVariableStatement(scanner.getStartPos(), /*decorators*/ undefined, /*modifiers:*/ undefined); case SyntaxKind.FunctionKeyword: return parseFunctionDeclaration(scanner.getStartPos(), /*decorators*/ undefined, /*modifiers:*/ undefined); + case SyntaxKind.ClassKeyword: + return parseClassDeclaration(scanner.getStartPos(), /*decorators*/ undefined, /*modifiers:*/ undefined); case SyntaxKind.SemicolonToken: return parseEmptyStatement(); case SyntaxKind.IfKeyword: @@ -4267,7 +4341,7 @@ module ts { // Even though variable statements and function declarations cannot have decorators, // we parse them here to provide better error recovery. if (isModifier(token) || token === SyntaxKind.AtToken) { - let result = tryParse(parseVariableStatementOrFunctionDeclarationWithDecoratorsOrModifiers); + let result = tryParse(parseVariableStatementOrFunctionDeclarationOrClassDeclarationWithDecoratorsOrModifiers); if (result) { return result; } @@ -4277,7 +4351,7 @@ module ts { } } - function parseVariableStatementOrFunctionDeclarationWithDecoratorsOrModifiers(): FunctionDeclaration | VariableStatement { + function parseVariableStatementOrFunctionDeclarationOrClassDeclarationWithDecoratorsOrModifiers(): FunctionDeclaration | VariableStatement | ClassDeclaration { let start = scanner.getStartPos(); let decorators = parseDecorators(); let modifiers = parseModifiers(); @@ -4297,8 +4371,12 @@ module ts { case SyntaxKind.VarKeyword: return parseVariableStatement(start, decorators, modifiers); + case SyntaxKind.FunctionKeyword: return parseFunctionDeclaration(start, decorators, modifiers); + + case SyntaxKind.ClassKeyword: + return parseClassDeclaration(start, decorators, modifiers); } return undefined; @@ -4619,6 +4697,12 @@ module ts { } function parseClassElement(): ClassElement { + if (token === SyntaxKind.SemicolonToken) { + let result = createNode(SyntaxKind.SemicolonClassElement); + nextToken(); + return finishNode(result); + } + let fullStart = getNodePos(); let decorators = parseDecorators(); let modifiers = parseModifiers(); @@ -4657,18 +4741,28 @@ module ts { Debug.fail("Should not have attempted to parse class member declaration."); } + function parseClassExpression(): ClassExpression { + return parseClassDeclarationOrExpression( + /*fullStart:*/ scanner.getStartPos(), + /*decorators:*/ undefined, + /*modifiers:*/ undefined, + SyntaxKind.ClassExpression); + } + function parseClassDeclaration(fullStart: number, decorators: NodeArray, modifiers: ModifiersArray): ClassDeclaration { + return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, SyntaxKind.ClassDeclaration); + } + + function parseClassDeclarationOrExpression(fullStart: number, decorators: NodeArray, modifiers: ModifiersArray, kind: SyntaxKind): ClassLikeDeclaration { // In ES6 specification, All parts of a ClassDeclaration or a ClassExpression are strict mode code let savedStrictModeContext = inStrictModeContext(); - if (languageVersion >= ScriptTarget.ES6) { - setStrictModeContext(true); - } + setStrictModeContext(true); - var node = createNode(SyntaxKind.ClassDeclaration, fullStart); + var node = createNode(kind, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(SyntaxKind.ClassKeyword); - node.name = node.flags & NodeFlags.Default ? parseOptionalIdentifier() : parseIdentifier(); + node.name = parseOptionalIdentifier(); node.typeParameters = parseTypeParameters(); node.heritageClauses = parseHeritageClauses(/*isClassHeritageClause:*/ true); @@ -4714,13 +4808,23 @@ module ts { let node = createNode(SyntaxKind.HeritageClause); node.token = token; nextToken(); - node.types = parseDelimitedList(ParsingContext.TypeReferences, parseTypeReference); + node.types = parseDelimitedList(ParsingContext.HeritageClauseElement, parseHeritageClauseElement); return finishNode(node); } return undefined; } + function parseHeritageClauseElement(): HeritageClauseElement { + let node = createNode(SyntaxKind.HeritageClauseElement); + node.expression = parseLeftHandSideExpressionOrHigher(); + if (token === SyntaxKind.LessThanToken) { + node.typeArguments = parseBracketedList(ParsingContext.TypeArguments, parseType, SyntaxKind.LessThanToken, SyntaxKind.GreaterThanToken); + } + + return finishNode(node); + } + function isHeritageClause(): boolean { return token === SyntaxKind.ExtendsKeyword || token === SyntaxKind.ImplementsKeyword; } @@ -5263,6 +5367,7 @@ module ts { case SyntaxKind.ArrayLiteralExpression: case SyntaxKind.ParenthesizedExpression: case SyntaxKind.ObjectLiteralExpression: + case SyntaxKind.ClassExpression: case SyntaxKind.FunctionExpression: case SyntaxKind.Identifier: case SyntaxKind.RegularExpressionLiteral: diff --git a/src/compiler/program.ts b/src/compiler/program.ts index cb12e6da4d5..69faeda2db0 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -8,7 +8,7 @@ module ts { /* @internal */ export let ioWriteTime = 0; /** The version of the TypeScript compiler release */ - export let version = "1.5.0.0"; + export let version = "1.5.0"; export function findConfigFile(searchPath: string): string { var fileName = "tsconfig.json"; @@ -454,6 +454,24 @@ module ts { } function verifyCompilerOptions() { + if (options.separateCompilation) { + if (options.sourceMap) { + diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_sourceMap_cannot_be_specified_with_option_separateCompilation)); + } + + if (options.declaration) { + diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_declaration_cannot_be_specified_with_option_separateCompilation)); + } + + if (options.noEmitOnError) { + diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_noEmitOnError_cannot_be_specified_with_option_separateCompilation)); + } + + if (options.out) { + diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_out_cannot_be_specified_with_option_separateCompilation)); + } + } + if (!options.sourceMap && (options.mapRoot || options.sourceRoot)) { // Error to specify --mapRoot or --sourceRoot without mapSourceFiles if (options.mapRoot) { @@ -468,12 +486,21 @@ module ts { let languageVersion = options.target || ScriptTarget.ES3; let firstExternalModuleSourceFile = forEach(files, f => isExternalModule(f) ? f : undefined); - if (firstExternalModuleSourceFile && !options.module) { + if (options.separateCompilation) { if (!options.module && languageVersion < ScriptTarget.ES6) { - // 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(createCompilerDiagnostic(Diagnostics.Option_separateCompilation_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher)); } + + 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)); + } + } + 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)); } // Cannot specify module gen target when in es6 or above @@ -481,11 +508,11 @@ module ts { diagnostics.add(createCompilerDiagnostic(Diagnostics.Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher)); } - // there has to be common source directory if user specified --outdir || --sourcRoot + // 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 if (options.outDir || // there is --outDir specified options.sourceRoot || // there is --sourceRoot specified - (options.mapRoot && // there is --mapRoot Specified and there would be multiple js files generated + (options.mapRoot && // there is --mapRoot specified and there would be multiple js files generated (!options.out || firstExternalModuleSourceFile !== undefined))) { let commonPathComponents: string[]; diff --git a/src/compiler/tsc.ts b/src/compiler/tsc.ts index a0d21106f43..0cbeff8204a 100644 --- a/src/compiler/tsc.ts +++ b/src/compiler/tsc.ts @@ -276,6 +276,7 @@ module ts { // If a source file changes, mark it as unwatched and start the recompilation timer function sourceFileChanged(sourceFile: SourceFile) { + sourceFile.fileWatcher.close(); sourceFile.fileWatcher = undefined; startTimer(); } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index e5697f9f372..74777057963 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -203,9 +203,12 @@ module ts { TemplateExpression, YieldExpression, SpreadElementExpression, + ClassExpression, OmittedExpression, // Misc TemplateSpan, + HeritageClauseElement, + SemicolonClassElement, // Element Block, VariableStatement, @@ -536,6 +539,11 @@ module ts { body?: Block; } + // For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. + export interface SemicolonClassElement extends ClassElement { + _semicolonClassElementBrand: any; + } + // See the comment on MethodDeclaration for the intuition behind AccessorDeclaration being a // ClassElement and an ObjectLiteralElement. export interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { @@ -728,6 +736,11 @@ module ts { arguments: NodeArray; } + export interface HeritageClauseElement extends Node { + expression: LeftHandSideExpression; + typeArguments?: NodeArray; + } + export interface NewExpression extends CallExpression, PrimaryExpression { } export interface TaggedTemplateExpression extends MemberExpression { @@ -849,13 +862,19 @@ module ts { _moduleElementBrand: any; } - export interface ClassDeclaration extends Declaration, ModuleElement { + export interface ClassLikeDeclaration extends Declaration { name?: Identifier; typeParameters?: NodeArray; heritageClauses?: NodeArray; members: NodeArray; } + export interface ClassDeclaration extends ClassLikeDeclaration, Statement { + } + + export interface ClassExpression extends ClassLikeDeclaration, PrimaryExpression { + } + export interface ClassElement extends Declaration { _classElementBrand: any; } @@ -869,7 +888,7 @@ module ts { export interface HeritageClause extends Node { token: SyntaxKind; - types?: NodeArray; + types?: NodeArray; } export interface TypeAliasDeclaration extends Declaration, ModuleElement { @@ -914,7 +933,7 @@ module ts { // import "mod" => importClause = undefined, moduleSpecifier = "mod" // In rest of the cases, module specifier is string literal corresponding to module // ImportClause information is shown at its declaration below. - export interface ImportDeclaration extends Statement, ModuleElement { + export interface ImportDeclaration extends ModuleElement { importClause?: ImportClause; moduleSpecifier: Expression; } @@ -1127,7 +1146,7 @@ module ts { getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; getAliasedSymbol(symbol: Symbol): Symbol; - getExportsOfExternalModule(node: ImportDeclaration): Symbol[]; + getExportsOfModule(moduleSymbol: Symbol): Symbol[]; // Should not be called directly. Should only be accessed through the Program instance. /* @internal */ getDiagnostics(sourceFile?: SourceFile): Diagnostic[]; @@ -1231,11 +1250,14 @@ module ts { writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult; - isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult; + isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult; // Returns the constant value this property access resolves to, or 'undefined' for a non-constant getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; resolvesToSomeValue(location: Node, name: string): boolean; getBlockScopedVariableId(node: Identifier): number; + 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[]; } export const enum SymbolFlags { @@ -1361,6 +1383,7 @@ module ts { EnumValuesComputed = 0x00000080, BlockScopedBindingInLoop = 0x00000100, EmitDecorate = 0x00000200, // Emit __decorate + EmitParam = 0x00000400, // Emit __param helper for decorators } export interface NodeLinks { @@ -1560,7 +1583,6 @@ module ts { export interface CompilerOptions { allowNonTsExtensions?: boolean; charset?: string; - codepage?: number; declaration?: boolean; diagnostics?: boolean; emitBOM?: boolean; @@ -1574,7 +1596,6 @@ module ts { noErrorTruncation?: boolean; noImplicitAny?: boolean; noLib?: boolean; - noLibCheck?: boolean; noResolve?: boolean; out?: string; outDir?: string; @@ -1587,9 +1608,9 @@ module ts { target?: ScriptTarget; version?: boolean; watch?: boolean; + separateCompilation?: boolean; + emitDecoratorMetadata?: boolean; /* @internal */ stripInternal?: boolean; - /* @internal */ preserveNewLines?: boolean; - /* @internal */ cacheDownlevelForOfLength?: boolean; [option: string]: string | number | boolean; } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 9fa0674c25c..4df840c3241 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -145,7 +145,7 @@ module ts { return node.pos === node.end && node.kind !== SyntaxKind.EndOfFileToken; } - + export function nodeIsPresent(node: Node) { return !nodeIsMissing(node); } @@ -274,11 +274,19 @@ module ts { export function getErrorSpanForNode(sourceFile: SourceFile, node: Node): TextSpan { let errorNode = node; switch (node.kind) { + case SyntaxKind.SourceFile: + let pos = skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false); + if (pos === sourceFile.text.length) { + // file is empty - return span for the beginning of the file + return createTextSpan(0, 0); + } + return getSpanOfTokenAtPosition(sourceFile, pos); // This list is a work in progress. Add missing node kinds to improve their error // spans. case SyntaxKind.VariableDeclaration: case SyntaxKind.BindingElement: case SyntaxKind.ClassDeclaration: + case SyntaxKind.ClassExpression: case SyntaxKind.InterfaceDeclaration: case SyntaxKind.ModuleDeclaration: case SyntaxKind.EnumDeclaration: @@ -288,7 +296,7 @@ module ts { errorNode = (node).name; break; } - + if (errorNode === undefined) { // If we don't have a better node, then just set the error on the first token of // construct. @@ -441,6 +449,18 @@ module ts { return false; } + export function isAccessor(node: Node): boolean { + if (node) { + switch (node.kind) { + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + return true; + } + } + + return false; + } + export function isFunctionLike(node: Node): boolean { if (node) { switch (node.kind) { @@ -506,6 +526,19 @@ module ts { // the *body* of the container. node = node.parent; break; + case SyntaxKind.Decorator: + // Decorators are always applied outside of the body of a class or method. + if (node.parent.kind === SyntaxKind.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; + } + else if (isClassElement(node.parent)) { + // If the decorator's parent is a class element, we resolve the 'this' container + // from the parent class declaration. + node = node.parent; + } + break; case SyntaxKind.ArrowFunction: if (!includeArrowFunctions) { continue; @@ -548,6 +581,19 @@ module ts { // the *body* of the container. node = node.parent; break; + case SyntaxKind.Decorator: + // Decorators are always applied outside of the body of a class or method. + if (node.parent.kind === SyntaxKind.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; + } + else if (isClassElement(node.parent)) { + // If the decorator's parent is a class element, we resolve the 'this' container + // from the parent class declaration. + node = node.parent; + } + break; case SyntaxKind.FunctionDeclaration: case SyntaxKind.FunctionExpression: case SyntaxKind.ArrowFunction: @@ -634,7 +680,7 @@ module ts { return false; } - + export function childIsDecorated(node: Node): boolean { switch (node.kind) { case SyntaxKind.ClassDeclaration: @@ -670,6 +716,7 @@ module ts { case SyntaxKind.TypeAssertionExpression: case SyntaxKind.ParenthesizedExpression: case SyntaxKind.FunctionExpression: + case SyntaxKind.ClassExpression: case SyntaxKind.ArrowFunction: case SyntaxKind.VoidExpression: case SyntaxKind.DeleteExpression: @@ -745,7 +792,7 @@ module ts { export function isInstantiatedModule(node: ModuleDeclaration, preserveConstEnums: boolean) { let moduleState = getModuleInstanceState(node) return moduleState === ModuleInstanceState.Instantiated || - (preserveConstEnums && moduleState === ModuleInstanceState.ConstEnumOnly); + (preserveConstEnums && moduleState === ModuleInstanceState.ConstEnumOnly); } export function isExternalModuleImportEqualsDeclaration(node: Node) { @@ -898,6 +945,7 @@ module ts { case SyntaxKind.MethodDeclaration: case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: + case SyntaxKind.MethodSignature: case SyntaxKind.IndexSignature: return true; default: @@ -942,12 +990,12 @@ module ts { node.kind === SyntaxKind.ExportAssignment && (node).expression.kind === SyntaxKind.Identifier; } - export function getClassBaseTypeNode(node: ClassDeclaration) { + export function getClassExtendsHeritageClauseElement(node: ClassLikeDeclaration) { let heritageClause = getHeritageClause(node.heritageClauses, SyntaxKind.ExtendsKeyword); return heritageClause && heritageClause.types.length > 0 ? heritageClause.types[0] : undefined; } - export function getClassImplementedTypeNodes(node: ClassDeclaration) { + export function getClassImplementsHeritageClauseElements(node: ClassDeclaration) { let heritageClause = getHeritageClause(node.heritageClauses, SyntaxKind.ImplementsKeyword); return heritageClause ? heritageClause.types : undefined; } @@ -1161,7 +1209,7 @@ module ts { export function createTextSpanFromBounds(start: number, end: number) { return createTextSpan(start, end - start); } - + export function textChangeRangeNewSpan(range: TextChangeRange) { return createTextSpan(range.span.start, range.newLength); } @@ -1435,13 +1483,13 @@ module ts { return escapedCharsMap[c] || get16BitUnicodeEscapeSequence(c.charCodeAt(0)); } } - + function get16BitUnicodeEscapeSequence(charCode: number): string { let hexCharCode = charCode.toString(16).toUpperCase(); let paddedHexCode = ("0000" + hexCharCode).slice(-4); return "\\u" + paddedHexCode; } - + let nonAsciiCharacters = /[^\u0000-\u007F]/g; export function escapeNonAsciiCharacters(s: string): string { // Replace non-ASCII characters with '\uNNNN' escapes if any exist. @@ -1573,7 +1621,7 @@ module ts { return getLineAndCharacterOfPosition(currentSourceFile, pos).line; } - export function getFirstConstructorWithBody(node: ClassDeclaration): ConstructorDeclaration { + export function getFirstConstructorWithBody(node: ClassLikeDeclaration): ConstructorDeclaration { return forEach(node.members, member => { if (member.kind === SyntaxKind.Constructor && nodeIsPresent((member).body)) { return member; @@ -1768,4 +1816,30 @@ 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); + } + + function isSupportedHeritageClauseElementExpression(node: Expression): boolean { + if (node.kind === SyntaxKind.Identifier) { + return true; + } + else if (node.kind === SyntaxKind.PropertyAccessExpression) { + return isSupportedHeritageClauseElementExpression((node).expression); + } + else { + return false; + } + } + + export function isRightSideOfQualifiedNameOrPropertyAccess(node: Node) { + return (node.parent.kind === SyntaxKind.QualifiedName && (node.parent).right === node) || + (node.parent.kind === SyntaxKind.PropertyAccessExpression && (node.parent).name === node); + } + + export function getLocalSymbolForExportDefault(symbol: Symbol) { + return symbol && symbol.valueDeclaration && (symbol.valueDeclaration.flags & NodeFlags.Default) ? symbol.valueDeclaration.localSymbol : undefined; + } } diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 5d488259a36..7269b2db75d 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -14,6 +14,7 @@ // /// +/// /// /// /// @@ -115,7 +116,7 @@ module FourSlash { // Name of testcase metadata including ts.CompilerOptions properties that will be used by globalOptions // To add additional option, add property into the testOptMetadataNames, refer the property in either globalMetadataNames or fileMetadataNames // Add cases into convertGlobalOptionsToCompilationsSettings function for the compiler to acknowledge such option from meta data - var testOptMetadataNames = { + var metadataOptionNames = { baselineFile: 'BaselineFile', declaration: 'declaration', emitThisFile: 'emitThisFile', // This flag is used for testing getEmitOutput feature. It allows test-cases to indicate what file to be output in multiple files project @@ -126,14 +127,15 @@ module FourSlash { outDir: 'outDir', sourceMap: 'sourceMap', sourceRoot: 'sourceRoot', + allowNonTsExtensions: 'allowNonTsExtensions', resolveReference: 'ResolveReference', // This flag is used to specify entry file for resolve file references. The flag is only allow once per test file }; // List of allowed metadata names - var fileMetadataNames = [testOptMetadataNames.fileName, testOptMetadataNames.emitThisFile, testOptMetadataNames.resolveReference]; - var globalMetadataNames = [testOptMetadataNames.baselineFile, testOptMetadataNames.declaration, - testOptMetadataNames.mapRoot, testOptMetadataNames.module, testOptMetadataNames.out, - testOptMetadataNames.outDir, testOptMetadataNames.sourceMap, testOptMetadataNames.sourceRoot] + var fileMetadataNames = [metadataOptionNames.fileName, metadataOptionNames.emitThisFile, metadataOptionNames.resolveReference]; + var globalMetadataNames = [metadataOptionNames.allowNonTsExtensions, metadataOptionNames.baselineFile, metadataOptionNames.declaration, + metadataOptionNames.mapRoot, metadataOptionNames.module, metadataOptionNames.out, + metadataOptionNames.outDir, metadataOptionNames.sourceMap, metadataOptionNames.sourceRoot] function convertGlobalOptionsToCompilerOptions(globalOptions: { [idx: string]: string }): ts.CompilerOptions { var settings: ts.CompilerOptions = { target: ts.ScriptTarget.ES5 }; @@ -141,13 +143,16 @@ module FourSlash { for (var prop in globalOptions) { if (globalOptions.hasOwnProperty(prop)) { switch (prop) { - case testOptMetadataNames.declaration: + case metadataOptionNames.allowNonTsExtensions: + settings.allowNonTsExtensions = true; + break; + case metadataOptionNames.declaration: settings.declaration = true; break; - case testOptMetadataNames.mapRoot: + case metadataOptionNames.mapRoot: settings.mapRoot = globalOptions[prop]; break; - case testOptMetadataNames.module: + case metadataOptionNames.module: // create appropriate external module target for CompilationSettings switch (globalOptions[prop]) { case "AMD": @@ -162,16 +167,16 @@ module FourSlash { break; } break; - case testOptMetadataNames.out: + case metadataOptionNames.out: settings.out = globalOptions[prop]; break; - case testOptMetadataNames.outDir: + case metadataOptionNames.outDir: settings.outDir = globalOptions[prop]; break; - case testOptMetadataNames.sourceMap: + case metadataOptionNames.sourceMap: settings.sourceMap = true; break; - case testOptMetadataNames.sourceRoot: + case metadataOptionNames.sourceRoot: settings.sourceRoot = globalOptions[prop]; break; } @@ -303,7 +308,7 @@ module FourSlash { ts.forEach(testData.files, file => { // Create map between fileName and its content for easily looking up when resolveReference flag is specified this.inputFiles[file.fileName] = file.content; - if (!startResolveFileRef && file.fileOptions[testOptMetadataNames.resolveReference]) { + if (!startResolveFileRef && file.fileOptions[metadataOptionNames.resolveReference]) { startResolveFileRef = file; } else if (startResolveFileRef) { // If entry point for resolving file references is already specified, report duplication error @@ -793,6 +798,13 @@ module FourSlash { return "\nActual " + name + ":\n\t" + actualValue + "\nExpected value:\n\t" + expectedValue; } + public getSemanticDiagnostics(expected: string) { + var diagnostics = this.languageService.getSemanticDiagnostics(this.activeFile.fileName); + var realized = ts.realizeDiagnostics(diagnostics, "\r\n"); + var actual = JSON.stringify(realized, null, " "); + assert.equal(actual, expected); + } + public verifyQuickInfoString(negative: boolean, expectedText?: string, expectedDocumentation?: string) { [expectedText, expectedDocumentation].forEach(str => { if (str) { @@ -1131,7 +1143,7 @@ module FourSlash { Harness.Baseline.runBaseline( "Breakpoint Locations for " + this.activeFile.fileName, - this.testData.globalOptions[testOptMetadataNames.baselineFile], + this.testData.globalOptions[metadataOptionNames.baselineFile], () => { return this.baselineCurrentFileLocations(pos => this.getBreakpointStatementLocation(pos)); }, @@ -1146,7 +1158,7 @@ module FourSlash { var allFourSlashFiles = this.testData.files; for (var idx = 0; idx < allFourSlashFiles.length; ++idx) { var file = allFourSlashFiles[idx]; - if (file.fileOptions[testOptMetadataNames.emitThisFile]) { + if (file.fileOptions[metadataOptionNames.emitThisFile]) { // Find a file with the flag emitThisFile turned on emitFiles.push(file); } @@ -1159,7 +1171,7 @@ module FourSlash { Harness.Baseline.runBaseline( "Generate getEmitOutput baseline : " + emitFiles.join(" "), - this.testData.globalOptions[testOptMetadataNames.baselineFile], + this.testData.globalOptions[metadataOptionNames.baselineFile], () => { var resultString = ""; // Loop through all the emittedFiles and emit them one by one @@ -1704,7 +1716,7 @@ module FourSlash { Harness.Baseline.runBaseline( "Name OrDottedNameSpans for " + this.activeFile.fileName, - this.testData.globalOptions[testOptMetadataNames.baselineFile], + this.testData.globalOptions[metadataOptionNames.baselineFile], () => { return this.baselineCurrentFileLocations(pos => this.getNameOrDottedNameSpan(pos)); @@ -2280,7 +2292,7 @@ module FourSlash { if (globalMetadataNamesIndex === -1) { if (fileMetadataNamesIndex === -1) { throw new Error('Unrecognized metadata name "' + match[1] + '". Available global metadata names are: ' + globalMetadataNames.join(', ') + '; file metadata names are: ' + fileMetadataNames.join(', ')); - } else if (fileMetadataNamesIndex === fileMetadataNames.indexOf(testOptMetadataNames.fileName)) { + } else if (fileMetadataNamesIndex === fileMetadataNames.indexOf(metadataOptionNames.fileName)) { // Found an @FileName directive, if this is not the first then create a new subfile if (currentFileContent) { var file = parseFileContent(currentFileContent, currentFileName, markerPositions, markers, ranges); diff --git a/src/harness/harness.ts b/src/harness/harness.ts index 90ffcef07ff..784d8312d69 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -781,7 +781,7 @@ module Harness { public reset() { this.fileCollection = {}; } - public toArray(): { fileName: string; file: WriterAggregator; }[] { + public toArray(): { fileName: string; file: WriterAggregator; }[]{ var result: { fileName: string; file: WriterAggregator; }[] = []; for (var p in this.fileCollection) { if (this.fileCollection.hasOwnProperty(p)) { @@ -944,6 +944,10 @@ module Harness { var newLine = '\r\n'; + // Files from built\local that are requested by test "@includeBuiltFiles" to be in the context. + // Treat them as library files, so include them in build, but not in baselines. + var includeBuiltFiles: { unitName: string; content: string }[] = []; + var useCaseSensitiveFileNames = ts.sys.useCaseSensitiveFileNames; this.settings.forEach(setting => { switch (setting.flag.toLowerCase()) { @@ -1008,10 +1012,6 @@ module Harness { options.outDir = setting.value; break; - case 'preservenewlines': - options.preserveNewLines = !!setting.value; - break; - case 'sourceroot': options.sourceRoot = setting.value; break; @@ -1040,17 +1040,7 @@ module Harness { useCaseSensitiveFileNames = setting.value === 'true'; break; - case 'mapsourcefiles': - case 'maproot': - case 'generatedeclarationfiles': - case 'gatherDiagnostics': - case 'codepage': - case 'createFileLog': case 'filename': - case 'removecomments': - case 'watch': - case 'allowautomaticsemicoloninsertion': - case 'locale': // Not supported yet break; @@ -1066,23 +1056,28 @@ module Harness { options.preserveConstEnums = setting.value === 'true'; break; + case 'separatecompilation': + options.separateCompilation = setting.value === 'true'; + break; + case 'suppressimplicitanyindexerrors': options.suppressImplicitAnyIndexErrors = setting.value === 'true'; break; case 'includebuiltfile': - inputFiles.push({ unitName: setting.value, content: normalizeLineEndings(IO.readFile(libFolder + setting.value), newLine) }); + let builtFileName = libFolder + setting.value; + includeBuiltFiles.push({ unitName: builtFileName, content: normalizeLineEndings(IO.readFile(builtFileName), newLine) }); break; default: throw new Error('Unsupported compiler setting ' + setting.flag); } }); - + var fileOutputs: GeneratedFile[] = []; - var programFiles = inputFiles.map(file => file.unitName); - var program = ts.createProgram(programFiles, options, createCompilerHost(inputFiles.concat(otherFiles), + 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)); @@ -1305,7 +1300,7 @@ module Harness { }); var numLibraryDiagnostics = ts.countWhere(diagnostics, diagnostic => { - return diagnostic.fileName && isLibraryFile(diagnostic.fileName); + return diagnostic.fileName && (isLibraryFile(diagnostic.fileName) || isBuiltFile(diagnostic.fileName)); }); var numTest262HarnessDiagnostics = ts.countWhere(diagnostics, diagnostic => { @@ -1465,7 +1460,12 @@ module Harness { var optionRegex = /^[\/]{2}\s*@(\w+)\s*:\s*(\S*)/gm; // multiple matches on multiple lines // List of allowed metadata names - var fileMetadataNames = ["filename", "comments", "declaration", "module", "nolib", "sourcemap", "target", "out", "outdir", "noemitonerror", "noimplicitany", "noresolve", "newline", "newlines", "emitbom", "errortruncation", "usecasesensitivefilenames", "preserveconstenums", "preservenewlines", "includebuiltfile", "suppressimplicitanyindexerrors", "stripinternal"]; + var fileMetadataNames = ["filename", "comments", "declaration", "module", + "nolib", "sourcemap", "target", "out", "outdir", "noemitonerror", + "noimplicitany", "noresolve", "newline", "newlines", "emitbom", + "errortruncation", "usecasesensitivefilenames", "preserveconstenums", + "includebuiltfile", "suppressimplicitanyindexerrors", "stripinternal", + "separatecompilation"]; function extractCompilerSettings(content: string): CompilerSetting[] { @@ -1703,6 +1703,18 @@ module Harness { return (Path.getFileName(filePath) === 'lib.d.ts') || (Path.getFileName(filePath) === 'lib.core.d.ts'); } + export function isBuiltFile(filePath: string): boolean { + return filePath.indexOf(Harness.libFolder) === 0; + } + + export function getDefaultLibraryFile(): { unitName: string, content: string } { + var libFile = Harness.userSpecifiedroot + Harness.libFolder + "/" + "lib.d.ts"; + return { + unitName: libFile, + content: IO.readFile(libFile) + } + } + if (Error) (Error).stackTraceLimit = 1; } diff --git a/src/harness/loggedIO.ts b/src/harness/loggedIO.ts index d9418c0e6ae..8ba38043e78 100644 --- a/src/harness/loggedIO.ts +++ b/src/harness/loggedIO.ts @@ -15,6 +15,7 @@ interface IOLog { arguments: string[]; executingPath: string; currentDirectory: string; + useCustomLibraryFile?: boolean; filesRead: { path: string; codepage: number; diff --git a/src/harness/rwcRunner.ts b/src/harness/rwcRunner.ts index c1c3251cf02..49a15112e9f 100644 --- a/src/harness/rwcRunner.ts +++ b/src/harness/rwcRunner.ts @@ -32,6 +32,7 @@ module RWC { }; var baseName = /(.*)\/(.*).json/.exec(ts.normalizeSlashes(jsonPath))[2]; var currentDirectory: string; + var useCustomLibraryFile: boolean; after(() => { // Mocha holds onto the closure environment of the describe callback even after the test is done. @@ -43,6 +44,10 @@ module RWC { baselineOpts = undefined; baseName = undefined; currentDirectory = undefined; + // useCustomLibraryFile is a flag specified in the json object to indicate whether to use built/local/lib.d.ts + // or to use lib.d.ts inside the json object. If the flag is true, use the lib.d.ts inside json file + // otherwise use the lib.d.ts from built/local + useCustomLibraryFile = undefined; }); it('can compile', () => { @@ -51,34 +56,52 @@ module RWC { var ioLog: IOLog = JSON.parse(Harness.IO.readFile(jsonPath)); currentDirectory = ioLog.currentDirectory; + useCustomLibraryFile = ioLog.useCustomLibraryFile; runWithIOLog(ioLog, () => { opts = ts.parseCommandLine(ioLog.arguments); assert.equal(opts.errors.length, 0); + + // To provide test coverage of output javascript file, + // we will set noEmitOnError flag to be false. + opts.options.noEmitOnError = false; }); runWithIOLog(ioLog, () => { harnessCompiler.reset(); + // Load the files ts.forEach(opts.fileNames, fileName => { inputFiles.push(getHarnessCompilerInputUnit(fileName)); }); - if (!opts.options.noLib) { - // Find the lib.d.ts file in the input file and add it to the input files list - var libFile = ts.forEach(ioLog.filesRead, fileRead=> Harness.isLibraryFile(fileRead.path) ? fileRead.path : undefined); - if (libFile) { - inputFiles.push(getHarnessCompilerInputUnit(libFile)); - } - } - - ts.forEach(ioLog.filesRead, fileRead => { + // Add files to compilation + for(let fileRead of ioLog.filesRead) { + // Check if the file is already added into the set of input files. var resolvedPath = ts.normalizeSlashes(ts.sys.resolvePath(fileRead.path)); - var inInputList = ts.forEach(inputFiles, inputFile=> inputFile.unitName === resolvedPath); - if (!inInputList) { - // Add the file to other files + var inInputList = ts.forEach(inputFiles, inputFile => inputFile.unitName === resolvedPath); + + if (!Harness.isLibraryFile(fileRead.path)) { + if (inInputList) { + continue; + } otherFiles.push(getHarnessCompilerInputUnit(fileRead.path)); } - }); + else if (!opts.options.noLib && Harness.isLibraryFile(fileRead.path)){ + if (!inInputList) { + // If useCustomLibraryFile is true, we will use lib.d.ts from json object + // otherwise use the lib.d.ts from built/local + // Majority of RWC code will be using built/local/lib.d.ts instead of + // lib.d.ts inside json file. However, some RWC cases will still use + // their own version of lib.d.ts because they have customized lib.d.ts + if (useCustomLibraryFile) { + inputFiles.push(getHarnessCompilerInputUnit(fileRead.path)); + } + else { + inputFiles.push(Harness.getDefaultLibraryFile()); + } + } + } + } // do not use lib since we already read it in above opts.options.noLib = true; @@ -115,9 +138,10 @@ module RWC { it('has the expected declaration file content', () => { Harness.Baseline.runBaseline('has the expected declaration file content', baseName + '.d.ts', () => { - if (compilerResult.errors.length || !compilerResult.declFilesCode.length) { + if (!compilerResult.declFilesCode.length) { return null; } + return Harness.Compiler.collateOutputs(compilerResult.declFilesCode); }, false, baselineOpts); }); diff --git a/src/harness/typeWriter.ts b/src/harness/typeWriter.ts index e645c8b765c..4c50e0e0cad 100644 --- a/src/harness/typeWriter.ts +++ b/src/harness/typeWriter.ts @@ -38,7 +38,6 @@ class TypeWriterWalker { case ts.SyntaxKind.SuperKeyword: case ts.SyntaxKind.ArrayLiteralExpression: case ts.SyntaxKind.ObjectLiteralExpression: - case ts.SyntaxKind.PropertyAccessExpression: case ts.SyntaxKind.ElementAccessExpression: case ts.SyntaxKind.CallExpression: case ts.SyntaxKind.NewExpression: @@ -57,6 +56,14 @@ class TypeWriterWalker { this.log(node, this.getTypeOfNode(node)); break; + case ts.SyntaxKind.PropertyAccessExpression: + for (var current = node; current.kind === ts.SyntaxKind.PropertyAccessExpression; current = current.parent) { + } + if (current.kind !== ts.SyntaxKind.HeritageClauseElement) { + this.log(node, this.getTypeOfNode(node)); + } + break; + // Should not change expression status (maybe expressions) // TODO: Again, ideally should log number and string literals too, // but to be consistent with the old typeWriter, just log identifiers diff --git a/src/lib/core.d.ts b/src/lib/core.d.ts index 2096fa839df..3d830ae5203 100644 --- a/src/lib/core.d.ts +++ b/src/lib/core.d.ts @@ -1168,4 +1168,4 @@ interface TypedPropertyDescriptor { declare type ClassDecorator = (target: TFunction) => TFunction | void; declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void; declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; -declare type ParameterDecorator = (target: Function, propertyKey: string | symbol, parameterIndex: number) => void; +declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void; diff --git a/src/lib/es6.d.ts b/src/lib/es6.d.ts index 3e6ac3f756c..8590e2273e0 100644 --- a/src/lib/es6.d.ts +++ b/src/lib/es6.d.ts @@ -3513,27 +3513,27 @@ interface ProxyHandler { interface ProxyConstructor { revocable(target: T, handler: ProxyHandler): { proxy: T; revoke: () => void; }; - new (target: T, handeler: ProxyHandler): T + new (target: T, handler: ProxyHandler): T } declare var Proxy: ProxyConstructor; -declare var Reflect: { - apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; - construct(target: Function, argumentsList: ArrayLike): any; - defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; - deleteProperty(target: any, propertyKey: PropertyKey): boolean; - enumerate(target: any): IterableIterator; - get(target: any, propertyKey: PropertyKey, receiver?: any): any; - getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor; - getPrototypeOf(target: any): any; - has(target: any, propertyKey: string): boolean; - has(target: any, propertyKey: symbol): boolean; - isExtensible(target: any): boolean; - ownKeys(target: any): Array; - preventExtensions(target: any): boolean; - set(target: any, propertyKey: PropertyKey, value: any, receiver? :any): boolean; - setPrototypeOf(target: any, proto: any): boolean; -}; +declare module Reflect { + function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; + function construct(target: Function, argumentsList: ArrayLike): any; + function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; + function deleteProperty(target: any, propertyKey: PropertyKey): boolean; + function enumerate(target: any): IterableIterator; + function get(target: any, propertyKey: PropertyKey, receiver?: any): any; + function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor; + function getPrototypeOf(target: any): any; + function has(target: any, propertyKey: string): boolean; + function has(target: any, propertyKey: symbol): boolean; + function isExtensible(target: any): boolean; + function ownKeys(target: any): Array; + function preventExtensions(target: any): boolean; + function set(target: any, propertyKey: PropertyKey, value: any, receiver? :any): boolean; + function setPrototypeOf(target: any, proto: any): boolean; +} /** * Represents the completion of an asynchronous operation diff --git a/src/lib/scriptHost.d.ts b/src/lib/scriptHost.d.ts index 2639739e5d6..decf813bc2d 100644 --- a/src/lib/scriptHost.d.ts +++ b/src/lib/scriptHost.d.ts @@ -4,7 +4,11 @@ /// Windows Script Host APIS ///////////////////////////// -declare var ActiveXObject: { new (s: string): any; }; + +interface ActiveXObject { + new (s: string): any; +} +declare var ActiveXObject: ActiveXObject; interface ITextWriter { Write(s: string): void; @@ -12,11 +16,157 @@ interface ITextWriter { Close(): void; } -declare var WScript: { - Echo(s: any): void; - StdErr: ITextWriter; - StdOut: ITextWriter; - Arguments: { length: number; Item(n: number): string; }; - ScriptFullName: string; - Quit(exitCode?: number): number; +interface TextStreamBase { + /** + * The column number of the current character position in an input stream. + */ + Column: number; + /** + * The current line number in an input stream. + */ + Line: number; + /** + * Closes a text stream. + * It is not necessary to close standard streams; they close automatically when the process ends. If you close a standard stream, be aware that any other pointers to that standard stream become invalid. + */ + Close(): void; } + +interface TextStreamWriter extends TextStreamBase { + /** + * Sends a string to an output stream. + */ + Write(s: string): void; + /** + * Sends a specified number of blank lines (newline characters) to an output stream. + */ + WriteBlankLines(intLines: number): void; + /** + * Sends a string followed by a newline character to an output stream. + */ + WriteLine(s: string): void; +} + +interface TextStreamReader extends TextStreamBase { + /** + * Returns a specified number of characters from an input stream, beginning at the current pointer position. + * Does not return until the ENTER key is pressed. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + Read(characters: number): string; + /** + * Returns all characters from an input stream. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + ReadAll(): string; + /** + * Returns an entire line from an input stream. + * Although this method extracts the newline character, it does not add it to the returned string. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + ReadLine(): string; + /** + * Skips a specified number of characters when reading from an input text stream. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.) + */ + Skip(characters: number): void; + /** + * Skips the next line when reading from an input text stream. + * Can only be used on a stream in reading mode, not writing or appending mode. + */ + SkipLine(): void; + /** + * Indicates whether the stream pointer position is at the end of a line. + */ + AtEndOfLine: boolean; + /** + * Indicates whether the stream pointer position is at the end of a stream. + */ + AtEndOfStream: boolean; +} + +declare var WScript: { + /** + * Outputs text to either a message box (under WScript.exe) or the command console window followed by a newline (under CScript.ext). + */ + Echo(s: any): void; + /** + * Exposes the write-only error output stream for the current script. + * Can be accessed only while using CScript.exe. + */ + StdErr: TextStreamWriter; + /** + * Exposes the write-only output stream for the current script. + * Can be accessed only while using CScript.exe. + */ + StdOut: TextStreamWriter; + Arguments: { length: number; Item(n: number): string; }; + /** + * The full path of the currently running script. + */ + ScriptFullName: string; + /** + * Forces the script to stop immediately, with an optional exit code. + */ + Quit(exitCode?: number): number; + /** + * The Windows Script Host build version number. + */ + BuildVersion: number; + /** + * Fully qualified path of the host executable. + */ + FullName: string; + /** + * Gets/sets the script mode - interactive(true) or batch(false). + */ + Interactive: boolean; + /** + * The name of the host executable (WScript.exe or CScript.exe). + */ + Name: string; + /** + * Path of the directory containing the host executable. + */ + Path: string; + /** + * The filename of the currently running script. + */ + ScriptName: string; + /** + * Exposes the read-only input stream for the current script. + * Can be accessed only while using CScript.exe. + */ + StdIn: TextStreamReader; + /** + * Windows Script Host version + */ + Version: string; + /** + * Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event. + */ + ConnectObject(objEventSource: any, strPrefix: string): void; + /** + * Creates a COM object. + * @param strProgiID + * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. + */ + CreateObject(strProgID: string, strPrefix?: string): any; + /** + * Disconnects a COM object from its event sources. + */ + DisconnectObject(obj: any): void; + /** + * Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file. + * @param strPathname Fully qualified path to the file containing the object persisted to disk. For objects in memory, pass a zero-length string. + * @param strProgID + * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. + */ + GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any; + /** + * Suspends script execution for a specified length of time, then continues execution. + * @param intTime Interval (in milliseconds) to suspend script execution. + */ + Sleep(intTime: number): void; +}; diff --git a/src/server/client.ts b/src/server/client.ts index 60421421780..d395d2a832c 100644 --- a/src/server/client.ts +++ b/src/server/client.ts @@ -68,12 +68,12 @@ module ts.server { }; } - private processRequest(command: string, arguments?: any): T { + private processRequest(command: string, args?: any): T { var request: protocol.Request = { seq: this.sequence++, type: "request", - command: command, - arguments: arguments + arguments: args, + command }; this.writeMessage(JSON.stringify(request)); diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index e2a9eba66aa..8b4ab2cffa8 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -458,7 +458,7 @@ module ts.server { var info = this.filenameToScriptInfo[args.file]; if (info) { info.setFormatOptions(args.formatOptions); - this.log("Host configuration update for file " + args.file); + this.log("Host configuration update for file " + args.file, "Info"); } } else { @@ -764,6 +764,26 @@ module ts.server { return info; } + // This is different from the method the compiler uses because + // the compiler can assume it will always start searching in the + // current directory (the directory in which tsc was invoked). + // The server must start searching from the directory containing + // the newly opened file. + findConfigFile(searchPath: string): string { + while (true) { + var fileName = ts.combinePaths(searchPath, "tsconfig.json"); + if (sys.fileExists(fileName)) { + return fileName; + } + var parentPath = ts.getDirectoryPath(searchPath); + if (parentPath === searchPath) { + break; + } + searchPath = parentPath; + } + return undefined; + } + /** * Open file whose contents is managed by the client * @param filename is absolute pathname @@ -771,7 +791,13 @@ module ts.server { openClientFile(fileName: string) { var searchPath = ts.normalizePath(getDirectoryPath(fileName)); - var configFileName = ts.findConfigFile(searchPath); + this.log("Search path: " + searchPath,"Info"); + var configFileName = this.findConfigFile(searchPath); + if (configFileName) { + this.log("Config file name: " + configFileName, "Info"); + } else { + this.log("no config file"); + } if (configFileName) { configFileName = getAbsolutePath(configFileName, searchPath); } @@ -797,7 +823,6 @@ module ts.server { */ closeClientFile(filename: string) { - // TODO: tsconfig check var info = ts.lookUp(this.filenameToScriptInfo, filename); if (info) { this.closeOpenFile(info); @@ -830,6 +855,9 @@ module ts.server { } printProjects() { + if (!this.psLogger.isVerbose()) { + return; + } this.psLogger.startGroup(); for (var i = 0, len = this.inferredProjects.length; i < len; i++) { var project = this.inferredProjects[i]; @@ -1440,6 +1468,10 @@ module ts.server { return accum; } + getLength(): number { + return this.root.charCount(); + } + every(f: (ll: LineLeaf, s: number, len: number) => boolean, rangeStart: number, rangeEnd?: number) { if (!rangeEnd) { rangeEnd = this.root.charCount(); diff --git a/src/server/protocol.d.ts b/src/server/protocol.d.ts index 382ce8494af..1d685be5d3a 100644 --- a/src/server/protocol.d.ts +++ b/src/server/protocol.d.ts @@ -405,6 +405,13 @@ declare module ts.server.protocol { arguments: OpenRequestArgs; } + /** + * Exit request; value of command field is "exit". Ask the server process + * to exit. + */ + export interface ExitRequest extends Request { + } + /** * Close request; value of command field is "close". Notify the * server that the client has closed a previously open file. If @@ -617,12 +624,29 @@ declare module ts.server.protocol { * Optional modifiers for the kind (such as 'public'). */ kindModifiers: string; + /** + * A string that is used for comparing completion items so that they can be ordered. This + * is often the same as the name but may be different in certain circumstances. + */ + sortText: string; } /** * Additional completion entry details, available on demand */ - export interface CompletionEntryDetails extends CompletionEntry { + export interface CompletionEntryDetails { + /** + * The symbol's name. + */ + name: string; + /** + * The symbol's kind (such as 'className' or 'parameterName'). + */ + kind: string; + /** + * Optional modifiers for the kind (such as 'public'). + */ + kindModifiers: string; /** * Display parts of the symbol (similar to quick info). */ diff --git a/src/server/server.ts b/src/server/server.ts index 4c13be80c4c..828deca2b2d 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -177,6 +177,12 @@ module ts.server { super(host, logger); } + exit() { + this.projectService.log("Exiting...","Info"); + this.projectService.closeLog(); + process.exit(0); + } + listen() { rl.on('line',(input: string) => { var message = input.trim(); @@ -184,9 +190,7 @@ module ts.server { }); rl.on('close',() => { - this.projectService.log("Exiting..."); - this.projectService.closeLog(); - process.exit(0); + this.exit(); }); } } diff --git a/src/server/session.ts b/src/server/session.ts index 80831e69284..560f5869c08 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -76,13 +76,14 @@ module ts.server { } export module CommandNames { + export var Brace = "brace"; export var Change = "change"; export var Close = "close"; export var Completions = "completions"; export var CompletionDetails = "completionEntryDetails"; - export var SignatureHelp = "signatureHelp"; export var Configure = "configure"; export var Definition = "definition"; + export var Exit = "exit"; export var Format = "format"; export var Formatonkey = "formatonkey"; export var Geterr = "geterr"; @@ -94,7 +95,7 @@ module ts.server { export var Reload = "reload"; export var Rename = "rename"; export var Saveto = "saveto"; - export var Brace = "brace"; + export var SignatureHelp = "signatureHelp"; export var Unknown = "unknown"; } @@ -758,6 +759,9 @@ module ts.server { })); } + exit() { + } + onMessage(message: string) { if (this.logger.isVerbose()) { this.logger.info("request: " + message); @@ -769,6 +773,11 @@ module ts.server { var errorMessage: string; var responseRequired = true; switch (request.command) { + case CommandNames.Exit: { + this.exit(); + responseRequired = false; + break; + } case CommandNames.Definition: { var defArgs = request.arguments; response = this.getDefinition(defArgs.line, defArgs.offset, defArgs.file); diff --git a/src/services/navigateTo.ts b/src/services/navigateTo.ts index 9871a447c05..54f87d8e50b 100644 --- a/src/services/navigateTo.ts +++ b/src/services/navigateTo.ts @@ -22,7 +22,7 @@ module ts.NavigateTo { continue; } - // It was a match! If the pattern has dots in it, then also see if hte + // It was a match! If the pattern has dots in it, then also see if the // declaration container matches as well. if (patternMatcher.patternContainsDots) { let containers = getContainers(declaration); diff --git a/src/services/navigationBar.ts b/src/services/navigationBar.ts index c6463aba733..e475827837c 100644 --- a/src/services/navigationBar.ts +++ b/src/services/navigationBar.ts @@ -418,10 +418,10 @@ module ts.NavigationBar { } function createFunctionItem(node: FunctionDeclaration) { - if ((node.name || node.flags & NodeFlags.Default) && node.body && node.body.kind === SyntaxKind.Block) { + if (node.body && node.body.kind === SyntaxKind.Block) { let childItems = getItemsWorker(sortNodes((node.body).statements), createChildItem); - return getNavigationBarItem((!node.name && node.flags & NodeFlags.Default) ? "default": node.name.text , + return getNavigationBarItem(!node.name ? "default": node.name.text , ts.ScriptElementKind.functionElement, getNodeModifiers(node), [getNodeSpan(node)], @@ -470,7 +470,7 @@ module ts.NavigationBar { childItems = getItemsWorker(sortNodes(nodes), createChildItem); } - var nodeName = !node.name && (node.flags & NodeFlags.Default) ? "default" : node.name.text; + var nodeName = !node.name ? "default" : node.name.text; return getNavigationBarItem( nodeName, diff --git a/src/services/patternMatcher.ts b/src/services/patternMatcher.ts index 61642552cab..646782b2cf0 100644 --- a/src/services/patternMatcher.ts +++ b/src/services/patternMatcher.ts @@ -471,7 +471,7 @@ module ts { // Helper function to compare two matches to determine which is better. Matches are first // ordered by kind (so all prefix matches always beat all substring matches). Then, if the - // match is a camel case match, the relative weights of hte match are used to determine + // match is a camel case match, the relative weights of the match are used to determine // which is better (with a greater weight being better). Then if the match is of the same // type, then a case sensitive match is considered better than an insensitive one. function patternMatchCompareTo(match1: PatternMatch, match2: PatternMatch): number { diff --git a/src/services/services.ts b/src/services/services.ts index 41ffc04e5ae..86c323f24bf 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -730,7 +730,7 @@ module ts { public statements: NodeArray; public endOfFileToken: Node; - public amdDependencies: {name: string; path: string}[]; + public amdDependencies: { name: string; path: string }[]; public amdModuleName: string; public referencedFiles: FileReference[]; @@ -769,126 +769,131 @@ module ts { public getNamedDeclarations() { if (!this.namedDeclarations) { - let sourceFile = this; - let namedDeclarations: Declaration[] = []; - - forEachChild(sourceFile, function visit(node: Node): void { - switch (node.kind) { - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.MethodDeclaration: - case SyntaxKind.MethodSignature: - let functionDeclaration = node; - - if (functionDeclaration.name && functionDeclaration.name.getFullWidth() > 0) { - let lastDeclaration = namedDeclarations.length > 0 ? - namedDeclarations[namedDeclarations.length - 1] : - undefined; - - // Check whether this declaration belongs to an "overload group". - if (lastDeclaration && functionDeclaration.symbol === lastDeclaration.symbol) { - // Overwrite the last declaration if it was an overload - // and this one is an implementation. - if (functionDeclaration.body && !(lastDeclaration).body) { - namedDeclarations[namedDeclarations.length - 1] = functionDeclaration; - } - } - else { - namedDeclarations.push(functionDeclaration); - } - - forEachChild(node, visit); - } - break; - - case SyntaxKind.ClassDeclaration: - case SyntaxKind.InterfaceDeclaration: - case SyntaxKind.TypeAliasDeclaration: - case SyntaxKind.EnumDeclaration: - case SyntaxKind.ModuleDeclaration: - case SyntaxKind.ImportEqualsDeclaration: - case SyntaxKind.ExportSpecifier: - case SyntaxKind.ImportSpecifier: - case SyntaxKind.ImportEqualsDeclaration: - case SyntaxKind.ImportClause: - case SyntaxKind.NamespaceImport: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - case SyntaxKind.TypeLiteral: - if ((node).name) { - namedDeclarations.push(node); - } - // fall through - case SyntaxKind.Constructor: - case SyntaxKind.VariableStatement: - case SyntaxKind.VariableDeclarationList: - case SyntaxKind.ObjectBindingPattern: - case SyntaxKind.ArrayBindingPattern: - case SyntaxKind.ModuleBlock: - forEachChild(node, visit); - break; - - case SyntaxKind.Block: - if (isFunctionBlock(node)) { - forEachChild(node, visit); - } - break; - - case SyntaxKind.Parameter: - // Only consider properties defined as constructor parameters - if (!(node.flags & NodeFlags.AccessibilityModifier)) { - break; - } - // fall through - case SyntaxKind.VariableDeclaration: - case SyntaxKind.BindingElement: - if (isBindingPattern((node).name)) { - forEachChild((node).name, visit); - break; - } - case SyntaxKind.EnumMember: - case SyntaxKind.PropertyDeclaration: - case SyntaxKind.PropertySignature: - namedDeclarations.push(node); - break; - - case SyntaxKind.ExportDeclaration: - // Handle named exports case e.g.: - // export {a, b as B} from "mod"; - if ((node).exportClause) { - forEach((node).exportClause.elements, visit); - } - break; - - case SyntaxKind.ImportDeclaration: - let importClause = (node).importClause; - if (importClause) { - // Handle default import case e.g.: - // import d from "mod"; - if (importClause.name) { - namedDeclarations.push(importClause); - } - - // Handle named bindings in imports e.g.: - // import * as NS from "mod"; - // import {a, b as B} from "mod"; - if (importClause.namedBindings) { - if (importClause.namedBindings.kind === SyntaxKind.NamespaceImport) { - namedDeclarations.push(importClause.namedBindings); - } - else { - forEach((importClause.namedBindings).elements, visit); - } - } - } - break; - } - }); - - this.namedDeclarations = namedDeclarations; + this.namedDeclarations = this.computeNamedDeclarations(); } return this.namedDeclarations; } + + private computeNamedDeclarations() { + let namedDeclarations: Declaration[] = []; + + forEachChild(this, visit); + + return namedDeclarations; + + function visit(node: Node): void { + switch (node.kind) { + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.MethodDeclaration: + case SyntaxKind.MethodSignature: + let functionDeclaration = node; + + if (functionDeclaration.name && functionDeclaration.name.getFullWidth() > 0) { + let lastDeclaration = namedDeclarations.length > 0 ? + namedDeclarations[namedDeclarations.length - 1] : + undefined; + + // Check whether this declaration belongs to an "overload group". + if (lastDeclaration && functionDeclaration.symbol === lastDeclaration.symbol) { + // Overwrite the last declaration if it was an overload + // and this one is an implementation. + if (functionDeclaration.body && !(lastDeclaration).body) { + namedDeclarations[namedDeclarations.length - 1] = functionDeclaration; + } + } + else { + namedDeclarations.push(functionDeclaration); + } + + forEachChild(node, visit); + } + break; + + case SyntaxKind.ClassDeclaration: + case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.TypeAliasDeclaration: + case SyntaxKind.EnumDeclaration: + case SyntaxKind.ModuleDeclaration: + case SyntaxKind.ImportEqualsDeclaration: + case SyntaxKind.ExportSpecifier: + case SyntaxKind.ImportSpecifier: + case SyntaxKind.ImportEqualsDeclaration: + case SyntaxKind.ImportClause: + case SyntaxKind.NamespaceImport: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.TypeLiteral: + if ((node).name) { + namedDeclarations.push(node); + } + // fall through + case SyntaxKind.Constructor: + case SyntaxKind.VariableStatement: + case SyntaxKind.VariableDeclarationList: + case SyntaxKind.ObjectBindingPattern: + case SyntaxKind.ArrayBindingPattern: + case SyntaxKind.ModuleBlock: + forEachChild(node, visit); + break; + + case SyntaxKind.Block: + if (isFunctionBlock(node)) { + forEachChild(node, visit); + } + break; + + case SyntaxKind.Parameter: + // Only consider properties defined as constructor parameters + if (!(node.flags & NodeFlags.AccessibilityModifier)) { + break; + } + // fall through + case SyntaxKind.VariableDeclaration: + case SyntaxKind.BindingElement: + if (isBindingPattern((node).name)) { + forEachChild((node).name, visit); + break; + } + case SyntaxKind.EnumMember: + case SyntaxKind.PropertyDeclaration: + case SyntaxKind.PropertySignature: + namedDeclarations.push(node); + break; + + case SyntaxKind.ExportDeclaration: + // Handle named exports case e.g.: + // export {a, b as B} from "mod"; + if ((node).exportClause) { + forEach((node).exportClause.elements, visit); + } + break; + + case SyntaxKind.ImportDeclaration: + let importClause = (node).importClause; + if (importClause) { + // Handle default import case e.g.: + // import d from "mod"; + if (importClause.name) { + namedDeclarations.push(importClause); + } + + // Handle named bindings in imports e.g.: + // import * as NS from "mod"; + // import {a, b as B} from "mod"; + if (importClause.namedBindings) { + if (importClause.namedBindings.kind === SyntaxKind.NamespaceImport) { + namedDeclarations.push(importClause.namedBindings); + } + else { + forEach((importClause.namedBindings).elements, visit); + } + } + } + break; + } + } + } } // @@ -1143,6 +1148,7 @@ module ts { name: string; kind: string; // see ScriptElementKind kindModifiers: string; // see ScriptElementKindModifier, comma separated + sortText: string; } export interface CompletionEntryDetails { @@ -1311,6 +1317,7 @@ module ts { // TODO: move these to enums export class ScriptElementKind { static unknown = ""; + static warning = "warning"; // predefined type (void) or keyword (class) static keyword = "keyword"; @@ -1635,6 +1642,61 @@ module ts { sourceFile.scriptSnapshot = scriptSnapshot; } + /* + * This function will compile source text from 'input' argument using specified compiler options. + * If not options are provided - it will use a set of default compiler options. + * Extra compiler options that will unconditionally be used bu this function are: + * - separateCompilation = true + * - allowNonTsExtensions = true + */ + export function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[]): string { + let options = compilerOptions ? clone(compilerOptions) : getDefaultCompilerOptions(); + + options.separateCompilation = true; + + // Filename can be non-ts file. + options.allowNonTsExtensions = true; + + // Parse + var inputFileName = fileName || "module.ts"; + var sourceFile = createSourceFile(inputFileName, input, options.target); + + // Store syntactic diagnostics + if (diagnostics && sourceFile.parseDiagnostics) { + diagnostics.push(...sourceFile.parseDiagnostics); + } + + // Output + let outputText: string; + + // Create a compilerHost object to allow the compiler to read and write files + var compilerHost: CompilerHost = { + getSourceFile: (fileName, target) => fileName === inputFileName ? sourceFile : undefined, + writeFile: (name, text, writeByteOrderMark) => { + Debug.assert(outputText === undefined, "Unexpected multiple outputs for the file: " + name); + outputText = text; + }, + getDefaultLibFileName: () => "lib.d.ts", + useCaseSensitiveFileNames: () => false, + getCanonicalFileName: fileName => fileName, + getCurrentDirectory: () => "", + getNewLine: () => (sys && sys.newLine) || "\r\n" + }; + + var program = createProgram([inputFileName], options, compilerHost); + + if (diagnostics) { + diagnostics.push(...program.getGlobalDiagnostics()); + } + + // Emit + program.emit(); + + Debug.assert(outputText !== undefined, "Output generation failed"); + + return outputText; + } + export function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile { let sourceFile = createSourceFile(fileName, scriptSnapshot.getText(0, scriptSnapshot.getLength()), scriptTarget, setNodeParents); setSourceFileFields(sourceFile, scriptSnapshot, version); @@ -2106,7 +2168,8 @@ module ts { keywordCompletions.push({ name: tokenToString(i), kind: ScriptElementKind.keyword, - kindModifiers: ScriptElementKindModifier.none + kindModifiers: ScriptElementKindModifier.none, + sortText: "0" }); } @@ -2370,15 +2433,26 @@ module ts { return program.getSyntacticDiagnostics(getValidSourceFile(fileName)); } + function isJavaScript(fileName: string) { + return fileExtensionIs(fileName, ".js"); + } + /** * getSemanticDiagnostiscs return array of Diagnostics. If '-d' is not enabled, only report semantic errors * If '-d' enabled, report both semantic and emitter errors */ - function getSemanticDiagnostics(fileName: string) { + function getSemanticDiagnostics(fileName: string): Diagnostic[] { synchronizeHostData(); let targetSourceFile = getValidSourceFile(fileName); + // For JavaScript files, we don't want to report the normal typescript semantic errors. + // Instead, we just report errors for using TypeScript-only constructs from within a + // JavaScript file. + if (isJavaScript(fileName)) { + return getJavaScriptSemanticDiagnostics(targetSourceFile); + } + // Only perform the action per file regardless of '-out' flag as LanguageServiceHost is expected to call this function per file. // Therefore only get diagnostics for given file. @@ -2392,27 +2466,199 @@ module ts { return concatenate(semanticDiagnostics, declarationDiagnostics); } + function getJavaScriptSemanticDiagnostics(sourceFile: SourceFile): Diagnostic[] { + let diagnostics: Diagnostic[] = []; + walk(sourceFile); + + return diagnostics; + + function walk(node: Node): boolean { + if (!node) { + return false; + } + + switch (node.kind) { + case SyntaxKind.ImportEqualsDeclaration: + diagnostics.push(createDiagnosticForNode(node, Diagnostics.import_can_only_be_used_in_a_ts_file)); + return true; + case SyntaxKind.ExportAssignment: + diagnostics.push(createDiagnosticForNode(node, Diagnostics.export_can_only_be_used_in_a_ts_file)); + return true; + case SyntaxKind.ClassDeclaration: + let classDeclaration = node; + if (checkModifiers(classDeclaration.modifiers) || + checkTypeParameters(classDeclaration.typeParameters)) { + return true; + } + break; + case SyntaxKind.HeritageClause: + let heritageClause = node; + if (heritageClause.token === SyntaxKind.ImplementsKeyword) { + diagnostics.push(createDiagnosticForNode(node, Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); + return true; + } + break; + case SyntaxKind.InterfaceDeclaration: + diagnostics.push(createDiagnosticForNode(node, Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); + return true; + case SyntaxKind.ModuleDeclaration: + diagnostics.push(createDiagnosticForNode(node, Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); + return true; + case SyntaxKind.TypeAliasDeclaration: + diagnostics.push(createDiagnosticForNode(node, Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); + return true; + case SyntaxKind.MethodDeclaration: + case SyntaxKind.MethodSignature: + case SyntaxKind.Constructor: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.FunctionExpression: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.ArrowFunction: + case SyntaxKind.FunctionDeclaration: + let functionDeclaration = node; + if (checkModifiers(functionDeclaration.modifiers) || + checkTypeParameters(functionDeclaration.typeParameters) || + checkTypeAnnotation(functionDeclaration.type)) { + return true; + } + break; + case SyntaxKind.VariableStatement: + let variableStatement = node; + if (checkModifiers(variableStatement.modifiers)) { + return true; + } + break; + case SyntaxKind.VariableDeclaration: + let variableDeclaration = node; + if (checkTypeAnnotation(variableDeclaration.type)) { + return true; + } + break; + case SyntaxKind.CallExpression: + case SyntaxKind.NewExpression: + let expression = node; + if (expression.typeArguments && expression.typeArguments.length > 0) { + let start = expression.typeArguments.pos; + diagnostics.push(createFileDiagnostic(sourceFile, start, expression.typeArguments.end - start, + Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)); + return true; + } + break; + case SyntaxKind.Parameter: + let parameter = node; + if (parameter.modifiers) { + let start = parameter.modifiers.pos; + diagnostics.push(createFileDiagnostic(sourceFile, start, parameter.modifiers.end - start, + Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file)); + return true; + } + if (parameter.questionToken) { + diagnostics.push(createDiagnosticForNode(parameter.questionToken, Diagnostics.can_only_be_used_in_a_ts_file)); + return true; + } + if (parameter.type) { + diagnostics.push(createDiagnosticForNode(parameter.type, Diagnostics.types_can_only_be_used_in_a_ts_file)); + return true; + } + break; + case SyntaxKind.PropertyDeclaration: + diagnostics.push(createDiagnosticForNode(node, Diagnostics.property_declarations_can_only_be_used_in_a_ts_file)); + return true; + case SyntaxKind.EnumDeclaration: + diagnostics.push(createDiagnosticForNode(node, Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); + return true; + case SyntaxKind.TypeAssertionExpression: + let typeAssertionExpression = node; + diagnostics.push(createDiagnosticForNode(typeAssertionExpression.type, Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); + return true; + case SyntaxKind.Decorator: + diagnostics.push(createDiagnosticForNode(node, Diagnostics.decorators_can_only_be_used_in_a_ts_file)); + return true; + } + + return forEachChild(node, walk); + } + + function checkTypeParameters(typeParameters: NodeArray): boolean { + if (typeParameters) { + let start = typeParameters.pos; + diagnostics.push(createFileDiagnostic(sourceFile, start, typeParameters.end - start, Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file)); + return true; + } + return false; + } + + function checkTypeAnnotation(type: TypeNode): boolean { + if (type) { + diagnostics.push(createDiagnosticForNode(type, Diagnostics.types_can_only_be_used_in_a_ts_file)); + return true; + } + + return false; + } + + function checkModifiers(modifiers: ModifiersArray): boolean { + if (modifiers) { + for (let modifier of modifiers) { + switch (modifier.kind) { + case SyntaxKind.PublicKeyword: + case SyntaxKind.PrivateKeyword: + case SyntaxKind.ProtectedKeyword: + case SyntaxKind.DeclareKeyword: + diagnostics.push(createDiagnosticForNode(modifier, Diagnostics._0_can_only_be_used_in_a_ts_file, tokenToString(modifier.kind))); + return true; + + // These are all legal modifiers. + case SyntaxKind.StaticKeyword: + case SyntaxKind.ExportKeyword: + case SyntaxKind.ConstKeyword: + case SyntaxKind.DefaultKeyword: + } + } + } + + return false; + } + } + function getCompilerOptionsDiagnostics() { synchronizeHostData(); return program.getGlobalDiagnostics(); } /// Completion - function getCompletionEntryDisplayName(symbol: Symbol, target: ScriptTarget, performCharacterChecks: boolean): string { + function getCompletionEntryDisplayNameForSymbol(symbol: Symbol, target: ScriptTarget, performCharacterChecks: boolean): string { let displayName = symbol.getName(); + if (displayName) { + // If this is the default export, get the name of the declaration if it exists + if (displayName === "default") { + let localSymbol = getLocalSymbolForExportDefault(symbol); + if (localSymbol && localSymbol.name) { + displayName = symbol.valueDeclaration.localSymbol.name; + } + } + + let firstCharCode = displayName.charCodeAt(0); + // First check of the displayName is not external module; if it is an external module, it is not valid entry + if ((symbol.flags & SymbolFlags.Namespace) && (firstCharCode === CharacterCodes.singleQuote || firstCharCode === CharacterCodes.doubleQuote)) { + // If the symbol is external module, don't show it in the completion list + // (i.e declare module "http" { let x; } | // <= request completion here, "http" should not be there) + return undefined; + } + } + + return getCompletionEntryDisplayName(displayName, target, performCharacterChecks); + } + + function getCompletionEntryDisplayName(displayName: string, target: ScriptTarget, performCharacterChecks: boolean): string { if (!displayName) { return undefined; } let firstCharCode = displayName.charCodeAt(0); - // First check of the displayName is not external module; if it is an external module, it is not valid entry - if ((symbol.flags & SymbolFlags.Namespace) && (firstCharCode === CharacterCodes.singleQuote || firstCharCode === CharacterCodes.doubleQuote)) { - // If the symbol is external module, don't show it in the completion list - // (i.e declare module "http" { let x; } | // <= request completion here, "http" should not be there) - return undefined; - } - - if (displayName && displayName.length >= 2 && firstCharCode === displayName.charCodeAt(displayName.length - 1) && + if (displayName.length >= 2 && + firstCharCode === displayName.charCodeAt(displayName.length - 1) && (firstCharCode === CharacterCodes.singleQuote || firstCharCode === CharacterCodes.doubleQuote)) { // If the user entered name for the symbol was quoted, removing the quotes is not enough, as the name could be an // invalid identifier name. We need to check if whatever was inside the quotes is actually a valid identifier name. @@ -2442,19 +2688,24 @@ module ts { // Try to get a valid display name for this symbol, if we could not find one, then ignore it. // We would like to only show things that can be added after a dot, so for instance numeric properties can // not be accessed with a dot (a.1 <- invalid) - let displayName = getCompletionEntryDisplayName(symbol, program.getCompilerOptions().target, /*performCharacterChecks:*/ true); + let displayName = getCompletionEntryDisplayNameForSymbol(symbol, program.getCompilerOptions().target, /*performCharacterChecks:*/ true); if (!displayName) { return undefined; } - // TODO(drosen): Right now we just permit *all* semantic meanings when calling 'getSymbolKind' - // which is permissible given that it is backwards compatible; but really we should consider - // passing the meaning for the node so that we don't report that a suggestion for a value is an interface. - // We COULD also just do what 'getSymbolModifiers' does, which is to use the first declaration. + // TODO(drosen): Right now we just permit *all* semantic meanings when calling + // 'getSymbolKind' which is permissible given that it is backwards compatible; but + // really we should consider passing the meaning for the node so that we don't report + // that a suggestion for a value is an interface. We COULD also just do what + // 'getSymbolModifiers' does, which is to use the first declaration. + + // Use a 'sortText' of 0' so that all symbol completion entries come before any other + // entries (like JavaScript identifier entries). return { name: displayName, kind: getSymbolKind(symbol, typeChecker, location), - kindModifiers: getSymbolModifiers(symbol) + kindModifiers: getSymbolModifiers(symbol), + sortText: "0", }; } @@ -2498,8 +2749,9 @@ module ts { return undefined; } - // Find the node where completion is requested on, in the case of a completion after a dot, it is the member access expression - // otherwise, it is a request for all visible symbols in the scope, and the node is the current location + // Find the node where completion is requested on, in the case of a completion after + // a dot, it is the member access expression other wise, it is a request for all + // visible symbols in the scope, and the node is the current location. let node = currentToken; let isRightOfDot = false; if (contextToken && contextToken.kind === SyntaxKind.DotToken && contextToken.parent.kind === SyntaxKind.PropertyAccessExpression) { @@ -2517,11 +2769,26 @@ module ts { let semanticStart = new Date().getTime(); let isMemberCompletion: boolean; let isNewIdentifierLocation: boolean; - let symbols: Symbol[]; + let symbols: Symbol[] = []; if (isRightOfDot) { + getTypeScriptMemberSymbols(); + } + else { + // For JavaScript or TypeScript, if we're not after a dot, then just try to get the + // global symbols in scope. These results should be valid for either language as + // the set of symbols that can be referenced from this location. + if (!tryGetGlobalSymbols()) { + return undefined; + } + } + + log("getCompletionData: Semantic work: " + (new Date().getTime() - semanticStart)); + + return { symbols, isMemberCompletion, isNewIdentifierLocation, location, isRightOfDot }; + + function getTypeScriptMemberSymbols(): void { // Right of dot member completion list - symbols = []; isMemberCompletion = true; isNewIdentifierLocation = false; @@ -2535,7 +2802,8 @@ module ts { if (symbol && symbol.flags & SymbolFlags.HasExports) { // Extract module or enum members - forEachValue(symbol.exports, symbol => { + let exportedSymbols = typeInfoResolver.getExportsOfModule(symbol); + forEach(exportedSymbols, symbol => { if (typeInfoResolver.isValidPropertyAccess((node.parent), symbol.name)) { symbols.push(symbol); } @@ -2553,7 +2821,8 @@ module ts { }); } } - else { + + function tryGetGlobalSymbols(): boolean { let containingObjectLiteral = getContainingObjectLiteralApplicableForCompletion(contextToken); if (containingObjectLiteral) { // Object literal expression, look up possible property names from contextual type @@ -2562,7 +2831,7 @@ module ts { let contextualType = typeInfoResolver.getContextualType(containingObjectLiteral); if (!contextualType) { - return undefined; + return false; } let contextualTypeMembers = typeInfoResolver.getPropertiesOfType(contextualType); @@ -2579,8 +2848,17 @@ module ts { if (showCompletionsInImportsClause(contextToken)) { let importDeclaration = getAncestor(contextToken, SyntaxKind.ImportDeclaration); Debug.assert(importDeclaration !== undefined); - let exports = typeInfoResolver.getExportsOfExternalModule(importDeclaration); - symbols = filterModuleExports(exports, importDeclaration); + + let exports: Symbol[]; + if (importDeclaration.moduleSpecifier) { + let moduleSpecifierSymbol = typeInfoResolver.getSymbolAtLocation(importDeclaration.moduleSpecifier); + if (moduleSpecifierSymbol) { + exports = typeInfoResolver.getExportsOfModule(moduleSpecifierSymbol); + } + } + + //let exports = typeInfoResolver.getExportsOfImportDeclaration(importDeclaration); + symbols = exports ? filterModuleExports(exports, importDeclaration) : emptyArray; } } else { @@ -2620,18 +2898,16 @@ module ts { previousToken.getStart() : position; - let scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile); + let scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile; /// TODO filter meaning based on the current context let symbolMeanings = SymbolFlags.Type | SymbolFlags.Value | SymbolFlags.Namespace | SymbolFlags.Alias; symbols = typeInfoResolver.getSymbolsInScope(scopeNode, symbolMeanings); } + + return true; } - log("getCompletionData: Semantic work: " + (new Date().getTime() - semanticStart)); - - return { symbols, isMemberCompletion, isNewIdentifierLocation, location }; - /** * Finds the first node that "embraces" the position, so that one may * accurately aggregate locals from the closest containing scope. @@ -2932,18 +3208,26 @@ module ts { function getCompletionsAtPosition(fileName: string, position: number): CompletionInfo { synchronizeHostData(); - + let completionData = getCompletionData(fileName, position); if (!completionData) { return undefined; } - let { symbols, isMemberCompletion, isNewIdentifierLocation, location } = completionData; - if (!symbols || symbols.length === 0) { - return undefined; - } + let { symbols, isMemberCompletion, isNewIdentifierLocation, location, isRightOfDot } = completionData; - var entries = getCompletionEntriesFromSymbols(symbols); + let entries: CompletionEntry[]; + if (isRightOfDot && isJavaScript(fileName)) { + entries = getCompletionEntriesFromSymbols(symbols); + addRange(entries, getJavaScriptCompletionEntries()); + } + else { + if (!symbols || symbols.length === 0) { + return undefined; + } + + entries = getCompletionEntriesFromSymbols(symbols); + } // Add keywords if this is not a member completion list if (!isMemberCompletion) { @@ -2952,21 +3236,51 @@ module ts { return { isMemberCompletion, isNewIdentifierLocation, entries }; - function getCompletionEntriesFromSymbols(symbols: Symbol[]): CompletionEntry[] { - let start = new Date().getTime(); - var entries: CompletionEntry[] = []; - var nameToSymbol: Map = {}; + function getJavaScriptCompletionEntries(): CompletionEntry[] { + let entries: CompletionEntry[] = []; + let allNames: Map = {}; + let target = program.getCompilerOptions().target; - for (let symbol of symbols) { - let entry = createCompletionEntry(symbol, typeInfoResolver, location); - if (entry) { - let id = escapeIdentifier(entry.name); - if (!lookUp(nameToSymbol, id)) { - entries.push(entry); - nameToSymbol[id] = symbol; + for (let sourceFile of program.getSourceFiles()) { + let nameTable = getNameTable(sourceFile); + for (let name in nameTable) { + if (!allNames[name]) { + allNames[name] = name; + let displayName = getCompletionEntryDisplayName(name, target, /*performCharacterChecks:*/ true); + if (displayName) { + let entry = { + name: displayName, + kind: ScriptElementKind.warning, + kindModifiers: "", + sortText: "1" + }; + entries.push(entry); + } } } } + + return entries; + } + + function getCompletionEntriesFromSymbols(symbols: Symbol[]): CompletionEntry[] { + let start = new Date().getTime(); + var entries: CompletionEntry[] = []; + + if (symbols) { + var nameToSymbol: Map = {}; + for (let symbol of symbols) { + let entry = createCompletionEntry(symbol, typeInfoResolver, location); + if (entry) { + let id = escapeIdentifier(entry.name); + if (!lookUp(nameToSymbol, id)) { + entries.push(entry); + nameToSymbol[id] = symbol; + } + } + } + } + log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (new Date().getTime() - start)); return entries; } @@ -2985,7 +3299,7 @@ module ts { // We don't need to perform character checks here because we're only comparing the // name against 'entryName' (which is known to be good), not building a new // completion entry. - let symbol = forEach(symbols, s => getCompletionEntryDisplayName(s, target, /*performCharacterChecks:*/ false) === entryName ? s : undefined); + let symbol = forEach(symbols, s => getCompletionEntryDisplayNameForSymbol(s, target, /*performCharacterChecks:*/ false) === entryName ? s : undefined); if (symbol) { let displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location, typeInfoResolver, location, SemanticMeaning.All); @@ -3641,8 +3955,24 @@ module ts { } } - /// References and Occurrences function getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[] { + let results = getOccurrencesAtPositionCore(fileName, position); + + if (results) { + let sourceFile = getCanonicalFileName(normalizeSlashes(fileName)); + + // ensure the results are in the file we're interested in + results.forEach((value) => { + let targetFile = getCanonicalFileName(normalizeSlashes(value.fileName)); + Debug.assert(sourceFile == targetFile, `Unexpected file in results. Found results in ${targetFile} expected only results in ${sourceFile}.`); + }); + } + + return results; + } + + /// References and Occurrences + function getOccurrencesAtPositionCore(fileName: string, position: number): ReferenceEntry[] { synchronizeHostData(); let sourceFile = getValidSourceFile(fileName); @@ -4877,8 +5207,8 @@ module ts { if (symbol && symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface)) { forEach(symbol.getDeclarations(), declaration => { if (declaration.kind === SyntaxKind.ClassDeclaration) { - getPropertySymbolFromTypeReference(getClassBaseTypeNode(declaration)); - forEach(getClassImplementedTypeNodes(declaration), getPropertySymbolFromTypeReference); + getPropertySymbolFromTypeReference(getClassExtendsHeritageClauseElement(declaration)); + forEach(getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); } else if (declaration.kind === SyntaxKind.InterfaceDeclaration) { forEach(getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); @@ -4887,7 +5217,7 @@ module ts { } return; - function getPropertySymbolFromTypeReference(typeReference: TypeReferenceNode) { + function getPropertySymbolFromTypeReference(typeReference: HeritageClauseElement) { if (typeReference) { let type = typeInfoResolver.getTypeAtLocation(typeReference); if (type) { @@ -5144,19 +5474,44 @@ module ts { } function isTypeReference(node: Node): boolean { - if (isRightSideOfQualifiedName(node)) { + if (isRightSideOfQualifiedNameOrPropertyAccess(node) ) { node = node.parent; } - return node.parent.kind === SyntaxKind.TypeReference; + return node.parent.kind === SyntaxKind.TypeReference || node.parent.kind === SyntaxKind.HeritageClauseElement; } function isNamespaceReference(node: Node): boolean { + return isQualifiedNameNamespaceReference(node) || isPropertyAccessNamespaceReference(node); + } + + function isPropertyAccessNamespaceReference(node: Node): boolean { + let root = node; + let isLastClause = true; + if (root.parent.kind === SyntaxKind.PropertyAccessExpression) { + while (root.parent && root.parent.kind === SyntaxKind.PropertyAccessExpression) { + root = root.parent; + } + + isLastClause = (root).name === node; + } + + if (!isLastClause && root.parent.kind === SyntaxKind.HeritageClauseElement && 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); + } + + return false; + } + + function isQualifiedNameNamespaceReference(node: Node): boolean { let root = node; let isLastClause = true; if (root.parent.kind === SyntaxKind.QualifiedName) { - while (root.parent && root.parent.kind === SyntaxKind.QualifiedName) + while (root.parent && root.parent.kind === SyntaxKind.QualifiedName) { root = root.parent; + } isLastClause = (root).right === node; } diff --git a/src/services/shims.ts b/src/services/shims.ts index adcec5ada2b..7b5eeaf94d2 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -331,6 +331,22 @@ module ts { } } + /* @internal */ + export function realizeDiagnostics(diagnostics: Diagnostic[], newLine: string): { message: string; start: number; length: number; category: string; } []{ + return diagnostics.map(d => realizeDiagnostic(d, newLine)); + } + + function realizeDiagnostic(diagnostic: Diagnostic, newLine: string): { message: string; start: number; length: number; category: string; } { + return { + message: flattenDiagnosticMessageText(diagnostic.messageText, newLine), + start: diagnostic.start, + length: diagnostic.length, + /// TODO: no need for the tolowerCase call + category: DiagnosticCategory[diagnostic.category].toLowerCase(), + code: diagnostic.code + }; + } + class LanguageServiceShimObject extends ShimBase implements LanguageServiceShim { private logger: Logger; @@ -391,18 +407,7 @@ module ts { private realizeDiagnostics(diagnostics: Diagnostic[]): { message: string; start: number; length: number; category: string; }[]{ var newLine = this.getNewLine(); - return diagnostics.map(d => this.realizeDiagnostic(d, newLine)); - } - - private realizeDiagnostic(diagnostic: Diagnostic, newLine: string): { message: string; start: number; length: number; category: string; } { - return { - message: flattenDiagnosticMessageText(diagnostic.messageText, newLine), - start: diagnostic.start, - length: diagnostic.length, - /// TODO: no need for the tolowerCase call - category: DiagnosticCategory[diagnostic.category].toLowerCase(), - code: diagnostic.code - }; + return ts.realizeDiagnostics(diagnostics, newLine); } public getSyntacticClassifications(fileName: string, start: number, length: number): string { diff --git a/tests/baselines/reference/2dArrays.js b/tests/baselines/reference/2dArrays.js index 7840f3d8c54..fe8ab380ba7 100644 --- a/tests/baselines/reference/2dArrays.js +++ b/tests/baselines/reference/2dArrays.js @@ -30,9 +30,7 @@ var Board = (function () { function Board() { } Board.prototype.allShipsSunk = function () { - return this.ships.every(function (val) { - return val.isSunk; - }); + return this.ships.every(function (val) { return val.isSunk; }); }; return Board; })(); diff --git a/tests/baselines/reference/APISample_compile.js b/tests/baselines/reference/APISample_compile.js index 07d5e4337a6..f30bd2c21a9 100644 --- a/tests/baselines/reference/APISample_compile.js +++ b/tests/baselines/reference/APISample_compile.js @@ -1,5 +1,3 @@ -//// [tests/cases/compiler/APISample_compile.ts] //// - //// [APISample_compile.ts] /* @@ -21,8 +19,9 @@ export function compile(fileNames: string[], options: ts.CompilerOptions): void var allDiagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics); allDiagnostics.forEach(diagnostic => { - var lineChar = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); - console.log(`${diagnostic.file.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, os.EOL)}`); + var { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); + var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); + console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); }); var exitCode = emitResult.emitSkipped ? 1 : 0; @@ -34,1971 +33,6 @@ compile(process.argv.slice(2), { noEmitOnError: true, noImplicitAny: true, target: ts.ScriptTarget.ES5, module: ts.ModuleKind.CommonJS }); -//// [typescript.d.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 http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -declare module "typescript" { - interface Map { - [index: string]: T; - } - interface TextRange { - pos: number; - end: number; - } - const enum SyntaxKind { - Unknown = 0, - EndOfFileToken = 1, - SingleLineCommentTrivia = 2, - MultiLineCommentTrivia = 3, - NewLineTrivia = 4, - WhitespaceTrivia = 5, - ConflictMarkerTrivia = 6, - NumericLiteral = 7, - StringLiteral = 8, - RegularExpressionLiteral = 9, - NoSubstitutionTemplateLiteral = 10, - TemplateHead = 11, - TemplateMiddle = 12, - TemplateTail = 13, - OpenBraceToken = 14, - CloseBraceToken = 15, - OpenParenToken = 16, - CloseParenToken = 17, - OpenBracketToken = 18, - CloseBracketToken = 19, - DotToken = 20, - DotDotDotToken = 21, - SemicolonToken = 22, - CommaToken = 23, - LessThanToken = 24, - GreaterThanToken = 25, - LessThanEqualsToken = 26, - GreaterThanEqualsToken = 27, - EqualsEqualsToken = 28, - ExclamationEqualsToken = 29, - EqualsEqualsEqualsToken = 30, - ExclamationEqualsEqualsToken = 31, - EqualsGreaterThanToken = 32, - PlusToken = 33, - MinusToken = 34, - AsteriskToken = 35, - SlashToken = 36, - PercentToken = 37, - PlusPlusToken = 38, - MinusMinusToken = 39, - LessThanLessThanToken = 40, - GreaterThanGreaterThanToken = 41, - GreaterThanGreaterThanGreaterThanToken = 42, - AmpersandToken = 43, - BarToken = 44, - CaretToken = 45, - ExclamationToken = 46, - TildeToken = 47, - AmpersandAmpersandToken = 48, - BarBarToken = 49, - QuestionToken = 50, - ColonToken = 51, - AtToken = 52, - EqualsToken = 53, - PlusEqualsToken = 54, - MinusEqualsToken = 55, - AsteriskEqualsToken = 56, - SlashEqualsToken = 57, - PercentEqualsToken = 58, - LessThanLessThanEqualsToken = 59, - GreaterThanGreaterThanEqualsToken = 60, - GreaterThanGreaterThanGreaterThanEqualsToken = 61, - AmpersandEqualsToken = 62, - BarEqualsToken = 63, - CaretEqualsToken = 64, - Identifier = 65, - BreakKeyword = 66, - CaseKeyword = 67, - CatchKeyword = 68, - ClassKeyword = 69, - ConstKeyword = 70, - ContinueKeyword = 71, - DebuggerKeyword = 72, - DefaultKeyword = 73, - DeleteKeyword = 74, - DoKeyword = 75, - ElseKeyword = 76, - EnumKeyword = 77, - ExportKeyword = 78, - ExtendsKeyword = 79, - FalseKeyword = 80, - FinallyKeyword = 81, - ForKeyword = 82, - FunctionKeyword = 83, - IfKeyword = 84, - ImportKeyword = 85, - InKeyword = 86, - InstanceOfKeyword = 87, - NewKeyword = 88, - NullKeyword = 89, - ReturnKeyword = 90, - SuperKeyword = 91, - SwitchKeyword = 92, - ThisKeyword = 93, - ThrowKeyword = 94, - TrueKeyword = 95, - TryKeyword = 96, - TypeOfKeyword = 97, - VarKeyword = 98, - VoidKeyword = 99, - WhileKeyword = 100, - WithKeyword = 101, - AsKeyword = 102, - ImplementsKeyword = 103, - InterfaceKeyword = 104, - LetKeyword = 105, - PackageKeyword = 106, - PrivateKeyword = 107, - ProtectedKeyword = 108, - PublicKeyword = 109, - StaticKeyword = 110, - YieldKeyword = 111, - AnyKeyword = 112, - BooleanKeyword = 113, - ConstructorKeyword = 114, - 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, - OmittedExpression = 174, - TemplateSpan = 175, - Block = 176, - VariableStatement = 177, - EmptyStatement = 178, - ExpressionStatement = 179, - IfStatement = 180, - DoStatement = 181, - WhileStatement = 182, - ForStatement = 183, - ForInStatement = 184, - ForOfStatement = 185, - ContinueStatement = 186, - BreakStatement = 187, - ReturnStatement = 188, - WithStatement = 189, - SwitchStatement = 190, - LabeledStatement = 191, - ThrowStatement = 192, - TryStatement = 193, - DebuggerStatement = 194, - VariableDeclaration = 195, - VariableDeclarationList = 196, - FunctionDeclaration = 197, - ClassDeclaration = 198, - InterfaceDeclaration = 199, - TypeAliasDeclaration = 200, - EnumDeclaration = 201, - ModuleDeclaration = 202, - ModuleBlock = 203, - CaseBlock = 204, - ImportEqualsDeclaration = 205, - ImportDeclaration = 206, - ImportClause = 207, - NamespaceImport = 208, - NamedImports = 209, - ImportSpecifier = 210, - ExportAssignment = 211, - ExportDeclaration = 212, - NamedExports = 213, - ExportSpecifier = 214, - MissingDeclaration = 215, - ExternalModuleReference = 216, - CaseClause = 217, - DefaultClause = 218, - HeritageClause = 219, - CatchClause = 220, - PropertyAssignment = 221, - ShorthandPropertyAssignment = 222, - EnumMember = 223, - SourceFile = 224, - SyntaxList = 225, - Count = 226, - FirstAssignment = 53, - LastAssignment = 64, - FirstReservedWord = 66, - LastReservedWord = 101, - FirstKeyword = 66, - LastKeyword = 125, - FirstFutureReservedWord = 103, - LastFutureReservedWord = 111, - FirstTypeNode = 141, - LastTypeNode = 149, - FirstPunctuation = 14, - LastPunctuation = 64, - FirstToken = 0, - LastToken = 125, - FirstTriviaToken = 2, - LastTriviaToken = 6, - FirstLiteralToken = 7, - LastLiteralToken = 10, - FirstTemplateToken = 10, - LastTemplateToken = 13, - FirstBinaryOperator = 24, - LastBinaryOperator = 64, - FirstNode = 126, - } - const enum NodeFlags { - Export = 1, - Ambient = 2, - Public = 16, - Private = 32, - Protected = 64, - Static = 128, - Default = 256, - MultiLine = 512, - Synthetic = 1024, - DeclarationFile = 2048, - Let = 4096, - Const = 8192, - OctalLiteral = 16384, - ExportContext = 32768, - Modifier = 499, - AccessibilityModifier = 112, - BlockScoped = 12288, - } - const enum ParserContextFlags { - StrictMode = 1, - DisallowIn = 2, - Yield = 4, - GeneratorParameter = 8, - Decorator = 16, - ThisNodeHasError = 32, - ParserGeneratedFlags = 63, - ThisNodeOrAnySubNodesHasError = 64, - HasAggregatedChildData = 128, - } - const enum RelationComparisonResult { - Succeeded = 1, - Failed = 2, - FailedAndReported = 3, - } - interface Node extends TextRange { - kind: SyntaxKind; - flags: NodeFlags; - parserContextFlags?: ParserContextFlags; - decorators?: NodeArray; - modifiers?: ModifiersArray; - id?: number; - parent?: Node; - symbol?: Symbol; - locals?: SymbolTable; - nextContainer?: Node; - localSymbol?: Symbol; - } - interface NodeArray extends Array, TextRange { - hasTrailingComma?: boolean; - } - interface ModifiersArray extends NodeArray { - flags: number; - } - interface Identifier extends PrimaryExpression { - text: string; - } - interface QualifiedName extends Node { - left: EntityName; - right: Identifier; - } - type EntityName = Identifier | QualifiedName; - type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName | BindingPattern; - interface Declaration extends Node { - _declarationBrand: any; - name?: DeclarationName; - } - interface ComputedPropertyName extends Node { - expression: Expression; - } - interface Decorator extends Node { - expression: LeftHandSideExpression; - } - interface TypeParameterDeclaration extends Declaration { - name: Identifier; - constraint?: TypeNode; - expression?: Expression; - } - interface SignatureDeclaration extends Declaration { - typeParameters?: NodeArray; - parameters: NodeArray; - type?: TypeNode; - } - interface VariableDeclaration extends Declaration { - parent?: VariableDeclarationList; - name: Identifier | BindingPattern; - type?: TypeNode; - initializer?: Expression; - } - interface VariableDeclarationList extends Node { - declarations: NodeArray; - } - interface ParameterDeclaration extends Declaration { - dotDotDotToken?: Node; - name: Identifier | BindingPattern; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface BindingElement extends Declaration { - propertyName?: Identifier; - dotDotDotToken?: Node; - name: Identifier | BindingPattern; - initializer?: Expression; - } - interface PropertyDeclaration extends Declaration, ClassElement { - name: DeclarationName; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface ObjectLiteralElement extends Declaration { - _objectLiteralBrandBrand: any; - } - interface PropertyAssignment extends ObjectLiteralElement { - _propertyAssignmentBrand: any; - name: DeclarationName; - questionToken?: Node; - initializer: Expression; - } - interface ShorthandPropertyAssignment extends ObjectLiteralElement { - name: Identifier; - questionToken?: Node; - } - interface VariableLikeDeclaration extends Declaration { - propertyName?: Identifier; - dotDotDotToken?: Node; - name: DeclarationName; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface BindingPattern extends Node { - elements: NodeArray; - } - /** - * Several node kinds share function-like features such as a signature, - * a name, and a body. These nodes should extend FunctionLikeDeclaration. - * Examples: - * FunctionDeclaration - * MethodDeclaration - * AccessorDeclaration - */ - interface FunctionLikeDeclaration extends SignatureDeclaration { - _functionLikeDeclarationBrand: any; - asteriskToken?: Node; - questionToken?: Node; - body?: Block | Expression; - } - interface FunctionDeclaration extends FunctionLikeDeclaration, Statement { - name?: Identifier; - body?: Block; - } - interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { - body?: Block; - } - interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { - body?: Block; - } - interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { - _accessorDeclarationBrand: any; - body: Block; - } - interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement { - _indexSignatureDeclarationBrand: any; - } - interface TypeNode extends Node { - _typeNodeBrand: any; - } - interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration { - _functionOrConstructorTypeNodeBrand: any; - } - interface TypeReferenceNode extends TypeNode { - typeName: EntityName; - typeArguments?: NodeArray; - } - interface TypeQueryNode extends TypeNode { - exprName: EntityName; - } - interface TypeLiteralNode extends TypeNode, Declaration { - members: NodeArray; - } - interface ArrayTypeNode extends TypeNode { - elementType: TypeNode; - } - interface TupleTypeNode extends TypeNode { - elementTypes: NodeArray; - } - interface UnionTypeNode extends TypeNode { - types: NodeArray; - } - interface ParenthesizedTypeNode extends TypeNode { - type: TypeNode; - } - interface StringLiteralTypeNode extends LiteralExpression, TypeNode { - } - interface Expression extends Node { - _expressionBrand: any; - contextualType?: Type; - } - interface UnaryExpression extends Expression { - _unaryExpressionBrand: any; - } - interface PrefixUnaryExpression extends UnaryExpression { - operator: SyntaxKind; - operand: UnaryExpression; - } - interface PostfixUnaryExpression extends PostfixExpression { - operand: LeftHandSideExpression; - operator: SyntaxKind; - } - interface PostfixExpression extends UnaryExpression { - _postfixExpressionBrand: any; - } - interface LeftHandSideExpression extends PostfixExpression { - _leftHandSideExpressionBrand: any; - } - interface MemberExpression extends LeftHandSideExpression { - _memberExpressionBrand: any; - } - interface PrimaryExpression extends MemberExpression { - _primaryExpressionBrand: any; - } - interface DeleteExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface TypeOfExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface VoidExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface YieldExpression extends Expression { - asteriskToken?: Node; - expression: Expression; - } - interface BinaryExpression extends Expression { - left: Expression; - operatorToken: Node; - right: Expression; - } - interface ConditionalExpression extends Expression { - condition: Expression; - questionToken: Node; - whenTrue: Expression; - colonToken: Node; - whenFalse: Expression; - } - interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration { - name?: Identifier; - body: Block | Expression; - } - interface ArrowFunction extends Expression, FunctionLikeDeclaration { - equalsGreaterThanToken: Node; - } - interface LiteralExpression extends PrimaryExpression { - text: string; - isUnterminated?: boolean; - hasExtendedUnicodeEscape?: boolean; - } - interface StringLiteralExpression extends LiteralExpression { - _stringLiteralExpressionBrand: any; - } - interface TemplateExpression extends PrimaryExpression { - head: LiteralExpression; - templateSpans: NodeArray; - } - interface TemplateSpan extends Node { - expression: Expression; - literal: LiteralExpression; - } - interface ParenthesizedExpression extends PrimaryExpression { - expression: Expression; - } - interface ArrayLiteralExpression extends PrimaryExpression { - elements: NodeArray; - } - interface SpreadElementExpression extends Expression { - expression: Expression; - } - interface ObjectLiteralExpression extends PrimaryExpression, Declaration { - properties: NodeArray; - } - interface PropertyAccessExpression extends MemberExpression { - expression: LeftHandSideExpression; - dotToken: Node; - name: Identifier; - } - interface ElementAccessExpression extends MemberExpression { - expression: LeftHandSideExpression; - argumentExpression?: Expression; - } - interface CallExpression extends LeftHandSideExpression { - expression: LeftHandSideExpression; - typeArguments?: NodeArray; - arguments: NodeArray; - } - interface NewExpression extends CallExpression, PrimaryExpression { - } - interface TaggedTemplateExpression extends MemberExpression { - tag: LeftHandSideExpression; - template: LiteralExpression | TemplateExpression; - } - type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression; - interface TypeAssertion extends UnaryExpression { - type: TypeNode; - expression: UnaryExpression; - } - interface Statement extends Node, ModuleElement { - _statementBrand: any; - } - interface Block extends Statement { - statements: NodeArray; - } - interface VariableStatement extends Statement { - declarationList: VariableDeclarationList; - } - interface ExpressionStatement extends Statement { - expression: Expression; - } - interface IfStatement extends Statement { - expression: Expression; - thenStatement: Statement; - elseStatement?: Statement; - } - interface IterationStatement extends Statement { - statement: Statement; - } - interface DoStatement extends IterationStatement { - expression: Expression; - } - interface WhileStatement extends IterationStatement { - expression: Expression; - } - interface ForStatement extends IterationStatement { - initializer?: VariableDeclarationList | Expression; - condition?: Expression; - iterator?: Expression; - } - interface ForInStatement extends IterationStatement { - initializer: VariableDeclarationList | Expression; - expression: Expression; - } - interface ForOfStatement extends IterationStatement { - initializer: VariableDeclarationList | Expression; - expression: Expression; - } - interface BreakOrContinueStatement extends Statement { - label?: Identifier; - } - interface ReturnStatement extends Statement { - expression?: Expression; - } - interface WithStatement extends Statement { - expression: Expression; - statement: Statement; - } - interface SwitchStatement extends Statement { - expression: Expression; - caseBlock: CaseBlock; - } - interface CaseBlock extends Node { - clauses: NodeArray; - } - interface CaseClause extends Node { - expression?: Expression; - statements: NodeArray; - } - interface DefaultClause extends Node { - statements: NodeArray; - } - type CaseOrDefaultClause = CaseClause | DefaultClause; - interface LabeledStatement extends Statement { - label: Identifier; - statement: Statement; - } - interface ThrowStatement extends Statement { - expression: Expression; - } - interface TryStatement extends Statement { - tryBlock: Block; - catchClause?: CatchClause; - finallyBlock?: Block; - } - interface CatchClause extends Node { - variableDeclaration: VariableDeclaration; - block: Block; - } - interface ModuleElement extends Node { - _moduleElementBrand: any; - } - interface ClassDeclaration extends Declaration, ModuleElement { - name?: Identifier; - typeParameters?: NodeArray; - heritageClauses?: NodeArray; - members: NodeArray; - } - interface ClassElement extends Declaration { - _classElementBrand: any; - } - interface InterfaceDeclaration extends Declaration, ModuleElement { - name: Identifier; - typeParameters?: NodeArray; - heritageClauses?: NodeArray; - members: NodeArray; - } - interface HeritageClause extends Node { - token: SyntaxKind; - types?: NodeArray; - } - interface TypeAliasDeclaration extends Declaration, ModuleElement { - name: Identifier; - type: TypeNode; - } - interface EnumMember extends Declaration { - name: DeclarationName; - initializer?: Expression; - } - interface EnumDeclaration extends Declaration, ModuleElement { - name: Identifier; - members: NodeArray; - } - interface ModuleDeclaration extends Declaration, ModuleElement { - name: Identifier | LiteralExpression; - body: ModuleBlock | ModuleDeclaration; - } - interface ModuleBlock extends Node, ModuleElement { - statements: NodeArray; - } - interface ImportEqualsDeclaration extends Declaration, ModuleElement { - name: Identifier; - moduleReference: EntityName | ExternalModuleReference; - } - interface ExternalModuleReference extends Node { - expression?: Expression; - } - interface ImportDeclaration extends Statement, ModuleElement { - importClause?: ImportClause; - moduleSpecifier: Expression; - } - interface ImportClause extends Declaration { - name?: Identifier; - namedBindings?: NamespaceImport | NamedImports; - } - interface NamespaceImport extends Declaration { - name: Identifier; - } - interface ExportDeclaration extends Declaration, ModuleElement { - exportClause?: NamedExports; - moduleSpecifier?: Expression; - } - interface NamedImportsOrExports extends Node { - elements: NodeArray; - } - type NamedImports = NamedImportsOrExports; - type NamedExports = NamedImportsOrExports; - interface ImportOrExportSpecifier extends Declaration { - propertyName?: Identifier; - name: Identifier; - } - type ImportSpecifier = ImportOrExportSpecifier; - type ExportSpecifier = ImportOrExportSpecifier; - interface ExportAssignment extends Declaration, ModuleElement { - isExportEquals?: boolean; - expression?: Expression; - type?: TypeNode; - } - interface FileReference extends TextRange { - fileName: string; - } - interface CommentRange extends TextRange { - hasTrailingNewLine?: boolean; - } - interface SourceFile extends Declaration { - statements: NodeArray; - endOfFileToken: Node; - fileName: string; - text: string; - amdDependencies: { - path: string; - name: string; - }[]; - amdModuleName: string; - referencedFiles: FileReference[]; - hasNoDefaultLib: boolean; - externalModuleIndicator: Node; - languageVersion: ScriptTarget; - identifiers: Map; - } - interface ScriptReferenceHost { - getCompilerOptions(): CompilerOptions; - getSourceFile(fileName: string): SourceFile; - getCurrentDirectory(): string; - } - interface WriteFileCallback { - (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; - } - interface Program extends ScriptReferenceHost { - getSourceFiles(): SourceFile[]; - /** - * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then - * the JavaScript and declaration files will be produced for all the files in this program. - * If targetSourceFile is specified, then only the JavaScript and declaration for that - * specific file will be generated. - * - * If writeFile is not specified then the writeFile callback from the compiler host will be - * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter - * will be invoked when writing the JavaScript and declaration files. - */ - emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback): EmitResult; - getSyntacticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getGlobalDiagnostics(): Diagnostic[]; - getSemanticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getDeclarationDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getTypeChecker(): TypeChecker; - getCommonSourceDirectory(): string; - } - interface SourceMapSpan { - emittedLine: number; - emittedColumn: number; - sourceLine: number; - sourceColumn: number; - nameIndex?: number; - sourceIndex: number; - } - interface SourceMapData { - sourceMapFilePath: string; - jsSourceMappingURL: string; - sourceMapFile: string; - sourceMapSourceRoot: string; - sourceMapSources: string[]; - inputSourceFileNames: string[]; - sourceMapNames?: string[]; - sourceMapMappings: string; - sourceMapDecodedMappings: SourceMapSpan[]; - } - enum ExitStatus { - Success = 0, - DiagnosticsPresent_OutputsSkipped = 1, - DiagnosticsPresent_OutputsGenerated = 2, - } - interface EmitResult { - emitSkipped: boolean; - diagnostics: Diagnostic[]; - sourceMaps: SourceMapData[]; - } - interface TypeCheckerHost { - getCompilerOptions(): CompilerOptions; - getSourceFiles(): SourceFile[]; - getSourceFile(fileName: string): SourceFile; - } - interface TypeChecker { - getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; - getDeclaredTypeOfSymbol(symbol: Symbol): Type; - getPropertiesOfType(type: Type): Symbol[]; - getPropertyOfType(type: Type, propertyName: string): Symbol; - getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; - getIndexTypeOfType(type: Type, kind: IndexKind): Type; - getReturnTypeOfSignature(signature: Signature): Type; - getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; - getSymbolAtLocation(node: Node): Symbol; - getShorthandAssignmentValueSymbol(location: Node): Symbol; - getTypeAtLocation(node: Node): Type; - typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; - symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; - getSymbolDisplayBuilder(): SymbolDisplayBuilder; - getFullyQualifiedName(symbol: Symbol): string; - getAugmentedPropertiesOfType(type: Type): Symbol[]; - getRootSymbols(symbol: Symbol): Symbol[]; - getContextualType(node: Expression): Type; - getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature; - getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature; - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; - isUndefinedSymbol(symbol: Symbol): boolean; - isArgumentsSymbol(symbol: Symbol): boolean; - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; - isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; - getAliasedSymbol(symbol: Symbol): Symbol; - getExportsOfExternalModule(node: ImportDeclaration): Symbol[]; - } - interface SymbolDisplayBuilder { - buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; - buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags): void; - buildDisplayForParametersAndDelimiters(parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - } - interface SymbolWriter { - writeKeyword(text: string): void; - writeOperator(text: string): void; - writePunctuation(text: string): void; - writeSpace(text: string): void; - writeStringLiteral(text: string): void; - writeParameter(text: string): void; - writeSymbol(text: string, symbol: Symbol): void; - writeLine(): void; - increaseIndent(): void; - decreaseIndent(): void; - clear(): void; - trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; - } - const enum TypeFormatFlags { - None = 0, - WriteArrayAsGenericType = 1, - UseTypeOfFunction = 2, - NoTruncation = 4, - WriteArrowStyleSignature = 8, - WriteOwnNameForAnyLike = 16, - WriteTypeArgumentsOfSignature = 32, - InElementType = 64, - UseFullyQualifiedType = 128, - } - const enum SymbolFormatFlags { - None = 0, - WriteTypeParametersOrArguments = 1, - UseOnlyExternalAliasing = 2, - } - const enum SymbolAccessibility { - Accessible = 0, - NotAccessible = 1, - CannotBeNamed = 2, - } - type AnyImportSyntax = ImportDeclaration | ImportEqualsDeclaration; - interface SymbolVisibilityResult { - accessibility: SymbolAccessibility; - aliasesToMakeVisible?: AnyImportSyntax[]; - errorSymbolName?: string; - errorNode?: Node; - } - interface SymbolAccessiblityResult extends SymbolVisibilityResult { - errorModuleName?: string; - } - interface EmitResolver { - hasGlobalName(name: string): boolean; - getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string; - isValueAliasDeclaration(node: Node): boolean; - isReferencedAliasDeclaration(node: Node, checkChildren?: boolean): boolean; - isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; - getNodeCheckFlags(node: Node): NodeCheckFlags; - isDeclarationVisible(node: Declaration): boolean; - collectLinkedAliases(node: Identifier): Node[]; - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; - writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult; - isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult; - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; - resolvesToSomeValue(location: Node, name: string): boolean; - getBlockScopedVariableId(node: Identifier): number; - } - const enum SymbolFlags { - FunctionScopedVariable = 1, - BlockScopedVariable = 2, - Property = 4, - EnumMember = 8, - Function = 16, - Class = 32, - Interface = 64, - ConstEnum = 128, - RegularEnum = 256, - ValueModule = 512, - NamespaceModule = 1024, - TypeLiteral = 2048, - ObjectLiteral = 4096, - Method = 8192, - Constructor = 16384, - GetAccessor = 32768, - SetAccessor = 65536, - Signature = 131072, - TypeParameter = 262144, - TypeAlias = 524288, - ExportValue = 1048576, - ExportType = 2097152, - ExportNamespace = 4194304, - Alias = 8388608, - Instantiated = 16777216, - Merged = 33554432, - Transient = 67108864, - Prototype = 134217728, - UnionProperty = 268435456, - Optional = 536870912, - ExportStar = 1073741824, - Enum = 384, - Variable = 3, - Value = 107455, - Type = 793056, - Namespace = 1536, - Module = 1536, - Accessor = 98304, - FunctionScopedVariableExcludes = 107454, - BlockScopedVariableExcludes = 107455, - ParameterExcludes = 107455, - PropertyExcludes = 107455, - EnumMemberExcludes = 107455, - FunctionExcludes = 106927, - ClassExcludes = 899583, - InterfaceExcludes = 792992, - RegularEnumExcludes = 899327, - ConstEnumExcludes = 899967, - ValueModuleExcludes = 106639, - NamespaceModuleExcludes = 0, - MethodExcludes = 99263, - GetAccessorExcludes = 41919, - SetAccessorExcludes = 74687, - TypeParameterExcludes = 530912, - TypeAliasExcludes = 793056, - AliasExcludes = 8388608, - ModuleMember = 8914931, - ExportHasLocal = 944, - HasLocals = 255504, - HasExports = 1952, - HasMembers = 6240, - IsContainer = 262128, - PropertyOrAccessor = 98308, - Export = 7340032, - } - interface Symbol { - flags: SymbolFlags; - name: string; - id?: number; - mergeId?: number; - declarations?: Declaration[]; - parent?: Symbol; - members?: SymbolTable; - exports?: SymbolTable; - exportSymbol?: Symbol; - valueDeclaration?: Declaration; - constEnumOnlyModule?: boolean; - } - interface SymbolLinks { - target?: Symbol; - type?: Type; - declaredType?: Type; - mapper?: TypeMapper; - referenced?: boolean; - unionType?: UnionType; - resolvedExports?: SymbolTable; - exportsChecked?: boolean; - } - interface TransientSymbol extends Symbol, SymbolLinks { - } - interface SymbolTable { - [index: string]: Symbol; - } - const enum NodeCheckFlags { - TypeChecked = 1, - LexicalThis = 2, - CaptureThis = 4, - EmitExtends = 8, - SuperInstance = 16, - SuperStatic = 32, - ContextChecked = 64, - EnumValuesComputed = 128, - BlockScopedBindingInLoop = 256, - EmitDecorate = 512, - } - interface NodeLinks { - resolvedType?: Type; - resolvedSignature?: Signature; - resolvedSymbol?: Symbol; - flags?: NodeCheckFlags; - enumMemberValue?: number; - isIllegalTypeReferenceInConstraint?: boolean; - isVisible?: boolean; - generatedName?: string; - generatedNames?: Map; - assignmentChecks?: Map; - hasReportedStatementInAmbientContext?: boolean; - importOnRightSide?: Symbol; - } - const enum TypeFlags { - Any = 1, - String = 2, - Number = 4, - Boolean = 8, - Void = 16, - Undefined = 32, - Null = 64, - Enum = 128, - StringLiteral = 256, - TypeParameter = 512, - Class = 1024, - Interface = 2048, - Reference = 4096, - Tuple = 8192, - Union = 16384, - Anonymous = 32768, - FromSignature = 65536, - ObjectLiteral = 131072, - ContainsUndefinedOrNull = 262144, - ContainsObjectLiteral = 524288, - ESSymbol = 1048576, - Intrinsic = 1048703, - Primitive = 1049086, - StringLike = 258, - NumberLike = 132, - ObjectType = 48128, - RequiresWidening = 786432, - } - interface Type { - flags: TypeFlags; - id: number; - symbol?: Symbol; - } - interface IntrinsicType extends Type { - intrinsicName: string; - } - interface StringLiteralType extends Type { - text: string; - } - interface ObjectType extends Type { - } - interface InterfaceType extends ObjectType { - typeParameters: TypeParameter[]; - baseTypes: ObjectType[]; - declaredProperties: Symbol[]; - declaredCallSignatures: Signature[]; - declaredConstructSignatures: Signature[]; - declaredStringIndexType: Type; - declaredNumberIndexType: Type; - } - interface TypeReference extends ObjectType { - target: GenericType; - typeArguments: Type[]; - } - interface GenericType extends InterfaceType, TypeReference { - instantiations: Map; - } - interface TupleType extends ObjectType { - elementTypes: Type[]; - baseArrayType: TypeReference; - } - interface UnionType extends Type { - types: Type[]; - resolvedProperties: SymbolTable; - } - interface ResolvedType extends ObjectType, UnionType { - members: SymbolTable; - properties: Symbol[]; - callSignatures: Signature[]; - constructSignatures: Signature[]; - stringIndexType: Type; - numberIndexType: Type; - } - interface TypeParameter extends Type { - constraint: Type; - target?: TypeParameter; - mapper?: TypeMapper; - } - const enum SignatureKind { - Call = 0, - Construct = 1, - } - interface Signature { - declaration: SignatureDeclaration; - typeParameters: TypeParameter[]; - parameters: Symbol[]; - resolvedReturnType: Type; - minArgumentCount: number; - hasRestParameter: boolean; - hasStringLiterals: boolean; - target?: Signature; - mapper?: TypeMapper; - unionSignatures?: Signature[]; - erasedSignatureCache?: Signature; - isolatedSignatureType?: ObjectType; - } - const enum IndexKind { - String = 0, - Number = 1, - } - interface TypeMapper { - (t: Type): Type; - } - interface DiagnosticMessage { - key: string; - category: DiagnosticCategory; - code: number; - } - interface DiagnosticMessageChain { - messageText: string; - category: DiagnosticCategory; - code: number; - next?: DiagnosticMessageChain; - } - interface Diagnostic { - file: SourceFile; - start: number; - length: number; - messageText: string | DiagnosticMessageChain; - category: DiagnosticCategory; - code: number; - } - enum DiagnosticCategory { - Warning = 0, - Error = 1, - Message = 2, - } - interface CompilerOptions { - allowNonTsExtensions?: boolean; - charset?: string; - codepage?: number; - declaration?: boolean; - diagnostics?: boolean; - emitBOM?: boolean; - help?: boolean; - listFiles?: boolean; - locale?: string; - mapRoot?: string; - module?: ModuleKind; - noEmit?: boolean; - noEmitOnError?: boolean; - noErrorTruncation?: boolean; - noImplicitAny?: boolean; - noLib?: boolean; - noLibCheck?: boolean; - noResolve?: boolean; - out?: string; - outDir?: string; - preserveConstEnums?: boolean; - project?: string; - removeComments?: boolean; - sourceMap?: boolean; - sourceRoot?: string; - suppressImplicitAnyIndexErrors?: boolean; - target?: ScriptTarget; - version?: boolean; - watch?: boolean; - [option: string]: string | number | boolean; - } - const enum ModuleKind { - None = 0, - CommonJS = 1, - AMD = 2, - } - interface LineAndCharacter { - line: number; - character: number; - } - const enum ScriptTarget { - ES3 = 0, - ES5 = 1, - ES6 = 2, - Latest = 2, - } - interface ParsedCommandLine { - options: CompilerOptions; - fileNames: string[]; - errors: Diagnostic[]; - } - interface CommandLineOption { - name: string; - type: string | Map; - isFilePath?: boolean; - shortName?: string; - description?: DiagnosticMessage; - paramType?: DiagnosticMessage; - error?: DiagnosticMessage; - experimental?: boolean; - } - const enum CharacterCodes { - nullCharacter = 0, - maxAsciiCharacter = 127, - lineFeed = 10, - carriageReturn = 13, - lineSeparator = 8232, - paragraphSeparator = 8233, - nextLine = 133, - space = 32, - nonBreakingSpace = 160, - enQuad = 8192, - emQuad = 8193, - enSpace = 8194, - emSpace = 8195, - threePerEmSpace = 8196, - fourPerEmSpace = 8197, - sixPerEmSpace = 8198, - figureSpace = 8199, - punctuationSpace = 8200, - thinSpace = 8201, - hairSpace = 8202, - zeroWidthSpace = 8203, - narrowNoBreakSpace = 8239, - ideographicSpace = 12288, - mathematicalSpace = 8287, - ogham = 5760, - _ = 95, - $ = 36, - _0 = 48, - _1 = 49, - _2 = 50, - _3 = 51, - _4 = 52, - _5 = 53, - _6 = 54, - _7 = 55, - _8 = 56, - _9 = 57, - a = 97, - b = 98, - c = 99, - d = 100, - e = 101, - f = 102, - g = 103, - h = 104, - i = 105, - j = 106, - k = 107, - l = 108, - m = 109, - n = 110, - o = 111, - p = 112, - q = 113, - r = 114, - s = 115, - t = 116, - u = 117, - v = 118, - w = 119, - x = 120, - y = 121, - z = 122, - A = 65, - B = 66, - C = 67, - D = 68, - E = 69, - F = 70, - G = 71, - H = 72, - I = 73, - J = 74, - K = 75, - L = 76, - M = 77, - N = 78, - O = 79, - P = 80, - Q = 81, - R = 82, - S = 83, - T = 84, - U = 85, - V = 86, - W = 87, - X = 88, - Y = 89, - Z = 90, - ampersand = 38, - asterisk = 42, - at = 64, - backslash = 92, - backtick = 96, - bar = 124, - caret = 94, - closeBrace = 125, - closeBracket = 93, - closeParen = 41, - colon = 58, - comma = 44, - dot = 46, - doubleQuote = 34, - equals = 61, - exclamation = 33, - greaterThan = 62, - hash = 35, - lessThan = 60, - minus = 45, - openBrace = 123, - openBracket = 91, - openParen = 40, - percent = 37, - plus = 43, - question = 63, - semicolon = 59, - singleQuote = 39, - slash = 47, - tilde = 126, - backspace = 8, - formFeed = 12, - byteOrderMark = 65279, - tab = 9, - verticalTab = 11, - } - interface CancellationToken { - isCancellationRequested(): boolean; - } - interface CompilerHost { - getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile; - getDefaultLibFileName(options: CompilerOptions): string; - getCancellationToken?(): CancellationToken; - writeFile: WriteFileCallback; - getCurrentDirectory(): string; - getCanonicalFileName(fileName: string): string; - useCaseSensitiveFileNames(): boolean; - getNewLine(): string; - } - interface TextSpan { - start: number; - length: number; - } - interface TextChangeRange { - span: TextSpan; - newLength: number; - } -} -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): void; - setTextPos(textPos: number): void; - lookAhead(callback: () => T): T; - tryScan(callback: () => T): T; - } - function tokenToString(t: SyntaxKind): string; - function computeLineStarts(text: string): number[]; - function getPositionOfLineAndCharacter(sourceFile: SourceFile, line: number, character: number): number; - function computePositionOfLineAndCharacter(lineStarts: number[], line: number, character: number): number; - function getLineStarts(sourceFile: SourceFile): number[]; - function computeLineAndCharacterOfPosition(lineStarts: number[], position: number): { - line: number; - character: number; - }; - function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter; - function isWhiteSpace(ch: number): boolean; - function isLineBreak(ch: number): boolean; - function isOctalDigit(ch: number): boolean; - function skipTrivia(text: string, pos: number, stopAfterLineBreak?: boolean): number; - function getLeadingCommentRanges(text: string, pos: number): CommentRange[]; - function getTrailingCommentRanges(text: string, pos: number): CommentRange[]; - function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean; - function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean; - function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback): Scanner; -} -declare module "typescript" { - function getNodeConstructor(kind: SyntaxKind): new () => Node; - function createNode(kind: SyntaxKind): Node; - function forEachChild(node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; - function modifierToFlag(token: SyntaxKind): NodeFlags; - function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; - function isEvalOrArgumentsIdentifier(node: Node): boolean; - function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean): SourceFile; - function isLeftHandSideExpression(expr: Expression): boolean; - function isAssignmentOperator(token: SyntaxKind): boolean; -} -declare module "typescript" { - function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker; -} -declare module "typescript" { - /** The version of the TypeScript compiler release */ - let version: string; - function findConfigFile(searchPath: string): string; - function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; - function getPreEmitDiagnostics(program: Program): Diagnostic[]; - function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; - function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; -} -declare module "typescript" { - /** The version of the language service API */ - let servicesVersion: string; - interface Node { - getSourceFile(): SourceFile; - getChildCount(sourceFile?: SourceFile): number; - getChildAt(index: number, sourceFile?: SourceFile): Node; - getChildren(sourceFile?: SourceFile): Node[]; - getStart(sourceFile?: SourceFile): number; - getFullStart(): number; - getEnd(): number; - getWidth(sourceFile?: SourceFile): number; - getFullWidth(): number; - getLeadingTriviaWidth(sourceFile?: SourceFile): number; - getFullText(sourceFile?: SourceFile): string; - getText(sourceFile?: SourceFile): string; - getFirstToken(sourceFile?: SourceFile): Node; - getLastToken(sourceFile?: SourceFile): Node; - } - interface Symbol { - getFlags(): SymbolFlags; - getName(): string; - getDeclarations(): Declaration[]; - getDocumentationComment(): SymbolDisplayPart[]; - } - interface Type { - getFlags(): TypeFlags; - getSymbol(): Symbol; - getProperties(): Symbol[]; - getProperty(propertyName: string): Symbol; - getApparentProperties(): Symbol[]; - getCallSignatures(): Signature[]; - getConstructSignatures(): Signature[]; - getStringIndexType(): Type; - getNumberIndexType(): Type; - } - interface Signature { - getDeclaration(): SignatureDeclaration; - getTypeParameters(): Type[]; - getParameters(): Symbol[]; - getReturnType(): Type; - getDocumentationComment(): SymbolDisplayPart[]; - } - interface SourceFile { - getNamedDeclarations(): Declaration[]; - getLineAndCharacterOfPosition(pos: number): LineAndCharacter; - getLineStarts(): number[]; - getPositionOfLineAndCharacter(line: number, character: number): number; - update(newText: string, textChangeRange: TextChangeRange): SourceFile; - } - /** - * Represents an immutable snapshot of a script at a specified time.Once acquired, the - * snapshot is observably immutable. i.e. the same calls with the same parameters will return - * the same values. - */ - interface IScriptSnapshot { - /** Gets a portion of the script snapshot specified by [start, end). */ - getText(start: number, end: number): string; - /** Gets the length of this script snapshot. */ - getLength(): number; - /** - * Gets the TextChangeRange that describe how the text changed between this text and - * an older version. This information is used by the incremental parser to determine - * what sections of the script need to be re-parsed. 'undefined' can be returned if the - * change range cannot be determined. However, in that case, incremental parsing will - * not happen and the entire document will be re - parsed. - */ - getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange; - } - module ScriptSnapshot { - function fromString(text: string): IScriptSnapshot; - } - interface PreProcessedFileInfo { - referencedFiles: FileReference[]; - importedFiles: FileReference[]; - isLibFile: boolean; - } - interface LanguageServiceHost { - getCompilationSettings(): CompilerOptions; - getNewLine?(): string; - getScriptFileNames(): string[]; - getScriptVersion(fileName: string): string; - getScriptSnapshot(fileName: string): IScriptSnapshot; - getLocalizedDiagnosticMessages?(): any; - getCancellationToken?(): CancellationToken; - getCurrentDirectory(): string; - getDefaultLibFileName(options: CompilerOptions): string; - log?(s: string): void; - trace?(s: string): void; - error?(s: string): void; - } - interface LanguageService { - cleanupSemanticCache(): void; - getSyntacticDiagnostics(fileName: string): Diagnostic[]; - getSemanticDiagnostics(fileName: string): Diagnostic[]; - getCompilerOptionsDiagnostics(): Diagnostic[]; - getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; - getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; - getCompletionsAtPosition(fileName: string, position: number): CompletionInfo; - getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails; - getQuickInfoAtPosition(fileName: string, position: number): QuickInfo; - getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan; - getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan; - getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems; - getRenameInfo(fileName: string, position: number): RenameInfo; - findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]; - getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; - getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; - getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; - findReferences(fileName: string, position: number): ReferencedSymbol[]; - getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[]; - getNavigationBarItems(fileName: string): NavigationBarItem[]; - getOutliningSpans(fileName: string): OutliningSpan[]; - getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[]; - getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[]; - getIndentationAtPosition(fileName: string, position: number, options: EditorOptions): number; - getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions): TextChange[]; - getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): TextChange[]; - getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextChange[]; - getEmitOutput(fileName: string): EmitOutput; - getProgram(): Program; - getSourceFile(fileName: string): SourceFile; - dispose(): void; - } - interface ClassifiedSpan { - textSpan: TextSpan; - classificationType: string; - } - interface NavigationBarItem { - text: string; - kind: string; - kindModifiers: string; - spans: TextSpan[]; - childItems: NavigationBarItem[]; - indent: number; - bolded: boolean; - grayed: boolean; - } - interface TodoCommentDescriptor { - text: string; - priority: number; - } - interface TodoComment { - descriptor: TodoCommentDescriptor; - message: string; - position: number; - } - class TextChange { - span: TextSpan; - newText: string; - } - interface RenameLocation { - textSpan: TextSpan; - fileName: string; - } - interface ReferenceEntry { - textSpan: TextSpan; - fileName: string; - isWriteAccess: boolean; - } - interface NavigateToItem { - name: string; - kind: string; - kindModifiers: string; - matchKind: string; - isCaseSensitive: boolean; - fileName: string; - textSpan: TextSpan; - containerName: string; - containerKind: string; - } - interface EditorOptions { - IndentSize: number; - TabSize: number; - NewLineCharacter: string; - ConvertTabsToSpaces: boolean; - } - interface FormatCodeOptions extends EditorOptions { - InsertSpaceAfterCommaDelimiter: boolean; - InsertSpaceAfterSemicolonInForStatements: boolean; - InsertSpaceBeforeAndAfterBinaryOperators: boolean; - InsertSpaceAfterKeywordsInControlFlowStatements: boolean; - InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; - InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; - PlaceOpenBraceOnNewLineForFunctions: boolean; - PlaceOpenBraceOnNewLineForControlBlocks: boolean; - [s: string]: boolean | number | string; - } - interface DefinitionInfo { - fileName: string; - textSpan: TextSpan; - kind: string; - name: string; - containerKind: string; - containerName: string; - } - interface ReferencedSymbol { - definition: DefinitionInfo; - references: ReferenceEntry[]; - } - enum SymbolDisplayPartKind { - aliasName = 0, - className = 1, - enumName = 2, - fieldName = 3, - interfaceName = 4, - keyword = 5, - lineBreak = 6, - numericLiteral = 7, - stringLiteral = 8, - localName = 9, - methodName = 10, - moduleName = 11, - operator = 12, - parameterName = 13, - propertyName = 14, - punctuation = 15, - space = 16, - text = 17, - typeParameterName = 18, - enumMemberName = 19, - functionName = 20, - regularExpressionLiteral = 21, - } - interface SymbolDisplayPart { - text: string; - kind: string; - } - interface QuickInfo { - kind: string; - kindModifiers: string; - textSpan: TextSpan; - displayParts: SymbolDisplayPart[]; - documentation: SymbolDisplayPart[]; - } - interface RenameInfo { - canRename: boolean; - localizedErrorMessage: string; - displayName: string; - fullDisplayName: string; - kind: string; - kindModifiers: string; - triggerSpan: TextSpan; - } - interface SignatureHelpParameter { - name: string; - documentation: SymbolDisplayPart[]; - displayParts: SymbolDisplayPart[]; - isOptional: boolean; - } - /** - * Represents a single signature to show in signature help. - * The id is used for subsequent calls into the language service to ask questions about the - * signature help item in the context of any documents that have been updated. i.e. after - * an edit has happened, while signature help is still active, the host can ask important - * questions like 'what parameter is the user currently contained within?'. - */ - interface SignatureHelpItem { - isVariadic: boolean; - prefixDisplayParts: SymbolDisplayPart[]; - suffixDisplayParts: SymbolDisplayPart[]; - separatorDisplayParts: SymbolDisplayPart[]; - parameters: SignatureHelpParameter[]; - documentation: SymbolDisplayPart[]; - } - /** - * Represents a set of signature help items, and the preferred item that should be selected. - */ - interface SignatureHelpItems { - items: SignatureHelpItem[]; - applicableSpan: TextSpan; - selectedItemIndex: number; - argumentIndex: number; - argumentCount: number; - } - interface CompletionInfo { - isMemberCompletion: boolean; - isNewIdentifierLocation: boolean; - entries: CompletionEntry[]; - } - interface CompletionEntry { - name: string; - kind: string; - kindModifiers: string; - } - interface CompletionEntryDetails { - name: string; - kind: string; - kindModifiers: string; - displayParts: SymbolDisplayPart[]; - documentation: SymbolDisplayPart[]; - } - interface OutliningSpan { - /** The span of the document to actually collapse. */ - textSpan: TextSpan; - /** The span of the document to display when the user hovers over the collapsed span. */ - hintSpan: TextSpan; - /** The text to display in the editor for the collapsed region. */ - bannerText: string; - /** - * Whether or not this region should be automatically collapsed when - * the 'Collapse to Definitions' command is invoked. - */ - autoCollapse: boolean; - } - interface EmitOutput { - outputFiles: OutputFile[]; - emitSkipped: boolean; - } - const enum OutputFileType { - JavaScript = 0, - SourceMap = 1, - Declaration = 2, - } - interface OutputFile { - name: string; - writeByteOrderMark: boolean; - text: string; - } - const enum EndOfLineState { - Start = 0, - InMultiLineCommentTrivia = 1, - InSingleQuoteStringLiteral = 2, - InDoubleQuoteStringLiteral = 3, - InTemplateHeadOrNoSubstitutionTemplate = 4, - InTemplateMiddleOrTail = 5, - InTemplateSubstitutionPosition = 6, - } - enum TokenClass { - Punctuation = 0, - Keyword = 1, - Operator = 2, - Comment = 3, - Whitespace = 4, - Identifier = 5, - NumberLiteral = 6, - StringLiteral = 7, - RegExpLiteral = 8, - } - interface ClassificationResult { - finalLexState: EndOfLineState; - entries: ClassificationInfo[]; - } - interface ClassificationInfo { - length: number; - classification: TokenClass; - } - interface Classifier { - /** - * Gives lexical classifications of tokens on a line without any syntactic context. - * For instance, a token consisting of the text 'string' can be either an identifier - * named 'string' or the keyword 'string', however, because this classifier is not aware, - * it relies on certain heuristics to give acceptable results. For classifications where - * speed trumps accuracy, this function is preferable; however, for true accuracy, the - * syntactic classifier is ideal. In fact, in certain editing scenarios, combining the - * lexical, syntactic, and semantic classifiers may issue the best user experience. - * - * @param text The text of a line to classify. - * @param lexState The state of the lexical classifier at the end of the previous line. - * @param syntacticClassifierAbsent Whether the client is *not* using a syntactic classifier. - * If there is no syntactic classifier (syntacticClassifierAbsent=true), - * certain heuristics may be used in its place; however, if there is a - * syntactic classifier (syntacticClassifierAbsent=false), certain - * classifications which may be incorrectly categorized will be given - * back as Identifiers in order to allow the syntactic classifier to - * subsume the classification. - */ - getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult; - } - /** - * The document registry represents a store of SourceFile objects that can be shared between - * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) - * of files in the context. - * SourceFile objects account for most of the memory usage by the language service. Sharing - * the same DocumentRegistry instance between different instances of LanguageService allow - * for more efficient memory utilization since all projects will share at least the library - * file (lib.d.ts). - * - * A more advanced use of the document registry is to serialize sourceFile objects to disk - * and re-hydrate them when needed. - * - * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it - * to all subsequent createLanguageService calls. - */ - interface DocumentRegistry { - /** - * Request a stored SourceFile with a given fileName and compilationSettings. - * The first call to acquire will call createLanguageServiceSourceFile to generate - * the SourceFile if was not found in the registry. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @parm scriptSnapshot Text of the file. Only used if the file was not found - * in the registry and a new one was created. - * @parm version Current version of the file. Only used if the file was not found - * in the registry and a new one was created. - */ - acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; - /** - * Request an updated version of an already existing SourceFile with a given fileName - * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile - * to get an updated SourceFile. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @param scriptSnapshot Text of the file. - * @param version Current version of the file. - */ - updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; - /** - * Informs the DocumentRegistry that a file is not needed any longer. - * - * Note: It is not allowed to call release on a SourceFile that was not acquired from - * this registry originally. - * - * @param fileName The name of the file to be released - * @param compilationSettings The compilation settings used to acquire the file - */ - releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; - } - class ScriptElementKind { - static unknown: string; - static keyword: string; - static scriptElement: string; - static moduleElement: string; - static classElement: string; - static interfaceElement: string; - static typeElement: string; - static enumElement: string; - static variableElement: string; - static localVariableElement: string; - static functionElement: string; - static localFunctionElement: string; - static memberFunctionElement: string; - static memberGetAccessorElement: string; - static memberSetAccessorElement: string; - static memberVariableElement: string; - static constructorImplementationElement: string; - static callSignatureElement: string; - static indexSignatureElement: string; - static constructSignatureElement: string; - static parameterElement: string; - static typeParameterElement: string; - static primitiveType: string; - static label: string; - static alias: string; - static constElement: string; - static letElement: string; - } - class ScriptElementKindModifier { - static none: string; - static publicMemberModifier: string; - static privateMemberModifier: string; - static protectedMemberModifier: string; - static exportedModifier: string; - static ambientModifier: string; - static staticModifier: string; - } - class ClassificationTypeNames { - static comment: string; - static identifier: string; - static keyword: string; - static numericLiteral: string; - static operator: string; - static stringLiteral: string; - static whiteSpace: string; - static text: string; - static punctuation: string; - static className: string; - static enumName: string; - static interfaceName: string; - static moduleName: string; - static typeParameterName: string; - static typeAlias: string; - } - interface DisplayPartsSymbolWriter extends SymbolWriter { - displayParts(): SymbolDisplayPart[]; - } - function displayPartsToString(displayParts: SymbolDisplayPart[]): string; - function getDefaultCompilerOptions(): CompilerOptions; - class OperationCanceledException { - } - class CancellationTokenObject { - private cancellationToken; - static None: CancellationTokenObject; - constructor(cancellationToken: CancellationToken); - isCancellationRequested(): boolean; - throwIfCancellationRequested(): void; - } - function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile; - let disableIncrementalParsing: boolean; - function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; - function createDocumentRegistry(): DocumentRegistry; - function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo; - function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; - function createClassifier(): Classifier; - /** - * Get the path of the default library file (lib.d.ts) as distributed with the typescript - * node package. - * The functionality is not supported if the ts module is consumed outside of a node module. - */ - function getDefaultLibFilePath(options: CompilerOptions): string; -} - //// [APISample_compile.js] /* @@ -2012,8 +46,9 @@ function compile(fileNames, options) { var emitResult = program.emit(); var allDiagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics); allDiagnostics.forEach(function (diagnostic) { - var lineChar = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); - console.log(diagnostic.file.fileName + " (" + (lineChar.line + 1) + "," + (lineChar.character + 1) + "): " + ts.flattenDiagnosticMessageText(diagnostic.messageText, os.EOL)); + var _a = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start), line = _a.line, character = _a.character; + var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); + console.log(diagnostic.file.fileName + " (" + (line + 1) + "," + (character + 1) + "): " + message); }); var exitCode = emitResult.emitSkipped ? 1 : 0; console.log("Process exiting with code '" + exitCode + "'."); @@ -2021,8 +56,6 @@ function compile(fileNames, options) { } exports.compile = compile; compile(process.argv.slice(2), { - noEmitOnError: true, - noImplicitAny: true, - target: 1 /* ES5 */, - module: 1 /* CommonJS */ + noEmitOnError: true, noImplicitAny: true, + target: 1 /* ES5 */, module: 1 /* CommonJS */ }); diff --git a/tests/baselines/reference/APISample_compile.types b/tests/baselines/reference/APISample_compile.types index eff47a4cb7b..7ccbae38212 100644 --- a/tests/baselines/reference/APISample_compile.types +++ b/tests/baselines/reference/APISample_compile.types @@ -56,15 +56,16 @@ export function compile(fileNames: string[], options: ts.CompilerOptions): void >diagnostics : ts.Diagnostic[] allDiagnostics.forEach(diagnostic => { ->allDiagnostics.forEach(diagnostic => { var lineChar = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); console.log(`${diagnostic.file.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, os.EOL)}`); }) : void +>allDiagnostics.forEach(diagnostic => { var { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); }) : void >allDiagnostics.forEach : (callbackfn: (value: ts.Diagnostic, index: number, array: ts.Diagnostic[]) => void, thisArg?: any) => void >allDiagnostics : ts.Diagnostic[] >forEach : (callbackfn: (value: ts.Diagnostic, index: number, array: ts.Diagnostic[]) => void, thisArg?: any) => void ->diagnostic => { var lineChar = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); console.log(`${diagnostic.file.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, os.EOL)}`); } : (diagnostic: ts.Diagnostic) => void +>diagnostic => { var { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); } : (diagnostic: ts.Diagnostic) => void >diagnostic : ts.Diagnostic - var lineChar = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); ->lineChar : ts.LineAndCharacter + var { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); +>line : number +>character : number >diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start) : ts.LineAndCharacter >diagnostic.file.getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter >diagnostic.file : ts.SourceFile @@ -75,8 +76,18 @@ export function compile(fileNames: string[], options: ts.CompilerOptions): void >diagnostic : ts.Diagnostic >start : number - console.log(`${diagnostic.file.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, os.EOL)}`); ->console.log(`${diagnostic.file.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, os.EOL)}`) : any + var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); +>message : string +>ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n') : string +>ts.flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string +>ts : typeof ts +>flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string +>diagnostic.messageText : string | ts.DiagnosticMessageChain +>diagnostic : ts.Diagnostic +>messageText : string | ts.DiagnosticMessageChain + + console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); +>console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`) : any >console.log : any >console : any >log : any @@ -85,24 +96,11 @@ export function compile(fileNames: string[], options: ts.CompilerOptions): void >diagnostic : ts.Diagnostic >file : ts.SourceFile >fileName : string ->lineChar.line + 1 : number ->lineChar.line : number ->lineChar : ts.LineAndCharacter +>line + 1 : number >line : number ->lineChar.character + 1 : number ->lineChar.character : number ->lineChar : ts.LineAndCharacter +>character + 1 : number >character : number ->ts.flattenDiagnosticMessageText(diagnostic.messageText, os.EOL) : string ->ts.flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string ->ts : typeof ts ->flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string ->diagnostic.messageText : string | ts.DiagnosticMessageChain ->diagnostic : ts.Diagnostic ->messageText : string | ts.DiagnosticMessageChain ->os.EOL : any ->os : any ->EOL : any +>message : string }); @@ -158,6064 +156,3 @@ compile(process.argv.slice(2), { >CommonJS : ts.ModuleKind }); -=== typescript.d.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 http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -declare module "typescript" { - interface Map { ->Map : Map ->T : T - - [index: string]: T; ->index : string ->T : T - } - interface TextRange { ->TextRange : TextRange - - pos: number; ->pos : number - - end: number; ->end : number - } - const enum SyntaxKind { ->SyntaxKind : SyntaxKind - - Unknown = 0, ->Unknown : SyntaxKind - - EndOfFileToken = 1, ->EndOfFileToken : SyntaxKind - - SingleLineCommentTrivia = 2, ->SingleLineCommentTrivia : SyntaxKind - - MultiLineCommentTrivia = 3, ->MultiLineCommentTrivia : SyntaxKind - - NewLineTrivia = 4, ->NewLineTrivia : SyntaxKind - - WhitespaceTrivia = 5, ->WhitespaceTrivia : SyntaxKind - - ConflictMarkerTrivia = 6, ->ConflictMarkerTrivia : SyntaxKind - - NumericLiteral = 7, ->NumericLiteral : SyntaxKind - - StringLiteral = 8, ->StringLiteral : SyntaxKind - - RegularExpressionLiteral = 9, ->RegularExpressionLiteral : SyntaxKind - - NoSubstitutionTemplateLiteral = 10, ->NoSubstitutionTemplateLiteral : SyntaxKind - - TemplateHead = 11, ->TemplateHead : SyntaxKind - - TemplateMiddle = 12, ->TemplateMiddle : SyntaxKind - - TemplateTail = 13, ->TemplateTail : SyntaxKind - - OpenBraceToken = 14, ->OpenBraceToken : SyntaxKind - - CloseBraceToken = 15, ->CloseBraceToken : SyntaxKind - - OpenParenToken = 16, ->OpenParenToken : SyntaxKind - - CloseParenToken = 17, ->CloseParenToken : SyntaxKind - - OpenBracketToken = 18, ->OpenBracketToken : SyntaxKind - - CloseBracketToken = 19, ->CloseBracketToken : SyntaxKind - - DotToken = 20, ->DotToken : SyntaxKind - - DotDotDotToken = 21, ->DotDotDotToken : SyntaxKind - - SemicolonToken = 22, ->SemicolonToken : SyntaxKind - - CommaToken = 23, ->CommaToken : SyntaxKind - - LessThanToken = 24, ->LessThanToken : SyntaxKind - - GreaterThanToken = 25, ->GreaterThanToken : SyntaxKind - - LessThanEqualsToken = 26, ->LessThanEqualsToken : SyntaxKind - - GreaterThanEqualsToken = 27, ->GreaterThanEqualsToken : SyntaxKind - - EqualsEqualsToken = 28, ->EqualsEqualsToken : SyntaxKind - - ExclamationEqualsToken = 29, ->ExclamationEqualsToken : SyntaxKind - - EqualsEqualsEqualsToken = 30, ->EqualsEqualsEqualsToken : SyntaxKind - - ExclamationEqualsEqualsToken = 31, ->ExclamationEqualsEqualsToken : SyntaxKind - - EqualsGreaterThanToken = 32, ->EqualsGreaterThanToken : SyntaxKind - - PlusToken = 33, ->PlusToken : SyntaxKind - - MinusToken = 34, ->MinusToken : SyntaxKind - - AsteriskToken = 35, ->AsteriskToken : SyntaxKind - - SlashToken = 36, ->SlashToken : SyntaxKind - - PercentToken = 37, ->PercentToken : SyntaxKind - - PlusPlusToken = 38, ->PlusPlusToken : SyntaxKind - - MinusMinusToken = 39, ->MinusMinusToken : SyntaxKind - - LessThanLessThanToken = 40, ->LessThanLessThanToken : SyntaxKind - - GreaterThanGreaterThanToken = 41, ->GreaterThanGreaterThanToken : SyntaxKind - - GreaterThanGreaterThanGreaterThanToken = 42, ->GreaterThanGreaterThanGreaterThanToken : SyntaxKind - - AmpersandToken = 43, ->AmpersandToken : SyntaxKind - - BarToken = 44, ->BarToken : SyntaxKind - - CaretToken = 45, ->CaretToken : SyntaxKind - - ExclamationToken = 46, ->ExclamationToken : SyntaxKind - - TildeToken = 47, ->TildeToken : SyntaxKind - - AmpersandAmpersandToken = 48, ->AmpersandAmpersandToken : SyntaxKind - - BarBarToken = 49, ->BarBarToken : SyntaxKind - - QuestionToken = 50, ->QuestionToken : SyntaxKind - - ColonToken = 51, ->ColonToken : SyntaxKind - - AtToken = 52, ->AtToken : SyntaxKind - - EqualsToken = 53, ->EqualsToken : SyntaxKind - - PlusEqualsToken = 54, ->PlusEqualsToken : SyntaxKind - - MinusEqualsToken = 55, ->MinusEqualsToken : SyntaxKind - - AsteriskEqualsToken = 56, ->AsteriskEqualsToken : SyntaxKind - - SlashEqualsToken = 57, ->SlashEqualsToken : SyntaxKind - - PercentEqualsToken = 58, ->PercentEqualsToken : SyntaxKind - - LessThanLessThanEqualsToken = 59, ->LessThanLessThanEqualsToken : SyntaxKind - - GreaterThanGreaterThanEqualsToken = 60, ->GreaterThanGreaterThanEqualsToken : SyntaxKind - - GreaterThanGreaterThanGreaterThanEqualsToken = 61, ->GreaterThanGreaterThanGreaterThanEqualsToken : SyntaxKind - - AmpersandEqualsToken = 62, ->AmpersandEqualsToken : SyntaxKind - - BarEqualsToken = 63, ->BarEqualsToken : SyntaxKind - - CaretEqualsToken = 64, ->CaretEqualsToken : SyntaxKind - - Identifier = 65, ->Identifier : SyntaxKind - - BreakKeyword = 66, ->BreakKeyword : SyntaxKind - - CaseKeyword = 67, ->CaseKeyword : SyntaxKind - - CatchKeyword = 68, ->CatchKeyword : SyntaxKind - - ClassKeyword = 69, ->ClassKeyword : SyntaxKind - - ConstKeyword = 70, ->ConstKeyword : SyntaxKind - - ContinueKeyword = 71, ->ContinueKeyword : SyntaxKind - - DebuggerKeyword = 72, ->DebuggerKeyword : SyntaxKind - - DefaultKeyword = 73, ->DefaultKeyword : SyntaxKind - - DeleteKeyword = 74, ->DeleteKeyword : SyntaxKind - - DoKeyword = 75, ->DoKeyword : SyntaxKind - - ElseKeyword = 76, ->ElseKeyword : SyntaxKind - - EnumKeyword = 77, ->EnumKeyword : SyntaxKind - - ExportKeyword = 78, ->ExportKeyword : SyntaxKind - - ExtendsKeyword = 79, ->ExtendsKeyword : SyntaxKind - - FalseKeyword = 80, ->FalseKeyword : SyntaxKind - - FinallyKeyword = 81, ->FinallyKeyword : SyntaxKind - - ForKeyword = 82, ->ForKeyword : SyntaxKind - - FunctionKeyword = 83, ->FunctionKeyword : SyntaxKind - - IfKeyword = 84, ->IfKeyword : SyntaxKind - - ImportKeyword = 85, ->ImportKeyword : SyntaxKind - - InKeyword = 86, ->InKeyword : SyntaxKind - - InstanceOfKeyword = 87, ->InstanceOfKeyword : SyntaxKind - - NewKeyword = 88, ->NewKeyword : SyntaxKind - - NullKeyword = 89, ->NullKeyword : SyntaxKind - - ReturnKeyword = 90, ->ReturnKeyword : SyntaxKind - - SuperKeyword = 91, ->SuperKeyword : SyntaxKind - - SwitchKeyword = 92, ->SwitchKeyword : SyntaxKind - - ThisKeyword = 93, ->ThisKeyword : SyntaxKind - - ThrowKeyword = 94, ->ThrowKeyword : SyntaxKind - - TrueKeyword = 95, ->TrueKeyword : SyntaxKind - - TryKeyword = 96, ->TryKeyword : SyntaxKind - - TypeOfKeyword = 97, ->TypeOfKeyword : SyntaxKind - - VarKeyword = 98, ->VarKeyword : SyntaxKind - - VoidKeyword = 99, ->VoidKeyword : SyntaxKind - - WhileKeyword = 100, ->WhileKeyword : SyntaxKind - - WithKeyword = 101, ->WithKeyword : SyntaxKind - - AsKeyword = 102, ->AsKeyword : SyntaxKind - - ImplementsKeyword = 103, ->ImplementsKeyword : SyntaxKind - - InterfaceKeyword = 104, ->InterfaceKeyword : SyntaxKind - - LetKeyword = 105, ->LetKeyword : SyntaxKind - - PackageKeyword = 106, ->PackageKeyword : SyntaxKind - - PrivateKeyword = 107, ->PrivateKeyword : SyntaxKind - - ProtectedKeyword = 108, ->ProtectedKeyword : SyntaxKind - - PublicKeyword = 109, ->PublicKeyword : SyntaxKind - - StaticKeyword = 110, ->StaticKeyword : SyntaxKind - - YieldKeyword = 111, ->YieldKeyword : SyntaxKind - - AnyKeyword = 112, ->AnyKeyword : SyntaxKind - - BooleanKeyword = 113, ->BooleanKeyword : SyntaxKind - - ConstructorKeyword = 114, ->ConstructorKeyword : SyntaxKind - - DeclareKeyword = 115, ->DeclareKeyword : SyntaxKind - - GetKeyword = 116, ->GetKeyword : SyntaxKind - - ModuleKeyword = 117, ->ModuleKeyword : SyntaxKind - - RequireKeyword = 118, ->RequireKeyword : SyntaxKind - - NumberKeyword = 119, ->NumberKeyword : SyntaxKind - - SetKeyword = 120, ->SetKeyword : SyntaxKind - - StringKeyword = 121, ->StringKeyword : SyntaxKind - - SymbolKeyword = 122, ->SymbolKeyword : SyntaxKind - - TypeKeyword = 123, ->TypeKeyword : SyntaxKind - - FromKeyword = 124, ->FromKeyword : SyntaxKind - - OfKeyword = 125, ->OfKeyword : SyntaxKind - - QualifiedName = 126, ->QualifiedName : SyntaxKind - - ComputedPropertyName = 127, ->ComputedPropertyName : SyntaxKind - - TypeParameter = 128, ->TypeParameter : SyntaxKind - - Parameter = 129, ->Parameter : SyntaxKind - - Decorator = 130, ->Decorator : SyntaxKind - - PropertySignature = 131, ->PropertySignature : SyntaxKind - - PropertyDeclaration = 132, ->PropertyDeclaration : SyntaxKind - - MethodSignature = 133, ->MethodSignature : SyntaxKind - - MethodDeclaration = 134, ->MethodDeclaration : SyntaxKind - - Constructor = 135, ->Constructor : SyntaxKind - - GetAccessor = 136, ->GetAccessor : SyntaxKind - - SetAccessor = 137, ->SetAccessor : SyntaxKind - - CallSignature = 138, ->CallSignature : SyntaxKind - - ConstructSignature = 139, ->ConstructSignature : SyntaxKind - - IndexSignature = 140, ->IndexSignature : SyntaxKind - - TypeReference = 141, ->TypeReference : SyntaxKind - - FunctionType = 142, ->FunctionType : SyntaxKind - - ConstructorType = 143, ->ConstructorType : SyntaxKind - - TypeQuery = 144, ->TypeQuery : SyntaxKind - - TypeLiteral = 145, ->TypeLiteral : SyntaxKind - - ArrayType = 146, ->ArrayType : SyntaxKind - - TupleType = 147, ->TupleType : SyntaxKind - - UnionType = 148, ->UnionType : SyntaxKind - - ParenthesizedType = 149, ->ParenthesizedType : SyntaxKind - - ObjectBindingPattern = 150, ->ObjectBindingPattern : SyntaxKind - - ArrayBindingPattern = 151, ->ArrayBindingPattern : SyntaxKind - - BindingElement = 152, ->BindingElement : SyntaxKind - - ArrayLiteralExpression = 153, ->ArrayLiteralExpression : SyntaxKind - - ObjectLiteralExpression = 154, ->ObjectLiteralExpression : SyntaxKind - - PropertyAccessExpression = 155, ->PropertyAccessExpression : SyntaxKind - - ElementAccessExpression = 156, ->ElementAccessExpression : SyntaxKind - - CallExpression = 157, ->CallExpression : SyntaxKind - - NewExpression = 158, ->NewExpression : SyntaxKind - - TaggedTemplateExpression = 159, ->TaggedTemplateExpression : SyntaxKind - - TypeAssertionExpression = 160, ->TypeAssertionExpression : SyntaxKind - - ParenthesizedExpression = 161, ->ParenthesizedExpression : SyntaxKind - - FunctionExpression = 162, ->FunctionExpression : SyntaxKind - - ArrowFunction = 163, ->ArrowFunction : SyntaxKind - - DeleteExpression = 164, ->DeleteExpression : SyntaxKind - - TypeOfExpression = 165, ->TypeOfExpression : SyntaxKind - - VoidExpression = 166, ->VoidExpression : SyntaxKind - - PrefixUnaryExpression = 167, ->PrefixUnaryExpression : SyntaxKind - - PostfixUnaryExpression = 168, ->PostfixUnaryExpression : SyntaxKind - - BinaryExpression = 169, ->BinaryExpression : SyntaxKind - - ConditionalExpression = 170, ->ConditionalExpression : SyntaxKind - - TemplateExpression = 171, ->TemplateExpression : SyntaxKind - - YieldExpression = 172, ->YieldExpression : SyntaxKind - - SpreadElementExpression = 173, ->SpreadElementExpression : SyntaxKind - - OmittedExpression = 174, ->OmittedExpression : SyntaxKind - - TemplateSpan = 175, ->TemplateSpan : SyntaxKind - - Block = 176, ->Block : SyntaxKind - - VariableStatement = 177, ->VariableStatement : SyntaxKind - - EmptyStatement = 178, ->EmptyStatement : SyntaxKind - - ExpressionStatement = 179, ->ExpressionStatement : SyntaxKind - - IfStatement = 180, ->IfStatement : SyntaxKind - - DoStatement = 181, ->DoStatement : SyntaxKind - - WhileStatement = 182, ->WhileStatement : SyntaxKind - - ForStatement = 183, ->ForStatement : SyntaxKind - - ForInStatement = 184, ->ForInStatement : SyntaxKind - - ForOfStatement = 185, ->ForOfStatement : SyntaxKind - - ContinueStatement = 186, ->ContinueStatement : SyntaxKind - - BreakStatement = 187, ->BreakStatement : SyntaxKind - - ReturnStatement = 188, ->ReturnStatement : SyntaxKind - - WithStatement = 189, ->WithStatement : SyntaxKind - - SwitchStatement = 190, ->SwitchStatement : SyntaxKind - - LabeledStatement = 191, ->LabeledStatement : SyntaxKind - - ThrowStatement = 192, ->ThrowStatement : SyntaxKind - - TryStatement = 193, ->TryStatement : SyntaxKind - - DebuggerStatement = 194, ->DebuggerStatement : SyntaxKind - - VariableDeclaration = 195, ->VariableDeclaration : SyntaxKind - - VariableDeclarationList = 196, ->VariableDeclarationList : SyntaxKind - - FunctionDeclaration = 197, ->FunctionDeclaration : SyntaxKind - - ClassDeclaration = 198, ->ClassDeclaration : SyntaxKind - - InterfaceDeclaration = 199, ->InterfaceDeclaration : SyntaxKind - - TypeAliasDeclaration = 200, ->TypeAliasDeclaration : SyntaxKind - - EnumDeclaration = 201, ->EnumDeclaration : SyntaxKind - - ModuleDeclaration = 202, ->ModuleDeclaration : SyntaxKind - - ModuleBlock = 203, ->ModuleBlock : SyntaxKind - - CaseBlock = 204, ->CaseBlock : SyntaxKind - - ImportEqualsDeclaration = 205, ->ImportEqualsDeclaration : SyntaxKind - - ImportDeclaration = 206, ->ImportDeclaration : SyntaxKind - - ImportClause = 207, ->ImportClause : SyntaxKind - - NamespaceImport = 208, ->NamespaceImport : SyntaxKind - - NamedImports = 209, ->NamedImports : SyntaxKind - - ImportSpecifier = 210, ->ImportSpecifier : SyntaxKind - - ExportAssignment = 211, ->ExportAssignment : SyntaxKind - - ExportDeclaration = 212, ->ExportDeclaration : SyntaxKind - - NamedExports = 213, ->NamedExports : SyntaxKind - - ExportSpecifier = 214, ->ExportSpecifier : SyntaxKind - - MissingDeclaration = 215, ->MissingDeclaration : SyntaxKind - - ExternalModuleReference = 216, ->ExternalModuleReference : SyntaxKind - - CaseClause = 217, ->CaseClause : SyntaxKind - - DefaultClause = 218, ->DefaultClause : SyntaxKind - - HeritageClause = 219, ->HeritageClause : SyntaxKind - - CatchClause = 220, ->CatchClause : SyntaxKind - - PropertyAssignment = 221, ->PropertyAssignment : SyntaxKind - - ShorthandPropertyAssignment = 222, ->ShorthandPropertyAssignment : SyntaxKind - - EnumMember = 223, ->EnumMember : SyntaxKind - - SourceFile = 224, ->SourceFile : SyntaxKind - - SyntaxList = 225, ->SyntaxList : SyntaxKind - - Count = 226, ->Count : SyntaxKind - - FirstAssignment = 53, ->FirstAssignment : SyntaxKind - - LastAssignment = 64, ->LastAssignment : SyntaxKind - - FirstReservedWord = 66, ->FirstReservedWord : SyntaxKind - - LastReservedWord = 101, ->LastReservedWord : SyntaxKind - - FirstKeyword = 66, ->FirstKeyword : SyntaxKind - - LastKeyword = 125, ->LastKeyword : SyntaxKind - - FirstFutureReservedWord = 103, ->FirstFutureReservedWord : SyntaxKind - - LastFutureReservedWord = 111, ->LastFutureReservedWord : SyntaxKind - - FirstTypeNode = 141, ->FirstTypeNode : SyntaxKind - - LastTypeNode = 149, ->LastTypeNode : SyntaxKind - - FirstPunctuation = 14, ->FirstPunctuation : SyntaxKind - - LastPunctuation = 64, ->LastPunctuation : SyntaxKind - - FirstToken = 0, ->FirstToken : SyntaxKind - - LastToken = 125, ->LastToken : SyntaxKind - - FirstTriviaToken = 2, ->FirstTriviaToken : SyntaxKind - - LastTriviaToken = 6, ->LastTriviaToken : SyntaxKind - - FirstLiteralToken = 7, ->FirstLiteralToken : SyntaxKind - - LastLiteralToken = 10, ->LastLiteralToken : SyntaxKind - - FirstTemplateToken = 10, ->FirstTemplateToken : SyntaxKind - - LastTemplateToken = 13, ->LastTemplateToken : SyntaxKind - - FirstBinaryOperator = 24, ->FirstBinaryOperator : SyntaxKind - - LastBinaryOperator = 64, ->LastBinaryOperator : SyntaxKind - - FirstNode = 126, ->FirstNode : SyntaxKind - } - const enum NodeFlags { ->NodeFlags : NodeFlags - - Export = 1, ->Export : NodeFlags - - Ambient = 2, ->Ambient : NodeFlags - - Public = 16, ->Public : NodeFlags - - Private = 32, ->Private : NodeFlags - - Protected = 64, ->Protected : NodeFlags - - Static = 128, ->Static : NodeFlags - - Default = 256, ->Default : NodeFlags - - MultiLine = 512, ->MultiLine : NodeFlags - - Synthetic = 1024, ->Synthetic : NodeFlags - - DeclarationFile = 2048, ->DeclarationFile : NodeFlags - - Let = 4096, ->Let : NodeFlags - - Const = 8192, ->Const : NodeFlags - - OctalLiteral = 16384, ->OctalLiteral : NodeFlags - - ExportContext = 32768, ->ExportContext : NodeFlags - - Modifier = 499, ->Modifier : NodeFlags - - AccessibilityModifier = 112, ->AccessibilityModifier : NodeFlags - - BlockScoped = 12288, ->BlockScoped : NodeFlags - } - const enum ParserContextFlags { ->ParserContextFlags : ParserContextFlags - - StrictMode = 1, ->StrictMode : ParserContextFlags - - DisallowIn = 2, ->DisallowIn : ParserContextFlags - - Yield = 4, ->Yield : ParserContextFlags - - GeneratorParameter = 8, ->GeneratorParameter : ParserContextFlags - - Decorator = 16, ->Decorator : ParserContextFlags - - ThisNodeHasError = 32, ->ThisNodeHasError : ParserContextFlags - - ParserGeneratedFlags = 63, ->ParserGeneratedFlags : ParserContextFlags - - ThisNodeOrAnySubNodesHasError = 64, ->ThisNodeOrAnySubNodesHasError : ParserContextFlags - - HasAggregatedChildData = 128, ->HasAggregatedChildData : ParserContextFlags - } - const enum RelationComparisonResult { ->RelationComparisonResult : RelationComparisonResult - - Succeeded = 1, ->Succeeded : RelationComparisonResult - - Failed = 2, ->Failed : RelationComparisonResult - - FailedAndReported = 3, ->FailedAndReported : RelationComparisonResult - } - interface Node extends TextRange { ->Node : Node ->TextRange : TextRange - - kind: SyntaxKind; ->kind : SyntaxKind ->SyntaxKind : SyntaxKind - - flags: NodeFlags; ->flags : NodeFlags ->NodeFlags : NodeFlags - - parserContextFlags?: ParserContextFlags; ->parserContextFlags : ParserContextFlags ->ParserContextFlags : ParserContextFlags - - decorators?: NodeArray; ->decorators : NodeArray ->NodeArray : NodeArray ->Decorator : Decorator - - modifiers?: ModifiersArray; ->modifiers : ModifiersArray ->ModifiersArray : ModifiersArray - - id?: number; ->id : number - - parent?: Node; ->parent : Node ->Node : Node - - symbol?: Symbol; ->symbol : Symbol ->Symbol : Symbol - - locals?: SymbolTable; ->locals : SymbolTable ->SymbolTable : SymbolTable - - nextContainer?: Node; ->nextContainer : Node ->Node : Node - - localSymbol?: Symbol; ->localSymbol : Symbol ->Symbol : Symbol - } - interface NodeArray extends Array, TextRange { ->NodeArray : NodeArray ->T : T ->Array : T[] ->T : T ->TextRange : TextRange - - hasTrailingComma?: boolean; ->hasTrailingComma : boolean - } - interface ModifiersArray extends NodeArray { ->ModifiersArray : ModifiersArray ->NodeArray : NodeArray ->Node : Node - - flags: number; ->flags : number - } - interface Identifier extends PrimaryExpression { ->Identifier : Identifier ->PrimaryExpression : PrimaryExpression - - text: string; ->text : string - } - interface QualifiedName extends Node { ->QualifiedName : QualifiedName ->Node : Node - - left: EntityName; ->left : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName - - right: Identifier; ->right : Identifier ->Identifier : Identifier - } - type EntityName = Identifier | QualifiedName; ->EntityName : Identifier | QualifiedName ->Identifier : Identifier ->QualifiedName : QualifiedName - - type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName | BindingPattern; ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->Identifier : Identifier ->LiteralExpression : LiteralExpression ->ComputedPropertyName : ComputedPropertyName ->BindingPattern : BindingPattern - - interface Declaration extends Node { ->Declaration : Declaration ->Node : Node - - _declarationBrand: any; ->_declarationBrand : any - - name?: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - } - interface ComputedPropertyName extends Node { ->ComputedPropertyName : ComputedPropertyName ->Node : Node - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface Decorator extends Node { ->Decorator : Decorator ->Node : Node - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - } - interface TypeParameterDeclaration extends Declaration { ->TypeParameterDeclaration : TypeParameterDeclaration ->Declaration : Declaration - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - constraint?: TypeNode; ->constraint : TypeNode ->TypeNode : TypeNode - - expression?: Expression; ->expression : Expression ->Expression : Expression - } - interface SignatureDeclaration extends Declaration { ->SignatureDeclaration : SignatureDeclaration ->Declaration : Declaration - - typeParameters?: NodeArray; ->typeParameters : NodeArray ->NodeArray : NodeArray ->TypeParameterDeclaration : TypeParameterDeclaration - - parameters: NodeArray; ->parameters : NodeArray ->NodeArray : NodeArray ->ParameterDeclaration : ParameterDeclaration - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface VariableDeclaration extends Declaration { ->VariableDeclaration : VariableDeclaration ->Declaration : Declaration - - parent?: VariableDeclarationList; ->parent : VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList - - name: Identifier | BindingPattern; ->name : Identifier | BindingPattern ->Identifier : Identifier ->BindingPattern : BindingPattern - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface VariableDeclarationList extends Node { ->VariableDeclarationList : VariableDeclarationList ->Node : Node - - declarations: NodeArray; ->declarations : NodeArray ->NodeArray : NodeArray ->VariableDeclaration : VariableDeclaration - } - interface ParameterDeclaration extends Declaration { ->ParameterDeclaration : ParameterDeclaration ->Declaration : Declaration - - dotDotDotToken?: Node; ->dotDotDotToken : Node ->Node : Node - - name: Identifier | BindingPattern; ->name : Identifier | BindingPattern ->Identifier : Identifier ->BindingPattern : BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface BindingElement extends Declaration { ->BindingElement : BindingElement ->Declaration : Declaration - - propertyName?: Identifier; ->propertyName : Identifier ->Identifier : Identifier - - dotDotDotToken?: Node; ->dotDotDotToken : Node ->Node : Node - - name: Identifier | BindingPattern; ->name : Identifier | BindingPattern ->Identifier : Identifier ->BindingPattern : BindingPattern - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface PropertyDeclaration extends Declaration, ClassElement { ->PropertyDeclaration : PropertyDeclaration ->Declaration : Declaration ->ClassElement : ClassElement - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface ObjectLiteralElement extends Declaration { ->ObjectLiteralElement : ObjectLiteralElement ->Declaration : Declaration - - _objectLiteralBrandBrand: any; ->_objectLiteralBrandBrand : any - } - interface PropertyAssignment extends ObjectLiteralElement { ->PropertyAssignment : PropertyAssignment ->ObjectLiteralElement : ObjectLiteralElement - - _propertyAssignmentBrand: any; ->_propertyAssignmentBrand : any - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - initializer: Expression; ->initializer : Expression ->Expression : Expression - } - interface ShorthandPropertyAssignment extends ObjectLiteralElement { ->ShorthandPropertyAssignment : ShorthandPropertyAssignment ->ObjectLiteralElement : ObjectLiteralElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - questionToken?: Node; ->questionToken : Node ->Node : Node - } - interface VariableLikeDeclaration extends Declaration { ->VariableLikeDeclaration : VariableLikeDeclaration ->Declaration : Declaration - - propertyName?: Identifier; ->propertyName : Identifier ->Identifier : Identifier - - dotDotDotToken?: Node; ->dotDotDotToken : Node ->Node : Node - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface BindingPattern extends Node { ->BindingPattern : BindingPattern ->Node : Node - - elements: NodeArray; ->elements : NodeArray ->NodeArray : NodeArray ->BindingElement : BindingElement - } - /** - * Several node kinds share function-like features such as a signature, - * a name, and a body. These nodes should extend FunctionLikeDeclaration. - * Examples: - * FunctionDeclaration - * MethodDeclaration - * AccessorDeclaration - */ - interface FunctionLikeDeclaration extends SignatureDeclaration { ->FunctionLikeDeclaration : FunctionLikeDeclaration ->SignatureDeclaration : SignatureDeclaration - - _functionLikeDeclarationBrand: any; ->_functionLikeDeclarationBrand : any - - asteriskToken?: Node; ->asteriskToken : Node ->Node : Node - - questionToken?: Node; ->questionToken : Node ->Node : Node - - body?: Block | Expression; ->body : Expression | Block ->Block : Block ->Expression : Expression - } - interface FunctionDeclaration extends FunctionLikeDeclaration, Statement { ->FunctionDeclaration : FunctionDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->Statement : Statement - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - body?: Block; ->body : Block ->Block : Block - } - interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { ->MethodDeclaration : MethodDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->ClassElement : ClassElement ->ObjectLiteralElement : ObjectLiteralElement - - body?: Block; ->body : Block ->Block : Block - } - interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { ->ConstructorDeclaration : ConstructorDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->ClassElement : ClassElement - - body?: Block; ->body : Block ->Block : Block - } - interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { ->AccessorDeclaration : AccessorDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->ClassElement : ClassElement ->ObjectLiteralElement : ObjectLiteralElement - - _accessorDeclarationBrand: any; ->_accessorDeclarationBrand : any - - body: Block; ->body : Block ->Block : Block - } - interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement { ->IndexSignatureDeclaration : IndexSignatureDeclaration ->SignatureDeclaration : SignatureDeclaration ->ClassElement : ClassElement - - _indexSignatureDeclarationBrand: any; ->_indexSignatureDeclarationBrand : any - } - interface TypeNode extends Node { ->TypeNode : TypeNode ->Node : Node - - _typeNodeBrand: any; ->_typeNodeBrand : any - } - interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration { ->FunctionOrConstructorTypeNode : FunctionOrConstructorTypeNode ->TypeNode : TypeNode ->SignatureDeclaration : SignatureDeclaration - - _functionOrConstructorTypeNodeBrand: any; ->_functionOrConstructorTypeNodeBrand : any - } - interface TypeReferenceNode extends TypeNode { ->TypeReferenceNode : TypeReferenceNode ->TypeNode : TypeNode - - typeName: EntityName; ->typeName : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName - - typeArguments?: NodeArray; ->typeArguments : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface TypeQueryNode extends TypeNode { ->TypeQueryNode : TypeQueryNode ->TypeNode : TypeNode - - exprName: EntityName; ->exprName : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName - } - interface TypeLiteralNode extends TypeNode, Declaration { ->TypeLiteralNode : TypeLiteralNode ->TypeNode : TypeNode ->Declaration : Declaration - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->Node : Node - } - interface ArrayTypeNode extends TypeNode { ->ArrayTypeNode : ArrayTypeNode ->TypeNode : TypeNode - - elementType: TypeNode; ->elementType : TypeNode ->TypeNode : TypeNode - } - interface TupleTypeNode extends TypeNode { ->TupleTypeNode : TupleTypeNode ->TypeNode : TypeNode - - elementTypes: NodeArray; ->elementTypes : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface UnionTypeNode extends TypeNode { ->UnionTypeNode : UnionTypeNode ->TypeNode : TypeNode - - types: NodeArray; ->types : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface ParenthesizedTypeNode extends TypeNode { ->ParenthesizedTypeNode : ParenthesizedTypeNode ->TypeNode : TypeNode - - type: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface StringLiteralTypeNode extends LiteralExpression, TypeNode { ->StringLiteralTypeNode : StringLiteralTypeNode ->LiteralExpression : LiteralExpression ->TypeNode : TypeNode - } - interface Expression extends Node { ->Expression : Expression ->Node : Node - - _expressionBrand: any; ->_expressionBrand : any - - contextualType?: Type; ->contextualType : Type ->Type : Type - } - interface UnaryExpression extends Expression { ->UnaryExpression : UnaryExpression ->Expression : Expression - - _unaryExpressionBrand: any; ->_unaryExpressionBrand : any - } - interface PrefixUnaryExpression extends UnaryExpression { ->PrefixUnaryExpression : PrefixUnaryExpression ->UnaryExpression : UnaryExpression - - operator: SyntaxKind; ->operator : SyntaxKind ->SyntaxKind : SyntaxKind - - operand: UnaryExpression; ->operand : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface PostfixUnaryExpression extends PostfixExpression { ->PostfixUnaryExpression : PostfixUnaryExpression ->PostfixExpression : PostfixExpression - - operand: LeftHandSideExpression; ->operand : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - operator: SyntaxKind; ->operator : SyntaxKind ->SyntaxKind : SyntaxKind - } - interface PostfixExpression extends UnaryExpression { ->PostfixExpression : PostfixExpression ->UnaryExpression : UnaryExpression - - _postfixExpressionBrand: any; ->_postfixExpressionBrand : any - } - interface LeftHandSideExpression extends PostfixExpression { ->LeftHandSideExpression : LeftHandSideExpression ->PostfixExpression : PostfixExpression - - _leftHandSideExpressionBrand: any; ->_leftHandSideExpressionBrand : any - } - interface MemberExpression extends LeftHandSideExpression { ->MemberExpression : MemberExpression ->LeftHandSideExpression : LeftHandSideExpression - - _memberExpressionBrand: any; ->_memberExpressionBrand : any - } - interface PrimaryExpression extends MemberExpression { ->PrimaryExpression : PrimaryExpression ->MemberExpression : MemberExpression - - _primaryExpressionBrand: any; ->_primaryExpressionBrand : any - } - interface DeleteExpression extends UnaryExpression { ->DeleteExpression : DeleteExpression ->UnaryExpression : UnaryExpression - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface TypeOfExpression extends UnaryExpression { ->TypeOfExpression : TypeOfExpression ->UnaryExpression : UnaryExpression - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface VoidExpression extends UnaryExpression { ->VoidExpression : VoidExpression ->UnaryExpression : UnaryExpression - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface YieldExpression extends Expression { ->YieldExpression : YieldExpression ->Expression : Expression - - asteriskToken?: Node; ->asteriskToken : Node ->Node : Node - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface BinaryExpression extends Expression { ->BinaryExpression : BinaryExpression ->Expression : Expression - - left: Expression; ->left : Expression ->Expression : Expression - - operatorToken: Node; ->operatorToken : Node ->Node : Node - - right: Expression; ->right : Expression ->Expression : Expression - } - interface ConditionalExpression extends Expression { ->ConditionalExpression : ConditionalExpression ->Expression : Expression - - condition: Expression; ->condition : Expression ->Expression : Expression - - questionToken: Node; ->questionToken : Node ->Node : Node - - whenTrue: Expression; ->whenTrue : Expression ->Expression : Expression - - colonToken: Node; ->colonToken : Node ->Node : Node - - whenFalse: Expression; ->whenFalse : Expression ->Expression : Expression - } - interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration { ->FunctionExpression : FunctionExpression ->PrimaryExpression : PrimaryExpression ->FunctionLikeDeclaration : FunctionLikeDeclaration - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - body: Block | Expression; ->body : Expression | Block ->Block : Block ->Expression : Expression - } - interface ArrowFunction extends Expression, FunctionLikeDeclaration { ->ArrowFunction : ArrowFunction ->Expression : Expression ->FunctionLikeDeclaration : FunctionLikeDeclaration - - equalsGreaterThanToken: Node; ->equalsGreaterThanToken : Node ->Node : Node - } - interface LiteralExpression extends PrimaryExpression { ->LiteralExpression : LiteralExpression ->PrimaryExpression : PrimaryExpression - - text: string; ->text : string - - isUnterminated?: boolean; ->isUnterminated : boolean - - hasExtendedUnicodeEscape?: boolean; ->hasExtendedUnicodeEscape : boolean - } - interface StringLiteralExpression extends LiteralExpression { ->StringLiteralExpression : StringLiteralExpression ->LiteralExpression : LiteralExpression - - _stringLiteralExpressionBrand: any; ->_stringLiteralExpressionBrand : any - } - interface TemplateExpression extends PrimaryExpression { ->TemplateExpression : TemplateExpression ->PrimaryExpression : PrimaryExpression - - head: LiteralExpression; ->head : LiteralExpression ->LiteralExpression : LiteralExpression - - templateSpans: NodeArray; ->templateSpans : NodeArray ->NodeArray : NodeArray ->TemplateSpan : TemplateSpan - } - interface TemplateSpan extends Node { ->TemplateSpan : TemplateSpan ->Node : Node - - expression: Expression; ->expression : Expression ->Expression : Expression - - literal: LiteralExpression; ->literal : LiteralExpression ->LiteralExpression : LiteralExpression - } - interface ParenthesizedExpression extends PrimaryExpression { ->ParenthesizedExpression : ParenthesizedExpression ->PrimaryExpression : PrimaryExpression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ArrayLiteralExpression extends PrimaryExpression { ->ArrayLiteralExpression : ArrayLiteralExpression ->PrimaryExpression : PrimaryExpression - - elements: NodeArray; ->elements : NodeArray ->NodeArray : NodeArray ->Expression : Expression - } - interface SpreadElementExpression extends Expression { ->SpreadElementExpression : SpreadElementExpression ->Expression : Expression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ObjectLiteralExpression extends PrimaryExpression, Declaration { ->ObjectLiteralExpression : ObjectLiteralExpression ->PrimaryExpression : PrimaryExpression ->Declaration : Declaration - - properties: NodeArray; ->properties : NodeArray ->NodeArray : NodeArray ->ObjectLiteralElement : ObjectLiteralElement - } - interface PropertyAccessExpression extends MemberExpression { ->PropertyAccessExpression : PropertyAccessExpression ->MemberExpression : MemberExpression - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - dotToken: Node; ->dotToken : Node ->Node : Node - - name: Identifier; ->name : Identifier ->Identifier : Identifier - } - interface ElementAccessExpression extends MemberExpression { ->ElementAccessExpression : ElementAccessExpression ->MemberExpression : MemberExpression - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - argumentExpression?: Expression; ->argumentExpression : Expression ->Expression : Expression - } - interface CallExpression extends LeftHandSideExpression { ->CallExpression : CallExpression ->LeftHandSideExpression : LeftHandSideExpression - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - typeArguments?: NodeArray; ->typeArguments : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - - arguments: NodeArray; ->arguments : NodeArray ->NodeArray : NodeArray ->Expression : Expression - } - interface NewExpression extends CallExpression, PrimaryExpression { ->NewExpression : NewExpression ->CallExpression : CallExpression ->PrimaryExpression : PrimaryExpression - } - interface TaggedTemplateExpression extends MemberExpression { ->TaggedTemplateExpression : TaggedTemplateExpression ->MemberExpression : MemberExpression - - tag: LeftHandSideExpression; ->tag : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - template: LiteralExpression | TemplateExpression; ->template : LiteralExpression | TemplateExpression ->LiteralExpression : LiteralExpression ->TemplateExpression : TemplateExpression - } - type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression; ->CallLikeExpression : CallExpression | NewExpression | TaggedTemplateExpression ->CallExpression : CallExpression ->NewExpression : NewExpression ->TaggedTemplateExpression : TaggedTemplateExpression - - interface TypeAssertion extends UnaryExpression { ->TypeAssertion : TypeAssertion ->UnaryExpression : UnaryExpression - - type: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface Statement extends Node, ModuleElement { ->Statement : Statement ->Node : Node ->ModuleElement : ModuleElement - - _statementBrand: any; ->_statementBrand : any - } - interface Block extends Statement { ->Block : Block ->Statement : Statement - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->Statement : Statement - } - interface VariableStatement extends Statement { ->VariableStatement : VariableStatement ->Statement : Statement - - declarationList: VariableDeclarationList; ->declarationList : VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList - } - interface ExpressionStatement extends Statement { ->ExpressionStatement : ExpressionStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface IfStatement extends Statement { ->IfStatement : IfStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - - thenStatement: Statement; ->thenStatement : Statement ->Statement : Statement - - elseStatement?: Statement; ->elseStatement : Statement ->Statement : Statement - } - interface IterationStatement extends Statement { ->IterationStatement : IterationStatement ->Statement : Statement - - statement: Statement; ->statement : Statement ->Statement : Statement - } - interface DoStatement extends IterationStatement { ->DoStatement : DoStatement ->IterationStatement : IterationStatement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface WhileStatement extends IterationStatement { ->WhileStatement : WhileStatement ->IterationStatement : IterationStatement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ForStatement extends IterationStatement { ->ForStatement : ForStatement ->IterationStatement : IterationStatement - - initializer?: VariableDeclarationList | Expression; ->initializer : Expression | VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList ->Expression : Expression - - condition?: Expression; ->condition : Expression ->Expression : Expression - - iterator?: Expression; ->iterator : Expression ->Expression : Expression - } - interface ForInStatement extends IterationStatement { ->ForInStatement : ForInStatement ->IterationStatement : IterationStatement - - initializer: VariableDeclarationList | Expression; ->initializer : Expression | VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList ->Expression : Expression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ForOfStatement extends IterationStatement { ->ForOfStatement : ForOfStatement ->IterationStatement : IterationStatement - - initializer: VariableDeclarationList | Expression; ->initializer : Expression | VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList ->Expression : Expression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface BreakOrContinueStatement extends Statement { ->BreakOrContinueStatement : BreakOrContinueStatement ->Statement : Statement - - label?: Identifier; ->label : Identifier ->Identifier : Identifier - } - interface ReturnStatement extends Statement { ->ReturnStatement : ReturnStatement ->Statement : Statement - - expression?: Expression; ->expression : Expression ->Expression : Expression - } - interface WithStatement extends Statement { ->WithStatement : WithStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - - statement: Statement; ->statement : Statement ->Statement : Statement - } - interface SwitchStatement extends Statement { ->SwitchStatement : SwitchStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - - caseBlock: CaseBlock; ->caseBlock : CaseBlock ->CaseBlock : CaseBlock - } - interface CaseBlock extends Node { ->CaseBlock : CaseBlock ->Node : Node - - clauses: NodeArray; ->clauses : NodeArray ->NodeArray : NodeArray ->CaseOrDefaultClause : CaseClause | DefaultClause - } - interface CaseClause extends Node { ->CaseClause : CaseClause ->Node : Node - - expression?: Expression; ->expression : Expression ->Expression : Expression - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->Statement : Statement - } - interface DefaultClause extends Node { ->DefaultClause : DefaultClause ->Node : Node - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->Statement : Statement - } - type CaseOrDefaultClause = CaseClause | DefaultClause; ->CaseOrDefaultClause : CaseClause | DefaultClause ->CaseClause : CaseClause ->DefaultClause : DefaultClause - - interface LabeledStatement extends Statement { ->LabeledStatement : LabeledStatement ->Statement : Statement - - label: Identifier; ->label : Identifier ->Identifier : Identifier - - statement: Statement; ->statement : Statement ->Statement : Statement - } - interface ThrowStatement extends Statement { ->ThrowStatement : ThrowStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface TryStatement extends Statement { ->TryStatement : TryStatement ->Statement : Statement - - tryBlock: Block; ->tryBlock : Block ->Block : Block - - catchClause?: CatchClause; ->catchClause : CatchClause ->CatchClause : CatchClause - - finallyBlock?: Block; ->finallyBlock : Block ->Block : Block - } - interface CatchClause extends Node { ->CatchClause : CatchClause ->Node : Node - - variableDeclaration: VariableDeclaration; ->variableDeclaration : VariableDeclaration ->VariableDeclaration : VariableDeclaration - - block: Block; ->block : Block ->Block : Block - } - interface ModuleElement extends Node { ->ModuleElement : ModuleElement ->Node : Node - - _moduleElementBrand: any; ->_moduleElementBrand : any - } - interface ClassDeclaration extends Declaration, ModuleElement { ->ClassDeclaration : ClassDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - typeParameters?: NodeArray; ->typeParameters : NodeArray ->NodeArray : NodeArray ->TypeParameterDeclaration : TypeParameterDeclaration - - heritageClauses?: NodeArray; ->heritageClauses : NodeArray ->NodeArray : NodeArray ->HeritageClause : HeritageClause - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->ClassElement : ClassElement - } - interface ClassElement extends Declaration { ->ClassElement : ClassElement ->Declaration : Declaration - - _classElementBrand: any; ->_classElementBrand : any - } - interface InterfaceDeclaration extends Declaration, ModuleElement { ->InterfaceDeclaration : InterfaceDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - typeParameters?: NodeArray; ->typeParameters : NodeArray ->NodeArray : NodeArray ->TypeParameterDeclaration : TypeParameterDeclaration - - heritageClauses?: NodeArray; ->heritageClauses : NodeArray ->NodeArray : NodeArray ->HeritageClause : HeritageClause - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->Declaration : Declaration - } - interface HeritageClause extends Node { ->HeritageClause : HeritageClause ->Node : Node - - token: SyntaxKind; ->token : SyntaxKind ->SyntaxKind : SyntaxKind - - types?: NodeArray; ->types : NodeArray ->NodeArray : NodeArray ->TypeReferenceNode : TypeReferenceNode - } - interface TypeAliasDeclaration extends Declaration, ModuleElement { ->TypeAliasDeclaration : TypeAliasDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - type: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface EnumMember extends Declaration { ->EnumMember : EnumMember ->Declaration : Declaration - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface EnumDeclaration extends Declaration, ModuleElement { ->EnumDeclaration : EnumDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->EnumMember : EnumMember - } - interface ModuleDeclaration extends Declaration, ModuleElement { ->ModuleDeclaration : ModuleDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier | LiteralExpression; ->name : Identifier | LiteralExpression ->Identifier : Identifier ->LiteralExpression : LiteralExpression - - body: ModuleBlock | ModuleDeclaration; ->body : ModuleDeclaration | ModuleBlock ->ModuleBlock : ModuleBlock ->ModuleDeclaration : ModuleDeclaration - } - interface ModuleBlock extends Node, ModuleElement { ->ModuleBlock : ModuleBlock ->Node : Node ->ModuleElement : ModuleElement - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->ModuleElement : ModuleElement - } - interface ImportEqualsDeclaration extends Declaration, ModuleElement { ->ImportEqualsDeclaration : ImportEqualsDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - moduleReference: EntityName | ExternalModuleReference; ->moduleReference : Identifier | QualifiedName | ExternalModuleReference ->EntityName : Identifier | QualifiedName ->ExternalModuleReference : ExternalModuleReference - } - interface ExternalModuleReference extends Node { ->ExternalModuleReference : ExternalModuleReference ->Node : Node - - expression?: Expression; ->expression : Expression ->Expression : Expression - } - interface ImportDeclaration extends Statement, ModuleElement { ->ImportDeclaration : ImportDeclaration ->Statement : Statement ->ModuleElement : ModuleElement - - importClause?: ImportClause; ->importClause : ImportClause ->ImportClause : ImportClause - - moduleSpecifier: Expression; ->moduleSpecifier : Expression ->Expression : Expression - } - interface ImportClause extends Declaration { ->ImportClause : ImportClause ->Declaration : Declaration - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - namedBindings?: NamespaceImport | NamedImports; ->namedBindings : NamespaceImport | NamedImportsOrExports ->NamespaceImport : NamespaceImport ->NamedImports : NamedImportsOrExports - } - interface NamespaceImport extends Declaration { ->NamespaceImport : NamespaceImport ->Declaration : Declaration - - name: Identifier; ->name : Identifier ->Identifier : Identifier - } - interface ExportDeclaration extends Declaration, ModuleElement { ->ExportDeclaration : ExportDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - exportClause?: NamedExports; ->exportClause : NamedImportsOrExports ->NamedExports : NamedImportsOrExports - - moduleSpecifier?: Expression; ->moduleSpecifier : Expression ->Expression : Expression - } - interface NamedImportsOrExports extends Node { ->NamedImportsOrExports : NamedImportsOrExports ->Node : Node - - elements: NodeArray; ->elements : NodeArray ->NodeArray : NodeArray ->ImportOrExportSpecifier : ImportOrExportSpecifier - } - type NamedImports = NamedImportsOrExports; ->NamedImports : NamedImportsOrExports ->NamedImportsOrExports : NamedImportsOrExports - - type NamedExports = NamedImportsOrExports; ->NamedExports : NamedImportsOrExports ->NamedImportsOrExports : NamedImportsOrExports - - interface ImportOrExportSpecifier extends Declaration { ->ImportOrExportSpecifier : ImportOrExportSpecifier ->Declaration : Declaration - - propertyName?: Identifier; ->propertyName : Identifier ->Identifier : Identifier - - name: Identifier; ->name : Identifier ->Identifier : Identifier - } - type ImportSpecifier = ImportOrExportSpecifier; ->ImportSpecifier : ImportOrExportSpecifier ->ImportOrExportSpecifier : ImportOrExportSpecifier - - type ExportSpecifier = ImportOrExportSpecifier; ->ExportSpecifier : ImportOrExportSpecifier ->ImportOrExportSpecifier : ImportOrExportSpecifier - - interface ExportAssignment extends Declaration, ModuleElement { ->ExportAssignment : ExportAssignment ->Declaration : Declaration ->ModuleElement : ModuleElement - - isExportEquals?: boolean; ->isExportEquals : boolean - - expression?: Expression; ->expression : Expression ->Expression : Expression - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface FileReference extends TextRange { ->FileReference : FileReference ->TextRange : TextRange - - fileName: string; ->fileName : string - } - interface CommentRange extends TextRange { ->CommentRange : CommentRange ->TextRange : TextRange - - hasTrailingNewLine?: boolean; ->hasTrailingNewLine : boolean - } - interface SourceFile extends Declaration { ->SourceFile : SourceFile ->Declaration : Declaration - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->ModuleElement : ModuleElement - - endOfFileToken: Node; ->endOfFileToken : Node ->Node : Node - - fileName: string; ->fileName : string - - text: string; ->text : string - - amdDependencies: { ->amdDependencies : { path: string; name: string; }[] - - path: string; ->path : string - - name: string; ->name : string - - }[]; - amdModuleName: string; ->amdModuleName : string - - referencedFiles: FileReference[]; ->referencedFiles : FileReference[] ->FileReference : FileReference - - hasNoDefaultLib: boolean; ->hasNoDefaultLib : boolean - - externalModuleIndicator: Node; ->externalModuleIndicator : Node ->Node : Node - - languageVersion: ScriptTarget; ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget - - identifiers: Map; ->identifiers : Map ->Map : Map - } - interface ScriptReferenceHost { ->ScriptReferenceHost : ScriptReferenceHost - - getCompilerOptions(): CompilerOptions; ->getCompilerOptions : () => CompilerOptions ->CompilerOptions : CompilerOptions - - getSourceFile(fileName: string): SourceFile; ->getSourceFile : (fileName: string) => SourceFile ->fileName : string ->SourceFile : SourceFile - - getCurrentDirectory(): string; ->getCurrentDirectory : () => string - } - interface WriteFileCallback { ->WriteFileCallback : WriteFileCallback - - (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; ->fileName : string ->data : string ->writeByteOrderMark : boolean ->onError : (message: string) => void ->message : string - } - interface Program extends ScriptReferenceHost { ->Program : Program ->ScriptReferenceHost : ScriptReferenceHost - - getSourceFiles(): SourceFile[]; ->getSourceFiles : () => SourceFile[] ->SourceFile : SourceFile - - /** - * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then - * the JavaScript and declaration files will be produced for all the files in this program. - * If targetSourceFile is specified, then only the JavaScript and declaration for that - * specific file will be generated. - * - * If writeFile is not specified then the writeFile callback from the compiler host will be - * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter - * will be invoked when writing the JavaScript and declaration files. - */ - emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback): EmitResult; ->emit : (targetSourceFile?: SourceFile, writeFile?: WriteFileCallback) => EmitResult ->targetSourceFile : SourceFile ->SourceFile : SourceFile ->writeFile : WriteFileCallback ->WriteFileCallback : WriteFileCallback ->EmitResult : EmitResult - - getSyntacticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; ->getSyntacticDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Diagnostic : Diagnostic - - getGlobalDiagnostics(): Diagnostic[]; ->getGlobalDiagnostics : () => Diagnostic[] ->Diagnostic : Diagnostic - - getSemanticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; ->getSemanticDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Diagnostic : Diagnostic - - getDeclarationDiagnostics(sourceFile?: SourceFile): Diagnostic[]; ->getDeclarationDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Diagnostic : Diagnostic - - getTypeChecker(): TypeChecker; ->getTypeChecker : () => TypeChecker ->TypeChecker : TypeChecker - - getCommonSourceDirectory(): string; ->getCommonSourceDirectory : () => string - } - interface SourceMapSpan { ->SourceMapSpan : SourceMapSpan - - emittedLine: number; ->emittedLine : number - - emittedColumn: number; ->emittedColumn : number - - sourceLine: number; ->sourceLine : number - - sourceColumn: number; ->sourceColumn : number - - nameIndex?: number; ->nameIndex : number - - sourceIndex: number; ->sourceIndex : number - } - interface SourceMapData { ->SourceMapData : SourceMapData - - sourceMapFilePath: string; ->sourceMapFilePath : string - - jsSourceMappingURL: string; ->jsSourceMappingURL : string - - sourceMapFile: string; ->sourceMapFile : string - - sourceMapSourceRoot: string; ->sourceMapSourceRoot : string - - sourceMapSources: string[]; ->sourceMapSources : string[] - - inputSourceFileNames: string[]; ->inputSourceFileNames : string[] - - sourceMapNames?: string[]; ->sourceMapNames : string[] - - sourceMapMappings: string; ->sourceMapMappings : string - - sourceMapDecodedMappings: SourceMapSpan[]; ->sourceMapDecodedMappings : SourceMapSpan[] ->SourceMapSpan : SourceMapSpan - } - enum ExitStatus { ->ExitStatus : ExitStatus - - Success = 0, ->Success : ExitStatus - - DiagnosticsPresent_OutputsSkipped = 1, ->DiagnosticsPresent_OutputsSkipped : ExitStatus - - DiagnosticsPresent_OutputsGenerated = 2, ->DiagnosticsPresent_OutputsGenerated : ExitStatus - } - interface EmitResult { ->EmitResult : EmitResult - - emitSkipped: boolean; ->emitSkipped : boolean - - diagnostics: Diagnostic[]; ->diagnostics : Diagnostic[] ->Diagnostic : Diagnostic - - sourceMaps: SourceMapData[]; ->sourceMaps : SourceMapData[] ->SourceMapData : SourceMapData - } - interface TypeCheckerHost { ->TypeCheckerHost : TypeCheckerHost - - getCompilerOptions(): CompilerOptions; ->getCompilerOptions : () => CompilerOptions ->CompilerOptions : CompilerOptions - - getSourceFiles(): SourceFile[]; ->getSourceFiles : () => SourceFile[] ->SourceFile : SourceFile - - getSourceFile(fileName: string): SourceFile; ->getSourceFile : (fileName: string) => SourceFile ->fileName : string ->SourceFile : SourceFile - } - interface TypeChecker { ->TypeChecker : TypeChecker - - getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; ->getTypeOfSymbolAtLocation : (symbol: Symbol, node: Node) => Type ->symbol : Symbol ->Symbol : Symbol ->node : Node ->Node : Node ->Type : Type - - getDeclaredTypeOfSymbol(symbol: Symbol): Type; ->getDeclaredTypeOfSymbol : (symbol: Symbol) => Type ->symbol : Symbol ->Symbol : Symbol ->Type : Type - - getPropertiesOfType(type: Type): Symbol[]; ->getPropertiesOfType : (type: Type) => Symbol[] ->type : Type ->Type : Type ->Symbol : Symbol - - getPropertyOfType(type: Type, propertyName: string): Symbol; ->getPropertyOfType : (type: Type, propertyName: string) => Symbol ->type : Type ->Type : Type ->propertyName : string ->Symbol : Symbol - - getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; ->getSignaturesOfType : (type: Type, kind: SignatureKind) => Signature[] ->type : Type ->Type : Type ->kind : SignatureKind ->SignatureKind : SignatureKind ->Signature : Signature - - getIndexTypeOfType(type: Type, kind: IndexKind): Type; ->getIndexTypeOfType : (type: Type, kind: IndexKind) => Type ->type : Type ->Type : Type ->kind : IndexKind ->IndexKind : IndexKind ->Type : Type - - getReturnTypeOfSignature(signature: Signature): Type; ->getReturnTypeOfSignature : (signature: Signature) => Type ->signature : Signature ->Signature : Signature ->Type : Type - - getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; ->getSymbolsInScope : (location: Node, meaning: SymbolFlags) => Symbol[] ->location : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags ->Symbol : Symbol - - getSymbolAtLocation(node: Node): Symbol; ->getSymbolAtLocation : (node: Node) => Symbol ->node : Node ->Node : Node ->Symbol : Symbol - - getShorthandAssignmentValueSymbol(location: Node): Symbol; ->getShorthandAssignmentValueSymbol : (location: Node) => Symbol ->location : Node ->Node : Node ->Symbol : Symbol - - getTypeAtLocation(node: Node): Type; ->getTypeAtLocation : (node: Node) => Type ->node : Node ->Node : Node ->Type : Type - - typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; ->typeToString : (type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => string ->type : Type ->Type : Type ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; ->symbolToString : (symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) => string ->symbol : Symbol ->Symbol : Symbol ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags - - getSymbolDisplayBuilder(): SymbolDisplayBuilder; ->getSymbolDisplayBuilder : () => SymbolDisplayBuilder ->SymbolDisplayBuilder : SymbolDisplayBuilder - - getFullyQualifiedName(symbol: Symbol): string; ->getFullyQualifiedName : (symbol: Symbol) => string ->symbol : Symbol ->Symbol : Symbol - - getAugmentedPropertiesOfType(type: Type): Symbol[]; ->getAugmentedPropertiesOfType : (type: Type) => Symbol[] ->type : Type ->Type : Type ->Symbol : Symbol - - getRootSymbols(symbol: Symbol): Symbol[]; ->getRootSymbols : (symbol: Symbol) => Symbol[] ->symbol : Symbol ->Symbol : Symbol ->Symbol : Symbol - - getContextualType(node: Expression): Type; ->getContextualType : (node: Expression) => Type ->node : Expression ->Expression : Expression ->Type : Type - - getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature; ->getResolvedSignature : (node: CallExpression | NewExpression | TaggedTemplateExpression, candidatesOutArray?: Signature[]) => Signature ->node : CallExpression | NewExpression | TaggedTemplateExpression ->CallLikeExpression : CallExpression | NewExpression | TaggedTemplateExpression ->candidatesOutArray : Signature[] ->Signature : Signature ->Signature : Signature - - getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature; ->getSignatureFromDeclaration : (declaration: SignatureDeclaration) => Signature ->declaration : SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration ->Signature : Signature - - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; ->isImplementationOfOverload : (node: FunctionLikeDeclaration) => boolean ->node : FunctionLikeDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration - - isUndefinedSymbol(symbol: Symbol): boolean; ->isUndefinedSymbol : (symbol: Symbol) => boolean ->symbol : Symbol ->Symbol : Symbol - - isArgumentsSymbol(symbol: Symbol): boolean; ->isArgumentsSymbol : (symbol: Symbol) => boolean ->symbol : Symbol ->Symbol : Symbol - - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; ->getConstantValue : (node: PropertyAccessExpression | ElementAccessExpression | EnumMember) => number ->node : PropertyAccessExpression | ElementAccessExpression | EnumMember ->EnumMember : EnumMember ->PropertyAccessExpression : PropertyAccessExpression ->ElementAccessExpression : ElementAccessExpression - - isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; ->isValidPropertyAccess : (node: QualifiedName | PropertyAccessExpression, propertyName: string) => boolean ->node : QualifiedName | PropertyAccessExpression ->PropertyAccessExpression : PropertyAccessExpression ->QualifiedName : QualifiedName ->propertyName : string - - getAliasedSymbol(symbol: Symbol): Symbol; ->getAliasedSymbol : (symbol: Symbol) => Symbol ->symbol : Symbol ->Symbol : Symbol ->Symbol : Symbol - - getExportsOfExternalModule(node: ImportDeclaration): Symbol[]; ->getExportsOfExternalModule : (node: ImportDeclaration) => Symbol[] ->node : ImportDeclaration ->ImportDeclaration : ImportDeclaration ->Symbol : Symbol - } - interface SymbolDisplayBuilder { ->SymbolDisplayBuilder : SymbolDisplayBuilder - - buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildTypeDisplay : (type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->type : Type ->Type : Type ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; ->buildSymbolDisplay : (symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags) => void ->symbol : Symbol ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags ->flags : SymbolFormatFlags ->SymbolFormatFlags : SymbolFormatFlags - - buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildSignatureDisplay : (signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->signatures : Signature ->Signature : Signature ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildParameterDisplay : (parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->parameter : Symbol ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildTypeParameterDisplay : (tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->tp : TypeParameter ->TypeParameter : TypeParameter ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags): void; ->buildTypeParameterDisplayFromSymbol : (symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags) => void ->symbol : Symbol ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaraiton : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildDisplayForParametersAndDelimiters(parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildDisplayForParametersAndDelimiters : (parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->parameters : Symbol[] ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildDisplayForTypeParametersAndDelimiters : (typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->typeParameters : TypeParameter[] ->TypeParameter : TypeParameter ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildReturnTypeDisplay : (signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->signature : Signature ->Signature : Signature ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - } - interface SymbolWriter { ->SymbolWriter : SymbolWriter - - writeKeyword(text: string): void; ->writeKeyword : (text: string) => void ->text : string - - writeOperator(text: string): void; ->writeOperator : (text: string) => void ->text : string - - writePunctuation(text: string): void; ->writePunctuation : (text: string) => void ->text : string - - writeSpace(text: string): void; ->writeSpace : (text: string) => void ->text : string - - writeStringLiteral(text: string): void; ->writeStringLiteral : (text: string) => void ->text : string - - writeParameter(text: string): void; ->writeParameter : (text: string) => void ->text : string - - writeSymbol(text: string, symbol: Symbol): void; ->writeSymbol : (text: string, symbol: Symbol) => void ->text : string ->symbol : Symbol ->Symbol : Symbol - - writeLine(): void; ->writeLine : () => void - - increaseIndent(): void; ->increaseIndent : () => void - - decreaseIndent(): void; ->decreaseIndent : () => void - - clear(): void; ->clear : () => void - - trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; ->trackSymbol : (symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) => void ->symbol : Symbol ->Symbol : Symbol ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags - } - const enum TypeFormatFlags { ->TypeFormatFlags : TypeFormatFlags - - None = 0, ->None : TypeFormatFlags - - WriteArrayAsGenericType = 1, ->WriteArrayAsGenericType : TypeFormatFlags - - UseTypeOfFunction = 2, ->UseTypeOfFunction : TypeFormatFlags - - NoTruncation = 4, ->NoTruncation : TypeFormatFlags - - WriteArrowStyleSignature = 8, ->WriteArrowStyleSignature : TypeFormatFlags - - WriteOwnNameForAnyLike = 16, ->WriteOwnNameForAnyLike : TypeFormatFlags - - WriteTypeArgumentsOfSignature = 32, ->WriteTypeArgumentsOfSignature : TypeFormatFlags - - InElementType = 64, ->InElementType : TypeFormatFlags - - UseFullyQualifiedType = 128, ->UseFullyQualifiedType : TypeFormatFlags - } - const enum SymbolFormatFlags { ->SymbolFormatFlags : SymbolFormatFlags - - None = 0, ->None : SymbolFormatFlags - - WriteTypeParametersOrArguments = 1, ->WriteTypeParametersOrArguments : SymbolFormatFlags - - UseOnlyExternalAliasing = 2, ->UseOnlyExternalAliasing : SymbolFormatFlags - } - const enum SymbolAccessibility { ->SymbolAccessibility : SymbolAccessibility - - Accessible = 0, ->Accessible : SymbolAccessibility - - NotAccessible = 1, ->NotAccessible : SymbolAccessibility - - CannotBeNamed = 2, ->CannotBeNamed : SymbolAccessibility - } - type AnyImportSyntax = ImportDeclaration | ImportEqualsDeclaration; ->AnyImportSyntax : ImportEqualsDeclaration | ImportDeclaration ->ImportDeclaration : ImportDeclaration ->ImportEqualsDeclaration : ImportEqualsDeclaration - - interface SymbolVisibilityResult { ->SymbolVisibilityResult : SymbolVisibilityResult - - accessibility: SymbolAccessibility; ->accessibility : SymbolAccessibility ->SymbolAccessibility : SymbolAccessibility - - aliasesToMakeVisible?: AnyImportSyntax[]; ->aliasesToMakeVisible : (ImportEqualsDeclaration | ImportDeclaration)[] ->AnyImportSyntax : ImportEqualsDeclaration | ImportDeclaration - - errorSymbolName?: string; ->errorSymbolName : string - - errorNode?: Node; ->errorNode : Node ->Node : Node - } - interface SymbolAccessiblityResult extends SymbolVisibilityResult { ->SymbolAccessiblityResult : SymbolAccessiblityResult ->SymbolVisibilityResult : SymbolVisibilityResult - - errorModuleName?: string; ->errorModuleName : string - } - interface EmitResolver { ->EmitResolver : EmitResolver - - hasGlobalName(name: string): boolean; ->hasGlobalName : (name: string) => boolean ->name : string - - getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string; ->getExpressionNameSubstitution : (node: Identifier, getGeneratedNameForNode: (node: Node) => string) => string ->node : Identifier ->Identifier : Identifier ->getGeneratedNameForNode : (node: Node) => string ->node : Node ->Node : Node - - isValueAliasDeclaration(node: Node): boolean; ->isValueAliasDeclaration : (node: Node) => boolean ->node : Node ->Node : Node - - isReferencedAliasDeclaration(node: Node, checkChildren?: boolean): boolean; ->isReferencedAliasDeclaration : (node: Node, checkChildren?: boolean) => boolean ->node : Node ->Node : Node ->checkChildren : boolean - - isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; ->isTopLevelValueImportEqualsWithEntityName : (node: ImportEqualsDeclaration) => boolean ->node : ImportEqualsDeclaration ->ImportEqualsDeclaration : ImportEqualsDeclaration - - getNodeCheckFlags(node: Node): NodeCheckFlags; ->getNodeCheckFlags : (node: Node) => NodeCheckFlags ->node : Node ->Node : Node ->NodeCheckFlags : NodeCheckFlags - - isDeclarationVisible(node: Declaration): boolean; ->isDeclarationVisible : (node: Declaration) => boolean ->node : Declaration ->Declaration : Declaration - - collectLinkedAliases(node: Identifier): Node[]; ->collectLinkedAliases : (node: Identifier) => Node[] ->node : Identifier ->Identifier : Identifier ->Node : Node - - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; ->isImplementationOfOverload : (node: FunctionLikeDeclaration) => boolean ->node : FunctionLikeDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration - - writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; ->writeTypeOfDeclaration : (declaration: VariableLikeDeclaration | AccessorDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void ->declaration : VariableLikeDeclaration | AccessorDeclaration ->AccessorDeclaration : AccessorDeclaration ->VariableLikeDeclaration : VariableLikeDeclaration ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags ->writer : SymbolWriter ->SymbolWriter : SymbolWriter - - writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; ->writeReturnTypeOfSignatureDeclaration : (signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void ->signatureDeclaration : SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags ->writer : SymbolWriter ->SymbolWriter : SymbolWriter - - writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; ->writeTypeOfExpression : (expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void ->expr : Expression ->Expression : Expression ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags ->writer : SymbolWriter ->SymbolWriter : SymbolWriter - - isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult; ->isSymbolAccessible : (symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags) => SymbolAccessiblityResult ->symbol : Symbol ->Symbol : Symbol ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags ->SymbolAccessiblityResult : SymbolAccessiblityResult - - isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult; ->isEntityNameVisible : (entityName: Identifier | QualifiedName, enclosingDeclaration: Node) => SymbolVisibilityResult ->entityName : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName ->enclosingDeclaration : Node ->Node : Node ->SymbolVisibilityResult : SymbolVisibilityResult - - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; ->getConstantValue : (node: PropertyAccessExpression | ElementAccessExpression | EnumMember) => number ->node : PropertyAccessExpression | ElementAccessExpression | EnumMember ->EnumMember : EnumMember ->PropertyAccessExpression : PropertyAccessExpression ->ElementAccessExpression : ElementAccessExpression - - resolvesToSomeValue(location: Node, name: string): boolean; ->resolvesToSomeValue : (location: Node, name: string) => boolean ->location : Node ->Node : Node ->name : string - - getBlockScopedVariableId(node: Identifier): number; ->getBlockScopedVariableId : (node: Identifier) => number ->node : Identifier ->Identifier : Identifier - } - const enum SymbolFlags { ->SymbolFlags : SymbolFlags - - FunctionScopedVariable = 1, ->FunctionScopedVariable : SymbolFlags - - BlockScopedVariable = 2, ->BlockScopedVariable : SymbolFlags - - Property = 4, ->Property : SymbolFlags - - EnumMember = 8, ->EnumMember : SymbolFlags - - Function = 16, ->Function : SymbolFlags - - Class = 32, ->Class : SymbolFlags - - Interface = 64, ->Interface : SymbolFlags - - ConstEnum = 128, ->ConstEnum : SymbolFlags - - RegularEnum = 256, ->RegularEnum : SymbolFlags - - ValueModule = 512, ->ValueModule : SymbolFlags - - NamespaceModule = 1024, ->NamespaceModule : SymbolFlags - - TypeLiteral = 2048, ->TypeLiteral : SymbolFlags - - ObjectLiteral = 4096, ->ObjectLiteral : SymbolFlags - - Method = 8192, ->Method : SymbolFlags - - Constructor = 16384, ->Constructor : SymbolFlags - - GetAccessor = 32768, ->GetAccessor : SymbolFlags - - SetAccessor = 65536, ->SetAccessor : SymbolFlags - - Signature = 131072, ->Signature : SymbolFlags - - TypeParameter = 262144, ->TypeParameter : SymbolFlags - - TypeAlias = 524288, ->TypeAlias : SymbolFlags - - ExportValue = 1048576, ->ExportValue : SymbolFlags - - ExportType = 2097152, ->ExportType : SymbolFlags - - ExportNamespace = 4194304, ->ExportNamespace : SymbolFlags - - Alias = 8388608, ->Alias : SymbolFlags - - Instantiated = 16777216, ->Instantiated : SymbolFlags - - Merged = 33554432, ->Merged : SymbolFlags - - Transient = 67108864, ->Transient : SymbolFlags - - Prototype = 134217728, ->Prototype : SymbolFlags - - UnionProperty = 268435456, ->UnionProperty : SymbolFlags - - Optional = 536870912, ->Optional : SymbolFlags - - ExportStar = 1073741824, ->ExportStar : SymbolFlags - - Enum = 384, ->Enum : SymbolFlags - - Variable = 3, ->Variable : SymbolFlags - - Value = 107455, ->Value : SymbolFlags - - Type = 793056, ->Type : SymbolFlags - - Namespace = 1536, ->Namespace : SymbolFlags - - Module = 1536, ->Module : SymbolFlags - - Accessor = 98304, ->Accessor : SymbolFlags - - FunctionScopedVariableExcludes = 107454, ->FunctionScopedVariableExcludes : SymbolFlags - - BlockScopedVariableExcludes = 107455, ->BlockScopedVariableExcludes : SymbolFlags - - ParameterExcludes = 107455, ->ParameterExcludes : SymbolFlags - - PropertyExcludes = 107455, ->PropertyExcludes : SymbolFlags - - EnumMemberExcludes = 107455, ->EnumMemberExcludes : SymbolFlags - - FunctionExcludes = 106927, ->FunctionExcludes : SymbolFlags - - ClassExcludes = 899583, ->ClassExcludes : SymbolFlags - - InterfaceExcludes = 792992, ->InterfaceExcludes : SymbolFlags - - RegularEnumExcludes = 899327, ->RegularEnumExcludes : SymbolFlags - - ConstEnumExcludes = 899967, ->ConstEnumExcludes : SymbolFlags - - ValueModuleExcludes = 106639, ->ValueModuleExcludes : SymbolFlags - - NamespaceModuleExcludes = 0, ->NamespaceModuleExcludes : SymbolFlags - - MethodExcludes = 99263, ->MethodExcludes : SymbolFlags - - GetAccessorExcludes = 41919, ->GetAccessorExcludes : SymbolFlags - - SetAccessorExcludes = 74687, ->SetAccessorExcludes : SymbolFlags - - TypeParameterExcludes = 530912, ->TypeParameterExcludes : SymbolFlags - - TypeAliasExcludes = 793056, ->TypeAliasExcludes : SymbolFlags - - AliasExcludes = 8388608, ->AliasExcludes : SymbolFlags - - ModuleMember = 8914931, ->ModuleMember : SymbolFlags - - ExportHasLocal = 944, ->ExportHasLocal : SymbolFlags - - HasLocals = 255504, ->HasLocals : SymbolFlags - - HasExports = 1952, ->HasExports : SymbolFlags - - HasMembers = 6240, ->HasMembers : SymbolFlags - - IsContainer = 262128, ->IsContainer : SymbolFlags - - PropertyOrAccessor = 98308, ->PropertyOrAccessor : SymbolFlags - - Export = 7340032, ->Export : SymbolFlags - } - interface Symbol { ->Symbol : Symbol - - flags: SymbolFlags; ->flags : SymbolFlags ->SymbolFlags : SymbolFlags - - name: string; ->name : string - - id?: number; ->id : number - - mergeId?: number; ->mergeId : number - - declarations?: Declaration[]; ->declarations : Declaration[] ->Declaration : Declaration - - parent?: Symbol; ->parent : Symbol ->Symbol : Symbol - - members?: SymbolTable; ->members : SymbolTable ->SymbolTable : SymbolTable - - exports?: SymbolTable; ->exports : SymbolTable ->SymbolTable : SymbolTable - - exportSymbol?: Symbol; ->exportSymbol : Symbol ->Symbol : Symbol - - valueDeclaration?: Declaration; ->valueDeclaration : Declaration ->Declaration : Declaration - - constEnumOnlyModule?: boolean; ->constEnumOnlyModule : boolean - } - interface SymbolLinks { ->SymbolLinks : SymbolLinks - - target?: Symbol; ->target : Symbol ->Symbol : Symbol - - type?: Type; ->type : Type ->Type : Type - - declaredType?: Type; ->declaredType : Type ->Type : Type - - mapper?: TypeMapper; ->mapper : TypeMapper ->TypeMapper : TypeMapper - - referenced?: boolean; ->referenced : boolean - - unionType?: UnionType; ->unionType : UnionType ->UnionType : UnionType - - resolvedExports?: SymbolTable; ->resolvedExports : SymbolTable ->SymbolTable : SymbolTable - - exportsChecked?: boolean; ->exportsChecked : boolean - } - interface TransientSymbol extends Symbol, SymbolLinks { ->TransientSymbol : TransientSymbol ->Symbol : Symbol ->SymbolLinks : SymbolLinks - } - interface SymbolTable { ->SymbolTable : SymbolTable - - [index: string]: Symbol; ->index : string ->Symbol : Symbol - } - const enum NodeCheckFlags { ->NodeCheckFlags : NodeCheckFlags - - TypeChecked = 1, ->TypeChecked : NodeCheckFlags - - LexicalThis = 2, ->LexicalThis : NodeCheckFlags - - CaptureThis = 4, ->CaptureThis : NodeCheckFlags - - EmitExtends = 8, ->EmitExtends : NodeCheckFlags - - SuperInstance = 16, ->SuperInstance : NodeCheckFlags - - SuperStatic = 32, ->SuperStatic : NodeCheckFlags - - ContextChecked = 64, ->ContextChecked : NodeCheckFlags - - EnumValuesComputed = 128, ->EnumValuesComputed : NodeCheckFlags - - BlockScopedBindingInLoop = 256, ->BlockScopedBindingInLoop : NodeCheckFlags - - EmitDecorate = 512, ->EmitDecorate : NodeCheckFlags - } - interface NodeLinks { ->NodeLinks : NodeLinks - - resolvedType?: Type; ->resolvedType : Type ->Type : Type - - resolvedSignature?: Signature; ->resolvedSignature : Signature ->Signature : Signature - - resolvedSymbol?: Symbol; ->resolvedSymbol : Symbol ->Symbol : Symbol - - flags?: NodeCheckFlags; ->flags : NodeCheckFlags ->NodeCheckFlags : NodeCheckFlags - - enumMemberValue?: number; ->enumMemberValue : number - - isIllegalTypeReferenceInConstraint?: boolean; ->isIllegalTypeReferenceInConstraint : boolean - - isVisible?: boolean; ->isVisible : boolean - - generatedName?: string; ->generatedName : string - - generatedNames?: Map; ->generatedNames : Map ->Map : Map - - assignmentChecks?: Map; ->assignmentChecks : Map ->Map : Map - - hasReportedStatementInAmbientContext?: boolean; ->hasReportedStatementInAmbientContext : boolean - - importOnRightSide?: Symbol; ->importOnRightSide : Symbol ->Symbol : Symbol - } - const enum TypeFlags { ->TypeFlags : TypeFlags - - Any = 1, ->Any : TypeFlags - - String = 2, ->String : TypeFlags - - Number = 4, ->Number : TypeFlags - - Boolean = 8, ->Boolean : TypeFlags - - Void = 16, ->Void : TypeFlags - - Undefined = 32, ->Undefined : TypeFlags - - Null = 64, ->Null : TypeFlags - - Enum = 128, ->Enum : TypeFlags - - StringLiteral = 256, ->StringLiteral : TypeFlags - - TypeParameter = 512, ->TypeParameter : TypeFlags - - Class = 1024, ->Class : TypeFlags - - Interface = 2048, ->Interface : TypeFlags - - Reference = 4096, ->Reference : TypeFlags - - Tuple = 8192, ->Tuple : TypeFlags - - Union = 16384, ->Union : TypeFlags - - Anonymous = 32768, ->Anonymous : TypeFlags - - FromSignature = 65536, ->FromSignature : TypeFlags - - ObjectLiteral = 131072, ->ObjectLiteral : TypeFlags - - ContainsUndefinedOrNull = 262144, ->ContainsUndefinedOrNull : TypeFlags - - ContainsObjectLiteral = 524288, ->ContainsObjectLiteral : TypeFlags - - ESSymbol = 1048576, ->ESSymbol : TypeFlags - - Intrinsic = 1048703, ->Intrinsic : TypeFlags - - Primitive = 1049086, ->Primitive : TypeFlags - - StringLike = 258, ->StringLike : TypeFlags - - NumberLike = 132, ->NumberLike : TypeFlags - - ObjectType = 48128, ->ObjectType : TypeFlags - - RequiresWidening = 786432, ->RequiresWidening : TypeFlags - } - interface Type { ->Type : Type - - flags: TypeFlags; ->flags : TypeFlags ->TypeFlags : TypeFlags - - id: number; ->id : number - - symbol?: Symbol; ->symbol : Symbol ->Symbol : Symbol - } - interface IntrinsicType extends Type { ->IntrinsicType : IntrinsicType ->Type : Type - - intrinsicName: string; ->intrinsicName : string - } - interface StringLiteralType extends Type { ->StringLiteralType : StringLiteralType ->Type : Type - - text: string; ->text : string - } - interface ObjectType extends Type { ->ObjectType : ObjectType ->Type : Type - } - interface InterfaceType extends ObjectType { ->InterfaceType : InterfaceType ->ObjectType : ObjectType - - typeParameters: TypeParameter[]; ->typeParameters : TypeParameter[] ->TypeParameter : TypeParameter - - baseTypes: ObjectType[]; ->baseTypes : ObjectType[] ->ObjectType : ObjectType - - declaredProperties: Symbol[]; ->declaredProperties : Symbol[] ->Symbol : Symbol - - declaredCallSignatures: Signature[]; ->declaredCallSignatures : Signature[] ->Signature : Signature - - declaredConstructSignatures: Signature[]; ->declaredConstructSignatures : Signature[] ->Signature : Signature - - declaredStringIndexType: Type; ->declaredStringIndexType : Type ->Type : Type - - declaredNumberIndexType: Type; ->declaredNumberIndexType : Type ->Type : Type - } - interface TypeReference extends ObjectType { ->TypeReference : TypeReference ->ObjectType : ObjectType - - target: GenericType; ->target : GenericType ->GenericType : GenericType - - typeArguments: Type[]; ->typeArguments : Type[] ->Type : Type - } - interface GenericType extends InterfaceType, TypeReference { ->GenericType : GenericType ->InterfaceType : InterfaceType ->TypeReference : TypeReference - - instantiations: Map; ->instantiations : Map ->Map : Map ->TypeReference : TypeReference - } - interface TupleType extends ObjectType { ->TupleType : TupleType ->ObjectType : ObjectType - - elementTypes: Type[]; ->elementTypes : Type[] ->Type : Type - - baseArrayType: TypeReference; ->baseArrayType : TypeReference ->TypeReference : TypeReference - } - interface UnionType extends Type { ->UnionType : UnionType ->Type : Type - - types: Type[]; ->types : Type[] ->Type : Type - - resolvedProperties: SymbolTable; ->resolvedProperties : SymbolTable ->SymbolTable : SymbolTable - } - interface ResolvedType extends ObjectType, UnionType { ->ResolvedType : ResolvedType ->ObjectType : ObjectType ->UnionType : UnionType - - members: SymbolTable; ->members : SymbolTable ->SymbolTable : SymbolTable - - properties: Symbol[]; ->properties : Symbol[] ->Symbol : Symbol - - callSignatures: Signature[]; ->callSignatures : Signature[] ->Signature : Signature - - constructSignatures: Signature[]; ->constructSignatures : Signature[] ->Signature : Signature - - stringIndexType: Type; ->stringIndexType : Type ->Type : Type - - numberIndexType: Type; ->numberIndexType : Type ->Type : Type - } - interface TypeParameter extends Type { ->TypeParameter : TypeParameter ->Type : Type - - constraint: Type; ->constraint : Type ->Type : Type - - target?: TypeParameter; ->target : TypeParameter ->TypeParameter : TypeParameter - - mapper?: TypeMapper; ->mapper : TypeMapper ->TypeMapper : TypeMapper - } - const enum SignatureKind { ->SignatureKind : SignatureKind - - Call = 0, ->Call : SignatureKind - - Construct = 1, ->Construct : SignatureKind - } - interface Signature { ->Signature : Signature - - declaration: SignatureDeclaration; ->declaration : SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration - - typeParameters: TypeParameter[]; ->typeParameters : TypeParameter[] ->TypeParameter : TypeParameter - - parameters: Symbol[]; ->parameters : Symbol[] ->Symbol : Symbol - - resolvedReturnType: Type; ->resolvedReturnType : Type ->Type : Type - - minArgumentCount: number; ->minArgumentCount : number - - hasRestParameter: boolean; ->hasRestParameter : boolean - - hasStringLiterals: boolean; ->hasStringLiterals : boolean - - target?: Signature; ->target : Signature ->Signature : Signature - - mapper?: TypeMapper; ->mapper : TypeMapper ->TypeMapper : TypeMapper - - unionSignatures?: Signature[]; ->unionSignatures : Signature[] ->Signature : Signature - - erasedSignatureCache?: Signature; ->erasedSignatureCache : Signature ->Signature : Signature - - isolatedSignatureType?: ObjectType; ->isolatedSignatureType : ObjectType ->ObjectType : ObjectType - } - const enum IndexKind { ->IndexKind : IndexKind - - String = 0, ->String : IndexKind - - Number = 1, ->Number : IndexKind - } - interface TypeMapper { ->TypeMapper : TypeMapper - - (t: Type): Type; ->t : Type ->Type : Type ->Type : Type - } - interface DiagnosticMessage { ->DiagnosticMessage : DiagnosticMessage - - key: string; ->key : string - - category: DiagnosticCategory; ->category : DiagnosticCategory ->DiagnosticCategory : DiagnosticCategory - - code: number; ->code : number - } - interface DiagnosticMessageChain { ->DiagnosticMessageChain : DiagnosticMessageChain - - messageText: string; ->messageText : string - - category: DiagnosticCategory; ->category : DiagnosticCategory ->DiagnosticCategory : DiagnosticCategory - - code: number; ->code : number - - next?: DiagnosticMessageChain; ->next : DiagnosticMessageChain ->DiagnosticMessageChain : DiagnosticMessageChain - } - interface Diagnostic { ->Diagnostic : Diagnostic - - file: SourceFile; ->file : SourceFile ->SourceFile : SourceFile - - start: number; ->start : number - - length: number; ->length : number - - messageText: string | DiagnosticMessageChain; ->messageText : string | DiagnosticMessageChain ->DiagnosticMessageChain : DiagnosticMessageChain - - category: DiagnosticCategory; ->category : DiagnosticCategory ->DiagnosticCategory : DiagnosticCategory - - code: number; ->code : number - } - enum DiagnosticCategory { ->DiagnosticCategory : DiagnosticCategory - - Warning = 0, ->Warning : DiagnosticCategory - - Error = 1, ->Error : DiagnosticCategory - - Message = 2, ->Message : DiagnosticCategory - } - interface CompilerOptions { ->CompilerOptions : CompilerOptions - - allowNonTsExtensions?: boolean; ->allowNonTsExtensions : boolean - - charset?: string; ->charset : string - - codepage?: number; ->codepage : number - - declaration?: boolean; ->declaration : boolean - - diagnostics?: boolean; ->diagnostics : boolean - - emitBOM?: boolean; ->emitBOM : boolean - - help?: boolean; ->help : boolean - - listFiles?: boolean; ->listFiles : boolean - - locale?: string; ->locale : string - - mapRoot?: string; ->mapRoot : string - - module?: ModuleKind; ->module : ModuleKind ->ModuleKind : ModuleKind - - noEmit?: boolean; ->noEmit : boolean - - noEmitOnError?: boolean; ->noEmitOnError : boolean - - noErrorTruncation?: boolean; ->noErrorTruncation : boolean - - noImplicitAny?: boolean; ->noImplicitAny : boolean - - noLib?: boolean; ->noLib : boolean - - noLibCheck?: boolean; ->noLibCheck : boolean - - noResolve?: boolean; ->noResolve : boolean - - out?: string; ->out : string - - outDir?: string; ->outDir : string - - preserveConstEnums?: boolean; ->preserveConstEnums : boolean - - project?: string; ->project : string - - removeComments?: boolean; ->removeComments : boolean - - sourceMap?: boolean; ->sourceMap : boolean - - sourceRoot?: string; ->sourceRoot : string - - suppressImplicitAnyIndexErrors?: boolean; ->suppressImplicitAnyIndexErrors : boolean - - target?: ScriptTarget; ->target : ScriptTarget ->ScriptTarget : ScriptTarget - - version?: boolean; ->version : boolean - - watch?: boolean; ->watch : boolean - - [option: string]: string | number | boolean; ->option : string - } - const enum ModuleKind { ->ModuleKind : ModuleKind - - None = 0, ->None : ModuleKind - - CommonJS = 1, ->CommonJS : ModuleKind - - AMD = 2, ->AMD : ModuleKind - } - interface LineAndCharacter { ->LineAndCharacter : LineAndCharacter - - line: number; ->line : number - - character: number; ->character : number - } - const enum ScriptTarget { ->ScriptTarget : ScriptTarget - - ES3 = 0, ->ES3 : ScriptTarget - - ES5 = 1, ->ES5 : ScriptTarget - - ES6 = 2, ->ES6 : ScriptTarget - - Latest = 2, ->Latest : ScriptTarget - } - interface ParsedCommandLine { ->ParsedCommandLine : ParsedCommandLine - - options: CompilerOptions; ->options : CompilerOptions ->CompilerOptions : CompilerOptions - - fileNames: string[]; ->fileNames : string[] - - errors: Diagnostic[]; ->errors : Diagnostic[] ->Diagnostic : Diagnostic - } - interface CommandLineOption { ->CommandLineOption : CommandLineOption - - name: string; ->name : string - - type: string | Map; ->type : string | Map ->Map : Map - - isFilePath?: boolean; ->isFilePath : boolean - - shortName?: string; ->shortName : string - - description?: DiagnosticMessage; ->description : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage - - paramType?: DiagnosticMessage; ->paramType : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage - - error?: DiagnosticMessage; ->error : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage - - experimental?: boolean; ->experimental : boolean - } - const enum CharacterCodes { ->CharacterCodes : CharacterCodes - - nullCharacter = 0, ->nullCharacter : CharacterCodes - - maxAsciiCharacter = 127, ->maxAsciiCharacter : CharacterCodes - - lineFeed = 10, ->lineFeed : CharacterCodes - - carriageReturn = 13, ->carriageReturn : CharacterCodes - - lineSeparator = 8232, ->lineSeparator : CharacterCodes - - paragraphSeparator = 8233, ->paragraphSeparator : CharacterCodes - - nextLine = 133, ->nextLine : CharacterCodes - - space = 32, ->space : CharacterCodes - - nonBreakingSpace = 160, ->nonBreakingSpace : CharacterCodes - - enQuad = 8192, ->enQuad : CharacterCodes - - emQuad = 8193, ->emQuad : CharacterCodes - - enSpace = 8194, ->enSpace : CharacterCodes - - emSpace = 8195, ->emSpace : CharacterCodes - - threePerEmSpace = 8196, ->threePerEmSpace : CharacterCodes - - fourPerEmSpace = 8197, ->fourPerEmSpace : CharacterCodes - - sixPerEmSpace = 8198, ->sixPerEmSpace : CharacterCodes - - figureSpace = 8199, ->figureSpace : CharacterCodes - - punctuationSpace = 8200, ->punctuationSpace : CharacterCodes - - thinSpace = 8201, ->thinSpace : CharacterCodes - - hairSpace = 8202, ->hairSpace : CharacterCodes - - zeroWidthSpace = 8203, ->zeroWidthSpace : CharacterCodes - - narrowNoBreakSpace = 8239, ->narrowNoBreakSpace : CharacterCodes - - ideographicSpace = 12288, ->ideographicSpace : CharacterCodes - - mathematicalSpace = 8287, ->mathematicalSpace : CharacterCodes - - ogham = 5760, ->ogham : CharacterCodes - - _ = 95, ->_ : CharacterCodes - - $ = 36, ->$ : CharacterCodes - - _0 = 48, ->_0 : CharacterCodes - - _1 = 49, ->_1 : CharacterCodes - - _2 = 50, ->_2 : CharacterCodes - - _3 = 51, ->_3 : CharacterCodes - - _4 = 52, ->_4 : CharacterCodes - - _5 = 53, ->_5 : CharacterCodes - - _6 = 54, ->_6 : CharacterCodes - - _7 = 55, ->_7 : CharacterCodes - - _8 = 56, ->_8 : CharacterCodes - - _9 = 57, ->_9 : CharacterCodes - - a = 97, ->a : CharacterCodes - - b = 98, ->b : CharacterCodes - - c = 99, ->c : CharacterCodes - - d = 100, ->d : CharacterCodes - - e = 101, ->e : CharacterCodes - - f = 102, ->f : CharacterCodes - - g = 103, ->g : CharacterCodes - - h = 104, ->h : CharacterCodes - - i = 105, ->i : CharacterCodes - - j = 106, ->j : CharacterCodes - - k = 107, ->k : CharacterCodes - - l = 108, ->l : CharacterCodes - - m = 109, ->m : CharacterCodes - - n = 110, ->n : CharacterCodes - - o = 111, ->o : CharacterCodes - - p = 112, ->p : CharacterCodes - - q = 113, ->q : CharacterCodes - - r = 114, ->r : CharacterCodes - - s = 115, ->s : CharacterCodes - - t = 116, ->t : CharacterCodes - - u = 117, ->u : CharacterCodes - - v = 118, ->v : CharacterCodes - - w = 119, ->w : CharacterCodes - - x = 120, ->x : CharacterCodes - - y = 121, ->y : CharacterCodes - - z = 122, ->z : CharacterCodes - - A = 65, ->A : CharacterCodes - - B = 66, ->B : CharacterCodes - - C = 67, ->C : CharacterCodes - - D = 68, ->D : CharacterCodes - - E = 69, ->E : CharacterCodes - - F = 70, ->F : CharacterCodes - - G = 71, ->G : CharacterCodes - - H = 72, ->H : CharacterCodes - - I = 73, ->I : CharacterCodes - - J = 74, ->J : CharacterCodes - - K = 75, ->K : CharacterCodes - - L = 76, ->L : CharacterCodes - - M = 77, ->M : CharacterCodes - - N = 78, ->N : CharacterCodes - - O = 79, ->O : CharacterCodes - - P = 80, ->P : CharacterCodes - - Q = 81, ->Q : CharacterCodes - - R = 82, ->R : CharacterCodes - - S = 83, ->S : CharacterCodes - - T = 84, ->T : CharacterCodes - - U = 85, ->U : CharacterCodes - - V = 86, ->V : CharacterCodes - - W = 87, ->W : CharacterCodes - - X = 88, ->X : CharacterCodes - - Y = 89, ->Y : CharacterCodes - - Z = 90, ->Z : CharacterCodes - - ampersand = 38, ->ampersand : CharacterCodes - - asterisk = 42, ->asterisk : CharacterCodes - - at = 64, ->at : CharacterCodes - - backslash = 92, ->backslash : CharacterCodes - - backtick = 96, ->backtick : CharacterCodes - - bar = 124, ->bar : CharacterCodes - - caret = 94, ->caret : CharacterCodes - - closeBrace = 125, ->closeBrace : CharacterCodes - - closeBracket = 93, ->closeBracket : CharacterCodes - - closeParen = 41, ->closeParen : CharacterCodes - - colon = 58, ->colon : CharacterCodes - - comma = 44, ->comma : CharacterCodes - - dot = 46, ->dot : CharacterCodes - - doubleQuote = 34, ->doubleQuote : CharacterCodes - - equals = 61, ->equals : CharacterCodes - - exclamation = 33, ->exclamation : CharacterCodes - - greaterThan = 62, ->greaterThan : CharacterCodes - - hash = 35, ->hash : CharacterCodes - - lessThan = 60, ->lessThan : CharacterCodes - - minus = 45, ->minus : CharacterCodes - - openBrace = 123, ->openBrace : CharacterCodes - - openBracket = 91, ->openBracket : CharacterCodes - - openParen = 40, ->openParen : CharacterCodes - - percent = 37, ->percent : CharacterCodes - - plus = 43, ->plus : CharacterCodes - - question = 63, ->question : CharacterCodes - - semicolon = 59, ->semicolon : CharacterCodes - - singleQuote = 39, ->singleQuote : CharacterCodes - - slash = 47, ->slash : CharacterCodes - - tilde = 126, ->tilde : CharacterCodes - - backspace = 8, ->backspace : CharacterCodes - - formFeed = 12, ->formFeed : CharacterCodes - - byteOrderMark = 65279, ->byteOrderMark : CharacterCodes - - tab = 9, ->tab : CharacterCodes - - verticalTab = 11, ->verticalTab : CharacterCodes - } - interface CancellationToken { ->CancellationToken : CancellationToken - - isCancellationRequested(): boolean; ->isCancellationRequested : () => boolean - } - interface CompilerHost { ->CompilerHost : CompilerHost - - getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile; ->getSourceFile : (fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void) => SourceFile ->fileName : string ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget ->onError : (message: string) => void ->message : string ->SourceFile : SourceFile - - getDefaultLibFileName(options: CompilerOptions): string; ->getDefaultLibFileName : (options: CompilerOptions) => string ->options : CompilerOptions ->CompilerOptions : CompilerOptions - - getCancellationToken?(): CancellationToken; ->getCancellationToken : () => CancellationToken ->CancellationToken : CancellationToken - - writeFile: WriteFileCallback; ->writeFile : WriteFileCallback ->WriteFileCallback : WriteFileCallback - - getCurrentDirectory(): string; ->getCurrentDirectory : () => string - - getCanonicalFileName(fileName: string): string; ->getCanonicalFileName : (fileName: string) => string ->fileName : string - - useCaseSensitiveFileNames(): boolean; ->useCaseSensitiveFileNames : () => boolean - - getNewLine(): string; ->getNewLine : () => string - } - interface TextSpan { ->TextSpan : TextSpan - - start: number; ->start : number - - length: number; ->length : number - } - interface TextChangeRange { ->TextChangeRange : TextChangeRange - - span: TextSpan; ->span : TextSpan ->TextSpan : TextSpan - - newLength: number; ->newLength : number - } -} -declare module "typescript" { - interface ErrorCallback { ->ErrorCallback : ErrorCallback - - (message: DiagnosticMessage, length: number): void; ->message : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage ->length : number - } - interface Scanner { ->Scanner : Scanner - - getStartPos(): number; ->getStartPos : () => number - - getToken(): SyntaxKind; ->getToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - getTextPos(): number; ->getTextPos : () => number - - getTokenPos(): number; ->getTokenPos : () => number - - getTokenText(): string; ->getTokenText : () => string - - getTokenValue(): string; ->getTokenValue : () => string - - hasExtendedUnicodeEscape(): boolean; ->hasExtendedUnicodeEscape : () => boolean - - hasPrecedingLineBreak(): boolean; ->hasPrecedingLineBreak : () => boolean - - isIdentifier(): boolean; ->isIdentifier : () => boolean - - isReservedWord(): boolean; ->isReservedWord : () => boolean - - isUnterminated(): boolean; ->isUnterminated : () => boolean - - reScanGreaterToken(): SyntaxKind; ->reScanGreaterToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - reScanSlashToken(): SyntaxKind; ->reScanSlashToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - reScanTemplateToken(): SyntaxKind; ->reScanTemplateToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - scan(): SyntaxKind; ->scan : () => SyntaxKind ->SyntaxKind : SyntaxKind - - setText(text: string): void; ->setText : (text: string) => void ->text : string - - setTextPos(textPos: number): void; ->setTextPos : (textPos: number) => void ->textPos : number - - lookAhead(callback: () => T): T; ->lookAhead : (callback: () => T) => T ->T : T ->callback : () => T ->T : T ->T : T - - tryScan(callback: () => T): T; ->tryScan : (callback: () => T) => T ->T : T ->callback : () => T ->T : T ->T : T - } - function tokenToString(t: SyntaxKind): string; ->tokenToString : (t: SyntaxKind) => string ->t : SyntaxKind ->SyntaxKind : SyntaxKind - - function computeLineStarts(text: string): number[]; ->computeLineStarts : (text: string) => number[] ->text : string - - function getPositionOfLineAndCharacter(sourceFile: SourceFile, line: number, character: number): number; ->getPositionOfLineAndCharacter : (sourceFile: SourceFile, line: number, character: number) => number ->sourceFile : SourceFile ->SourceFile : SourceFile ->line : number ->character : number - - function computePositionOfLineAndCharacter(lineStarts: number[], line: number, character: number): number; ->computePositionOfLineAndCharacter : (lineStarts: number[], line: number, character: number) => number ->lineStarts : number[] ->line : number ->character : number - - function getLineStarts(sourceFile: SourceFile): number[]; ->getLineStarts : (sourceFile: SourceFile) => number[] ->sourceFile : SourceFile ->SourceFile : SourceFile - - function computeLineAndCharacterOfPosition(lineStarts: number[], position: number): { ->computeLineAndCharacterOfPosition : (lineStarts: number[], position: number) => { line: number; character: number; } ->lineStarts : number[] ->position : number - - line: number; ->line : number - - character: number; ->character : number - - }; - function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter; ->getLineAndCharacterOfPosition : (sourceFile: SourceFile, position: number) => LineAndCharacter ->sourceFile : SourceFile ->SourceFile : SourceFile ->position : number ->LineAndCharacter : LineAndCharacter - - function isWhiteSpace(ch: number): boolean; ->isWhiteSpace : (ch: number) => boolean ->ch : number - - function isLineBreak(ch: number): boolean; ->isLineBreak : (ch: number) => boolean ->ch : number - - function isOctalDigit(ch: number): boolean; ->isOctalDigit : (ch: number) => boolean ->ch : number - - function skipTrivia(text: string, pos: number, stopAfterLineBreak?: boolean): number; ->skipTrivia : (text: string, pos: number, stopAfterLineBreak?: boolean) => number ->text : string ->pos : number ->stopAfterLineBreak : boolean - - function getLeadingCommentRanges(text: string, pos: number): CommentRange[]; ->getLeadingCommentRanges : (text: string, pos: number) => CommentRange[] ->text : string ->pos : number ->CommentRange : CommentRange - - function getTrailingCommentRanges(text: string, pos: number): CommentRange[]; ->getTrailingCommentRanges : (text: string, pos: number) => CommentRange[] ->text : string ->pos : number ->CommentRange : CommentRange - - function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean; ->isIdentifierStart : (ch: number, languageVersion: ScriptTarget) => boolean ->ch : number ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget - - function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean; ->isIdentifierPart : (ch: number, languageVersion: ScriptTarget) => boolean ->ch : number ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget - - function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback): Scanner; ->createScanner : (languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback) => Scanner ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget ->skipTrivia : boolean ->text : string ->onError : ErrorCallback ->ErrorCallback : ErrorCallback ->Scanner : Scanner -} -declare module "typescript" { - function getNodeConstructor(kind: SyntaxKind): new () => Node; ->getNodeConstructor : (kind: SyntaxKind) => new () => Node ->kind : SyntaxKind ->SyntaxKind : SyntaxKind ->Node : Node - - function createNode(kind: SyntaxKind): Node; ->createNode : (kind: SyntaxKind) => Node ->kind : SyntaxKind ->SyntaxKind : SyntaxKind ->Node : Node - - function forEachChild(node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; ->forEachChild : (node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T) => T ->T : T ->node : Node ->Node : Node ->cbNode : (node: Node) => T ->node : Node ->Node : Node ->T : T ->cbNodeArray : (nodes: Node[]) => T ->nodes : Node[] ->Node : Node ->T : T ->T : T - - function modifierToFlag(token: SyntaxKind): NodeFlags; ->modifierToFlag : (token: SyntaxKind) => NodeFlags ->token : SyntaxKind ->SyntaxKind : SyntaxKind ->NodeFlags : NodeFlags - - function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; ->updateSourceFile : (sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean) => SourceFile ->sourceFile : SourceFile ->SourceFile : SourceFile ->newText : string ->textChangeRange : TextChangeRange ->TextChangeRange : TextChangeRange ->aggressiveChecks : boolean ->SourceFile : SourceFile - - function isEvalOrArgumentsIdentifier(node: Node): boolean; ->isEvalOrArgumentsIdentifier : (node: Node) => boolean ->node : Node ->Node : Node - - function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean): SourceFile; ->createSourceFile : (fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean) => SourceFile ->fileName : string ->sourceText : string ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget ->setParentNodes : boolean ->SourceFile : SourceFile - - function isLeftHandSideExpression(expr: Expression): boolean; ->isLeftHandSideExpression : (expr: Expression) => boolean ->expr : Expression ->Expression : Expression - - function isAssignmentOperator(token: SyntaxKind): boolean; ->isAssignmentOperator : (token: SyntaxKind) => boolean ->token : SyntaxKind ->SyntaxKind : SyntaxKind -} -declare module "typescript" { - function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker; ->createTypeChecker : (host: TypeCheckerHost, produceDiagnostics: boolean) => TypeChecker ->host : TypeCheckerHost ->TypeCheckerHost : TypeCheckerHost ->produceDiagnostics : boolean ->TypeChecker : TypeChecker -} -declare module "typescript" { - /** The version of the TypeScript compiler release */ - let version: string; ->version : string - - function findConfigFile(searchPath: string): string; ->findConfigFile : (searchPath: string) => string ->searchPath : string - - function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; ->createCompilerHost : (options: CompilerOptions, setParentNodes?: boolean) => CompilerHost ->options : CompilerOptions ->CompilerOptions : CompilerOptions ->setParentNodes : boolean ->CompilerHost : CompilerHost - - function getPreEmitDiagnostics(program: Program): Diagnostic[]; ->getPreEmitDiagnostics : (program: Program) => Diagnostic[] ->program : Program ->Program : Program ->Diagnostic : Diagnostic - - function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; ->flattenDiagnosticMessageText : (messageText: string | DiagnosticMessageChain, newLine: string) => string ->messageText : string | DiagnosticMessageChain ->DiagnosticMessageChain : DiagnosticMessageChain ->newLine : string - - function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; ->createProgram : (rootNames: string[], options: CompilerOptions, host?: CompilerHost) => Program ->rootNames : string[] ->options : CompilerOptions ->CompilerOptions : CompilerOptions ->host : CompilerHost ->CompilerHost : CompilerHost ->Program : Program -} -declare module "typescript" { - /** The version of the language service API */ - let servicesVersion: string; ->servicesVersion : string - - interface Node { ->Node : Node - - getSourceFile(): SourceFile; ->getSourceFile : () => SourceFile ->SourceFile : SourceFile - - getChildCount(sourceFile?: SourceFile): number; ->getChildCount : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getChildAt(index: number, sourceFile?: SourceFile): Node; ->getChildAt : (index: number, sourceFile?: SourceFile) => Node ->index : number ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - - getChildren(sourceFile?: SourceFile): Node[]; ->getChildren : (sourceFile?: SourceFile) => Node[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - - getStart(sourceFile?: SourceFile): number; ->getStart : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFullStart(): number; ->getFullStart : () => number - - getEnd(): number; ->getEnd : () => number - - getWidth(sourceFile?: SourceFile): number; ->getWidth : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFullWidth(): number; ->getFullWidth : () => number - - getLeadingTriviaWidth(sourceFile?: SourceFile): number; ->getLeadingTriviaWidth : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFullText(sourceFile?: SourceFile): string; ->getFullText : (sourceFile?: SourceFile) => string ->sourceFile : SourceFile ->SourceFile : SourceFile - - getText(sourceFile?: SourceFile): string; ->getText : (sourceFile?: SourceFile) => string ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFirstToken(sourceFile?: SourceFile): Node; ->getFirstToken : (sourceFile?: SourceFile) => Node ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - - getLastToken(sourceFile?: SourceFile): Node; ->getLastToken : (sourceFile?: SourceFile) => Node ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - } - interface Symbol { ->Symbol : Symbol - - getFlags(): SymbolFlags; ->getFlags : () => SymbolFlags ->SymbolFlags : SymbolFlags - - getName(): string; ->getName : () => string - - getDeclarations(): Declaration[]; ->getDeclarations : () => Declaration[] ->Declaration : Declaration - - getDocumentationComment(): SymbolDisplayPart[]; ->getDocumentationComment : () => SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface Type { ->Type : Type - - getFlags(): TypeFlags; ->getFlags : () => TypeFlags ->TypeFlags : TypeFlags - - getSymbol(): Symbol; ->getSymbol : () => Symbol ->Symbol : Symbol - - getProperties(): Symbol[]; ->getProperties : () => Symbol[] ->Symbol : Symbol - - getProperty(propertyName: string): Symbol; ->getProperty : (propertyName: string) => Symbol ->propertyName : string ->Symbol : Symbol - - getApparentProperties(): Symbol[]; ->getApparentProperties : () => Symbol[] ->Symbol : Symbol - - getCallSignatures(): Signature[]; ->getCallSignatures : () => Signature[] ->Signature : Signature - - getConstructSignatures(): Signature[]; ->getConstructSignatures : () => Signature[] ->Signature : Signature - - getStringIndexType(): Type; ->getStringIndexType : () => Type ->Type : Type - - getNumberIndexType(): Type; ->getNumberIndexType : () => Type ->Type : Type - } - interface Signature { ->Signature : Signature - - getDeclaration(): SignatureDeclaration; ->getDeclaration : () => SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration - - getTypeParameters(): Type[]; ->getTypeParameters : () => Type[] ->Type : Type - - getParameters(): Symbol[]; ->getParameters : () => Symbol[] ->Symbol : Symbol - - getReturnType(): Type; ->getReturnType : () => Type ->Type : Type - - getDocumentationComment(): SymbolDisplayPart[]; ->getDocumentationComment : () => SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface SourceFile { ->SourceFile : SourceFile - - getNamedDeclarations(): Declaration[]; ->getNamedDeclarations : () => Declaration[] ->Declaration : Declaration - - getLineAndCharacterOfPosition(pos: number): LineAndCharacter; ->getLineAndCharacterOfPosition : (pos: number) => LineAndCharacter ->pos : number ->LineAndCharacter : LineAndCharacter - - getLineStarts(): number[]; ->getLineStarts : () => number[] - - getPositionOfLineAndCharacter(line: number, character: number): number; ->getPositionOfLineAndCharacter : (line: number, character: number) => number ->line : number ->character : number - - update(newText: string, textChangeRange: TextChangeRange): SourceFile; ->update : (newText: string, textChangeRange: TextChangeRange) => SourceFile ->newText : string ->textChangeRange : TextChangeRange ->TextChangeRange : TextChangeRange ->SourceFile : SourceFile - } - /** - * Represents an immutable snapshot of a script at a specified time.Once acquired, the - * snapshot is observably immutable. i.e. the same calls with the same parameters will return - * the same values. - */ - interface IScriptSnapshot { ->IScriptSnapshot : IScriptSnapshot - - /** Gets a portion of the script snapshot specified by [start, end). */ - getText(start: number, end: number): string; ->getText : (start: number, end: number) => string ->start : number ->end : number - - /** Gets the length of this script snapshot. */ - getLength(): number; ->getLength : () => number - - /** - * Gets the TextChangeRange that describe how the text changed between this text and - * an older version. This information is used by the incremental parser to determine - * what sections of the script need to be re-parsed. 'undefined' can be returned if the - * change range cannot be determined. However, in that case, incremental parsing will - * not happen and the entire document will be re - parsed. - */ - getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange; ->getChangeRange : (oldSnapshot: IScriptSnapshot) => TextChangeRange ->oldSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->TextChangeRange : TextChangeRange - } - module ScriptSnapshot { ->ScriptSnapshot : typeof ScriptSnapshot - - function fromString(text: string): IScriptSnapshot; ->fromString : (text: string) => IScriptSnapshot ->text : string ->IScriptSnapshot : IScriptSnapshot - } - interface PreProcessedFileInfo { ->PreProcessedFileInfo : PreProcessedFileInfo - - referencedFiles: FileReference[]; ->referencedFiles : FileReference[] ->FileReference : FileReference - - importedFiles: FileReference[]; ->importedFiles : FileReference[] ->FileReference : FileReference - - isLibFile: boolean; ->isLibFile : boolean - } - interface LanguageServiceHost { ->LanguageServiceHost : LanguageServiceHost - - getCompilationSettings(): CompilerOptions; ->getCompilationSettings : () => CompilerOptions ->CompilerOptions : CompilerOptions - - getNewLine?(): string; ->getNewLine : () => string - - getScriptFileNames(): string[]; ->getScriptFileNames : () => string[] - - getScriptVersion(fileName: string): string; ->getScriptVersion : (fileName: string) => string ->fileName : string - - getScriptSnapshot(fileName: string): IScriptSnapshot; ->getScriptSnapshot : (fileName: string) => IScriptSnapshot ->fileName : string ->IScriptSnapshot : IScriptSnapshot - - getLocalizedDiagnosticMessages?(): any; ->getLocalizedDiagnosticMessages : () => any - - getCancellationToken?(): CancellationToken; ->getCancellationToken : () => CancellationToken ->CancellationToken : CancellationToken - - getCurrentDirectory(): string; ->getCurrentDirectory : () => string - - getDefaultLibFileName(options: CompilerOptions): string; ->getDefaultLibFileName : (options: CompilerOptions) => string ->options : CompilerOptions ->CompilerOptions : CompilerOptions - - log?(s: string): void; ->log : (s: string) => void ->s : string - - trace?(s: string): void; ->trace : (s: string) => void ->s : string - - error?(s: string): void; ->error : (s: string) => void ->s : string - } - interface LanguageService { ->LanguageService : LanguageService - - cleanupSemanticCache(): void; ->cleanupSemanticCache : () => void - - getSyntacticDiagnostics(fileName: string): Diagnostic[]; ->getSyntacticDiagnostics : (fileName: string) => Diagnostic[] ->fileName : string ->Diagnostic : Diagnostic - - getSemanticDiagnostics(fileName: string): Diagnostic[]; ->getSemanticDiagnostics : (fileName: string) => Diagnostic[] ->fileName : string ->Diagnostic : Diagnostic - - getCompilerOptionsDiagnostics(): Diagnostic[]; ->getCompilerOptionsDiagnostics : () => Diagnostic[] ->Diagnostic : Diagnostic - - getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; ->getSyntacticClassifications : (fileName: string, span: TextSpan) => ClassifiedSpan[] ->fileName : string ->span : TextSpan ->TextSpan : TextSpan ->ClassifiedSpan : ClassifiedSpan - - getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; ->getSemanticClassifications : (fileName: string, span: TextSpan) => ClassifiedSpan[] ->fileName : string ->span : TextSpan ->TextSpan : TextSpan ->ClassifiedSpan : ClassifiedSpan - - getCompletionsAtPosition(fileName: string, position: number): CompletionInfo; ->getCompletionsAtPosition : (fileName: string, position: number) => CompletionInfo ->fileName : string ->position : number ->CompletionInfo : CompletionInfo - - getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails; ->getCompletionEntryDetails : (fileName: string, position: number, entryName: string) => CompletionEntryDetails ->fileName : string ->position : number ->entryName : string ->CompletionEntryDetails : CompletionEntryDetails - - getQuickInfoAtPosition(fileName: string, position: number): QuickInfo; ->getQuickInfoAtPosition : (fileName: string, position: number) => QuickInfo ->fileName : string ->position : number ->QuickInfo : QuickInfo - - getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan; ->getNameOrDottedNameSpan : (fileName: string, startPos: number, endPos: number) => TextSpan ->fileName : string ->startPos : number ->endPos : number ->TextSpan : TextSpan - - getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan; ->getBreakpointStatementAtPosition : (fileName: string, position: number) => TextSpan ->fileName : string ->position : number ->TextSpan : TextSpan - - getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems; ->getSignatureHelpItems : (fileName: string, position: number) => SignatureHelpItems ->fileName : string ->position : number ->SignatureHelpItems : SignatureHelpItems - - getRenameInfo(fileName: string, position: number): RenameInfo; ->getRenameInfo : (fileName: string, position: number) => RenameInfo ->fileName : string ->position : number ->RenameInfo : RenameInfo - - findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]; ->findRenameLocations : (fileName: string, position: number, findInStrings: boolean, findInComments: boolean) => RenameLocation[] ->fileName : string ->position : number ->findInStrings : boolean ->findInComments : boolean ->RenameLocation : RenameLocation - - getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; ->getDefinitionAtPosition : (fileName: string, position: number) => DefinitionInfo[] ->fileName : string ->position : number ->DefinitionInfo : DefinitionInfo - - getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; ->getReferencesAtPosition : (fileName: string, position: number) => ReferenceEntry[] ->fileName : string ->position : number ->ReferenceEntry : ReferenceEntry - - getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; ->getOccurrencesAtPosition : (fileName: string, position: number) => ReferenceEntry[] ->fileName : string ->position : number ->ReferenceEntry : ReferenceEntry - - findReferences(fileName: string, position: number): ReferencedSymbol[]; ->findReferences : (fileName: string, position: number) => ReferencedSymbol[] ->fileName : string ->position : number ->ReferencedSymbol : ReferencedSymbol - - getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[]; ->getNavigateToItems : (searchValue: string, maxResultCount?: number) => NavigateToItem[] ->searchValue : string ->maxResultCount : number ->NavigateToItem : NavigateToItem - - getNavigationBarItems(fileName: string): NavigationBarItem[]; ->getNavigationBarItems : (fileName: string) => NavigationBarItem[] ->fileName : string ->NavigationBarItem : NavigationBarItem - - getOutliningSpans(fileName: string): OutliningSpan[]; ->getOutliningSpans : (fileName: string) => OutliningSpan[] ->fileName : string ->OutliningSpan : OutliningSpan - - getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[]; ->getTodoComments : (fileName: string, descriptors: TodoCommentDescriptor[]) => TodoComment[] ->fileName : string ->descriptors : TodoCommentDescriptor[] ->TodoCommentDescriptor : TodoCommentDescriptor ->TodoComment : TodoComment - - getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[]; ->getBraceMatchingAtPosition : (fileName: string, position: number) => TextSpan[] ->fileName : string ->position : number ->TextSpan : TextSpan - - getIndentationAtPosition(fileName: string, position: number, options: EditorOptions): number; ->getIndentationAtPosition : (fileName: string, position: number, options: EditorOptions) => number ->fileName : string ->position : number ->options : EditorOptions ->EditorOptions : EditorOptions - - getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions): TextChange[]; ->getFormattingEditsForRange : (fileName: string, start: number, end: number, options: FormatCodeOptions) => TextChange[] ->fileName : string ->start : number ->end : number ->options : FormatCodeOptions ->FormatCodeOptions : FormatCodeOptions ->TextChange : TextChange - - getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): TextChange[]; ->getFormattingEditsForDocument : (fileName: string, options: FormatCodeOptions) => TextChange[] ->fileName : string ->options : FormatCodeOptions ->FormatCodeOptions : FormatCodeOptions ->TextChange : TextChange - - getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextChange[]; ->getFormattingEditsAfterKeystroke : (fileName: string, position: number, key: string, options: FormatCodeOptions) => TextChange[] ->fileName : string ->position : number ->key : string ->options : FormatCodeOptions ->FormatCodeOptions : FormatCodeOptions ->TextChange : TextChange - - getEmitOutput(fileName: string): EmitOutput; ->getEmitOutput : (fileName: string) => EmitOutput ->fileName : string ->EmitOutput : EmitOutput - - getProgram(): Program; ->getProgram : () => Program ->Program : Program - - getSourceFile(fileName: string): SourceFile; ->getSourceFile : (fileName: string) => SourceFile ->fileName : string ->SourceFile : SourceFile - - dispose(): void; ->dispose : () => void - } - interface ClassifiedSpan { ->ClassifiedSpan : ClassifiedSpan - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - classificationType: string; ->classificationType : string - } - interface NavigationBarItem { ->NavigationBarItem : NavigationBarItem - - text: string; ->text : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - spans: TextSpan[]; ->spans : TextSpan[] ->TextSpan : TextSpan - - childItems: NavigationBarItem[]; ->childItems : NavigationBarItem[] ->NavigationBarItem : NavigationBarItem - - indent: number; ->indent : number - - bolded: boolean; ->bolded : boolean - - grayed: boolean; ->grayed : boolean - } - interface TodoCommentDescriptor { ->TodoCommentDescriptor : TodoCommentDescriptor - - text: string; ->text : string - - priority: number; ->priority : number - } - interface TodoComment { ->TodoComment : TodoComment - - descriptor: TodoCommentDescriptor; ->descriptor : TodoCommentDescriptor ->TodoCommentDescriptor : TodoCommentDescriptor - - message: string; ->message : string - - position: number; ->position : number - } - class TextChange { ->TextChange : TextChange - - span: TextSpan; ->span : TextSpan ->TextSpan : TextSpan - - newText: string; ->newText : string - } - interface RenameLocation { ->RenameLocation : RenameLocation - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - fileName: string; ->fileName : string - } - interface ReferenceEntry { ->ReferenceEntry : ReferenceEntry - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - fileName: string; ->fileName : string - - isWriteAccess: boolean; ->isWriteAccess : boolean - } - interface NavigateToItem { ->NavigateToItem : NavigateToItem - - name: string; ->name : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - matchKind: string; ->matchKind : string - - isCaseSensitive: boolean; ->isCaseSensitive : boolean - - fileName: string; ->fileName : string - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - containerName: string; ->containerName : string - - containerKind: string; ->containerKind : string - } - interface EditorOptions { ->EditorOptions : EditorOptions - - IndentSize: number; ->IndentSize : number - - TabSize: number; ->TabSize : number - - NewLineCharacter: string; ->NewLineCharacter : string - - ConvertTabsToSpaces: boolean; ->ConvertTabsToSpaces : boolean - } - interface FormatCodeOptions extends EditorOptions { ->FormatCodeOptions : FormatCodeOptions ->EditorOptions : EditorOptions - - InsertSpaceAfterCommaDelimiter: boolean; ->InsertSpaceAfterCommaDelimiter : boolean - - InsertSpaceAfterSemicolonInForStatements: boolean; ->InsertSpaceAfterSemicolonInForStatements : boolean - - InsertSpaceBeforeAndAfterBinaryOperators: boolean; ->InsertSpaceBeforeAndAfterBinaryOperators : boolean - - InsertSpaceAfterKeywordsInControlFlowStatements: boolean; ->InsertSpaceAfterKeywordsInControlFlowStatements : boolean - - InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; ->InsertSpaceAfterFunctionKeywordForAnonymousFunctions : boolean - - InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; ->InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis : boolean - - PlaceOpenBraceOnNewLineForFunctions: boolean; ->PlaceOpenBraceOnNewLineForFunctions : boolean - - PlaceOpenBraceOnNewLineForControlBlocks: boolean; ->PlaceOpenBraceOnNewLineForControlBlocks : boolean - - [s: string]: boolean | number | string; ->s : string - } - interface DefinitionInfo { ->DefinitionInfo : DefinitionInfo - - fileName: string; ->fileName : string - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - kind: string; ->kind : string - - name: string; ->name : string - - containerKind: string; ->containerKind : string - - containerName: string; ->containerName : string - } - interface ReferencedSymbol { ->ReferencedSymbol : ReferencedSymbol - - definition: DefinitionInfo; ->definition : DefinitionInfo ->DefinitionInfo : DefinitionInfo - - references: ReferenceEntry[]; ->references : ReferenceEntry[] ->ReferenceEntry : ReferenceEntry - } - enum SymbolDisplayPartKind { ->SymbolDisplayPartKind : SymbolDisplayPartKind - - aliasName = 0, ->aliasName : SymbolDisplayPartKind - - className = 1, ->className : SymbolDisplayPartKind - - enumName = 2, ->enumName : SymbolDisplayPartKind - - fieldName = 3, ->fieldName : SymbolDisplayPartKind - - interfaceName = 4, ->interfaceName : SymbolDisplayPartKind - - keyword = 5, ->keyword : SymbolDisplayPartKind - - lineBreak = 6, ->lineBreak : SymbolDisplayPartKind - - numericLiteral = 7, ->numericLiteral : SymbolDisplayPartKind - - stringLiteral = 8, ->stringLiteral : SymbolDisplayPartKind - - localName = 9, ->localName : SymbolDisplayPartKind - - methodName = 10, ->methodName : SymbolDisplayPartKind - - moduleName = 11, ->moduleName : SymbolDisplayPartKind - - operator = 12, ->operator : SymbolDisplayPartKind - - parameterName = 13, ->parameterName : SymbolDisplayPartKind - - propertyName = 14, ->propertyName : SymbolDisplayPartKind - - punctuation = 15, ->punctuation : SymbolDisplayPartKind - - space = 16, ->space : SymbolDisplayPartKind - - text = 17, ->text : SymbolDisplayPartKind - - typeParameterName = 18, ->typeParameterName : SymbolDisplayPartKind - - enumMemberName = 19, ->enumMemberName : SymbolDisplayPartKind - - functionName = 20, ->functionName : SymbolDisplayPartKind - - regularExpressionLiteral = 21, ->regularExpressionLiteral : SymbolDisplayPartKind - } - interface SymbolDisplayPart { ->SymbolDisplayPart : SymbolDisplayPart - - text: string; ->text : string - - kind: string; ->kind : string - } - interface QuickInfo { ->QuickInfo : QuickInfo - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - displayParts: SymbolDisplayPart[]; ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface RenameInfo { ->RenameInfo : RenameInfo - - canRename: boolean; ->canRename : boolean - - localizedErrorMessage: string; ->localizedErrorMessage : string - - displayName: string; ->displayName : string - - fullDisplayName: string; ->fullDisplayName : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - triggerSpan: TextSpan; ->triggerSpan : TextSpan ->TextSpan : TextSpan - } - interface SignatureHelpParameter { ->SignatureHelpParameter : SignatureHelpParameter - - name: string; ->name : string - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - displayParts: SymbolDisplayPart[]; ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - isOptional: boolean; ->isOptional : boolean - } - /** - * Represents a single signature to show in signature help. - * The id is used for subsequent calls into the language service to ask questions about the - * signature help item in the context of any documents that have been updated. i.e. after - * an edit has happened, while signature help is still active, the host can ask important - * questions like 'what parameter is the user currently contained within?'. - */ - interface SignatureHelpItem { ->SignatureHelpItem : SignatureHelpItem - - isVariadic: boolean; ->isVariadic : boolean - - prefixDisplayParts: SymbolDisplayPart[]; ->prefixDisplayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - suffixDisplayParts: SymbolDisplayPart[]; ->suffixDisplayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - separatorDisplayParts: SymbolDisplayPart[]; ->separatorDisplayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - parameters: SignatureHelpParameter[]; ->parameters : SignatureHelpParameter[] ->SignatureHelpParameter : SignatureHelpParameter - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - /** - * Represents a set of signature help items, and the preferred item that should be selected. - */ - interface SignatureHelpItems { ->SignatureHelpItems : SignatureHelpItems - - items: SignatureHelpItem[]; ->items : SignatureHelpItem[] ->SignatureHelpItem : SignatureHelpItem - - applicableSpan: TextSpan; ->applicableSpan : TextSpan ->TextSpan : TextSpan - - selectedItemIndex: number; ->selectedItemIndex : number - - argumentIndex: number; ->argumentIndex : number - - argumentCount: number; ->argumentCount : number - } - interface CompletionInfo { ->CompletionInfo : CompletionInfo - - isMemberCompletion: boolean; ->isMemberCompletion : boolean - - isNewIdentifierLocation: boolean; ->isNewIdentifierLocation : boolean - - entries: CompletionEntry[]; ->entries : CompletionEntry[] ->CompletionEntry : CompletionEntry - } - interface CompletionEntry { ->CompletionEntry : CompletionEntry - - name: string; ->name : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - } - interface CompletionEntryDetails { ->CompletionEntryDetails : CompletionEntryDetails - - name: string; ->name : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - displayParts: SymbolDisplayPart[]; ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface OutliningSpan { ->OutliningSpan : OutliningSpan - - /** The span of the document to actually collapse. */ - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - /** The span of the document to display when the user hovers over the collapsed span. */ - hintSpan: TextSpan; ->hintSpan : TextSpan ->TextSpan : TextSpan - - /** The text to display in the editor for the collapsed region. */ - bannerText: string; ->bannerText : string - - /** - * Whether or not this region should be automatically collapsed when - * the 'Collapse to Definitions' command is invoked. - */ - autoCollapse: boolean; ->autoCollapse : boolean - } - interface EmitOutput { ->EmitOutput : EmitOutput - - outputFiles: OutputFile[]; ->outputFiles : OutputFile[] ->OutputFile : OutputFile - - emitSkipped: boolean; ->emitSkipped : boolean - } - const enum OutputFileType { ->OutputFileType : OutputFileType - - JavaScript = 0, ->JavaScript : OutputFileType - - SourceMap = 1, ->SourceMap : OutputFileType - - Declaration = 2, ->Declaration : OutputFileType - } - interface OutputFile { ->OutputFile : OutputFile - - name: string; ->name : string - - writeByteOrderMark: boolean; ->writeByteOrderMark : boolean - - text: string; ->text : string - } - const enum EndOfLineState { ->EndOfLineState : EndOfLineState - - Start = 0, ->Start : EndOfLineState - - InMultiLineCommentTrivia = 1, ->InMultiLineCommentTrivia : EndOfLineState - - InSingleQuoteStringLiteral = 2, ->InSingleQuoteStringLiteral : EndOfLineState - - InDoubleQuoteStringLiteral = 3, ->InDoubleQuoteStringLiteral : EndOfLineState - - InTemplateHeadOrNoSubstitutionTemplate = 4, ->InTemplateHeadOrNoSubstitutionTemplate : EndOfLineState - - InTemplateMiddleOrTail = 5, ->InTemplateMiddleOrTail : EndOfLineState - - InTemplateSubstitutionPosition = 6, ->InTemplateSubstitutionPosition : EndOfLineState - } - enum TokenClass { ->TokenClass : TokenClass - - Punctuation = 0, ->Punctuation : TokenClass - - Keyword = 1, ->Keyword : TokenClass - - Operator = 2, ->Operator : TokenClass - - Comment = 3, ->Comment : TokenClass - - Whitespace = 4, ->Whitespace : TokenClass - - Identifier = 5, ->Identifier : TokenClass - - NumberLiteral = 6, ->NumberLiteral : TokenClass - - StringLiteral = 7, ->StringLiteral : TokenClass - - RegExpLiteral = 8, ->RegExpLiteral : TokenClass - } - interface ClassificationResult { ->ClassificationResult : ClassificationResult - - finalLexState: EndOfLineState; ->finalLexState : EndOfLineState ->EndOfLineState : EndOfLineState - - entries: ClassificationInfo[]; ->entries : ClassificationInfo[] ->ClassificationInfo : ClassificationInfo - } - interface ClassificationInfo { ->ClassificationInfo : ClassificationInfo - - length: number; ->length : number - - classification: TokenClass; ->classification : TokenClass ->TokenClass : TokenClass - } - interface Classifier { ->Classifier : Classifier - - /** - * Gives lexical classifications of tokens on a line without any syntactic context. - * For instance, a token consisting of the text 'string' can be either an identifier - * named 'string' or the keyword 'string', however, because this classifier is not aware, - * it relies on certain heuristics to give acceptable results. For classifications where - * speed trumps accuracy, this function is preferable; however, for true accuracy, the - * syntactic classifier is ideal. In fact, in certain editing scenarios, combining the - * lexical, syntactic, and semantic classifiers may issue the best user experience. - * - * @param text The text of a line to classify. - * @param lexState The state of the lexical classifier at the end of the previous line. - * @param syntacticClassifierAbsent Whether the client is *not* using a syntactic classifier. - * If there is no syntactic classifier (syntacticClassifierAbsent=true), - * certain heuristics may be used in its place; however, if there is a - * syntactic classifier (syntacticClassifierAbsent=false), certain - * classifications which may be incorrectly categorized will be given - * back as Identifiers in order to allow the syntactic classifier to - * subsume the classification. - */ - getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult; ->getClassificationsForLine : (text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean) => ClassificationResult ->text : string ->lexState : EndOfLineState ->EndOfLineState : EndOfLineState ->syntacticClassifierAbsent : boolean ->ClassificationResult : ClassificationResult - } - /** - * The document registry represents a store of SourceFile objects that can be shared between - * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) - * of files in the context. - * SourceFile objects account for most of the memory usage by the language service. Sharing - * the same DocumentRegistry instance between different instances of LanguageService allow - * for more efficient memory utilization since all projects will share at least the library - * file (lib.d.ts). - * - * A more advanced use of the document registry is to serialize sourceFile objects to disk - * and re-hydrate them when needed. - * - * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it - * to all subsequent createLanguageService calls. - */ - interface DocumentRegistry { ->DocumentRegistry : DocumentRegistry - - /** - * Request a stored SourceFile with a given fileName and compilationSettings. - * The first call to acquire will call createLanguageServiceSourceFile to generate - * the SourceFile if was not found in the registry. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @parm scriptSnapshot Text of the file. Only used if the file was not found - * in the registry and a new one was created. - * @parm version Current version of the file. Only used if the file was not found - * in the registry and a new one was created. - */ - acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; ->acquireDocument : (fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string) => SourceFile ->fileName : string ->compilationSettings : CompilerOptions ->CompilerOptions : CompilerOptions ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->version : string ->SourceFile : SourceFile - - /** - * Request an updated version of an already existing SourceFile with a given fileName - * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile - * to get an updated SourceFile. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @param scriptSnapshot Text of the file. - * @param version Current version of the file. - */ - updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; ->updateDocument : (fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string) => SourceFile ->fileName : string ->compilationSettings : CompilerOptions ->CompilerOptions : CompilerOptions ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->version : string ->SourceFile : SourceFile - - /** - * Informs the DocumentRegistry that a file is not needed any longer. - * - * Note: It is not allowed to call release on a SourceFile that was not acquired from - * this registry originally. - * - * @param fileName The name of the file to be released - * @param compilationSettings The compilation settings used to acquire the file - */ - releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; ->releaseDocument : (fileName: string, compilationSettings: CompilerOptions) => void ->fileName : string ->compilationSettings : CompilerOptions ->CompilerOptions : CompilerOptions - } - class ScriptElementKind { ->ScriptElementKind : ScriptElementKind - - static unknown: string; ->unknown : string - - static keyword: string; ->keyword : string - - static scriptElement: string; ->scriptElement : string - - static moduleElement: string; ->moduleElement : string - - static classElement: string; ->classElement : string - - static interfaceElement: string; ->interfaceElement : string - - static typeElement: string; ->typeElement : string - - static enumElement: string; ->enumElement : string - - static variableElement: string; ->variableElement : string - - static localVariableElement: string; ->localVariableElement : string - - static functionElement: string; ->functionElement : string - - static localFunctionElement: string; ->localFunctionElement : string - - static memberFunctionElement: string; ->memberFunctionElement : string - - static memberGetAccessorElement: string; ->memberGetAccessorElement : string - - static memberSetAccessorElement: string; ->memberSetAccessorElement : string - - static memberVariableElement: string; ->memberVariableElement : string - - static constructorImplementationElement: string; ->constructorImplementationElement : string - - static callSignatureElement: string; ->callSignatureElement : string - - static indexSignatureElement: string; ->indexSignatureElement : string - - static constructSignatureElement: string; ->constructSignatureElement : string - - static parameterElement: string; ->parameterElement : string - - static typeParameterElement: string; ->typeParameterElement : string - - static primitiveType: string; ->primitiveType : string - - static label: string; ->label : string - - static alias: string; ->alias : string - - static constElement: string; ->constElement : string - - static letElement: string; ->letElement : string - } - class ScriptElementKindModifier { ->ScriptElementKindModifier : ScriptElementKindModifier - - static none: string; ->none : string - - static publicMemberModifier: string; ->publicMemberModifier : string - - static privateMemberModifier: string; ->privateMemberModifier : string - - static protectedMemberModifier: string; ->protectedMemberModifier : string - - static exportedModifier: string; ->exportedModifier : string - - static ambientModifier: string; ->ambientModifier : string - - static staticModifier: string; ->staticModifier : string - } - class ClassificationTypeNames { ->ClassificationTypeNames : ClassificationTypeNames - - static comment: string; ->comment : string - - static identifier: string; ->identifier : string - - static keyword: string; ->keyword : string - - static numericLiteral: string; ->numericLiteral : string - - static operator: string; ->operator : string - - static stringLiteral: string; ->stringLiteral : string - - static whiteSpace: string; ->whiteSpace : string - - static text: string; ->text : string - - static punctuation: string; ->punctuation : string - - static className: string; ->className : string - - static enumName: string; ->enumName : string - - static interfaceName: string; ->interfaceName : string - - static moduleName: string; ->moduleName : string - - static typeParameterName: string; ->typeParameterName : string - - static typeAlias: string; ->typeAlias : string - } - interface DisplayPartsSymbolWriter extends SymbolWriter { ->DisplayPartsSymbolWriter : DisplayPartsSymbolWriter ->SymbolWriter : SymbolWriter - - displayParts(): SymbolDisplayPart[]; ->displayParts : () => SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - function displayPartsToString(displayParts: SymbolDisplayPart[]): string; ->displayPartsToString : (displayParts: SymbolDisplayPart[]) => string ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - function getDefaultCompilerOptions(): CompilerOptions; ->getDefaultCompilerOptions : () => CompilerOptions ->CompilerOptions : CompilerOptions - - class OperationCanceledException { ->OperationCanceledException : OperationCanceledException - } - class CancellationTokenObject { ->CancellationTokenObject : CancellationTokenObject - - private cancellationToken; ->cancellationToken : any - - static None: CancellationTokenObject; ->None : CancellationTokenObject ->CancellationTokenObject : CancellationTokenObject - - constructor(cancellationToken: CancellationToken); ->cancellationToken : CancellationToken ->CancellationToken : CancellationToken - - isCancellationRequested(): boolean; ->isCancellationRequested : () => boolean - - throwIfCancellationRequested(): void; ->throwIfCancellationRequested : () => void - } - function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile; ->createLanguageServiceSourceFile : (fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean) => SourceFile ->fileName : string ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->scriptTarget : ScriptTarget ->ScriptTarget : ScriptTarget ->version : string ->setNodeParents : boolean ->SourceFile : SourceFile - - let disableIncrementalParsing: boolean; ->disableIncrementalParsing : boolean - - function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; ->updateLanguageServiceSourceFile : (sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean) => SourceFile ->sourceFile : SourceFile ->SourceFile : SourceFile ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->version : string ->textChangeRange : TextChangeRange ->TextChangeRange : TextChangeRange ->aggressiveChecks : boolean ->SourceFile : SourceFile - - function createDocumentRegistry(): DocumentRegistry; ->createDocumentRegistry : () => DocumentRegistry ->DocumentRegistry : DocumentRegistry - - function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo; ->preProcessFile : (sourceText: string, readImportFiles?: boolean) => PreProcessedFileInfo ->sourceText : string ->readImportFiles : boolean ->PreProcessedFileInfo : PreProcessedFileInfo - - function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; ->createLanguageService : (host: LanguageServiceHost, documentRegistry?: DocumentRegistry) => LanguageService ->host : LanguageServiceHost ->LanguageServiceHost : LanguageServiceHost ->documentRegistry : DocumentRegistry ->DocumentRegistry : DocumentRegistry ->LanguageService : LanguageService - - function createClassifier(): Classifier; ->createClassifier : () => Classifier ->Classifier : Classifier - - /** - * Get the path of the default library file (lib.d.ts) as distributed with the typescript - * node package. - * The functionality is not supported if the ts module is consumed outside of a node module. - */ - function getDefaultLibFilePath(options: CompilerOptions): string; ->getDefaultLibFilePath : (options: CompilerOptions) => string ->options : CompilerOptions ->CompilerOptions : CompilerOptions -} - diff --git a/tests/baselines/reference/APISample_linter.js b/tests/baselines/reference/APISample_linter.js index b57acaf0e9c..17061add038 100644 --- a/tests/baselines/reference/APISample_linter.js +++ b/tests/baselines/reference/APISample_linter.js @@ -1,5 +1,3 @@ -//// [tests/cases/compiler/APISample_linter.ts] //// - //// [APISample_linter.ts] /* @@ -10,9 +8,9 @@ declare var process: any; declare var console: any; -declare var fs: any; +declare var readFileSync: any; -import ts = require("typescript"); +import * as ts from "typescript"; export function delint(sourceFile: ts.SourceFile) { delintNode(sourceFile); @@ -27,21 +25,22 @@ export function delint(sourceFile: ts.SourceFile) { report(node, "A looping statement's contents should be wrapped in a block body."); } break; + case ts.SyntaxKind.IfStatement: - var ifStatement = (node); + let ifStatement = (node); if (ifStatement.thenStatement.kind !== ts.SyntaxKind.Block) { report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body."); } if (ifStatement.elseStatement && - ifStatement.elseStatement.kind !== ts.SyntaxKind.Block && ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement) { + ifStatement.elseStatement.kind !== ts.SyntaxKind.Block && + ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement) { report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body."); } break; case ts.SyntaxKind.BinaryExpression: - var op = (node).operatorToken.kind; - - if (op === ts.SyntaxKind.EqualsEqualsToken || op === ts.SyntaxKind.ExclamationEqualsToken) { + let op = (node).operatorToken.kind; + if (op === ts.SyntaxKind.EqualsEqualsToken || op == ts.SyntaxKind.ExclamationEqualsToken) { report(node, "Use '===' and '!=='.") } break; @@ -51,1985 +50,19 @@ export function delint(sourceFile: ts.SourceFile) { } function report(node: ts.Node, message: string) { - var lineChar = sourceFile.getLineAndCharacterOfPosition(node.getStart()); - console.log(`${sourceFile.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${message}`) + let { line, character } = sourceFile.getLineAndCharacterOfPosition(node.getStart()); + console.log(`${sourceFile.fileName} (${line + 1},${character + 1}): ${message}`); } } -var fileNames = process.argv.slice(2); +const fileNames = process.argv.slice(2); fileNames.forEach(fileName => { // Parse a file - var sourceFile = ts.createSourceFile(fileName, fs.readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); + let sourceFile = ts.createSourceFile(fileName, readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); // delint it delint(sourceFile); -}); - -//// [typescript.d.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 http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -declare module "typescript" { - interface Map { - [index: string]: T; - } - interface TextRange { - pos: number; - end: number; - } - const enum SyntaxKind { - Unknown = 0, - EndOfFileToken = 1, - SingleLineCommentTrivia = 2, - MultiLineCommentTrivia = 3, - NewLineTrivia = 4, - WhitespaceTrivia = 5, - ConflictMarkerTrivia = 6, - NumericLiteral = 7, - StringLiteral = 8, - RegularExpressionLiteral = 9, - NoSubstitutionTemplateLiteral = 10, - TemplateHead = 11, - TemplateMiddle = 12, - TemplateTail = 13, - OpenBraceToken = 14, - CloseBraceToken = 15, - OpenParenToken = 16, - CloseParenToken = 17, - OpenBracketToken = 18, - CloseBracketToken = 19, - DotToken = 20, - DotDotDotToken = 21, - SemicolonToken = 22, - CommaToken = 23, - LessThanToken = 24, - GreaterThanToken = 25, - LessThanEqualsToken = 26, - GreaterThanEqualsToken = 27, - EqualsEqualsToken = 28, - ExclamationEqualsToken = 29, - EqualsEqualsEqualsToken = 30, - ExclamationEqualsEqualsToken = 31, - EqualsGreaterThanToken = 32, - PlusToken = 33, - MinusToken = 34, - AsteriskToken = 35, - SlashToken = 36, - PercentToken = 37, - PlusPlusToken = 38, - MinusMinusToken = 39, - LessThanLessThanToken = 40, - GreaterThanGreaterThanToken = 41, - GreaterThanGreaterThanGreaterThanToken = 42, - AmpersandToken = 43, - BarToken = 44, - CaretToken = 45, - ExclamationToken = 46, - TildeToken = 47, - AmpersandAmpersandToken = 48, - BarBarToken = 49, - QuestionToken = 50, - ColonToken = 51, - AtToken = 52, - EqualsToken = 53, - PlusEqualsToken = 54, - MinusEqualsToken = 55, - AsteriskEqualsToken = 56, - SlashEqualsToken = 57, - PercentEqualsToken = 58, - LessThanLessThanEqualsToken = 59, - GreaterThanGreaterThanEqualsToken = 60, - GreaterThanGreaterThanGreaterThanEqualsToken = 61, - AmpersandEqualsToken = 62, - BarEqualsToken = 63, - CaretEqualsToken = 64, - Identifier = 65, - BreakKeyword = 66, - CaseKeyword = 67, - CatchKeyword = 68, - ClassKeyword = 69, - ConstKeyword = 70, - ContinueKeyword = 71, - DebuggerKeyword = 72, - DefaultKeyword = 73, - DeleteKeyword = 74, - DoKeyword = 75, - ElseKeyword = 76, - EnumKeyword = 77, - ExportKeyword = 78, - ExtendsKeyword = 79, - FalseKeyword = 80, - FinallyKeyword = 81, - ForKeyword = 82, - FunctionKeyword = 83, - IfKeyword = 84, - ImportKeyword = 85, - InKeyword = 86, - InstanceOfKeyword = 87, - NewKeyword = 88, - NullKeyword = 89, - ReturnKeyword = 90, - SuperKeyword = 91, - SwitchKeyword = 92, - ThisKeyword = 93, - ThrowKeyword = 94, - TrueKeyword = 95, - TryKeyword = 96, - TypeOfKeyword = 97, - VarKeyword = 98, - VoidKeyword = 99, - WhileKeyword = 100, - WithKeyword = 101, - AsKeyword = 102, - ImplementsKeyword = 103, - InterfaceKeyword = 104, - LetKeyword = 105, - PackageKeyword = 106, - PrivateKeyword = 107, - ProtectedKeyword = 108, - PublicKeyword = 109, - StaticKeyword = 110, - YieldKeyword = 111, - AnyKeyword = 112, - BooleanKeyword = 113, - ConstructorKeyword = 114, - 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, - OmittedExpression = 174, - TemplateSpan = 175, - Block = 176, - VariableStatement = 177, - EmptyStatement = 178, - ExpressionStatement = 179, - IfStatement = 180, - DoStatement = 181, - WhileStatement = 182, - ForStatement = 183, - ForInStatement = 184, - ForOfStatement = 185, - ContinueStatement = 186, - BreakStatement = 187, - ReturnStatement = 188, - WithStatement = 189, - SwitchStatement = 190, - LabeledStatement = 191, - ThrowStatement = 192, - TryStatement = 193, - DebuggerStatement = 194, - VariableDeclaration = 195, - VariableDeclarationList = 196, - FunctionDeclaration = 197, - ClassDeclaration = 198, - InterfaceDeclaration = 199, - TypeAliasDeclaration = 200, - EnumDeclaration = 201, - ModuleDeclaration = 202, - ModuleBlock = 203, - CaseBlock = 204, - ImportEqualsDeclaration = 205, - ImportDeclaration = 206, - ImportClause = 207, - NamespaceImport = 208, - NamedImports = 209, - ImportSpecifier = 210, - ExportAssignment = 211, - ExportDeclaration = 212, - NamedExports = 213, - ExportSpecifier = 214, - MissingDeclaration = 215, - ExternalModuleReference = 216, - CaseClause = 217, - DefaultClause = 218, - HeritageClause = 219, - CatchClause = 220, - PropertyAssignment = 221, - ShorthandPropertyAssignment = 222, - EnumMember = 223, - SourceFile = 224, - SyntaxList = 225, - Count = 226, - FirstAssignment = 53, - LastAssignment = 64, - FirstReservedWord = 66, - LastReservedWord = 101, - FirstKeyword = 66, - LastKeyword = 125, - FirstFutureReservedWord = 103, - LastFutureReservedWord = 111, - FirstTypeNode = 141, - LastTypeNode = 149, - FirstPunctuation = 14, - LastPunctuation = 64, - FirstToken = 0, - LastToken = 125, - FirstTriviaToken = 2, - LastTriviaToken = 6, - FirstLiteralToken = 7, - LastLiteralToken = 10, - FirstTemplateToken = 10, - LastTemplateToken = 13, - FirstBinaryOperator = 24, - LastBinaryOperator = 64, - FirstNode = 126, - } - const enum NodeFlags { - Export = 1, - Ambient = 2, - Public = 16, - Private = 32, - Protected = 64, - Static = 128, - Default = 256, - MultiLine = 512, - Synthetic = 1024, - DeclarationFile = 2048, - Let = 4096, - Const = 8192, - OctalLiteral = 16384, - ExportContext = 32768, - Modifier = 499, - AccessibilityModifier = 112, - BlockScoped = 12288, - } - const enum ParserContextFlags { - StrictMode = 1, - DisallowIn = 2, - Yield = 4, - GeneratorParameter = 8, - Decorator = 16, - ThisNodeHasError = 32, - ParserGeneratedFlags = 63, - ThisNodeOrAnySubNodesHasError = 64, - HasAggregatedChildData = 128, - } - const enum RelationComparisonResult { - Succeeded = 1, - Failed = 2, - FailedAndReported = 3, - } - interface Node extends TextRange { - kind: SyntaxKind; - flags: NodeFlags; - parserContextFlags?: ParserContextFlags; - decorators?: NodeArray; - modifiers?: ModifiersArray; - id?: number; - parent?: Node; - symbol?: Symbol; - locals?: SymbolTable; - nextContainer?: Node; - localSymbol?: Symbol; - } - interface NodeArray extends Array, TextRange { - hasTrailingComma?: boolean; - } - interface ModifiersArray extends NodeArray { - flags: number; - } - interface Identifier extends PrimaryExpression { - text: string; - } - interface QualifiedName extends Node { - left: EntityName; - right: Identifier; - } - type EntityName = Identifier | QualifiedName; - type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName | BindingPattern; - interface Declaration extends Node { - _declarationBrand: any; - name?: DeclarationName; - } - interface ComputedPropertyName extends Node { - expression: Expression; - } - interface Decorator extends Node { - expression: LeftHandSideExpression; - } - interface TypeParameterDeclaration extends Declaration { - name: Identifier; - constraint?: TypeNode; - expression?: Expression; - } - interface SignatureDeclaration extends Declaration { - typeParameters?: NodeArray; - parameters: NodeArray; - type?: TypeNode; - } - interface VariableDeclaration extends Declaration { - parent?: VariableDeclarationList; - name: Identifier | BindingPattern; - type?: TypeNode; - initializer?: Expression; - } - interface VariableDeclarationList extends Node { - declarations: NodeArray; - } - interface ParameterDeclaration extends Declaration { - dotDotDotToken?: Node; - name: Identifier | BindingPattern; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface BindingElement extends Declaration { - propertyName?: Identifier; - dotDotDotToken?: Node; - name: Identifier | BindingPattern; - initializer?: Expression; - } - interface PropertyDeclaration extends Declaration, ClassElement { - name: DeclarationName; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface ObjectLiteralElement extends Declaration { - _objectLiteralBrandBrand: any; - } - interface PropertyAssignment extends ObjectLiteralElement { - _propertyAssignmentBrand: any; - name: DeclarationName; - questionToken?: Node; - initializer: Expression; - } - interface ShorthandPropertyAssignment extends ObjectLiteralElement { - name: Identifier; - questionToken?: Node; - } - interface VariableLikeDeclaration extends Declaration { - propertyName?: Identifier; - dotDotDotToken?: Node; - name: DeclarationName; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface BindingPattern extends Node { - elements: NodeArray; - } - /** - * Several node kinds share function-like features such as a signature, - * a name, and a body. These nodes should extend FunctionLikeDeclaration. - * Examples: - * FunctionDeclaration - * MethodDeclaration - * AccessorDeclaration - */ - interface FunctionLikeDeclaration extends SignatureDeclaration { - _functionLikeDeclarationBrand: any; - asteriskToken?: Node; - questionToken?: Node; - body?: Block | Expression; - } - interface FunctionDeclaration extends FunctionLikeDeclaration, Statement { - name?: Identifier; - body?: Block; - } - interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { - body?: Block; - } - interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { - body?: Block; - } - interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { - _accessorDeclarationBrand: any; - body: Block; - } - interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement { - _indexSignatureDeclarationBrand: any; - } - interface TypeNode extends Node { - _typeNodeBrand: any; - } - interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration { - _functionOrConstructorTypeNodeBrand: any; - } - interface TypeReferenceNode extends TypeNode { - typeName: EntityName; - typeArguments?: NodeArray; - } - interface TypeQueryNode extends TypeNode { - exprName: EntityName; - } - interface TypeLiteralNode extends TypeNode, Declaration { - members: NodeArray; - } - interface ArrayTypeNode extends TypeNode { - elementType: TypeNode; - } - interface TupleTypeNode extends TypeNode { - elementTypes: NodeArray; - } - interface UnionTypeNode extends TypeNode { - types: NodeArray; - } - interface ParenthesizedTypeNode extends TypeNode { - type: TypeNode; - } - interface StringLiteralTypeNode extends LiteralExpression, TypeNode { - } - interface Expression extends Node { - _expressionBrand: any; - contextualType?: Type; - } - interface UnaryExpression extends Expression { - _unaryExpressionBrand: any; - } - interface PrefixUnaryExpression extends UnaryExpression { - operator: SyntaxKind; - operand: UnaryExpression; - } - interface PostfixUnaryExpression extends PostfixExpression { - operand: LeftHandSideExpression; - operator: SyntaxKind; - } - interface PostfixExpression extends UnaryExpression { - _postfixExpressionBrand: any; - } - interface LeftHandSideExpression extends PostfixExpression { - _leftHandSideExpressionBrand: any; - } - interface MemberExpression extends LeftHandSideExpression { - _memberExpressionBrand: any; - } - interface PrimaryExpression extends MemberExpression { - _primaryExpressionBrand: any; - } - interface DeleteExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface TypeOfExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface VoidExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface YieldExpression extends Expression { - asteriskToken?: Node; - expression: Expression; - } - interface BinaryExpression extends Expression { - left: Expression; - operatorToken: Node; - right: Expression; - } - interface ConditionalExpression extends Expression { - condition: Expression; - questionToken: Node; - whenTrue: Expression; - colonToken: Node; - whenFalse: Expression; - } - interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration { - name?: Identifier; - body: Block | Expression; - } - interface ArrowFunction extends Expression, FunctionLikeDeclaration { - equalsGreaterThanToken: Node; - } - interface LiteralExpression extends PrimaryExpression { - text: string; - isUnterminated?: boolean; - hasExtendedUnicodeEscape?: boolean; - } - interface StringLiteralExpression extends LiteralExpression { - _stringLiteralExpressionBrand: any; - } - interface TemplateExpression extends PrimaryExpression { - head: LiteralExpression; - templateSpans: NodeArray; - } - interface TemplateSpan extends Node { - expression: Expression; - literal: LiteralExpression; - } - interface ParenthesizedExpression extends PrimaryExpression { - expression: Expression; - } - interface ArrayLiteralExpression extends PrimaryExpression { - elements: NodeArray; - } - interface SpreadElementExpression extends Expression { - expression: Expression; - } - interface ObjectLiteralExpression extends PrimaryExpression, Declaration { - properties: NodeArray; - } - interface PropertyAccessExpression extends MemberExpression { - expression: LeftHandSideExpression; - dotToken: Node; - name: Identifier; - } - interface ElementAccessExpression extends MemberExpression { - expression: LeftHandSideExpression; - argumentExpression?: Expression; - } - interface CallExpression extends LeftHandSideExpression { - expression: LeftHandSideExpression; - typeArguments?: NodeArray; - arguments: NodeArray; - } - interface NewExpression extends CallExpression, PrimaryExpression { - } - interface TaggedTemplateExpression extends MemberExpression { - tag: LeftHandSideExpression; - template: LiteralExpression | TemplateExpression; - } - type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression; - interface TypeAssertion extends UnaryExpression { - type: TypeNode; - expression: UnaryExpression; - } - interface Statement extends Node, ModuleElement { - _statementBrand: any; - } - interface Block extends Statement { - statements: NodeArray; - } - interface VariableStatement extends Statement { - declarationList: VariableDeclarationList; - } - interface ExpressionStatement extends Statement { - expression: Expression; - } - interface IfStatement extends Statement { - expression: Expression; - thenStatement: Statement; - elseStatement?: Statement; - } - interface IterationStatement extends Statement { - statement: Statement; - } - interface DoStatement extends IterationStatement { - expression: Expression; - } - interface WhileStatement extends IterationStatement { - expression: Expression; - } - interface ForStatement extends IterationStatement { - initializer?: VariableDeclarationList | Expression; - condition?: Expression; - iterator?: Expression; - } - interface ForInStatement extends IterationStatement { - initializer: VariableDeclarationList | Expression; - expression: Expression; - } - interface ForOfStatement extends IterationStatement { - initializer: VariableDeclarationList | Expression; - expression: Expression; - } - interface BreakOrContinueStatement extends Statement { - label?: Identifier; - } - interface ReturnStatement extends Statement { - expression?: Expression; - } - interface WithStatement extends Statement { - expression: Expression; - statement: Statement; - } - interface SwitchStatement extends Statement { - expression: Expression; - caseBlock: CaseBlock; - } - interface CaseBlock extends Node { - clauses: NodeArray; - } - interface CaseClause extends Node { - expression?: Expression; - statements: NodeArray; - } - interface DefaultClause extends Node { - statements: NodeArray; - } - type CaseOrDefaultClause = CaseClause | DefaultClause; - interface LabeledStatement extends Statement { - label: Identifier; - statement: Statement; - } - interface ThrowStatement extends Statement { - expression: Expression; - } - interface TryStatement extends Statement { - tryBlock: Block; - catchClause?: CatchClause; - finallyBlock?: Block; - } - interface CatchClause extends Node { - variableDeclaration: VariableDeclaration; - block: Block; - } - interface ModuleElement extends Node { - _moduleElementBrand: any; - } - interface ClassDeclaration extends Declaration, ModuleElement { - name?: Identifier; - typeParameters?: NodeArray; - heritageClauses?: NodeArray; - members: NodeArray; - } - interface ClassElement extends Declaration { - _classElementBrand: any; - } - interface InterfaceDeclaration extends Declaration, ModuleElement { - name: Identifier; - typeParameters?: NodeArray; - heritageClauses?: NodeArray; - members: NodeArray; - } - interface HeritageClause extends Node { - token: SyntaxKind; - types?: NodeArray; - } - interface TypeAliasDeclaration extends Declaration, ModuleElement { - name: Identifier; - type: TypeNode; - } - interface EnumMember extends Declaration { - name: DeclarationName; - initializer?: Expression; - } - interface EnumDeclaration extends Declaration, ModuleElement { - name: Identifier; - members: NodeArray; - } - interface ModuleDeclaration extends Declaration, ModuleElement { - name: Identifier | LiteralExpression; - body: ModuleBlock | ModuleDeclaration; - } - interface ModuleBlock extends Node, ModuleElement { - statements: NodeArray; - } - interface ImportEqualsDeclaration extends Declaration, ModuleElement { - name: Identifier; - moduleReference: EntityName | ExternalModuleReference; - } - interface ExternalModuleReference extends Node { - expression?: Expression; - } - interface ImportDeclaration extends Statement, ModuleElement { - importClause?: ImportClause; - moduleSpecifier: Expression; - } - interface ImportClause extends Declaration { - name?: Identifier; - namedBindings?: NamespaceImport | NamedImports; - } - interface NamespaceImport extends Declaration { - name: Identifier; - } - interface ExportDeclaration extends Declaration, ModuleElement { - exportClause?: NamedExports; - moduleSpecifier?: Expression; - } - interface NamedImportsOrExports extends Node { - elements: NodeArray; - } - type NamedImports = NamedImportsOrExports; - type NamedExports = NamedImportsOrExports; - interface ImportOrExportSpecifier extends Declaration { - propertyName?: Identifier; - name: Identifier; - } - type ImportSpecifier = ImportOrExportSpecifier; - type ExportSpecifier = ImportOrExportSpecifier; - interface ExportAssignment extends Declaration, ModuleElement { - isExportEquals?: boolean; - expression?: Expression; - type?: TypeNode; - } - interface FileReference extends TextRange { - fileName: string; - } - interface CommentRange extends TextRange { - hasTrailingNewLine?: boolean; - } - interface SourceFile extends Declaration { - statements: NodeArray; - endOfFileToken: Node; - fileName: string; - text: string; - amdDependencies: { - path: string; - name: string; - }[]; - amdModuleName: string; - referencedFiles: FileReference[]; - hasNoDefaultLib: boolean; - externalModuleIndicator: Node; - languageVersion: ScriptTarget; - identifiers: Map; - } - interface ScriptReferenceHost { - getCompilerOptions(): CompilerOptions; - getSourceFile(fileName: string): SourceFile; - getCurrentDirectory(): string; - } - interface WriteFileCallback { - (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; - } - interface Program extends ScriptReferenceHost { - getSourceFiles(): SourceFile[]; - /** - * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then - * the JavaScript and declaration files will be produced for all the files in this program. - * If targetSourceFile is specified, then only the JavaScript and declaration for that - * specific file will be generated. - * - * If writeFile is not specified then the writeFile callback from the compiler host will be - * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter - * will be invoked when writing the JavaScript and declaration files. - */ - emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback): EmitResult; - getSyntacticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getGlobalDiagnostics(): Diagnostic[]; - getSemanticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getDeclarationDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getTypeChecker(): TypeChecker; - getCommonSourceDirectory(): string; - } - interface SourceMapSpan { - emittedLine: number; - emittedColumn: number; - sourceLine: number; - sourceColumn: number; - nameIndex?: number; - sourceIndex: number; - } - interface SourceMapData { - sourceMapFilePath: string; - jsSourceMappingURL: string; - sourceMapFile: string; - sourceMapSourceRoot: string; - sourceMapSources: string[]; - inputSourceFileNames: string[]; - sourceMapNames?: string[]; - sourceMapMappings: string; - sourceMapDecodedMappings: SourceMapSpan[]; - } - enum ExitStatus { - Success = 0, - DiagnosticsPresent_OutputsSkipped = 1, - DiagnosticsPresent_OutputsGenerated = 2, - } - interface EmitResult { - emitSkipped: boolean; - diagnostics: Diagnostic[]; - sourceMaps: SourceMapData[]; - } - interface TypeCheckerHost { - getCompilerOptions(): CompilerOptions; - getSourceFiles(): SourceFile[]; - getSourceFile(fileName: string): SourceFile; - } - interface TypeChecker { - getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; - getDeclaredTypeOfSymbol(symbol: Symbol): Type; - getPropertiesOfType(type: Type): Symbol[]; - getPropertyOfType(type: Type, propertyName: string): Symbol; - getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; - getIndexTypeOfType(type: Type, kind: IndexKind): Type; - getReturnTypeOfSignature(signature: Signature): Type; - getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; - getSymbolAtLocation(node: Node): Symbol; - getShorthandAssignmentValueSymbol(location: Node): Symbol; - getTypeAtLocation(node: Node): Type; - typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; - symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; - getSymbolDisplayBuilder(): SymbolDisplayBuilder; - getFullyQualifiedName(symbol: Symbol): string; - getAugmentedPropertiesOfType(type: Type): Symbol[]; - getRootSymbols(symbol: Symbol): Symbol[]; - getContextualType(node: Expression): Type; - getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature; - getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature; - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; - isUndefinedSymbol(symbol: Symbol): boolean; - isArgumentsSymbol(symbol: Symbol): boolean; - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; - isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; - getAliasedSymbol(symbol: Symbol): Symbol; - getExportsOfExternalModule(node: ImportDeclaration): Symbol[]; - } - interface SymbolDisplayBuilder { - buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; - buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags): void; - buildDisplayForParametersAndDelimiters(parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - } - interface SymbolWriter { - writeKeyword(text: string): void; - writeOperator(text: string): void; - writePunctuation(text: string): void; - writeSpace(text: string): void; - writeStringLiteral(text: string): void; - writeParameter(text: string): void; - writeSymbol(text: string, symbol: Symbol): void; - writeLine(): void; - increaseIndent(): void; - decreaseIndent(): void; - clear(): void; - trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; - } - const enum TypeFormatFlags { - None = 0, - WriteArrayAsGenericType = 1, - UseTypeOfFunction = 2, - NoTruncation = 4, - WriteArrowStyleSignature = 8, - WriteOwnNameForAnyLike = 16, - WriteTypeArgumentsOfSignature = 32, - InElementType = 64, - UseFullyQualifiedType = 128, - } - const enum SymbolFormatFlags { - None = 0, - WriteTypeParametersOrArguments = 1, - UseOnlyExternalAliasing = 2, - } - const enum SymbolAccessibility { - Accessible = 0, - NotAccessible = 1, - CannotBeNamed = 2, - } - type AnyImportSyntax = ImportDeclaration | ImportEqualsDeclaration; - interface SymbolVisibilityResult { - accessibility: SymbolAccessibility; - aliasesToMakeVisible?: AnyImportSyntax[]; - errorSymbolName?: string; - errorNode?: Node; - } - interface SymbolAccessiblityResult extends SymbolVisibilityResult { - errorModuleName?: string; - } - interface EmitResolver { - hasGlobalName(name: string): boolean; - getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string; - isValueAliasDeclaration(node: Node): boolean; - isReferencedAliasDeclaration(node: Node, checkChildren?: boolean): boolean; - isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; - getNodeCheckFlags(node: Node): NodeCheckFlags; - isDeclarationVisible(node: Declaration): boolean; - collectLinkedAliases(node: Identifier): Node[]; - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; - writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult; - isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult; - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; - resolvesToSomeValue(location: Node, name: string): boolean; - getBlockScopedVariableId(node: Identifier): number; - } - const enum SymbolFlags { - FunctionScopedVariable = 1, - BlockScopedVariable = 2, - Property = 4, - EnumMember = 8, - Function = 16, - Class = 32, - Interface = 64, - ConstEnum = 128, - RegularEnum = 256, - ValueModule = 512, - NamespaceModule = 1024, - TypeLiteral = 2048, - ObjectLiteral = 4096, - Method = 8192, - Constructor = 16384, - GetAccessor = 32768, - SetAccessor = 65536, - Signature = 131072, - TypeParameter = 262144, - TypeAlias = 524288, - ExportValue = 1048576, - ExportType = 2097152, - ExportNamespace = 4194304, - Alias = 8388608, - Instantiated = 16777216, - Merged = 33554432, - Transient = 67108864, - Prototype = 134217728, - UnionProperty = 268435456, - Optional = 536870912, - ExportStar = 1073741824, - Enum = 384, - Variable = 3, - Value = 107455, - Type = 793056, - Namespace = 1536, - Module = 1536, - Accessor = 98304, - FunctionScopedVariableExcludes = 107454, - BlockScopedVariableExcludes = 107455, - ParameterExcludes = 107455, - PropertyExcludes = 107455, - EnumMemberExcludes = 107455, - FunctionExcludes = 106927, - ClassExcludes = 899583, - InterfaceExcludes = 792992, - RegularEnumExcludes = 899327, - ConstEnumExcludes = 899967, - ValueModuleExcludes = 106639, - NamespaceModuleExcludes = 0, - MethodExcludes = 99263, - GetAccessorExcludes = 41919, - SetAccessorExcludes = 74687, - TypeParameterExcludes = 530912, - TypeAliasExcludes = 793056, - AliasExcludes = 8388608, - ModuleMember = 8914931, - ExportHasLocal = 944, - HasLocals = 255504, - HasExports = 1952, - HasMembers = 6240, - IsContainer = 262128, - PropertyOrAccessor = 98308, - Export = 7340032, - } - interface Symbol { - flags: SymbolFlags; - name: string; - id?: number; - mergeId?: number; - declarations?: Declaration[]; - parent?: Symbol; - members?: SymbolTable; - exports?: SymbolTable; - exportSymbol?: Symbol; - valueDeclaration?: Declaration; - constEnumOnlyModule?: boolean; - } - interface SymbolLinks { - target?: Symbol; - type?: Type; - declaredType?: Type; - mapper?: TypeMapper; - referenced?: boolean; - unionType?: UnionType; - resolvedExports?: SymbolTable; - exportsChecked?: boolean; - } - interface TransientSymbol extends Symbol, SymbolLinks { - } - interface SymbolTable { - [index: string]: Symbol; - } - const enum NodeCheckFlags { - TypeChecked = 1, - LexicalThis = 2, - CaptureThis = 4, - EmitExtends = 8, - SuperInstance = 16, - SuperStatic = 32, - ContextChecked = 64, - EnumValuesComputed = 128, - BlockScopedBindingInLoop = 256, - EmitDecorate = 512, - } - interface NodeLinks { - resolvedType?: Type; - resolvedSignature?: Signature; - resolvedSymbol?: Symbol; - flags?: NodeCheckFlags; - enumMemberValue?: number; - isIllegalTypeReferenceInConstraint?: boolean; - isVisible?: boolean; - generatedName?: string; - generatedNames?: Map; - assignmentChecks?: Map; - hasReportedStatementInAmbientContext?: boolean; - importOnRightSide?: Symbol; - } - const enum TypeFlags { - Any = 1, - String = 2, - Number = 4, - Boolean = 8, - Void = 16, - Undefined = 32, - Null = 64, - Enum = 128, - StringLiteral = 256, - TypeParameter = 512, - Class = 1024, - Interface = 2048, - Reference = 4096, - Tuple = 8192, - Union = 16384, - Anonymous = 32768, - FromSignature = 65536, - ObjectLiteral = 131072, - ContainsUndefinedOrNull = 262144, - ContainsObjectLiteral = 524288, - ESSymbol = 1048576, - Intrinsic = 1048703, - Primitive = 1049086, - StringLike = 258, - NumberLike = 132, - ObjectType = 48128, - RequiresWidening = 786432, - } - interface Type { - flags: TypeFlags; - id: number; - symbol?: Symbol; - } - interface IntrinsicType extends Type { - intrinsicName: string; - } - interface StringLiteralType extends Type { - text: string; - } - interface ObjectType extends Type { - } - interface InterfaceType extends ObjectType { - typeParameters: TypeParameter[]; - baseTypes: ObjectType[]; - declaredProperties: Symbol[]; - declaredCallSignatures: Signature[]; - declaredConstructSignatures: Signature[]; - declaredStringIndexType: Type; - declaredNumberIndexType: Type; - } - interface TypeReference extends ObjectType { - target: GenericType; - typeArguments: Type[]; - } - interface GenericType extends InterfaceType, TypeReference { - instantiations: Map; - } - interface TupleType extends ObjectType { - elementTypes: Type[]; - baseArrayType: TypeReference; - } - interface UnionType extends Type { - types: Type[]; - resolvedProperties: SymbolTable; - } - interface ResolvedType extends ObjectType, UnionType { - members: SymbolTable; - properties: Symbol[]; - callSignatures: Signature[]; - constructSignatures: Signature[]; - stringIndexType: Type; - numberIndexType: Type; - } - interface TypeParameter extends Type { - constraint: Type; - target?: TypeParameter; - mapper?: TypeMapper; - } - const enum SignatureKind { - Call = 0, - Construct = 1, - } - interface Signature { - declaration: SignatureDeclaration; - typeParameters: TypeParameter[]; - parameters: Symbol[]; - resolvedReturnType: Type; - minArgumentCount: number; - hasRestParameter: boolean; - hasStringLiterals: boolean; - target?: Signature; - mapper?: TypeMapper; - unionSignatures?: Signature[]; - erasedSignatureCache?: Signature; - isolatedSignatureType?: ObjectType; - } - const enum IndexKind { - String = 0, - Number = 1, - } - interface TypeMapper { - (t: Type): Type; - } - interface DiagnosticMessage { - key: string; - category: DiagnosticCategory; - code: number; - } - interface DiagnosticMessageChain { - messageText: string; - category: DiagnosticCategory; - code: number; - next?: DiagnosticMessageChain; - } - interface Diagnostic { - file: SourceFile; - start: number; - length: number; - messageText: string | DiagnosticMessageChain; - category: DiagnosticCategory; - code: number; - } - enum DiagnosticCategory { - Warning = 0, - Error = 1, - Message = 2, - } - interface CompilerOptions { - allowNonTsExtensions?: boolean; - charset?: string; - codepage?: number; - declaration?: boolean; - diagnostics?: boolean; - emitBOM?: boolean; - help?: boolean; - listFiles?: boolean; - locale?: string; - mapRoot?: string; - module?: ModuleKind; - noEmit?: boolean; - noEmitOnError?: boolean; - noErrorTruncation?: boolean; - noImplicitAny?: boolean; - noLib?: boolean; - noLibCheck?: boolean; - noResolve?: boolean; - out?: string; - outDir?: string; - preserveConstEnums?: boolean; - project?: string; - removeComments?: boolean; - sourceMap?: boolean; - sourceRoot?: string; - suppressImplicitAnyIndexErrors?: boolean; - target?: ScriptTarget; - version?: boolean; - watch?: boolean; - [option: string]: string | number | boolean; - } - const enum ModuleKind { - None = 0, - CommonJS = 1, - AMD = 2, - } - interface LineAndCharacter { - line: number; - character: number; - } - const enum ScriptTarget { - ES3 = 0, - ES5 = 1, - ES6 = 2, - Latest = 2, - } - interface ParsedCommandLine { - options: CompilerOptions; - fileNames: string[]; - errors: Diagnostic[]; - } - interface CommandLineOption { - name: string; - type: string | Map; - isFilePath?: boolean; - shortName?: string; - description?: DiagnosticMessage; - paramType?: DiagnosticMessage; - error?: DiagnosticMessage; - experimental?: boolean; - } - const enum CharacterCodes { - nullCharacter = 0, - maxAsciiCharacter = 127, - lineFeed = 10, - carriageReturn = 13, - lineSeparator = 8232, - paragraphSeparator = 8233, - nextLine = 133, - space = 32, - nonBreakingSpace = 160, - enQuad = 8192, - emQuad = 8193, - enSpace = 8194, - emSpace = 8195, - threePerEmSpace = 8196, - fourPerEmSpace = 8197, - sixPerEmSpace = 8198, - figureSpace = 8199, - punctuationSpace = 8200, - thinSpace = 8201, - hairSpace = 8202, - zeroWidthSpace = 8203, - narrowNoBreakSpace = 8239, - ideographicSpace = 12288, - mathematicalSpace = 8287, - ogham = 5760, - _ = 95, - $ = 36, - _0 = 48, - _1 = 49, - _2 = 50, - _3 = 51, - _4 = 52, - _5 = 53, - _6 = 54, - _7 = 55, - _8 = 56, - _9 = 57, - a = 97, - b = 98, - c = 99, - d = 100, - e = 101, - f = 102, - g = 103, - h = 104, - i = 105, - j = 106, - k = 107, - l = 108, - m = 109, - n = 110, - o = 111, - p = 112, - q = 113, - r = 114, - s = 115, - t = 116, - u = 117, - v = 118, - w = 119, - x = 120, - y = 121, - z = 122, - A = 65, - B = 66, - C = 67, - D = 68, - E = 69, - F = 70, - G = 71, - H = 72, - I = 73, - J = 74, - K = 75, - L = 76, - M = 77, - N = 78, - O = 79, - P = 80, - Q = 81, - R = 82, - S = 83, - T = 84, - U = 85, - V = 86, - W = 87, - X = 88, - Y = 89, - Z = 90, - ampersand = 38, - asterisk = 42, - at = 64, - backslash = 92, - backtick = 96, - bar = 124, - caret = 94, - closeBrace = 125, - closeBracket = 93, - closeParen = 41, - colon = 58, - comma = 44, - dot = 46, - doubleQuote = 34, - equals = 61, - exclamation = 33, - greaterThan = 62, - hash = 35, - lessThan = 60, - minus = 45, - openBrace = 123, - openBracket = 91, - openParen = 40, - percent = 37, - plus = 43, - question = 63, - semicolon = 59, - singleQuote = 39, - slash = 47, - tilde = 126, - backspace = 8, - formFeed = 12, - byteOrderMark = 65279, - tab = 9, - verticalTab = 11, - } - interface CancellationToken { - isCancellationRequested(): boolean; - } - interface CompilerHost { - getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile; - getDefaultLibFileName(options: CompilerOptions): string; - getCancellationToken?(): CancellationToken; - writeFile: WriteFileCallback; - getCurrentDirectory(): string; - getCanonicalFileName(fileName: string): string; - useCaseSensitiveFileNames(): boolean; - getNewLine(): string; - } - interface TextSpan { - start: number; - length: number; - } - interface TextChangeRange { - span: TextSpan; - newLength: number; - } -} -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): void; - setTextPos(textPos: number): void; - lookAhead(callback: () => T): T; - tryScan(callback: () => T): T; - } - function tokenToString(t: SyntaxKind): string; - function computeLineStarts(text: string): number[]; - function getPositionOfLineAndCharacter(sourceFile: SourceFile, line: number, character: number): number; - function computePositionOfLineAndCharacter(lineStarts: number[], line: number, character: number): number; - function getLineStarts(sourceFile: SourceFile): number[]; - function computeLineAndCharacterOfPosition(lineStarts: number[], position: number): { - line: number; - character: number; - }; - function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter; - function isWhiteSpace(ch: number): boolean; - function isLineBreak(ch: number): boolean; - function isOctalDigit(ch: number): boolean; - function skipTrivia(text: string, pos: number, stopAfterLineBreak?: boolean): number; - function getLeadingCommentRanges(text: string, pos: number): CommentRange[]; - function getTrailingCommentRanges(text: string, pos: number): CommentRange[]; - function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean; - function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean; - function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback): Scanner; -} -declare module "typescript" { - function getNodeConstructor(kind: SyntaxKind): new () => Node; - function createNode(kind: SyntaxKind): Node; - function forEachChild(node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; - function modifierToFlag(token: SyntaxKind): NodeFlags; - function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; - function isEvalOrArgumentsIdentifier(node: Node): boolean; - function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean): SourceFile; - function isLeftHandSideExpression(expr: Expression): boolean; - function isAssignmentOperator(token: SyntaxKind): boolean; -} -declare module "typescript" { - function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker; -} -declare module "typescript" { - /** The version of the TypeScript compiler release */ - let version: string; - function findConfigFile(searchPath: string): string; - function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; - function getPreEmitDiagnostics(program: Program): Diagnostic[]; - function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; - function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; -} -declare module "typescript" { - /** The version of the language service API */ - let servicesVersion: string; - interface Node { - getSourceFile(): SourceFile; - getChildCount(sourceFile?: SourceFile): number; - getChildAt(index: number, sourceFile?: SourceFile): Node; - getChildren(sourceFile?: SourceFile): Node[]; - getStart(sourceFile?: SourceFile): number; - getFullStart(): number; - getEnd(): number; - getWidth(sourceFile?: SourceFile): number; - getFullWidth(): number; - getLeadingTriviaWidth(sourceFile?: SourceFile): number; - getFullText(sourceFile?: SourceFile): string; - getText(sourceFile?: SourceFile): string; - getFirstToken(sourceFile?: SourceFile): Node; - getLastToken(sourceFile?: SourceFile): Node; - } - interface Symbol { - getFlags(): SymbolFlags; - getName(): string; - getDeclarations(): Declaration[]; - getDocumentationComment(): SymbolDisplayPart[]; - } - interface Type { - getFlags(): TypeFlags; - getSymbol(): Symbol; - getProperties(): Symbol[]; - getProperty(propertyName: string): Symbol; - getApparentProperties(): Symbol[]; - getCallSignatures(): Signature[]; - getConstructSignatures(): Signature[]; - getStringIndexType(): Type; - getNumberIndexType(): Type; - } - interface Signature { - getDeclaration(): SignatureDeclaration; - getTypeParameters(): Type[]; - getParameters(): Symbol[]; - getReturnType(): Type; - getDocumentationComment(): SymbolDisplayPart[]; - } - interface SourceFile { - getNamedDeclarations(): Declaration[]; - getLineAndCharacterOfPosition(pos: number): LineAndCharacter; - getLineStarts(): number[]; - getPositionOfLineAndCharacter(line: number, character: number): number; - update(newText: string, textChangeRange: TextChangeRange): SourceFile; - } - /** - * Represents an immutable snapshot of a script at a specified time.Once acquired, the - * snapshot is observably immutable. i.e. the same calls with the same parameters will return - * the same values. - */ - interface IScriptSnapshot { - /** Gets a portion of the script snapshot specified by [start, end). */ - getText(start: number, end: number): string; - /** Gets the length of this script snapshot. */ - getLength(): number; - /** - * Gets the TextChangeRange that describe how the text changed between this text and - * an older version. This information is used by the incremental parser to determine - * what sections of the script need to be re-parsed. 'undefined' can be returned if the - * change range cannot be determined. However, in that case, incremental parsing will - * not happen and the entire document will be re - parsed. - */ - getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange; - } - module ScriptSnapshot { - function fromString(text: string): IScriptSnapshot; - } - interface PreProcessedFileInfo { - referencedFiles: FileReference[]; - importedFiles: FileReference[]; - isLibFile: boolean; - } - interface LanguageServiceHost { - getCompilationSettings(): CompilerOptions; - getNewLine?(): string; - getScriptFileNames(): string[]; - getScriptVersion(fileName: string): string; - getScriptSnapshot(fileName: string): IScriptSnapshot; - getLocalizedDiagnosticMessages?(): any; - getCancellationToken?(): CancellationToken; - getCurrentDirectory(): string; - getDefaultLibFileName(options: CompilerOptions): string; - log?(s: string): void; - trace?(s: string): void; - error?(s: string): void; - } - interface LanguageService { - cleanupSemanticCache(): void; - getSyntacticDiagnostics(fileName: string): Diagnostic[]; - getSemanticDiagnostics(fileName: string): Diagnostic[]; - getCompilerOptionsDiagnostics(): Diagnostic[]; - getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; - getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; - getCompletionsAtPosition(fileName: string, position: number): CompletionInfo; - getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails; - getQuickInfoAtPosition(fileName: string, position: number): QuickInfo; - getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan; - getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan; - getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems; - getRenameInfo(fileName: string, position: number): RenameInfo; - findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]; - getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; - getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; - getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; - findReferences(fileName: string, position: number): ReferencedSymbol[]; - getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[]; - getNavigationBarItems(fileName: string): NavigationBarItem[]; - getOutliningSpans(fileName: string): OutliningSpan[]; - getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[]; - getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[]; - getIndentationAtPosition(fileName: string, position: number, options: EditorOptions): number; - getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions): TextChange[]; - getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): TextChange[]; - getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextChange[]; - getEmitOutput(fileName: string): EmitOutput; - getProgram(): Program; - getSourceFile(fileName: string): SourceFile; - dispose(): void; - } - interface ClassifiedSpan { - textSpan: TextSpan; - classificationType: string; - } - interface NavigationBarItem { - text: string; - kind: string; - kindModifiers: string; - spans: TextSpan[]; - childItems: NavigationBarItem[]; - indent: number; - bolded: boolean; - grayed: boolean; - } - interface TodoCommentDescriptor { - text: string; - priority: number; - } - interface TodoComment { - descriptor: TodoCommentDescriptor; - message: string; - position: number; - } - class TextChange { - span: TextSpan; - newText: string; - } - interface RenameLocation { - textSpan: TextSpan; - fileName: string; - } - interface ReferenceEntry { - textSpan: TextSpan; - fileName: string; - isWriteAccess: boolean; - } - interface NavigateToItem { - name: string; - kind: string; - kindModifiers: string; - matchKind: string; - isCaseSensitive: boolean; - fileName: string; - textSpan: TextSpan; - containerName: string; - containerKind: string; - } - interface EditorOptions { - IndentSize: number; - TabSize: number; - NewLineCharacter: string; - ConvertTabsToSpaces: boolean; - } - interface FormatCodeOptions extends EditorOptions { - InsertSpaceAfterCommaDelimiter: boolean; - InsertSpaceAfterSemicolonInForStatements: boolean; - InsertSpaceBeforeAndAfterBinaryOperators: boolean; - InsertSpaceAfterKeywordsInControlFlowStatements: boolean; - InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; - InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; - PlaceOpenBraceOnNewLineForFunctions: boolean; - PlaceOpenBraceOnNewLineForControlBlocks: boolean; - [s: string]: boolean | number | string; - } - interface DefinitionInfo { - fileName: string; - textSpan: TextSpan; - kind: string; - name: string; - containerKind: string; - containerName: string; - } - interface ReferencedSymbol { - definition: DefinitionInfo; - references: ReferenceEntry[]; - } - enum SymbolDisplayPartKind { - aliasName = 0, - className = 1, - enumName = 2, - fieldName = 3, - interfaceName = 4, - keyword = 5, - lineBreak = 6, - numericLiteral = 7, - stringLiteral = 8, - localName = 9, - methodName = 10, - moduleName = 11, - operator = 12, - parameterName = 13, - propertyName = 14, - punctuation = 15, - space = 16, - text = 17, - typeParameterName = 18, - enumMemberName = 19, - functionName = 20, - regularExpressionLiteral = 21, - } - interface SymbolDisplayPart { - text: string; - kind: string; - } - interface QuickInfo { - kind: string; - kindModifiers: string; - textSpan: TextSpan; - displayParts: SymbolDisplayPart[]; - documentation: SymbolDisplayPart[]; - } - interface RenameInfo { - canRename: boolean; - localizedErrorMessage: string; - displayName: string; - fullDisplayName: string; - kind: string; - kindModifiers: string; - triggerSpan: TextSpan; - } - interface SignatureHelpParameter { - name: string; - documentation: SymbolDisplayPart[]; - displayParts: SymbolDisplayPart[]; - isOptional: boolean; - } - /** - * Represents a single signature to show in signature help. - * The id is used for subsequent calls into the language service to ask questions about the - * signature help item in the context of any documents that have been updated. i.e. after - * an edit has happened, while signature help is still active, the host can ask important - * questions like 'what parameter is the user currently contained within?'. - */ - interface SignatureHelpItem { - isVariadic: boolean; - prefixDisplayParts: SymbolDisplayPart[]; - suffixDisplayParts: SymbolDisplayPart[]; - separatorDisplayParts: SymbolDisplayPart[]; - parameters: SignatureHelpParameter[]; - documentation: SymbolDisplayPart[]; - } - /** - * Represents a set of signature help items, and the preferred item that should be selected. - */ - interface SignatureHelpItems { - items: SignatureHelpItem[]; - applicableSpan: TextSpan; - selectedItemIndex: number; - argumentIndex: number; - argumentCount: number; - } - interface CompletionInfo { - isMemberCompletion: boolean; - isNewIdentifierLocation: boolean; - entries: CompletionEntry[]; - } - interface CompletionEntry { - name: string; - kind: string; - kindModifiers: string; - } - interface CompletionEntryDetails { - name: string; - kind: string; - kindModifiers: string; - displayParts: SymbolDisplayPart[]; - documentation: SymbolDisplayPart[]; - } - interface OutliningSpan { - /** The span of the document to actually collapse. */ - textSpan: TextSpan; - /** The span of the document to display when the user hovers over the collapsed span. */ - hintSpan: TextSpan; - /** The text to display in the editor for the collapsed region. */ - bannerText: string; - /** - * Whether or not this region should be automatically collapsed when - * the 'Collapse to Definitions' command is invoked. - */ - autoCollapse: boolean; - } - interface EmitOutput { - outputFiles: OutputFile[]; - emitSkipped: boolean; - } - const enum OutputFileType { - JavaScript = 0, - SourceMap = 1, - Declaration = 2, - } - interface OutputFile { - name: string; - writeByteOrderMark: boolean; - text: string; - } - const enum EndOfLineState { - Start = 0, - InMultiLineCommentTrivia = 1, - InSingleQuoteStringLiteral = 2, - InDoubleQuoteStringLiteral = 3, - InTemplateHeadOrNoSubstitutionTemplate = 4, - InTemplateMiddleOrTail = 5, - InTemplateSubstitutionPosition = 6, - } - enum TokenClass { - Punctuation = 0, - Keyword = 1, - Operator = 2, - Comment = 3, - Whitespace = 4, - Identifier = 5, - NumberLiteral = 6, - StringLiteral = 7, - RegExpLiteral = 8, - } - interface ClassificationResult { - finalLexState: EndOfLineState; - entries: ClassificationInfo[]; - } - interface ClassificationInfo { - length: number; - classification: TokenClass; - } - interface Classifier { - /** - * Gives lexical classifications of tokens on a line without any syntactic context. - * For instance, a token consisting of the text 'string' can be either an identifier - * named 'string' or the keyword 'string', however, because this classifier is not aware, - * it relies on certain heuristics to give acceptable results. For classifications where - * speed trumps accuracy, this function is preferable; however, for true accuracy, the - * syntactic classifier is ideal. In fact, in certain editing scenarios, combining the - * lexical, syntactic, and semantic classifiers may issue the best user experience. - * - * @param text The text of a line to classify. - * @param lexState The state of the lexical classifier at the end of the previous line. - * @param syntacticClassifierAbsent Whether the client is *not* using a syntactic classifier. - * If there is no syntactic classifier (syntacticClassifierAbsent=true), - * certain heuristics may be used in its place; however, if there is a - * syntactic classifier (syntacticClassifierAbsent=false), certain - * classifications which may be incorrectly categorized will be given - * back as Identifiers in order to allow the syntactic classifier to - * subsume the classification. - */ - getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult; - } - /** - * The document registry represents a store of SourceFile objects that can be shared between - * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) - * of files in the context. - * SourceFile objects account for most of the memory usage by the language service. Sharing - * the same DocumentRegistry instance between different instances of LanguageService allow - * for more efficient memory utilization since all projects will share at least the library - * file (lib.d.ts). - * - * A more advanced use of the document registry is to serialize sourceFile objects to disk - * and re-hydrate them when needed. - * - * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it - * to all subsequent createLanguageService calls. - */ - interface DocumentRegistry { - /** - * Request a stored SourceFile with a given fileName and compilationSettings. - * The first call to acquire will call createLanguageServiceSourceFile to generate - * the SourceFile if was not found in the registry. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @parm scriptSnapshot Text of the file. Only used if the file was not found - * in the registry and a new one was created. - * @parm version Current version of the file. Only used if the file was not found - * in the registry and a new one was created. - */ - acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; - /** - * Request an updated version of an already existing SourceFile with a given fileName - * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile - * to get an updated SourceFile. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @param scriptSnapshot Text of the file. - * @param version Current version of the file. - */ - updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; - /** - * Informs the DocumentRegistry that a file is not needed any longer. - * - * Note: It is not allowed to call release on a SourceFile that was not acquired from - * this registry originally. - * - * @param fileName The name of the file to be released - * @param compilationSettings The compilation settings used to acquire the file - */ - releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; - } - class ScriptElementKind { - static unknown: string; - static keyword: string; - static scriptElement: string; - static moduleElement: string; - static classElement: string; - static interfaceElement: string; - static typeElement: string; - static enumElement: string; - static variableElement: string; - static localVariableElement: string; - static functionElement: string; - static localFunctionElement: string; - static memberFunctionElement: string; - static memberGetAccessorElement: string; - static memberSetAccessorElement: string; - static memberVariableElement: string; - static constructorImplementationElement: string; - static callSignatureElement: string; - static indexSignatureElement: string; - static constructSignatureElement: string; - static parameterElement: string; - static typeParameterElement: string; - static primitiveType: string; - static label: string; - static alias: string; - static constElement: string; - static letElement: string; - } - class ScriptElementKindModifier { - static none: string; - static publicMemberModifier: string; - static privateMemberModifier: string; - static protectedMemberModifier: string; - static exportedModifier: string; - static ambientModifier: string; - static staticModifier: string; - } - class ClassificationTypeNames { - static comment: string; - static identifier: string; - static keyword: string; - static numericLiteral: string; - static operator: string; - static stringLiteral: string; - static whiteSpace: string; - static text: string; - static punctuation: string; - static className: string; - static enumName: string; - static interfaceName: string; - static moduleName: string; - static typeParameterName: string; - static typeAlias: string; - } - interface DisplayPartsSymbolWriter extends SymbolWriter { - displayParts(): SymbolDisplayPart[]; - } - function displayPartsToString(displayParts: SymbolDisplayPart[]): string; - function getDefaultCompilerOptions(): CompilerOptions; - class OperationCanceledException { - } - class CancellationTokenObject { - private cancellationToken; - static None: CancellationTokenObject; - constructor(cancellationToken: CancellationToken); - isCancellationRequested(): boolean; - throwIfCancellationRequested(): void; - } - function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile; - let disableIncrementalParsing: boolean; - function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; - function createDocumentRegistry(): DocumentRegistry; - function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo; - function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; - function createClassifier(): Classifier; - /** - * Get the path of the default library file (lib.d.ts) as distributed with the typescript - * node package. - * The functionality is not supported if the ts module is consumed outside of a node module. - */ - function getDefaultLibFilePath(options: CompilerOptions): string; -} - +}); //// [APISample_linter.js] /* @@ -2042,26 +75,28 @@ function delint(sourceFile) { delintNode(sourceFile); function delintNode(node) { switch (node.kind) { - case 183 /* ForStatement */: - case 184 /* ForInStatement */: - case 182 /* WhileStatement */: - case 181 /* DoStatement */: - if (node.statement.kind !== 176 /* Block */) { + case 186 /* ForStatement */: + case 187 /* ForInStatement */: + case 185 /* WhileStatement */: + case 184 /* DoStatement */: + if (node.statement.kind !== 179 /* Block */) { report(node, "A looping statement's contents should be wrapped in a block body."); } break; - case 180 /* IfStatement */: + case 183 /* IfStatement */: var ifStatement = node; - if (ifStatement.thenStatement.kind !== 176 /* Block */) { + if (ifStatement.thenStatement.kind !== 179 /* Block */) { report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body."); } - if (ifStatement.elseStatement && ifStatement.elseStatement.kind !== 176 /* Block */ && ifStatement.elseStatement.kind !== 180 /* IfStatement */) { + if (ifStatement.elseStatement && + ifStatement.elseStatement.kind !== 179 /* Block */ && + ifStatement.elseStatement.kind !== 183 /* IfStatement */) { report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body."); } break; case 169 /* BinaryExpression */: var op = node.operatorToken.kind; - if (op === 28 /* EqualsEqualsToken */ || op === 29 /* ExclamationEqualsToken */) { + if (op === 28 /* EqualsEqualsToken */ || op == 29 /* ExclamationEqualsToken */) { report(node, "Use '===' and '!=='."); } break; @@ -2069,15 +104,15 @@ function delint(sourceFile) { ts.forEachChild(node, delintNode); } function report(node, message) { - var lineChar = sourceFile.getLineAndCharacterOfPosition(node.getStart()); - console.log(sourceFile.fileName + " (" + (lineChar.line + 1) + "," + (lineChar.character + 1) + "): " + message); + var _a = sourceFile.getLineAndCharacterOfPosition(node.getStart()), line = _a.line, character = _a.character; + console.log(sourceFile.fileName + " (" + (line + 1) + "," + (character + 1) + "): " + message); } } exports.delint = delint; var fileNames = process.argv.slice(2); fileNames.forEach(function (fileName) { // Parse a file - var sourceFile = ts.createSourceFile(fileName, fs.readFileSync(fileName).toString(), 2 /* ES6 */, true); + var sourceFile = ts.createSourceFile(fileName, readFileSync(fileName).toString(), 2 /* ES6 */, true); // delint it delint(sourceFile); }); diff --git a/tests/baselines/reference/APISample_linter.types b/tests/baselines/reference/APISample_linter.types index 600bf5c6adc..609f08f3a76 100644 --- a/tests/baselines/reference/APISample_linter.types +++ b/tests/baselines/reference/APISample_linter.types @@ -12,10 +12,10 @@ declare var process: any; declare var console: any; >console : any -declare var fs: any; ->fs : any +declare var readFileSync: any; +>readFileSync : any -import ts = require("typescript"); +import * as ts from "typescript"; >ts : typeof ts export function delint(sourceFile: ts.SourceFile) { @@ -91,6 +91,7 @@ export function delint(sourceFile: ts.SourceFile) { >node : ts.Node } break; + case ts.SyntaxKind.IfStatement: >ts.SyntaxKind.IfStatement : ts.SyntaxKind >ts.SyntaxKind : typeof ts.SyntaxKind @@ -98,7 +99,7 @@ export function delint(sourceFile: ts.SourceFile) { >SyntaxKind : typeof ts.SyntaxKind >IfStatement : ts.SyntaxKind - var ifStatement = (node); + let ifStatement = (node); >ifStatement : ts.IfStatement >(node) : ts.IfStatement >node : ts.IfStatement @@ -127,13 +128,13 @@ export function delint(sourceFile: ts.SourceFile) { >thenStatement : ts.Statement } if (ifStatement.elseStatement && ->ifStatement.elseStatement && ifStatement.elseStatement.kind !== ts.SyntaxKind.Block && ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement : boolean +>ifStatement.elseStatement && ifStatement.elseStatement.kind !== ts.SyntaxKind.Block && ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement : boolean >ifStatement.elseStatement && ifStatement.elseStatement.kind !== ts.SyntaxKind.Block : boolean >ifStatement.elseStatement : ts.Statement >ifStatement : ts.IfStatement >elseStatement : ts.Statement - ifStatement.elseStatement.kind !== ts.SyntaxKind.Block && ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement) { + ifStatement.elseStatement.kind !== ts.SyntaxKind.Block && >ifStatement.elseStatement.kind !== ts.SyntaxKind.Block : boolean >ifStatement.elseStatement.kind : ts.SyntaxKind >ifStatement.elseStatement : ts.Statement @@ -145,6 +146,8 @@ export function delint(sourceFile: ts.SourceFile) { >ts : typeof ts >SyntaxKind : typeof ts.SyntaxKind >Block : ts.SyntaxKind + + ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement) { >ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement : boolean >ifStatement.elseStatement.kind : ts.SyntaxKind >ifStatement.elseStatement : ts.Statement @@ -173,7 +176,7 @@ export function delint(sourceFile: ts.SourceFile) { >SyntaxKind : typeof ts.SyntaxKind >BinaryExpression : ts.SyntaxKind - var op = (node).operatorToken.kind; + let op = (node).operatorToken.kind; >op : ts.SyntaxKind >(node).operatorToken.kind : ts.SyntaxKind >(node).operatorToken : ts.Node @@ -185,8 +188,8 @@ export function delint(sourceFile: ts.SourceFile) { >operatorToken : ts.Node >kind : ts.SyntaxKind - if (op === ts.SyntaxKind.EqualsEqualsToken || op === ts.SyntaxKind.ExclamationEqualsToken) { ->op === ts.SyntaxKind.EqualsEqualsToken || op === ts.SyntaxKind.ExclamationEqualsToken : boolean + if (op === ts.SyntaxKind.EqualsEqualsToken || op == ts.SyntaxKind.ExclamationEqualsToken) { +>op === ts.SyntaxKind.EqualsEqualsToken || op == ts.SyntaxKind.ExclamationEqualsToken : boolean >op === ts.SyntaxKind.EqualsEqualsToken : boolean >op : ts.SyntaxKind >ts.SyntaxKind.EqualsEqualsToken : ts.SyntaxKind @@ -194,7 +197,7 @@ export function delint(sourceFile: ts.SourceFile) { >ts : typeof ts >SyntaxKind : typeof ts.SyntaxKind >EqualsEqualsToken : ts.SyntaxKind ->op === ts.SyntaxKind.ExclamationEqualsToken : boolean +>op == ts.SyntaxKind.ExclamationEqualsToken : boolean >op : ts.SyntaxKind >ts.SyntaxKind.ExclamationEqualsToken : ts.SyntaxKind >ts.SyntaxKind : typeof ts.SyntaxKind @@ -226,8 +229,9 @@ export function delint(sourceFile: ts.SourceFile) { >Node : ts.Node >message : string - var lineChar = sourceFile.getLineAndCharacterOfPosition(node.getStart()); ->lineChar : ts.LineAndCharacter + let { line, character } = sourceFile.getLineAndCharacterOfPosition(node.getStart()); +>line : number +>character : number >sourceFile.getLineAndCharacterOfPosition(node.getStart()) : ts.LineAndCharacter >sourceFile.getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter >sourceFile : ts.SourceFile @@ -237,27 +241,23 @@ export function delint(sourceFile: ts.SourceFile) { >node : ts.Node >getStart : (sourceFile?: ts.SourceFile) => number - console.log(`${sourceFile.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${message}`) ->console.log(`${sourceFile.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${message}`) : any + console.log(`${sourceFile.fileName} (${line + 1},${character + 1}): ${message}`); +>console.log(`${sourceFile.fileName} (${line + 1},${character + 1}): ${message}`) : any >console.log : any >console : any >log : any >sourceFile.fileName : string >sourceFile : ts.SourceFile >fileName : string ->lineChar.line + 1 : number ->lineChar.line : number ->lineChar : ts.LineAndCharacter +>line + 1 : number >line : number ->lineChar.character + 1 : number ->lineChar.character : number ->lineChar : ts.LineAndCharacter +>character + 1 : number >character : number >message : string } } -var fileNames = process.argv.slice(2); +const fileNames = process.argv.slice(2); >fileNames : any >process.argv.slice(2) : any >process.argv.slice : any @@ -267,26 +267,24 @@ var fileNames = process.argv.slice(2); >slice : any fileNames.forEach(fileName => { ->fileNames.forEach(fileName => { // Parse a file var sourceFile = ts.createSourceFile(fileName, fs.readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); // delint it delint(sourceFile);}) : any +>fileNames.forEach(fileName => { // Parse a file let sourceFile = ts.createSourceFile(fileName, readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); // delint it delint(sourceFile);}) : any >fileNames.forEach : any >fileNames : any >forEach : any ->fileName => { // Parse a file var sourceFile = ts.createSourceFile(fileName, fs.readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); // delint it delint(sourceFile);} : (fileName: any) => void +>fileName => { // Parse a file let sourceFile = ts.createSourceFile(fileName, readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); // delint it delint(sourceFile);} : (fileName: any) => void >fileName : any // Parse a file - var sourceFile = ts.createSourceFile(fileName, fs.readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); + let sourceFile = ts.createSourceFile(fileName, readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); >sourceFile : ts.SourceFile ->ts.createSourceFile(fileName, fs.readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true) : ts.SourceFile +>ts.createSourceFile(fileName, readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true) : ts.SourceFile >ts.createSourceFile : (fileName: string, sourceText: string, languageVersion: ts.ScriptTarget, setParentNodes?: boolean) => ts.SourceFile >ts : typeof ts >createSourceFile : (fileName: string, sourceText: string, languageVersion: ts.ScriptTarget, setParentNodes?: boolean) => ts.SourceFile >fileName : any ->fs.readFileSync(fileName).toString() : any ->fs.readFileSync(fileName).toString : any ->fs.readFileSync(fileName) : any ->fs.readFileSync : any ->fs : any +>readFileSync(fileName).toString() : any +>readFileSync(fileName).toString : any +>readFileSync(fileName) : any >readFileSync : any >fileName : any >toString : any @@ -303,6065 +301,3 @@ fileNames.forEach(fileName => { >sourceFile : ts.SourceFile }); - -=== typescript.d.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 http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -declare module "typescript" { - interface Map { ->Map : Map ->T : T - - [index: string]: T; ->index : string ->T : T - } - interface TextRange { ->TextRange : TextRange - - pos: number; ->pos : number - - end: number; ->end : number - } - const enum SyntaxKind { ->SyntaxKind : SyntaxKind - - Unknown = 0, ->Unknown : SyntaxKind - - EndOfFileToken = 1, ->EndOfFileToken : SyntaxKind - - SingleLineCommentTrivia = 2, ->SingleLineCommentTrivia : SyntaxKind - - MultiLineCommentTrivia = 3, ->MultiLineCommentTrivia : SyntaxKind - - NewLineTrivia = 4, ->NewLineTrivia : SyntaxKind - - WhitespaceTrivia = 5, ->WhitespaceTrivia : SyntaxKind - - ConflictMarkerTrivia = 6, ->ConflictMarkerTrivia : SyntaxKind - - NumericLiteral = 7, ->NumericLiteral : SyntaxKind - - StringLiteral = 8, ->StringLiteral : SyntaxKind - - RegularExpressionLiteral = 9, ->RegularExpressionLiteral : SyntaxKind - - NoSubstitutionTemplateLiteral = 10, ->NoSubstitutionTemplateLiteral : SyntaxKind - - TemplateHead = 11, ->TemplateHead : SyntaxKind - - TemplateMiddle = 12, ->TemplateMiddle : SyntaxKind - - TemplateTail = 13, ->TemplateTail : SyntaxKind - - OpenBraceToken = 14, ->OpenBraceToken : SyntaxKind - - CloseBraceToken = 15, ->CloseBraceToken : SyntaxKind - - OpenParenToken = 16, ->OpenParenToken : SyntaxKind - - CloseParenToken = 17, ->CloseParenToken : SyntaxKind - - OpenBracketToken = 18, ->OpenBracketToken : SyntaxKind - - CloseBracketToken = 19, ->CloseBracketToken : SyntaxKind - - DotToken = 20, ->DotToken : SyntaxKind - - DotDotDotToken = 21, ->DotDotDotToken : SyntaxKind - - SemicolonToken = 22, ->SemicolonToken : SyntaxKind - - CommaToken = 23, ->CommaToken : SyntaxKind - - LessThanToken = 24, ->LessThanToken : SyntaxKind - - GreaterThanToken = 25, ->GreaterThanToken : SyntaxKind - - LessThanEqualsToken = 26, ->LessThanEqualsToken : SyntaxKind - - GreaterThanEqualsToken = 27, ->GreaterThanEqualsToken : SyntaxKind - - EqualsEqualsToken = 28, ->EqualsEqualsToken : SyntaxKind - - ExclamationEqualsToken = 29, ->ExclamationEqualsToken : SyntaxKind - - EqualsEqualsEqualsToken = 30, ->EqualsEqualsEqualsToken : SyntaxKind - - ExclamationEqualsEqualsToken = 31, ->ExclamationEqualsEqualsToken : SyntaxKind - - EqualsGreaterThanToken = 32, ->EqualsGreaterThanToken : SyntaxKind - - PlusToken = 33, ->PlusToken : SyntaxKind - - MinusToken = 34, ->MinusToken : SyntaxKind - - AsteriskToken = 35, ->AsteriskToken : SyntaxKind - - SlashToken = 36, ->SlashToken : SyntaxKind - - PercentToken = 37, ->PercentToken : SyntaxKind - - PlusPlusToken = 38, ->PlusPlusToken : SyntaxKind - - MinusMinusToken = 39, ->MinusMinusToken : SyntaxKind - - LessThanLessThanToken = 40, ->LessThanLessThanToken : SyntaxKind - - GreaterThanGreaterThanToken = 41, ->GreaterThanGreaterThanToken : SyntaxKind - - GreaterThanGreaterThanGreaterThanToken = 42, ->GreaterThanGreaterThanGreaterThanToken : SyntaxKind - - AmpersandToken = 43, ->AmpersandToken : SyntaxKind - - BarToken = 44, ->BarToken : SyntaxKind - - CaretToken = 45, ->CaretToken : SyntaxKind - - ExclamationToken = 46, ->ExclamationToken : SyntaxKind - - TildeToken = 47, ->TildeToken : SyntaxKind - - AmpersandAmpersandToken = 48, ->AmpersandAmpersandToken : SyntaxKind - - BarBarToken = 49, ->BarBarToken : SyntaxKind - - QuestionToken = 50, ->QuestionToken : SyntaxKind - - ColonToken = 51, ->ColonToken : SyntaxKind - - AtToken = 52, ->AtToken : SyntaxKind - - EqualsToken = 53, ->EqualsToken : SyntaxKind - - PlusEqualsToken = 54, ->PlusEqualsToken : SyntaxKind - - MinusEqualsToken = 55, ->MinusEqualsToken : SyntaxKind - - AsteriskEqualsToken = 56, ->AsteriskEqualsToken : SyntaxKind - - SlashEqualsToken = 57, ->SlashEqualsToken : SyntaxKind - - PercentEqualsToken = 58, ->PercentEqualsToken : SyntaxKind - - LessThanLessThanEqualsToken = 59, ->LessThanLessThanEqualsToken : SyntaxKind - - GreaterThanGreaterThanEqualsToken = 60, ->GreaterThanGreaterThanEqualsToken : SyntaxKind - - GreaterThanGreaterThanGreaterThanEqualsToken = 61, ->GreaterThanGreaterThanGreaterThanEqualsToken : SyntaxKind - - AmpersandEqualsToken = 62, ->AmpersandEqualsToken : SyntaxKind - - BarEqualsToken = 63, ->BarEqualsToken : SyntaxKind - - CaretEqualsToken = 64, ->CaretEqualsToken : SyntaxKind - - Identifier = 65, ->Identifier : SyntaxKind - - BreakKeyword = 66, ->BreakKeyword : SyntaxKind - - CaseKeyword = 67, ->CaseKeyword : SyntaxKind - - CatchKeyword = 68, ->CatchKeyword : SyntaxKind - - ClassKeyword = 69, ->ClassKeyword : SyntaxKind - - ConstKeyword = 70, ->ConstKeyword : SyntaxKind - - ContinueKeyword = 71, ->ContinueKeyword : SyntaxKind - - DebuggerKeyword = 72, ->DebuggerKeyword : SyntaxKind - - DefaultKeyword = 73, ->DefaultKeyword : SyntaxKind - - DeleteKeyword = 74, ->DeleteKeyword : SyntaxKind - - DoKeyword = 75, ->DoKeyword : SyntaxKind - - ElseKeyword = 76, ->ElseKeyword : SyntaxKind - - EnumKeyword = 77, ->EnumKeyword : SyntaxKind - - ExportKeyword = 78, ->ExportKeyword : SyntaxKind - - ExtendsKeyword = 79, ->ExtendsKeyword : SyntaxKind - - FalseKeyword = 80, ->FalseKeyword : SyntaxKind - - FinallyKeyword = 81, ->FinallyKeyword : SyntaxKind - - ForKeyword = 82, ->ForKeyword : SyntaxKind - - FunctionKeyword = 83, ->FunctionKeyword : SyntaxKind - - IfKeyword = 84, ->IfKeyword : SyntaxKind - - ImportKeyword = 85, ->ImportKeyword : SyntaxKind - - InKeyword = 86, ->InKeyword : SyntaxKind - - InstanceOfKeyword = 87, ->InstanceOfKeyword : SyntaxKind - - NewKeyword = 88, ->NewKeyword : SyntaxKind - - NullKeyword = 89, ->NullKeyword : SyntaxKind - - ReturnKeyword = 90, ->ReturnKeyword : SyntaxKind - - SuperKeyword = 91, ->SuperKeyword : SyntaxKind - - SwitchKeyword = 92, ->SwitchKeyword : SyntaxKind - - ThisKeyword = 93, ->ThisKeyword : SyntaxKind - - ThrowKeyword = 94, ->ThrowKeyword : SyntaxKind - - TrueKeyword = 95, ->TrueKeyword : SyntaxKind - - TryKeyword = 96, ->TryKeyword : SyntaxKind - - TypeOfKeyword = 97, ->TypeOfKeyword : SyntaxKind - - VarKeyword = 98, ->VarKeyword : SyntaxKind - - VoidKeyword = 99, ->VoidKeyword : SyntaxKind - - WhileKeyword = 100, ->WhileKeyword : SyntaxKind - - WithKeyword = 101, ->WithKeyword : SyntaxKind - - AsKeyword = 102, ->AsKeyword : SyntaxKind - - ImplementsKeyword = 103, ->ImplementsKeyword : SyntaxKind - - InterfaceKeyword = 104, ->InterfaceKeyword : SyntaxKind - - LetKeyword = 105, ->LetKeyword : SyntaxKind - - PackageKeyword = 106, ->PackageKeyword : SyntaxKind - - PrivateKeyword = 107, ->PrivateKeyword : SyntaxKind - - ProtectedKeyword = 108, ->ProtectedKeyword : SyntaxKind - - PublicKeyword = 109, ->PublicKeyword : SyntaxKind - - StaticKeyword = 110, ->StaticKeyword : SyntaxKind - - YieldKeyword = 111, ->YieldKeyword : SyntaxKind - - AnyKeyword = 112, ->AnyKeyword : SyntaxKind - - BooleanKeyword = 113, ->BooleanKeyword : SyntaxKind - - ConstructorKeyword = 114, ->ConstructorKeyword : SyntaxKind - - DeclareKeyword = 115, ->DeclareKeyword : SyntaxKind - - GetKeyword = 116, ->GetKeyword : SyntaxKind - - ModuleKeyword = 117, ->ModuleKeyword : SyntaxKind - - RequireKeyword = 118, ->RequireKeyword : SyntaxKind - - NumberKeyword = 119, ->NumberKeyword : SyntaxKind - - SetKeyword = 120, ->SetKeyword : SyntaxKind - - StringKeyword = 121, ->StringKeyword : SyntaxKind - - SymbolKeyword = 122, ->SymbolKeyword : SyntaxKind - - TypeKeyword = 123, ->TypeKeyword : SyntaxKind - - FromKeyword = 124, ->FromKeyword : SyntaxKind - - OfKeyword = 125, ->OfKeyword : SyntaxKind - - QualifiedName = 126, ->QualifiedName : SyntaxKind - - ComputedPropertyName = 127, ->ComputedPropertyName : SyntaxKind - - TypeParameter = 128, ->TypeParameter : SyntaxKind - - Parameter = 129, ->Parameter : SyntaxKind - - Decorator = 130, ->Decorator : SyntaxKind - - PropertySignature = 131, ->PropertySignature : SyntaxKind - - PropertyDeclaration = 132, ->PropertyDeclaration : SyntaxKind - - MethodSignature = 133, ->MethodSignature : SyntaxKind - - MethodDeclaration = 134, ->MethodDeclaration : SyntaxKind - - Constructor = 135, ->Constructor : SyntaxKind - - GetAccessor = 136, ->GetAccessor : SyntaxKind - - SetAccessor = 137, ->SetAccessor : SyntaxKind - - CallSignature = 138, ->CallSignature : SyntaxKind - - ConstructSignature = 139, ->ConstructSignature : SyntaxKind - - IndexSignature = 140, ->IndexSignature : SyntaxKind - - TypeReference = 141, ->TypeReference : SyntaxKind - - FunctionType = 142, ->FunctionType : SyntaxKind - - ConstructorType = 143, ->ConstructorType : SyntaxKind - - TypeQuery = 144, ->TypeQuery : SyntaxKind - - TypeLiteral = 145, ->TypeLiteral : SyntaxKind - - ArrayType = 146, ->ArrayType : SyntaxKind - - TupleType = 147, ->TupleType : SyntaxKind - - UnionType = 148, ->UnionType : SyntaxKind - - ParenthesizedType = 149, ->ParenthesizedType : SyntaxKind - - ObjectBindingPattern = 150, ->ObjectBindingPattern : SyntaxKind - - ArrayBindingPattern = 151, ->ArrayBindingPattern : SyntaxKind - - BindingElement = 152, ->BindingElement : SyntaxKind - - ArrayLiteralExpression = 153, ->ArrayLiteralExpression : SyntaxKind - - ObjectLiteralExpression = 154, ->ObjectLiteralExpression : SyntaxKind - - PropertyAccessExpression = 155, ->PropertyAccessExpression : SyntaxKind - - ElementAccessExpression = 156, ->ElementAccessExpression : SyntaxKind - - CallExpression = 157, ->CallExpression : SyntaxKind - - NewExpression = 158, ->NewExpression : SyntaxKind - - TaggedTemplateExpression = 159, ->TaggedTemplateExpression : SyntaxKind - - TypeAssertionExpression = 160, ->TypeAssertionExpression : SyntaxKind - - ParenthesizedExpression = 161, ->ParenthesizedExpression : SyntaxKind - - FunctionExpression = 162, ->FunctionExpression : SyntaxKind - - ArrowFunction = 163, ->ArrowFunction : SyntaxKind - - DeleteExpression = 164, ->DeleteExpression : SyntaxKind - - TypeOfExpression = 165, ->TypeOfExpression : SyntaxKind - - VoidExpression = 166, ->VoidExpression : SyntaxKind - - PrefixUnaryExpression = 167, ->PrefixUnaryExpression : SyntaxKind - - PostfixUnaryExpression = 168, ->PostfixUnaryExpression : SyntaxKind - - BinaryExpression = 169, ->BinaryExpression : SyntaxKind - - ConditionalExpression = 170, ->ConditionalExpression : SyntaxKind - - TemplateExpression = 171, ->TemplateExpression : SyntaxKind - - YieldExpression = 172, ->YieldExpression : SyntaxKind - - SpreadElementExpression = 173, ->SpreadElementExpression : SyntaxKind - - OmittedExpression = 174, ->OmittedExpression : SyntaxKind - - TemplateSpan = 175, ->TemplateSpan : SyntaxKind - - Block = 176, ->Block : SyntaxKind - - VariableStatement = 177, ->VariableStatement : SyntaxKind - - EmptyStatement = 178, ->EmptyStatement : SyntaxKind - - ExpressionStatement = 179, ->ExpressionStatement : SyntaxKind - - IfStatement = 180, ->IfStatement : SyntaxKind - - DoStatement = 181, ->DoStatement : SyntaxKind - - WhileStatement = 182, ->WhileStatement : SyntaxKind - - ForStatement = 183, ->ForStatement : SyntaxKind - - ForInStatement = 184, ->ForInStatement : SyntaxKind - - ForOfStatement = 185, ->ForOfStatement : SyntaxKind - - ContinueStatement = 186, ->ContinueStatement : SyntaxKind - - BreakStatement = 187, ->BreakStatement : SyntaxKind - - ReturnStatement = 188, ->ReturnStatement : SyntaxKind - - WithStatement = 189, ->WithStatement : SyntaxKind - - SwitchStatement = 190, ->SwitchStatement : SyntaxKind - - LabeledStatement = 191, ->LabeledStatement : SyntaxKind - - ThrowStatement = 192, ->ThrowStatement : SyntaxKind - - TryStatement = 193, ->TryStatement : SyntaxKind - - DebuggerStatement = 194, ->DebuggerStatement : SyntaxKind - - VariableDeclaration = 195, ->VariableDeclaration : SyntaxKind - - VariableDeclarationList = 196, ->VariableDeclarationList : SyntaxKind - - FunctionDeclaration = 197, ->FunctionDeclaration : SyntaxKind - - ClassDeclaration = 198, ->ClassDeclaration : SyntaxKind - - InterfaceDeclaration = 199, ->InterfaceDeclaration : SyntaxKind - - TypeAliasDeclaration = 200, ->TypeAliasDeclaration : SyntaxKind - - EnumDeclaration = 201, ->EnumDeclaration : SyntaxKind - - ModuleDeclaration = 202, ->ModuleDeclaration : SyntaxKind - - ModuleBlock = 203, ->ModuleBlock : SyntaxKind - - CaseBlock = 204, ->CaseBlock : SyntaxKind - - ImportEqualsDeclaration = 205, ->ImportEqualsDeclaration : SyntaxKind - - ImportDeclaration = 206, ->ImportDeclaration : SyntaxKind - - ImportClause = 207, ->ImportClause : SyntaxKind - - NamespaceImport = 208, ->NamespaceImport : SyntaxKind - - NamedImports = 209, ->NamedImports : SyntaxKind - - ImportSpecifier = 210, ->ImportSpecifier : SyntaxKind - - ExportAssignment = 211, ->ExportAssignment : SyntaxKind - - ExportDeclaration = 212, ->ExportDeclaration : SyntaxKind - - NamedExports = 213, ->NamedExports : SyntaxKind - - ExportSpecifier = 214, ->ExportSpecifier : SyntaxKind - - MissingDeclaration = 215, ->MissingDeclaration : SyntaxKind - - ExternalModuleReference = 216, ->ExternalModuleReference : SyntaxKind - - CaseClause = 217, ->CaseClause : SyntaxKind - - DefaultClause = 218, ->DefaultClause : SyntaxKind - - HeritageClause = 219, ->HeritageClause : SyntaxKind - - CatchClause = 220, ->CatchClause : SyntaxKind - - PropertyAssignment = 221, ->PropertyAssignment : SyntaxKind - - ShorthandPropertyAssignment = 222, ->ShorthandPropertyAssignment : SyntaxKind - - EnumMember = 223, ->EnumMember : SyntaxKind - - SourceFile = 224, ->SourceFile : SyntaxKind - - SyntaxList = 225, ->SyntaxList : SyntaxKind - - Count = 226, ->Count : SyntaxKind - - FirstAssignment = 53, ->FirstAssignment : SyntaxKind - - LastAssignment = 64, ->LastAssignment : SyntaxKind - - FirstReservedWord = 66, ->FirstReservedWord : SyntaxKind - - LastReservedWord = 101, ->LastReservedWord : SyntaxKind - - FirstKeyword = 66, ->FirstKeyword : SyntaxKind - - LastKeyword = 125, ->LastKeyword : SyntaxKind - - FirstFutureReservedWord = 103, ->FirstFutureReservedWord : SyntaxKind - - LastFutureReservedWord = 111, ->LastFutureReservedWord : SyntaxKind - - FirstTypeNode = 141, ->FirstTypeNode : SyntaxKind - - LastTypeNode = 149, ->LastTypeNode : SyntaxKind - - FirstPunctuation = 14, ->FirstPunctuation : SyntaxKind - - LastPunctuation = 64, ->LastPunctuation : SyntaxKind - - FirstToken = 0, ->FirstToken : SyntaxKind - - LastToken = 125, ->LastToken : SyntaxKind - - FirstTriviaToken = 2, ->FirstTriviaToken : SyntaxKind - - LastTriviaToken = 6, ->LastTriviaToken : SyntaxKind - - FirstLiteralToken = 7, ->FirstLiteralToken : SyntaxKind - - LastLiteralToken = 10, ->LastLiteralToken : SyntaxKind - - FirstTemplateToken = 10, ->FirstTemplateToken : SyntaxKind - - LastTemplateToken = 13, ->LastTemplateToken : SyntaxKind - - FirstBinaryOperator = 24, ->FirstBinaryOperator : SyntaxKind - - LastBinaryOperator = 64, ->LastBinaryOperator : SyntaxKind - - FirstNode = 126, ->FirstNode : SyntaxKind - } - const enum NodeFlags { ->NodeFlags : NodeFlags - - Export = 1, ->Export : NodeFlags - - Ambient = 2, ->Ambient : NodeFlags - - Public = 16, ->Public : NodeFlags - - Private = 32, ->Private : NodeFlags - - Protected = 64, ->Protected : NodeFlags - - Static = 128, ->Static : NodeFlags - - Default = 256, ->Default : NodeFlags - - MultiLine = 512, ->MultiLine : NodeFlags - - Synthetic = 1024, ->Synthetic : NodeFlags - - DeclarationFile = 2048, ->DeclarationFile : NodeFlags - - Let = 4096, ->Let : NodeFlags - - Const = 8192, ->Const : NodeFlags - - OctalLiteral = 16384, ->OctalLiteral : NodeFlags - - ExportContext = 32768, ->ExportContext : NodeFlags - - Modifier = 499, ->Modifier : NodeFlags - - AccessibilityModifier = 112, ->AccessibilityModifier : NodeFlags - - BlockScoped = 12288, ->BlockScoped : NodeFlags - } - const enum ParserContextFlags { ->ParserContextFlags : ParserContextFlags - - StrictMode = 1, ->StrictMode : ParserContextFlags - - DisallowIn = 2, ->DisallowIn : ParserContextFlags - - Yield = 4, ->Yield : ParserContextFlags - - GeneratorParameter = 8, ->GeneratorParameter : ParserContextFlags - - Decorator = 16, ->Decorator : ParserContextFlags - - ThisNodeHasError = 32, ->ThisNodeHasError : ParserContextFlags - - ParserGeneratedFlags = 63, ->ParserGeneratedFlags : ParserContextFlags - - ThisNodeOrAnySubNodesHasError = 64, ->ThisNodeOrAnySubNodesHasError : ParserContextFlags - - HasAggregatedChildData = 128, ->HasAggregatedChildData : ParserContextFlags - } - const enum RelationComparisonResult { ->RelationComparisonResult : RelationComparisonResult - - Succeeded = 1, ->Succeeded : RelationComparisonResult - - Failed = 2, ->Failed : RelationComparisonResult - - FailedAndReported = 3, ->FailedAndReported : RelationComparisonResult - } - interface Node extends TextRange { ->Node : Node ->TextRange : TextRange - - kind: SyntaxKind; ->kind : SyntaxKind ->SyntaxKind : SyntaxKind - - flags: NodeFlags; ->flags : NodeFlags ->NodeFlags : NodeFlags - - parserContextFlags?: ParserContextFlags; ->parserContextFlags : ParserContextFlags ->ParserContextFlags : ParserContextFlags - - decorators?: NodeArray; ->decorators : NodeArray ->NodeArray : NodeArray ->Decorator : Decorator - - modifiers?: ModifiersArray; ->modifiers : ModifiersArray ->ModifiersArray : ModifiersArray - - id?: number; ->id : number - - parent?: Node; ->parent : Node ->Node : Node - - symbol?: Symbol; ->symbol : Symbol ->Symbol : Symbol - - locals?: SymbolTable; ->locals : SymbolTable ->SymbolTable : SymbolTable - - nextContainer?: Node; ->nextContainer : Node ->Node : Node - - localSymbol?: Symbol; ->localSymbol : Symbol ->Symbol : Symbol - } - interface NodeArray extends Array, TextRange { ->NodeArray : NodeArray ->T : T ->Array : T[] ->T : T ->TextRange : TextRange - - hasTrailingComma?: boolean; ->hasTrailingComma : boolean - } - interface ModifiersArray extends NodeArray { ->ModifiersArray : ModifiersArray ->NodeArray : NodeArray ->Node : Node - - flags: number; ->flags : number - } - interface Identifier extends PrimaryExpression { ->Identifier : Identifier ->PrimaryExpression : PrimaryExpression - - text: string; ->text : string - } - interface QualifiedName extends Node { ->QualifiedName : QualifiedName ->Node : Node - - left: EntityName; ->left : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName - - right: Identifier; ->right : Identifier ->Identifier : Identifier - } - type EntityName = Identifier | QualifiedName; ->EntityName : Identifier | QualifiedName ->Identifier : Identifier ->QualifiedName : QualifiedName - - type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName | BindingPattern; ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->Identifier : Identifier ->LiteralExpression : LiteralExpression ->ComputedPropertyName : ComputedPropertyName ->BindingPattern : BindingPattern - - interface Declaration extends Node { ->Declaration : Declaration ->Node : Node - - _declarationBrand: any; ->_declarationBrand : any - - name?: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - } - interface ComputedPropertyName extends Node { ->ComputedPropertyName : ComputedPropertyName ->Node : Node - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface Decorator extends Node { ->Decorator : Decorator ->Node : Node - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - } - interface TypeParameterDeclaration extends Declaration { ->TypeParameterDeclaration : TypeParameterDeclaration ->Declaration : Declaration - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - constraint?: TypeNode; ->constraint : TypeNode ->TypeNode : TypeNode - - expression?: Expression; ->expression : Expression ->Expression : Expression - } - interface SignatureDeclaration extends Declaration { ->SignatureDeclaration : SignatureDeclaration ->Declaration : Declaration - - typeParameters?: NodeArray; ->typeParameters : NodeArray ->NodeArray : NodeArray ->TypeParameterDeclaration : TypeParameterDeclaration - - parameters: NodeArray; ->parameters : NodeArray ->NodeArray : NodeArray ->ParameterDeclaration : ParameterDeclaration - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface VariableDeclaration extends Declaration { ->VariableDeclaration : VariableDeclaration ->Declaration : Declaration - - parent?: VariableDeclarationList; ->parent : VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList - - name: Identifier | BindingPattern; ->name : Identifier | BindingPattern ->Identifier : Identifier ->BindingPattern : BindingPattern - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface VariableDeclarationList extends Node { ->VariableDeclarationList : VariableDeclarationList ->Node : Node - - declarations: NodeArray; ->declarations : NodeArray ->NodeArray : NodeArray ->VariableDeclaration : VariableDeclaration - } - interface ParameterDeclaration extends Declaration { ->ParameterDeclaration : ParameterDeclaration ->Declaration : Declaration - - dotDotDotToken?: Node; ->dotDotDotToken : Node ->Node : Node - - name: Identifier | BindingPattern; ->name : Identifier | BindingPattern ->Identifier : Identifier ->BindingPattern : BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface BindingElement extends Declaration { ->BindingElement : BindingElement ->Declaration : Declaration - - propertyName?: Identifier; ->propertyName : Identifier ->Identifier : Identifier - - dotDotDotToken?: Node; ->dotDotDotToken : Node ->Node : Node - - name: Identifier | BindingPattern; ->name : Identifier | BindingPattern ->Identifier : Identifier ->BindingPattern : BindingPattern - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface PropertyDeclaration extends Declaration, ClassElement { ->PropertyDeclaration : PropertyDeclaration ->Declaration : Declaration ->ClassElement : ClassElement - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface ObjectLiteralElement extends Declaration { ->ObjectLiteralElement : ObjectLiteralElement ->Declaration : Declaration - - _objectLiteralBrandBrand: any; ->_objectLiteralBrandBrand : any - } - interface PropertyAssignment extends ObjectLiteralElement { ->PropertyAssignment : PropertyAssignment ->ObjectLiteralElement : ObjectLiteralElement - - _propertyAssignmentBrand: any; ->_propertyAssignmentBrand : any - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - initializer: Expression; ->initializer : Expression ->Expression : Expression - } - interface ShorthandPropertyAssignment extends ObjectLiteralElement { ->ShorthandPropertyAssignment : ShorthandPropertyAssignment ->ObjectLiteralElement : ObjectLiteralElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - questionToken?: Node; ->questionToken : Node ->Node : Node - } - interface VariableLikeDeclaration extends Declaration { ->VariableLikeDeclaration : VariableLikeDeclaration ->Declaration : Declaration - - propertyName?: Identifier; ->propertyName : Identifier ->Identifier : Identifier - - dotDotDotToken?: Node; ->dotDotDotToken : Node ->Node : Node - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface BindingPattern extends Node { ->BindingPattern : BindingPattern ->Node : Node - - elements: NodeArray; ->elements : NodeArray ->NodeArray : NodeArray ->BindingElement : BindingElement - } - /** - * Several node kinds share function-like features such as a signature, - * a name, and a body. These nodes should extend FunctionLikeDeclaration. - * Examples: - * FunctionDeclaration - * MethodDeclaration - * AccessorDeclaration - */ - interface FunctionLikeDeclaration extends SignatureDeclaration { ->FunctionLikeDeclaration : FunctionLikeDeclaration ->SignatureDeclaration : SignatureDeclaration - - _functionLikeDeclarationBrand: any; ->_functionLikeDeclarationBrand : any - - asteriskToken?: Node; ->asteriskToken : Node ->Node : Node - - questionToken?: Node; ->questionToken : Node ->Node : Node - - body?: Block | Expression; ->body : Expression | Block ->Block : Block ->Expression : Expression - } - interface FunctionDeclaration extends FunctionLikeDeclaration, Statement { ->FunctionDeclaration : FunctionDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->Statement : Statement - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - body?: Block; ->body : Block ->Block : Block - } - interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { ->MethodDeclaration : MethodDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->ClassElement : ClassElement ->ObjectLiteralElement : ObjectLiteralElement - - body?: Block; ->body : Block ->Block : Block - } - interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { ->ConstructorDeclaration : ConstructorDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->ClassElement : ClassElement - - body?: Block; ->body : Block ->Block : Block - } - interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { ->AccessorDeclaration : AccessorDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->ClassElement : ClassElement ->ObjectLiteralElement : ObjectLiteralElement - - _accessorDeclarationBrand: any; ->_accessorDeclarationBrand : any - - body: Block; ->body : Block ->Block : Block - } - interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement { ->IndexSignatureDeclaration : IndexSignatureDeclaration ->SignatureDeclaration : SignatureDeclaration ->ClassElement : ClassElement - - _indexSignatureDeclarationBrand: any; ->_indexSignatureDeclarationBrand : any - } - interface TypeNode extends Node { ->TypeNode : TypeNode ->Node : Node - - _typeNodeBrand: any; ->_typeNodeBrand : any - } - interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration { ->FunctionOrConstructorTypeNode : FunctionOrConstructorTypeNode ->TypeNode : TypeNode ->SignatureDeclaration : SignatureDeclaration - - _functionOrConstructorTypeNodeBrand: any; ->_functionOrConstructorTypeNodeBrand : any - } - interface TypeReferenceNode extends TypeNode { ->TypeReferenceNode : TypeReferenceNode ->TypeNode : TypeNode - - typeName: EntityName; ->typeName : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName - - typeArguments?: NodeArray; ->typeArguments : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface TypeQueryNode extends TypeNode { ->TypeQueryNode : TypeQueryNode ->TypeNode : TypeNode - - exprName: EntityName; ->exprName : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName - } - interface TypeLiteralNode extends TypeNode, Declaration { ->TypeLiteralNode : TypeLiteralNode ->TypeNode : TypeNode ->Declaration : Declaration - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->Node : Node - } - interface ArrayTypeNode extends TypeNode { ->ArrayTypeNode : ArrayTypeNode ->TypeNode : TypeNode - - elementType: TypeNode; ->elementType : TypeNode ->TypeNode : TypeNode - } - interface TupleTypeNode extends TypeNode { ->TupleTypeNode : TupleTypeNode ->TypeNode : TypeNode - - elementTypes: NodeArray; ->elementTypes : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface UnionTypeNode extends TypeNode { ->UnionTypeNode : UnionTypeNode ->TypeNode : TypeNode - - types: NodeArray; ->types : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface ParenthesizedTypeNode extends TypeNode { ->ParenthesizedTypeNode : ParenthesizedTypeNode ->TypeNode : TypeNode - - type: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface StringLiteralTypeNode extends LiteralExpression, TypeNode { ->StringLiteralTypeNode : StringLiteralTypeNode ->LiteralExpression : LiteralExpression ->TypeNode : TypeNode - } - interface Expression extends Node { ->Expression : Expression ->Node : Node - - _expressionBrand: any; ->_expressionBrand : any - - contextualType?: Type; ->contextualType : Type ->Type : Type - } - interface UnaryExpression extends Expression { ->UnaryExpression : UnaryExpression ->Expression : Expression - - _unaryExpressionBrand: any; ->_unaryExpressionBrand : any - } - interface PrefixUnaryExpression extends UnaryExpression { ->PrefixUnaryExpression : PrefixUnaryExpression ->UnaryExpression : UnaryExpression - - operator: SyntaxKind; ->operator : SyntaxKind ->SyntaxKind : SyntaxKind - - operand: UnaryExpression; ->operand : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface PostfixUnaryExpression extends PostfixExpression { ->PostfixUnaryExpression : PostfixUnaryExpression ->PostfixExpression : PostfixExpression - - operand: LeftHandSideExpression; ->operand : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - operator: SyntaxKind; ->operator : SyntaxKind ->SyntaxKind : SyntaxKind - } - interface PostfixExpression extends UnaryExpression { ->PostfixExpression : PostfixExpression ->UnaryExpression : UnaryExpression - - _postfixExpressionBrand: any; ->_postfixExpressionBrand : any - } - interface LeftHandSideExpression extends PostfixExpression { ->LeftHandSideExpression : LeftHandSideExpression ->PostfixExpression : PostfixExpression - - _leftHandSideExpressionBrand: any; ->_leftHandSideExpressionBrand : any - } - interface MemberExpression extends LeftHandSideExpression { ->MemberExpression : MemberExpression ->LeftHandSideExpression : LeftHandSideExpression - - _memberExpressionBrand: any; ->_memberExpressionBrand : any - } - interface PrimaryExpression extends MemberExpression { ->PrimaryExpression : PrimaryExpression ->MemberExpression : MemberExpression - - _primaryExpressionBrand: any; ->_primaryExpressionBrand : any - } - interface DeleteExpression extends UnaryExpression { ->DeleteExpression : DeleteExpression ->UnaryExpression : UnaryExpression - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface TypeOfExpression extends UnaryExpression { ->TypeOfExpression : TypeOfExpression ->UnaryExpression : UnaryExpression - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface VoidExpression extends UnaryExpression { ->VoidExpression : VoidExpression ->UnaryExpression : UnaryExpression - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface YieldExpression extends Expression { ->YieldExpression : YieldExpression ->Expression : Expression - - asteriskToken?: Node; ->asteriskToken : Node ->Node : Node - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface BinaryExpression extends Expression { ->BinaryExpression : BinaryExpression ->Expression : Expression - - left: Expression; ->left : Expression ->Expression : Expression - - operatorToken: Node; ->operatorToken : Node ->Node : Node - - right: Expression; ->right : Expression ->Expression : Expression - } - interface ConditionalExpression extends Expression { ->ConditionalExpression : ConditionalExpression ->Expression : Expression - - condition: Expression; ->condition : Expression ->Expression : Expression - - questionToken: Node; ->questionToken : Node ->Node : Node - - whenTrue: Expression; ->whenTrue : Expression ->Expression : Expression - - colonToken: Node; ->colonToken : Node ->Node : Node - - whenFalse: Expression; ->whenFalse : Expression ->Expression : Expression - } - interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration { ->FunctionExpression : FunctionExpression ->PrimaryExpression : PrimaryExpression ->FunctionLikeDeclaration : FunctionLikeDeclaration - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - body: Block | Expression; ->body : Expression | Block ->Block : Block ->Expression : Expression - } - interface ArrowFunction extends Expression, FunctionLikeDeclaration { ->ArrowFunction : ArrowFunction ->Expression : Expression ->FunctionLikeDeclaration : FunctionLikeDeclaration - - equalsGreaterThanToken: Node; ->equalsGreaterThanToken : Node ->Node : Node - } - interface LiteralExpression extends PrimaryExpression { ->LiteralExpression : LiteralExpression ->PrimaryExpression : PrimaryExpression - - text: string; ->text : string - - isUnterminated?: boolean; ->isUnterminated : boolean - - hasExtendedUnicodeEscape?: boolean; ->hasExtendedUnicodeEscape : boolean - } - interface StringLiteralExpression extends LiteralExpression { ->StringLiteralExpression : StringLiteralExpression ->LiteralExpression : LiteralExpression - - _stringLiteralExpressionBrand: any; ->_stringLiteralExpressionBrand : any - } - interface TemplateExpression extends PrimaryExpression { ->TemplateExpression : TemplateExpression ->PrimaryExpression : PrimaryExpression - - head: LiteralExpression; ->head : LiteralExpression ->LiteralExpression : LiteralExpression - - templateSpans: NodeArray; ->templateSpans : NodeArray ->NodeArray : NodeArray ->TemplateSpan : TemplateSpan - } - interface TemplateSpan extends Node { ->TemplateSpan : TemplateSpan ->Node : Node - - expression: Expression; ->expression : Expression ->Expression : Expression - - literal: LiteralExpression; ->literal : LiteralExpression ->LiteralExpression : LiteralExpression - } - interface ParenthesizedExpression extends PrimaryExpression { ->ParenthesizedExpression : ParenthesizedExpression ->PrimaryExpression : PrimaryExpression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ArrayLiteralExpression extends PrimaryExpression { ->ArrayLiteralExpression : ArrayLiteralExpression ->PrimaryExpression : PrimaryExpression - - elements: NodeArray; ->elements : NodeArray ->NodeArray : NodeArray ->Expression : Expression - } - interface SpreadElementExpression extends Expression { ->SpreadElementExpression : SpreadElementExpression ->Expression : Expression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ObjectLiteralExpression extends PrimaryExpression, Declaration { ->ObjectLiteralExpression : ObjectLiteralExpression ->PrimaryExpression : PrimaryExpression ->Declaration : Declaration - - properties: NodeArray; ->properties : NodeArray ->NodeArray : NodeArray ->ObjectLiteralElement : ObjectLiteralElement - } - interface PropertyAccessExpression extends MemberExpression { ->PropertyAccessExpression : PropertyAccessExpression ->MemberExpression : MemberExpression - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - dotToken: Node; ->dotToken : Node ->Node : Node - - name: Identifier; ->name : Identifier ->Identifier : Identifier - } - interface ElementAccessExpression extends MemberExpression { ->ElementAccessExpression : ElementAccessExpression ->MemberExpression : MemberExpression - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - argumentExpression?: Expression; ->argumentExpression : Expression ->Expression : Expression - } - interface CallExpression extends LeftHandSideExpression { ->CallExpression : CallExpression ->LeftHandSideExpression : LeftHandSideExpression - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - typeArguments?: NodeArray; ->typeArguments : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - - arguments: NodeArray; ->arguments : NodeArray ->NodeArray : NodeArray ->Expression : Expression - } - interface NewExpression extends CallExpression, PrimaryExpression { ->NewExpression : NewExpression ->CallExpression : CallExpression ->PrimaryExpression : PrimaryExpression - } - interface TaggedTemplateExpression extends MemberExpression { ->TaggedTemplateExpression : TaggedTemplateExpression ->MemberExpression : MemberExpression - - tag: LeftHandSideExpression; ->tag : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - template: LiteralExpression | TemplateExpression; ->template : LiteralExpression | TemplateExpression ->LiteralExpression : LiteralExpression ->TemplateExpression : TemplateExpression - } - type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression; ->CallLikeExpression : CallExpression | NewExpression | TaggedTemplateExpression ->CallExpression : CallExpression ->NewExpression : NewExpression ->TaggedTemplateExpression : TaggedTemplateExpression - - interface TypeAssertion extends UnaryExpression { ->TypeAssertion : TypeAssertion ->UnaryExpression : UnaryExpression - - type: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface Statement extends Node, ModuleElement { ->Statement : Statement ->Node : Node ->ModuleElement : ModuleElement - - _statementBrand: any; ->_statementBrand : any - } - interface Block extends Statement { ->Block : Block ->Statement : Statement - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->Statement : Statement - } - interface VariableStatement extends Statement { ->VariableStatement : VariableStatement ->Statement : Statement - - declarationList: VariableDeclarationList; ->declarationList : VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList - } - interface ExpressionStatement extends Statement { ->ExpressionStatement : ExpressionStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface IfStatement extends Statement { ->IfStatement : IfStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - - thenStatement: Statement; ->thenStatement : Statement ->Statement : Statement - - elseStatement?: Statement; ->elseStatement : Statement ->Statement : Statement - } - interface IterationStatement extends Statement { ->IterationStatement : IterationStatement ->Statement : Statement - - statement: Statement; ->statement : Statement ->Statement : Statement - } - interface DoStatement extends IterationStatement { ->DoStatement : DoStatement ->IterationStatement : IterationStatement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface WhileStatement extends IterationStatement { ->WhileStatement : WhileStatement ->IterationStatement : IterationStatement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ForStatement extends IterationStatement { ->ForStatement : ForStatement ->IterationStatement : IterationStatement - - initializer?: VariableDeclarationList | Expression; ->initializer : Expression | VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList ->Expression : Expression - - condition?: Expression; ->condition : Expression ->Expression : Expression - - iterator?: Expression; ->iterator : Expression ->Expression : Expression - } - interface ForInStatement extends IterationStatement { ->ForInStatement : ForInStatement ->IterationStatement : IterationStatement - - initializer: VariableDeclarationList | Expression; ->initializer : Expression | VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList ->Expression : Expression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ForOfStatement extends IterationStatement { ->ForOfStatement : ForOfStatement ->IterationStatement : IterationStatement - - initializer: VariableDeclarationList | Expression; ->initializer : Expression | VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList ->Expression : Expression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface BreakOrContinueStatement extends Statement { ->BreakOrContinueStatement : BreakOrContinueStatement ->Statement : Statement - - label?: Identifier; ->label : Identifier ->Identifier : Identifier - } - interface ReturnStatement extends Statement { ->ReturnStatement : ReturnStatement ->Statement : Statement - - expression?: Expression; ->expression : Expression ->Expression : Expression - } - interface WithStatement extends Statement { ->WithStatement : WithStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - - statement: Statement; ->statement : Statement ->Statement : Statement - } - interface SwitchStatement extends Statement { ->SwitchStatement : SwitchStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - - caseBlock: CaseBlock; ->caseBlock : CaseBlock ->CaseBlock : CaseBlock - } - interface CaseBlock extends Node { ->CaseBlock : CaseBlock ->Node : Node - - clauses: NodeArray; ->clauses : NodeArray ->NodeArray : NodeArray ->CaseOrDefaultClause : CaseClause | DefaultClause - } - interface CaseClause extends Node { ->CaseClause : CaseClause ->Node : Node - - expression?: Expression; ->expression : Expression ->Expression : Expression - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->Statement : Statement - } - interface DefaultClause extends Node { ->DefaultClause : DefaultClause ->Node : Node - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->Statement : Statement - } - type CaseOrDefaultClause = CaseClause | DefaultClause; ->CaseOrDefaultClause : CaseClause | DefaultClause ->CaseClause : CaseClause ->DefaultClause : DefaultClause - - interface LabeledStatement extends Statement { ->LabeledStatement : LabeledStatement ->Statement : Statement - - label: Identifier; ->label : Identifier ->Identifier : Identifier - - statement: Statement; ->statement : Statement ->Statement : Statement - } - interface ThrowStatement extends Statement { ->ThrowStatement : ThrowStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface TryStatement extends Statement { ->TryStatement : TryStatement ->Statement : Statement - - tryBlock: Block; ->tryBlock : Block ->Block : Block - - catchClause?: CatchClause; ->catchClause : CatchClause ->CatchClause : CatchClause - - finallyBlock?: Block; ->finallyBlock : Block ->Block : Block - } - interface CatchClause extends Node { ->CatchClause : CatchClause ->Node : Node - - variableDeclaration: VariableDeclaration; ->variableDeclaration : VariableDeclaration ->VariableDeclaration : VariableDeclaration - - block: Block; ->block : Block ->Block : Block - } - interface ModuleElement extends Node { ->ModuleElement : ModuleElement ->Node : Node - - _moduleElementBrand: any; ->_moduleElementBrand : any - } - interface ClassDeclaration extends Declaration, ModuleElement { ->ClassDeclaration : ClassDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - typeParameters?: NodeArray; ->typeParameters : NodeArray ->NodeArray : NodeArray ->TypeParameterDeclaration : TypeParameterDeclaration - - heritageClauses?: NodeArray; ->heritageClauses : NodeArray ->NodeArray : NodeArray ->HeritageClause : HeritageClause - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->ClassElement : ClassElement - } - interface ClassElement extends Declaration { ->ClassElement : ClassElement ->Declaration : Declaration - - _classElementBrand: any; ->_classElementBrand : any - } - interface InterfaceDeclaration extends Declaration, ModuleElement { ->InterfaceDeclaration : InterfaceDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - typeParameters?: NodeArray; ->typeParameters : NodeArray ->NodeArray : NodeArray ->TypeParameterDeclaration : TypeParameterDeclaration - - heritageClauses?: NodeArray; ->heritageClauses : NodeArray ->NodeArray : NodeArray ->HeritageClause : HeritageClause - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->Declaration : Declaration - } - interface HeritageClause extends Node { ->HeritageClause : HeritageClause ->Node : Node - - token: SyntaxKind; ->token : SyntaxKind ->SyntaxKind : SyntaxKind - - types?: NodeArray; ->types : NodeArray ->NodeArray : NodeArray ->TypeReferenceNode : TypeReferenceNode - } - interface TypeAliasDeclaration extends Declaration, ModuleElement { ->TypeAliasDeclaration : TypeAliasDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - type: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface EnumMember extends Declaration { ->EnumMember : EnumMember ->Declaration : Declaration - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface EnumDeclaration extends Declaration, ModuleElement { ->EnumDeclaration : EnumDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->EnumMember : EnumMember - } - interface ModuleDeclaration extends Declaration, ModuleElement { ->ModuleDeclaration : ModuleDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier | LiteralExpression; ->name : Identifier | LiteralExpression ->Identifier : Identifier ->LiteralExpression : LiteralExpression - - body: ModuleBlock | ModuleDeclaration; ->body : ModuleDeclaration | ModuleBlock ->ModuleBlock : ModuleBlock ->ModuleDeclaration : ModuleDeclaration - } - interface ModuleBlock extends Node, ModuleElement { ->ModuleBlock : ModuleBlock ->Node : Node ->ModuleElement : ModuleElement - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->ModuleElement : ModuleElement - } - interface ImportEqualsDeclaration extends Declaration, ModuleElement { ->ImportEqualsDeclaration : ImportEqualsDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - moduleReference: EntityName | ExternalModuleReference; ->moduleReference : Identifier | QualifiedName | ExternalModuleReference ->EntityName : Identifier | QualifiedName ->ExternalModuleReference : ExternalModuleReference - } - interface ExternalModuleReference extends Node { ->ExternalModuleReference : ExternalModuleReference ->Node : Node - - expression?: Expression; ->expression : Expression ->Expression : Expression - } - interface ImportDeclaration extends Statement, ModuleElement { ->ImportDeclaration : ImportDeclaration ->Statement : Statement ->ModuleElement : ModuleElement - - importClause?: ImportClause; ->importClause : ImportClause ->ImportClause : ImportClause - - moduleSpecifier: Expression; ->moduleSpecifier : Expression ->Expression : Expression - } - interface ImportClause extends Declaration { ->ImportClause : ImportClause ->Declaration : Declaration - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - namedBindings?: NamespaceImport | NamedImports; ->namedBindings : NamespaceImport | NamedImportsOrExports ->NamespaceImport : NamespaceImport ->NamedImports : NamedImportsOrExports - } - interface NamespaceImport extends Declaration { ->NamespaceImport : NamespaceImport ->Declaration : Declaration - - name: Identifier; ->name : Identifier ->Identifier : Identifier - } - interface ExportDeclaration extends Declaration, ModuleElement { ->ExportDeclaration : ExportDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - exportClause?: NamedExports; ->exportClause : NamedImportsOrExports ->NamedExports : NamedImportsOrExports - - moduleSpecifier?: Expression; ->moduleSpecifier : Expression ->Expression : Expression - } - interface NamedImportsOrExports extends Node { ->NamedImportsOrExports : NamedImportsOrExports ->Node : Node - - elements: NodeArray; ->elements : NodeArray ->NodeArray : NodeArray ->ImportOrExportSpecifier : ImportOrExportSpecifier - } - type NamedImports = NamedImportsOrExports; ->NamedImports : NamedImportsOrExports ->NamedImportsOrExports : NamedImportsOrExports - - type NamedExports = NamedImportsOrExports; ->NamedExports : NamedImportsOrExports ->NamedImportsOrExports : NamedImportsOrExports - - interface ImportOrExportSpecifier extends Declaration { ->ImportOrExportSpecifier : ImportOrExportSpecifier ->Declaration : Declaration - - propertyName?: Identifier; ->propertyName : Identifier ->Identifier : Identifier - - name: Identifier; ->name : Identifier ->Identifier : Identifier - } - type ImportSpecifier = ImportOrExportSpecifier; ->ImportSpecifier : ImportOrExportSpecifier ->ImportOrExportSpecifier : ImportOrExportSpecifier - - type ExportSpecifier = ImportOrExportSpecifier; ->ExportSpecifier : ImportOrExportSpecifier ->ImportOrExportSpecifier : ImportOrExportSpecifier - - interface ExportAssignment extends Declaration, ModuleElement { ->ExportAssignment : ExportAssignment ->Declaration : Declaration ->ModuleElement : ModuleElement - - isExportEquals?: boolean; ->isExportEquals : boolean - - expression?: Expression; ->expression : Expression ->Expression : Expression - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface FileReference extends TextRange { ->FileReference : FileReference ->TextRange : TextRange - - fileName: string; ->fileName : string - } - interface CommentRange extends TextRange { ->CommentRange : CommentRange ->TextRange : TextRange - - hasTrailingNewLine?: boolean; ->hasTrailingNewLine : boolean - } - interface SourceFile extends Declaration { ->SourceFile : SourceFile ->Declaration : Declaration - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->ModuleElement : ModuleElement - - endOfFileToken: Node; ->endOfFileToken : Node ->Node : Node - - fileName: string; ->fileName : string - - text: string; ->text : string - - amdDependencies: { ->amdDependencies : { path: string; name: string; }[] - - path: string; ->path : string - - name: string; ->name : string - - }[]; - amdModuleName: string; ->amdModuleName : string - - referencedFiles: FileReference[]; ->referencedFiles : FileReference[] ->FileReference : FileReference - - hasNoDefaultLib: boolean; ->hasNoDefaultLib : boolean - - externalModuleIndicator: Node; ->externalModuleIndicator : Node ->Node : Node - - languageVersion: ScriptTarget; ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget - - identifiers: Map; ->identifiers : Map ->Map : Map - } - interface ScriptReferenceHost { ->ScriptReferenceHost : ScriptReferenceHost - - getCompilerOptions(): CompilerOptions; ->getCompilerOptions : () => CompilerOptions ->CompilerOptions : CompilerOptions - - getSourceFile(fileName: string): SourceFile; ->getSourceFile : (fileName: string) => SourceFile ->fileName : string ->SourceFile : SourceFile - - getCurrentDirectory(): string; ->getCurrentDirectory : () => string - } - interface WriteFileCallback { ->WriteFileCallback : WriteFileCallback - - (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; ->fileName : string ->data : string ->writeByteOrderMark : boolean ->onError : (message: string) => void ->message : string - } - interface Program extends ScriptReferenceHost { ->Program : Program ->ScriptReferenceHost : ScriptReferenceHost - - getSourceFiles(): SourceFile[]; ->getSourceFiles : () => SourceFile[] ->SourceFile : SourceFile - - /** - * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then - * the JavaScript and declaration files will be produced for all the files in this program. - * If targetSourceFile is specified, then only the JavaScript and declaration for that - * specific file will be generated. - * - * If writeFile is not specified then the writeFile callback from the compiler host will be - * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter - * will be invoked when writing the JavaScript and declaration files. - */ - emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback): EmitResult; ->emit : (targetSourceFile?: SourceFile, writeFile?: WriteFileCallback) => EmitResult ->targetSourceFile : SourceFile ->SourceFile : SourceFile ->writeFile : WriteFileCallback ->WriteFileCallback : WriteFileCallback ->EmitResult : EmitResult - - getSyntacticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; ->getSyntacticDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Diagnostic : Diagnostic - - getGlobalDiagnostics(): Diagnostic[]; ->getGlobalDiagnostics : () => Diagnostic[] ->Diagnostic : Diagnostic - - getSemanticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; ->getSemanticDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Diagnostic : Diagnostic - - getDeclarationDiagnostics(sourceFile?: SourceFile): Diagnostic[]; ->getDeclarationDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Diagnostic : Diagnostic - - getTypeChecker(): TypeChecker; ->getTypeChecker : () => TypeChecker ->TypeChecker : TypeChecker - - getCommonSourceDirectory(): string; ->getCommonSourceDirectory : () => string - } - interface SourceMapSpan { ->SourceMapSpan : SourceMapSpan - - emittedLine: number; ->emittedLine : number - - emittedColumn: number; ->emittedColumn : number - - sourceLine: number; ->sourceLine : number - - sourceColumn: number; ->sourceColumn : number - - nameIndex?: number; ->nameIndex : number - - sourceIndex: number; ->sourceIndex : number - } - interface SourceMapData { ->SourceMapData : SourceMapData - - sourceMapFilePath: string; ->sourceMapFilePath : string - - jsSourceMappingURL: string; ->jsSourceMappingURL : string - - sourceMapFile: string; ->sourceMapFile : string - - sourceMapSourceRoot: string; ->sourceMapSourceRoot : string - - sourceMapSources: string[]; ->sourceMapSources : string[] - - inputSourceFileNames: string[]; ->inputSourceFileNames : string[] - - sourceMapNames?: string[]; ->sourceMapNames : string[] - - sourceMapMappings: string; ->sourceMapMappings : string - - sourceMapDecodedMappings: SourceMapSpan[]; ->sourceMapDecodedMappings : SourceMapSpan[] ->SourceMapSpan : SourceMapSpan - } - enum ExitStatus { ->ExitStatus : ExitStatus - - Success = 0, ->Success : ExitStatus - - DiagnosticsPresent_OutputsSkipped = 1, ->DiagnosticsPresent_OutputsSkipped : ExitStatus - - DiagnosticsPresent_OutputsGenerated = 2, ->DiagnosticsPresent_OutputsGenerated : ExitStatus - } - interface EmitResult { ->EmitResult : EmitResult - - emitSkipped: boolean; ->emitSkipped : boolean - - diagnostics: Diagnostic[]; ->diagnostics : Diagnostic[] ->Diagnostic : Diagnostic - - sourceMaps: SourceMapData[]; ->sourceMaps : SourceMapData[] ->SourceMapData : SourceMapData - } - interface TypeCheckerHost { ->TypeCheckerHost : TypeCheckerHost - - getCompilerOptions(): CompilerOptions; ->getCompilerOptions : () => CompilerOptions ->CompilerOptions : CompilerOptions - - getSourceFiles(): SourceFile[]; ->getSourceFiles : () => SourceFile[] ->SourceFile : SourceFile - - getSourceFile(fileName: string): SourceFile; ->getSourceFile : (fileName: string) => SourceFile ->fileName : string ->SourceFile : SourceFile - } - interface TypeChecker { ->TypeChecker : TypeChecker - - getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; ->getTypeOfSymbolAtLocation : (symbol: Symbol, node: Node) => Type ->symbol : Symbol ->Symbol : Symbol ->node : Node ->Node : Node ->Type : Type - - getDeclaredTypeOfSymbol(symbol: Symbol): Type; ->getDeclaredTypeOfSymbol : (symbol: Symbol) => Type ->symbol : Symbol ->Symbol : Symbol ->Type : Type - - getPropertiesOfType(type: Type): Symbol[]; ->getPropertiesOfType : (type: Type) => Symbol[] ->type : Type ->Type : Type ->Symbol : Symbol - - getPropertyOfType(type: Type, propertyName: string): Symbol; ->getPropertyOfType : (type: Type, propertyName: string) => Symbol ->type : Type ->Type : Type ->propertyName : string ->Symbol : Symbol - - getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; ->getSignaturesOfType : (type: Type, kind: SignatureKind) => Signature[] ->type : Type ->Type : Type ->kind : SignatureKind ->SignatureKind : SignatureKind ->Signature : Signature - - getIndexTypeOfType(type: Type, kind: IndexKind): Type; ->getIndexTypeOfType : (type: Type, kind: IndexKind) => Type ->type : Type ->Type : Type ->kind : IndexKind ->IndexKind : IndexKind ->Type : Type - - getReturnTypeOfSignature(signature: Signature): Type; ->getReturnTypeOfSignature : (signature: Signature) => Type ->signature : Signature ->Signature : Signature ->Type : Type - - getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; ->getSymbolsInScope : (location: Node, meaning: SymbolFlags) => Symbol[] ->location : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags ->Symbol : Symbol - - getSymbolAtLocation(node: Node): Symbol; ->getSymbolAtLocation : (node: Node) => Symbol ->node : Node ->Node : Node ->Symbol : Symbol - - getShorthandAssignmentValueSymbol(location: Node): Symbol; ->getShorthandAssignmentValueSymbol : (location: Node) => Symbol ->location : Node ->Node : Node ->Symbol : Symbol - - getTypeAtLocation(node: Node): Type; ->getTypeAtLocation : (node: Node) => Type ->node : Node ->Node : Node ->Type : Type - - typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; ->typeToString : (type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => string ->type : Type ->Type : Type ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; ->symbolToString : (symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) => string ->symbol : Symbol ->Symbol : Symbol ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags - - getSymbolDisplayBuilder(): SymbolDisplayBuilder; ->getSymbolDisplayBuilder : () => SymbolDisplayBuilder ->SymbolDisplayBuilder : SymbolDisplayBuilder - - getFullyQualifiedName(symbol: Symbol): string; ->getFullyQualifiedName : (symbol: Symbol) => string ->symbol : Symbol ->Symbol : Symbol - - getAugmentedPropertiesOfType(type: Type): Symbol[]; ->getAugmentedPropertiesOfType : (type: Type) => Symbol[] ->type : Type ->Type : Type ->Symbol : Symbol - - getRootSymbols(symbol: Symbol): Symbol[]; ->getRootSymbols : (symbol: Symbol) => Symbol[] ->symbol : Symbol ->Symbol : Symbol ->Symbol : Symbol - - getContextualType(node: Expression): Type; ->getContextualType : (node: Expression) => Type ->node : Expression ->Expression : Expression ->Type : Type - - getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature; ->getResolvedSignature : (node: CallExpression | NewExpression | TaggedTemplateExpression, candidatesOutArray?: Signature[]) => Signature ->node : CallExpression | NewExpression | TaggedTemplateExpression ->CallLikeExpression : CallExpression | NewExpression | TaggedTemplateExpression ->candidatesOutArray : Signature[] ->Signature : Signature ->Signature : Signature - - getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature; ->getSignatureFromDeclaration : (declaration: SignatureDeclaration) => Signature ->declaration : SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration ->Signature : Signature - - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; ->isImplementationOfOverload : (node: FunctionLikeDeclaration) => boolean ->node : FunctionLikeDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration - - isUndefinedSymbol(symbol: Symbol): boolean; ->isUndefinedSymbol : (symbol: Symbol) => boolean ->symbol : Symbol ->Symbol : Symbol - - isArgumentsSymbol(symbol: Symbol): boolean; ->isArgumentsSymbol : (symbol: Symbol) => boolean ->symbol : Symbol ->Symbol : Symbol - - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; ->getConstantValue : (node: PropertyAccessExpression | ElementAccessExpression | EnumMember) => number ->node : PropertyAccessExpression | ElementAccessExpression | EnumMember ->EnumMember : EnumMember ->PropertyAccessExpression : PropertyAccessExpression ->ElementAccessExpression : ElementAccessExpression - - isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; ->isValidPropertyAccess : (node: QualifiedName | PropertyAccessExpression, propertyName: string) => boolean ->node : QualifiedName | PropertyAccessExpression ->PropertyAccessExpression : PropertyAccessExpression ->QualifiedName : QualifiedName ->propertyName : string - - getAliasedSymbol(symbol: Symbol): Symbol; ->getAliasedSymbol : (symbol: Symbol) => Symbol ->symbol : Symbol ->Symbol : Symbol ->Symbol : Symbol - - getExportsOfExternalModule(node: ImportDeclaration): Symbol[]; ->getExportsOfExternalModule : (node: ImportDeclaration) => Symbol[] ->node : ImportDeclaration ->ImportDeclaration : ImportDeclaration ->Symbol : Symbol - } - interface SymbolDisplayBuilder { ->SymbolDisplayBuilder : SymbolDisplayBuilder - - buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildTypeDisplay : (type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->type : Type ->Type : Type ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; ->buildSymbolDisplay : (symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags) => void ->symbol : Symbol ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags ->flags : SymbolFormatFlags ->SymbolFormatFlags : SymbolFormatFlags - - buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildSignatureDisplay : (signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->signatures : Signature ->Signature : Signature ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildParameterDisplay : (parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->parameter : Symbol ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildTypeParameterDisplay : (tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->tp : TypeParameter ->TypeParameter : TypeParameter ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags): void; ->buildTypeParameterDisplayFromSymbol : (symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags) => void ->symbol : Symbol ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaraiton : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildDisplayForParametersAndDelimiters(parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildDisplayForParametersAndDelimiters : (parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->parameters : Symbol[] ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildDisplayForTypeParametersAndDelimiters : (typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->typeParameters : TypeParameter[] ->TypeParameter : TypeParameter ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildReturnTypeDisplay : (signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->signature : Signature ->Signature : Signature ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - } - interface SymbolWriter { ->SymbolWriter : SymbolWriter - - writeKeyword(text: string): void; ->writeKeyword : (text: string) => void ->text : string - - writeOperator(text: string): void; ->writeOperator : (text: string) => void ->text : string - - writePunctuation(text: string): void; ->writePunctuation : (text: string) => void ->text : string - - writeSpace(text: string): void; ->writeSpace : (text: string) => void ->text : string - - writeStringLiteral(text: string): void; ->writeStringLiteral : (text: string) => void ->text : string - - writeParameter(text: string): void; ->writeParameter : (text: string) => void ->text : string - - writeSymbol(text: string, symbol: Symbol): void; ->writeSymbol : (text: string, symbol: Symbol) => void ->text : string ->symbol : Symbol ->Symbol : Symbol - - writeLine(): void; ->writeLine : () => void - - increaseIndent(): void; ->increaseIndent : () => void - - decreaseIndent(): void; ->decreaseIndent : () => void - - clear(): void; ->clear : () => void - - trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; ->trackSymbol : (symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) => void ->symbol : Symbol ->Symbol : Symbol ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags - } - const enum TypeFormatFlags { ->TypeFormatFlags : TypeFormatFlags - - None = 0, ->None : TypeFormatFlags - - WriteArrayAsGenericType = 1, ->WriteArrayAsGenericType : TypeFormatFlags - - UseTypeOfFunction = 2, ->UseTypeOfFunction : TypeFormatFlags - - NoTruncation = 4, ->NoTruncation : TypeFormatFlags - - WriteArrowStyleSignature = 8, ->WriteArrowStyleSignature : TypeFormatFlags - - WriteOwnNameForAnyLike = 16, ->WriteOwnNameForAnyLike : TypeFormatFlags - - WriteTypeArgumentsOfSignature = 32, ->WriteTypeArgumentsOfSignature : TypeFormatFlags - - InElementType = 64, ->InElementType : TypeFormatFlags - - UseFullyQualifiedType = 128, ->UseFullyQualifiedType : TypeFormatFlags - } - const enum SymbolFormatFlags { ->SymbolFormatFlags : SymbolFormatFlags - - None = 0, ->None : SymbolFormatFlags - - WriteTypeParametersOrArguments = 1, ->WriteTypeParametersOrArguments : SymbolFormatFlags - - UseOnlyExternalAliasing = 2, ->UseOnlyExternalAliasing : SymbolFormatFlags - } - const enum SymbolAccessibility { ->SymbolAccessibility : SymbolAccessibility - - Accessible = 0, ->Accessible : SymbolAccessibility - - NotAccessible = 1, ->NotAccessible : SymbolAccessibility - - CannotBeNamed = 2, ->CannotBeNamed : SymbolAccessibility - } - type AnyImportSyntax = ImportDeclaration | ImportEqualsDeclaration; ->AnyImportSyntax : ImportEqualsDeclaration | ImportDeclaration ->ImportDeclaration : ImportDeclaration ->ImportEqualsDeclaration : ImportEqualsDeclaration - - interface SymbolVisibilityResult { ->SymbolVisibilityResult : SymbolVisibilityResult - - accessibility: SymbolAccessibility; ->accessibility : SymbolAccessibility ->SymbolAccessibility : SymbolAccessibility - - aliasesToMakeVisible?: AnyImportSyntax[]; ->aliasesToMakeVisible : (ImportEqualsDeclaration | ImportDeclaration)[] ->AnyImportSyntax : ImportEqualsDeclaration | ImportDeclaration - - errorSymbolName?: string; ->errorSymbolName : string - - errorNode?: Node; ->errorNode : Node ->Node : Node - } - interface SymbolAccessiblityResult extends SymbolVisibilityResult { ->SymbolAccessiblityResult : SymbolAccessiblityResult ->SymbolVisibilityResult : SymbolVisibilityResult - - errorModuleName?: string; ->errorModuleName : string - } - interface EmitResolver { ->EmitResolver : EmitResolver - - hasGlobalName(name: string): boolean; ->hasGlobalName : (name: string) => boolean ->name : string - - getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string; ->getExpressionNameSubstitution : (node: Identifier, getGeneratedNameForNode: (node: Node) => string) => string ->node : Identifier ->Identifier : Identifier ->getGeneratedNameForNode : (node: Node) => string ->node : Node ->Node : Node - - isValueAliasDeclaration(node: Node): boolean; ->isValueAliasDeclaration : (node: Node) => boolean ->node : Node ->Node : Node - - isReferencedAliasDeclaration(node: Node, checkChildren?: boolean): boolean; ->isReferencedAliasDeclaration : (node: Node, checkChildren?: boolean) => boolean ->node : Node ->Node : Node ->checkChildren : boolean - - isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; ->isTopLevelValueImportEqualsWithEntityName : (node: ImportEqualsDeclaration) => boolean ->node : ImportEqualsDeclaration ->ImportEqualsDeclaration : ImportEqualsDeclaration - - getNodeCheckFlags(node: Node): NodeCheckFlags; ->getNodeCheckFlags : (node: Node) => NodeCheckFlags ->node : Node ->Node : Node ->NodeCheckFlags : NodeCheckFlags - - isDeclarationVisible(node: Declaration): boolean; ->isDeclarationVisible : (node: Declaration) => boolean ->node : Declaration ->Declaration : Declaration - - collectLinkedAliases(node: Identifier): Node[]; ->collectLinkedAliases : (node: Identifier) => Node[] ->node : Identifier ->Identifier : Identifier ->Node : Node - - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; ->isImplementationOfOverload : (node: FunctionLikeDeclaration) => boolean ->node : FunctionLikeDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration - - writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; ->writeTypeOfDeclaration : (declaration: VariableLikeDeclaration | AccessorDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void ->declaration : VariableLikeDeclaration | AccessorDeclaration ->AccessorDeclaration : AccessorDeclaration ->VariableLikeDeclaration : VariableLikeDeclaration ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags ->writer : SymbolWriter ->SymbolWriter : SymbolWriter - - writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; ->writeReturnTypeOfSignatureDeclaration : (signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void ->signatureDeclaration : SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags ->writer : SymbolWriter ->SymbolWriter : SymbolWriter - - writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; ->writeTypeOfExpression : (expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void ->expr : Expression ->Expression : Expression ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags ->writer : SymbolWriter ->SymbolWriter : SymbolWriter - - isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult; ->isSymbolAccessible : (symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags) => SymbolAccessiblityResult ->symbol : Symbol ->Symbol : Symbol ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags ->SymbolAccessiblityResult : SymbolAccessiblityResult - - isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult; ->isEntityNameVisible : (entityName: Identifier | QualifiedName, enclosingDeclaration: Node) => SymbolVisibilityResult ->entityName : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName ->enclosingDeclaration : Node ->Node : Node ->SymbolVisibilityResult : SymbolVisibilityResult - - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; ->getConstantValue : (node: PropertyAccessExpression | ElementAccessExpression | EnumMember) => number ->node : PropertyAccessExpression | ElementAccessExpression | EnumMember ->EnumMember : EnumMember ->PropertyAccessExpression : PropertyAccessExpression ->ElementAccessExpression : ElementAccessExpression - - resolvesToSomeValue(location: Node, name: string): boolean; ->resolvesToSomeValue : (location: Node, name: string) => boolean ->location : Node ->Node : Node ->name : string - - getBlockScopedVariableId(node: Identifier): number; ->getBlockScopedVariableId : (node: Identifier) => number ->node : Identifier ->Identifier : Identifier - } - const enum SymbolFlags { ->SymbolFlags : SymbolFlags - - FunctionScopedVariable = 1, ->FunctionScopedVariable : SymbolFlags - - BlockScopedVariable = 2, ->BlockScopedVariable : SymbolFlags - - Property = 4, ->Property : SymbolFlags - - EnumMember = 8, ->EnumMember : SymbolFlags - - Function = 16, ->Function : SymbolFlags - - Class = 32, ->Class : SymbolFlags - - Interface = 64, ->Interface : SymbolFlags - - ConstEnum = 128, ->ConstEnum : SymbolFlags - - RegularEnum = 256, ->RegularEnum : SymbolFlags - - ValueModule = 512, ->ValueModule : SymbolFlags - - NamespaceModule = 1024, ->NamespaceModule : SymbolFlags - - TypeLiteral = 2048, ->TypeLiteral : SymbolFlags - - ObjectLiteral = 4096, ->ObjectLiteral : SymbolFlags - - Method = 8192, ->Method : SymbolFlags - - Constructor = 16384, ->Constructor : SymbolFlags - - GetAccessor = 32768, ->GetAccessor : SymbolFlags - - SetAccessor = 65536, ->SetAccessor : SymbolFlags - - Signature = 131072, ->Signature : SymbolFlags - - TypeParameter = 262144, ->TypeParameter : SymbolFlags - - TypeAlias = 524288, ->TypeAlias : SymbolFlags - - ExportValue = 1048576, ->ExportValue : SymbolFlags - - ExportType = 2097152, ->ExportType : SymbolFlags - - ExportNamespace = 4194304, ->ExportNamespace : SymbolFlags - - Alias = 8388608, ->Alias : SymbolFlags - - Instantiated = 16777216, ->Instantiated : SymbolFlags - - Merged = 33554432, ->Merged : SymbolFlags - - Transient = 67108864, ->Transient : SymbolFlags - - Prototype = 134217728, ->Prototype : SymbolFlags - - UnionProperty = 268435456, ->UnionProperty : SymbolFlags - - Optional = 536870912, ->Optional : SymbolFlags - - ExportStar = 1073741824, ->ExportStar : SymbolFlags - - Enum = 384, ->Enum : SymbolFlags - - Variable = 3, ->Variable : SymbolFlags - - Value = 107455, ->Value : SymbolFlags - - Type = 793056, ->Type : SymbolFlags - - Namespace = 1536, ->Namespace : SymbolFlags - - Module = 1536, ->Module : SymbolFlags - - Accessor = 98304, ->Accessor : SymbolFlags - - FunctionScopedVariableExcludes = 107454, ->FunctionScopedVariableExcludes : SymbolFlags - - BlockScopedVariableExcludes = 107455, ->BlockScopedVariableExcludes : SymbolFlags - - ParameterExcludes = 107455, ->ParameterExcludes : SymbolFlags - - PropertyExcludes = 107455, ->PropertyExcludes : SymbolFlags - - EnumMemberExcludes = 107455, ->EnumMemberExcludes : SymbolFlags - - FunctionExcludes = 106927, ->FunctionExcludes : SymbolFlags - - ClassExcludes = 899583, ->ClassExcludes : SymbolFlags - - InterfaceExcludes = 792992, ->InterfaceExcludes : SymbolFlags - - RegularEnumExcludes = 899327, ->RegularEnumExcludes : SymbolFlags - - ConstEnumExcludes = 899967, ->ConstEnumExcludes : SymbolFlags - - ValueModuleExcludes = 106639, ->ValueModuleExcludes : SymbolFlags - - NamespaceModuleExcludes = 0, ->NamespaceModuleExcludes : SymbolFlags - - MethodExcludes = 99263, ->MethodExcludes : SymbolFlags - - GetAccessorExcludes = 41919, ->GetAccessorExcludes : SymbolFlags - - SetAccessorExcludes = 74687, ->SetAccessorExcludes : SymbolFlags - - TypeParameterExcludes = 530912, ->TypeParameterExcludes : SymbolFlags - - TypeAliasExcludes = 793056, ->TypeAliasExcludes : SymbolFlags - - AliasExcludes = 8388608, ->AliasExcludes : SymbolFlags - - ModuleMember = 8914931, ->ModuleMember : SymbolFlags - - ExportHasLocal = 944, ->ExportHasLocal : SymbolFlags - - HasLocals = 255504, ->HasLocals : SymbolFlags - - HasExports = 1952, ->HasExports : SymbolFlags - - HasMembers = 6240, ->HasMembers : SymbolFlags - - IsContainer = 262128, ->IsContainer : SymbolFlags - - PropertyOrAccessor = 98308, ->PropertyOrAccessor : SymbolFlags - - Export = 7340032, ->Export : SymbolFlags - } - interface Symbol { ->Symbol : Symbol - - flags: SymbolFlags; ->flags : SymbolFlags ->SymbolFlags : SymbolFlags - - name: string; ->name : string - - id?: number; ->id : number - - mergeId?: number; ->mergeId : number - - declarations?: Declaration[]; ->declarations : Declaration[] ->Declaration : Declaration - - parent?: Symbol; ->parent : Symbol ->Symbol : Symbol - - members?: SymbolTable; ->members : SymbolTable ->SymbolTable : SymbolTable - - exports?: SymbolTable; ->exports : SymbolTable ->SymbolTable : SymbolTable - - exportSymbol?: Symbol; ->exportSymbol : Symbol ->Symbol : Symbol - - valueDeclaration?: Declaration; ->valueDeclaration : Declaration ->Declaration : Declaration - - constEnumOnlyModule?: boolean; ->constEnumOnlyModule : boolean - } - interface SymbolLinks { ->SymbolLinks : SymbolLinks - - target?: Symbol; ->target : Symbol ->Symbol : Symbol - - type?: Type; ->type : Type ->Type : Type - - declaredType?: Type; ->declaredType : Type ->Type : Type - - mapper?: TypeMapper; ->mapper : TypeMapper ->TypeMapper : TypeMapper - - referenced?: boolean; ->referenced : boolean - - unionType?: UnionType; ->unionType : UnionType ->UnionType : UnionType - - resolvedExports?: SymbolTable; ->resolvedExports : SymbolTable ->SymbolTable : SymbolTable - - exportsChecked?: boolean; ->exportsChecked : boolean - } - interface TransientSymbol extends Symbol, SymbolLinks { ->TransientSymbol : TransientSymbol ->Symbol : Symbol ->SymbolLinks : SymbolLinks - } - interface SymbolTable { ->SymbolTable : SymbolTable - - [index: string]: Symbol; ->index : string ->Symbol : Symbol - } - const enum NodeCheckFlags { ->NodeCheckFlags : NodeCheckFlags - - TypeChecked = 1, ->TypeChecked : NodeCheckFlags - - LexicalThis = 2, ->LexicalThis : NodeCheckFlags - - CaptureThis = 4, ->CaptureThis : NodeCheckFlags - - EmitExtends = 8, ->EmitExtends : NodeCheckFlags - - SuperInstance = 16, ->SuperInstance : NodeCheckFlags - - SuperStatic = 32, ->SuperStatic : NodeCheckFlags - - ContextChecked = 64, ->ContextChecked : NodeCheckFlags - - EnumValuesComputed = 128, ->EnumValuesComputed : NodeCheckFlags - - BlockScopedBindingInLoop = 256, ->BlockScopedBindingInLoop : NodeCheckFlags - - EmitDecorate = 512, ->EmitDecorate : NodeCheckFlags - } - interface NodeLinks { ->NodeLinks : NodeLinks - - resolvedType?: Type; ->resolvedType : Type ->Type : Type - - resolvedSignature?: Signature; ->resolvedSignature : Signature ->Signature : Signature - - resolvedSymbol?: Symbol; ->resolvedSymbol : Symbol ->Symbol : Symbol - - flags?: NodeCheckFlags; ->flags : NodeCheckFlags ->NodeCheckFlags : NodeCheckFlags - - enumMemberValue?: number; ->enumMemberValue : number - - isIllegalTypeReferenceInConstraint?: boolean; ->isIllegalTypeReferenceInConstraint : boolean - - isVisible?: boolean; ->isVisible : boolean - - generatedName?: string; ->generatedName : string - - generatedNames?: Map; ->generatedNames : Map ->Map : Map - - assignmentChecks?: Map; ->assignmentChecks : Map ->Map : Map - - hasReportedStatementInAmbientContext?: boolean; ->hasReportedStatementInAmbientContext : boolean - - importOnRightSide?: Symbol; ->importOnRightSide : Symbol ->Symbol : Symbol - } - const enum TypeFlags { ->TypeFlags : TypeFlags - - Any = 1, ->Any : TypeFlags - - String = 2, ->String : TypeFlags - - Number = 4, ->Number : TypeFlags - - Boolean = 8, ->Boolean : TypeFlags - - Void = 16, ->Void : TypeFlags - - Undefined = 32, ->Undefined : TypeFlags - - Null = 64, ->Null : TypeFlags - - Enum = 128, ->Enum : TypeFlags - - StringLiteral = 256, ->StringLiteral : TypeFlags - - TypeParameter = 512, ->TypeParameter : TypeFlags - - Class = 1024, ->Class : TypeFlags - - Interface = 2048, ->Interface : TypeFlags - - Reference = 4096, ->Reference : TypeFlags - - Tuple = 8192, ->Tuple : TypeFlags - - Union = 16384, ->Union : TypeFlags - - Anonymous = 32768, ->Anonymous : TypeFlags - - FromSignature = 65536, ->FromSignature : TypeFlags - - ObjectLiteral = 131072, ->ObjectLiteral : TypeFlags - - ContainsUndefinedOrNull = 262144, ->ContainsUndefinedOrNull : TypeFlags - - ContainsObjectLiteral = 524288, ->ContainsObjectLiteral : TypeFlags - - ESSymbol = 1048576, ->ESSymbol : TypeFlags - - Intrinsic = 1048703, ->Intrinsic : TypeFlags - - Primitive = 1049086, ->Primitive : TypeFlags - - StringLike = 258, ->StringLike : TypeFlags - - NumberLike = 132, ->NumberLike : TypeFlags - - ObjectType = 48128, ->ObjectType : TypeFlags - - RequiresWidening = 786432, ->RequiresWidening : TypeFlags - } - interface Type { ->Type : Type - - flags: TypeFlags; ->flags : TypeFlags ->TypeFlags : TypeFlags - - id: number; ->id : number - - symbol?: Symbol; ->symbol : Symbol ->Symbol : Symbol - } - interface IntrinsicType extends Type { ->IntrinsicType : IntrinsicType ->Type : Type - - intrinsicName: string; ->intrinsicName : string - } - interface StringLiteralType extends Type { ->StringLiteralType : StringLiteralType ->Type : Type - - text: string; ->text : string - } - interface ObjectType extends Type { ->ObjectType : ObjectType ->Type : Type - } - interface InterfaceType extends ObjectType { ->InterfaceType : InterfaceType ->ObjectType : ObjectType - - typeParameters: TypeParameter[]; ->typeParameters : TypeParameter[] ->TypeParameter : TypeParameter - - baseTypes: ObjectType[]; ->baseTypes : ObjectType[] ->ObjectType : ObjectType - - declaredProperties: Symbol[]; ->declaredProperties : Symbol[] ->Symbol : Symbol - - declaredCallSignatures: Signature[]; ->declaredCallSignatures : Signature[] ->Signature : Signature - - declaredConstructSignatures: Signature[]; ->declaredConstructSignatures : Signature[] ->Signature : Signature - - declaredStringIndexType: Type; ->declaredStringIndexType : Type ->Type : Type - - declaredNumberIndexType: Type; ->declaredNumberIndexType : Type ->Type : Type - } - interface TypeReference extends ObjectType { ->TypeReference : TypeReference ->ObjectType : ObjectType - - target: GenericType; ->target : GenericType ->GenericType : GenericType - - typeArguments: Type[]; ->typeArguments : Type[] ->Type : Type - } - interface GenericType extends InterfaceType, TypeReference { ->GenericType : GenericType ->InterfaceType : InterfaceType ->TypeReference : TypeReference - - instantiations: Map; ->instantiations : Map ->Map : Map ->TypeReference : TypeReference - } - interface TupleType extends ObjectType { ->TupleType : TupleType ->ObjectType : ObjectType - - elementTypes: Type[]; ->elementTypes : Type[] ->Type : Type - - baseArrayType: TypeReference; ->baseArrayType : TypeReference ->TypeReference : TypeReference - } - interface UnionType extends Type { ->UnionType : UnionType ->Type : Type - - types: Type[]; ->types : Type[] ->Type : Type - - resolvedProperties: SymbolTable; ->resolvedProperties : SymbolTable ->SymbolTable : SymbolTable - } - interface ResolvedType extends ObjectType, UnionType { ->ResolvedType : ResolvedType ->ObjectType : ObjectType ->UnionType : UnionType - - members: SymbolTable; ->members : SymbolTable ->SymbolTable : SymbolTable - - properties: Symbol[]; ->properties : Symbol[] ->Symbol : Symbol - - callSignatures: Signature[]; ->callSignatures : Signature[] ->Signature : Signature - - constructSignatures: Signature[]; ->constructSignatures : Signature[] ->Signature : Signature - - stringIndexType: Type; ->stringIndexType : Type ->Type : Type - - numberIndexType: Type; ->numberIndexType : Type ->Type : Type - } - interface TypeParameter extends Type { ->TypeParameter : TypeParameter ->Type : Type - - constraint: Type; ->constraint : Type ->Type : Type - - target?: TypeParameter; ->target : TypeParameter ->TypeParameter : TypeParameter - - mapper?: TypeMapper; ->mapper : TypeMapper ->TypeMapper : TypeMapper - } - const enum SignatureKind { ->SignatureKind : SignatureKind - - Call = 0, ->Call : SignatureKind - - Construct = 1, ->Construct : SignatureKind - } - interface Signature { ->Signature : Signature - - declaration: SignatureDeclaration; ->declaration : SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration - - typeParameters: TypeParameter[]; ->typeParameters : TypeParameter[] ->TypeParameter : TypeParameter - - parameters: Symbol[]; ->parameters : Symbol[] ->Symbol : Symbol - - resolvedReturnType: Type; ->resolvedReturnType : Type ->Type : Type - - minArgumentCount: number; ->minArgumentCount : number - - hasRestParameter: boolean; ->hasRestParameter : boolean - - hasStringLiterals: boolean; ->hasStringLiterals : boolean - - target?: Signature; ->target : Signature ->Signature : Signature - - mapper?: TypeMapper; ->mapper : TypeMapper ->TypeMapper : TypeMapper - - unionSignatures?: Signature[]; ->unionSignatures : Signature[] ->Signature : Signature - - erasedSignatureCache?: Signature; ->erasedSignatureCache : Signature ->Signature : Signature - - isolatedSignatureType?: ObjectType; ->isolatedSignatureType : ObjectType ->ObjectType : ObjectType - } - const enum IndexKind { ->IndexKind : IndexKind - - String = 0, ->String : IndexKind - - Number = 1, ->Number : IndexKind - } - interface TypeMapper { ->TypeMapper : TypeMapper - - (t: Type): Type; ->t : Type ->Type : Type ->Type : Type - } - interface DiagnosticMessage { ->DiagnosticMessage : DiagnosticMessage - - key: string; ->key : string - - category: DiagnosticCategory; ->category : DiagnosticCategory ->DiagnosticCategory : DiagnosticCategory - - code: number; ->code : number - } - interface DiagnosticMessageChain { ->DiagnosticMessageChain : DiagnosticMessageChain - - messageText: string; ->messageText : string - - category: DiagnosticCategory; ->category : DiagnosticCategory ->DiagnosticCategory : DiagnosticCategory - - code: number; ->code : number - - next?: DiagnosticMessageChain; ->next : DiagnosticMessageChain ->DiagnosticMessageChain : DiagnosticMessageChain - } - interface Diagnostic { ->Diagnostic : Diagnostic - - file: SourceFile; ->file : SourceFile ->SourceFile : SourceFile - - start: number; ->start : number - - length: number; ->length : number - - messageText: string | DiagnosticMessageChain; ->messageText : string | DiagnosticMessageChain ->DiagnosticMessageChain : DiagnosticMessageChain - - category: DiagnosticCategory; ->category : DiagnosticCategory ->DiagnosticCategory : DiagnosticCategory - - code: number; ->code : number - } - enum DiagnosticCategory { ->DiagnosticCategory : DiagnosticCategory - - Warning = 0, ->Warning : DiagnosticCategory - - Error = 1, ->Error : DiagnosticCategory - - Message = 2, ->Message : DiagnosticCategory - } - interface CompilerOptions { ->CompilerOptions : CompilerOptions - - allowNonTsExtensions?: boolean; ->allowNonTsExtensions : boolean - - charset?: string; ->charset : string - - codepage?: number; ->codepage : number - - declaration?: boolean; ->declaration : boolean - - diagnostics?: boolean; ->diagnostics : boolean - - emitBOM?: boolean; ->emitBOM : boolean - - help?: boolean; ->help : boolean - - listFiles?: boolean; ->listFiles : boolean - - locale?: string; ->locale : string - - mapRoot?: string; ->mapRoot : string - - module?: ModuleKind; ->module : ModuleKind ->ModuleKind : ModuleKind - - noEmit?: boolean; ->noEmit : boolean - - noEmitOnError?: boolean; ->noEmitOnError : boolean - - noErrorTruncation?: boolean; ->noErrorTruncation : boolean - - noImplicitAny?: boolean; ->noImplicitAny : boolean - - noLib?: boolean; ->noLib : boolean - - noLibCheck?: boolean; ->noLibCheck : boolean - - noResolve?: boolean; ->noResolve : boolean - - out?: string; ->out : string - - outDir?: string; ->outDir : string - - preserveConstEnums?: boolean; ->preserveConstEnums : boolean - - project?: string; ->project : string - - removeComments?: boolean; ->removeComments : boolean - - sourceMap?: boolean; ->sourceMap : boolean - - sourceRoot?: string; ->sourceRoot : string - - suppressImplicitAnyIndexErrors?: boolean; ->suppressImplicitAnyIndexErrors : boolean - - target?: ScriptTarget; ->target : ScriptTarget ->ScriptTarget : ScriptTarget - - version?: boolean; ->version : boolean - - watch?: boolean; ->watch : boolean - - [option: string]: string | number | boolean; ->option : string - } - const enum ModuleKind { ->ModuleKind : ModuleKind - - None = 0, ->None : ModuleKind - - CommonJS = 1, ->CommonJS : ModuleKind - - AMD = 2, ->AMD : ModuleKind - } - interface LineAndCharacter { ->LineAndCharacter : LineAndCharacter - - line: number; ->line : number - - character: number; ->character : number - } - const enum ScriptTarget { ->ScriptTarget : ScriptTarget - - ES3 = 0, ->ES3 : ScriptTarget - - ES5 = 1, ->ES5 : ScriptTarget - - ES6 = 2, ->ES6 : ScriptTarget - - Latest = 2, ->Latest : ScriptTarget - } - interface ParsedCommandLine { ->ParsedCommandLine : ParsedCommandLine - - options: CompilerOptions; ->options : CompilerOptions ->CompilerOptions : CompilerOptions - - fileNames: string[]; ->fileNames : string[] - - errors: Diagnostic[]; ->errors : Diagnostic[] ->Diagnostic : Diagnostic - } - interface CommandLineOption { ->CommandLineOption : CommandLineOption - - name: string; ->name : string - - type: string | Map; ->type : string | Map ->Map : Map - - isFilePath?: boolean; ->isFilePath : boolean - - shortName?: string; ->shortName : string - - description?: DiagnosticMessage; ->description : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage - - paramType?: DiagnosticMessage; ->paramType : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage - - error?: DiagnosticMessage; ->error : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage - - experimental?: boolean; ->experimental : boolean - } - const enum CharacterCodes { ->CharacterCodes : CharacterCodes - - nullCharacter = 0, ->nullCharacter : CharacterCodes - - maxAsciiCharacter = 127, ->maxAsciiCharacter : CharacterCodes - - lineFeed = 10, ->lineFeed : CharacterCodes - - carriageReturn = 13, ->carriageReturn : CharacterCodes - - lineSeparator = 8232, ->lineSeparator : CharacterCodes - - paragraphSeparator = 8233, ->paragraphSeparator : CharacterCodes - - nextLine = 133, ->nextLine : CharacterCodes - - space = 32, ->space : CharacterCodes - - nonBreakingSpace = 160, ->nonBreakingSpace : CharacterCodes - - enQuad = 8192, ->enQuad : CharacterCodes - - emQuad = 8193, ->emQuad : CharacterCodes - - enSpace = 8194, ->enSpace : CharacterCodes - - emSpace = 8195, ->emSpace : CharacterCodes - - threePerEmSpace = 8196, ->threePerEmSpace : CharacterCodes - - fourPerEmSpace = 8197, ->fourPerEmSpace : CharacterCodes - - sixPerEmSpace = 8198, ->sixPerEmSpace : CharacterCodes - - figureSpace = 8199, ->figureSpace : CharacterCodes - - punctuationSpace = 8200, ->punctuationSpace : CharacterCodes - - thinSpace = 8201, ->thinSpace : CharacterCodes - - hairSpace = 8202, ->hairSpace : CharacterCodes - - zeroWidthSpace = 8203, ->zeroWidthSpace : CharacterCodes - - narrowNoBreakSpace = 8239, ->narrowNoBreakSpace : CharacterCodes - - ideographicSpace = 12288, ->ideographicSpace : CharacterCodes - - mathematicalSpace = 8287, ->mathematicalSpace : CharacterCodes - - ogham = 5760, ->ogham : CharacterCodes - - _ = 95, ->_ : CharacterCodes - - $ = 36, ->$ : CharacterCodes - - _0 = 48, ->_0 : CharacterCodes - - _1 = 49, ->_1 : CharacterCodes - - _2 = 50, ->_2 : CharacterCodes - - _3 = 51, ->_3 : CharacterCodes - - _4 = 52, ->_4 : CharacterCodes - - _5 = 53, ->_5 : CharacterCodes - - _6 = 54, ->_6 : CharacterCodes - - _7 = 55, ->_7 : CharacterCodes - - _8 = 56, ->_8 : CharacterCodes - - _9 = 57, ->_9 : CharacterCodes - - a = 97, ->a : CharacterCodes - - b = 98, ->b : CharacterCodes - - c = 99, ->c : CharacterCodes - - d = 100, ->d : CharacterCodes - - e = 101, ->e : CharacterCodes - - f = 102, ->f : CharacterCodes - - g = 103, ->g : CharacterCodes - - h = 104, ->h : CharacterCodes - - i = 105, ->i : CharacterCodes - - j = 106, ->j : CharacterCodes - - k = 107, ->k : CharacterCodes - - l = 108, ->l : CharacterCodes - - m = 109, ->m : CharacterCodes - - n = 110, ->n : CharacterCodes - - o = 111, ->o : CharacterCodes - - p = 112, ->p : CharacterCodes - - q = 113, ->q : CharacterCodes - - r = 114, ->r : CharacterCodes - - s = 115, ->s : CharacterCodes - - t = 116, ->t : CharacterCodes - - u = 117, ->u : CharacterCodes - - v = 118, ->v : CharacterCodes - - w = 119, ->w : CharacterCodes - - x = 120, ->x : CharacterCodes - - y = 121, ->y : CharacterCodes - - z = 122, ->z : CharacterCodes - - A = 65, ->A : CharacterCodes - - B = 66, ->B : CharacterCodes - - C = 67, ->C : CharacterCodes - - D = 68, ->D : CharacterCodes - - E = 69, ->E : CharacterCodes - - F = 70, ->F : CharacterCodes - - G = 71, ->G : CharacterCodes - - H = 72, ->H : CharacterCodes - - I = 73, ->I : CharacterCodes - - J = 74, ->J : CharacterCodes - - K = 75, ->K : CharacterCodes - - L = 76, ->L : CharacterCodes - - M = 77, ->M : CharacterCodes - - N = 78, ->N : CharacterCodes - - O = 79, ->O : CharacterCodes - - P = 80, ->P : CharacterCodes - - Q = 81, ->Q : CharacterCodes - - R = 82, ->R : CharacterCodes - - S = 83, ->S : CharacterCodes - - T = 84, ->T : CharacterCodes - - U = 85, ->U : CharacterCodes - - V = 86, ->V : CharacterCodes - - W = 87, ->W : CharacterCodes - - X = 88, ->X : CharacterCodes - - Y = 89, ->Y : CharacterCodes - - Z = 90, ->Z : CharacterCodes - - ampersand = 38, ->ampersand : CharacterCodes - - asterisk = 42, ->asterisk : CharacterCodes - - at = 64, ->at : CharacterCodes - - backslash = 92, ->backslash : CharacterCodes - - backtick = 96, ->backtick : CharacterCodes - - bar = 124, ->bar : CharacterCodes - - caret = 94, ->caret : CharacterCodes - - closeBrace = 125, ->closeBrace : CharacterCodes - - closeBracket = 93, ->closeBracket : CharacterCodes - - closeParen = 41, ->closeParen : CharacterCodes - - colon = 58, ->colon : CharacterCodes - - comma = 44, ->comma : CharacterCodes - - dot = 46, ->dot : CharacterCodes - - doubleQuote = 34, ->doubleQuote : CharacterCodes - - equals = 61, ->equals : CharacterCodes - - exclamation = 33, ->exclamation : CharacterCodes - - greaterThan = 62, ->greaterThan : CharacterCodes - - hash = 35, ->hash : CharacterCodes - - lessThan = 60, ->lessThan : CharacterCodes - - minus = 45, ->minus : CharacterCodes - - openBrace = 123, ->openBrace : CharacterCodes - - openBracket = 91, ->openBracket : CharacterCodes - - openParen = 40, ->openParen : CharacterCodes - - percent = 37, ->percent : CharacterCodes - - plus = 43, ->plus : CharacterCodes - - question = 63, ->question : CharacterCodes - - semicolon = 59, ->semicolon : CharacterCodes - - singleQuote = 39, ->singleQuote : CharacterCodes - - slash = 47, ->slash : CharacterCodes - - tilde = 126, ->tilde : CharacterCodes - - backspace = 8, ->backspace : CharacterCodes - - formFeed = 12, ->formFeed : CharacterCodes - - byteOrderMark = 65279, ->byteOrderMark : CharacterCodes - - tab = 9, ->tab : CharacterCodes - - verticalTab = 11, ->verticalTab : CharacterCodes - } - interface CancellationToken { ->CancellationToken : CancellationToken - - isCancellationRequested(): boolean; ->isCancellationRequested : () => boolean - } - interface CompilerHost { ->CompilerHost : CompilerHost - - getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile; ->getSourceFile : (fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void) => SourceFile ->fileName : string ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget ->onError : (message: string) => void ->message : string ->SourceFile : SourceFile - - getDefaultLibFileName(options: CompilerOptions): string; ->getDefaultLibFileName : (options: CompilerOptions) => string ->options : CompilerOptions ->CompilerOptions : CompilerOptions - - getCancellationToken?(): CancellationToken; ->getCancellationToken : () => CancellationToken ->CancellationToken : CancellationToken - - writeFile: WriteFileCallback; ->writeFile : WriteFileCallback ->WriteFileCallback : WriteFileCallback - - getCurrentDirectory(): string; ->getCurrentDirectory : () => string - - getCanonicalFileName(fileName: string): string; ->getCanonicalFileName : (fileName: string) => string ->fileName : string - - useCaseSensitiveFileNames(): boolean; ->useCaseSensitiveFileNames : () => boolean - - getNewLine(): string; ->getNewLine : () => string - } - interface TextSpan { ->TextSpan : TextSpan - - start: number; ->start : number - - length: number; ->length : number - } - interface TextChangeRange { ->TextChangeRange : TextChangeRange - - span: TextSpan; ->span : TextSpan ->TextSpan : TextSpan - - newLength: number; ->newLength : number - } -} -declare module "typescript" { - interface ErrorCallback { ->ErrorCallback : ErrorCallback - - (message: DiagnosticMessage, length: number): void; ->message : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage ->length : number - } - interface Scanner { ->Scanner : Scanner - - getStartPos(): number; ->getStartPos : () => number - - getToken(): SyntaxKind; ->getToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - getTextPos(): number; ->getTextPos : () => number - - getTokenPos(): number; ->getTokenPos : () => number - - getTokenText(): string; ->getTokenText : () => string - - getTokenValue(): string; ->getTokenValue : () => string - - hasExtendedUnicodeEscape(): boolean; ->hasExtendedUnicodeEscape : () => boolean - - hasPrecedingLineBreak(): boolean; ->hasPrecedingLineBreak : () => boolean - - isIdentifier(): boolean; ->isIdentifier : () => boolean - - isReservedWord(): boolean; ->isReservedWord : () => boolean - - isUnterminated(): boolean; ->isUnterminated : () => boolean - - reScanGreaterToken(): SyntaxKind; ->reScanGreaterToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - reScanSlashToken(): SyntaxKind; ->reScanSlashToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - reScanTemplateToken(): SyntaxKind; ->reScanTemplateToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - scan(): SyntaxKind; ->scan : () => SyntaxKind ->SyntaxKind : SyntaxKind - - setText(text: string): void; ->setText : (text: string) => void ->text : string - - setTextPos(textPos: number): void; ->setTextPos : (textPos: number) => void ->textPos : number - - lookAhead(callback: () => T): T; ->lookAhead : (callback: () => T) => T ->T : T ->callback : () => T ->T : T ->T : T - - tryScan(callback: () => T): T; ->tryScan : (callback: () => T) => T ->T : T ->callback : () => T ->T : T ->T : T - } - function tokenToString(t: SyntaxKind): string; ->tokenToString : (t: SyntaxKind) => string ->t : SyntaxKind ->SyntaxKind : SyntaxKind - - function computeLineStarts(text: string): number[]; ->computeLineStarts : (text: string) => number[] ->text : string - - function getPositionOfLineAndCharacter(sourceFile: SourceFile, line: number, character: number): number; ->getPositionOfLineAndCharacter : (sourceFile: SourceFile, line: number, character: number) => number ->sourceFile : SourceFile ->SourceFile : SourceFile ->line : number ->character : number - - function computePositionOfLineAndCharacter(lineStarts: number[], line: number, character: number): number; ->computePositionOfLineAndCharacter : (lineStarts: number[], line: number, character: number) => number ->lineStarts : number[] ->line : number ->character : number - - function getLineStarts(sourceFile: SourceFile): number[]; ->getLineStarts : (sourceFile: SourceFile) => number[] ->sourceFile : SourceFile ->SourceFile : SourceFile - - function computeLineAndCharacterOfPosition(lineStarts: number[], position: number): { ->computeLineAndCharacterOfPosition : (lineStarts: number[], position: number) => { line: number; character: number; } ->lineStarts : number[] ->position : number - - line: number; ->line : number - - character: number; ->character : number - - }; - function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter; ->getLineAndCharacterOfPosition : (sourceFile: SourceFile, position: number) => LineAndCharacter ->sourceFile : SourceFile ->SourceFile : SourceFile ->position : number ->LineAndCharacter : LineAndCharacter - - function isWhiteSpace(ch: number): boolean; ->isWhiteSpace : (ch: number) => boolean ->ch : number - - function isLineBreak(ch: number): boolean; ->isLineBreak : (ch: number) => boolean ->ch : number - - function isOctalDigit(ch: number): boolean; ->isOctalDigit : (ch: number) => boolean ->ch : number - - function skipTrivia(text: string, pos: number, stopAfterLineBreak?: boolean): number; ->skipTrivia : (text: string, pos: number, stopAfterLineBreak?: boolean) => number ->text : string ->pos : number ->stopAfterLineBreak : boolean - - function getLeadingCommentRanges(text: string, pos: number): CommentRange[]; ->getLeadingCommentRanges : (text: string, pos: number) => CommentRange[] ->text : string ->pos : number ->CommentRange : CommentRange - - function getTrailingCommentRanges(text: string, pos: number): CommentRange[]; ->getTrailingCommentRanges : (text: string, pos: number) => CommentRange[] ->text : string ->pos : number ->CommentRange : CommentRange - - function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean; ->isIdentifierStart : (ch: number, languageVersion: ScriptTarget) => boolean ->ch : number ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget - - function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean; ->isIdentifierPart : (ch: number, languageVersion: ScriptTarget) => boolean ->ch : number ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget - - function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback): Scanner; ->createScanner : (languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback) => Scanner ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget ->skipTrivia : boolean ->text : string ->onError : ErrorCallback ->ErrorCallback : ErrorCallback ->Scanner : Scanner -} -declare module "typescript" { - function getNodeConstructor(kind: SyntaxKind): new () => Node; ->getNodeConstructor : (kind: SyntaxKind) => new () => Node ->kind : SyntaxKind ->SyntaxKind : SyntaxKind ->Node : Node - - function createNode(kind: SyntaxKind): Node; ->createNode : (kind: SyntaxKind) => Node ->kind : SyntaxKind ->SyntaxKind : SyntaxKind ->Node : Node - - function forEachChild(node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; ->forEachChild : (node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T) => T ->T : T ->node : Node ->Node : Node ->cbNode : (node: Node) => T ->node : Node ->Node : Node ->T : T ->cbNodeArray : (nodes: Node[]) => T ->nodes : Node[] ->Node : Node ->T : T ->T : T - - function modifierToFlag(token: SyntaxKind): NodeFlags; ->modifierToFlag : (token: SyntaxKind) => NodeFlags ->token : SyntaxKind ->SyntaxKind : SyntaxKind ->NodeFlags : NodeFlags - - function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; ->updateSourceFile : (sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean) => SourceFile ->sourceFile : SourceFile ->SourceFile : SourceFile ->newText : string ->textChangeRange : TextChangeRange ->TextChangeRange : TextChangeRange ->aggressiveChecks : boolean ->SourceFile : SourceFile - - function isEvalOrArgumentsIdentifier(node: Node): boolean; ->isEvalOrArgumentsIdentifier : (node: Node) => boolean ->node : Node ->Node : Node - - function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean): SourceFile; ->createSourceFile : (fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean) => SourceFile ->fileName : string ->sourceText : string ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget ->setParentNodes : boolean ->SourceFile : SourceFile - - function isLeftHandSideExpression(expr: Expression): boolean; ->isLeftHandSideExpression : (expr: Expression) => boolean ->expr : Expression ->Expression : Expression - - function isAssignmentOperator(token: SyntaxKind): boolean; ->isAssignmentOperator : (token: SyntaxKind) => boolean ->token : SyntaxKind ->SyntaxKind : SyntaxKind -} -declare module "typescript" { - function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker; ->createTypeChecker : (host: TypeCheckerHost, produceDiagnostics: boolean) => TypeChecker ->host : TypeCheckerHost ->TypeCheckerHost : TypeCheckerHost ->produceDiagnostics : boolean ->TypeChecker : TypeChecker -} -declare module "typescript" { - /** The version of the TypeScript compiler release */ - let version: string; ->version : string - - function findConfigFile(searchPath: string): string; ->findConfigFile : (searchPath: string) => string ->searchPath : string - - function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; ->createCompilerHost : (options: CompilerOptions, setParentNodes?: boolean) => CompilerHost ->options : CompilerOptions ->CompilerOptions : CompilerOptions ->setParentNodes : boolean ->CompilerHost : CompilerHost - - function getPreEmitDiagnostics(program: Program): Diagnostic[]; ->getPreEmitDiagnostics : (program: Program) => Diagnostic[] ->program : Program ->Program : Program ->Diagnostic : Diagnostic - - function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; ->flattenDiagnosticMessageText : (messageText: string | DiagnosticMessageChain, newLine: string) => string ->messageText : string | DiagnosticMessageChain ->DiagnosticMessageChain : DiagnosticMessageChain ->newLine : string - - function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; ->createProgram : (rootNames: string[], options: CompilerOptions, host?: CompilerHost) => Program ->rootNames : string[] ->options : CompilerOptions ->CompilerOptions : CompilerOptions ->host : CompilerHost ->CompilerHost : CompilerHost ->Program : Program -} -declare module "typescript" { - /** The version of the language service API */ - let servicesVersion: string; ->servicesVersion : string - - interface Node { ->Node : Node - - getSourceFile(): SourceFile; ->getSourceFile : () => SourceFile ->SourceFile : SourceFile - - getChildCount(sourceFile?: SourceFile): number; ->getChildCount : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getChildAt(index: number, sourceFile?: SourceFile): Node; ->getChildAt : (index: number, sourceFile?: SourceFile) => Node ->index : number ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - - getChildren(sourceFile?: SourceFile): Node[]; ->getChildren : (sourceFile?: SourceFile) => Node[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - - getStart(sourceFile?: SourceFile): number; ->getStart : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFullStart(): number; ->getFullStart : () => number - - getEnd(): number; ->getEnd : () => number - - getWidth(sourceFile?: SourceFile): number; ->getWidth : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFullWidth(): number; ->getFullWidth : () => number - - getLeadingTriviaWidth(sourceFile?: SourceFile): number; ->getLeadingTriviaWidth : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFullText(sourceFile?: SourceFile): string; ->getFullText : (sourceFile?: SourceFile) => string ->sourceFile : SourceFile ->SourceFile : SourceFile - - getText(sourceFile?: SourceFile): string; ->getText : (sourceFile?: SourceFile) => string ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFirstToken(sourceFile?: SourceFile): Node; ->getFirstToken : (sourceFile?: SourceFile) => Node ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - - getLastToken(sourceFile?: SourceFile): Node; ->getLastToken : (sourceFile?: SourceFile) => Node ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - } - interface Symbol { ->Symbol : Symbol - - getFlags(): SymbolFlags; ->getFlags : () => SymbolFlags ->SymbolFlags : SymbolFlags - - getName(): string; ->getName : () => string - - getDeclarations(): Declaration[]; ->getDeclarations : () => Declaration[] ->Declaration : Declaration - - getDocumentationComment(): SymbolDisplayPart[]; ->getDocumentationComment : () => SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface Type { ->Type : Type - - getFlags(): TypeFlags; ->getFlags : () => TypeFlags ->TypeFlags : TypeFlags - - getSymbol(): Symbol; ->getSymbol : () => Symbol ->Symbol : Symbol - - getProperties(): Symbol[]; ->getProperties : () => Symbol[] ->Symbol : Symbol - - getProperty(propertyName: string): Symbol; ->getProperty : (propertyName: string) => Symbol ->propertyName : string ->Symbol : Symbol - - getApparentProperties(): Symbol[]; ->getApparentProperties : () => Symbol[] ->Symbol : Symbol - - getCallSignatures(): Signature[]; ->getCallSignatures : () => Signature[] ->Signature : Signature - - getConstructSignatures(): Signature[]; ->getConstructSignatures : () => Signature[] ->Signature : Signature - - getStringIndexType(): Type; ->getStringIndexType : () => Type ->Type : Type - - getNumberIndexType(): Type; ->getNumberIndexType : () => Type ->Type : Type - } - interface Signature { ->Signature : Signature - - getDeclaration(): SignatureDeclaration; ->getDeclaration : () => SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration - - getTypeParameters(): Type[]; ->getTypeParameters : () => Type[] ->Type : Type - - getParameters(): Symbol[]; ->getParameters : () => Symbol[] ->Symbol : Symbol - - getReturnType(): Type; ->getReturnType : () => Type ->Type : Type - - getDocumentationComment(): SymbolDisplayPart[]; ->getDocumentationComment : () => SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface SourceFile { ->SourceFile : SourceFile - - getNamedDeclarations(): Declaration[]; ->getNamedDeclarations : () => Declaration[] ->Declaration : Declaration - - getLineAndCharacterOfPosition(pos: number): LineAndCharacter; ->getLineAndCharacterOfPosition : (pos: number) => LineAndCharacter ->pos : number ->LineAndCharacter : LineAndCharacter - - getLineStarts(): number[]; ->getLineStarts : () => number[] - - getPositionOfLineAndCharacter(line: number, character: number): number; ->getPositionOfLineAndCharacter : (line: number, character: number) => number ->line : number ->character : number - - update(newText: string, textChangeRange: TextChangeRange): SourceFile; ->update : (newText: string, textChangeRange: TextChangeRange) => SourceFile ->newText : string ->textChangeRange : TextChangeRange ->TextChangeRange : TextChangeRange ->SourceFile : SourceFile - } - /** - * Represents an immutable snapshot of a script at a specified time.Once acquired, the - * snapshot is observably immutable. i.e. the same calls with the same parameters will return - * the same values. - */ - interface IScriptSnapshot { ->IScriptSnapshot : IScriptSnapshot - - /** Gets a portion of the script snapshot specified by [start, end). */ - getText(start: number, end: number): string; ->getText : (start: number, end: number) => string ->start : number ->end : number - - /** Gets the length of this script snapshot. */ - getLength(): number; ->getLength : () => number - - /** - * Gets the TextChangeRange that describe how the text changed between this text and - * an older version. This information is used by the incremental parser to determine - * what sections of the script need to be re-parsed. 'undefined' can be returned if the - * change range cannot be determined. However, in that case, incremental parsing will - * not happen and the entire document will be re - parsed. - */ - getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange; ->getChangeRange : (oldSnapshot: IScriptSnapshot) => TextChangeRange ->oldSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->TextChangeRange : TextChangeRange - } - module ScriptSnapshot { ->ScriptSnapshot : typeof ScriptSnapshot - - function fromString(text: string): IScriptSnapshot; ->fromString : (text: string) => IScriptSnapshot ->text : string ->IScriptSnapshot : IScriptSnapshot - } - interface PreProcessedFileInfo { ->PreProcessedFileInfo : PreProcessedFileInfo - - referencedFiles: FileReference[]; ->referencedFiles : FileReference[] ->FileReference : FileReference - - importedFiles: FileReference[]; ->importedFiles : FileReference[] ->FileReference : FileReference - - isLibFile: boolean; ->isLibFile : boolean - } - interface LanguageServiceHost { ->LanguageServiceHost : LanguageServiceHost - - getCompilationSettings(): CompilerOptions; ->getCompilationSettings : () => CompilerOptions ->CompilerOptions : CompilerOptions - - getNewLine?(): string; ->getNewLine : () => string - - getScriptFileNames(): string[]; ->getScriptFileNames : () => string[] - - getScriptVersion(fileName: string): string; ->getScriptVersion : (fileName: string) => string ->fileName : string - - getScriptSnapshot(fileName: string): IScriptSnapshot; ->getScriptSnapshot : (fileName: string) => IScriptSnapshot ->fileName : string ->IScriptSnapshot : IScriptSnapshot - - getLocalizedDiagnosticMessages?(): any; ->getLocalizedDiagnosticMessages : () => any - - getCancellationToken?(): CancellationToken; ->getCancellationToken : () => CancellationToken ->CancellationToken : CancellationToken - - getCurrentDirectory(): string; ->getCurrentDirectory : () => string - - getDefaultLibFileName(options: CompilerOptions): string; ->getDefaultLibFileName : (options: CompilerOptions) => string ->options : CompilerOptions ->CompilerOptions : CompilerOptions - - log?(s: string): void; ->log : (s: string) => void ->s : string - - trace?(s: string): void; ->trace : (s: string) => void ->s : string - - error?(s: string): void; ->error : (s: string) => void ->s : string - } - interface LanguageService { ->LanguageService : LanguageService - - cleanupSemanticCache(): void; ->cleanupSemanticCache : () => void - - getSyntacticDiagnostics(fileName: string): Diagnostic[]; ->getSyntacticDiagnostics : (fileName: string) => Diagnostic[] ->fileName : string ->Diagnostic : Diagnostic - - getSemanticDiagnostics(fileName: string): Diagnostic[]; ->getSemanticDiagnostics : (fileName: string) => Diagnostic[] ->fileName : string ->Diagnostic : Diagnostic - - getCompilerOptionsDiagnostics(): Diagnostic[]; ->getCompilerOptionsDiagnostics : () => Diagnostic[] ->Diagnostic : Diagnostic - - getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; ->getSyntacticClassifications : (fileName: string, span: TextSpan) => ClassifiedSpan[] ->fileName : string ->span : TextSpan ->TextSpan : TextSpan ->ClassifiedSpan : ClassifiedSpan - - getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; ->getSemanticClassifications : (fileName: string, span: TextSpan) => ClassifiedSpan[] ->fileName : string ->span : TextSpan ->TextSpan : TextSpan ->ClassifiedSpan : ClassifiedSpan - - getCompletionsAtPosition(fileName: string, position: number): CompletionInfo; ->getCompletionsAtPosition : (fileName: string, position: number) => CompletionInfo ->fileName : string ->position : number ->CompletionInfo : CompletionInfo - - getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails; ->getCompletionEntryDetails : (fileName: string, position: number, entryName: string) => CompletionEntryDetails ->fileName : string ->position : number ->entryName : string ->CompletionEntryDetails : CompletionEntryDetails - - getQuickInfoAtPosition(fileName: string, position: number): QuickInfo; ->getQuickInfoAtPosition : (fileName: string, position: number) => QuickInfo ->fileName : string ->position : number ->QuickInfo : QuickInfo - - getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan; ->getNameOrDottedNameSpan : (fileName: string, startPos: number, endPos: number) => TextSpan ->fileName : string ->startPos : number ->endPos : number ->TextSpan : TextSpan - - getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan; ->getBreakpointStatementAtPosition : (fileName: string, position: number) => TextSpan ->fileName : string ->position : number ->TextSpan : TextSpan - - getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems; ->getSignatureHelpItems : (fileName: string, position: number) => SignatureHelpItems ->fileName : string ->position : number ->SignatureHelpItems : SignatureHelpItems - - getRenameInfo(fileName: string, position: number): RenameInfo; ->getRenameInfo : (fileName: string, position: number) => RenameInfo ->fileName : string ->position : number ->RenameInfo : RenameInfo - - findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]; ->findRenameLocations : (fileName: string, position: number, findInStrings: boolean, findInComments: boolean) => RenameLocation[] ->fileName : string ->position : number ->findInStrings : boolean ->findInComments : boolean ->RenameLocation : RenameLocation - - getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; ->getDefinitionAtPosition : (fileName: string, position: number) => DefinitionInfo[] ->fileName : string ->position : number ->DefinitionInfo : DefinitionInfo - - getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; ->getReferencesAtPosition : (fileName: string, position: number) => ReferenceEntry[] ->fileName : string ->position : number ->ReferenceEntry : ReferenceEntry - - getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; ->getOccurrencesAtPosition : (fileName: string, position: number) => ReferenceEntry[] ->fileName : string ->position : number ->ReferenceEntry : ReferenceEntry - - findReferences(fileName: string, position: number): ReferencedSymbol[]; ->findReferences : (fileName: string, position: number) => ReferencedSymbol[] ->fileName : string ->position : number ->ReferencedSymbol : ReferencedSymbol - - getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[]; ->getNavigateToItems : (searchValue: string, maxResultCount?: number) => NavigateToItem[] ->searchValue : string ->maxResultCount : number ->NavigateToItem : NavigateToItem - - getNavigationBarItems(fileName: string): NavigationBarItem[]; ->getNavigationBarItems : (fileName: string) => NavigationBarItem[] ->fileName : string ->NavigationBarItem : NavigationBarItem - - getOutliningSpans(fileName: string): OutliningSpan[]; ->getOutliningSpans : (fileName: string) => OutliningSpan[] ->fileName : string ->OutliningSpan : OutliningSpan - - getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[]; ->getTodoComments : (fileName: string, descriptors: TodoCommentDescriptor[]) => TodoComment[] ->fileName : string ->descriptors : TodoCommentDescriptor[] ->TodoCommentDescriptor : TodoCommentDescriptor ->TodoComment : TodoComment - - getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[]; ->getBraceMatchingAtPosition : (fileName: string, position: number) => TextSpan[] ->fileName : string ->position : number ->TextSpan : TextSpan - - getIndentationAtPosition(fileName: string, position: number, options: EditorOptions): number; ->getIndentationAtPosition : (fileName: string, position: number, options: EditorOptions) => number ->fileName : string ->position : number ->options : EditorOptions ->EditorOptions : EditorOptions - - getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions): TextChange[]; ->getFormattingEditsForRange : (fileName: string, start: number, end: number, options: FormatCodeOptions) => TextChange[] ->fileName : string ->start : number ->end : number ->options : FormatCodeOptions ->FormatCodeOptions : FormatCodeOptions ->TextChange : TextChange - - getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): TextChange[]; ->getFormattingEditsForDocument : (fileName: string, options: FormatCodeOptions) => TextChange[] ->fileName : string ->options : FormatCodeOptions ->FormatCodeOptions : FormatCodeOptions ->TextChange : TextChange - - getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextChange[]; ->getFormattingEditsAfterKeystroke : (fileName: string, position: number, key: string, options: FormatCodeOptions) => TextChange[] ->fileName : string ->position : number ->key : string ->options : FormatCodeOptions ->FormatCodeOptions : FormatCodeOptions ->TextChange : TextChange - - getEmitOutput(fileName: string): EmitOutput; ->getEmitOutput : (fileName: string) => EmitOutput ->fileName : string ->EmitOutput : EmitOutput - - getProgram(): Program; ->getProgram : () => Program ->Program : Program - - getSourceFile(fileName: string): SourceFile; ->getSourceFile : (fileName: string) => SourceFile ->fileName : string ->SourceFile : SourceFile - - dispose(): void; ->dispose : () => void - } - interface ClassifiedSpan { ->ClassifiedSpan : ClassifiedSpan - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - classificationType: string; ->classificationType : string - } - interface NavigationBarItem { ->NavigationBarItem : NavigationBarItem - - text: string; ->text : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - spans: TextSpan[]; ->spans : TextSpan[] ->TextSpan : TextSpan - - childItems: NavigationBarItem[]; ->childItems : NavigationBarItem[] ->NavigationBarItem : NavigationBarItem - - indent: number; ->indent : number - - bolded: boolean; ->bolded : boolean - - grayed: boolean; ->grayed : boolean - } - interface TodoCommentDescriptor { ->TodoCommentDescriptor : TodoCommentDescriptor - - text: string; ->text : string - - priority: number; ->priority : number - } - interface TodoComment { ->TodoComment : TodoComment - - descriptor: TodoCommentDescriptor; ->descriptor : TodoCommentDescriptor ->TodoCommentDescriptor : TodoCommentDescriptor - - message: string; ->message : string - - position: number; ->position : number - } - class TextChange { ->TextChange : TextChange - - span: TextSpan; ->span : TextSpan ->TextSpan : TextSpan - - newText: string; ->newText : string - } - interface RenameLocation { ->RenameLocation : RenameLocation - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - fileName: string; ->fileName : string - } - interface ReferenceEntry { ->ReferenceEntry : ReferenceEntry - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - fileName: string; ->fileName : string - - isWriteAccess: boolean; ->isWriteAccess : boolean - } - interface NavigateToItem { ->NavigateToItem : NavigateToItem - - name: string; ->name : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - matchKind: string; ->matchKind : string - - isCaseSensitive: boolean; ->isCaseSensitive : boolean - - fileName: string; ->fileName : string - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - containerName: string; ->containerName : string - - containerKind: string; ->containerKind : string - } - interface EditorOptions { ->EditorOptions : EditorOptions - - IndentSize: number; ->IndentSize : number - - TabSize: number; ->TabSize : number - - NewLineCharacter: string; ->NewLineCharacter : string - - ConvertTabsToSpaces: boolean; ->ConvertTabsToSpaces : boolean - } - interface FormatCodeOptions extends EditorOptions { ->FormatCodeOptions : FormatCodeOptions ->EditorOptions : EditorOptions - - InsertSpaceAfterCommaDelimiter: boolean; ->InsertSpaceAfterCommaDelimiter : boolean - - InsertSpaceAfterSemicolonInForStatements: boolean; ->InsertSpaceAfterSemicolonInForStatements : boolean - - InsertSpaceBeforeAndAfterBinaryOperators: boolean; ->InsertSpaceBeforeAndAfterBinaryOperators : boolean - - InsertSpaceAfterKeywordsInControlFlowStatements: boolean; ->InsertSpaceAfterKeywordsInControlFlowStatements : boolean - - InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; ->InsertSpaceAfterFunctionKeywordForAnonymousFunctions : boolean - - InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; ->InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis : boolean - - PlaceOpenBraceOnNewLineForFunctions: boolean; ->PlaceOpenBraceOnNewLineForFunctions : boolean - - PlaceOpenBraceOnNewLineForControlBlocks: boolean; ->PlaceOpenBraceOnNewLineForControlBlocks : boolean - - [s: string]: boolean | number | string; ->s : string - } - interface DefinitionInfo { ->DefinitionInfo : DefinitionInfo - - fileName: string; ->fileName : string - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - kind: string; ->kind : string - - name: string; ->name : string - - containerKind: string; ->containerKind : string - - containerName: string; ->containerName : string - } - interface ReferencedSymbol { ->ReferencedSymbol : ReferencedSymbol - - definition: DefinitionInfo; ->definition : DefinitionInfo ->DefinitionInfo : DefinitionInfo - - references: ReferenceEntry[]; ->references : ReferenceEntry[] ->ReferenceEntry : ReferenceEntry - } - enum SymbolDisplayPartKind { ->SymbolDisplayPartKind : SymbolDisplayPartKind - - aliasName = 0, ->aliasName : SymbolDisplayPartKind - - className = 1, ->className : SymbolDisplayPartKind - - enumName = 2, ->enumName : SymbolDisplayPartKind - - fieldName = 3, ->fieldName : SymbolDisplayPartKind - - interfaceName = 4, ->interfaceName : SymbolDisplayPartKind - - keyword = 5, ->keyword : SymbolDisplayPartKind - - lineBreak = 6, ->lineBreak : SymbolDisplayPartKind - - numericLiteral = 7, ->numericLiteral : SymbolDisplayPartKind - - stringLiteral = 8, ->stringLiteral : SymbolDisplayPartKind - - localName = 9, ->localName : SymbolDisplayPartKind - - methodName = 10, ->methodName : SymbolDisplayPartKind - - moduleName = 11, ->moduleName : SymbolDisplayPartKind - - operator = 12, ->operator : SymbolDisplayPartKind - - parameterName = 13, ->parameterName : SymbolDisplayPartKind - - propertyName = 14, ->propertyName : SymbolDisplayPartKind - - punctuation = 15, ->punctuation : SymbolDisplayPartKind - - space = 16, ->space : SymbolDisplayPartKind - - text = 17, ->text : SymbolDisplayPartKind - - typeParameterName = 18, ->typeParameterName : SymbolDisplayPartKind - - enumMemberName = 19, ->enumMemberName : SymbolDisplayPartKind - - functionName = 20, ->functionName : SymbolDisplayPartKind - - regularExpressionLiteral = 21, ->regularExpressionLiteral : SymbolDisplayPartKind - } - interface SymbolDisplayPart { ->SymbolDisplayPart : SymbolDisplayPart - - text: string; ->text : string - - kind: string; ->kind : string - } - interface QuickInfo { ->QuickInfo : QuickInfo - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - displayParts: SymbolDisplayPart[]; ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface RenameInfo { ->RenameInfo : RenameInfo - - canRename: boolean; ->canRename : boolean - - localizedErrorMessage: string; ->localizedErrorMessage : string - - displayName: string; ->displayName : string - - fullDisplayName: string; ->fullDisplayName : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - triggerSpan: TextSpan; ->triggerSpan : TextSpan ->TextSpan : TextSpan - } - interface SignatureHelpParameter { ->SignatureHelpParameter : SignatureHelpParameter - - name: string; ->name : string - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - displayParts: SymbolDisplayPart[]; ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - isOptional: boolean; ->isOptional : boolean - } - /** - * Represents a single signature to show in signature help. - * The id is used for subsequent calls into the language service to ask questions about the - * signature help item in the context of any documents that have been updated. i.e. after - * an edit has happened, while signature help is still active, the host can ask important - * questions like 'what parameter is the user currently contained within?'. - */ - interface SignatureHelpItem { ->SignatureHelpItem : SignatureHelpItem - - isVariadic: boolean; ->isVariadic : boolean - - prefixDisplayParts: SymbolDisplayPart[]; ->prefixDisplayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - suffixDisplayParts: SymbolDisplayPart[]; ->suffixDisplayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - separatorDisplayParts: SymbolDisplayPart[]; ->separatorDisplayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - parameters: SignatureHelpParameter[]; ->parameters : SignatureHelpParameter[] ->SignatureHelpParameter : SignatureHelpParameter - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - /** - * Represents a set of signature help items, and the preferred item that should be selected. - */ - interface SignatureHelpItems { ->SignatureHelpItems : SignatureHelpItems - - items: SignatureHelpItem[]; ->items : SignatureHelpItem[] ->SignatureHelpItem : SignatureHelpItem - - applicableSpan: TextSpan; ->applicableSpan : TextSpan ->TextSpan : TextSpan - - selectedItemIndex: number; ->selectedItemIndex : number - - argumentIndex: number; ->argumentIndex : number - - argumentCount: number; ->argumentCount : number - } - interface CompletionInfo { ->CompletionInfo : CompletionInfo - - isMemberCompletion: boolean; ->isMemberCompletion : boolean - - isNewIdentifierLocation: boolean; ->isNewIdentifierLocation : boolean - - entries: CompletionEntry[]; ->entries : CompletionEntry[] ->CompletionEntry : CompletionEntry - } - interface CompletionEntry { ->CompletionEntry : CompletionEntry - - name: string; ->name : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - } - interface CompletionEntryDetails { ->CompletionEntryDetails : CompletionEntryDetails - - name: string; ->name : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - displayParts: SymbolDisplayPart[]; ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface OutliningSpan { ->OutliningSpan : OutliningSpan - - /** The span of the document to actually collapse. */ - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - /** The span of the document to display when the user hovers over the collapsed span. */ - hintSpan: TextSpan; ->hintSpan : TextSpan ->TextSpan : TextSpan - - /** The text to display in the editor for the collapsed region. */ - bannerText: string; ->bannerText : string - - /** - * Whether or not this region should be automatically collapsed when - * the 'Collapse to Definitions' command is invoked. - */ - autoCollapse: boolean; ->autoCollapse : boolean - } - interface EmitOutput { ->EmitOutput : EmitOutput - - outputFiles: OutputFile[]; ->outputFiles : OutputFile[] ->OutputFile : OutputFile - - emitSkipped: boolean; ->emitSkipped : boolean - } - const enum OutputFileType { ->OutputFileType : OutputFileType - - JavaScript = 0, ->JavaScript : OutputFileType - - SourceMap = 1, ->SourceMap : OutputFileType - - Declaration = 2, ->Declaration : OutputFileType - } - interface OutputFile { ->OutputFile : OutputFile - - name: string; ->name : string - - writeByteOrderMark: boolean; ->writeByteOrderMark : boolean - - text: string; ->text : string - } - const enum EndOfLineState { ->EndOfLineState : EndOfLineState - - Start = 0, ->Start : EndOfLineState - - InMultiLineCommentTrivia = 1, ->InMultiLineCommentTrivia : EndOfLineState - - InSingleQuoteStringLiteral = 2, ->InSingleQuoteStringLiteral : EndOfLineState - - InDoubleQuoteStringLiteral = 3, ->InDoubleQuoteStringLiteral : EndOfLineState - - InTemplateHeadOrNoSubstitutionTemplate = 4, ->InTemplateHeadOrNoSubstitutionTemplate : EndOfLineState - - InTemplateMiddleOrTail = 5, ->InTemplateMiddleOrTail : EndOfLineState - - InTemplateSubstitutionPosition = 6, ->InTemplateSubstitutionPosition : EndOfLineState - } - enum TokenClass { ->TokenClass : TokenClass - - Punctuation = 0, ->Punctuation : TokenClass - - Keyword = 1, ->Keyword : TokenClass - - Operator = 2, ->Operator : TokenClass - - Comment = 3, ->Comment : TokenClass - - Whitespace = 4, ->Whitespace : TokenClass - - Identifier = 5, ->Identifier : TokenClass - - NumberLiteral = 6, ->NumberLiteral : TokenClass - - StringLiteral = 7, ->StringLiteral : TokenClass - - RegExpLiteral = 8, ->RegExpLiteral : TokenClass - } - interface ClassificationResult { ->ClassificationResult : ClassificationResult - - finalLexState: EndOfLineState; ->finalLexState : EndOfLineState ->EndOfLineState : EndOfLineState - - entries: ClassificationInfo[]; ->entries : ClassificationInfo[] ->ClassificationInfo : ClassificationInfo - } - interface ClassificationInfo { ->ClassificationInfo : ClassificationInfo - - length: number; ->length : number - - classification: TokenClass; ->classification : TokenClass ->TokenClass : TokenClass - } - interface Classifier { ->Classifier : Classifier - - /** - * Gives lexical classifications of tokens on a line without any syntactic context. - * For instance, a token consisting of the text 'string' can be either an identifier - * named 'string' or the keyword 'string', however, because this classifier is not aware, - * it relies on certain heuristics to give acceptable results. For classifications where - * speed trumps accuracy, this function is preferable; however, for true accuracy, the - * syntactic classifier is ideal. In fact, in certain editing scenarios, combining the - * lexical, syntactic, and semantic classifiers may issue the best user experience. - * - * @param text The text of a line to classify. - * @param lexState The state of the lexical classifier at the end of the previous line. - * @param syntacticClassifierAbsent Whether the client is *not* using a syntactic classifier. - * If there is no syntactic classifier (syntacticClassifierAbsent=true), - * certain heuristics may be used in its place; however, if there is a - * syntactic classifier (syntacticClassifierAbsent=false), certain - * classifications which may be incorrectly categorized will be given - * back as Identifiers in order to allow the syntactic classifier to - * subsume the classification. - */ - getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult; ->getClassificationsForLine : (text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean) => ClassificationResult ->text : string ->lexState : EndOfLineState ->EndOfLineState : EndOfLineState ->syntacticClassifierAbsent : boolean ->ClassificationResult : ClassificationResult - } - /** - * The document registry represents a store of SourceFile objects that can be shared between - * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) - * of files in the context. - * SourceFile objects account for most of the memory usage by the language service. Sharing - * the same DocumentRegistry instance between different instances of LanguageService allow - * for more efficient memory utilization since all projects will share at least the library - * file (lib.d.ts). - * - * A more advanced use of the document registry is to serialize sourceFile objects to disk - * and re-hydrate them when needed. - * - * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it - * to all subsequent createLanguageService calls. - */ - interface DocumentRegistry { ->DocumentRegistry : DocumentRegistry - - /** - * Request a stored SourceFile with a given fileName and compilationSettings. - * The first call to acquire will call createLanguageServiceSourceFile to generate - * the SourceFile if was not found in the registry. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @parm scriptSnapshot Text of the file. Only used if the file was not found - * in the registry and a new one was created. - * @parm version Current version of the file. Only used if the file was not found - * in the registry and a new one was created. - */ - acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; ->acquireDocument : (fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string) => SourceFile ->fileName : string ->compilationSettings : CompilerOptions ->CompilerOptions : CompilerOptions ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->version : string ->SourceFile : SourceFile - - /** - * Request an updated version of an already existing SourceFile with a given fileName - * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile - * to get an updated SourceFile. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @param scriptSnapshot Text of the file. - * @param version Current version of the file. - */ - updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; ->updateDocument : (fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string) => SourceFile ->fileName : string ->compilationSettings : CompilerOptions ->CompilerOptions : CompilerOptions ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->version : string ->SourceFile : SourceFile - - /** - * Informs the DocumentRegistry that a file is not needed any longer. - * - * Note: It is not allowed to call release on a SourceFile that was not acquired from - * this registry originally. - * - * @param fileName The name of the file to be released - * @param compilationSettings The compilation settings used to acquire the file - */ - releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; ->releaseDocument : (fileName: string, compilationSettings: CompilerOptions) => void ->fileName : string ->compilationSettings : CompilerOptions ->CompilerOptions : CompilerOptions - } - class ScriptElementKind { ->ScriptElementKind : ScriptElementKind - - static unknown: string; ->unknown : string - - static keyword: string; ->keyword : string - - static scriptElement: string; ->scriptElement : string - - static moduleElement: string; ->moduleElement : string - - static classElement: string; ->classElement : string - - static interfaceElement: string; ->interfaceElement : string - - static typeElement: string; ->typeElement : string - - static enumElement: string; ->enumElement : string - - static variableElement: string; ->variableElement : string - - static localVariableElement: string; ->localVariableElement : string - - static functionElement: string; ->functionElement : string - - static localFunctionElement: string; ->localFunctionElement : string - - static memberFunctionElement: string; ->memberFunctionElement : string - - static memberGetAccessorElement: string; ->memberGetAccessorElement : string - - static memberSetAccessorElement: string; ->memberSetAccessorElement : string - - static memberVariableElement: string; ->memberVariableElement : string - - static constructorImplementationElement: string; ->constructorImplementationElement : string - - static callSignatureElement: string; ->callSignatureElement : string - - static indexSignatureElement: string; ->indexSignatureElement : string - - static constructSignatureElement: string; ->constructSignatureElement : string - - static parameterElement: string; ->parameterElement : string - - static typeParameterElement: string; ->typeParameterElement : string - - static primitiveType: string; ->primitiveType : string - - static label: string; ->label : string - - static alias: string; ->alias : string - - static constElement: string; ->constElement : string - - static letElement: string; ->letElement : string - } - class ScriptElementKindModifier { ->ScriptElementKindModifier : ScriptElementKindModifier - - static none: string; ->none : string - - static publicMemberModifier: string; ->publicMemberModifier : string - - static privateMemberModifier: string; ->privateMemberModifier : string - - static protectedMemberModifier: string; ->protectedMemberModifier : string - - static exportedModifier: string; ->exportedModifier : string - - static ambientModifier: string; ->ambientModifier : string - - static staticModifier: string; ->staticModifier : string - } - class ClassificationTypeNames { ->ClassificationTypeNames : ClassificationTypeNames - - static comment: string; ->comment : string - - static identifier: string; ->identifier : string - - static keyword: string; ->keyword : string - - static numericLiteral: string; ->numericLiteral : string - - static operator: string; ->operator : string - - static stringLiteral: string; ->stringLiteral : string - - static whiteSpace: string; ->whiteSpace : string - - static text: string; ->text : string - - static punctuation: string; ->punctuation : string - - static className: string; ->className : string - - static enumName: string; ->enumName : string - - static interfaceName: string; ->interfaceName : string - - static moduleName: string; ->moduleName : string - - static typeParameterName: string; ->typeParameterName : string - - static typeAlias: string; ->typeAlias : string - } - interface DisplayPartsSymbolWriter extends SymbolWriter { ->DisplayPartsSymbolWriter : DisplayPartsSymbolWriter ->SymbolWriter : SymbolWriter - - displayParts(): SymbolDisplayPart[]; ->displayParts : () => SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - function displayPartsToString(displayParts: SymbolDisplayPart[]): string; ->displayPartsToString : (displayParts: SymbolDisplayPart[]) => string ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - function getDefaultCompilerOptions(): CompilerOptions; ->getDefaultCompilerOptions : () => CompilerOptions ->CompilerOptions : CompilerOptions - - class OperationCanceledException { ->OperationCanceledException : OperationCanceledException - } - class CancellationTokenObject { ->CancellationTokenObject : CancellationTokenObject - - private cancellationToken; ->cancellationToken : any - - static None: CancellationTokenObject; ->None : CancellationTokenObject ->CancellationTokenObject : CancellationTokenObject - - constructor(cancellationToken: CancellationToken); ->cancellationToken : CancellationToken ->CancellationToken : CancellationToken - - isCancellationRequested(): boolean; ->isCancellationRequested : () => boolean - - throwIfCancellationRequested(): void; ->throwIfCancellationRequested : () => void - } - function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile; ->createLanguageServiceSourceFile : (fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean) => SourceFile ->fileName : string ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->scriptTarget : ScriptTarget ->ScriptTarget : ScriptTarget ->version : string ->setNodeParents : boolean ->SourceFile : SourceFile - - let disableIncrementalParsing: boolean; ->disableIncrementalParsing : boolean - - function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; ->updateLanguageServiceSourceFile : (sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean) => SourceFile ->sourceFile : SourceFile ->SourceFile : SourceFile ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->version : string ->textChangeRange : TextChangeRange ->TextChangeRange : TextChangeRange ->aggressiveChecks : boolean ->SourceFile : SourceFile - - function createDocumentRegistry(): DocumentRegistry; ->createDocumentRegistry : () => DocumentRegistry ->DocumentRegistry : DocumentRegistry - - function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo; ->preProcessFile : (sourceText: string, readImportFiles?: boolean) => PreProcessedFileInfo ->sourceText : string ->readImportFiles : boolean ->PreProcessedFileInfo : PreProcessedFileInfo - - function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; ->createLanguageService : (host: LanguageServiceHost, documentRegistry?: DocumentRegistry) => LanguageService ->host : LanguageServiceHost ->LanguageServiceHost : LanguageServiceHost ->documentRegistry : DocumentRegistry ->DocumentRegistry : DocumentRegistry ->LanguageService : LanguageService - - function createClassifier(): Classifier; ->createClassifier : () => Classifier ->Classifier : Classifier - - /** - * Get the path of the default library file (lib.d.ts) as distributed with the typescript - * node package. - * The functionality is not supported if the ts module is consumed outside of a node module. - */ - function getDefaultLibFilePath(options: CompilerOptions): string; ->getDefaultLibFilePath : (options: CompilerOptions) => string ->options : CompilerOptions ->CompilerOptions : CompilerOptions -} - diff --git a/tests/baselines/reference/APISample_transform.js b/tests/baselines/reference/APISample_transform.js index 4004007508a..a7f83f19b5e 100644 --- a/tests/baselines/reference/APISample_transform.js +++ b/tests/baselines/reference/APISample_transform.js @@ -1,5 +1,3 @@ -//// [tests/cases/compiler/APISample_transform.ts] //// - //// [APISample_transform.ts] /* @@ -8,2029 +6,15 @@ * Please log a "breaking change" issue for any API breaking change affecting this issue */ -declare var process: any; declare var console: any; -declare var fs: any; -declare var path: any; -declare var os: any; -import ts = require("typescript"); +import * as ts from "typescript"; -function transform(contents: string, compilerOptions: ts.CompilerOptions = {}) { - // Sources - var files = { - "file.ts": contents, - "lib.d.ts": fs.readFileSync(ts.getDefaultLibFilePath(compilerOptions)).toString() - }; +const source = "let x: string = 'string'"; - // Generated outputs - var outputs = []; - - // Create a compilerHost object to allow the compiler to read and write files - var compilerHost = { - getSourceFile: (fileName, target) => { - return files[fileName] !== undefined ? - ts.createSourceFile(fileName, files[fileName], target) : undefined; - }, - writeFile: (name, text, writeByteOrderMark) => { - outputs.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); - }, - getDefaultLibFileName: () => "lib.d.ts", - useCaseSensitiveFileNames: () => false, - getCanonicalFileName: (fileName) => fileName, - getCurrentDirectory: () => "", - getNewLine: () => "\n" - }; - - // Create a program from inputs - var program = ts.createProgram(["file.ts"], compilerOptions, compilerHost); - - // Query for early errors - var errors = ts.getPreEmitDiagnostics(program); - var emitResult = program.emit(); - - errors = errors.concat(emitResult.diagnostics); - - return { - outputs: outputs, - errors: errors.map(function (e) { - return e.file.fileName + "(" + (e.file.getLineAndCharacterOfPosition(e.start).line + 1) + "): " - + ts.flattenDiagnosticMessageText(e.messageText, os.EOL); - }) - }; -} - -// Calling our transform function using a simple TypeScript variable declarations, -// and loading the default library like: -var source = "var x: number = 'string'"; -var result = transform(source); +let result = ts.transpile(source, { module: ts.ModuleKind.CommonJS }); console.log(JSON.stringify(result)); -//// [typescript.d.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 http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -declare module "typescript" { - interface Map { - [index: string]: T; - } - interface TextRange { - pos: number; - end: number; - } - const enum SyntaxKind { - Unknown = 0, - EndOfFileToken = 1, - SingleLineCommentTrivia = 2, - MultiLineCommentTrivia = 3, - NewLineTrivia = 4, - WhitespaceTrivia = 5, - ConflictMarkerTrivia = 6, - NumericLiteral = 7, - StringLiteral = 8, - RegularExpressionLiteral = 9, - NoSubstitutionTemplateLiteral = 10, - TemplateHead = 11, - TemplateMiddle = 12, - TemplateTail = 13, - OpenBraceToken = 14, - CloseBraceToken = 15, - OpenParenToken = 16, - CloseParenToken = 17, - OpenBracketToken = 18, - CloseBracketToken = 19, - DotToken = 20, - DotDotDotToken = 21, - SemicolonToken = 22, - CommaToken = 23, - LessThanToken = 24, - GreaterThanToken = 25, - LessThanEqualsToken = 26, - GreaterThanEqualsToken = 27, - EqualsEqualsToken = 28, - ExclamationEqualsToken = 29, - EqualsEqualsEqualsToken = 30, - ExclamationEqualsEqualsToken = 31, - EqualsGreaterThanToken = 32, - PlusToken = 33, - MinusToken = 34, - AsteriskToken = 35, - SlashToken = 36, - PercentToken = 37, - PlusPlusToken = 38, - MinusMinusToken = 39, - LessThanLessThanToken = 40, - GreaterThanGreaterThanToken = 41, - GreaterThanGreaterThanGreaterThanToken = 42, - AmpersandToken = 43, - BarToken = 44, - CaretToken = 45, - ExclamationToken = 46, - TildeToken = 47, - AmpersandAmpersandToken = 48, - BarBarToken = 49, - QuestionToken = 50, - ColonToken = 51, - AtToken = 52, - EqualsToken = 53, - PlusEqualsToken = 54, - MinusEqualsToken = 55, - AsteriskEqualsToken = 56, - SlashEqualsToken = 57, - PercentEqualsToken = 58, - LessThanLessThanEqualsToken = 59, - GreaterThanGreaterThanEqualsToken = 60, - GreaterThanGreaterThanGreaterThanEqualsToken = 61, - AmpersandEqualsToken = 62, - BarEqualsToken = 63, - CaretEqualsToken = 64, - Identifier = 65, - BreakKeyword = 66, - CaseKeyword = 67, - CatchKeyword = 68, - ClassKeyword = 69, - ConstKeyword = 70, - ContinueKeyword = 71, - DebuggerKeyword = 72, - DefaultKeyword = 73, - DeleteKeyword = 74, - DoKeyword = 75, - ElseKeyword = 76, - EnumKeyword = 77, - ExportKeyword = 78, - ExtendsKeyword = 79, - FalseKeyword = 80, - FinallyKeyword = 81, - ForKeyword = 82, - FunctionKeyword = 83, - IfKeyword = 84, - ImportKeyword = 85, - InKeyword = 86, - InstanceOfKeyword = 87, - NewKeyword = 88, - NullKeyword = 89, - ReturnKeyword = 90, - SuperKeyword = 91, - SwitchKeyword = 92, - ThisKeyword = 93, - ThrowKeyword = 94, - TrueKeyword = 95, - TryKeyword = 96, - TypeOfKeyword = 97, - VarKeyword = 98, - VoidKeyword = 99, - WhileKeyword = 100, - WithKeyword = 101, - AsKeyword = 102, - ImplementsKeyword = 103, - InterfaceKeyword = 104, - LetKeyword = 105, - PackageKeyword = 106, - PrivateKeyword = 107, - ProtectedKeyword = 108, - PublicKeyword = 109, - StaticKeyword = 110, - YieldKeyword = 111, - AnyKeyword = 112, - BooleanKeyword = 113, - ConstructorKeyword = 114, - 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, - OmittedExpression = 174, - TemplateSpan = 175, - Block = 176, - VariableStatement = 177, - EmptyStatement = 178, - ExpressionStatement = 179, - IfStatement = 180, - DoStatement = 181, - WhileStatement = 182, - ForStatement = 183, - ForInStatement = 184, - ForOfStatement = 185, - ContinueStatement = 186, - BreakStatement = 187, - ReturnStatement = 188, - WithStatement = 189, - SwitchStatement = 190, - LabeledStatement = 191, - ThrowStatement = 192, - TryStatement = 193, - DebuggerStatement = 194, - VariableDeclaration = 195, - VariableDeclarationList = 196, - FunctionDeclaration = 197, - ClassDeclaration = 198, - InterfaceDeclaration = 199, - TypeAliasDeclaration = 200, - EnumDeclaration = 201, - ModuleDeclaration = 202, - ModuleBlock = 203, - CaseBlock = 204, - ImportEqualsDeclaration = 205, - ImportDeclaration = 206, - ImportClause = 207, - NamespaceImport = 208, - NamedImports = 209, - ImportSpecifier = 210, - ExportAssignment = 211, - ExportDeclaration = 212, - NamedExports = 213, - ExportSpecifier = 214, - MissingDeclaration = 215, - ExternalModuleReference = 216, - CaseClause = 217, - DefaultClause = 218, - HeritageClause = 219, - CatchClause = 220, - PropertyAssignment = 221, - ShorthandPropertyAssignment = 222, - EnumMember = 223, - SourceFile = 224, - SyntaxList = 225, - Count = 226, - FirstAssignment = 53, - LastAssignment = 64, - FirstReservedWord = 66, - LastReservedWord = 101, - FirstKeyword = 66, - LastKeyword = 125, - FirstFutureReservedWord = 103, - LastFutureReservedWord = 111, - FirstTypeNode = 141, - LastTypeNode = 149, - FirstPunctuation = 14, - LastPunctuation = 64, - FirstToken = 0, - LastToken = 125, - FirstTriviaToken = 2, - LastTriviaToken = 6, - FirstLiteralToken = 7, - LastLiteralToken = 10, - FirstTemplateToken = 10, - LastTemplateToken = 13, - FirstBinaryOperator = 24, - LastBinaryOperator = 64, - FirstNode = 126, - } - const enum NodeFlags { - Export = 1, - Ambient = 2, - Public = 16, - Private = 32, - Protected = 64, - Static = 128, - Default = 256, - MultiLine = 512, - Synthetic = 1024, - DeclarationFile = 2048, - Let = 4096, - Const = 8192, - OctalLiteral = 16384, - ExportContext = 32768, - Modifier = 499, - AccessibilityModifier = 112, - BlockScoped = 12288, - } - const enum ParserContextFlags { - StrictMode = 1, - DisallowIn = 2, - Yield = 4, - GeneratorParameter = 8, - Decorator = 16, - ThisNodeHasError = 32, - ParserGeneratedFlags = 63, - ThisNodeOrAnySubNodesHasError = 64, - HasAggregatedChildData = 128, - } - const enum RelationComparisonResult { - Succeeded = 1, - Failed = 2, - FailedAndReported = 3, - } - interface Node extends TextRange { - kind: SyntaxKind; - flags: NodeFlags; - parserContextFlags?: ParserContextFlags; - decorators?: NodeArray; - modifiers?: ModifiersArray; - id?: number; - parent?: Node; - symbol?: Symbol; - locals?: SymbolTable; - nextContainer?: Node; - localSymbol?: Symbol; - } - interface NodeArray extends Array, TextRange { - hasTrailingComma?: boolean; - } - interface ModifiersArray extends NodeArray { - flags: number; - } - interface Identifier extends PrimaryExpression { - text: string; - } - interface QualifiedName extends Node { - left: EntityName; - right: Identifier; - } - type EntityName = Identifier | QualifiedName; - type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName | BindingPattern; - interface Declaration extends Node { - _declarationBrand: any; - name?: DeclarationName; - } - interface ComputedPropertyName extends Node { - expression: Expression; - } - interface Decorator extends Node { - expression: LeftHandSideExpression; - } - interface TypeParameterDeclaration extends Declaration { - name: Identifier; - constraint?: TypeNode; - expression?: Expression; - } - interface SignatureDeclaration extends Declaration { - typeParameters?: NodeArray; - parameters: NodeArray; - type?: TypeNode; - } - interface VariableDeclaration extends Declaration { - parent?: VariableDeclarationList; - name: Identifier | BindingPattern; - type?: TypeNode; - initializer?: Expression; - } - interface VariableDeclarationList extends Node { - declarations: NodeArray; - } - interface ParameterDeclaration extends Declaration { - dotDotDotToken?: Node; - name: Identifier | BindingPattern; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface BindingElement extends Declaration { - propertyName?: Identifier; - dotDotDotToken?: Node; - name: Identifier | BindingPattern; - initializer?: Expression; - } - interface PropertyDeclaration extends Declaration, ClassElement { - name: DeclarationName; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface ObjectLiteralElement extends Declaration { - _objectLiteralBrandBrand: any; - } - interface PropertyAssignment extends ObjectLiteralElement { - _propertyAssignmentBrand: any; - name: DeclarationName; - questionToken?: Node; - initializer: Expression; - } - interface ShorthandPropertyAssignment extends ObjectLiteralElement { - name: Identifier; - questionToken?: Node; - } - interface VariableLikeDeclaration extends Declaration { - propertyName?: Identifier; - dotDotDotToken?: Node; - name: DeclarationName; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface BindingPattern extends Node { - elements: NodeArray; - } - /** - * Several node kinds share function-like features such as a signature, - * a name, and a body. These nodes should extend FunctionLikeDeclaration. - * Examples: - * FunctionDeclaration - * MethodDeclaration - * AccessorDeclaration - */ - interface FunctionLikeDeclaration extends SignatureDeclaration { - _functionLikeDeclarationBrand: any; - asteriskToken?: Node; - questionToken?: Node; - body?: Block | Expression; - } - interface FunctionDeclaration extends FunctionLikeDeclaration, Statement { - name?: Identifier; - body?: Block; - } - interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { - body?: Block; - } - interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { - body?: Block; - } - interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { - _accessorDeclarationBrand: any; - body: Block; - } - interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement { - _indexSignatureDeclarationBrand: any; - } - interface TypeNode extends Node { - _typeNodeBrand: any; - } - interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration { - _functionOrConstructorTypeNodeBrand: any; - } - interface TypeReferenceNode extends TypeNode { - typeName: EntityName; - typeArguments?: NodeArray; - } - interface TypeQueryNode extends TypeNode { - exprName: EntityName; - } - interface TypeLiteralNode extends TypeNode, Declaration { - members: NodeArray; - } - interface ArrayTypeNode extends TypeNode { - elementType: TypeNode; - } - interface TupleTypeNode extends TypeNode { - elementTypes: NodeArray; - } - interface UnionTypeNode extends TypeNode { - types: NodeArray; - } - interface ParenthesizedTypeNode extends TypeNode { - type: TypeNode; - } - interface StringLiteralTypeNode extends LiteralExpression, TypeNode { - } - interface Expression extends Node { - _expressionBrand: any; - contextualType?: Type; - } - interface UnaryExpression extends Expression { - _unaryExpressionBrand: any; - } - interface PrefixUnaryExpression extends UnaryExpression { - operator: SyntaxKind; - operand: UnaryExpression; - } - interface PostfixUnaryExpression extends PostfixExpression { - operand: LeftHandSideExpression; - operator: SyntaxKind; - } - interface PostfixExpression extends UnaryExpression { - _postfixExpressionBrand: any; - } - interface LeftHandSideExpression extends PostfixExpression { - _leftHandSideExpressionBrand: any; - } - interface MemberExpression extends LeftHandSideExpression { - _memberExpressionBrand: any; - } - interface PrimaryExpression extends MemberExpression { - _primaryExpressionBrand: any; - } - interface DeleteExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface TypeOfExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface VoidExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface YieldExpression extends Expression { - asteriskToken?: Node; - expression: Expression; - } - interface BinaryExpression extends Expression { - left: Expression; - operatorToken: Node; - right: Expression; - } - interface ConditionalExpression extends Expression { - condition: Expression; - questionToken: Node; - whenTrue: Expression; - colonToken: Node; - whenFalse: Expression; - } - interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration { - name?: Identifier; - body: Block | Expression; - } - interface ArrowFunction extends Expression, FunctionLikeDeclaration { - equalsGreaterThanToken: Node; - } - interface LiteralExpression extends PrimaryExpression { - text: string; - isUnterminated?: boolean; - hasExtendedUnicodeEscape?: boolean; - } - interface StringLiteralExpression extends LiteralExpression { - _stringLiteralExpressionBrand: any; - } - interface TemplateExpression extends PrimaryExpression { - head: LiteralExpression; - templateSpans: NodeArray; - } - interface TemplateSpan extends Node { - expression: Expression; - literal: LiteralExpression; - } - interface ParenthesizedExpression extends PrimaryExpression { - expression: Expression; - } - interface ArrayLiteralExpression extends PrimaryExpression { - elements: NodeArray; - } - interface SpreadElementExpression extends Expression { - expression: Expression; - } - interface ObjectLiteralExpression extends PrimaryExpression, Declaration { - properties: NodeArray; - } - interface PropertyAccessExpression extends MemberExpression { - expression: LeftHandSideExpression; - dotToken: Node; - name: Identifier; - } - interface ElementAccessExpression extends MemberExpression { - expression: LeftHandSideExpression; - argumentExpression?: Expression; - } - interface CallExpression extends LeftHandSideExpression { - expression: LeftHandSideExpression; - typeArguments?: NodeArray; - arguments: NodeArray; - } - interface NewExpression extends CallExpression, PrimaryExpression { - } - interface TaggedTemplateExpression extends MemberExpression { - tag: LeftHandSideExpression; - template: LiteralExpression | TemplateExpression; - } - type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression; - interface TypeAssertion extends UnaryExpression { - type: TypeNode; - expression: UnaryExpression; - } - interface Statement extends Node, ModuleElement { - _statementBrand: any; - } - interface Block extends Statement { - statements: NodeArray; - } - interface VariableStatement extends Statement { - declarationList: VariableDeclarationList; - } - interface ExpressionStatement extends Statement { - expression: Expression; - } - interface IfStatement extends Statement { - expression: Expression; - thenStatement: Statement; - elseStatement?: Statement; - } - interface IterationStatement extends Statement { - statement: Statement; - } - interface DoStatement extends IterationStatement { - expression: Expression; - } - interface WhileStatement extends IterationStatement { - expression: Expression; - } - interface ForStatement extends IterationStatement { - initializer?: VariableDeclarationList | Expression; - condition?: Expression; - iterator?: Expression; - } - interface ForInStatement extends IterationStatement { - initializer: VariableDeclarationList | Expression; - expression: Expression; - } - interface ForOfStatement extends IterationStatement { - initializer: VariableDeclarationList | Expression; - expression: Expression; - } - interface BreakOrContinueStatement extends Statement { - label?: Identifier; - } - interface ReturnStatement extends Statement { - expression?: Expression; - } - interface WithStatement extends Statement { - expression: Expression; - statement: Statement; - } - interface SwitchStatement extends Statement { - expression: Expression; - caseBlock: CaseBlock; - } - interface CaseBlock extends Node { - clauses: NodeArray; - } - interface CaseClause extends Node { - expression?: Expression; - statements: NodeArray; - } - interface DefaultClause extends Node { - statements: NodeArray; - } - type CaseOrDefaultClause = CaseClause | DefaultClause; - interface LabeledStatement extends Statement { - label: Identifier; - statement: Statement; - } - interface ThrowStatement extends Statement { - expression: Expression; - } - interface TryStatement extends Statement { - tryBlock: Block; - catchClause?: CatchClause; - finallyBlock?: Block; - } - interface CatchClause extends Node { - variableDeclaration: VariableDeclaration; - block: Block; - } - interface ModuleElement extends Node { - _moduleElementBrand: any; - } - interface ClassDeclaration extends Declaration, ModuleElement { - name?: Identifier; - typeParameters?: NodeArray; - heritageClauses?: NodeArray; - members: NodeArray; - } - interface ClassElement extends Declaration { - _classElementBrand: any; - } - interface InterfaceDeclaration extends Declaration, ModuleElement { - name: Identifier; - typeParameters?: NodeArray; - heritageClauses?: NodeArray; - members: NodeArray; - } - interface HeritageClause extends Node { - token: SyntaxKind; - types?: NodeArray; - } - interface TypeAliasDeclaration extends Declaration, ModuleElement { - name: Identifier; - type: TypeNode; - } - interface EnumMember extends Declaration { - name: DeclarationName; - initializer?: Expression; - } - interface EnumDeclaration extends Declaration, ModuleElement { - name: Identifier; - members: NodeArray; - } - interface ModuleDeclaration extends Declaration, ModuleElement { - name: Identifier | LiteralExpression; - body: ModuleBlock | ModuleDeclaration; - } - interface ModuleBlock extends Node, ModuleElement { - statements: NodeArray; - } - interface ImportEqualsDeclaration extends Declaration, ModuleElement { - name: Identifier; - moduleReference: EntityName | ExternalModuleReference; - } - interface ExternalModuleReference extends Node { - expression?: Expression; - } - interface ImportDeclaration extends Statement, ModuleElement { - importClause?: ImportClause; - moduleSpecifier: Expression; - } - interface ImportClause extends Declaration { - name?: Identifier; - namedBindings?: NamespaceImport | NamedImports; - } - interface NamespaceImport extends Declaration { - name: Identifier; - } - interface ExportDeclaration extends Declaration, ModuleElement { - exportClause?: NamedExports; - moduleSpecifier?: Expression; - } - interface NamedImportsOrExports extends Node { - elements: NodeArray; - } - type NamedImports = NamedImportsOrExports; - type NamedExports = NamedImportsOrExports; - interface ImportOrExportSpecifier extends Declaration { - propertyName?: Identifier; - name: Identifier; - } - type ImportSpecifier = ImportOrExportSpecifier; - type ExportSpecifier = ImportOrExportSpecifier; - interface ExportAssignment extends Declaration, ModuleElement { - isExportEquals?: boolean; - expression?: Expression; - type?: TypeNode; - } - interface FileReference extends TextRange { - fileName: string; - } - interface CommentRange extends TextRange { - hasTrailingNewLine?: boolean; - } - interface SourceFile extends Declaration { - statements: NodeArray; - endOfFileToken: Node; - fileName: string; - text: string; - amdDependencies: { - path: string; - name: string; - }[]; - amdModuleName: string; - referencedFiles: FileReference[]; - hasNoDefaultLib: boolean; - externalModuleIndicator: Node; - languageVersion: ScriptTarget; - identifiers: Map; - } - interface ScriptReferenceHost { - getCompilerOptions(): CompilerOptions; - getSourceFile(fileName: string): SourceFile; - getCurrentDirectory(): string; - } - interface WriteFileCallback { - (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; - } - interface Program extends ScriptReferenceHost { - getSourceFiles(): SourceFile[]; - /** - * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then - * the JavaScript and declaration files will be produced for all the files in this program. - * If targetSourceFile is specified, then only the JavaScript and declaration for that - * specific file will be generated. - * - * If writeFile is not specified then the writeFile callback from the compiler host will be - * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter - * will be invoked when writing the JavaScript and declaration files. - */ - emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback): EmitResult; - getSyntacticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getGlobalDiagnostics(): Diagnostic[]; - getSemanticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getDeclarationDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getTypeChecker(): TypeChecker; - getCommonSourceDirectory(): string; - } - interface SourceMapSpan { - emittedLine: number; - emittedColumn: number; - sourceLine: number; - sourceColumn: number; - nameIndex?: number; - sourceIndex: number; - } - interface SourceMapData { - sourceMapFilePath: string; - jsSourceMappingURL: string; - sourceMapFile: string; - sourceMapSourceRoot: string; - sourceMapSources: string[]; - inputSourceFileNames: string[]; - sourceMapNames?: string[]; - sourceMapMappings: string; - sourceMapDecodedMappings: SourceMapSpan[]; - } - enum ExitStatus { - Success = 0, - DiagnosticsPresent_OutputsSkipped = 1, - DiagnosticsPresent_OutputsGenerated = 2, - } - interface EmitResult { - emitSkipped: boolean; - diagnostics: Diagnostic[]; - sourceMaps: SourceMapData[]; - } - interface TypeCheckerHost { - getCompilerOptions(): CompilerOptions; - getSourceFiles(): SourceFile[]; - getSourceFile(fileName: string): SourceFile; - } - interface TypeChecker { - getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; - getDeclaredTypeOfSymbol(symbol: Symbol): Type; - getPropertiesOfType(type: Type): Symbol[]; - getPropertyOfType(type: Type, propertyName: string): Symbol; - getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; - getIndexTypeOfType(type: Type, kind: IndexKind): Type; - getReturnTypeOfSignature(signature: Signature): Type; - getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; - getSymbolAtLocation(node: Node): Symbol; - getShorthandAssignmentValueSymbol(location: Node): Symbol; - getTypeAtLocation(node: Node): Type; - typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; - symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; - getSymbolDisplayBuilder(): SymbolDisplayBuilder; - getFullyQualifiedName(symbol: Symbol): string; - getAugmentedPropertiesOfType(type: Type): Symbol[]; - getRootSymbols(symbol: Symbol): Symbol[]; - getContextualType(node: Expression): Type; - getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature; - getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature; - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; - isUndefinedSymbol(symbol: Symbol): boolean; - isArgumentsSymbol(symbol: Symbol): boolean; - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; - isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; - getAliasedSymbol(symbol: Symbol): Symbol; - getExportsOfExternalModule(node: ImportDeclaration): Symbol[]; - } - interface SymbolDisplayBuilder { - buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; - buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags): void; - buildDisplayForParametersAndDelimiters(parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - } - interface SymbolWriter { - writeKeyword(text: string): void; - writeOperator(text: string): void; - writePunctuation(text: string): void; - writeSpace(text: string): void; - writeStringLiteral(text: string): void; - writeParameter(text: string): void; - writeSymbol(text: string, symbol: Symbol): void; - writeLine(): void; - increaseIndent(): void; - decreaseIndent(): void; - clear(): void; - trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; - } - const enum TypeFormatFlags { - None = 0, - WriteArrayAsGenericType = 1, - UseTypeOfFunction = 2, - NoTruncation = 4, - WriteArrowStyleSignature = 8, - WriteOwnNameForAnyLike = 16, - WriteTypeArgumentsOfSignature = 32, - InElementType = 64, - UseFullyQualifiedType = 128, - } - const enum SymbolFormatFlags { - None = 0, - WriteTypeParametersOrArguments = 1, - UseOnlyExternalAliasing = 2, - } - const enum SymbolAccessibility { - Accessible = 0, - NotAccessible = 1, - CannotBeNamed = 2, - } - type AnyImportSyntax = ImportDeclaration | ImportEqualsDeclaration; - interface SymbolVisibilityResult { - accessibility: SymbolAccessibility; - aliasesToMakeVisible?: AnyImportSyntax[]; - errorSymbolName?: string; - errorNode?: Node; - } - interface SymbolAccessiblityResult extends SymbolVisibilityResult { - errorModuleName?: string; - } - interface EmitResolver { - hasGlobalName(name: string): boolean; - getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string; - isValueAliasDeclaration(node: Node): boolean; - isReferencedAliasDeclaration(node: Node, checkChildren?: boolean): boolean; - isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; - getNodeCheckFlags(node: Node): NodeCheckFlags; - isDeclarationVisible(node: Declaration): boolean; - collectLinkedAliases(node: Identifier): Node[]; - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; - writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult; - isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult; - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; - resolvesToSomeValue(location: Node, name: string): boolean; - getBlockScopedVariableId(node: Identifier): number; - } - const enum SymbolFlags { - FunctionScopedVariable = 1, - BlockScopedVariable = 2, - Property = 4, - EnumMember = 8, - Function = 16, - Class = 32, - Interface = 64, - ConstEnum = 128, - RegularEnum = 256, - ValueModule = 512, - NamespaceModule = 1024, - TypeLiteral = 2048, - ObjectLiteral = 4096, - Method = 8192, - Constructor = 16384, - GetAccessor = 32768, - SetAccessor = 65536, - Signature = 131072, - TypeParameter = 262144, - TypeAlias = 524288, - ExportValue = 1048576, - ExportType = 2097152, - ExportNamespace = 4194304, - Alias = 8388608, - Instantiated = 16777216, - Merged = 33554432, - Transient = 67108864, - Prototype = 134217728, - UnionProperty = 268435456, - Optional = 536870912, - ExportStar = 1073741824, - Enum = 384, - Variable = 3, - Value = 107455, - Type = 793056, - Namespace = 1536, - Module = 1536, - Accessor = 98304, - FunctionScopedVariableExcludes = 107454, - BlockScopedVariableExcludes = 107455, - ParameterExcludes = 107455, - PropertyExcludes = 107455, - EnumMemberExcludes = 107455, - FunctionExcludes = 106927, - ClassExcludes = 899583, - InterfaceExcludes = 792992, - RegularEnumExcludes = 899327, - ConstEnumExcludes = 899967, - ValueModuleExcludes = 106639, - NamespaceModuleExcludes = 0, - MethodExcludes = 99263, - GetAccessorExcludes = 41919, - SetAccessorExcludes = 74687, - TypeParameterExcludes = 530912, - TypeAliasExcludes = 793056, - AliasExcludes = 8388608, - ModuleMember = 8914931, - ExportHasLocal = 944, - HasLocals = 255504, - HasExports = 1952, - HasMembers = 6240, - IsContainer = 262128, - PropertyOrAccessor = 98308, - Export = 7340032, - } - interface Symbol { - flags: SymbolFlags; - name: string; - id?: number; - mergeId?: number; - declarations?: Declaration[]; - parent?: Symbol; - members?: SymbolTable; - exports?: SymbolTable; - exportSymbol?: Symbol; - valueDeclaration?: Declaration; - constEnumOnlyModule?: boolean; - } - interface SymbolLinks { - target?: Symbol; - type?: Type; - declaredType?: Type; - mapper?: TypeMapper; - referenced?: boolean; - unionType?: UnionType; - resolvedExports?: SymbolTable; - exportsChecked?: boolean; - } - interface TransientSymbol extends Symbol, SymbolLinks { - } - interface SymbolTable { - [index: string]: Symbol; - } - const enum NodeCheckFlags { - TypeChecked = 1, - LexicalThis = 2, - CaptureThis = 4, - EmitExtends = 8, - SuperInstance = 16, - SuperStatic = 32, - ContextChecked = 64, - EnumValuesComputed = 128, - BlockScopedBindingInLoop = 256, - EmitDecorate = 512, - } - interface NodeLinks { - resolvedType?: Type; - resolvedSignature?: Signature; - resolvedSymbol?: Symbol; - flags?: NodeCheckFlags; - enumMemberValue?: number; - isIllegalTypeReferenceInConstraint?: boolean; - isVisible?: boolean; - generatedName?: string; - generatedNames?: Map; - assignmentChecks?: Map; - hasReportedStatementInAmbientContext?: boolean; - importOnRightSide?: Symbol; - } - const enum TypeFlags { - Any = 1, - String = 2, - Number = 4, - Boolean = 8, - Void = 16, - Undefined = 32, - Null = 64, - Enum = 128, - StringLiteral = 256, - TypeParameter = 512, - Class = 1024, - Interface = 2048, - Reference = 4096, - Tuple = 8192, - Union = 16384, - Anonymous = 32768, - FromSignature = 65536, - ObjectLiteral = 131072, - ContainsUndefinedOrNull = 262144, - ContainsObjectLiteral = 524288, - ESSymbol = 1048576, - Intrinsic = 1048703, - Primitive = 1049086, - StringLike = 258, - NumberLike = 132, - ObjectType = 48128, - RequiresWidening = 786432, - } - interface Type { - flags: TypeFlags; - id: number; - symbol?: Symbol; - } - interface IntrinsicType extends Type { - intrinsicName: string; - } - interface StringLiteralType extends Type { - text: string; - } - interface ObjectType extends Type { - } - interface InterfaceType extends ObjectType { - typeParameters: TypeParameter[]; - baseTypes: ObjectType[]; - declaredProperties: Symbol[]; - declaredCallSignatures: Signature[]; - declaredConstructSignatures: Signature[]; - declaredStringIndexType: Type; - declaredNumberIndexType: Type; - } - interface TypeReference extends ObjectType { - target: GenericType; - typeArguments: Type[]; - } - interface GenericType extends InterfaceType, TypeReference { - instantiations: Map; - } - interface TupleType extends ObjectType { - elementTypes: Type[]; - baseArrayType: TypeReference; - } - interface UnionType extends Type { - types: Type[]; - resolvedProperties: SymbolTable; - } - interface ResolvedType extends ObjectType, UnionType { - members: SymbolTable; - properties: Symbol[]; - callSignatures: Signature[]; - constructSignatures: Signature[]; - stringIndexType: Type; - numberIndexType: Type; - } - interface TypeParameter extends Type { - constraint: Type; - target?: TypeParameter; - mapper?: TypeMapper; - } - const enum SignatureKind { - Call = 0, - Construct = 1, - } - interface Signature { - declaration: SignatureDeclaration; - typeParameters: TypeParameter[]; - parameters: Symbol[]; - resolvedReturnType: Type; - minArgumentCount: number; - hasRestParameter: boolean; - hasStringLiterals: boolean; - target?: Signature; - mapper?: TypeMapper; - unionSignatures?: Signature[]; - erasedSignatureCache?: Signature; - isolatedSignatureType?: ObjectType; - } - const enum IndexKind { - String = 0, - Number = 1, - } - interface TypeMapper { - (t: Type): Type; - } - interface DiagnosticMessage { - key: string; - category: DiagnosticCategory; - code: number; - } - interface DiagnosticMessageChain { - messageText: string; - category: DiagnosticCategory; - code: number; - next?: DiagnosticMessageChain; - } - interface Diagnostic { - file: SourceFile; - start: number; - length: number; - messageText: string | DiagnosticMessageChain; - category: DiagnosticCategory; - code: number; - } - enum DiagnosticCategory { - Warning = 0, - Error = 1, - Message = 2, - } - interface CompilerOptions { - allowNonTsExtensions?: boolean; - charset?: string; - codepage?: number; - declaration?: boolean; - diagnostics?: boolean; - emitBOM?: boolean; - help?: boolean; - listFiles?: boolean; - locale?: string; - mapRoot?: string; - module?: ModuleKind; - noEmit?: boolean; - noEmitOnError?: boolean; - noErrorTruncation?: boolean; - noImplicitAny?: boolean; - noLib?: boolean; - noLibCheck?: boolean; - noResolve?: boolean; - out?: string; - outDir?: string; - preserveConstEnums?: boolean; - project?: string; - removeComments?: boolean; - sourceMap?: boolean; - sourceRoot?: string; - suppressImplicitAnyIndexErrors?: boolean; - target?: ScriptTarget; - version?: boolean; - watch?: boolean; - [option: string]: string | number | boolean; - } - const enum ModuleKind { - None = 0, - CommonJS = 1, - AMD = 2, - } - interface LineAndCharacter { - line: number; - character: number; - } - const enum ScriptTarget { - ES3 = 0, - ES5 = 1, - ES6 = 2, - Latest = 2, - } - interface ParsedCommandLine { - options: CompilerOptions; - fileNames: string[]; - errors: Diagnostic[]; - } - interface CommandLineOption { - name: string; - type: string | Map; - isFilePath?: boolean; - shortName?: string; - description?: DiagnosticMessage; - paramType?: DiagnosticMessage; - error?: DiagnosticMessage; - experimental?: boolean; - } - const enum CharacterCodes { - nullCharacter = 0, - maxAsciiCharacter = 127, - lineFeed = 10, - carriageReturn = 13, - lineSeparator = 8232, - paragraphSeparator = 8233, - nextLine = 133, - space = 32, - nonBreakingSpace = 160, - enQuad = 8192, - emQuad = 8193, - enSpace = 8194, - emSpace = 8195, - threePerEmSpace = 8196, - fourPerEmSpace = 8197, - sixPerEmSpace = 8198, - figureSpace = 8199, - punctuationSpace = 8200, - thinSpace = 8201, - hairSpace = 8202, - zeroWidthSpace = 8203, - narrowNoBreakSpace = 8239, - ideographicSpace = 12288, - mathematicalSpace = 8287, - ogham = 5760, - _ = 95, - $ = 36, - _0 = 48, - _1 = 49, - _2 = 50, - _3 = 51, - _4 = 52, - _5 = 53, - _6 = 54, - _7 = 55, - _8 = 56, - _9 = 57, - a = 97, - b = 98, - c = 99, - d = 100, - e = 101, - f = 102, - g = 103, - h = 104, - i = 105, - j = 106, - k = 107, - l = 108, - m = 109, - n = 110, - o = 111, - p = 112, - q = 113, - r = 114, - s = 115, - t = 116, - u = 117, - v = 118, - w = 119, - x = 120, - y = 121, - z = 122, - A = 65, - B = 66, - C = 67, - D = 68, - E = 69, - F = 70, - G = 71, - H = 72, - I = 73, - J = 74, - K = 75, - L = 76, - M = 77, - N = 78, - O = 79, - P = 80, - Q = 81, - R = 82, - S = 83, - T = 84, - U = 85, - V = 86, - W = 87, - X = 88, - Y = 89, - Z = 90, - ampersand = 38, - asterisk = 42, - at = 64, - backslash = 92, - backtick = 96, - bar = 124, - caret = 94, - closeBrace = 125, - closeBracket = 93, - closeParen = 41, - colon = 58, - comma = 44, - dot = 46, - doubleQuote = 34, - equals = 61, - exclamation = 33, - greaterThan = 62, - hash = 35, - lessThan = 60, - minus = 45, - openBrace = 123, - openBracket = 91, - openParen = 40, - percent = 37, - plus = 43, - question = 63, - semicolon = 59, - singleQuote = 39, - slash = 47, - tilde = 126, - backspace = 8, - formFeed = 12, - byteOrderMark = 65279, - tab = 9, - verticalTab = 11, - } - interface CancellationToken { - isCancellationRequested(): boolean; - } - interface CompilerHost { - getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile; - getDefaultLibFileName(options: CompilerOptions): string; - getCancellationToken?(): CancellationToken; - writeFile: WriteFileCallback; - getCurrentDirectory(): string; - getCanonicalFileName(fileName: string): string; - useCaseSensitiveFileNames(): boolean; - getNewLine(): string; - } - interface TextSpan { - start: number; - length: number; - } - interface TextChangeRange { - span: TextSpan; - newLength: number; - } -} -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): void; - setTextPos(textPos: number): void; - lookAhead(callback: () => T): T; - tryScan(callback: () => T): T; - } - function tokenToString(t: SyntaxKind): string; - function computeLineStarts(text: string): number[]; - function getPositionOfLineAndCharacter(sourceFile: SourceFile, line: number, character: number): number; - function computePositionOfLineAndCharacter(lineStarts: number[], line: number, character: number): number; - function getLineStarts(sourceFile: SourceFile): number[]; - function computeLineAndCharacterOfPosition(lineStarts: number[], position: number): { - line: number; - character: number; - }; - function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter; - function isWhiteSpace(ch: number): boolean; - function isLineBreak(ch: number): boolean; - function isOctalDigit(ch: number): boolean; - function skipTrivia(text: string, pos: number, stopAfterLineBreak?: boolean): number; - function getLeadingCommentRanges(text: string, pos: number): CommentRange[]; - function getTrailingCommentRanges(text: string, pos: number): CommentRange[]; - function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean; - function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean; - function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback): Scanner; -} -declare module "typescript" { - function getNodeConstructor(kind: SyntaxKind): new () => Node; - function createNode(kind: SyntaxKind): Node; - function forEachChild(node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; - function modifierToFlag(token: SyntaxKind): NodeFlags; - function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; - function isEvalOrArgumentsIdentifier(node: Node): boolean; - function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean): SourceFile; - function isLeftHandSideExpression(expr: Expression): boolean; - function isAssignmentOperator(token: SyntaxKind): boolean; -} -declare module "typescript" { - function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker; -} -declare module "typescript" { - /** The version of the TypeScript compiler release */ - let version: string; - function findConfigFile(searchPath: string): string; - function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; - function getPreEmitDiagnostics(program: Program): Diagnostic[]; - function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; - function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; -} -declare module "typescript" { - /** The version of the language service API */ - let servicesVersion: string; - interface Node { - getSourceFile(): SourceFile; - getChildCount(sourceFile?: SourceFile): number; - getChildAt(index: number, sourceFile?: SourceFile): Node; - getChildren(sourceFile?: SourceFile): Node[]; - getStart(sourceFile?: SourceFile): number; - getFullStart(): number; - getEnd(): number; - getWidth(sourceFile?: SourceFile): number; - getFullWidth(): number; - getLeadingTriviaWidth(sourceFile?: SourceFile): number; - getFullText(sourceFile?: SourceFile): string; - getText(sourceFile?: SourceFile): string; - getFirstToken(sourceFile?: SourceFile): Node; - getLastToken(sourceFile?: SourceFile): Node; - } - interface Symbol { - getFlags(): SymbolFlags; - getName(): string; - getDeclarations(): Declaration[]; - getDocumentationComment(): SymbolDisplayPart[]; - } - interface Type { - getFlags(): TypeFlags; - getSymbol(): Symbol; - getProperties(): Symbol[]; - getProperty(propertyName: string): Symbol; - getApparentProperties(): Symbol[]; - getCallSignatures(): Signature[]; - getConstructSignatures(): Signature[]; - getStringIndexType(): Type; - getNumberIndexType(): Type; - } - interface Signature { - getDeclaration(): SignatureDeclaration; - getTypeParameters(): Type[]; - getParameters(): Symbol[]; - getReturnType(): Type; - getDocumentationComment(): SymbolDisplayPart[]; - } - interface SourceFile { - getNamedDeclarations(): Declaration[]; - getLineAndCharacterOfPosition(pos: number): LineAndCharacter; - getLineStarts(): number[]; - getPositionOfLineAndCharacter(line: number, character: number): number; - update(newText: string, textChangeRange: TextChangeRange): SourceFile; - } - /** - * Represents an immutable snapshot of a script at a specified time.Once acquired, the - * snapshot is observably immutable. i.e. the same calls with the same parameters will return - * the same values. - */ - interface IScriptSnapshot { - /** Gets a portion of the script snapshot specified by [start, end). */ - getText(start: number, end: number): string; - /** Gets the length of this script snapshot. */ - getLength(): number; - /** - * Gets the TextChangeRange that describe how the text changed between this text and - * an older version. This information is used by the incremental parser to determine - * what sections of the script need to be re-parsed. 'undefined' can be returned if the - * change range cannot be determined. However, in that case, incremental parsing will - * not happen and the entire document will be re - parsed. - */ - getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange; - } - module ScriptSnapshot { - function fromString(text: string): IScriptSnapshot; - } - interface PreProcessedFileInfo { - referencedFiles: FileReference[]; - importedFiles: FileReference[]; - isLibFile: boolean; - } - interface LanguageServiceHost { - getCompilationSettings(): CompilerOptions; - getNewLine?(): string; - getScriptFileNames(): string[]; - getScriptVersion(fileName: string): string; - getScriptSnapshot(fileName: string): IScriptSnapshot; - getLocalizedDiagnosticMessages?(): any; - getCancellationToken?(): CancellationToken; - getCurrentDirectory(): string; - getDefaultLibFileName(options: CompilerOptions): string; - log?(s: string): void; - trace?(s: string): void; - error?(s: string): void; - } - interface LanguageService { - cleanupSemanticCache(): void; - getSyntacticDiagnostics(fileName: string): Diagnostic[]; - getSemanticDiagnostics(fileName: string): Diagnostic[]; - getCompilerOptionsDiagnostics(): Diagnostic[]; - getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; - getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; - getCompletionsAtPosition(fileName: string, position: number): CompletionInfo; - getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails; - getQuickInfoAtPosition(fileName: string, position: number): QuickInfo; - getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan; - getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan; - getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems; - getRenameInfo(fileName: string, position: number): RenameInfo; - findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]; - getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; - getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; - getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; - findReferences(fileName: string, position: number): ReferencedSymbol[]; - getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[]; - getNavigationBarItems(fileName: string): NavigationBarItem[]; - getOutliningSpans(fileName: string): OutliningSpan[]; - getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[]; - getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[]; - getIndentationAtPosition(fileName: string, position: number, options: EditorOptions): number; - getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions): TextChange[]; - getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): TextChange[]; - getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextChange[]; - getEmitOutput(fileName: string): EmitOutput; - getProgram(): Program; - getSourceFile(fileName: string): SourceFile; - dispose(): void; - } - interface ClassifiedSpan { - textSpan: TextSpan; - classificationType: string; - } - interface NavigationBarItem { - text: string; - kind: string; - kindModifiers: string; - spans: TextSpan[]; - childItems: NavigationBarItem[]; - indent: number; - bolded: boolean; - grayed: boolean; - } - interface TodoCommentDescriptor { - text: string; - priority: number; - } - interface TodoComment { - descriptor: TodoCommentDescriptor; - message: string; - position: number; - } - class TextChange { - span: TextSpan; - newText: string; - } - interface RenameLocation { - textSpan: TextSpan; - fileName: string; - } - interface ReferenceEntry { - textSpan: TextSpan; - fileName: string; - isWriteAccess: boolean; - } - interface NavigateToItem { - name: string; - kind: string; - kindModifiers: string; - matchKind: string; - isCaseSensitive: boolean; - fileName: string; - textSpan: TextSpan; - containerName: string; - containerKind: string; - } - interface EditorOptions { - IndentSize: number; - TabSize: number; - NewLineCharacter: string; - ConvertTabsToSpaces: boolean; - } - interface FormatCodeOptions extends EditorOptions { - InsertSpaceAfterCommaDelimiter: boolean; - InsertSpaceAfterSemicolonInForStatements: boolean; - InsertSpaceBeforeAndAfterBinaryOperators: boolean; - InsertSpaceAfterKeywordsInControlFlowStatements: boolean; - InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; - InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; - PlaceOpenBraceOnNewLineForFunctions: boolean; - PlaceOpenBraceOnNewLineForControlBlocks: boolean; - [s: string]: boolean | number | string; - } - interface DefinitionInfo { - fileName: string; - textSpan: TextSpan; - kind: string; - name: string; - containerKind: string; - containerName: string; - } - interface ReferencedSymbol { - definition: DefinitionInfo; - references: ReferenceEntry[]; - } - enum SymbolDisplayPartKind { - aliasName = 0, - className = 1, - enumName = 2, - fieldName = 3, - interfaceName = 4, - keyword = 5, - lineBreak = 6, - numericLiteral = 7, - stringLiteral = 8, - localName = 9, - methodName = 10, - moduleName = 11, - operator = 12, - parameterName = 13, - propertyName = 14, - punctuation = 15, - space = 16, - text = 17, - typeParameterName = 18, - enumMemberName = 19, - functionName = 20, - regularExpressionLiteral = 21, - } - interface SymbolDisplayPart { - text: string; - kind: string; - } - interface QuickInfo { - kind: string; - kindModifiers: string; - textSpan: TextSpan; - displayParts: SymbolDisplayPart[]; - documentation: SymbolDisplayPart[]; - } - interface RenameInfo { - canRename: boolean; - localizedErrorMessage: string; - displayName: string; - fullDisplayName: string; - kind: string; - kindModifiers: string; - triggerSpan: TextSpan; - } - interface SignatureHelpParameter { - name: string; - documentation: SymbolDisplayPart[]; - displayParts: SymbolDisplayPart[]; - isOptional: boolean; - } - /** - * Represents a single signature to show in signature help. - * The id is used for subsequent calls into the language service to ask questions about the - * signature help item in the context of any documents that have been updated. i.e. after - * an edit has happened, while signature help is still active, the host can ask important - * questions like 'what parameter is the user currently contained within?'. - */ - interface SignatureHelpItem { - isVariadic: boolean; - prefixDisplayParts: SymbolDisplayPart[]; - suffixDisplayParts: SymbolDisplayPart[]; - separatorDisplayParts: SymbolDisplayPart[]; - parameters: SignatureHelpParameter[]; - documentation: SymbolDisplayPart[]; - } - /** - * Represents a set of signature help items, and the preferred item that should be selected. - */ - interface SignatureHelpItems { - items: SignatureHelpItem[]; - applicableSpan: TextSpan; - selectedItemIndex: number; - argumentIndex: number; - argumentCount: number; - } - interface CompletionInfo { - isMemberCompletion: boolean; - isNewIdentifierLocation: boolean; - entries: CompletionEntry[]; - } - interface CompletionEntry { - name: string; - kind: string; - kindModifiers: string; - } - interface CompletionEntryDetails { - name: string; - kind: string; - kindModifiers: string; - displayParts: SymbolDisplayPart[]; - documentation: SymbolDisplayPart[]; - } - interface OutliningSpan { - /** The span of the document to actually collapse. */ - textSpan: TextSpan; - /** The span of the document to display when the user hovers over the collapsed span. */ - hintSpan: TextSpan; - /** The text to display in the editor for the collapsed region. */ - bannerText: string; - /** - * Whether or not this region should be automatically collapsed when - * the 'Collapse to Definitions' command is invoked. - */ - autoCollapse: boolean; - } - interface EmitOutput { - outputFiles: OutputFile[]; - emitSkipped: boolean; - } - const enum OutputFileType { - JavaScript = 0, - SourceMap = 1, - Declaration = 2, - } - interface OutputFile { - name: string; - writeByteOrderMark: boolean; - text: string; - } - const enum EndOfLineState { - Start = 0, - InMultiLineCommentTrivia = 1, - InSingleQuoteStringLiteral = 2, - InDoubleQuoteStringLiteral = 3, - InTemplateHeadOrNoSubstitutionTemplate = 4, - InTemplateMiddleOrTail = 5, - InTemplateSubstitutionPosition = 6, - } - enum TokenClass { - Punctuation = 0, - Keyword = 1, - Operator = 2, - Comment = 3, - Whitespace = 4, - Identifier = 5, - NumberLiteral = 6, - StringLiteral = 7, - RegExpLiteral = 8, - } - interface ClassificationResult { - finalLexState: EndOfLineState; - entries: ClassificationInfo[]; - } - interface ClassificationInfo { - length: number; - classification: TokenClass; - } - interface Classifier { - /** - * Gives lexical classifications of tokens on a line without any syntactic context. - * For instance, a token consisting of the text 'string' can be either an identifier - * named 'string' or the keyword 'string', however, because this classifier is not aware, - * it relies on certain heuristics to give acceptable results. For classifications where - * speed trumps accuracy, this function is preferable; however, for true accuracy, the - * syntactic classifier is ideal. In fact, in certain editing scenarios, combining the - * lexical, syntactic, and semantic classifiers may issue the best user experience. - * - * @param text The text of a line to classify. - * @param lexState The state of the lexical classifier at the end of the previous line. - * @param syntacticClassifierAbsent Whether the client is *not* using a syntactic classifier. - * If there is no syntactic classifier (syntacticClassifierAbsent=true), - * certain heuristics may be used in its place; however, if there is a - * syntactic classifier (syntacticClassifierAbsent=false), certain - * classifications which may be incorrectly categorized will be given - * back as Identifiers in order to allow the syntactic classifier to - * subsume the classification. - */ - getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult; - } - /** - * The document registry represents a store of SourceFile objects that can be shared between - * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) - * of files in the context. - * SourceFile objects account for most of the memory usage by the language service. Sharing - * the same DocumentRegistry instance between different instances of LanguageService allow - * for more efficient memory utilization since all projects will share at least the library - * file (lib.d.ts). - * - * A more advanced use of the document registry is to serialize sourceFile objects to disk - * and re-hydrate them when needed. - * - * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it - * to all subsequent createLanguageService calls. - */ - interface DocumentRegistry { - /** - * Request a stored SourceFile with a given fileName and compilationSettings. - * The first call to acquire will call createLanguageServiceSourceFile to generate - * the SourceFile if was not found in the registry. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @parm scriptSnapshot Text of the file. Only used if the file was not found - * in the registry and a new one was created. - * @parm version Current version of the file. Only used if the file was not found - * in the registry and a new one was created. - */ - acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; - /** - * Request an updated version of an already existing SourceFile with a given fileName - * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile - * to get an updated SourceFile. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @param scriptSnapshot Text of the file. - * @param version Current version of the file. - */ - updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; - /** - * Informs the DocumentRegistry that a file is not needed any longer. - * - * Note: It is not allowed to call release on a SourceFile that was not acquired from - * this registry originally. - * - * @param fileName The name of the file to be released - * @param compilationSettings The compilation settings used to acquire the file - */ - releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; - } - class ScriptElementKind { - static unknown: string; - static keyword: string; - static scriptElement: string; - static moduleElement: string; - static classElement: string; - static interfaceElement: string; - static typeElement: string; - static enumElement: string; - static variableElement: string; - static localVariableElement: string; - static functionElement: string; - static localFunctionElement: string; - static memberFunctionElement: string; - static memberGetAccessorElement: string; - static memberSetAccessorElement: string; - static memberVariableElement: string; - static constructorImplementationElement: string; - static callSignatureElement: string; - static indexSignatureElement: string; - static constructSignatureElement: string; - static parameterElement: string; - static typeParameterElement: string; - static primitiveType: string; - static label: string; - static alias: string; - static constElement: string; - static letElement: string; - } - class ScriptElementKindModifier { - static none: string; - static publicMemberModifier: string; - static privateMemberModifier: string; - static protectedMemberModifier: string; - static exportedModifier: string; - static ambientModifier: string; - static staticModifier: string; - } - class ClassificationTypeNames { - static comment: string; - static identifier: string; - static keyword: string; - static numericLiteral: string; - static operator: string; - static stringLiteral: string; - static whiteSpace: string; - static text: string; - static punctuation: string; - static className: string; - static enumName: string; - static interfaceName: string; - static moduleName: string; - static typeParameterName: string; - static typeAlias: string; - } - interface DisplayPartsSymbolWriter extends SymbolWriter { - displayParts(): SymbolDisplayPart[]; - } - function displayPartsToString(displayParts: SymbolDisplayPart[]): string; - function getDefaultCompilerOptions(): CompilerOptions; - class OperationCanceledException { - } - class CancellationTokenObject { - private cancellationToken; - static None: CancellationTokenObject; - constructor(cancellationToken: CancellationToken); - isCancellationRequested(): boolean; - throwIfCancellationRequested(): void; - } - function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile; - let disableIncrementalParsing: boolean; - function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; - function createDocumentRegistry(): DocumentRegistry; - function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo; - function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; - function createClassifier(): Classifier; - /** - * Get the path of the default library file (lib.d.ts) as distributed with the typescript - * node package. - * The functionality is not supported if the ts module is consumed outside of a node module. - */ - function getDefaultLibFilePath(options: CompilerOptions): string; -} - //// [APISample_transform.js] /* @@ -2039,60 +23,6 @@ declare module "typescript" { * Please log a "breaking change" issue for any API breaking change affecting this issue */ var ts = require("typescript"); -function transform(contents, compilerOptions) { - if (compilerOptions === void 0) { compilerOptions = {}; } - // Sources - var files = { - "file.ts": contents, - "lib.d.ts": fs.readFileSync(ts.getDefaultLibFilePath(compilerOptions)).toString() - }; - // Generated outputs - var outputs = []; - // Create a compilerHost object to allow the compiler to read and write files - var compilerHost = { - getSourceFile: function (fileName, target) { - return files[fileName] !== undefined ? ts.createSourceFile(fileName, files[fileName], target) : undefined; - }, - writeFile: function (name, text, writeByteOrderMark) { - outputs.push({ - name: name, - text: text, - writeByteOrderMark: writeByteOrderMark - }); - }, - getDefaultLibFileName: function () { - return "lib.d.ts"; - }, - useCaseSensitiveFileNames: function () { - return false; - }, - getCanonicalFileName: function (fileName) { - return fileName; - }, - getCurrentDirectory: function () { - return ""; - }, - getNewLine: function () { - return "\n"; - } - }; - // Create a program from inputs - var program = ts.createProgram([ - "file.ts" - ], compilerOptions, compilerHost); - // Query for early errors - var errors = ts.getPreEmitDiagnostics(program); - var emitResult = program.emit(); - errors = errors.concat(emitResult.diagnostics); - return { - outputs: outputs, - errors: errors.map(function (e) { - return e.file.fileName + "(" + (e.file.getLineAndCharacterOfPosition(e.start).line + 1) + "): " + ts.flattenDiagnosticMessageText(e.messageText, os.EOL); - }) - }; -} -// Calling our transform function using a simple TypeScript variable declarations, -// and loading the default library like: -var source = "var x: number = 'string'"; -var result = transform(source); +var source = "let x: string = 'string'"; +var result = ts.transpile(source, { module: 1 /* CommonJS */ }); console.log(JSON.stringify(result)); diff --git a/tests/baselines/reference/APISample_transform.types b/tests/baselines/reference/APISample_transform.types index 4ea9c49d758..d98d2cfad00 100644 --- a/tests/baselines/reference/APISample_transform.types +++ b/tests/baselines/reference/APISample_transform.types @@ -6,242 +6,29 @@ * Please log a "breaking change" issue for any API breaking change affecting this issue */ -declare var process: any; ->process : any - declare var console: any; >console : any -declare var fs: any; ->fs : any - -declare var path: any; ->path : any - -declare var os: any; ->os : any - -import ts = require("typescript"); +import * as ts from "typescript"; >ts : typeof ts -function transform(contents: string, compilerOptions: ts.CompilerOptions = {}) { ->transform : (contents: string, compilerOptions?: ts.CompilerOptions) => { outputs: any[]; errors: string[]; } ->contents : string ->compilerOptions : ts.CompilerOptions ->ts : unknown ->CompilerOptions : ts.CompilerOptions ->{} : { [x: string]: undefined; } - - // Sources - var files = { ->files : { "file.ts": string; "lib.d.ts": any; } ->{ "file.ts": contents, "lib.d.ts": fs.readFileSync(ts.getDefaultLibFilePath(compilerOptions)).toString() } : { "file.ts": string; "lib.d.ts": any; } - - "file.ts": contents, ->contents : string - - "lib.d.ts": fs.readFileSync(ts.getDefaultLibFilePath(compilerOptions)).toString() ->fs.readFileSync(ts.getDefaultLibFilePath(compilerOptions)).toString() : any ->fs.readFileSync(ts.getDefaultLibFilePath(compilerOptions)).toString : any ->fs.readFileSync(ts.getDefaultLibFilePath(compilerOptions)) : any ->fs.readFileSync : any ->fs : any ->readFileSync : any ->ts.getDefaultLibFilePath(compilerOptions) : string ->ts.getDefaultLibFilePath : (options: ts.CompilerOptions) => string ->ts : typeof ts ->getDefaultLibFilePath : (options: ts.CompilerOptions) => string ->compilerOptions : ts.CompilerOptions ->toString : any - - }; - - // Generated outputs - var outputs = []; ->outputs : any[] ->[] : undefined[] - - // Create a compilerHost object to allow the compiler to read and write files - var compilerHost = { ->compilerHost : { getSourceFile: (fileName: any, target: any) => ts.SourceFile; writeFile: (name: any, text: any, writeByteOrderMark: any) => void; getDefaultLibFileName: () => string; useCaseSensitiveFileNames: () => boolean; getCanonicalFileName: (fileName: any) => any; getCurrentDirectory: () => string; getNewLine: () => string; } ->{ getSourceFile: (fileName, target) => { return files[fileName] !== undefined ? ts.createSourceFile(fileName, files[fileName], target) : undefined; }, writeFile: (name, text, writeByteOrderMark) => { outputs.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }, getDefaultLibFileName: () => "lib.d.ts", useCaseSensitiveFileNames: () => false, getCanonicalFileName: (fileName) => fileName, getCurrentDirectory: () => "", getNewLine: () => "\n" } : { getSourceFile: (fileName: any, target: any) => ts.SourceFile; writeFile: (name: any, text: any, writeByteOrderMark: any) => void; getDefaultLibFileName: () => string; useCaseSensitiveFileNames: () => boolean; getCanonicalFileName: (fileName: any) => any; getCurrentDirectory: () => string; getNewLine: () => string; } - - getSourceFile: (fileName, target) => { ->getSourceFile : (fileName: any, target: any) => ts.SourceFile ->(fileName, target) => { return files[fileName] !== undefined ? ts.createSourceFile(fileName, files[fileName], target) : undefined; } : (fileName: any, target: any) => ts.SourceFile ->fileName : any ->target : any - - return files[fileName] !== undefined ? ->files[fileName] !== undefined ? ts.createSourceFile(fileName, files[fileName], target) : undefined : ts.SourceFile ->files[fileName] !== undefined : boolean ->files[fileName] : any ->files : { "file.ts": string; "lib.d.ts": any; } ->fileName : any ->undefined : undefined - - ts.createSourceFile(fileName, files[fileName], target) : undefined; ->ts.createSourceFile(fileName, files[fileName], target) : ts.SourceFile ->ts.createSourceFile : (fileName: string, sourceText: string, languageVersion: ts.ScriptTarget, setParentNodes?: boolean) => ts.SourceFile ->ts : typeof ts ->createSourceFile : (fileName: string, sourceText: string, languageVersion: ts.ScriptTarget, setParentNodes?: boolean) => ts.SourceFile ->fileName : any ->files[fileName] : any ->files : { "file.ts": string; "lib.d.ts": any; } ->fileName : any ->target : any ->undefined : undefined - - }, - writeFile: (name, text, writeByteOrderMark) => { ->writeFile : (name: any, text: any, writeByteOrderMark: any) => void ->(name, text, writeByteOrderMark) => { outputs.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); } : (name: any, text: any, writeByteOrderMark: any) => void ->name : any ->text : any ->writeByteOrderMark : any - - outputs.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); ->outputs.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }) : number ->outputs.push : (...items: any[]) => number ->outputs : any[] ->push : (...items: any[]) => number ->{ name: name, text: text, writeByteOrderMark: writeByteOrderMark } : { name: any; text: any; writeByteOrderMark: any; } ->name : any ->name : any ->text : any ->text : any ->writeByteOrderMark : any ->writeByteOrderMark : any - - }, - getDefaultLibFileName: () => "lib.d.ts", ->getDefaultLibFileName : () => string ->() => "lib.d.ts" : () => string - - useCaseSensitiveFileNames: () => false, ->useCaseSensitiveFileNames : () => boolean ->() => false : () => boolean - - getCanonicalFileName: (fileName) => fileName, ->getCanonicalFileName : (fileName: any) => any ->(fileName) => fileName : (fileName: any) => any ->fileName : any ->fileName : any - - getCurrentDirectory: () => "", ->getCurrentDirectory : () => string ->() => "" : () => string - - getNewLine: () => "\n" ->getNewLine : () => string ->() => "\n" : () => string - - }; - - // Create a program from inputs - var program = ts.createProgram(["file.ts"], compilerOptions, compilerHost); ->program : ts.Program ->ts.createProgram(["file.ts"], compilerOptions, compilerHost) : ts.Program ->ts.createProgram : (rootNames: string[], options: ts.CompilerOptions, host?: ts.CompilerHost) => ts.Program ->ts : typeof ts ->createProgram : (rootNames: string[], options: ts.CompilerOptions, host?: ts.CompilerHost) => ts.Program ->["file.ts"] : string[] ->compilerOptions : ts.CompilerOptions ->compilerHost : { getSourceFile: (fileName: any, target: any) => ts.SourceFile; writeFile: (name: any, text: any, writeByteOrderMark: any) => void; getDefaultLibFileName: () => string; useCaseSensitiveFileNames: () => boolean; getCanonicalFileName: (fileName: any) => any; getCurrentDirectory: () => string; getNewLine: () => string; } - - // Query for early errors - var errors = ts.getPreEmitDiagnostics(program); ->errors : ts.Diagnostic[] ->ts.getPreEmitDiagnostics(program) : ts.Diagnostic[] ->ts.getPreEmitDiagnostics : (program: ts.Program) => ts.Diagnostic[] ->ts : typeof ts ->getPreEmitDiagnostics : (program: ts.Program) => ts.Diagnostic[] ->program : ts.Program - - var emitResult = program.emit(); ->emitResult : ts.EmitResult ->program.emit() : ts.EmitResult ->program.emit : (targetSourceFile?: ts.SourceFile, writeFile?: ts.WriteFileCallback) => ts.EmitResult ->program : ts.Program ->emit : (targetSourceFile?: ts.SourceFile, writeFile?: ts.WriteFileCallback) => ts.EmitResult - - errors = errors.concat(emitResult.diagnostics); ->errors = errors.concat(emitResult.diagnostics) : ts.Diagnostic[] ->errors : ts.Diagnostic[] ->errors.concat(emitResult.diagnostics) : ts.Diagnostic[] ->errors.concat : { (...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; } ->errors : ts.Diagnostic[] ->concat : { (...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; } ->emitResult.diagnostics : ts.Diagnostic[] ->emitResult : ts.EmitResult ->diagnostics : ts.Diagnostic[] - - return { ->{ outputs: outputs, errors: errors.map(function (e) { return e.file.fileName + "(" + (e.file.getLineAndCharacterOfPosition(e.start).line + 1) + "): " + ts.flattenDiagnosticMessageText(e.messageText, os.EOL); }) } : { outputs: any[]; errors: string[]; } - - outputs: outputs, ->outputs : any[] ->outputs : any[] - - errors: errors.map(function (e) { ->errors : string[] ->errors.map(function (e) { return e.file.fileName + "(" + (e.file.getLineAndCharacterOfPosition(e.start).line + 1) + "): " + ts.flattenDiagnosticMessageText(e.messageText, os.EOL); }) : string[] ->errors.map : (callbackfn: (value: ts.Diagnostic, index: number, array: ts.Diagnostic[]) => U, thisArg?: any) => U[] ->errors : ts.Diagnostic[] ->map : (callbackfn: (value: ts.Diagnostic, index: number, array: ts.Diagnostic[]) => U, thisArg?: any) => U[] ->function (e) { return e.file.fileName + "(" + (e.file.getLineAndCharacterOfPosition(e.start).line + 1) + "): " + ts.flattenDiagnosticMessageText(e.messageText, os.EOL); } : (e: ts.Diagnostic) => string ->e : ts.Diagnostic - - return e.file.fileName + "(" + (e.file.getLineAndCharacterOfPosition(e.start).line + 1) + "): " ->e.file.fileName + "(" + (e.file.getLineAndCharacterOfPosition(e.start).line + 1) + "): " + ts.flattenDiagnosticMessageText(e.messageText, os.EOL) : string ->e.file.fileName + "(" + (e.file.getLineAndCharacterOfPosition(e.start).line + 1) + "): " : string ->e.file.fileName + "(" + (e.file.getLineAndCharacterOfPosition(e.start).line + 1) : string ->e.file.fileName + "(" : string ->e.file.fileName : string ->e.file : ts.SourceFile ->e : ts.Diagnostic ->file : ts.SourceFile ->fileName : string ->(e.file.getLineAndCharacterOfPosition(e.start).line + 1) : number ->e.file.getLineAndCharacterOfPosition(e.start).line + 1 : number ->e.file.getLineAndCharacterOfPosition(e.start).line : number ->e.file.getLineAndCharacterOfPosition(e.start) : ts.LineAndCharacter ->e.file.getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter ->e.file : ts.SourceFile ->e : ts.Diagnostic ->file : ts.SourceFile ->getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter ->e.start : number ->e : ts.Diagnostic ->start : number ->line : number - - + ts.flattenDiagnosticMessageText(e.messageText, os.EOL); ->ts.flattenDiagnosticMessageText(e.messageText, os.EOL) : string ->ts.flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string ->ts : typeof ts ->flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string ->e.messageText : string | ts.DiagnosticMessageChain ->e : ts.Diagnostic ->messageText : string | ts.DiagnosticMessageChain ->os.EOL : any ->os : any ->EOL : any - - }) - }; -} - -// Calling our transform function using a simple TypeScript variable declarations, -// and loading the default library like: -var source = "var x: number = 'string'"; +const source = "let x: string = 'string'"; >source : string -var result = transform(source); ->result : { outputs: any[]; errors: string[]; } ->transform(source) : { outputs: any[]; errors: string[]; } ->transform : (contents: string, compilerOptions?: ts.CompilerOptions) => { outputs: any[]; errors: string[]; } +let result = ts.transpile(source, { module: ts.ModuleKind.CommonJS }); +>result : string +>ts.transpile(source, { module: ts.ModuleKind.CommonJS }) : string +>ts.transpile : (input: string, compilerOptions?: ts.CompilerOptions, fileName?: string, diagnostics?: ts.Diagnostic[]) => string +>ts : typeof ts +>transpile : (input: string, compilerOptions?: ts.CompilerOptions, fileName?: string, diagnostics?: ts.Diagnostic[]) => string >source : string +>{ module: ts.ModuleKind.CommonJS } : { [x: string]: ts.ModuleKind; module: ts.ModuleKind; } +>module : ts.ModuleKind +>ts.ModuleKind.CommonJS : ts.ModuleKind +>ts.ModuleKind : typeof ts.ModuleKind +>ts : typeof ts +>ModuleKind : typeof ts.ModuleKind +>CommonJS : ts.ModuleKind console.log(JSON.stringify(result)); >console.log(JSON.stringify(result)) : any @@ -252,6066 +39,5 @@ console.log(JSON.stringify(result)); >JSON.stringify : { (value: any): string; (value: any, replacer: (key: string, value: any) => any): string; (value: any, replacer: any[]): string; (value: any, replacer: (key: string, value: any) => any, space: any): string; (value: any, replacer: any[], space: any): string; } >JSON : JSON >stringify : { (value: any): string; (value: any, replacer: (key: string, value: any) => any): string; (value: any, replacer: any[]): string; (value: any, replacer: (key: string, value: any) => any, space: any): string; (value: any, replacer: any[], space: any): string; } ->result : { outputs: any[]; errors: string[]; } - -=== typescript.d.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 http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -declare module "typescript" { - interface Map { ->Map : Map ->T : T - - [index: string]: T; ->index : string ->T : T - } - interface TextRange { ->TextRange : TextRange - - pos: number; ->pos : number - - end: number; ->end : number - } - const enum SyntaxKind { ->SyntaxKind : SyntaxKind - - Unknown = 0, ->Unknown : SyntaxKind - - EndOfFileToken = 1, ->EndOfFileToken : SyntaxKind - - SingleLineCommentTrivia = 2, ->SingleLineCommentTrivia : SyntaxKind - - MultiLineCommentTrivia = 3, ->MultiLineCommentTrivia : SyntaxKind - - NewLineTrivia = 4, ->NewLineTrivia : SyntaxKind - - WhitespaceTrivia = 5, ->WhitespaceTrivia : SyntaxKind - - ConflictMarkerTrivia = 6, ->ConflictMarkerTrivia : SyntaxKind - - NumericLiteral = 7, ->NumericLiteral : SyntaxKind - - StringLiteral = 8, ->StringLiteral : SyntaxKind - - RegularExpressionLiteral = 9, ->RegularExpressionLiteral : SyntaxKind - - NoSubstitutionTemplateLiteral = 10, ->NoSubstitutionTemplateLiteral : SyntaxKind - - TemplateHead = 11, ->TemplateHead : SyntaxKind - - TemplateMiddle = 12, ->TemplateMiddle : SyntaxKind - - TemplateTail = 13, ->TemplateTail : SyntaxKind - - OpenBraceToken = 14, ->OpenBraceToken : SyntaxKind - - CloseBraceToken = 15, ->CloseBraceToken : SyntaxKind - - OpenParenToken = 16, ->OpenParenToken : SyntaxKind - - CloseParenToken = 17, ->CloseParenToken : SyntaxKind - - OpenBracketToken = 18, ->OpenBracketToken : SyntaxKind - - CloseBracketToken = 19, ->CloseBracketToken : SyntaxKind - - DotToken = 20, ->DotToken : SyntaxKind - - DotDotDotToken = 21, ->DotDotDotToken : SyntaxKind - - SemicolonToken = 22, ->SemicolonToken : SyntaxKind - - CommaToken = 23, ->CommaToken : SyntaxKind - - LessThanToken = 24, ->LessThanToken : SyntaxKind - - GreaterThanToken = 25, ->GreaterThanToken : SyntaxKind - - LessThanEqualsToken = 26, ->LessThanEqualsToken : SyntaxKind - - GreaterThanEqualsToken = 27, ->GreaterThanEqualsToken : SyntaxKind - - EqualsEqualsToken = 28, ->EqualsEqualsToken : SyntaxKind - - ExclamationEqualsToken = 29, ->ExclamationEqualsToken : SyntaxKind - - EqualsEqualsEqualsToken = 30, ->EqualsEqualsEqualsToken : SyntaxKind - - ExclamationEqualsEqualsToken = 31, ->ExclamationEqualsEqualsToken : SyntaxKind - - EqualsGreaterThanToken = 32, ->EqualsGreaterThanToken : SyntaxKind - - PlusToken = 33, ->PlusToken : SyntaxKind - - MinusToken = 34, ->MinusToken : SyntaxKind - - AsteriskToken = 35, ->AsteriskToken : SyntaxKind - - SlashToken = 36, ->SlashToken : SyntaxKind - - PercentToken = 37, ->PercentToken : SyntaxKind - - PlusPlusToken = 38, ->PlusPlusToken : SyntaxKind - - MinusMinusToken = 39, ->MinusMinusToken : SyntaxKind - - LessThanLessThanToken = 40, ->LessThanLessThanToken : SyntaxKind - - GreaterThanGreaterThanToken = 41, ->GreaterThanGreaterThanToken : SyntaxKind - - GreaterThanGreaterThanGreaterThanToken = 42, ->GreaterThanGreaterThanGreaterThanToken : SyntaxKind - - AmpersandToken = 43, ->AmpersandToken : SyntaxKind - - BarToken = 44, ->BarToken : SyntaxKind - - CaretToken = 45, ->CaretToken : SyntaxKind - - ExclamationToken = 46, ->ExclamationToken : SyntaxKind - - TildeToken = 47, ->TildeToken : SyntaxKind - - AmpersandAmpersandToken = 48, ->AmpersandAmpersandToken : SyntaxKind - - BarBarToken = 49, ->BarBarToken : SyntaxKind - - QuestionToken = 50, ->QuestionToken : SyntaxKind - - ColonToken = 51, ->ColonToken : SyntaxKind - - AtToken = 52, ->AtToken : SyntaxKind - - EqualsToken = 53, ->EqualsToken : SyntaxKind - - PlusEqualsToken = 54, ->PlusEqualsToken : SyntaxKind - - MinusEqualsToken = 55, ->MinusEqualsToken : SyntaxKind - - AsteriskEqualsToken = 56, ->AsteriskEqualsToken : SyntaxKind - - SlashEqualsToken = 57, ->SlashEqualsToken : SyntaxKind - - PercentEqualsToken = 58, ->PercentEqualsToken : SyntaxKind - - LessThanLessThanEqualsToken = 59, ->LessThanLessThanEqualsToken : SyntaxKind - - GreaterThanGreaterThanEqualsToken = 60, ->GreaterThanGreaterThanEqualsToken : SyntaxKind - - GreaterThanGreaterThanGreaterThanEqualsToken = 61, ->GreaterThanGreaterThanGreaterThanEqualsToken : SyntaxKind - - AmpersandEqualsToken = 62, ->AmpersandEqualsToken : SyntaxKind - - BarEqualsToken = 63, ->BarEqualsToken : SyntaxKind - - CaretEqualsToken = 64, ->CaretEqualsToken : SyntaxKind - - Identifier = 65, ->Identifier : SyntaxKind - - BreakKeyword = 66, ->BreakKeyword : SyntaxKind - - CaseKeyword = 67, ->CaseKeyword : SyntaxKind - - CatchKeyword = 68, ->CatchKeyword : SyntaxKind - - ClassKeyword = 69, ->ClassKeyword : SyntaxKind - - ConstKeyword = 70, ->ConstKeyword : SyntaxKind - - ContinueKeyword = 71, ->ContinueKeyword : SyntaxKind - - DebuggerKeyword = 72, ->DebuggerKeyword : SyntaxKind - - DefaultKeyword = 73, ->DefaultKeyword : SyntaxKind - - DeleteKeyword = 74, ->DeleteKeyword : SyntaxKind - - DoKeyword = 75, ->DoKeyword : SyntaxKind - - ElseKeyword = 76, ->ElseKeyword : SyntaxKind - - EnumKeyword = 77, ->EnumKeyword : SyntaxKind - - ExportKeyword = 78, ->ExportKeyword : SyntaxKind - - ExtendsKeyword = 79, ->ExtendsKeyword : SyntaxKind - - FalseKeyword = 80, ->FalseKeyword : SyntaxKind - - FinallyKeyword = 81, ->FinallyKeyword : SyntaxKind - - ForKeyword = 82, ->ForKeyword : SyntaxKind - - FunctionKeyword = 83, ->FunctionKeyword : SyntaxKind - - IfKeyword = 84, ->IfKeyword : SyntaxKind - - ImportKeyword = 85, ->ImportKeyword : SyntaxKind - - InKeyword = 86, ->InKeyword : SyntaxKind - - InstanceOfKeyword = 87, ->InstanceOfKeyword : SyntaxKind - - NewKeyword = 88, ->NewKeyword : SyntaxKind - - NullKeyword = 89, ->NullKeyword : SyntaxKind - - ReturnKeyword = 90, ->ReturnKeyword : SyntaxKind - - SuperKeyword = 91, ->SuperKeyword : SyntaxKind - - SwitchKeyword = 92, ->SwitchKeyword : SyntaxKind - - ThisKeyword = 93, ->ThisKeyword : SyntaxKind - - ThrowKeyword = 94, ->ThrowKeyword : SyntaxKind - - TrueKeyword = 95, ->TrueKeyword : SyntaxKind - - TryKeyword = 96, ->TryKeyword : SyntaxKind - - TypeOfKeyword = 97, ->TypeOfKeyword : SyntaxKind - - VarKeyword = 98, ->VarKeyword : SyntaxKind - - VoidKeyword = 99, ->VoidKeyword : SyntaxKind - - WhileKeyword = 100, ->WhileKeyword : SyntaxKind - - WithKeyword = 101, ->WithKeyword : SyntaxKind - - AsKeyword = 102, ->AsKeyword : SyntaxKind - - ImplementsKeyword = 103, ->ImplementsKeyword : SyntaxKind - - InterfaceKeyword = 104, ->InterfaceKeyword : SyntaxKind - - LetKeyword = 105, ->LetKeyword : SyntaxKind - - PackageKeyword = 106, ->PackageKeyword : SyntaxKind - - PrivateKeyword = 107, ->PrivateKeyword : SyntaxKind - - ProtectedKeyword = 108, ->ProtectedKeyword : SyntaxKind - - PublicKeyword = 109, ->PublicKeyword : SyntaxKind - - StaticKeyword = 110, ->StaticKeyword : SyntaxKind - - YieldKeyword = 111, ->YieldKeyword : SyntaxKind - - AnyKeyword = 112, ->AnyKeyword : SyntaxKind - - BooleanKeyword = 113, ->BooleanKeyword : SyntaxKind - - ConstructorKeyword = 114, ->ConstructorKeyword : SyntaxKind - - DeclareKeyword = 115, ->DeclareKeyword : SyntaxKind - - GetKeyword = 116, ->GetKeyword : SyntaxKind - - ModuleKeyword = 117, ->ModuleKeyword : SyntaxKind - - RequireKeyword = 118, ->RequireKeyword : SyntaxKind - - NumberKeyword = 119, ->NumberKeyword : SyntaxKind - - SetKeyword = 120, ->SetKeyword : SyntaxKind - - StringKeyword = 121, ->StringKeyword : SyntaxKind - - SymbolKeyword = 122, ->SymbolKeyword : SyntaxKind - - TypeKeyword = 123, ->TypeKeyword : SyntaxKind - - FromKeyword = 124, ->FromKeyword : SyntaxKind - - OfKeyword = 125, ->OfKeyword : SyntaxKind - - QualifiedName = 126, ->QualifiedName : SyntaxKind - - ComputedPropertyName = 127, ->ComputedPropertyName : SyntaxKind - - TypeParameter = 128, ->TypeParameter : SyntaxKind - - Parameter = 129, ->Parameter : SyntaxKind - - Decorator = 130, ->Decorator : SyntaxKind - - PropertySignature = 131, ->PropertySignature : SyntaxKind - - PropertyDeclaration = 132, ->PropertyDeclaration : SyntaxKind - - MethodSignature = 133, ->MethodSignature : SyntaxKind - - MethodDeclaration = 134, ->MethodDeclaration : SyntaxKind - - Constructor = 135, ->Constructor : SyntaxKind - - GetAccessor = 136, ->GetAccessor : SyntaxKind - - SetAccessor = 137, ->SetAccessor : SyntaxKind - - CallSignature = 138, ->CallSignature : SyntaxKind - - ConstructSignature = 139, ->ConstructSignature : SyntaxKind - - IndexSignature = 140, ->IndexSignature : SyntaxKind - - TypeReference = 141, ->TypeReference : SyntaxKind - - FunctionType = 142, ->FunctionType : SyntaxKind - - ConstructorType = 143, ->ConstructorType : SyntaxKind - - TypeQuery = 144, ->TypeQuery : SyntaxKind - - TypeLiteral = 145, ->TypeLiteral : SyntaxKind - - ArrayType = 146, ->ArrayType : SyntaxKind - - TupleType = 147, ->TupleType : SyntaxKind - - UnionType = 148, ->UnionType : SyntaxKind - - ParenthesizedType = 149, ->ParenthesizedType : SyntaxKind - - ObjectBindingPattern = 150, ->ObjectBindingPattern : SyntaxKind - - ArrayBindingPattern = 151, ->ArrayBindingPattern : SyntaxKind - - BindingElement = 152, ->BindingElement : SyntaxKind - - ArrayLiteralExpression = 153, ->ArrayLiteralExpression : SyntaxKind - - ObjectLiteralExpression = 154, ->ObjectLiteralExpression : SyntaxKind - - PropertyAccessExpression = 155, ->PropertyAccessExpression : SyntaxKind - - ElementAccessExpression = 156, ->ElementAccessExpression : SyntaxKind - - CallExpression = 157, ->CallExpression : SyntaxKind - - NewExpression = 158, ->NewExpression : SyntaxKind - - TaggedTemplateExpression = 159, ->TaggedTemplateExpression : SyntaxKind - - TypeAssertionExpression = 160, ->TypeAssertionExpression : SyntaxKind - - ParenthesizedExpression = 161, ->ParenthesizedExpression : SyntaxKind - - FunctionExpression = 162, ->FunctionExpression : SyntaxKind - - ArrowFunction = 163, ->ArrowFunction : SyntaxKind - - DeleteExpression = 164, ->DeleteExpression : SyntaxKind - - TypeOfExpression = 165, ->TypeOfExpression : SyntaxKind - - VoidExpression = 166, ->VoidExpression : SyntaxKind - - PrefixUnaryExpression = 167, ->PrefixUnaryExpression : SyntaxKind - - PostfixUnaryExpression = 168, ->PostfixUnaryExpression : SyntaxKind - - BinaryExpression = 169, ->BinaryExpression : SyntaxKind - - ConditionalExpression = 170, ->ConditionalExpression : SyntaxKind - - TemplateExpression = 171, ->TemplateExpression : SyntaxKind - - YieldExpression = 172, ->YieldExpression : SyntaxKind - - SpreadElementExpression = 173, ->SpreadElementExpression : SyntaxKind - - OmittedExpression = 174, ->OmittedExpression : SyntaxKind - - TemplateSpan = 175, ->TemplateSpan : SyntaxKind - - Block = 176, ->Block : SyntaxKind - - VariableStatement = 177, ->VariableStatement : SyntaxKind - - EmptyStatement = 178, ->EmptyStatement : SyntaxKind - - ExpressionStatement = 179, ->ExpressionStatement : SyntaxKind - - IfStatement = 180, ->IfStatement : SyntaxKind - - DoStatement = 181, ->DoStatement : SyntaxKind - - WhileStatement = 182, ->WhileStatement : SyntaxKind - - ForStatement = 183, ->ForStatement : SyntaxKind - - ForInStatement = 184, ->ForInStatement : SyntaxKind - - ForOfStatement = 185, ->ForOfStatement : SyntaxKind - - ContinueStatement = 186, ->ContinueStatement : SyntaxKind - - BreakStatement = 187, ->BreakStatement : SyntaxKind - - ReturnStatement = 188, ->ReturnStatement : SyntaxKind - - WithStatement = 189, ->WithStatement : SyntaxKind - - SwitchStatement = 190, ->SwitchStatement : SyntaxKind - - LabeledStatement = 191, ->LabeledStatement : SyntaxKind - - ThrowStatement = 192, ->ThrowStatement : SyntaxKind - - TryStatement = 193, ->TryStatement : SyntaxKind - - DebuggerStatement = 194, ->DebuggerStatement : SyntaxKind - - VariableDeclaration = 195, ->VariableDeclaration : SyntaxKind - - VariableDeclarationList = 196, ->VariableDeclarationList : SyntaxKind - - FunctionDeclaration = 197, ->FunctionDeclaration : SyntaxKind - - ClassDeclaration = 198, ->ClassDeclaration : SyntaxKind - - InterfaceDeclaration = 199, ->InterfaceDeclaration : SyntaxKind - - TypeAliasDeclaration = 200, ->TypeAliasDeclaration : SyntaxKind - - EnumDeclaration = 201, ->EnumDeclaration : SyntaxKind - - ModuleDeclaration = 202, ->ModuleDeclaration : SyntaxKind - - ModuleBlock = 203, ->ModuleBlock : SyntaxKind - - CaseBlock = 204, ->CaseBlock : SyntaxKind - - ImportEqualsDeclaration = 205, ->ImportEqualsDeclaration : SyntaxKind - - ImportDeclaration = 206, ->ImportDeclaration : SyntaxKind - - ImportClause = 207, ->ImportClause : SyntaxKind - - NamespaceImport = 208, ->NamespaceImport : SyntaxKind - - NamedImports = 209, ->NamedImports : SyntaxKind - - ImportSpecifier = 210, ->ImportSpecifier : SyntaxKind - - ExportAssignment = 211, ->ExportAssignment : SyntaxKind - - ExportDeclaration = 212, ->ExportDeclaration : SyntaxKind - - NamedExports = 213, ->NamedExports : SyntaxKind - - ExportSpecifier = 214, ->ExportSpecifier : SyntaxKind - - MissingDeclaration = 215, ->MissingDeclaration : SyntaxKind - - ExternalModuleReference = 216, ->ExternalModuleReference : SyntaxKind - - CaseClause = 217, ->CaseClause : SyntaxKind - - DefaultClause = 218, ->DefaultClause : SyntaxKind - - HeritageClause = 219, ->HeritageClause : SyntaxKind - - CatchClause = 220, ->CatchClause : SyntaxKind - - PropertyAssignment = 221, ->PropertyAssignment : SyntaxKind - - ShorthandPropertyAssignment = 222, ->ShorthandPropertyAssignment : SyntaxKind - - EnumMember = 223, ->EnumMember : SyntaxKind - - SourceFile = 224, ->SourceFile : SyntaxKind - - SyntaxList = 225, ->SyntaxList : SyntaxKind - - Count = 226, ->Count : SyntaxKind - - FirstAssignment = 53, ->FirstAssignment : SyntaxKind - - LastAssignment = 64, ->LastAssignment : SyntaxKind - - FirstReservedWord = 66, ->FirstReservedWord : SyntaxKind - - LastReservedWord = 101, ->LastReservedWord : SyntaxKind - - FirstKeyword = 66, ->FirstKeyword : SyntaxKind - - LastKeyword = 125, ->LastKeyword : SyntaxKind - - FirstFutureReservedWord = 103, ->FirstFutureReservedWord : SyntaxKind - - LastFutureReservedWord = 111, ->LastFutureReservedWord : SyntaxKind - - FirstTypeNode = 141, ->FirstTypeNode : SyntaxKind - - LastTypeNode = 149, ->LastTypeNode : SyntaxKind - - FirstPunctuation = 14, ->FirstPunctuation : SyntaxKind - - LastPunctuation = 64, ->LastPunctuation : SyntaxKind - - FirstToken = 0, ->FirstToken : SyntaxKind - - LastToken = 125, ->LastToken : SyntaxKind - - FirstTriviaToken = 2, ->FirstTriviaToken : SyntaxKind - - LastTriviaToken = 6, ->LastTriviaToken : SyntaxKind - - FirstLiteralToken = 7, ->FirstLiteralToken : SyntaxKind - - LastLiteralToken = 10, ->LastLiteralToken : SyntaxKind - - FirstTemplateToken = 10, ->FirstTemplateToken : SyntaxKind - - LastTemplateToken = 13, ->LastTemplateToken : SyntaxKind - - FirstBinaryOperator = 24, ->FirstBinaryOperator : SyntaxKind - - LastBinaryOperator = 64, ->LastBinaryOperator : SyntaxKind - - FirstNode = 126, ->FirstNode : SyntaxKind - } - const enum NodeFlags { ->NodeFlags : NodeFlags - - Export = 1, ->Export : NodeFlags - - Ambient = 2, ->Ambient : NodeFlags - - Public = 16, ->Public : NodeFlags - - Private = 32, ->Private : NodeFlags - - Protected = 64, ->Protected : NodeFlags - - Static = 128, ->Static : NodeFlags - - Default = 256, ->Default : NodeFlags - - MultiLine = 512, ->MultiLine : NodeFlags - - Synthetic = 1024, ->Synthetic : NodeFlags - - DeclarationFile = 2048, ->DeclarationFile : NodeFlags - - Let = 4096, ->Let : NodeFlags - - Const = 8192, ->Const : NodeFlags - - OctalLiteral = 16384, ->OctalLiteral : NodeFlags - - ExportContext = 32768, ->ExportContext : NodeFlags - - Modifier = 499, ->Modifier : NodeFlags - - AccessibilityModifier = 112, ->AccessibilityModifier : NodeFlags - - BlockScoped = 12288, ->BlockScoped : NodeFlags - } - const enum ParserContextFlags { ->ParserContextFlags : ParserContextFlags - - StrictMode = 1, ->StrictMode : ParserContextFlags - - DisallowIn = 2, ->DisallowIn : ParserContextFlags - - Yield = 4, ->Yield : ParserContextFlags - - GeneratorParameter = 8, ->GeneratorParameter : ParserContextFlags - - Decorator = 16, ->Decorator : ParserContextFlags - - ThisNodeHasError = 32, ->ThisNodeHasError : ParserContextFlags - - ParserGeneratedFlags = 63, ->ParserGeneratedFlags : ParserContextFlags - - ThisNodeOrAnySubNodesHasError = 64, ->ThisNodeOrAnySubNodesHasError : ParserContextFlags - - HasAggregatedChildData = 128, ->HasAggregatedChildData : ParserContextFlags - } - const enum RelationComparisonResult { ->RelationComparisonResult : RelationComparisonResult - - Succeeded = 1, ->Succeeded : RelationComparisonResult - - Failed = 2, ->Failed : RelationComparisonResult - - FailedAndReported = 3, ->FailedAndReported : RelationComparisonResult - } - interface Node extends TextRange { ->Node : Node ->TextRange : TextRange - - kind: SyntaxKind; ->kind : SyntaxKind ->SyntaxKind : SyntaxKind - - flags: NodeFlags; ->flags : NodeFlags ->NodeFlags : NodeFlags - - parserContextFlags?: ParserContextFlags; ->parserContextFlags : ParserContextFlags ->ParserContextFlags : ParserContextFlags - - decorators?: NodeArray; ->decorators : NodeArray ->NodeArray : NodeArray ->Decorator : Decorator - - modifiers?: ModifiersArray; ->modifiers : ModifiersArray ->ModifiersArray : ModifiersArray - - id?: number; ->id : number - - parent?: Node; ->parent : Node ->Node : Node - - symbol?: Symbol; ->symbol : Symbol ->Symbol : Symbol - - locals?: SymbolTable; ->locals : SymbolTable ->SymbolTable : SymbolTable - - nextContainer?: Node; ->nextContainer : Node ->Node : Node - - localSymbol?: Symbol; ->localSymbol : Symbol ->Symbol : Symbol - } - interface NodeArray extends Array, TextRange { ->NodeArray : NodeArray ->T : T ->Array : T[] ->T : T ->TextRange : TextRange - - hasTrailingComma?: boolean; ->hasTrailingComma : boolean - } - interface ModifiersArray extends NodeArray { ->ModifiersArray : ModifiersArray ->NodeArray : NodeArray ->Node : Node - - flags: number; ->flags : number - } - interface Identifier extends PrimaryExpression { ->Identifier : Identifier ->PrimaryExpression : PrimaryExpression - - text: string; ->text : string - } - interface QualifiedName extends Node { ->QualifiedName : QualifiedName ->Node : Node - - left: EntityName; ->left : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName - - right: Identifier; ->right : Identifier ->Identifier : Identifier - } - type EntityName = Identifier | QualifiedName; ->EntityName : Identifier | QualifiedName ->Identifier : Identifier ->QualifiedName : QualifiedName - - type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName | BindingPattern; ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->Identifier : Identifier ->LiteralExpression : LiteralExpression ->ComputedPropertyName : ComputedPropertyName ->BindingPattern : BindingPattern - - interface Declaration extends Node { ->Declaration : Declaration ->Node : Node - - _declarationBrand: any; ->_declarationBrand : any - - name?: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - } - interface ComputedPropertyName extends Node { ->ComputedPropertyName : ComputedPropertyName ->Node : Node - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface Decorator extends Node { ->Decorator : Decorator ->Node : Node - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - } - interface TypeParameterDeclaration extends Declaration { ->TypeParameterDeclaration : TypeParameterDeclaration ->Declaration : Declaration - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - constraint?: TypeNode; ->constraint : TypeNode ->TypeNode : TypeNode - - expression?: Expression; ->expression : Expression ->Expression : Expression - } - interface SignatureDeclaration extends Declaration { ->SignatureDeclaration : SignatureDeclaration ->Declaration : Declaration - - typeParameters?: NodeArray; ->typeParameters : NodeArray ->NodeArray : NodeArray ->TypeParameterDeclaration : TypeParameterDeclaration - - parameters: NodeArray; ->parameters : NodeArray ->NodeArray : NodeArray ->ParameterDeclaration : ParameterDeclaration - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface VariableDeclaration extends Declaration { ->VariableDeclaration : VariableDeclaration ->Declaration : Declaration - - parent?: VariableDeclarationList; ->parent : VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList - - name: Identifier | BindingPattern; ->name : Identifier | BindingPattern ->Identifier : Identifier ->BindingPattern : BindingPattern - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface VariableDeclarationList extends Node { ->VariableDeclarationList : VariableDeclarationList ->Node : Node - - declarations: NodeArray; ->declarations : NodeArray ->NodeArray : NodeArray ->VariableDeclaration : VariableDeclaration - } - interface ParameterDeclaration extends Declaration { ->ParameterDeclaration : ParameterDeclaration ->Declaration : Declaration - - dotDotDotToken?: Node; ->dotDotDotToken : Node ->Node : Node - - name: Identifier | BindingPattern; ->name : Identifier | BindingPattern ->Identifier : Identifier ->BindingPattern : BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface BindingElement extends Declaration { ->BindingElement : BindingElement ->Declaration : Declaration - - propertyName?: Identifier; ->propertyName : Identifier ->Identifier : Identifier - - dotDotDotToken?: Node; ->dotDotDotToken : Node ->Node : Node - - name: Identifier | BindingPattern; ->name : Identifier | BindingPattern ->Identifier : Identifier ->BindingPattern : BindingPattern - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface PropertyDeclaration extends Declaration, ClassElement { ->PropertyDeclaration : PropertyDeclaration ->Declaration : Declaration ->ClassElement : ClassElement - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface ObjectLiteralElement extends Declaration { ->ObjectLiteralElement : ObjectLiteralElement ->Declaration : Declaration - - _objectLiteralBrandBrand: any; ->_objectLiteralBrandBrand : any - } - interface PropertyAssignment extends ObjectLiteralElement { ->PropertyAssignment : PropertyAssignment ->ObjectLiteralElement : ObjectLiteralElement - - _propertyAssignmentBrand: any; ->_propertyAssignmentBrand : any - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - initializer: Expression; ->initializer : Expression ->Expression : Expression - } - interface ShorthandPropertyAssignment extends ObjectLiteralElement { ->ShorthandPropertyAssignment : ShorthandPropertyAssignment ->ObjectLiteralElement : ObjectLiteralElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - questionToken?: Node; ->questionToken : Node ->Node : Node - } - interface VariableLikeDeclaration extends Declaration { ->VariableLikeDeclaration : VariableLikeDeclaration ->Declaration : Declaration - - propertyName?: Identifier; ->propertyName : Identifier ->Identifier : Identifier - - dotDotDotToken?: Node; ->dotDotDotToken : Node ->Node : Node - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface BindingPattern extends Node { ->BindingPattern : BindingPattern ->Node : Node - - elements: NodeArray; ->elements : NodeArray ->NodeArray : NodeArray ->BindingElement : BindingElement - } - /** - * Several node kinds share function-like features such as a signature, - * a name, and a body. These nodes should extend FunctionLikeDeclaration. - * Examples: - * FunctionDeclaration - * MethodDeclaration - * AccessorDeclaration - */ - interface FunctionLikeDeclaration extends SignatureDeclaration { ->FunctionLikeDeclaration : FunctionLikeDeclaration ->SignatureDeclaration : SignatureDeclaration - - _functionLikeDeclarationBrand: any; ->_functionLikeDeclarationBrand : any - - asteriskToken?: Node; ->asteriskToken : Node ->Node : Node - - questionToken?: Node; ->questionToken : Node ->Node : Node - - body?: Block | Expression; ->body : Expression | Block ->Block : Block ->Expression : Expression - } - interface FunctionDeclaration extends FunctionLikeDeclaration, Statement { ->FunctionDeclaration : FunctionDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->Statement : Statement - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - body?: Block; ->body : Block ->Block : Block - } - interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { ->MethodDeclaration : MethodDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->ClassElement : ClassElement ->ObjectLiteralElement : ObjectLiteralElement - - body?: Block; ->body : Block ->Block : Block - } - interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { ->ConstructorDeclaration : ConstructorDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->ClassElement : ClassElement - - body?: Block; ->body : Block ->Block : Block - } - interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { ->AccessorDeclaration : AccessorDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->ClassElement : ClassElement ->ObjectLiteralElement : ObjectLiteralElement - - _accessorDeclarationBrand: any; ->_accessorDeclarationBrand : any - - body: Block; ->body : Block ->Block : Block - } - interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement { ->IndexSignatureDeclaration : IndexSignatureDeclaration ->SignatureDeclaration : SignatureDeclaration ->ClassElement : ClassElement - - _indexSignatureDeclarationBrand: any; ->_indexSignatureDeclarationBrand : any - } - interface TypeNode extends Node { ->TypeNode : TypeNode ->Node : Node - - _typeNodeBrand: any; ->_typeNodeBrand : any - } - interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration { ->FunctionOrConstructorTypeNode : FunctionOrConstructorTypeNode ->TypeNode : TypeNode ->SignatureDeclaration : SignatureDeclaration - - _functionOrConstructorTypeNodeBrand: any; ->_functionOrConstructorTypeNodeBrand : any - } - interface TypeReferenceNode extends TypeNode { ->TypeReferenceNode : TypeReferenceNode ->TypeNode : TypeNode - - typeName: EntityName; ->typeName : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName - - typeArguments?: NodeArray; ->typeArguments : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface TypeQueryNode extends TypeNode { ->TypeQueryNode : TypeQueryNode ->TypeNode : TypeNode - - exprName: EntityName; ->exprName : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName - } - interface TypeLiteralNode extends TypeNode, Declaration { ->TypeLiteralNode : TypeLiteralNode ->TypeNode : TypeNode ->Declaration : Declaration - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->Node : Node - } - interface ArrayTypeNode extends TypeNode { ->ArrayTypeNode : ArrayTypeNode ->TypeNode : TypeNode - - elementType: TypeNode; ->elementType : TypeNode ->TypeNode : TypeNode - } - interface TupleTypeNode extends TypeNode { ->TupleTypeNode : TupleTypeNode ->TypeNode : TypeNode - - elementTypes: NodeArray; ->elementTypes : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface UnionTypeNode extends TypeNode { ->UnionTypeNode : UnionTypeNode ->TypeNode : TypeNode - - types: NodeArray; ->types : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface ParenthesizedTypeNode extends TypeNode { ->ParenthesizedTypeNode : ParenthesizedTypeNode ->TypeNode : TypeNode - - type: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface StringLiteralTypeNode extends LiteralExpression, TypeNode { ->StringLiteralTypeNode : StringLiteralTypeNode ->LiteralExpression : LiteralExpression ->TypeNode : TypeNode - } - interface Expression extends Node { ->Expression : Expression ->Node : Node - - _expressionBrand: any; ->_expressionBrand : any - - contextualType?: Type; ->contextualType : Type ->Type : Type - } - interface UnaryExpression extends Expression { ->UnaryExpression : UnaryExpression ->Expression : Expression - - _unaryExpressionBrand: any; ->_unaryExpressionBrand : any - } - interface PrefixUnaryExpression extends UnaryExpression { ->PrefixUnaryExpression : PrefixUnaryExpression ->UnaryExpression : UnaryExpression - - operator: SyntaxKind; ->operator : SyntaxKind ->SyntaxKind : SyntaxKind - - operand: UnaryExpression; ->operand : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface PostfixUnaryExpression extends PostfixExpression { ->PostfixUnaryExpression : PostfixUnaryExpression ->PostfixExpression : PostfixExpression - - operand: LeftHandSideExpression; ->operand : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - operator: SyntaxKind; ->operator : SyntaxKind ->SyntaxKind : SyntaxKind - } - interface PostfixExpression extends UnaryExpression { ->PostfixExpression : PostfixExpression ->UnaryExpression : UnaryExpression - - _postfixExpressionBrand: any; ->_postfixExpressionBrand : any - } - interface LeftHandSideExpression extends PostfixExpression { ->LeftHandSideExpression : LeftHandSideExpression ->PostfixExpression : PostfixExpression - - _leftHandSideExpressionBrand: any; ->_leftHandSideExpressionBrand : any - } - interface MemberExpression extends LeftHandSideExpression { ->MemberExpression : MemberExpression ->LeftHandSideExpression : LeftHandSideExpression - - _memberExpressionBrand: any; ->_memberExpressionBrand : any - } - interface PrimaryExpression extends MemberExpression { ->PrimaryExpression : PrimaryExpression ->MemberExpression : MemberExpression - - _primaryExpressionBrand: any; ->_primaryExpressionBrand : any - } - interface DeleteExpression extends UnaryExpression { ->DeleteExpression : DeleteExpression ->UnaryExpression : UnaryExpression - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface TypeOfExpression extends UnaryExpression { ->TypeOfExpression : TypeOfExpression ->UnaryExpression : UnaryExpression - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface VoidExpression extends UnaryExpression { ->VoidExpression : VoidExpression ->UnaryExpression : UnaryExpression - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface YieldExpression extends Expression { ->YieldExpression : YieldExpression ->Expression : Expression - - asteriskToken?: Node; ->asteriskToken : Node ->Node : Node - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface BinaryExpression extends Expression { ->BinaryExpression : BinaryExpression ->Expression : Expression - - left: Expression; ->left : Expression ->Expression : Expression - - operatorToken: Node; ->operatorToken : Node ->Node : Node - - right: Expression; ->right : Expression ->Expression : Expression - } - interface ConditionalExpression extends Expression { ->ConditionalExpression : ConditionalExpression ->Expression : Expression - - condition: Expression; ->condition : Expression ->Expression : Expression - - questionToken: Node; ->questionToken : Node ->Node : Node - - whenTrue: Expression; ->whenTrue : Expression ->Expression : Expression - - colonToken: Node; ->colonToken : Node ->Node : Node - - whenFalse: Expression; ->whenFalse : Expression ->Expression : Expression - } - interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration { ->FunctionExpression : FunctionExpression ->PrimaryExpression : PrimaryExpression ->FunctionLikeDeclaration : FunctionLikeDeclaration - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - body: Block | Expression; ->body : Expression | Block ->Block : Block ->Expression : Expression - } - interface ArrowFunction extends Expression, FunctionLikeDeclaration { ->ArrowFunction : ArrowFunction ->Expression : Expression ->FunctionLikeDeclaration : FunctionLikeDeclaration - - equalsGreaterThanToken: Node; ->equalsGreaterThanToken : Node ->Node : Node - } - interface LiteralExpression extends PrimaryExpression { ->LiteralExpression : LiteralExpression ->PrimaryExpression : PrimaryExpression - - text: string; ->text : string - - isUnterminated?: boolean; ->isUnterminated : boolean - - hasExtendedUnicodeEscape?: boolean; ->hasExtendedUnicodeEscape : boolean - } - interface StringLiteralExpression extends LiteralExpression { ->StringLiteralExpression : StringLiteralExpression ->LiteralExpression : LiteralExpression - - _stringLiteralExpressionBrand: any; ->_stringLiteralExpressionBrand : any - } - interface TemplateExpression extends PrimaryExpression { ->TemplateExpression : TemplateExpression ->PrimaryExpression : PrimaryExpression - - head: LiteralExpression; ->head : LiteralExpression ->LiteralExpression : LiteralExpression - - templateSpans: NodeArray; ->templateSpans : NodeArray ->NodeArray : NodeArray ->TemplateSpan : TemplateSpan - } - interface TemplateSpan extends Node { ->TemplateSpan : TemplateSpan ->Node : Node - - expression: Expression; ->expression : Expression ->Expression : Expression - - literal: LiteralExpression; ->literal : LiteralExpression ->LiteralExpression : LiteralExpression - } - interface ParenthesizedExpression extends PrimaryExpression { ->ParenthesizedExpression : ParenthesizedExpression ->PrimaryExpression : PrimaryExpression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ArrayLiteralExpression extends PrimaryExpression { ->ArrayLiteralExpression : ArrayLiteralExpression ->PrimaryExpression : PrimaryExpression - - elements: NodeArray; ->elements : NodeArray ->NodeArray : NodeArray ->Expression : Expression - } - interface SpreadElementExpression extends Expression { ->SpreadElementExpression : SpreadElementExpression ->Expression : Expression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ObjectLiteralExpression extends PrimaryExpression, Declaration { ->ObjectLiteralExpression : ObjectLiteralExpression ->PrimaryExpression : PrimaryExpression ->Declaration : Declaration - - properties: NodeArray; ->properties : NodeArray ->NodeArray : NodeArray ->ObjectLiteralElement : ObjectLiteralElement - } - interface PropertyAccessExpression extends MemberExpression { ->PropertyAccessExpression : PropertyAccessExpression ->MemberExpression : MemberExpression - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - dotToken: Node; ->dotToken : Node ->Node : Node - - name: Identifier; ->name : Identifier ->Identifier : Identifier - } - interface ElementAccessExpression extends MemberExpression { ->ElementAccessExpression : ElementAccessExpression ->MemberExpression : MemberExpression - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - argumentExpression?: Expression; ->argumentExpression : Expression ->Expression : Expression - } - interface CallExpression extends LeftHandSideExpression { ->CallExpression : CallExpression ->LeftHandSideExpression : LeftHandSideExpression - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - typeArguments?: NodeArray; ->typeArguments : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - - arguments: NodeArray; ->arguments : NodeArray ->NodeArray : NodeArray ->Expression : Expression - } - interface NewExpression extends CallExpression, PrimaryExpression { ->NewExpression : NewExpression ->CallExpression : CallExpression ->PrimaryExpression : PrimaryExpression - } - interface TaggedTemplateExpression extends MemberExpression { ->TaggedTemplateExpression : TaggedTemplateExpression ->MemberExpression : MemberExpression - - tag: LeftHandSideExpression; ->tag : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - template: LiteralExpression | TemplateExpression; ->template : LiteralExpression | TemplateExpression ->LiteralExpression : LiteralExpression ->TemplateExpression : TemplateExpression - } - type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression; ->CallLikeExpression : CallExpression | NewExpression | TaggedTemplateExpression ->CallExpression : CallExpression ->NewExpression : NewExpression ->TaggedTemplateExpression : TaggedTemplateExpression - - interface TypeAssertion extends UnaryExpression { ->TypeAssertion : TypeAssertion ->UnaryExpression : UnaryExpression - - type: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface Statement extends Node, ModuleElement { ->Statement : Statement ->Node : Node ->ModuleElement : ModuleElement - - _statementBrand: any; ->_statementBrand : any - } - interface Block extends Statement { ->Block : Block ->Statement : Statement - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->Statement : Statement - } - interface VariableStatement extends Statement { ->VariableStatement : VariableStatement ->Statement : Statement - - declarationList: VariableDeclarationList; ->declarationList : VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList - } - interface ExpressionStatement extends Statement { ->ExpressionStatement : ExpressionStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface IfStatement extends Statement { ->IfStatement : IfStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - - thenStatement: Statement; ->thenStatement : Statement ->Statement : Statement - - elseStatement?: Statement; ->elseStatement : Statement ->Statement : Statement - } - interface IterationStatement extends Statement { ->IterationStatement : IterationStatement ->Statement : Statement - - statement: Statement; ->statement : Statement ->Statement : Statement - } - interface DoStatement extends IterationStatement { ->DoStatement : DoStatement ->IterationStatement : IterationStatement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface WhileStatement extends IterationStatement { ->WhileStatement : WhileStatement ->IterationStatement : IterationStatement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ForStatement extends IterationStatement { ->ForStatement : ForStatement ->IterationStatement : IterationStatement - - initializer?: VariableDeclarationList | Expression; ->initializer : Expression | VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList ->Expression : Expression - - condition?: Expression; ->condition : Expression ->Expression : Expression - - iterator?: Expression; ->iterator : Expression ->Expression : Expression - } - interface ForInStatement extends IterationStatement { ->ForInStatement : ForInStatement ->IterationStatement : IterationStatement - - initializer: VariableDeclarationList | Expression; ->initializer : Expression | VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList ->Expression : Expression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ForOfStatement extends IterationStatement { ->ForOfStatement : ForOfStatement ->IterationStatement : IterationStatement - - initializer: VariableDeclarationList | Expression; ->initializer : Expression | VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList ->Expression : Expression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface BreakOrContinueStatement extends Statement { ->BreakOrContinueStatement : BreakOrContinueStatement ->Statement : Statement - - label?: Identifier; ->label : Identifier ->Identifier : Identifier - } - interface ReturnStatement extends Statement { ->ReturnStatement : ReturnStatement ->Statement : Statement - - expression?: Expression; ->expression : Expression ->Expression : Expression - } - interface WithStatement extends Statement { ->WithStatement : WithStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - - statement: Statement; ->statement : Statement ->Statement : Statement - } - interface SwitchStatement extends Statement { ->SwitchStatement : SwitchStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - - caseBlock: CaseBlock; ->caseBlock : CaseBlock ->CaseBlock : CaseBlock - } - interface CaseBlock extends Node { ->CaseBlock : CaseBlock ->Node : Node - - clauses: NodeArray; ->clauses : NodeArray ->NodeArray : NodeArray ->CaseOrDefaultClause : CaseClause | DefaultClause - } - interface CaseClause extends Node { ->CaseClause : CaseClause ->Node : Node - - expression?: Expression; ->expression : Expression ->Expression : Expression - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->Statement : Statement - } - interface DefaultClause extends Node { ->DefaultClause : DefaultClause ->Node : Node - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->Statement : Statement - } - type CaseOrDefaultClause = CaseClause | DefaultClause; ->CaseOrDefaultClause : CaseClause | DefaultClause ->CaseClause : CaseClause ->DefaultClause : DefaultClause - - interface LabeledStatement extends Statement { ->LabeledStatement : LabeledStatement ->Statement : Statement - - label: Identifier; ->label : Identifier ->Identifier : Identifier - - statement: Statement; ->statement : Statement ->Statement : Statement - } - interface ThrowStatement extends Statement { ->ThrowStatement : ThrowStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface TryStatement extends Statement { ->TryStatement : TryStatement ->Statement : Statement - - tryBlock: Block; ->tryBlock : Block ->Block : Block - - catchClause?: CatchClause; ->catchClause : CatchClause ->CatchClause : CatchClause - - finallyBlock?: Block; ->finallyBlock : Block ->Block : Block - } - interface CatchClause extends Node { ->CatchClause : CatchClause ->Node : Node - - variableDeclaration: VariableDeclaration; ->variableDeclaration : VariableDeclaration ->VariableDeclaration : VariableDeclaration - - block: Block; ->block : Block ->Block : Block - } - interface ModuleElement extends Node { ->ModuleElement : ModuleElement ->Node : Node - - _moduleElementBrand: any; ->_moduleElementBrand : any - } - interface ClassDeclaration extends Declaration, ModuleElement { ->ClassDeclaration : ClassDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - typeParameters?: NodeArray; ->typeParameters : NodeArray ->NodeArray : NodeArray ->TypeParameterDeclaration : TypeParameterDeclaration - - heritageClauses?: NodeArray; ->heritageClauses : NodeArray ->NodeArray : NodeArray ->HeritageClause : HeritageClause - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->ClassElement : ClassElement - } - interface ClassElement extends Declaration { ->ClassElement : ClassElement ->Declaration : Declaration - - _classElementBrand: any; ->_classElementBrand : any - } - interface InterfaceDeclaration extends Declaration, ModuleElement { ->InterfaceDeclaration : InterfaceDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - typeParameters?: NodeArray; ->typeParameters : NodeArray ->NodeArray : NodeArray ->TypeParameterDeclaration : TypeParameterDeclaration - - heritageClauses?: NodeArray; ->heritageClauses : NodeArray ->NodeArray : NodeArray ->HeritageClause : HeritageClause - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->Declaration : Declaration - } - interface HeritageClause extends Node { ->HeritageClause : HeritageClause ->Node : Node - - token: SyntaxKind; ->token : SyntaxKind ->SyntaxKind : SyntaxKind - - types?: NodeArray; ->types : NodeArray ->NodeArray : NodeArray ->TypeReferenceNode : TypeReferenceNode - } - interface TypeAliasDeclaration extends Declaration, ModuleElement { ->TypeAliasDeclaration : TypeAliasDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - type: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface EnumMember extends Declaration { ->EnumMember : EnumMember ->Declaration : Declaration - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface EnumDeclaration extends Declaration, ModuleElement { ->EnumDeclaration : EnumDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->EnumMember : EnumMember - } - interface ModuleDeclaration extends Declaration, ModuleElement { ->ModuleDeclaration : ModuleDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier | LiteralExpression; ->name : Identifier | LiteralExpression ->Identifier : Identifier ->LiteralExpression : LiteralExpression - - body: ModuleBlock | ModuleDeclaration; ->body : ModuleDeclaration | ModuleBlock ->ModuleBlock : ModuleBlock ->ModuleDeclaration : ModuleDeclaration - } - interface ModuleBlock extends Node, ModuleElement { ->ModuleBlock : ModuleBlock ->Node : Node ->ModuleElement : ModuleElement - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->ModuleElement : ModuleElement - } - interface ImportEqualsDeclaration extends Declaration, ModuleElement { ->ImportEqualsDeclaration : ImportEqualsDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - moduleReference: EntityName | ExternalModuleReference; ->moduleReference : Identifier | QualifiedName | ExternalModuleReference ->EntityName : Identifier | QualifiedName ->ExternalModuleReference : ExternalModuleReference - } - interface ExternalModuleReference extends Node { ->ExternalModuleReference : ExternalModuleReference ->Node : Node - - expression?: Expression; ->expression : Expression ->Expression : Expression - } - interface ImportDeclaration extends Statement, ModuleElement { ->ImportDeclaration : ImportDeclaration ->Statement : Statement ->ModuleElement : ModuleElement - - importClause?: ImportClause; ->importClause : ImportClause ->ImportClause : ImportClause - - moduleSpecifier: Expression; ->moduleSpecifier : Expression ->Expression : Expression - } - interface ImportClause extends Declaration { ->ImportClause : ImportClause ->Declaration : Declaration - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - namedBindings?: NamespaceImport | NamedImports; ->namedBindings : NamespaceImport | NamedImportsOrExports ->NamespaceImport : NamespaceImport ->NamedImports : NamedImportsOrExports - } - interface NamespaceImport extends Declaration { ->NamespaceImport : NamespaceImport ->Declaration : Declaration - - name: Identifier; ->name : Identifier ->Identifier : Identifier - } - interface ExportDeclaration extends Declaration, ModuleElement { ->ExportDeclaration : ExportDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - exportClause?: NamedExports; ->exportClause : NamedImportsOrExports ->NamedExports : NamedImportsOrExports - - moduleSpecifier?: Expression; ->moduleSpecifier : Expression ->Expression : Expression - } - interface NamedImportsOrExports extends Node { ->NamedImportsOrExports : NamedImportsOrExports ->Node : Node - - elements: NodeArray; ->elements : NodeArray ->NodeArray : NodeArray ->ImportOrExportSpecifier : ImportOrExportSpecifier - } - type NamedImports = NamedImportsOrExports; ->NamedImports : NamedImportsOrExports ->NamedImportsOrExports : NamedImportsOrExports - - type NamedExports = NamedImportsOrExports; ->NamedExports : NamedImportsOrExports ->NamedImportsOrExports : NamedImportsOrExports - - interface ImportOrExportSpecifier extends Declaration { ->ImportOrExportSpecifier : ImportOrExportSpecifier ->Declaration : Declaration - - propertyName?: Identifier; ->propertyName : Identifier ->Identifier : Identifier - - name: Identifier; ->name : Identifier ->Identifier : Identifier - } - type ImportSpecifier = ImportOrExportSpecifier; ->ImportSpecifier : ImportOrExportSpecifier ->ImportOrExportSpecifier : ImportOrExportSpecifier - - type ExportSpecifier = ImportOrExportSpecifier; ->ExportSpecifier : ImportOrExportSpecifier ->ImportOrExportSpecifier : ImportOrExportSpecifier - - interface ExportAssignment extends Declaration, ModuleElement { ->ExportAssignment : ExportAssignment ->Declaration : Declaration ->ModuleElement : ModuleElement - - isExportEquals?: boolean; ->isExportEquals : boolean - - expression?: Expression; ->expression : Expression ->Expression : Expression - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface FileReference extends TextRange { ->FileReference : FileReference ->TextRange : TextRange - - fileName: string; ->fileName : string - } - interface CommentRange extends TextRange { ->CommentRange : CommentRange ->TextRange : TextRange - - hasTrailingNewLine?: boolean; ->hasTrailingNewLine : boolean - } - interface SourceFile extends Declaration { ->SourceFile : SourceFile ->Declaration : Declaration - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->ModuleElement : ModuleElement - - endOfFileToken: Node; ->endOfFileToken : Node ->Node : Node - - fileName: string; ->fileName : string - - text: string; ->text : string - - amdDependencies: { ->amdDependencies : { path: string; name: string; }[] - - path: string; ->path : string - - name: string; ->name : string - - }[]; - amdModuleName: string; ->amdModuleName : string - - referencedFiles: FileReference[]; ->referencedFiles : FileReference[] ->FileReference : FileReference - - hasNoDefaultLib: boolean; ->hasNoDefaultLib : boolean - - externalModuleIndicator: Node; ->externalModuleIndicator : Node ->Node : Node - - languageVersion: ScriptTarget; ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget - - identifiers: Map; ->identifiers : Map ->Map : Map - } - interface ScriptReferenceHost { ->ScriptReferenceHost : ScriptReferenceHost - - getCompilerOptions(): CompilerOptions; ->getCompilerOptions : () => CompilerOptions ->CompilerOptions : CompilerOptions - - getSourceFile(fileName: string): SourceFile; ->getSourceFile : (fileName: string) => SourceFile ->fileName : string ->SourceFile : SourceFile - - getCurrentDirectory(): string; ->getCurrentDirectory : () => string - } - interface WriteFileCallback { ->WriteFileCallback : WriteFileCallback - - (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; ->fileName : string ->data : string ->writeByteOrderMark : boolean ->onError : (message: string) => void ->message : string - } - interface Program extends ScriptReferenceHost { ->Program : Program ->ScriptReferenceHost : ScriptReferenceHost - - getSourceFiles(): SourceFile[]; ->getSourceFiles : () => SourceFile[] ->SourceFile : SourceFile - - /** - * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then - * the JavaScript and declaration files will be produced for all the files in this program. - * If targetSourceFile is specified, then only the JavaScript and declaration for that - * specific file will be generated. - * - * If writeFile is not specified then the writeFile callback from the compiler host will be - * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter - * will be invoked when writing the JavaScript and declaration files. - */ - emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback): EmitResult; ->emit : (targetSourceFile?: SourceFile, writeFile?: WriteFileCallback) => EmitResult ->targetSourceFile : SourceFile ->SourceFile : SourceFile ->writeFile : WriteFileCallback ->WriteFileCallback : WriteFileCallback ->EmitResult : EmitResult - - getSyntacticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; ->getSyntacticDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Diagnostic : Diagnostic - - getGlobalDiagnostics(): Diagnostic[]; ->getGlobalDiagnostics : () => Diagnostic[] ->Diagnostic : Diagnostic - - getSemanticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; ->getSemanticDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Diagnostic : Diagnostic - - getDeclarationDiagnostics(sourceFile?: SourceFile): Diagnostic[]; ->getDeclarationDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Diagnostic : Diagnostic - - getTypeChecker(): TypeChecker; ->getTypeChecker : () => TypeChecker ->TypeChecker : TypeChecker - - getCommonSourceDirectory(): string; ->getCommonSourceDirectory : () => string - } - interface SourceMapSpan { ->SourceMapSpan : SourceMapSpan - - emittedLine: number; ->emittedLine : number - - emittedColumn: number; ->emittedColumn : number - - sourceLine: number; ->sourceLine : number - - sourceColumn: number; ->sourceColumn : number - - nameIndex?: number; ->nameIndex : number - - sourceIndex: number; ->sourceIndex : number - } - interface SourceMapData { ->SourceMapData : SourceMapData - - sourceMapFilePath: string; ->sourceMapFilePath : string - - jsSourceMappingURL: string; ->jsSourceMappingURL : string - - sourceMapFile: string; ->sourceMapFile : string - - sourceMapSourceRoot: string; ->sourceMapSourceRoot : string - - sourceMapSources: string[]; ->sourceMapSources : string[] - - inputSourceFileNames: string[]; ->inputSourceFileNames : string[] - - sourceMapNames?: string[]; ->sourceMapNames : string[] - - sourceMapMappings: string; ->sourceMapMappings : string - - sourceMapDecodedMappings: SourceMapSpan[]; ->sourceMapDecodedMappings : SourceMapSpan[] ->SourceMapSpan : SourceMapSpan - } - enum ExitStatus { ->ExitStatus : ExitStatus - - Success = 0, ->Success : ExitStatus - - DiagnosticsPresent_OutputsSkipped = 1, ->DiagnosticsPresent_OutputsSkipped : ExitStatus - - DiagnosticsPresent_OutputsGenerated = 2, ->DiagnosticsPresent_OutputsGenerated : ExitStatus - } - interface EmitResult { ->EmitResult : EmitResult - - emitSkipped: boolean; ->emitSkipped : boolean - - diagnostics: Diagnostic[]; ->diagnostics : Diagnostic[] ->Diagnostic : Diagnostic - - sourceMaps: SourceMapData[]; ->sourceMaps : SourceMapData[] ->SourceMapData : SourceMapData - } - interface TypeCheckerHost { ->TypeCheckerHost : TypeCheckerHost - - getCompilerOptions(): CompilerOptions; ->getCompilerOptions : () => CompilerOptions ->CompilerOptions : CompilerOptions - - getSourceFiles(): SourceFile[]; ->getSourceFiles : () => SourceFile[] ->SourceFile : SourceFile - - getSourceFile(fileName: string): SourceFile; ->getSourceFile : (fileName: string) => SourceFile ->fileName : string ->SourceFile : SourceFile - } - interface TypeChecker { ->TypeChecker : TypeChecker - - getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; ->getTypeOfSymbolAtLocation : (symbol: Symbol, node: Node) => Type ->symbol : Symbol ->Symbol : Symbol ->node : Node ->Node : Node ->Type : Type - - getDeclaredTypeOfSymbol(symbol: Symbol): Type; ->getDeclaredTypeOfSymbol : (symbol: Symbol) => Type ->symbol : Symbol ->Symbol : Symbol ->Type : Type - - getPropertiesOfType(type: Type): Symbol[]; ->getPropertiesOfType : (type: Type) => Symbol[] ->type : Type ->Type : Type ->Symbol : Symbol - - getPropertyOfType(type: Type, propertyName: string): Symbol; ->getPropertyOfType : (type: Type, propertyName: string) => Symbol ->type : Type ->Type : Type ->propertyName : string ->Symbol : Symbol - - getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; ->getSignaturesOfType : (type: Type, kind: SignatureKind) => Signature[] ->type : Type ->Type : Type ->kind : SignatureKind ->SignatureKind : SignatureKind ->Signature : Signature - - getIndexTypeOfType(type: Type, kind: IndexKind): Type; ->getIndexTypeOfType : (type: Type, kind: IndexKind) => Type ->type : Type ->Type : Type ->kind : IndexKind ->IndexKind : IndexKind ->Type : Type - - getReturnTypeOfSignature(signature: Signature): Type; ->getReturnTypeOfSignature : (signature: Signature) => Type ->signature : Signature ->Signature : Signature ->Type : Type - - getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; ->getSymbolsInScope : (location: Node, meaning: SymbolFlags) => Symbol[] ->location : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags ->Symbol : Symbol - - getSymbolAtLocation(node: Node): Symbol; ->getSymbolAtLocation : (node: Node) => Symbol ->node : Node ->Node : Node ->Symbol : Symbol - - getShorthandAssignmentValueSymbol(location: Node): Symbol; ->getShorthandAssignmentValueSymbol : (location: Node) => Symbol ->location : Node ->Node : Node ->Symbol : Symbol - - getTypeAtLocation(node: Node): Type; ->getTypeAtLocation : (node: Node) => Type ->node : Node ->Node : Node ->Type : Type - - typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; ->typeToString : (type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => string ->type : Type ->Type : Type ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; ->symbolToString : (symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) => string ->symbol : Symbol ->Symbol : Symbol ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags - - getSymbolDisplayBuilder(): SymbolDisplayBuilder; ->getSymbolDisplayBuilder : () => SymbolDisplayBuilder ->SymbolDisplayBuilder : SymbolDisplayBuilder - - getFullyQualifiedName(symbol: Symbol): string; ->getFullyQualifiedName : (symbol: Symbol) => string ->symbol : Symbol ->Symbol : Symbol - - getAugmentedPropertiesOfType(type: Type): Symbol[]; ->getAugmentedPropertiesOfType : (type: Type) => Symbol[] ->type : Type ->Type : Type ->Symbol : Symbol - - getRootSymbols(symbol: Symbol): Symbol[]; ->getRootSymbols : (symbol: Symbol) => Symbol[] ->symbol : Symbol ->Symbol : Symbol ->Symbol : Symbol - - getContextualType(node: Expression): Type; ->getContextualType : (node: Expression) => Type ->node : Expression ->Expression : Expression ->Type : Type - - getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature; ->getResolvedSignature : (node: CallExpression | NewExpression | TaggedTemplateExpression, candidatesOutArray?: Signature[]) => Signature ->node : CallExpression | NewExpression | TaggedTemplateExpression ->CallLikeExpression : CallExpression | NewExpression | TaggedTemplateExpression ->candidatesOutArray : Signature[] ->Signature : Signature ->Signature : Signature - - getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature; ->getSignatureFromDeclaration : (declaration: SignatureDeclaration) => Signature ->declaration : SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration ->Signature : Signature - - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; ->isImplementationOfOverload : (node: FunctionLikeDeclaration) => boolean ->node : FunctionLikeDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration - - isUndefinedSymbol(symbol: Symbol): boolean; ->isUndefinedSymbol : (symbol: Symbol) => boolean ->symbol : Symbol ->Symbol : Symbol - - isArgumentsSymbol(symbol: Symbol): boolean; ->isArgumentsSymbol : (symbol: Symbol) => boolean ->symbol : Symbol ->Symbol : Symbol - - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; ->getConstantValue : (node: PropertyAccessExpression | ElementAccessExpression | EnumMember) => number ->node : PropertyAccessExpression | ElementAccessExpression | EnumMember ->EnumMember : EnumMember ->PropertyAccessExpression : PropertyAccessExpression ->ElementAccessExpression : ElementAccessExpression - - isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; ->isValidPropertyAccess : (node: QualifiedName | PropertyAccessExpression, propertyName: string) => boolean ->node : QualifiedName | PropertyAccessExpression ->PropertyAccessExpression : PropertyAccessExpression ->QualifiedName : QualifiedName ->propertyName : string - - getAliasedSymbol(symbol: Symbol): Symbol; ->getAliasedSymbol : (symbol: Symbol) => Symbol ->symbol : Symbol ->Symbol : Symbol ->Symbol : Symbol - - getExportsOfExternalModule(node: ImportDeclaration): Symbol[]; ->getExportsOfExternalModule : (node: ImportDeclaration) => Symbol[] ->node : ImportDeclaration ->ImportDeclaration : ImportDeclaration ->Symbol : Symbol - } - interface SymbolDisplayBuilder { ->SymbolDisplayBuilder : SymbolDisplayBuilder - - buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildTypeDisplay : (type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->type : Type ->Type : Type ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; ->buildSymbolDisplay : (symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags) => void ->symbol : Symbol ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags ->flags : SymbolFormatFlags ->SymbolFormatFlags : SymbolFormatFlags - - buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildSignatureDisplay : (signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->signatures : Signature ->Signature : Signature ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildParameterDisplay : (parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->parameter : Symbol ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildTypeParameterDisplay : (tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->tp : TypeParameter ->TypeParameter : TypeParameter ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags): void; ->buildTypeParameterDisplayFromSymbol : (symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags) => void ->symbol : Symbol ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaraiton : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildDisplayForParametersAndDelimiters(parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildDisplayForParametersAndDelimiters : (parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->parameters : Symbol[] ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildDisplayForTypeParametersAndDelimiters : (typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->typeParameters : TypeParameter[] ->TypeParameter : TypeParameter ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildReturnTypeDisplay : (signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->signature : Signature ->Signature : Signature ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - } - interface SymbolWriter { ->SymbolWriter : SymbolWriter - - writeKeyword(text: string): void; ->writeKeyword : (text: string) => void ->text : string - - writeOperator(text: string): void; ->writeOperator : (text: string) => void ->text : string - - writePunctuation(text: string): void; ->writePunctuation : (text: string) => void ->text : string - - writeSpace(text: string): void; ->writeSpace : (text: string) => void ->text : string - - writeStringLiteral(text: string): void; ->writeStringLiteral : (text: string) => void ->text : string - - writeParameter(text: string): void; ->writeParameter : (text: string) => void ->text : string - - writeSymbol(text: string, symbol: Symbol): void; ->writeSymbol : (text: string, symbol: Symbol) => void ->text : string ->symbol : Symbol ->Symbol : Symbol - - writeLine(): void; ->writeLine : () => void - - increaseIndent(): void; ->increaseIndent : () => void - - decreaseIndent(): void; ->decreaseIndent : () => void - - clear(): void; ->clear : () => void - - trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; ->trackSymbol : (symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) => void ->symbol : Symbol ->Symbol : Symbol ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags - } - const enum TypeFormatFlags { ->TypeFormatFlags : TypeFormatFlags - - None = 0, ->None : TypeFormatFlags - - WriteArrayAsGenericType = 1, ->WriteArrayAsGenericType : TypeFormatFlags - - UseTypeOfFunction = 2, ->UseTypeOfFunction : TypeFormatFlags - - NoTruncation = 4, ->NoTruncation : TypeFormatFlags - - WriteArrowStyleSignature = 8, ->WriteArrowStyleSignature : TypeFormatFlags - - WriteOwnNameForAnyLike = 16, ->WriteOwnNameForAnyLike : TypeFormatFlags - - WriteTypeArgumentsOfSignature = 32, ->WriteTypeArgumentsOfSignature : TypeFormatFlags - - InElementType = 64, ->InElementType : TypeFormatFlags - - UseFullyQualifiedType = 128, ->UseFullyQualifiedType : TypeFormatFlags - } - const enum SymbolFormatFlags { ->SymbolFormatFlags : SymbolFormatFlags - - None = 0, ->None : SymbolFormatFlags - - WriteTypeParametersOrArguments = 1, ->WriteTypeParametersOrArguments : SymbolFormatFlags - - UseOnlyExternalAliasing = 2, ->UseOnlyExternalAliasing : SymbolFormatFlags - } - const enum SymbolAccessibility { ->SymbolAccessibility : SymbolAccessibility - - Accessible = 0, ->Accessible : SymbolAccessibility - - NotAccessible = 1, ->NotAccessible : SymbolAccessibility - - CannotBeNamed = 2, ->CannotBeNamed : SymbolAccessibility - } - type AnyImportSyntax = ImportDeclaration | ImportEqualsDeclaration; ->AnyImportSyntax : ImportEqualsDeclaration | ImportDeclaration ->ImportDeclaration : ImportDeclaration ->ImportEqualsDeclaration : ImportEqualsDeclaration - - interface SymbolVisibilityResult { ->SymbolVisibilityResult : SymbolVisibilityResult - - accessibility: SymbolAccessibility; ->accessibility : SymbolAccessibility ->SymbolAccessibility : SymbolAccessibility - - aliasesToMakeVisible?: AnyImportSyntax[]; ->aliasesToMakeVisible : (ImportEqualsDeclaration | ImportDeclaration)[] ->AnyImportSyntax : ImportEqualsDeclaration | ImportDeclaration - - errorSymbolName?: string; ->errorSymbolName : string - - errorNode?: Node; ->errorNode : Node ->Node : Node - } - interface SymbolAccessiblityResult extends SymbolVisibilityResult { ->SymbolAccessiblityResult : SymbolAccessiblityResult ->SymbolVisibilityResult : SymbolVisibilityResult - - errorModuleName?: string; ->errorModuleName : string - } - interface EmitResolver { ->EmitResolver : EmitResolver - - hasGlobalName(name: string): boolean; ->hasGlobalName : (name: string) => boolean ->name : string - - getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string; ->getExpressionNameSubstitution : (node: Identifier, getGeneratedNameForNode: (node: Node) => string) => string ->node : Identifier ->Identifier : Identifier ->getGeneratedNameForNode : (node: Node) => string ->node : Node ->Node : Node - - isValueAliasDeclaration(node: Node): boolean; ->isValueAliasDeclaration : (node: Node) => boolean ->node : Node ->Node : Node - - isReferencedAliasDeclaration(node: Node, checkChildren?: boolean): boolean; ->isReferencedAliasDeclaration : (node: Node, checkChildren?: boolean) => boolean ->node : Node ->Node : Node ->checkChildren : boolean - - isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; ->isTopLevelValueImportEqualsWithEntityName : (node: ImportEqualsDeclaration) => boolean ->node : ImportEqualsDeclaration ->ImportEqualsDeclaration : ImportEqualsDeclaration - - getNodeCheckFlags(node: Node): NodeCheckFlags; ->getNodeCheckFlags : (node: Node) => NodeCheckFlags ->node : Node ->Node : Node ->NodeCheckFlags : NodeCheckFlags - - isDeclarationVisible(node: Declaration): boolean; ->isDeclarationVisible : (node: Declaration) => boolean ->node : Declaration ->Declaration : Declaration - - collectLinkedAliases(node: Identifier): Node[]; ->collectLinkedAliases : (node: Identifier) => Node[] ->node : Identifier ->Identifier : Identifier ->Node : Node - - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; ->isImplementationOfOverload : (node: FunctionLikeDeclaration) => boolean ->node : FunctionLikeDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration - - writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; ->writeTypeOfDeclaration : (declaration: VariableLikeDeclaration | AccessorDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void ->declaration : VariableLikeDeclaration | AccessorDeclaration ->AccessorDeclaration : AccessorDeclaration ->VariableLikeDeclaration : VariableLikeDeclaration ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags ->writer : SymbolWriter ->SymbolWriter : SymbolWriter - - writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; ->writeReturnTypeOfSignatureDeclaration : (signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void ->signatureDeclaration : SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags ->writer : SymbolWriter ->SymbolWriter : SymbolWriter - - writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; ->writeTypeOfExpression : (expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void ->expr : Expression ->Expression : Expression ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags ->writer : SymbolWriter ->SymbolWriter : SymbolWriter - - isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult; ->isSymbolAccessible : (symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags) => SymbolAccessiblityResult ->symbol : Symbol ->Symbol : Symbol ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags ->SymbolAccessiblityResult : SymbolAccessiblityResult - - isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult; ->isEntityNameVisible : (entityName: Identifier | QualifiedName, enclosingDeclaration: Node) => SymbolVisibilityResult ->entityName : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName ->enclosingDeclaration : Node ->Node : Node ->SymbolVisibilityResult : SymbolVisibilityResult - - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; ->getConstantValue : (node: PropertyAccessExpression | ElementAccessExpression | EnumMember) => number ->node : PropertyAccessExpression | ElementAccessExpression | EnumMember ->EnumMember : EnumMember ->PropertyAccessExpression : PropertyAccessExpression ->ElementAccessExpression : ElementAccessExpression - - resolvesToSomeValue(location: Node, name: string): boolean; ->resolvesToSomeValue : (location: Node, name: string) => boolean ->location : Node ->Node : Node ->name : string - - getBlockScopedVariableId(node: Identifier): number; ->getBlockScopedVariableId : (node: Identifier) => number ->node : Identifier ->Identifier : Identifier - } - const enum SymbolFlags { ->SymbolFlags : SymbolFlags - - FunctionScopedVariable = 1, ->FunctionScopedVariable : SymbolFlags - - BlockScopedVariable = 2, ->BlockScopedVariable : SymbolFlags - - Property = 4, ->Property : SymbolFlags - - EnumMember = 8, ->EnumMember : SymbolFlags - - Function = 16, ->Function : SymbolFlags - - Class = 32, ->Class : SymbolFlags - - Interface = 64, ->Interface : SymbolFlags - - ConstEnum = 128, ->ConstEnum : SymbolFlags - - RegularEnum = 256, ->RegularEnum : SymbolFlags - - ValueModule = 512, ->ValueModule : SymbolFlags - - NamespaceModule = 1024, ->NamespaceModule : SymbolFlags - - TypeLiteral = 2048, ->TypeLiteral : SymbolFlags - - ObjectLiteral = 4096, ->ObjectLiteral : SymbolFlags - - Method = 8192, ->Method : SymbolFlags - - Constructor = 16384, ->Constructor : SymbolFlags - - GetAccessor = 32768, ->GetAccessor : SymbolFlags - - SetAccessor = 65536, ->SetAccessor : SymbolFlags - - Signature = 131072, ->Signature : SymbolFlags - - TypeParameter = 262144, ->TypeParameter : SymbolFlags - - TypeAlias = 524288, ->TypeAlias : SymbolFlags - - ExportValue = 1048576, ->ExportValue : SymbolFlags - - ExportType = 2097152, ->ExportType : SymbolFlags - - ExportNamespace = 4194304, ->ExportNamespace : SymbolFlags - - Alias = 8388608, ->Alias : SymbolFlags - - Instantiated = 16777216, ->Instantiated : SymbolFlags - - Merged = 33554432, ->Merged : SymbolFlags - - Transient = 67108864, ->Transient : SymbolFlags - - Prototype = 134217728, ->Prototype : SymbolFlags - - UnionProperty = 268435456, ->UnionProperty : SymbolFlags - - Optional = 536870912, ->Optional : SymbolFlags - - ExportStar = 1073741824, ->ExportStar : SymbolFlags - - Enum = 384, ->Enum : SymbolFlags - - Variable = 3, ->Variable : SymbolFlags - - Value = 107455, ->Value : SymbolFlags - - Type = 793056, ->Type : SymbolFlags - - Namespace = 1536, ->Namespace : SymbolFlags - - Module = 1536, ->Module : SymbolFlags - - Accessor = 98304, ->Accessor : SymbolFlags - - FunctionScopedVariableExcludes = 107454, ->FunctionScopedVariableExcludes : SymbolFlags - - BlockScopedVariableExcludes = 107455, ->BlockScopedVariableExcludes : SymbolFlags - - ParameterExcludes = 107455, ->ParameterExcludes : SymbolFlags - - PropertyExcludes = 107455, ->PropertyExcludes : SymbolFlags - - EnumMemberExcludes = 107455, ->EnumMemberExcludes : SymbolFlags - - FunctionExcludes = 106927, ->FunctionExcludes : SymbolFlags - - ClassExcludes = 899583, ->ClassExcludes : SymbolFlags - - InterfaceExcludes = 792992, ->InterfaceExcludes : SymbolFlags - - RegularEnumExcludes = 899327, ->RegularEnumExcludes : SymbolFlags - - ConstEnumExcludes = 899967, ->ConstEnumExcludes : SymbolFlags - - ValueModuleExcludes = 106639, ->ValueModuleExcludes : SymbolFlags - - NamespaceModuleExcludes = 0, ->NamespaceModuleExcludes : SymbolFlags - - MethodExcludes = 99263, ->MethodExcludes : SymbolFlags - - GetAccessorExcludes = 41919, ->GetAccessorExcludes : SymbolFlags - - SetAccessorExcludes = 74687, ->SetAccessorExcludes : SymbolFlags - - TypeParameterExcludes = 530912, ->TypeParameterExcludes : SymbolFlags - - TypeAliasExcludes = 793056, ->TypeAliasExcludes : SymbolFlags - - AliasExcludes = 8388608, ->AliasExcludes : SymbolFlags - - ModuleMember = 8914931, ->ModuleMember : SymbolFlags - - ExportHasLocal = 944, ->ExportHasLocal : SymbolFlags - - HasLocals = 255504, ->HasLocals : SymbolFlags - - HasExports = 1952, ->HasExports : SymbolFlags - - HasMembers = 6240, ->HasMembers : SymbolFlags - - IsContainer = 262128, ->IsContainer : SymbolFlags - - PropertyOrAccessor = 98308, ->PropertyOrAccessor : SymbolFlags - - Export = 7340032, ->Export : SymbolFlags - } - interface Symbol { ->Symbol : Symbol - - flags: SymbolFlags; ->flags : SymbolFlags ->SymbolFlags : SymbolFlags - - name: string; ->name : string - - id?: number; ->id : number - - mergeId?: number; ->mergeId : number - - declarations?: Declaration[]; ->declarations : Declaration[] ->Declaration : Declaration - - parent?: Symbol; ->parent : Symbol ->Symbol : Symbol - - members?: SymbolTable; ->members : SymbolTable ->SymbolTable : SymbolTable - - exports?: SymbolTable; ->exports : SymbolTable ->SymbolTable : SymbolTable - - exportSymbol?: Symbol; ->exportSymbol : Symbol ->Symbol : Symbol - - valueDeclaration?: Declaration; ->valueDeclaration : Declaration ->Declaration : Declaration - - constEnumOnlyModule?: boolean; ->constEnumOnlyModule : boolean - } - interface SymbolLinks { ->SymbolLinks : SymbolLinks - - target?: Symbol; ->target : Symbol ->Symbol : Symbol - - type?: Type; ->type : Type ->Type : Type - - declaredType?: Type; ->declaredType : Type ->Type : Type - - mapper?: TypeMapper; ->mapper : TypeMapper ->TypeMapper : TypeMapper - - referenced?: boolean; ->referenced : boolean - - unionType?: UnionType; ->unionType : UnionType ->UnionType : UnionType - - resolvedExports?: SymbolTable; ->resolvedExports : SymbolTable ->SymbolTable : SymbolTable - - exportsChecked?: boolean; ->exportsChecked : boolean - } - interface TransientSymbol extends Symbol, SymbolLinks { ->TransientSymbol : TransientSymbol ->Symbol : Symbol ->SymbolLinks : SymbolLinks - } - interface SymbolTable { ->SymbolTable : SymbolTable - - [index: string]: Symbol; ->index : string ->Symbol : Symbol - } - const enum NodeCheckFlags { ->NodeCheckFlags : NodeCheckFlags - - TypeChecked = 1, ->TypeChecked : NodeCheckFlags - - LexicalThis = 2, ->LexicalThis : NodeCheckFlags - - CaptureThis = 4, ->CaptureThis : NodeCheckFlags - - EmitExtends = 8, ->EmitExtends : NodeCheckFlags - - SuperInstance = 16, ->SuperInstance : NodeCheckFlags - - SuperStatic = 32, ->SuperStatic : NodeCheckFlags - - ContextChecked = 64, ->ContextChecked : NodeCheckFlags - - EnumValuesComputed = 128, ->EnumValuesComputed : NodeCheckFlags - - BlockScopedBindingInLoop = 256, ->BlockScopedBindingInLoop : NodeCheckFlags - - EmitDecorate = 512, ->EmitDecorate : NodeCheckFlags - } - interface NodeLinks { ->NodeLinks : NodeLinks - - resolvedType?: Type; ->resolvedType : Type ->Type : Type - - resolvedSignature?: Signature; ->resolvedSignature : Signature ->Signature : Signature - - resolvedSymbol?: Symbol; ->resolvedSymbol : Symbol ->Symbol : Symbol - - flags?: NodeCheckFlags; ->flags : NodeCheckFlags ->NodeCheckFlags : NodeCheckFlags - - enumMemberValue?: number; ->enumMemberValue : number - - isIllegalTypeReferenceInConstraint?: boolean; ->isIllegalTypeReferenceInConstraint : boolean - - isVisible?: boolean; ->isVisible : boolean - - generatedName?: string; ->generatedName : string - - generatedNames?: Map; ->generatedNames : Map ->Map : Map - - assignmentChecks?: Map; ->assignmentChecks : Map ->Map : Map - - hasReportedStatementInAmbientContext?: boolean; ->hasReportedStatementInAmbientContext : boolean - - importOnRightSide?: Symbol; ->importOnRightSide : Symbol ->Symbol : Symbol - } - const enum TypeFlags { ->TypeFlags : TypeFlags - - Any = 1, ->Any : TypeFlags - - String = 2, ->String : TypeFlags - - Number = 4, ->Number : TypeFlags - - Boolean = 8, ->Boolean : TypeFlags - - Void = 16, ->Void : TypeFlags - - Undefined = 32, ->Undefined : TypeFlags - - Null = 64, ->Null : TypeFlags - - Enum = 128, ->Enum : TypeFlags - - StringLiteral = 256, ->StringLiteral : TypeFlags - - TypeParameter = 512, ->TypeParameter : TypeFlags - - Class = 1024, ->Class : TypeFlags - - Interface = 2048, ->Interface : TypeFlags - - Reference = 4096, ->Reference : TypeFlags - - Tuple = 8192, ->Tuple : TypeFlags - - Union = 16384, ->Union : TypeFlags - - Anonymous = 32768, ->Anonymous : TypeFlags - - FromSignature = 65536, ->FromSignature : TypeFlags - - ObjectLiteral = 131072, ->ObjectLiteral : TypeFlags - - ContainsUndefinedOrNull = 262144, ->ContainsUndefinedOrNull : TypeFlags - - ContainsObjectLiteral = 524288, ->ContainsObjectLiteral : TypeFlags - - ESSymbol = 1048576, ->ESSymbol : TypeFlags - - Intrinsic = 1048703, ->Intrinsic : TypeFlags - - Primitive = 1049086, ->Primitive : TypeFlags - - StringLike = 258, ->StringLike : TypeFlags - - NumberLike = 132, ->NumberLike : TypeFlags - - ObjectType = 48128, ->ObjectType : TypeFlags - - RequiresWidening = 786432, ->RequiresWidening : TypeFlags - } - interface Type { ->Type : Type - - flags: TypeFlags; ->flags : TypeFlags ->TypeFlags : TypeFlags - - id: number; ->id : number - - symbol?: Symbol; ->symbol : Symbol ->Symbol : Symbol - } - interface IntrinsicType extends Type { ->IntrinsicType : IntrinsicType ->Type : Type - - intrinsicName: string; ->intrinsicName : string - } - interface StringLiteralType extends Type { ->StringLiteralType : StringLiteralType ->Type : Type - - text: string; ->text : string - } - interface ObjectType extends Type { ->ObjectType : ObjectType ->Type : Type - } - interface InterfaceType extends ObjectType { ->InterfaceType : InterfaceType ->ObjectType : ObjectType - - typeParameters: TypeParameter[]; ->typeParameters : TypeParameter[] ->TypeParameter : TypeParameter - - baseTypes: ObjectType[]; ->baseTypes : ObjectType[] ->ObjectType : ObjectType - - declaredProperties: Symbol[]; ->declaredProperties : Symbol[] ->Symbol : Symbol - - declaredCallSignatures: Signature[]; ->declaredCallSignatures : Signature[] ->Signature : Signature - - declaredConstructSignatures: Signature[]; ->declaredConstructSignatures : Signature[] ->Signature : Signature - - declaredStringIndexType: Type; ->declaredStringIndexType : Type ->Type : Type - - declaredNumberIndexType: Type; ->declaredNumberIndexType : Type ->Type : Type - } - interface TypeReference extends ObjectType { ->TypeReference : TypeReference ->ObjectType : ObjectType - - target: GenericType; ->target : GenericType ->GenericType : GenericType - - typeArguments: Type[]; ->typeArguments : Type[] ->Type : Type - } - interface GenericType extends InterfaceType, TypeReference { ->GenericType : GenericType ->InterfaceType : InterfaceType ->TypeReference : TypeReference - - instantiations: Map; ->instantiations : Map ->Map : Map ->TypeReference : TypeReference - } - interface TupleType extends ObjectType { ->TupleType : TupleType ->ObjectType : ObjectType - - elementTypes: Type[]; ->elementTypes : Type[] ->Type : Type - - baseArrayType: TypeReference; ->baseArrayType : TypeReference ->TypeReference : TypeReference - } - interface UnionType extends Type { ->UnionType : UnionType ->Type : Type - - types: Type[]; ->types : Type[] ->Type : Type - - resolvedProperties: SymbolTable; ->resolvedProperties : SymbolTable ->SymbolTable : SymbolTable - } - interface ResolvedType extends ObjectType, UnionType { ->ResolvedType : ResolvedType ->ObjectType : ObjectType ->UnionType : UnionType - - members: SymbolTable; ->members : SymbolTable ->SymbolTable : SymbolTable - - properties: Symbol[]; ->properties : Symbol[] ->Symbol : Symbol - - callSignatures: Signature[]; ->callSignatures : Signature[] ->Signature : Signature - - constructSignatures: Signature[]; ->constructSignatures : Signature[] ->Signature : Signature - - stringIndexType: Type; ->stringIndexType : Type ->Type : Type - - numberIndexType: Type; ->numberIndexType : Type ->Type : Type - } - interface TypeParameter extends Type { ->TypeParameter : TypeParameter ->Type : Type - - constraint: Type; ->constraint : Type ->Type : Type - - target?: TypeParameter; ->target : TypeParameter ->TypeParameter : TypeParameter - - mapper?: TypeMapper; ->mapper : TypeMapper ->TypeMapper : TypeMapper - } - const enum SignatureKind { ->SignatureKind : SignatureKind - - Call = 0, ->Call : SignatureKind - - Construct = 1, ->Construct : SignatureKind - } - interface Signature { ->Signature : Signature - - declaration: SignatureDeclaration; ->declaration : SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration - - typeParameters: TypeParameter[]; ->typeParameters : TypeParameter[] ->TypeParameter : TypeParameter - - parameters: Symbol[]; ->parameters : Symbol[] ->Symbol : Symbol - - resolvedReturnType: Type; ->resolvedReturnType : Type ->Type : Type - - minArgumentCount: number; ->minArgumentCount : number - - hasRestParameter: boolean; ->hasRestParameter : boolean - - hasStringLiterals: boolean; ->hasStringLiterals : boolean - - target?: Signature; ->target : Signature ->Signature : Signature - - mapper?: TypeMapper; ->mapper : TypeMapper ->TypeMapper : TypeMapper - - unionSignatures?: Signature[]; ->unionSignatures : Signature[] ->Signature : Signature - - erasedSignatureCache?: Signature; ->erasedSignatureCache : Signature ->Signature : Signature - - isolatedSignatureType?: ObjectType; ->isolatedSignatureType : ObjectType ->ObjectType : ObjectType - } - const enum IndexKind { ->IndexKind : IndexKind - - String = 0, ->String : IndexKind - - Number = 1, ->Number : IndexKind - } - interface TypeMapper { ->TypeMapper : TypeMapper - - (t: Type): Type; ->t : Type ->Type : Type ->Type : Type - } - interface DiagnosticMessage { ->DiagnosticMessage : DiagnosticMessage - - key: string; ->key : string - - category: DiagnosticCategory; ->category : DiagnosticCategory ->DiagnosticCategory : DiagnosticCategory - - code: number; ->code : number - } - interface DiagnosticMessageChain { ->DiagnosticMessageChain : DiagnosticMessageChain - - messageText: string; ->messageText : string - - category: DiagnosticCategory; ->category : DiagnosticCategory ->DiagnosticCategory : DiagnosticCategory - - code: number; ->code : number - - next?: DiagnosticMessageChain; ->next : DiagnosticMessageChain ->DiagnosticMessageChain : DiagnosticMessageChain - } - interface Diagnostic { ->Diagnostic : Diagnostic - - file: SourceFile; ->file : SourceFile ->SourceFile : SourceFile - - start: number; ->start : number - - length: number; ->length : number - - messageText: string | DiagnosticMessageChain; ->messageText : string | DiagnosticMessageChain ->DiagnosticMessageChain : DiagnosticMessageChain - - category: DiagnosticCategory; ->category : DiagnosticCategory ->DiagnosticCategory : DiagnosticCategory - - code: number; ->code : number - } - enum DiagnosticCategory { ->DiagnosticCategory : DiagnosticCategory - - Warning = 0, ->Warning : DiagnosticCategory - - Error = 1, ->Error : DiagnosticCategory - - Message = 2, ->Message : DiagnosticCategory - } - interface CompilerOptions { ->CompilerOptions : CompilerOptions - - allowNonTsExtensions?: boolean; ->allowNonTsExtensions : boolean - - charset?: string; ->charset : string - - codepage?: number; ->codepage : number - - declaration?: boolean; ->declaration : boolean - - diagnostics?: boolean; ->diagnostics : boolean - - emitBOM?: boolean; ->emitBOM : boolean - - help?: boolean; ->help : boolean - - listFiles?: boolean; ->listFiles : boolean - - locale?: string; ->locale : string - - mapRoot?: string; ->mapRoot : string - - module?: ModuleKind; ->module : ModuleKind ->ModuleKind : ModuleKind - - noEmit?: boolean; ->noEmit : boolean - - noEmitOnError?: boolean; ->noEmitOnError : boolean - - noErrorTruncation?: boolean; ->noErrorTruncation : boolean - - noImplicitAny?: boolean; ->noImplicitAny : boolean - - noLib?: boolean; ->noLib : boolean - - noLibCheck?: boolean; ->noLibCheck : boolean - - noResolve?: boolean; ->noResolve : boolean - - out?: string; ->out : string - - outDir?: string; ->outDir : string - - preserveConstEnums?: boolean; ->preserveConstEnums : boolean - - project?: string; ->project : string - - removeComments?: boolean; ->removeComments : boolean - - sourceMap?: boolean; ->sourceMap : boolean - - sourceRoot?: string; ->sourceRoot : string - - suppressImplicitAnyIndexErrors?: boolean; ->suppressImplicitAnyIndexErrors : boolean - - target?: ScriptTarget; ->target : ScriptTarget ->ScriptTarget : ScriptTarget - - version?: boolean; ->version : boolean - - watch?: boolean; ->watch : boolean - - [option: string]: string | number | boolean; ->option : string - } - const enum ModuleKind { ->ModuleKind : ModuleKind - - None = 0, ->None : ModuleKind - - CommonJS = 1, ->CommonJS : ModuleKind - - AMD = 2, ->AMD : ModuleKind - } - interface LineAndCharacter { ->LineAndCharacter : LineAndCharacter - - line: number; ->line : number - - character: number; ->character : number - } - const enum ScriptTarget { ->ScriptTarget : ScriptTarget - - ES3 = 0, ->ES3 : ScriptTarget - - ES5 = 1, ->ES5 : ScriptTarget - - ES6 = 2, ->ES6 : ScriptTarget - - Latest = 2, ->Latest : ScriptTarget - } - interface ParsedCommandLine { ->ParsedCommandLine : ParsedCommandLine - - options: CompilerOptions; ->options : CompilerOptions ->CompilerOptions : CompilerOptions - - fileNames: string[]; ->fileNames : string[] - - errors: Diagnostic[]; ->errors : Diagnostic[] ->Diagnostic : Diagnostic - } - interface CommandLineOption { ->CommandLineOption : CommandLineOption - - name: string; ->name : string - - type: string | Map; ->type : string | Map ->Map : Map - - isFilePath?: boolean; ->isFilePath : boolean - - shortName?: string; ->shortName : string - - description?: DiagnosticMessage; ->description : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage - - paramType?: DiagnosticMessage; ->paramType : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage - - error?: DiagnosticMessage; ->error : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage - - experimental?: boolean; ->experimental : boolean - } - const enum CharacterCodes { ->CharacterCodes : CharacterCodes - - nullCharacter = 0, ->nullCharacter : CharacterCodes - - maxAsciiCharacter = 127, ->maxAsciiCharacter : CharacterCodes - - lineFeed = 10, ->lineFeed : CharacterCodes - - carriageReturn = 13, ->carriageReturn : CharacterCodes - - lineSeparator = 8232, ->lineSeparator : CharacterCodes - - paragraphSeparator = 8233, ->paragraphSeparator : CharacterCodes - - nextLine = 133, ->nextLine : CharacterCodes - - space = 32, ->space : CharacterCodes - - nonBreakingSpace = 160, ->nonBreakingSpace : CharacterCodes - - enQuad = 8192, ->enQuad : CharacterCodes - - emQuad = 8193, ->emQuad : CharacterCodes - - enSpace = 8194, ->enSpace : CharacterCodes - - emSpace = 8195, ->emSpace : CharacterCodes - - threePerEmSpace = 8196, ->threePerEmSpace : CharacterCodes - - fourPerEmSpace = 8197, ->fourPerEmSpace : CharacterCodes - - sixPerEmSpace = 8198, ->sixPerEmSpace : CharacterCodes - - figureSpace = 8199, ->figureSpace : CharacterCodes - - punctuationSpace = 8200, ->punctuationSpace : CharacterCodes - - thinSpace = 8201, ->thinSpace : CharacterCodes - - hairSpace = 8202, ->hairSpace : CharacterCodes - - zeroWidthSpace = 8203, ->zeroWidthSpace : CharacterCodes - - narrowNoBreakSpace = 8239, ->narrowNoBreakSpace : CharacterCodes - - ideographicSpace = 12288, ->ideographicSpace : CharacterCodes - - mathematicalSpace = 8287, ->mathematicalSpace : CharacterCodes - - ogham = 5760, ->ogham : CharacterCodes - - _ = 95, ->_ : CharacterCodes - - $ = 36, ->$ : CharacterCodes - - _0 = 48, ->_0 : CharacterCodes - - _1 = 49, ->_1 : CharacterCodes - - _2 = 50, ->_2 : CharacterCodes - - _3 = 51, ->_3 : CharacterCodes - - _4 = 52, ->_4 : CharacterCodes - - _5 = 53, ->_5 : CharacterCodes - - _6 = 54, ->_6 : CharacterCodes - - _7 = 55, ->_7 : CharacterCodes - - _8 = 56, ->_8 : CharacterCodes - - _9 = 57, ->_9 : CharacterCodes - - a = 97, ->a : CharacterCodes - - b = 98, ->b : CharacterCodes - - c = 99, ->c : CharacterCodes - - d = 100, ->d : CharacterCodes - - e = 101, ->e : CharacterCodes - - f = 102, ->f : CharacterCodes - - g = 103, ->g : CharacterCodes - - h = 104, ->h : CharacterCodes - - i = 105, ->i : CharacterCodes - - j = 106, ->j : CharacterCodes - - k = 107, ->k : CharacterCodes - - l = 108, ->l : CharacterCodes - - m = 109, ->m : CharacterCodes - - n = 110, ->n : CharacterCodes - - o = 111, ->o : CharacterCodes - - p = 112, ->p : CharacterCodes - - q = 113, ->q : CharacterCodes - - r = 114, ->r : CharacterCodes - - s = 115, ->s : CharacterCodes - - t = 116, ->t : CharacterCodes - - u = 117, ->u : CharacterCodes - - v = 118, ->v : CharacterCodes - - w = 119, ->w : CharacterCodes - - x = 120, ->x : CharacterCodes - - y = 121, ->y : CharacterCodes - - z = 122, ->z : CharacterCodes - - A = 65, ->A : CharacterCodes - - B = 66, ->B : CharacterCodes - - C = 67, ->C : CharacterCodes - - D = 68, ->D : CharacterCodes - - E = 69, ->E : CharacterCodes - - F = 70, ->F : CharacterCodes - - G = 71, ->G : CharacterCodes - - H = 72, ->H : CharacterCodes - - I = 73, ->I : CharacterCodes - - J = 74, ->J : CharacterCodes - - K = 75, ->K : CharacterCodes - - L = 76, ->L : CharacterCodes - - M = 77, ->M : CharacterCodes - - N = 78, ->N : CharacterCodes - - O = 79, ->O : CharacterCodes - - P = 80, ->P : CharacterCodes - - Q = 81, ->Q : CharacterCodes - - R = 82, ->R : CharacterCodes - - S = 83, ->S : CharacterCodes - - T = 84, ->T : CharacterCodes - - U = 85, ->U : CharacterCodes - - V = 86, ->V : CharacterCodes - - W = 87, ->W : CharacterCodes - - X = 88, ->X : CharacterCodes - - Y = 89, ->Y : CharacterCodes - - Z = 90, ->Z : CharacterCodes - - ampersand = 38, ->ampersand : CharacterCodes - - asterisk = 42, ->asterisk : CharacterCodes - - at = 64, ->at : CharacterCodes - - backslash = 92, ->backslash : CharacterCodes - - backtick = 96, ->backtick : CharacterCodes - - bar = 124, ->bar : CharacterCodes - - caret = 94, ->caret : CharacterCodes - - closeBrace = 125, ->closeBrace : CharacterCodes - - closeBracket = 93, ->closeBracket : CharacterCodes - - closeParen = 41, ->closeParen : CharacterCodes - - colon = 58, ->colon : CharacterCodes - - comma = 44, ->comma : CharacterCodes - - dot = 46, ->dot : CharacterCodes - - doubleQuote = 34, ->doubleQuote : CharacterCodes - - equals = 61, ->equals : CharacterCodes - - exclamation = 33, ->exclamation : CharacterCodes - - greaterThan = 62, ->greaterThan : CharacterCodes - - hash = 35, ->hash : CharacterCodes - - lessThan = 60, ->lessThan : CharacterCodes - - minus = 45, ->minus : CharacterCodes - - openBrace = 123, ->openBrace : CharacterCodes - - openBracket = 91, ->openBracket : CharacterCodes - - openParen = 40, ->openParen : CharacterCodes - - percent = 37, ->percent : CharacterCodes - - plus = 43, ->plus : CharacterCodes - - question = 63, ->question : CharacterCodes - - semicolon = 59, ->semicolon : CharacterCodes - - singleQuote = 39, ->singleQuote : CharacterCodes - - slash = 47, ->slash : CharacterCodes - - tilde = 126, ->tilde : CharacterCodes - - backspace = 8, ->backspace : CharacterCodes - - formFeed = 12, ->formFeed : CharacterCodes - - byteOrderMark = 65279, ->byteOrderMark : CharacterCodes - - tab = 9, ->tab : CharacterCodes - - verticalTab = 11, ->verticalTab : CharacterCodes - } - interface CancellationToken { ->CancellationToken : CancellationToken - - isCancellationRequested(): boolean; ->isCancellationRequested : () => boolean - } - interface CompilerHost { ->CompilerHost : CompilerHost - - getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile; ->getSourceFile : (fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void) => SourceFile ->fileName : string ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget ->onError : (message: string) => void ->message : string ->SourceFile : SourceFile - - getDefaultLibFileName(options: CompilerOptions): string; ->getDefaultLibFileName : (options: CompilerOptions) => string ->options : CompilerOptions ->CompilerOptions : CompilerOptions - - getCancellationToken?(): CancellationToken; ->getCancellationToken : () => CancellationToken ->CancellationToken : CancellationToken - - writeFile: WriteFileCallback; ->writeFile : WriteFileCallback ->WriteFileCallback : WriteFileCallback - - getCurrentDirectory(): string; ->getCurrentDirectory : () => string - - getCanonicalFileName(fileName: string): string; ->getCanonicalFileName : (fileName: string) => string ->fileName : string - - useCaseSensitiveFileNames(): boolean; ->useCaseSensitiveFileNames : () => boolean - - getNewLine(): string; ->getNewLine : () => string - } - interface TextSpan { ->TextSpan : TextSpan - - start: number; ->start : number - - length: number; ->length : number - } - interface TextChangeRange { ->TextChangeRange : TextChangeRange - - span: TextSpan; ->span : TextSpan ->TextSpan : TextSpan - - newLength: number; ->newLength : number - } -} -declare module "typescript" { - interface ErrorCallback { ->ErrorCallback : ErrorCallback - - (message: DiagnosticMessage, length: number): void; ->message : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage ->length : number - } - interface Scanner { ->Scanner : Scanner - - getStartPos(): number; ->getStartPos : () => number - - getToken(): SyntaxKind; ->getToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - getTextPos(): number; ->getTextPos : () => number - - getTokenPos(): number; ->getTokenPos : () => number - - getTokenText(): string; ->getTokenText : () => string - - getTokenValue(): string; ->getTokenValue : () => string - - hasExtendedUnicodeEscape(): boolean; ->hasExtendedUnicodeEscape : () => boolean - - hasPrecedingLineBreak(): boolean; ->hasPrecedingLineBreak : () => boolean - - isIdentifier(): boolean; ->isIdentifier : () => boolean - - isReservedWord(): boolean; ->isReservedWord : () => boolean - - isUnterminated(): boolean; ->isUnterminated : () => boolean - - reScanGreaterToken(): SyntaxKind; ->reScanGreaterToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - reScanSlashToken(): SyntaxKind; ->reScanSlashToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - reScanTemplateToken(): SyntaxKind; ->reScanTemplateToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - scan(): SyntaxKind; ->scan : () => SyntaxKind ->SyntaxKind : SyntaxKind - - setText(text: string): void; ->setText : (text: string) => void ->text : string - - setTextPos(textPos: number): void; ->setTextPos : (textPos: number) => void ->textPos : number - - lookAhead(callback: () => T): T; ->lookAhead : (callback: () => T) => T ->T : T ->callback : () => T ->T : T ->T : T - - tryScan(callback: () => T): T; ->tryScan : (callback: () => T) => T ->T : T ->callback : () => T ->T : T ->T : T - } - function tokenToString(t: SyntaxKind): string; ->tokenToString : (t: SyntaxKind) => string ->t : SyntaxKind ->SyntaxKind : SyntaxKind - - function computeLineStarts(text: string): number[]; ->computeLineStarts : (text: string) => number[] ->text : string - - function getPositionOfLineAndCharacter(sourceFile: SourceFile, line: number, character: number): number; ->getPositionOfLineAndCharacter : (sourceFile: SourceFile, line: number, character: number) => number ->sourceFile : SourceFile ->SourceFile : SourceFile ->line : number ->character : number - - function computePositionOfLineAndCharacter(lineStarts: number[], line: number, character: number): number; ->computePositionOfLineAndCharacter : (lineStarts: number[], line: number, character: number) => number ->lineStarts : number[] ->line : number ->character : number - - function getLineStarts(sourceFile: SourceFile): number[]; ->getLineStarts : (sourceFile: SourceFile) => number[] ->sourceFile : SourceFile ->SourceFile : SourceFile - - function computeLineAndCharacterOfPosition(lineStarts: number[], position: number): { ->computeLineAndCharacterOfPosition : (lineStarts: number[], position: number) => { line: number; character: number; } ->lineStarts : number[] ->position : number - - line: number; ->line : number - - character: number; ->character : number - - }; - function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter; ->getLineAndCharacterOfPosition : (sourceFile: SourceFile, position: number) => LineAndCharacter ->sourceFile : SourceFile ->SourceFile : SourceFile ->position : number ->LineAndCharacter : LineAndCharacter - - function isWhiteSpace(ch: number): boolean; ->isWhiteSpace : (ch: number) => boolean ->ch : number - - function isLineBreak(ch: number): boolean; ->isLineBreak : (ch: number) => boolean ->ch : number - - function isOctalDigit(ch: number): boolean; ->isOctalDigit : (ch: number) => boolean ->ch : number - - function skipTrivia(text: string, pos: number, stopAfterLineBreak?: boolean): number; ->skipTrivia : (text: string, pos: number, stopAfterLineBreak?: boolean) => number ->text : string ->pos : number ->stopAfterLineBreak : boolean - - function getLeadingCommentRanges(text: string, pos: number): CommentRange[]; ->getLeadingCommentRanges : (text: string, pos: number) => CommentRange[] ->text : string ->pos : number ->CommentRange : CommentRange - - function getTrailingCommentRanges(text: string, pos: number): CommentRange[]; ->getTrailingCommentRanges : (text: string, pos: number) => CommentRange[] ->text : string ->pos : number ->CommentRange : CommentRange - - function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean; ->isIdentifierStart : (ch: number, languageVersion: ScriptTarget) => boolean ->ch : number ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget - - function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean; ->isIdentifierPart : (ch: number, languageVersion: ScriptTarget) => boolean ->ch : number ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget - - function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback): Scanner; ->createScanner : (languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback) => Scanner ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget ->skipTrivia : boolean ->text : string ->onError : ErrorCallback ->ErrorCallback : ErrorCallback ->Scanner : Scanner -} -declare module "typescript" { - function getNodeConstructor(kind: SyntaxKind): new () => Node; ->getNodeConstructor : (kind: SyntaxKind) => new () => Node ->kind : SyntaxKind ->SyntaxKind : SyntaxKind ->Node : Node - - function createNode(kind: SyntaxKind): Node; ->createNode : (kind: SyntaxKind) => Node ->kind : SyntaxKind ->SyntaxKind : SyntaxKind ->Node : Node - - function forEachChild(node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; ->forEachChild : (node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T) => T ->T : T ->node : Node ->Node : Node ->cbNode : (node: Node) => T ->node : Node ->Node : Node ->T : T ->cbNodeArray : (nodes: Node[]) => T ->nodes : Node[] ->Node : Node ->T : T ->T : T - - function modifierToFlag(token: SyntaxKind): NodeFlags; ->modifierToFlag : (token: SyntaxKind) => NodeFlags ->token : SyntaxKind ->SyntaxKind : SyntaxKind ->NodeFlags : NodeFlags - - function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; ->updateSourceFile : (sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean) => SourceFile ->sourceFile : SourceFile ->SourceFile : SourceFile ->newText : string ->textChangeRange : TextChangeRange ->TextChangeRange : TextChangeRange ->aggressiveChecks : boolean ->SourceFile : SourceFile - - function isEvalOrArgumentsIdentifier(node: Node): boolean; ->isEvalOrArgumentsIdentifier : (node: Node) => boolean ->node : Node ->Node : Node - - function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean): SourceFile; ->createSourceFile : (fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean) => SourceFile ->fileName : string ->sourceText : string ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget ->setParentNodes : boolean ->SourceFile : SourceFile - - function isLeftHandSideExpression(expr: Expression): boolean; ->isLeftHandSideExpression : (expr: Expression) => boolean ->expr : Expression ->Expression : Expression - - function isAssignmentOperator(token: SyntaxKind): boolean; ->isAssignmentOperator : (token: SyntaxKind) => boolean ->token : SyntaxKind ->SyntaxKind : SyntaxKind -} -declare module "typescript" { - function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker; ->createTypeChecker : (host: TypeCheckerHost, produceDiagnostics: boolean) => TypeChecker ->host : TypeCheckerHost ->TypeCheckerHost : TypeCheckerHost ->produceDiagnostics : boolean ->TypeChecker : TypeChecker -} -declare module "typescript" { - /** The version of the TypeScript compiler release */ - let version: string; ->version : string - - function findConfigFile(searchPath: string): string; ->findConfigFile : (searchPath: string) => string ->searchPath : string - - function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; ->createCompilerHost : (options: CompilerOptions, setParentNodes?: boolean) => CompilerHost ->options : CompilerOptions ->CompilerOptions : CompilerOptions ->setParentNodes : boolean ->CompilerHost : CompilerHost - - function getPreEmitDiagnostics(program: Program): Diagnostic[]; ->getPreEmitDiagnostics : (program: Program) => Diagnostic[] ->program : Program ->Program : Program ->Diagnostic : Diagnostic - - function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; ->flattenDiagnosticMessageText : (messageText: string | DiagnosticMessageChain, newLine: string) => string ->messageText : string | DiagnosticMessageChain ->DiagnosticMessageChain : DiagnosticMessageChain ->newLine : string - - function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; ->createProgram : (rootNames: string[], options: CompilerOptions, host?: CompilerHost) => Program ->rootNames : string[] ->options : CompilerOptions ->CompilerOptions : CompilerOptions ->host : CompilerHost ->CompilerHost : CompilerHost ->Program : Program -} -declare module "typescript" { - /** The version of the language service API */ - let servicesVersion: string; ->servicesVersion : string - - interface Node { ->Node : Node - - getSourceFile(): SourceFile; ->getSourceFile : () => SourceFile ->SourceFile : SourceFile - - getChildCount(sourceFile?: SourceFile): number; ->getChildCount : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getChildAt(index: number, sourceFile?: SourceFile): Node; ->getChildAt : (index: number, sourceFile?: SourceFile) => Node ->index : number ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - - getChildren(sourceFile?: SourceFile): Node[]; ->getChildren : (sourceFile?: SourceFile) => Node[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - - getStart(sourceFile?: SourceFile): number; ->getStart : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFullStart(): number; ->getFullStart : () => number - - getEnd(): number; ->getEnd : () => number - - getWidth(sourceFile?: SourceFile): number; ->getWidth : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFullWidth(): number; ->getFullWidth : () => number - - getLeadingTriviaWidth(sourceFile?: SourceFile): number; ->getLeadingTriviaWidth : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFullText(sourceFile?: SourceFile): string; ->getFullText : (sourceFile?: SourceFile) => string ->sourceFile : SourceFile ->SourceFile : SourceFile - - getText(sourceFile?: SourceFile): string; ->getText : (sourceFile?: SourceFile) => string ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFirstToken(sourceFile?: SourceFile): Node; ->getFirstToken : (sourceFile?: SourceFile) => Node ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - - getLastToken(sourceFile?: SourceFile): Node; ->getLastToken : (sourceFile?: SourceFile) => Node ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - } - interface Symbol { ->Symbol : Symbol - - getFlags(): SymbolFlags; ->getFlags : () => SymbolFlags ->SymbolFlags : SymbolFlags - - getName(): string; ->getName : () => string - - getDeclarations(): Declaration[]; ->getDeclarations : () => Declaration[] ->Declaration : Declaration - - getDocumentationComment(): SymbolDisplayPart[]; ->getDocumentationComment : () => SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface Type { ->Type : Type - - getFlags(): TypeFlags; ->getFlags : () => TypeFlags ->TypeFlags : TypeFlags - - getSymbol(): Symbol; ->getSymbol : () => Symbol ->Symbol : Symbol - - getProperties(): Symbol[]; ->getProperties : () => Symbol[] ->Symbol : Symbol - - getProperty(propertyName: string): Symbol; ->getProperty : (propertyName: string) => Symbol ->propertyName : string ->Symbol : Symbol - - getApparentProperties(): Symbol[]; ->getApparentProperties : () => Symbol[] ->Symbol : Symbol - - getCallSignatures(): Signature[]; ->getCallSignatures : () => Signature[] ->Signature : Signature - - getConstructSignatures(): Signature[]; ->getConstructSignatures : () => Signature[] ->Signature : Signature - - getStringIndexType(): Type; ->getStringIndexType : () => Type ->Type : Type - - getNumberIndexType(): Type; ->getNumberIndexType : () => Type ->Type : Type - } - interface Signature { ->Signature : Signature - - getDeclaration(): SignatureDeclaration; ->getDeclaration : () => SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration - - getTypeParameters(): Type[]; ->getTypeParameters : () => Type[] ->Type : Type - - getParameters(): Symbol[]; ->getParameters : () => Symbol[] ->Symbol : Symbol - - getReturnType(): Type; ->getReturnType : () => Type ->Type : Type - - getDocumentationComment(): SymbolDisplayPart[]; ->getDocumentationComment : () => SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface SourceFile { ->SourceFile : SourceFile - - getNamedDeclarations(): Declaration[]; ->getNamedDeclarations : () => Declaration[] ->Declaration : Declaration - - getLineAndCharacterOfPosition(pos: number): LineAndCharacter; ->getLineAndCharacterOfPosition : (pos: number) => LineAndCharacter ->pos : number ->LineAndCharacter : LineAndCharacter - - getLineStarts(): number[]; ->getLineStarts : () => number[] - - getPositionOfLineAndCharacter(line: number, character: number): number; ->getPositionOfLineAndCharacter : (line: number, character: number) => number ->line : number ->character : number - - update(newText: string, textChangeRange: TextChangeRange): SourceFile; ->update : (newText: string, textChangeRange: TextChangeRange) => SourceFile ->newText : string ->textChangeRange : TextChangeRange ->TextChangeRange : TextChangeRange ->SourceFile : SourceFile - } - /** - * Represents an immutable snapshot of a script at a specified time.Once acquired, the - * snapshot is observably immutable. i.e. the same calls with the same parameters will return - * the same values. - */ - interface IScriptSnapshot { ->IScriptSnapshot : IScriptSnapshot - - /** Gets a portion of the script snapshot specified by [start, end). */ - getText(start: number, end: number): string; ->getText : (start: number, end: number) => string ->start : number ->end : number - - /** Gets the length of this script snapshot. */ - getLength(): number; ->getLength : () => number - - /** - * Gets the TextChangeRange that describe how the text changed between this text and - * an older version. This information is used by the incremental parser to determine - * what sections of the script need to be re-parsed. 'undefined' can be returned if the - * change range cannot be determined. However, in that case, incremental parsing will - * not happen and the entire document will be re - parsed. - */ - getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange; ->getChangeRange : (oldSnapshot: IScriptSnapshot) => TextChangeRange ->oldSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->TextChangeRange : TextChangeRange - } - module ScriptSnapshot { ->ScriptSnapshot : typeof ScriptSnapshot - - function fromString(text: string): IScriptSnapshot; ->fromString : (text: string) => IScriptSnapshot ->text : string ->IScriptSnapshot : IScriptSnapshot - } - interface PreProcessedFileInfo { ->PreProcessedFileInfo : PreProcessedFileInfo - - referencedFiles: FileReference[]; ->referencedFiles : FileReference[] ->FileReference : FileReference - - importedFiles: FileReference[]; ->importedFiles : FileReference[] ->FileReference : FileReference - - isLibFile: boolean; ->isLibFile : boolean - } - interface LanguageServiceHost { ->LanguageServiceHost : LanguageServiceHost - - getCompilationSettings(): CompilerOptions; ->getCompilationSettings : () => CompilerOptions ->CompilerOptions : CompilerOptions - - getNewLine?(): string; ->getNewLine : () => string - - getScriptFileNames(): string[]; ->getScriptFileNames : () => string[] - - getScriptVersion(fileName: string): string; ->getScriptVersion : (fileName: string) => string ->fileName : string - - getScriptSnapshot(fileName: string): IScriptSnapshot; ->getScriptSnapshot : (fileName: string) => IScriptSnapshot ->fileName : string ->IScriptSnapshot : IScriptSnapshot - - getLocalizedDiagnosticMessages?(): any; ->getLocalizedDiagnosticMessages : () => any - - getCancellationToken?(): CancellationToken; ->getCancellationToken : () => CancellationToken ->CancellationToken : CancellationToken - - getCurrentDirectory(): string; ->getCurrentDirectory : () => string - - getDefaultLibFileName(options: CompilerOptions): string; ->getDefaultLibFileName : (options: CompilerOptions) => string ->options : CompilerOptions ->CompilerOptions : CompilerOptions - - log?(s: string): void; ->log : (s: string) => void ->s : string - - trace?(s: string): void; ->trace : (s: string) => void ->s : string - - error?(s: string): void; ->error : (s: string) => void ->s : string - } - interface LanguageService { ->LanguageService : LanguageService - - cleanupSemanticCache(): void; ->cleanupSemanticCache : () => void - - getSyntacticDiagnostics(fileName: string): Diagnostic[]; ->getSyntacticDiagnostics : (fileName: string) => Diagnostic[] ->fileName : string ->Diagnostic : Diagnostic - - getSemanticDiagnostics(fileName: string): Diagnostic[]; ->getSemanticDiagnostics : (fileName: string) => Diagnostic[] ->fileName : string ->Diagnostic : Diagnostic - - getCompilerOptionsDiagnostics(): Diagnostic[]; ->getCompilerOptionsDiagnostics : () => Diagnostic[] ->Diagnostic : Diagnostic - - getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; ->getSyntacticClassifications : (fileName: string, span: TextSpan) => ClassifiedSpan[] ->fileName : string ->span : TextSpan ->TextSpan : TextSpan ->ClassifiedSpan : ClassifiedSpan - - getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; ->getSemanticClassifications : (fileName: string, span: TextSpan) => ClassifiedSpan[] ->fileName : string ->span : TextSpan ->TextSpan : TextSpan ->ClassifiedSpan : ClassifiedSpan - - getCompletionsAtPosition(fileName: string, position: number): CompletionInfo; ->getCompletionsAtPosition : (fileName: string, position: number) => CompletionInfo ->fileName : string ->position : number ->CompletionInfo : CompletionInfo - - getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails; ->getCompletionEntryDetails : (fileName: string, position: number, entryName: string) => CompletionEntryDetails ->fileName : string ->position : number ->entryName : string ->CompletionEntryDetails : CompletionEntryDetails - - getQuickInfoAtPosition(fileName: string, position: number): QuickInfo; ->getQuickInfoAtPosition : (fileName: string, position: number) => QuickInfo ->fileName : string ->position : number ->QuickInfo : QuickInfo - - getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan; ->getNameOrDottedNameSpan : (fileName: string, startPos: number, endPos: number) => TextSpan ->fileName : string ->startPos : number ->endPos : number ->TextSpan : TextSpan - - getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan; ->getBreakpointStatementAtPosition : (fileName: string, position: number) => TextSpan ->fileName : string ->position : number ->TextSpan : TextSpan - - getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems; ->getSignatureHelpItems : (fileName: string, position: number) => SignatureHelpItems ->fileName : string ->position : number ->SignatureHelpItems : SignatureHelpItems - - getRenameInfo(fileName: string, position: number): RenameInfo; ->getRenameInfo : (fileName: string, position: number) => RenameInfo ->fileName : string ->position : number ->RenameInfo : RenameInfo - - findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]; ->findRenameLocations : (fileName: string, position: number, findInStrings: boolean, findInComments: boolean) => RenameLocation[] ->fileName : string ->position : number ->findInStrings : boolean ->findInComments : boolean ->RenameLocation : RenameLocation - - getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; ->getDefinitionAtPosition : (fileName: string, position: number) => DefinitionInfo[] ->fileName : string ->position : number ->DefinitionInfo : DefinitionInfo - - getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; ->getReferencesAtPosition : (fileName: string, position: number) => ReferenceEntry[] ->fileName : string ->position : number ->ReferenceEntry : ReferenceEntry - - getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; ->getOccurrencesAtPosition : (fileName: string, position: number) => ReferenceEntry[] ->fileName : string ->position : number ->ReferenceEntry : ReferenceEntry - - findReferences(fileName: string, position: number): ReferencedSymbol[]; ->findReferences : (fileName: string, position: number) => ReferencedSymbol[] ->fileName : string ->position : number ->ReferencedSymbol : ReferencedSymbol - - getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[]; ->getNavigateToItems : (searchValue: string, maxResultCount?: number) => NavigateToItem[] ->searchValue : string ->maxResultCount : number ->NavigateToItem : NavigateToItem - - getNavigationBarItems(fileName: string): NavigationBarItem[]; ->getNavigationBarItems : (fileName: string) => NavigationBarItem[] ->fileName : string ->NavigationBarItem : NavigationBarItem - - getOutliningSpans(fileName: string): OutliningSpan[]; ->getOutliningSpans : (fileName: string) => OutliningSpan[] ->fileName : string ->OutliningSpan : OutliningSpan - - getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[]; ->getTodoComments : (fileName: string, descriptors: TodoCommentDescriptor[]) => TodoComment[] ->fileName : string ->descriptors : TodoCommentDescriptor[] ->TodoCommentDescriptor : TodoCommentDescriptor ->TodoComment : TodoComment - - getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[]; ->getBraceMatchingAtPosition : (fileName: string, position: number) => TextSpan[] ->fileName : string ->position : number ->TextSpan : TextSpan - - getIndentationAtPosition(fileName: string, position: number, options: EditorOptions): number; ->getIndentationAtPosition : (fileName: string, position: number, options: EditorOptions) => number ->fileName : string ->position : number ->options : EditorOptions ->EditorOptions : EditorOptions - - getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions): TextChange[]; ->getFormattingEditsForRange : (fileName: string, start: number, end: number, options: FormatCodeOptions) => TextChange[] ->fileName : string ->start : number ->end : number ->options : FormatCodeOptions ->FormatCodeOptions : FormatCodeOptions ->TextChange : TextChange - - getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): TextChange[]; ->getFormattingEditsForDocument : (fileName: string, options: FormatCodeOptions) => TextChange[] ->fileName : string ->options : FormatCodeOptions ->FormatCodeOptions : FormatCodeOptions ->TextChange : TextChange - - getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextChange[]; ->getFormattingEditsAfterKeystroke : (fileName: string, position: number, key: string, options: FormatCodeOptions) => TextChange[] ->fileName : string ->position : number ->key : string ->options : FormatCodeOptions ->FormatCodeOptions : FormatCodeOptions ->TextChange : TextChange - - getEmitOutput(fileName: string): EmitOutput; ->getEmitOutput : (fileName: string) => EmitOutput ->fileName : string ->EmitOutput : EmitOutput - - getProgram(): Program; ->getProgram : () => Program ->Program : Program - - getSourceFile(fileName: string): SourceFile; ->getSourceFile : (fileName: string) => SourceFile ->fileName : string ->SourceFile : SourceFile - - dispose(): void; ->dispose : () => void - } - interface ClassifiedSpan { ->ClassifiedSpan : ClassifiedSpan - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - classificationType: string; ->classificationType : string - } - interface NavigationBarItem { ->NavigationBarItem : NavigationBarItem - - text: string; ->text : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - spans: TextSpan[]; ->spans : TextSpan[] ->TextSpan : TextSpan - - childItems: NavigationBarItem[]; ->childItems : NavigationBarItem[] ->NavigationBarItem : NavigationBarItem - - indent: number; ->indent : number - - bolded: boolean; ->bolded : boolean - - grayed: boolean; ->grayed : boolean - } - interface TodoCommentDescriptor { ->TodoCommentDescriptor : TodoCommentDescriptor - - text: string; ->text : string - - priority: number; ->priority : number - } - interface TodoComment { ->TodoComment : TodoComment - - descriptor: TodoCommentDescriptor; ->descriptor : TodoCommentDescriptor ->TodoCommentDescriptor : TodoCommentDescriptor - - message: string; ->message : string - - position: number; ->position : number - } - class TextChange { ->TextChange : TextChange - - span: TextSpan; ->span : TextSpan ->TextSpan : TextSpan - - newText: string; ->newText : string - } - interface RenameLocation { ->RenameLocation : RenameLocation - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - fileName: string; ->fileName : string - } - interface ReferenceEntry { ->ReferenceEntry : ReferenceEntry - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - fileName: string; ->fileName : string - - isWriteAccess: boolean; ->isWriteAccess : boolean - } - interface NavigateToItem { ->NavigateToItem : NavigateToItem - - name: string; ->name : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - matchKind: string; ->matchKind : string - - isCaseSensitive: boolean; ->isCaseSensitive : boolean - - fileName: string; ->fileName : string - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - containerName: string; ->containerName : string - - containerKind: string; ->containerKind : string - } - interface EditorOptions { ->EditorOptions : EditorOptions - - IndentSize: number; ->IndentSize : number - - TabSize: number; ->TabSize : number - - NewLineCharacter: string; ->NewLineCharacter : string - - ConvertTabsToSpaces: boolean; ->ConvertTabsToSpaces : boolean - } - interface FormatCodeOptions extends EditorOptions { ->FormatCodeOptions : FormatCodeOptions ->EditorOptions : EditorOptions - - InsertSpaceAfterCommaDelimiter: boolean; ->InsertSpaceAfterCommaDelimiter : boolean - - InsertSpaceAfterSemicolonInForStatements: boolean; ->InsertSpaceAfterSemicolonInForStatements : boolean - - InsertSpaceBeforeAndAfterBinaryOperators: boolean; ->InsertSpaceBeforeAndAfterBinaryOperators : boolean - - InsertSpaceAfterKeywordsInControlFlowStatements: boolean; ->InsertSpaceAfterKeywordsInControlFlowStatements : boolean - - InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; ->InsertSpaceAfterFunctionKeywordForAnonymousFunctions : boolean - - InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; ->InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis : boolean - - PlaceOpenBraceOnNewLineForFunctions: boolean; ->PlaceOpenBraceOnNewLineForFunctions : boolean - - PlaceOpenBraceOnNewLineForControlBlocks: boolean; ->PlaceOpenBraceOnNewLineForControlBlocks : boolean - - [s: string]: boolean | number | string; ->s : string - } - interface DefinitionInfo { ->DefinitionInfo : DefinitionInfo - - fileName: string; ->fileName : string - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - kind: string; ->kind : string - - name: string; ->name : string - - containerKind: string; ->containerKind : string - - containerName: string; ->containerName : string - } - interface ReferencedSymbol { ->ReferencedSymbol : ReferencedSymbol - - definition: DefinitionInfo; ->definition : DefinitionInfo ->DefinitionInfo : DefinitionInfo - - references: ReferenceEntry[]; ->references : ReferenceEntry[] ->ReferenceEntry : ReferenceEntry - } - enum SymbolDisplayPartKind { ->SymbolDisplayPartKind : SymbolDisplayPartKind - - aliasName = 0, ->aliasName : SymbolDisplayPartKind - - className = 1, ->className : SymbolDisplayPartKind - - enumName = 2, ->enumName : SymbolDisplayPartKind - - fieldName = 3, ->fieldName : SymbolDisplayPartKind - - interfaceName = 4, ->interfaceName : SymbolDisplayPartKind - - keyword = 5, ->keyword : SymbolDisplayPartKind - - lineBreak = 6, ->lineBreak : SymbolDisplayPartKind - - numericLiteral = 7, ->numericLiteral : SymbolDisplayPartKind - - stringLiteral = 8, ->stringLiteral : SymbolDisplayPartKind - - localName = 9, ->localName : SymbolDisplayPartKind - - methodName = 10, ->methodName : SymbolDisplayPartKind - - moduleName = 11, ->moduleName : SymbolDisplayPartKind - - operator = 12, ->operator : SymbolDisplayPartKind - - parameterName = 13, ->parameterName : SymbolDisplayPartKind - - propertyName = 14, ->propertyName : SymbolDisplayPartKind - - punctuation = 15, ->punctuation : SymbolDisplayPartKind - - space = 16, ->space : SymbolDisplayPartKind - - text = 17, ->text : SymbolDisplayPartKind - - typeParameterName = 18, ->typeParameterName : SymbolDisplayPartKind - - enumMemberName = 19, ->enumMemberName : SymbolDisplayPartKind - - functionName = 20, ->functionName : SymbolDisplayPartKind - - regularExpressionLiteral = 21, ->regularExpressionLiteral : SymbolDisplayPartKind - } - interface SymbolDisplayPart { ->SymbolDisplayPart : SymbolDisplayPart - - text: string; ->text : string - - kind: string; ->kind : string - } - interface QuickInfo { ->QuickInfo : QuickInfo - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - displayParts: SymbolDisplayPart[]; ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface RenameInfo { ->RenameInfo : RenameInfo - - canRename: boolean; ->canRename : boolean - - localizedErrorMessage: string; ->localizedErrorMessage : string - - displayName: string; ->displayName : string - - fullDisplayName: string; ->fullDisplayName : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - triggerSpan: TextSpan; ->triggerSpan : TextSpan ->TextSpan : TextSpan - } - interface SignatureHelpParameter { ->SignatureHelpParameter : SignatureHelpParameter - - name: string; ->name : string - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - displayParts: SymbolDisplayPart[]; ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - isOptional: boolean; ->isOptional : boolean - } - /** - * Represents a single signature to show in signature help. - * The id is used for subsequent calls into the language service to ask questions about the - * signature help item in the context of any documents that have been updated. i.e. after - * an edit has happened, while signature help is still active, the host can ask important - * questions like 'what parameter is the user currently contained within?'. - */ - interface SignatureHelpItem { ->SignatureHelpItem : SignatureHelpItem - - isVariadic: boolean; ->isVariadic : boolean - - prefixDisplayParts: SymbolDisplayPart[]; ->prefixDisplayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - suffixDisplayParts: SymbolDisplayPart[]; ->suffixDisplayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - separatorDisplayParts: SymbolDisplayPart[]; ->separatorDisplayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - parameters: SignatureHelpParameter[]; ->parameters : SignatureHelpParameter[] ->SignatureHelpParameter : SignatureHelpParameter - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - /** - * Represents a set of signature help items, and the preferred item that should be selected. - */ - interface SignatureHelpItems { ->SignatureHelpItems : SignatureHelpItems - - items: SignatureHelpItem[]; ->items : SignatureHelpItem[] ->SignatureHelpItem : SignatureHelpItem - - applicableSpan: TextSpan; ->applicableSpan : TextSpan ->TextSpan : TextSpan - - selectedItemIndex: number; ->selectedItemIndex : number - - argumentIndex: number; ->argumentIndex : number - - argumentCount: number; ->argumentCount : number - } - interface CompletionInfo { ->CompletionInfo : CompletionInfo - - isMemberCompletion: boolean; ->isMemberCompletion : boolean - - isNewIdentifierLocation: boolean; ->isNewIdentifierLocation : boolean - - entries: CompletionEntry[]; ->entries : CompletionEntry[] ->CompletionEntry : CompletionEntry - } - interface CompletionEntry { ->CompletionEntry : CompletionEntry - - name: string; ->name : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - } - interface CompletionEntryDetails { ->CompletionEntryDetails : CompletionEntryDetails - - name: string; ->name : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - displayParts: SymbolDisplayPart[]; ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface OutliningSpan { ->OutliningSpan : OutliningSpan - - /** The span of the document to actually collapse. */ - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - /** The span of the document to display when the user hovers over the collapsed span. */ - hintSpan: TextSpan; ->hintSpan : TextSpan ->TextSpan : TextSpan - - /** The text to display in the editor for the collapsed region. */ - bannerText: string; ->bannerText : string - - /** - * Whether or not this region should be automatically collapsed when - * the 'Collapse to Definitions' command is invoked. - */ - autoCollapse: boolean; ->autoCollapse : boolean - } - interface EmitOutput { ->EmitOutput : EmitOutput - - outputFiles: OutputFile[]; ->outputFiles : OutputFile[] ->OutputFile : OutputFile - - emitSkipped: boolean; ->emitSkipped : boolean - } - const enum OutputFileType { ->OutputFileType : OutputFileType - - JavaScript = 0, ->JavaScript : OutputFileType - - SourceMap = 1, ->SourceMap : OutputFileType - - Declaration = 2, ->Declaration : OutputFileType - } - interface OutputFile { ->OutputFile : OutputFile - - name: string; ->name : string - - writeByteOrderMark: boolean; ->writeByteOrderMark : boolean - - text: string; ->text : string - } - const enum EndOfLineState { ->EndOfLineState : EndOfLineState - - Start = 0, ->Start : EndOfLineState - - InMultiLineCommentTrivia = 1, ->InMultiLineCommentTrivia : EndOfLineState - - InSingleQuoteStringLiteral = 2, ->InSingleQuoteStringLiteral : EndOfLineState - - InDoubleQuoteStringLiteral = 3, ->InDoubleQuoteStringLiteral : EndOfLineState - - InTemplateHeadOrNoSubstitutionTemplate = 4, ->InTemplateHeadOrNoSubstitutionTemplate : EndOfLineState - - InTemplateMiddleOrTail = 5, ->InTemplateMiddleOrTail : EndOfLineState - - InTemplateSubstitutionPosition = 6, ->InTemplateSubstitutionPosition : EndOfLineState - } - enum TokenClass { ->TokenClass : TokenClass - - Punctuation = 0, ->Punctuation : TokenClass - - Keyword = 1, ->Keyword : TokenClass - - Operator = 2, ->Operator : TokenClass - - Comment = 3, ->Comment : TokenClass - - Whitespace = 4, ->Whitespace : TokenClass - - Identifier = 5, ->Identifier : TokenClass - - NumberLiteral = 6, ->NumberLiteral : TokenClass - - StringLiteral = 7, ->StringLiteral : TokenClass - - RegExpLiteral = 8, ->RegExpLiteral : TokenClass - } - interface ClassificationResult { ->ClassificationResult : ClassificationResult - - finalLexState: EndOfLineState; ->finalLexState : EndOfLineState ->EndOfLineState : EndOfLineState - - entries: ClassificationInfo[]; ->entries : ClassificationInfo[] ->ClassificationInfo : ClassificationInfo - } - interface ClassificationInfo { ->ClassificationInfo : ClassificationInfo - - length: number; ->length : number - - classification: TokenClass; ->classification : TokenClass ->TokenClass : TokenClass - } - interface Classifier { ->Classifier : Classifier - - /** - * Gives lexical classifications of tokens on a line without any syntactic context. - * For instance, a token consisting of the text 'string' can be either an identifier - * named 'string' or the keyword 'string', however, because this classifier is not aware, - * it relies on certain heuristics to give acceptable results. For classifications where - * speed trumps accuracy, this function is preferable; however, for true accuracy, the - * syntactic classifier is ideal. In fact, in certain editing scenarios, combining the - * lexical, syntactic, and semantic classifiers may issue the best user experience. - * - * @param text The text of a line to classify. - * @param lexState The state of the lexical classifier at the end of the previous line. - * @param syntacticClassifierAbsent Whether the client is *not* using a syntactic classifier. - * If there is no syntactic classifier (syntacticClassifierAbsent=true), - * certain heuristics may be used in its place; however, if there is a - * syntactic classifier (syntacticClassifierAbsent=false), certain - * classifications which may be incorrectly categorized will be given - * back as Identifiers in order to allow the syntactic classifier to - * subsume the classification. - */ - getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult; ->getClassificationsForLine : (text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean) => ClassificationResult ->text : string ->lexState : EndOfLineState ->EndOfLineState : EndOfLineState ->syntacticClassifierAbsent : boolean ->ClassificationResult : ClassificationResult - } - /** - * The document registry represents a store of SourceFile objects that can be shared between - * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) - * of files in the context. - * SourceFile objects account for most of the memory usage by the language service. Sharing - * the same DocumentRegistry instance between different instances of LanguageService allow - * for more efficient memory utilization since all projects will share at least the library - * file (lib.d.ts). - * - * A more advanced use of the document registry is to serialize sourceFile objects to disk - * and re-hydrate them when needed. - * - * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it - * to all subsequent createLanguageService calls. - */ - interface DocumentRegistry { ->DocumentRegistry : DocumentRegistry - - /** - * Request a stored SourceFile with a given fileName and compilationSettings. - * The first call to acquire will call createLanguageServiceSourceFile to generate - * the SourceFile if was not found in the registry. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @parm scriptSnapshot Text of the file. Only used if the file was not found - * in the registry and a new one was created. - * @parm version Current version of the file. Only used if the file was not found - * in the registry and a new one was created. - */ - acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; ->acquireDocument : (fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string) => SourceFile ->fileName : string ->compilationSettings : CompilerOptions ->CompilerOptions : CompilerOptions ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->version : string ->SourceFile : SourceFile - - /** - * Request an updated version of an already existing SourceFile with a given fileName - * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile - * to get an updated SourceFile. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @param scriptSnapshot Text of the file. - * @param version Current version of the file. - */ - updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; ->updateDocument : (fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string) => SourceFile ->fileName : string ->compilationSettings : CompilerOptions ->CompilerOptions : CompilerOptions ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->version : string ->SourceFile : SourceFile - - /** - * Informs the DocumentRegistry that a file is not needed any longer. - * - * Note: It is not allowed to call release on a SourceFile that was not acquired from - * this registry originally. - * - * @param fileName The name of the file to be released - * @param compilationSettings The compilation settings used to acquire the file - */ - releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; ->releaseDocument : (fileName: string, compilationSettings: CompilerOptions) => void ->fileName : string ->compilationSettings : CompilerOptions ->CompilerOptions : CompilerOptions - } - class ScriptElementKind { ->ScriptElementKind : ScriptElementKind - - static unknown: string; ->unknown : string - - static keyword: string; ->keyword : string - - static scriptElement: string; ->scriptElement : string - - static moduleElement: string; ->moduleElement : string - - static classElement: string; ->classElement : string - - static interfaceElement: string; ->interfaceElement : string - - static typeElement: string; ->typeElement : string - - static enumElement: string; ->enumElement : string - - static variableElement: string; ->variableElement : string - - static localVariableElement: string; ->localVariableElement : string - - static functionElement: string; ->functionElement : string - - static localFunctionElement: string; ->localFunctionElement : string - - static memberFunctionElement: string; ->memberFunctionElement : string - - static memberGetAccessorElement: string; ->memberGetAccessorElement : string - - static memberSetAccessorElement: string; ->memberSetAccessorElement : string - - static memberVariableElement: string; ->memberVariableElement : string - - static constructorImplementationElement: string; ->constructorImplementationElement : string - - static callSignatureElement: string; ->callSignatureElement : string - - static indexSignatureElement: string; ->indexSignatureElement : string - - static constructSignatureElement: string; ->constructSignatureElement : string - - static parameterElement: string; ->parameterElement : string - - static typeParameterElement: string; ->typeParameterElement : string - - static primitiveType: string; ->primitiveType : string - - static label: string; ->label : string - - static alias: string; ->alias : string - - static constElement: string; ->constElement : string - - static letElement: string; ->letElement : string - } - class ScriptElementKindModifier { ->ScriptElementKindModifier : ScriptElementKindModifier - - static none: string; ->none : string - - static publicMemberModifier: string; ->publicMemberModifier : string - - static privateMemberModifier: string; ->privateMemberModifier : string - - static protectedMemberModifier: string; ->protectedMemberModifier : string - - static exportedModifier: string; ->exportedModifier : string - - static ambientModifier: string; ->ambientModifier : string - - static staticModifier: string; ->staticModifier : string - } - class ClassificationTypeNames { ->ClassificationTypeNames : ClassificationTypeNames - - static comment: string; ->comment : string - - static identifier: string; ->identifier : string - - static keyword: string; ->keyword : string - - static numericLiteral: string; ->numericLiteral : string - - static operator: string; ->operator : string - - static stringLiteral: string; ->stringLiteral : string - - static whiteSpace: string; ->whiteSpace : string - - static text: string; ->text : string - - static punctuation: string; ->punctuation : string - - static className: string; ->className : string - - static enumName: string; ->enumName : string - - static interfaceName: string; ->interfaceName : string - - static moduleName: string; ->moduleName : string - - static typeParameterName: string; ->typeParameterName : string - - static typeAlias: string; ->typeAlias : string - } - interface DisplayPartsSymbolWriter extends SymbolWriter { ->DisplayPartsSymbolWriter : DisplayPartsSymbolWriter ->SymbolWriter : SymbolWriter - - displayParts(): SymbolDisplayPart[]; ->displayParts : () => SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - function displayPartsToString(displayParts: SymbolDisplayPart[]): string; ->displayPartsToString : (displayParts: SymbolDisplayPart[]) => string ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - function getDefaultCompilerOptions(): CompilerOptions; ->getDefaultCompilerOptions : () => CompilerOptions ->CompilerOptions : CompilerOptions - - class OperationCanceledException { ->OperationCanceledException : OperationCanceledException - } - class CancellationTokenObject { ->CancellationTokenObject : CancellationTokenObject - - private cancellationToken; ->cancellationToken : any - - static None: CancellationTokenObject; ->None : CancellationTokenObject ->CancellationTokenObject : CancellationTokenObject - - constructor(cancellationToken: CancellationToken); ->cancellationToken : CancellationToken ->CancellationToken : CancellationToken - - isCancellationRequested(): boolean; ->isCancellationRequested : () => boolean - - throwIfCancellationRequested(): void; ->throwIfCancellationRequested : () => void - } - function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile; ->createLanguageServiceSourceFile : (fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean) => SourceFile ->fileName : string ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->scriptTarget : ScriptTarget ->ScriptTarget : ScriptTarget ->version : string ->setNodeParents : boolean ->SourceFile : SourceFile - - let disableIncrementalParsing: boolean; ->disableIncrementalParsing : boolean - - function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; ->updateLanguageServiceSourceFile : (sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean) => SourceFile ->sourceFile : SourceFile ->SourceFile : SourceFile ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->version : string ->textChangeRange : TextChangeRange ->TextChangeRange : TextChangeRange ->aggressiveChecks : boolean ->SourceFile : SourceFile - - function createDocumentRegistry(): DocumentRegistry; ->createDocumentRegistry : () => DocumentRegistry ->DocumentRegistry : DocumentRegistry - - function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo; ->preProcessFile : (sourceText: string, readImportFiles?: boolean) => PreProcessedFileInfo ->sourceText : string ->readImportFiles : boolean ->PreProcessedFileInfo : PreProcessedFileInfo - - function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; ->createLanguageService : (host: LanguageServiceHost, documentRegistry?: DocumentRegistry) => LanguageService ->host : LanguageServiceHost ->LanguageServiceHost : LanguageServiceHost ->documentRegistry : DocumentRegistry ->DocumentRegistry : DocumentRegistry ->LanguageService : LanguageService - - function createClassifier(): Classifier; ->createClassifier : () => Classifier ->Classifier : Classifier - - /** - * Get the path of the default library file (lib.d.ts) as distributed with the typescript - * node package. - * The functionality is not supported if the ts module is consumed outside of a node module. - */ - function getDefaultLibFilePath(options: CompilerOptions): string; ->getDefaultLibFilePath : (options: CompilerOptions) => string ->options : CompilerOptions ->CompilerOptions : CompilerOptions -} +>result : string diff --git a/tests/baselines/reference/APISample_watcher.js b/tests/baselines/reference/APISample_watcher.js index 34503a0d81a..e2ab4e135dd 100644 --- a/tests/baselines/reference/APISample_watcher.js +++ b/tests/baselines/reference/APISample_watcher.js @@ -1,5 +1,3 @@ -//// [tests/cases/compiler/APISample_watcher.ts] //// - //// [APISample_watcher.ts] /* @@ -13,10 +11,10 @@ declare var console: any; declare var fs: any; declare var path: any; -import ts = require("typescript"); +import * as ts from "typescript"; function watch(rootFileNames: string[], options: ts.CompilerOptions) { - var files: ts.Map<{ version: number }> = {}; + const files: ts.Map<{ version: number }> = {}; // initialize the list of files rootFileNames.forEach(fileName => { @@ -24,7 +22,7 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { }); // Create the language service host to allow the LS to communicate with the host - var servicesHost: ts.LanguageServiceHost = { + const servicesHost: ts.LanguageServiceHost = { getScriptFileNames: () => rootFileNames, getScriptVersion: (fileName) => files[fileName] && files[fileName].version.toString(), getScriptSnapshot: (fileName) => { @@ -40,7 +38,7 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { }; // Create the language service files - var services = ts.createLanguageService(servicesHost, ts.createDocumentRegistry()) + const services = ts.createLanguageService(servicesHost, ts.createDocumentRegistry()) // Now let's watch the files rootFileNames.forEach(fileName => { @@ -65,7 +63,7 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { }); function emitFile(fileName: string) { - var output = services.getEmitOutput(fileName); + let output = services.getEmitOutput(fileName); if (!output.emitSkipped) { console.log(`Emitting ${fileName}`); @@ -81,1993 +79,29 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { } function logErrors(fileName: string) { - var allDiagnostics = services.getCompilerOptionsDiagnostics() + let allDiagnostics = services.getCompilerOptionsDiagnostics() .concat(services.getSyntacticDiagnostics(fileName)) .concat(services.getSemanticDiagnostics(fileName)); allDiagnostics.forEach(diagnostic => { + let message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"); if (diagnostic.file) { - var lineChar = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); - console.log(` Error ${diagnostic.file.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n")}`); + let { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); + console.log(` Error ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); } else { - console.log(` Error: ${diagnostic.messageText}`); + console.log(` Error: ${message}`); } }); } } // Initialize files constituting the program as all .ts files in the current directory -var currentDirectoryFiles = fs.readdirSync(process.cwd()). +const currentDirectoryFiles = fs.readdirSync(process.cwd()). filter(fileName=> fileName.length >= 3 && fileName.substr(fileName.length - 3, 3) === ".ts"); // Start the watcher watch(currentDirectoryFiles, { module: ts.ModuleKind.CommonJS }); -//// [typescript.d.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 http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -declare module "typescript" { - interface Map { - [index: string]: T; - } - interface TextRange { - pos: number; - end: number; - } - const enum SyntaxKind { - Unknown = 0, - EndOfFileToken = 1, - SingleLineCommentTrivia = 2, - MultiLineCommentTrivia = 3, - NewLineTrivia = 4, - WhitespaceTrivia = 5, - ConflictMarkerTrivia = 6, - NumericLiteral = 7, - StringLiteral = 8, - RegularExpressionLiteral = 9, - NoSubstitutionTemplateLiteral = 10, - TemplateHead = 11, - TemplateMiddle = 12, - TemplateTail = 13, - OpenBraceToken = 14, - CloseBraceToken = 15, - OpenParenToken = 16, - CloseParenToken = 17, - OpenBracketToken = 18, - CloseBracketToken = 19, - DotToken = 20, - DotDotDotToken = 21, - SemicolonToken = 22, - CommaToken = 23, - LessThanToken = 24, - GreaterThanToken = 25, - LessThanEqualsToken = 26, - GreaterThanEqualsToken = 27, - EqualsEqualsToken = 28, - ExclamationEqualsToken = 29, - EqualsEqualsEqualsToken = 30, - ExclamationEqualsEqualsToken = 31, - EqualsGreaterThanToken = 32, - PlusToken = 33, - MinusToken = 34, - AsteriskToken = 35, - SlashToken = 36, - PercentToken = 37, - PlusPlusToken = 38, - MinusMinusToken = 39, - LessThanLessThanToken = 40, - GreaterThanGreaterThanToken = 41, - GreaterThanGreaterThanGreaterThanToken = 42, - AmpersandToken = 43, - BarToken = 44, - CaretToken = 45, - ExclamationToken = 46, - TildeToken = 47, - AmpersandAmpersandToken = 48, - BarBarToken = 49, - QuestionToken = 50, - ColonToken = 51, - AtToken = 52, - EqualsToken = 53, - PlusEqualsToken = 54, - MinusEqualsToken = 55, - AsteriskEqualsToken = 56, - SlashEqualsToken = 57, - PercentEqualsToken = 58, - LessThanLessThanEqualsToken = 59, - GreaterThanGreaterThanEqualsToken = 60, - GreaterThanGreaterThanGreaterThanEqualsToken = 61, - AmpersandEqualsToken = 62, - BarEqualsToken = 63, - CaretEqualsToken = 64, - Identifier = 65, - BreakKeyword = 66, - CaseKeyword = 67, - CatchKeyword = 68, - ClassKeyword = 69, - ConstKeyword = 70, - ContinueKeyword = 71, - DebuggerKeyword = 72, - DefaultKeyword = 73, - DeleteKeyword = 74, - DoKeyword = 75, - ElseKeyword = 76, - EnumKeyword = 77, - ExportKeyword = 78, - ExtendsKeyword = 79, - FalseKeyword = 80, - FinallyKeyword = 81, - ForKeyword = 82, - FunctionKeyword = 83, - IfKeyword = 84, - ImportKeyword = 85, - InKeyword = 86, - InstanceOfKeyword = 87, - NewKeyword = 88, - NullKeyword = 89, - ReturnKeyword = 90, - SuperKeyword = 91, - SwitchKeyword = 92, - ThisKeyword = 93, - ThrowKeyword = 94, - TrueKeyword = 95, - TryKeyword = 96, - TypeOfKeyword = 97, - VarKeyword = 98, - VoidKeyword = 99, - WhileKeyword = 100, - WithKeyword = 101, - AsKeyword = 102, - ImplementsKeyword = 103, - InterfaceKeyword = 104, - LetKeyword = 105, - PackageKeyword = 106, - PrivateKeyword = 107, - ProtectedKeyword = 108, - PublicKeyword = 109, - StaticKeyword = 110, - YieldKeyword = 111, - AnyKeyword = 112, - BooleanKeyword = 113, - ConstructorKeyword = 114, - 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, - OmittedExpression = 174, - TemplateSpan = 175, - Block = 176, - VariableStatement = 177, - EmptyStatement = 178, - ExpressionStatement = 179, - IfStatement = 180, - DoStatement = 181, - WhileStatement = 182, - ForStatement = 183, - ForInStatement = 184, - ForOfStatement = 185, - ContinueStatement = 186, - BreakStatement = 187, - ReturnStatement = 188, - WithStatement = 189, - SwitchStatement = 190, - LabeledStatement = 191, - ThrowStatement = 192, - TryStatement = 193, - DebuggerStatement = 194, - VariableDeclaration = 195, - VariableDeclarationList = 196, - FunctionDeclaration = 197, - ClassDeclaration = 198, - InterfaceDeclaration = 199, - TypeAliasDeclaration = 200, - EnumDeclaration = 201, - ModuleDeclaration = 202, - ModuleBlock = 203, - CaseBlock = 204, - ImportEqualsDeclaration = 205, - ImportDeclaration = 206, - ImportClause = 207, - NamespaceImport = 208, - NamedImports = 209, - ImportSpecifier = 210, - ExportAssignment = 211, - ExportDeclaration = 212, - NamedExports = 213, - ExportSpecifier = 214, - MissingDeclaration = 215, - ExternalModuleReference = 216, - CaseClause = 217, - DefaultClause = 218, - HeritageClause = 219, - CatchClause = 220, - PropertyAssignment = 221, - ShorthandPropertyAssignment = 222, - EnumMember = 223, - SourceFile = 224, - SyntaxList = 225, - Count = 226, - FirstAssignment = 53, - LastAssignment = 64, - FirstReservedWord = 66, - LastReservedWord = 101, - FirstKeyword = 66, - LastKeyword = 125, - FirstFutureReservedWord = 103, - LastFutureReservedWord = 111, - FirstTypeNode = 141, - LastTypeNode = 149, - FirstPunctuation = 14, - LastPunctuation = 64, - FirstToken = 0, - LastToken = 125, - FirstTriviaToken = 2, - LastTriviaToken = 6, - FirstLiteralToken = 7, - LastLiteralToken = 10, - FirstTemplateToken = 10, - LastTemplateToken = 13, - FirstBinaryOperator = 24, - LastBinaryOperator = 64, - FirstNode = 126, - } - const enum NodeFlags { - Export = 1, - Ambient = 2, - Public = 16, - Private = 32, - Protected = 64, - Static = 128, - Default = 256, - MultiLine = 512, - Synthetic = 1024, - DeclarationFile = 2048, - Let = 4096, - Const = 8192, - OctalLiteral = 16384, - ExportContext = 32768, - Modifier = 499, - AccessibilityModifier = 112, - BlockScoped = 12288, - } - const enum ParserContextFlags { - StrictMode = 1, - DisallowIn = 2, - Yield = 4, - GeneratorParameter = 8, - Decorator = 16, - ThisNodeHasError = 32, - ParserGeneratedFlags = 63, - ThisNodeOrAnySubNodesHasError = 64, - HasAggregatedChildData = 128, - } - const enum RelationComparisonResult { - Succeeded = 1, - Failed = 2, - FailedAndReported = 3, - } - interface Node extends TextRange { - kind: SyntaxKind; - flags: NodeFlags; - parserContextFlags?: ParserContextFlags; - decorators?: NodeArray; - modifiers?: ModifiersArray; - id?: number; - parent?: Node; - symbol?: Symbol; - locals?: SymbolTable; - nextContainer?: Node; - localSymbol?: Symbol; - } - interface NodeArray extends Array, TextRange { - hasTrailingComma?: boolean; - } - interface ModifiersArray extends NodeArray { - flags: number; - } - interface Identifier extends PrimaryExpression { - text: string; - } - interface QualifiedName extends Node { - left: EntityName; - right: Identifier; - } - type EntityName = Identifier | QualifiedName; - type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName | BindingPattern; - interface Declaration extends Node { - _declarationBrand: any; - name?: DeclarationName; - } - interface ComputedPropertyName extends Node { - expression: Expression; - } - interface Decorator extends Node { - expression: LeftHandSideExpression; - } - interface TypeParameterDeclaration extends Declaration { - name: Identifier; - constraint?: TypeNode; - expression?: Expression; - } - interface SignatureDeclaration extends Declaration { - typeParameters?: NodeArray; - parameters: NodeArray; - type?: TypeNode; - } - interface VariableDeclaration extends Declaration { - parent?: VariableDeclarationList; - name: Identifier | BindingPattern; - type?: TypeNode; - initializer?: Expression; - } - interface VariableDeclarationList extends Node { - declarations: NodeArray; - } - interface ParameterDeclaration extends Declaration { - dotDotDotToken?: Node; - name: Identifier | BindingPattern; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface BindingElement extends Declaration { - propertyName?: Identifier; - dotDotDotToken?: Node; - name: Identifier | BindingPattern; - initializer?: Expression; - } - interface PropertyDeclaration extends Declaration, ClassElement { - name: DeclarationName; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface ObjectLiteralElement extends Declaration { - _objectLiteralBrandBrand: any; - } - interface PropertyAssignment extends ObjectLiteralElement { - _propertyAssignmentBrand: any; - name: DeclarationName; - questionToken?: Node; - initializer: Expression; - } - interface ShorthandPropertyAssignment extends ObjectLiteralElement { - name: Identifier; - questionToken?: Node; - } - interface VariableLikeDeclaration extends Declaration { - propertyName?: Identifier; - dotDotDotToken?: Node; - name: DeclarationName; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface BindingPattern extends Node { - elements: NodeArray; - } - /** - * Several node kinds share function-like features such as a signature, - * a name, and a body. These nodes should extend FunctionLikeDeclaration. - * Examples: - * FunctionDeclaration - * MethodDeclaration - * AccessorDeclaration - */ - interface FunctionLikeDeclaration extends SignatureDeclaration { - _functionLikeDeclarationBrand: any; - asteriskToken?: Node; - questionToken?: Node; - body?: Block | Expression; - } - interface FunctionDeclaration extends FunctionLikeDeclaration, Statement { - name?: Identifier; - body?: Block; - } - interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { - body?: Block; - } - interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { - body?: Block; - } - interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { - _accessorDeclarationBrand: any; - body: Block; - } - interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement { - _indexSignatureDeclarationBrand: any; - } - interface TypeNode extends Node { - _typeNodeBrand: any; - } - interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration { - _functionOrConstructorTypeNodeBrand: any; - } - interface TypeReferenceNode extends TypeNode { - typeName: EntityName; - typeArguments?: NodeArray; - } - interface TypeQueryNode extends TypeNode { - exprName: EntityName; - } - interface TypeLiteralNode extends TypeNode, Declaration { - members: NodeArray; - } - interface ArrayTypeNode extends TypeNode { - elementType: TypeNode; - } - interface TupleTypeNode extends TypeNode { - elementTypes: NodeArray; - } - interface UnionTypeNode extends TypeNode { - types: NodeArray; - } - interface ParenthesizedTypeNode extends TypeNode { - type: TypeNode; - } - interface StringLiteralTypeNode extends LiteralExpression, TypeNode { - } - interface Expression extends Node { - _expressionBrand: any; - contextualType?: Type; - } - interface UnaryExpression extends Expression { - _unaryExpressionBrand: any; - } - interface PrefixUnaryExpression extends UnaryExpression { - operator: SyntaxKind; - operand: UnaryExpression; - } - interface PostfixUnaryExpression extends PostfixExpression { - operand: LeftHandSideExpression; - operator: SyntaxKind; - } - interface PostfixExpression extends UnaryExpression { - _postfixExpressionBrand: any; - } - interface LeftHandSideExpression extends PostfixExpression { - _leftHandSideExpressionBrand: any; - } - interface MemberExpression extends LeftHandSideExpression { - _memberExpressionBrand: any; - } - interface PrimaryExpression extends MemberExpression { - _primaryExpressionBrand: any; - } - interface DeleteExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface TypeOfExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface VoidExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface YieldExpression extends Expression { - asteriskToken?: Node; - expression: Expression; - } - interface BinaryExpression extends Expression { - left: Expression; - operatorToken: Node; - right: Expression; - } - interface ConditionalExpression extends Expression { - condition: Expression; - questionToken: Node; - whenTrue: Expression; - colonToken: Node; - whenFalse: Expression; - } - interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration { - name?: Identifier; - body: Block | Expression; - } - interface ArrowFunction extends Expression, FunctionLikeDeclaration { - equalsGreaterThanToken: Node; - } - interface LiteralExpression extends PrimaryExpression { - text: string; - isUnterminated?: boolean; - hasExtendedUnicodeEscape?: boolean; - } - interface StringLiteralExpression extends LiteralExpression { - _stringLiteralExpressionBrand: any; - } - interface TemplateExpression extends PrimaryExpression { - head: LiteralExpression; - templateSpans: NodeArray; - } - interface TemplateSpan extends Node { - expression: Expression; - literal: LiteralExpression; - } - interface ParenthesizedExpression extends PrimaryExpression { - expression: Expression; - } - interface ArrayLiteralExpression extends PrimaryExpression { - elements: NodeArray; - } - interface SpreadElementExpression extends Expression { - expression: Expression; - } - interface ObjectLiteralExpression extends PrimaryExpression, Declaration { - properties: NodeArray; - } - interface PropertyAccessExpression extends MemberExpression { - expression: LeftHandSideExpression; - dotToken: Node; - name: Identifier; - } - interface ElementAccessExpression extends MemberExpression { - expression: LeftHandSideExpression; - argumentExpression?: Expression; - } - interface CallExpression extends LeftHandSideExpression { - expression: LeftHandSideExpression; - typeArguments?: NodeArray; - arguments: NodeArray; - } - interface NewExpression extends CallExpression, PrimaryExpression { - } - interface TaggedTemplateExpression extends MemberExpression { - tag: LeftHandSideExpression; - template: LiteralExpression | TemplateExpression; - } - type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression; - interface TypeAssertion extends UnaryExpression { - type: TypeNode; - expression: UnaryExpression; - } - interface Statement extends Node, ModuleElement { - _statementBrand: any; - } - interface Block extends Statement { - statements: NodeArray; - } - interface VariableStatement extends Statement { - declarationList: VariableDeclarationList; - } - interface ExpressionStatement extends Statement { - expression: Expression; - } - interface IfStatement extends Statement { - expression: Expression; - thenStatement: Statement; - elseStatement?: Statement; - } - interface IterationStatement extends Statement { - statement: Statement; - } - interface DoStatement extends IterationStatement { - expression: Expression; - } - interface WhileStatement extends IterationStatement { - expression: Expression; - } - interface ForStatement extends IterationStatement { - initializer?: VariableDeclarationList | Expression; - condition?: Expression; - iterator?: Expression; - } - interface ForInStatement extends IterationStatement { - initializer: VariableDeclarationList | Expression; - expression: Expression; - } - interface ForOfStatement extends IterationStatement { - initializer: VariableDeclarationList | Expression; - expression: Expression; - } - interface BreakOrContinueStatement extends Statement { - label?: Identifier; - } - interface ReturnStatement extends Statement { - expression?: Expression; - } - interface WithStatement extends Statement { - expression: Expression; - statement: Statement; - } - interface SwitchStatement extends Statement { - expression: Expression; - caseBlock: CaseBlock; - } - interface CaseBlock extends Node { - clauses: NodeArray; - } - interface CaseClause extends Node { - expression?: Expression; - statements: NodeArray; - } - interface DefaultClause extends Node { - statements: NodeArray; - } - type CaseOrDefaultClause = CaseClause | DefaultClause; - interface LabeledStatement extends Statement { - label: Identifier; - statement: Statement; - } - interface ThrowStatement extends Statement { - expression: Expression; - } - interface TryStatement extends Statement { - tryBlock: Block; - catchClause?: CatchClause; - finallyBlock?: Block; - } - interface CatchClause extends Node { - variableDeclaration: VariableDeclaration; - block: Block; - } - interface ModuleElement extends Node { - _moduleElementBrand: any; - } - interface ClassDeclaration extends Declaration, ModuleElement { - name?: Identifier; - typeParameters?: NodeArray; - heritageClauses?: NodeArray; - members: NodeArray; - } - interface ClassElement extends Declaration { - _classElementBrand: any; - } - interface InterfaceDeclaration extends Declaration, ModuleElement { - name: Identifier; - typeParameters?: NodeArray; - heritageClauses?: NodeArray; - members: NodeArray; - } - interface HeritageClause extends Node { - token: SyntaxKind; - types?: NodeArray; - } - interface TypeAliasDeclaration extends Declaration, ModuleElement { - name: Identifier; - type: TypeNode; - } - interface EnumMember extends Declaration { - name: DeclarationName; - initializer?: Expression; - } - interface EnumDeclaration extends Declaration, ModuleElement { - name: Identifier; - members: NodeArray; - } - interface ModuleDeclaration extends Declaration, ModuleElement { - name: Identifier | LiteralExpression; - body: ModuleBlock | ModuleDeclaration; - } - interface ModuleBlock extends Node, ModuleElement { - statements: NodeArray; - } - interface ImportEqualsDeclaration extends Declaration, ModuleElement { - name: Identifier; - moduleReference: EntityName | ExternalModuleReference; - } - interface ExternalModuleReference extends Node { - expression?: Expression; - } - interface ImportDeclaration extends Statement, ModuleElement { - importClause?: ImportClause; - moduleSpecifier: Expression; - } - interface ImportClause extends Declaration { - name?: Identifier; - namedBindings?: NamespaceImport | NamedImports; - } - interface NamespaceImport extends Declaration { - name: Identifier; - } - interface ExportDeclaration extends Declaration, ModuleElement { - exportClause?: NamedExports; - moduleSpecifier?: Expression; - } - interface NamedImportsOrExports extends Node { - elements: NodeArray; - } - type NamedImports = NamedImportsOrExports; - type NamedExports = NamedImportsOrExports; - interface ImportOrExportSpecifier extends Declaration { - propertyName?: Identifier; - name: Identifier; - } - type ImportSpecifier = ImportOrExportSpecifier; - type ExportSpecifier = ImportOrExportSpecifier; - interface ExportAssignment extends Declaration, ModuleElement { - isExportEquals?: boolean; - expression?: Expression; - type?: TypeNode; - } - interface FileReference extends TextRange { - fileName: string; - } - interface CommentRange extends TextRange { - hasTrailingNewLine?: boolean; - } - interface SourceFile extends Declaration { - statements: NodeArray; - endOfFileToken: Node; - fileName: string; - text: string; - amdDependencies: { - path: string; - name: string; - }[]; - amdModuleName: string; - referencedFiles: FileReference[]; - hasNoDefaultLib: boolean; - externalModuleIndicator: Node; - languageVersion: ScriptTarget; - identifiers: Map; - } - interface ScriptReferenceHost { - getCompilerOptions(): CompilerOptions; - getSourceFile(fileName: string): SourceFile; - getCurrentDirectory(): string; - } - interface WriteFileCallback { - (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; - } - interface Program extends ScriptReferenceHost { - getSourceFiles(): SourceFile[]; - /** - * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then - * the JavaScript and declaration files will be produced for all the files in this program. - * If targetSourceFile is specified, then only the JavaScript and declaration for that - * specific file will be generated. - * - * If writeFile is not specified then the writeFile callback from the compiler host will be - * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter - * will be invoked when writing the JavaScript and declaration files. - */ - emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback): EmitResult; - getSyntacticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getGlobalDiagnostics(): Diagnostic[]; - getSemanticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getDeclarationDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getTypeChecker(): TypeChecker; - getCommonSourceDirectory(): string; - } - interface SourceMapSpan { - emittedLine: number; - emittedColumn: number; - sourceLine: number; - sourceColumn: number; - nameIndex?: number; - sourceIndex: number; - } - interface SourceMapData { - sourceMapFilePath: string; - jsSourceMappingURL: string; - sourceMapFile: string; - sourceMapSourceRoot: string; - sourceMapSources: string[]; - inputSourceFileNames: string[]; - sourceMapNames?: string[]; - sourceMapMappings: string; - sourceMapDecodedMappings: SourceMapSpan[]; - } - enum ExitStatus { - Success = 0, - DiagnosticsPresent_OutputsSkipped = 1, - DiagnosticsPresent_OutputsGenerated = 2, - } - interface EmitResult { - emitSkipped: boolean; - diagnostics: Diagnostic[]; - sourceMaps: SourceMapData[]; - } - interface TypeCheckerHost { - getCompilerOptions(): CompilerOptions; - getSourceFiles(): SourceFile[]; - getSourceFile(fileName: string): SourceFile; - } - interface TypeChecker { - getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; - getDeclaredTypeOfSymbol(symbol: Symbol): Type; - getPropertiesOfType(type: Type): Symbol[]; - getPropertyOfType(type: Type, propertyName: string): Symbol; - getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; - getIndexTypeOfType(type: Type, kind: IndexKind): Type; - getReturnTypeOfSignature(signature: Signature): Type; - getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; - getSymbolAtLocation(node: Node): Symbol; - getShorthandAssignmentValueSymbol(location: Node): Symbol; - getTypeAtLocation(node: Node): Type; - typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; - symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; - getSymbolDisplayBuilder(): SymbolDisplayBuilder; - getFullyQualifiedName(symbol: Symbol): string; - getAugmentedPropertiesOfType(type: Type): Symbol[]; - getRootSymbols(symbol: Symbol): Symbol[]; - getContextualType(node: Expression): Type; - getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature; - getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature; - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; - isUndefinedSymbol(symbol: Symbol): boolean; - isArgumentsSymbol(symbol: Symbol): boolean; - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; - isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; - getAliasedSymbol(symbol: Symbol): Symbol; - getExportsOfExternalModule(node: ImportDeclaration): Symbol[]; - } - interface SymbolDisplayBuilder { - buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; - buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags): void; - buildDisplayForParametersAndDelimiters(parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - } - interface SymbolWriter { - writeKeyword(text: string): void; - writeOperator(text: string): void; - writePunctuation(text: string): void; - writeSpace(text: string): void; - writeStringLiteral(text: string): void; - writeParameter(text: string): void; - writeSymbol(text: string, symbol: Symbol): void; - writeLine(): void; - increaseIndent(): void; - decreaseIndent(): void; - clear(): void; - trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; - } - const enum TypeFormatFlags { - None = 0, - WriteArrayAsGenericType = 1, - UseTypeOfFunction = 2, - NoTruncation = 4, - WriteArrowStyleSignature = 8, - WriteOwnNameForAnyLike = 16, - WriteTypeArgumentsOfSignature = 32, - InElementType = 64, - UseFullyQualifiedType = 128, - } - const enum SymbolFormatFlags { - None = 0, - WriteTypeParametersOrArguments = 1, - UseOnlyExternalAliasing = 2, - } - const enum SymbolAccessibility { - Accessible = 0, - NotAccessible = 1, - CannotBeNamed = 2, - } - type AnyImportSyntax = ImportDeclaration | ImportEqualsDeclaration; - interface SymbolVisibilityResult { - accessibility: SymbolAccessibility; - aliasesToMakeVisible?: AnyImportSyntax[]; - errorSymbolName?: string; - errorNode?: Node; - } - interface SymbolAccessiblityResult extends SymbolVisibilityResult { - errorModuleName?: string; - } - interface EmitResolver { - hasGlobalName(name: string): boolean; - getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string; - isValueAliasDeclaration(node: Node): boolean; - isReferencedAliasDeclaration(node: Node, checkChildren?: boolean): boolean; - isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; - getNodeCheckFlags(node: Node): NodeCheckFlags; - isDeclarationVisible(node: Declaration): boolean; - collectLinkedAliases(node: Identifier): Node[]; - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; - writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult; - isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult; - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; - resolvesToSomeValue(location: Node, name: string): boolean; - getBlockScopedVariableId(node: Identifier): number; - } - const enum SymbolFlags { - FunctionScopedVariable = 1, - BlockScopedVariable = 2, - Property = 4, - EnumMember = 8, - Function = 16, - Class = 32, - Interface = 64, - ConstEnum = 128, - RegularEnum = 256, - ValueModule = 512, - NamespaceModule = 1024, - TypeLiteral = 2048, - ObjectLiteral = 4096, - Method = 8192, - Constructor = 16384, - GetAccessor = 32768, - SetAccessor = 65536, - Signature = 131072, - TypeParameter = 262144, - TypeAlias = 524288, - ExportValue = 1048576, - ExportType = 2097152, - ExportNamespace = 4194304, - Alias = 8388608, - Instantiated = 16777216, - Merged = 33554432, - Transient = 67108864, - Prototype = 134217728, - UnionProperty = 268435456, - Optional = 536870912, - ExportStar = 1073741824, - Enum = 384, - Variable = 3, - Value = 107455, - Type = 793056, - Namespace = 1536, - Module = 1536, - Accessor = 98304, - FunctionScopedVariableExcludes = 107454, - BlockScopedVariableExcludes = 107455, - ParameterExcludes = 107455, - PropertyExcludes = 107455, - EnumMemberExcludes = 107455, - FunctionExcludes = 106927, - ClassExcludes = 899583, - InterfaceExcludes = 792992, - RegularEnumExcludes = 899327, - ConstEnumExcludes = 899967, - ValueModuleExcludes = 106639, - NamespaceModuleExcludes = 0, - MethodExcludes = 99263, - GetAccessorExcludes = 41919, - SetAccessorExcludes = 74687, - TypeParameterExcludes = 530912, - TypeAliasExcludes = 793056, - AliasExcludes = 8388608, - ModuleMember = 8914931, - ExportHasLocal = 944, - HasLocals = 255504, - HasExports = 1952, - HasMembers = 6240, - IsContainer = 262128, - PropertyOrAccessor = 98308, - Export = 7340032, - } - interface Symbol { - flags: SymbolFlags; - name: string; - id?: number; - mergeId?: number; - declarations?: Declaration[]; - parent?: Symbol; - members?: SymbolTable; - exports?: SymbolTable; - exportSymbol?: Symbol; - valueDeclaration?: Declaration; - constEnumOnlyModule?: boolean; - } - interface SymbolLinks { - target?: Symbol; - type?: Type; - declaredType?: Type; - mapper?: TypeMapper; - referenced?: boolean; - unionType?: UnionType; - resolvedExports?: SymbolTable; - exportsChecked?: boolean; - } - interface TransientSymbol extends Symbol, SymbolLinks { - } - interface SymbolTable { - [index: string]: Symbol; - } - const enum NodeCheckFlags { - TypeChecked = 1, - LexicalThis = 2, - CaptureThis = 4, - EmitExtends = 8, - SuperInstance = 16, - SuperStatic = 32, - ContextChecked = 64, - EnumValuesComputed = 128, - BlockScopedBindingInLoop = 256, - EmitDecorate = 512, - } - interface NodeLinks { - resolvedType?: Type; - resolvedSignature?: Signature; - resolvedSymbol?: Symbol; - flags?: NodeCheckFlags; - enumMemberValue?: number; - isIllegalTypeReferenceInConstraint?: boolean; - isVisible?: boolean; - generatedName?: string; - generatedNames?: Map; - assignmentChecks?: Map; - hasReportedStatementInAmbientContext?: boolean; - importOnRightSide?: Symbol; - } - const enum TypeFlags { - Any = 1, - String = 2, - Number = 4, - Boolean = 8, - Void = 16, - Undefined = 32, - Null = 64, - Enum = 128, - StringLiteral = 256, - TypeParameter = 512, - Class = 1024, - Interface = 2048, - Reference = 4096, - Tuple = 8192, - Union = 16384, - Anonymous = 32768, - FromSignature = 65536, - ObjectLiteral = 131072, - ContainsUndefinedOrNull = 262144, - ContainsObjectLiteral = 524288, - ESSymbol = 1048576, - Intrinsic = 1048703, - Primitive = 1049086, - StringLike = 258, - NumberLike = 132, - ObjectType = 48128, - RequiresWidening = 786432, - } - interface Type { - flags: TypeFlags; - id: number; - symbol?: Symbol; - } - interface IntrinsicType extends Type { - intrinsicName: string; - } - interface StringLiteralType extends Type { - text: string; - } - interface ObjectType extends Type { - } - interface InterfaceType extends ObjectType { - typeParameters: TypeParameter[]; - baseTypes: ObjectType[]; - declaredProperties: Symbol[]; - declaredCallSignatures: Signature[]; - declaredConstructSignatures: Signature[]; - declaredStringIndexType: Type; - declaredNumberIndexType: Type; - } - interface TypeReference extends ObjectType { - target: GenericType; - typeArguments: Type[]; - } - interface GenericType extends InterfaceType, TypeReference { - instantiations: Map; - } - interface TupleType extends ObjectType { - elementTypes: Type[]; - baseArrayType: TypeReference; - } - interface UnionType extends Type { - types: Type[]; - resolvedProperties: SymbolTable; - } - interface ResolvedType extends ObjectType, UnionType { - members: SymbolTable; - properties: Symbol[]; - callSignatures: Signature[]; - constructSignatures: Signature[]; - stringIndexType: Type; - numberIndexType: Type; - } - interface TypeParameter extends Type { - constraint: Type; - target?: TypeParameter; - mapper?: TypeMapper; - } - const enum SignatureKind { - Call = 0, - Construct = 1, - } - interface Signature { - declaration: SignatureDeclaration; - typeParameters: TypeParameter[]; - parameters: Symbol[]; - resolvedReturnType: Type; - minArgumentCount: number; - hasRestParameter: boolean; - hasStringLiterals: boolean; - target?: Signature; - mapper?: TypeMapper; - unionSignatures?: Signature[]; - erasedSignatureCache?: Signature; - isolatedSignatureType?: ObjectType; - } - const enum IndexKind { - String = 0, - Number = 1, - } - interface TypeMapper { - (t: Type): Type; - } - interface DiagnosticMessage { - key: string; - category: DiagnosticCategory; - code: number; - } - interface DiagnosticMessageChain { - messageText: string; - category: DiagnosticCategory; - code: number; - next?: DiagnosticMessageChain; - } - interface Diagnostic { - file: SourceFile; - start: number; - length: number; - messageText: string | DiagnosticMessageChain; - category: DiagnosticCategory; - code: number; - } - enum DiagnosticCategory { - Warning = 0, - Error = 1, - Message = 2, - } - interface CompilerOptions { - allowNonTsExtensions?: boolean; - charset?: string; - codepage?: number; - declaration?: boolean; - diagnostics?: boolean; - emitBOM?: boolean; - help?: boolean; - listFiles?: boolean; - locale?: string; - mapRoot?: string; - module?: ModuleKind; - noEmit?: boolean; - noEmitOnError?: boolean; - noErrorTruncation?: boolean; - noImplicitAny?: boolean; - noLib?: boolean; - noLibCheck?: boolean; - noResolve?: boolean; - out?: string; - outDir?: string; - preserveConstEnums?: boolean; - project?: string; - removeComments?: boolean; - sourceMap?: boolean; - sourceRoot?: string; - suppressImplicitAnyIndexErrors?: boolean; - target?: ScriptTarget; - version?: boolean; - watch?: boolean; - [option: string]: string | number | boolean; - } - const enum ModuleKind { - None = 0, - CommonJS = 1, - AMD = 2, - } - interface LineAndCharacter { - line: number; - character: number; - } - const enum ScriptTarget { - ES3 = 0, - ES5 = 1, - ES6 = 2, - Latest = 2, - } - interface ParsedCommandLine { - options: CompilerOptions; - fileNames: string[]; - errors: Diagnostic[]; - } - interface CommandLineOption { - name: string; - type: string | Map; - isFilePath?: boolean; - shortName?: string; - description?: DiagnosticMessage; - paramType?: DiagnosticMessage; - error?: DiagnosticMessage; - experimental?: boolean; - } - const enum CharacterCodes { - nullCharacter = 0, - maxAsciiCharacter = 127, - lineFeed = 10, - carriageReturn = 13, - lineSeparator = 8232, - paragraphSeparator = 8233, - nextLine = 133, - space = 32, - nonBreakingSpace = 160, - enQuad = 8192, - emQuad = 8193, - enSpace = 8194, - emSpace = 8195, - threePerEmSpace = 8196, - fourPerEmSpace = 8197, - sixPerEmSpace = 8198, - figureSpace = 8199, - punctuationSpace = 8200, - thinSpace = 8201, - hairSpace = 8202, - zeroWidthSpace = 8203, - narrowNoBreakSpace = 8239, - ideographicSpace = 12288, - mathematicalSpace = 8287, - ogham = 5760, - _ = 95, - $ = 36, - _0 = 48, - _1 = 49, - _2 = 50, - _3 = 51, - _4 = 52, - _5 = 53, - _6 = 54, - _7 = 55, - _8 = 56, - _9 = 57, - a = 97, - b = 98, - c = 99, - d = 100, - e = 101, - f = 102, - g = 103, - h = 104, - i = 105, - j = 106, - k = 107, - l = 108, - m = 109, - n = 110, - o = 111, - p = 112, - q = 113, - r = 114, - s = 115, - t = 116, - u = 117, - v = 118, - w = 119, - x = 120, - y = 121, - z = 122, - A = 65, - B = 66, - C = 67, - D = 68, - E = 69, - F = 70, - G = 71, - H = 72, - I = 73, - J = 74, - K = 75, - L = 76, - M = 77, - N = 78, - O = 79, - P = 80, - Q = 81, - R = 82, - S = 83, - T = 84, - U = 85, - V = 86, - W = 87, - X = 88, - Y = 89, - Z = 90, - ampersand = 38, - asterisk = 42, - at = 64, - backslash = 92, - backtick = 96, - bar = 124, - caret = 94, - closeBrace = 125, - closeBracket = 93, - closeParen = 41, - colon = 58, - comma = 44, - dot = 46, - doubleQuote = 34, - equals = 61, - exclamation = 33, - greaterThan = 62, - hash = 35, - lessThan = 60, - minus = 45, - openBrace = 123, - openBracket = 91, - openParen = 40, - percent = 37, - plus = 43, - question = 63, - semicolon = 59, - singleQuote = 39, - slash = 47, - tilde = 126, - backspace = 8, - formFeed = 12, - byteOrderMark = 65279, - tab = 9, - verticalTab = 11, - } - interface CancellationToken { - isCancellationRequested(): boolean; - } - interface CompilerHost { - getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile; - getDefaultLibFileName(options: CompilerOptions): string; - getCancellationToken?(): CancellationToken; - writeFile: WriteFileCallback; - getCurrentDirectory(): string; - getCanonicalFileName(fileName: string): string; - useCaseSensitiveFileNames(): boolean; - getNewLine(): string; - } - interface TextSpan { - start: number; - length: number; - } - interface TextChangeRange { - span: TextSpan; - newLength: number; - } -} -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): void; - setTextPos(textPos: number): void; - lookAhead(callback: () => T): T; - tryScan(callback: () => T): T; - } - function tokenToString(t: SyntaxKind): string; - function computeLineStarts(text: string): number[]; - function getPositionOfLineAndCharacter(sourceFile: SourceFile, line: number, character: number): number; - function computePositionOfLineAndCharacter(lineStarts: number[], line: number, character: number): number; - function getLineStarts(sourceFile: SourceFile): number[]; - function computeLineAndCharacterOfPosition(lineStarts: number[], position: number): { - line: number; - character: number; - }; - function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter; - function isWhiteSpace(ch: number): boolean; - function isLineBreak(ch: number): boolean; - function isOctalDigit(ch: number): boolean; - function skipTrivia(text: string, pos: number, stopAfterLineBreak?: boolean): number; - function getLeadingCommentRanges(text: string, pos: number): CommentRange[]; - function getTrailingCommentRanges(text: string, pos: number): CommentRange[]; - function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean; - function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean; - function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback): Scanner; -} -declare module "typescript" { - function getNodeConstructor(kind: SyntaxKind): new () => Node; - function createNode(kind: SyntaxKind): Node; - function forEachChild(node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; - function modifierToFlag(token: SyntaxKind): NodeFlags; - function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; - function isEvalOrArgumentsIdentifier(node: Node): boolean; - function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean): SourceFile; - function isLeftHandSideExpression(expr: Expression): boolean; - function isAssignmentOperator(token: SyntaxKind): boolean; -} -declare module "typescript" { - function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker; -} -declare module "typescript" { - /** The version of the TypeScript compiler release */ - let version: string; - function findConfigFile(searchPath: string): string; - function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; - function getPreEmitDiagnostics(program: Program): Diagnostic[]; - function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; - function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; -} -declare module "typescript" { - /** The version of the language service API */ - let servicesVersion: string; - interface Node { - getSourceFile(): SourceFile; - getChildCount(sourceFile?: SourceFile): number; - getChildAt(index: number, sourceFile?: SourceFile): Node; - getChildren(sourceFile?: SourceFile): Node[]; - getStart(sourceFile?: SourceFile): number; - getFullStart(): number; - getEnd(): number; - getWidth(sourceFile?: SourceFile): number; - getFullWidth(): number; - getLeadingTriviaWidth(sourceFile?: SourceFile): number; - getFullText(sourceFile?: SourceFile): string; - getText(sourceFile?: SourceFile): string; - getFirstToken(sourceFile?: SourceFile): Node; - getLastToken(sourceFile?: SourceFile): Node; - } - interface Symbol { - getFlags(): SymbolFlags; - getName(): string; - getDeclarations(): Declaration[]; - getDocumentationComment(): SymbolDisplayPart[]; - } - interface Type { - getFlags(): TypeFlags; - getSymbol(): Symbol; - getProperties(): Symbol[]; - getProperty(propertyName: string): Symbol; - getApparentProperties(): Symbol[]; - getCallSignatures(): Signature[]; - getConstructSignatures(): Signature[]; - getStringIndexType(): Type; - getNumberIndexType(): Type; - } - interface Signature { - getDeclaration(): SignatureDeclaration; - getTypeParameters(): Type[]; - getParameters(): Symbol[]; - getReturnType(): Type; - getDocumentationComment(): SymbolDisplayPart[]; - } - interface SourceFile { - getNamedDeclarations(): Declaration[]; - getLineAndCharacterOfPosition(pos: number): LineAndCharacter; - getLineStarts(): number[]; - getPositionOfLineAndCharacter(line: number, character: number): number; - update(newText: string, textChangeRange: TextChangeRange): SourceFile; - } - /** - * Represents an immutable snapshot of a script at a specified time.Once acquired, the - * snapshot is observably immutable. i.e. the same calls with the same parameters will return - * the same values. - */ - interface IScriptSnapshot { - /** Gets a portion of the script snapshot specified by [start, end). */ - getText(start: number, end: number): string; - /** Gets the length of this script snapshot. */ - getLength(): number; - /** - * Gets the TextChangeRange that describe how the text changed between this text and - * an older version. This information is used by the incremental parser to determine - * what sections of the script need to be re-parsed. 'undefined' can be returned if the - * change range cannot be determined. However, in that case, incremental parsing will - * not happen and the entire document will be re - parsed. - */ - getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange; - } - module ScriptSnapshot { - function fromString(text: string): IScriptSnapshot; - } - interface PreProcessedFileInfo { - referencedFiles: FileReference[]; - importedFiles: FileReference[]; - isLibFile: boolean; - } - interface LanguageServiceHost { - getCompilationSettings(): CompilerOptions; - getNewLine?(): string; - getScriptFileNames(): string[]; - getScriptVersion(fileName: string): string; - getScriptSnapshot(fileName: string): IScriptSnapshot; - getLocalizedDiagnosticMessages?(): any; - getCancellationToken?(): CancellationToken; - getCurrentDirectory(): string; - getDefaultLibFileName(options: CompilerOptions): string; - log?(s: string): void; - trace?(s: string): void; - error?(s: string): void; - } - interface LanguageService { - cleanupSemanticCache(): void; - getSyntacticDiagnostics(fileName: string): Diagnostic[]; - getSemanticDiagnostics(fileName: string): Diagnostic[]; - getCompilerOptionsDiagnostics(): Diagnostic[]; - getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; - getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; - getCompletionsAtPosition(fileName: string, position: number): CompletionInfo; - getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails; - getQuickInfoAtPosition(fileName: string, position: number): QuickInfo; - getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan; - getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan; - getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems; - getRenameInfo(fileName: string, position: number): RenameInfo; - findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]; - getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; - getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; - getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; - findReferences(fileName: string, position: number): ReferencedSymbol[]; - getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[]; - getNavigationBarItems(fileName: string): NavigationBarItem[]; - getOutliningSpans(fileName: string): OutliningSpan[]; - getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[]; - getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[]; - getIndentationAtPosition(fileName: string, position: number, options: EditorOptions): number; - getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions): TextChange[]; - getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): TextChange[]; - getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextChange[]; - getEmitOutput(fileName: string): EmitOutput; - getProgram(): Program; - getSourceFile(fileName: string): SourceFile; - dispose(): void; - } - interface ClassifiedSpan { - textSpan: TextSpan; - classificationType: string; - } - interface NavigationBarItem { - text: string; - kind: string; - kindModifiers: string; - spans: TextSpan[]; - childItems: NavigationBarItem[]; - indent: number; - bolded: boolean; - grayed: boolean; - } - interface TodoCommentDescriptor { - text: string; - priority: number; - } - interface TodoComment { - descriptor: TodoCommentDescriptor; - message: string; - position: number; - } - class TextChange { - span: TextSpan; - newText: string; - } - interface RenameLocation { - textSpan: TextSpan; - fileName: string; - } - interface ReferenceEntry { - textSpan: TextSpan; - fileName: string; - isWriteAccess: boolean; - } - interface NavigateToItem { - name: string; - kind: string; - kindModifiers: string; - matchKind: string; - isCaseSensitive: boolean; - fileName: string; - textSpan: TextSpan; - containerName: string; - containerKind: string; - } - interface EditorOptions { - IndentSize: number; - TabSize: number; - NewLineCharacter: string; - ConvertTabsToSpaces: boolean; - } - interface FormatCodeOptions extends EditorOptions { - InsertSpaceAfterCommaDelimiter: boolean; - InsertSpaceAfterSemicolonInForStatements: boolean; - InsertSpaceBeforeAndAfterBinaryOperators: boolean; - InsertSpaceAfterKeywordsInControlFlowStatements: boolean; - InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; - InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; - PlaceOpenBraceOnNewLineForFunctions: boolean; - PlaceOpenBraceOnNewLineForControlBlocks: boolean; - [s: string]: boolean | number | string; - } - interface DefinitionInfo { - fileName: string; - textSpan: TextSpan; - kind: string; - name: string; - containerKind: string; - containerName: string; - } - interface ReferencedSymbol { - definition: DefinitionInfo; - references: ReferenceEntry[]; - } - enum SymbolDisplayPartKind { - aliasName = 0, - className = 1, - enumName = 2, - fieldName = 3, - interfaceName = 4, - keyword = 5, - lineBreak = 6, - numericLiteral = 7, - stringLiteral = 8, - localName = 9, - methodName = 10, - moduleName = 11, - operator = 12, - parameterName = 13, - propertyName = 14, - punctuation = 15, - space = 16, - text = 17, - typeParameterName = 18, - enumMemberName = 19, - functionName = 20, - regularExpressionLiteral = 21, - } - interface SymbolDisplayPart { - text: string; - kind: string; - } - interface QuickInfo { - kind: string; - kindModifiers: string; - textSpan: TextSpan; - displayParts: SymbolDisplayPart[]; - documentation: SymbolDisplayPart[]; - } - interface RenameInfo { - canRename: boolean; - localizedErrorMessage: string; - displayName: string; - fullDisplayName: string; - kind: string; - kindModifiers: string; - triggerSpan: TextSpan; - } - interface SignatureHelpParameter { - name: string; - documentation: SymbolDisplayPart[]; - displayParts: SymbolDisplayPart[]; - isOptional: boolean; - } - /** - * Represents a single signature to show in signature help. - * The id is used for subsequent calls into the language service to ask questions about the - * signature help item in the context of any documents that have been updated. i.e. after - * an edit has happened, while signature help is still active, the host can ask important - * questions like 'what parameter is the user currently contained within?'. - */ - interface SignatureHelpItem { - isVariadic: boolean; - prefixDisplayParts: SymbolDisplayPart[]; - suffixDisplayParts: SymbolDisplayPart[]; - separatorDisplayParts: SymbolDisplayPart[]; - parameters: SignatureHelpParameter[]; - documentation: SymbolDisplayPart[]; - } - /** - * Represents a set of signature help items, and the preferred item that should be selected. - */ - interface SignatureHelpItems { - items: SignatureHelpItem[]; - applicableSpan: TextSpan; - selectedItemIndex: number; - argumentIndex: number; - argumentCount: number; - } - interface CompletionInfo { - isMemberCompletion: boolean; - isNewIdentifierLocation: boolean; - entries: CompletionEntry[]; - } - interface CompletionEntry { - name: string; - kind: string; - kindModifiers: string; - } - interface CompletionEntryDetails { - name: string; - kind: string; - kindModifiers: string; - displayParts: SymbolDisplayPart[]; - documentation: SymbolDisplayPart[]; - } - interface OutliningSpan { - /** The span of the document to actually collapse. */ - textSpan: TextSpan; - /** The span of the document to display when the user hovers over the collapsed span. */ - hintSpan: TextSpan; - /** The text to display in the editor for the collapsed region. */ - bannerText: string; - /** - * Whether or not this region should be automatically collapsed when - * the 'Collapse to Definitions' command is invoked. - */ - autoCollapse: boolean; - } - interface EmitOutput { - outputFiles: OutputFile[]; - emitSkipped: boolean; - } - const enum OutputFileType { - JavaScript = 0, - SourceMap = 1, - Declaration = 2, - } - interface OutputFile { - name: string; - writeByteOrderMark: boolean; - text: string; - } - const enum EndOfLineState { - Start = 0, - InMultiLineCommentTrivia = 1, - InSingleQuoteStringLiteral = 2, - InDoubleQuoteStringLiteral = 3, - InTemplateHeadOrNoSubstitutionTemplate = 4, - InTemplateMiddleOrTail = 5, - InTemplateSubstitutionPosition = 6, - } - enum TokenClass { - Punctuation = 0, - Keyword = 1, - Operator = 2, - Comment = 3, - Whitespace = 4, - Identifier = 5, - NumberLiteral = 6, - StringLiteral = 7, - RegExpLiteral = 8, - } - interface ClassificationResult { - finalLexState: EndOfLineState; - entries: ClassificationInfo[]; - } - interface ClassificationInfo { - length: number; - classification: TokenClass; - } - interface Classifier { - /** - * Gives lexical classifications of tokens on a line without any syntactic context. - * For instance, a token consisting of the text 'string' can be either an identifier - * named 'string' or the keyword 'string', however, because this classifier is not aware, - * it relies on certain heuristics to give acceptable results. For classifications where - * speed trumps accuracy, this function is preferable; however, for true accuracy, the - * syntactic classifier is ideal. In fact, in certain editing scenarios, combining the - * lexical, syntactic, and semantic classifiers may issue the best user experience. - * - * @param text The text of a line to classify. - * @param lexState The state of the lexical classifier at the end of the previous line. - * @param syntacticClassifierAbsent Whether the client is *not* using a syntactic classifier. - * If there is no syntactic classifier (syntacticClassifierAbsent=true), - * certain heuristics may be used in its place; however, if there is a - * syntactic classifier (syntacticClassifierAbsent=false), certain - * classifications which may be incorrectly categorized will be given - * back as Identifiers in order to allow the syntactic classifier to - * subsume the classification. - */ - getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult; - } - /** - * The document registry represents a store of SourceFile objects that can be shared between - * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) - * of files in the context. - * SourceFile objects account for most of the memory usage by the language service. Sharing - * the same DocumentRegistry instance between different instances of LanguageService allow - * for more efficient memory utilization since all projects will share at least the library - * file (lib.d.ts). - * - * A more advanced use of the document registry is to serialize sourceFile objects to disk - * and re-hydrate them when needed. - * - * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it - * to all subsequent createLanguageService calls. - */ - interface DocumentRegistry { - /** - * Request a stored SourceFile with a given fileName and compilationSettings. - * The first call to acquire will call createLanguageServiceSourceFile to generate - * the SourceFile if was not found in the registry. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @parm scriptSnapshot Text of the file. Only used if the file was not found - * in the registry and a new one was created. - * @parm version Current version of the file. Only used if the file was not found - * in the registry and a new one was created. - */ - acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; - /** - * Request an updated version of an already existing SourceFile with a given fileName - * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile - * to get an updated SourceFile. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @param scriptSnapshot Text of the file. - * @param version Current version of the file. - */ - updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; - /** - * Informs the DocumentRegistry that a file is not needed any longer. - * - * Note: It is not allowed to call release on a SourceFile that was not acquired from - * this registry originally. - * - * @param fileName The name of the file to be released - * @param compilationSettings The compilation settings used to acquire the file - */ - releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; - } - class ScriptElementKind { - static unknown: string; - static keyword: string; - static scriptElement: string; - static moduleElement: string; - static classElement: string; - static interfaceElement: string; - static typeElement: string; - static enumElement: string; - static variableElement: string; - static localVariableElement: string; - static functionElement: string; - static localFunctionElement: string; - static memberFunctionElement: string; - static memberGetAccessorElement: string; - static memberSetAccessorElement: string; - static memberVariableElement: string; - static constructorImplementationElement: string; - static callSignatureElement: string; - static indexSignatureElement: string; - static constructSignatureElement: string; - static parameterElement: string; - static typeParameterElement: string; - static primitiveType: string; - static label: string; - static alias: string; - static constElement: string; - static letElement: string; - } - class ScriptElementKindModifier { - static none: string; - static publicMemberModifier: string; - static privateMemberModifier: string; - static protectedMemberModifier: string; - static exportedModifier: string; - static ambientModifier: string; - static staticModifier: string; - } - class ClassificationTypeNames { - static comment: string; - static identifier: string; - static keyword: string; - static numericLiteral: string; - static operator: string; - static stringLiteral: string; - static whiteSpace: string; - static text: string; - static punctuation: string; - static className: string; - static enumName: string; - static interfaceName: string; - static moduleName: string; - static typeParameterName: string; - static typeAlias: string; - } - interface DisplayPartsSymbolWriter extends SymbolWriter { - displayParts(): SymbolDisplayPart[]; - } - function displayPartsToString(displayParts: SymbolDisplayPart[]): string; - function getDefaultCompilerOptions(): CompilerOptions; - class OperationCanceledException { - } - class CancellationTokenObject { - private cancellationToken; - static None: CancellationTokenObject; - constructor(cancellationToken: CancellationToken); - isCancellationRequested(): boolean; - throwIfCancellationRequested(): void; - } - function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile; - let disableIncrementalParsing: boolean; - function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; - function createDocumentRegistry(): DocumentRegistry; - function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo; - function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; - function createClassifier(): Classifier; - /** - * Get the path of the default library file (lib.d.ts) as distributed with the typescript - * node package. - * The functionality is not supported if the ts module is consumed outside of a node module. - */ - function getDefaultLibFilePath(options: CompilerOptions): string; -} - //// [APISample_watcher.js] /* @@ -2080,33 +114,21 @@ function watch(rootFileNames, options) { var files = {}; // initialize the list of files rootFileNames.forEach(function (fileName) { - files[fileName] = { - version: 0 - }; + files[fileName] = { version: 0 }; }); // Create the language service host to allow the LS to communicate with the host var servicesHost = { - getScriptFileNames: function () { - return rootFileNames; - }, - getScriptVersion: function (fileName) { - return files[fileName] && files[fileName].version.toString(); - }, + getScriptFileNames: function () { return rootFileNames; }, + getScriptVersion: function (fileName) { return files[fileName] && files[fileName].version.toString(); }, getScriptSnapshot: function (fileName) { if (!fs.existsSync(fileName)) { return undefined; } return ts.ScriptSnapshot.fromString(fs.readFileSync(fileName).toString()); }, - getCurrentDirectory: function () { - return process.cwd(); - }, - getCompilationSettings: function () { - return options; - }, - getDefaultLibFileName: function (options) { - return ts.getDefaultLibFilePath(options); - } + getCurrentDirectory: function () { return process.cwd(); }, + getCompilationSettings: function () { return options; }, + getDefaultLibFileName: function (options) { return ts.getDefaultLibFilePath(options); } }; // Create the language service files var services = ts.createLanguageService(servicesHost, ts.createDocumentRegistry()); @@ -2115,10 +137,7 @@ function watch(rootFileNames, options) { // First time around, emit all files emitFile(fileName); // Add a watch on the file to handle next change - fs.watchFile(fileName, { - persistent: true, - interval: 250 - }, function (curr, prev) { + fs.watchFile(fileName, { persistent: true, interval: 250 }, function (curr, prev) { // Check timestamp if (+curr.mtime <= +prev.mtime) { return; @@ -2143,23 +162,23 @@ function watch(rootFileNames, options) { }); } function logErrors(fileName) { - var allDiagnostics = services.getCompilerOptionsDiagnostics().concat(services.getSyntacticDiagnostics(fileName)).concat(services.getSemanticDiagnostics(fileName)); + var allDiagnostics = services.getCompilerOptionsDiagnostics() + .concat(services.getSyntacticDiagnostics(fileName)) + .concat(services.getSemanticDiagnostics(fileName)); allDiagnostics.forEach(function (diagnostic) { + var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"); if (diagnostic.file) { - var lineChar = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); - console.log(" Error " + diagnostic.file.fileName + " (" + (lineChar.line + 1) + "," + (lineChar.character + 1) + "): " + ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n")); + var _a = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start), line = _a.line, character = _a.character; + console.log(" Error " + diagnostic.file.fileName + " (" + (line + 1) + "," + (character + 1) + "): " + message); } else { - console.log(" Error: " + diagnostic.messageText); + console.log(" Error: " + message); } }); } } // Initialize files constituting the program as all .ts files in the current directory -var currentDirectoryFiles = fs.readdirSync(process.cwd()).filter(function (fileName) { - return fileName.length >= 3 && fileName.substr(fileName.length - 3, 3) === ".ts"; -}); +var currentDirectoryFiles = fs.readdirSync(process.cwd()). + filter(function (fileName) { return fileName.length >= 3 && fileName.substr(fileName.length - 3, 3) === ".ts"; }); // Start the watcher -watch(currentDirectoryFiles, { - module: 1 /* CommonJS */ -}); +watch(currentDirectoryFiles, { module: 1 /* CommonJS */ }); diff --git a/tests/baselines/reference/APISample_watcher.types b/tests/baselines/reference/APISample_watcher.types index 3903e169b4e..5f123ea839b 100644 --- a/tests/baselines/reference/APISample_watcher.types +++ b/tests/baselines/reference/APISample_watcher.types @@ -18,7 +18,7 @@ declare var fs: any; declare var path: any; >path : any -import ts = require("typescript"); +import * as ts from "typescript"; >ts : typeof ts function watch(rootFileNames: string[], options: ts.CompilerOptions) { @@ -28,7 +28,7 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { >ts : unknown >CompilerOptions : ts.CompilerOptions - var files: ts.Map<{ version: number }> = {}; + const files: ts.Map<{ version: number }> = {}; >files : ts.Map<{ version: number; }> >ts : unknown >Map : ts.Map @@ -55,7 +55,7 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { }); // Create the language service host to allow the LS to communicate with the host - var servicesHost: ts.LanguageServiceHost = { + const servicesHost: ts.LanguageServiceHost = { >servicesHost : ts.LanguageServiceHost >ts : unknown >LanguageServiceHost : ts.LanguageServiceHost @@ -143,7 +143,7 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { }; // Create the language service files - var services = ts.createLanguageService(servicesHost, ts.createDocumentRegistry()) + const services = ts.createLanguageService(servicesHost, ts.createDocumentRegistry()) >services : ts.LanguageService >ts.createLanguageService(servicesHost, ts.createDocumentRegistry()) : ts.LanguageService >ts.createLanguageService : (host: ts.LanguageServiceHost, documentRegistry?: ts.DocumentRegistry) => ts.LanguageService @@ -225,7 +225,7 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { >emitFile : (fileName: string) => void >fileName : string - var output = services.getEmitOutput(fileName); + let output = services.getEmitOutput(fileName); >output : ts.EmitOutput >services.getEmitOutput(fileName) : ts.EmitOutput >services.getEmitOutput : (fileName: string) => ts.EmitOutput @@ -289,7 +289,7 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { >logErrors : (fileName: string) => void >fileName : string - var allDiagnostics = services.getCompilerOptionsDiagnostics() + let allDiagnostics = services.getCompilerOptionsDiagnostics() >allDiagnostics : ts.Diagnostic[] >services.getCompilerOptionsDiagnostics() .concat(services.getSyntacticDiagnostics(fileName)) .concat(services.getSemanticDiagnostics(fileName)) : ts.Diagnostic[] >services.getCompilerOptionsDiagnostics() .concat(services.getSyntacticDiagnostics(fileName)) .concat : { (...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; } @@ -317,20 +317,31 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { >fileName : string allDiagnostics.forEach(diagnostic => { ->allDiagnostics.forEach(diagnostic => { if (diagnostic.file) { var lineChar = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); console.log(` Error ${diagnostic.file.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n")}`); } else { console.log(` Error: ${diagnostic.messageText}`); } }) : void +>allDiagnostics.forEach(diagnostic => { let message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"); if (diagnostic.file) { let { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); console.log(` Error ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); } else { console.log(` Error: ${message}`); } }) : void >allDiagnostics.forEach : (callbackfn: (value: ts.Diagnostic, index: number, array: ts.Diagnostic[]) => void, thisArg?: any) => void >allDiagnostics : ts.Diagnostic[] >forEach : (callbackfn: (value: ts.Diagnostic, index: number, array: ts.Diagnostic[]) => void, thisArg?: any) => void ->diagnostic => { if (diagnostic.file) { var lineChar = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); console.log(` Error ${diagnostic.file.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n")}`); } else { console.log(` Error: ${diagnostic.messageText}`); } } : (diagnostic: ts.Diagnostic) => void +>diagnostic => { let message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"); if (diagnostic.file) { let { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); console.log(` Error ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); } else { console.log(` Error: ${message}`); } } : (diagnostic: ts.Diagnostic) => void >diagnostic : ts.Diagnostic + let message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"); +>message : string +>ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n") : string +>ts.flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string +>ts : typeof ts +>flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string +>diagnostic.messageText : string | ts.DiagnosticMessageChain +>diagnostic : ts.Diagnostic +>messageText : string | ts.DiagnosticMessageChain + if (diagnostic.file) { >diagnostic.file : ts.SourceFile >diagnostic : ts.Diagnostic >file : ts.SourceFile - var lineChar = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); ->lineChar : ts.LineAndCharacter + let { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); +>line : number +>character : number >diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start) : ts.LineAndCharacter >diagnostic.file.getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter >diagnostic.file : ts.SourceFile @@ -341,8 +352,8 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { >diagnostic : ts.Diagnostic >start : number - console.log(` Error ${diagnostic.file.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n")}`); ->console.log(` Error ${diagnostic.file.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n")}`) : any + console.log(` Error ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); +>console.log(` Error ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`) : any >console.log : any >console : any >log : any @@ -351,38 +362,26 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { >diagnostic : ts.Diagnostic >file : ts.SourceFile >fileName : string ->lineChar.line + 1 : number ->lineChar.line : number ->lineChar : ts.LineAndCharacter +>line + 1 : number >line : number ->lineChar.character + 1 : number ->lineChar.character : number ->lineChar : ts.LineAndCharacter +>character + 1 : number >character : number ->ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n") : string ->ts.flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string ->ts : typeof ts ->flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string ->diagnostic.messageText : string | ts.DiagnosticMessageChain ->diagnostic : ts.Diagnostic ->messageText : string | ts.DiagnosticMessageChain +>message : string } else { - console.log(` Error: ${diagnostic.messageText}`); ->console.log(` Error: ${diagnostic.messageText}`) : any + console.log(` Error: ${message}`); +>console.log(` Error: ${message}`) : any >console.log : any >console : any >log : any ->diagnostic.messageText : string | ts.DiagnosticMessageChain ->diagnostic : ts.Diagnostic ->messageText : string | ts.DiagnosticMessageChain +>message : string } }); } } // Initialize files constituting the program as all .ts files in the current directory -var currentDirectoryFiles = fs.readdirSync(process.cwd()). +const currentDirectoryFiles = fs.readdirSync(process.cwd()). >currentDirectoryFiles : any >fs.readdirSync(process.cwd()). filter(fileName=> fileName.length >= 3 && fileName.substr(fileName.length - 3, 3) === ".ts") : any >fs.readdirSync(process.cwd()). filter : any @@ -427,6064 +426,3 @@ watch(currentDirectoryFiles, { module: ts.ModuleKind.CommonJS }); >ModuleKind : typeof ts.ModuleKind >CommonJS : ts.ModuleKind -=== typescript.d.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 http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -declare module "typescript" { - interface Map { ->Map : Map ->T : T - - [index: string]: T; ->index : string ->T : T - } - interface TextRange { ->TextRange : TextRange - - pos: number; ->pos : number - - end: number; ->end : number - } - const enum SyntaxKind { ->SyntaxKind : SyntaxKind - - Unknown = 0, ->Unknown : SyntaxKind - - EndOfFileToken = 1, ->EndOfFileToken : SyntaxKind - - SingleLineCommentTrivia = 2, ->SingleLineCommentTrivia : SyntaxKind - - MultiLineCommentTrivia = 3, ->MultiLineCommentTrivia : SyntaxKind - - NewLineTrivia = 4, ->NewLineTrivia : SyntaxKind - - WhitespaceTrivia = 5, ->WhitespaceTrivia : SyntaxKind - - ConflictMarkerTrivia = 6, ->ConflictMarkerTrivia : SyntaxKind - - NumericLiteral = 7, ->NumericLiteral : SyntaxKind - - StringLiteral = 8, ->StringLiteral : SyntaxKind - - RegularExpressionLiteral = 9, ->RegularExpressionLiteral : SyntaxKind - - NoSubstitutionTemplateLiteral = 10, ->NoSubstitutionTemplateLiteral : SyntaxKind - - TemplateHead = 11, ->TemplateHead : SyntaxKind - - TemplateMiddle = 12, ->TemplateMiddle : SyntaxKind - - TemplateTail = 13, ->TemplateTail : SyntaxKind - - OpenBraceToken = 14, ->OpenBraceToken : SyntaxKind - - CloseBraceToken = 15, ->CloseBraceToken : SyntaxKind - - OpenParenToken = 16, ->OpenParenToken : SyntaxKind - - CloseParenToken = 17, ->CloseParenToken : SyntaxKind - - OpenBracketToken = 18, ->OpenBracketToken : SyntaxKind - - CloseBracketToken = 19, ->CloseBracketToken : SyntaxKind - - DotToken = 20, ->DotToken : SyntaxKind - - DotDotDotToken = 21, ->DotDotDotToken : SyntaxKind - - SemicolonToken = 22, ->SemicolonToken : SyntaxKind - - CommaToken = 23, ->CommaToken : SyntaxKind - - LessThanToken = 24, ->LessThanToken : SyntaxKind - - GreaterThanToken = 25, ->GreaterThanToken : SyntaxKind - - LessThanEqualsToken = 26, ->LessThanEqualsToken : SyntaxKind - - GreaterThanEqualsToken = 27, ->GreaterThanEqualsToken : SyntaxKind - - EqualsEqualsToken = 28, ->EqualsEqualsToken : SyntaxKind - - ExclamationEqualsToken = 29, ->ExclamationEqualsToken : SyntaxKind - - EqualsEqualsEqualsToken = 30, ->EqualsEqualsEqualsToken : SyntaxKind - - ExclamationEqualsEqualsToken = 31, ->ExclamationEqualsEqualsToken : SyntaxKind - - EqualsGreaterThanToken = 32, ->EqualsGreaterThanToken : SyntaxKind - - PlusToken = 33, ->PlusToken : SyntaxKind - - MinusToken = 34, ->MinusToken : SyntaxKind - - AsteriskToken = 35, ->AsteriskToken : SyntaxKind - - SlashToken = 36, ->SlashToken : SyntaxKind - - PercentToken = 37, ->PercentToken : SyntaxKind - - PlusPlusToken = 38, ->PlusPlusToken : SyntaxKind - - MinusMinusToken = 39, ->MinusMinusToken : SyntaxKind - - LessThanLessThanToken = 40, ->LessThanLessThanToken : SyntaxKind - - GreaterThanGreaterThanToken = 41, ->GreaterThanGreaterThanToken : SyntaxKind - - GreaterThanGreaterThanGreaterThanToken = 42, ->GreaterThanGreaterThanGreaterThanToken : SyntaxKind - - AmpersandToken = 43, ->AmpersandToken : SyntaxKind - - BarToken = 44, ->BarToken : SyntaxKind - - CaretToken = 45, ->CaretToken : SyntaxKind - - ExclamationToken = 46, ->ExclamationToken : SyntaxKind - - TildeToken = 47, ->TildeToken : SyntaxKind - - AmpersandAmpersandToken = 48, ->AmpersandAmpersandToken : SyntaxKind - - BarBarToken = 49, ->BarBarToken : SyntaxKind - - QuestionToken = 50, ->QuestionToken : SyntaxKind - - ColonToken = 51, ->ColonToken : SyntaxKind - - AtToken = 52, ->AtToken : SyntaxKind - - EqualsToken = 53, ->EqualsToken : SyntaxKind - - PlusEqualsToken = 54, ->PlusEqualsToken : SyntaxKind - - MinusEqualsToken = 55, ->MinusEqualsToken : SyntaxKind - - AsteriskEqualsToken = 56, ->AsteriskEqualsToken : SyntaxKind - - SlashEqualsToken = 57, ->SlashEqualsToken : SyntaxKind - - PercentEqualsToken = 58, ->PercentEqualsToken : SyntaxKind - - LessThanLessThanEqualsToken = 59, ->LessThanLessThanEqualsToken : SyntaxKind - - GreaterThanGreaterThanEqualsToken = 60, ->GreaterThanGreaterThanEqualsToken : SyntaxKind - - GreaterThanGreaterThanGreaterThanEqualsToken = 61, ->GreaterThanGreaterThanGreaterThanEqualsToken : SyntaxKind - - AmpersandEqualsToken = 62, ->AmpersandEqualsToken : SyntaxKind - - BarEqualsToken = 63, ->BarEqualsToken : SyntaxKind - - CaretEqualsToken = 64, ->CaretEqualsToken : SyntaxKind - - Identifier = 65, ->Identifier : SyntaxKind - - BreakKeyword = 66, ->BreakKeyword : SyntaxKind - - CaseKeyword = 67, ->CaseKeyword : SyntaxKind - - CatchKeyword = 68, ->CatchKeyword : SyntaxKind - - ClassKeyword = 69, ->ClassKeyword : SyntaxKind - - ConstKeyword = 70, ->ConstKeyword : SyntaxKind - - ContinueKeyword = 71, ->ContinueKeyword : SyntaxKind - - DebuggerKeyword = 72, ->DebuggerKeyword : SyntaxKind - - DefaultKeyword = 73, ->DefaultKeyword : SyntaxKind - - DeleteKeyword = 74, ->DeleteKeyword : SyntaxKind - - DoKeyword = 75, ->DoKeyword : SyntaxKind - - ElseKeyword = 76, ->ElseKeyword : SyntaxKind - - EnumKeyword = 77, ->EnumKeyword : SyntaxKind - - ExportKeyword = 78, ->ExportKeyword : SyntaxKind - - ExtendsKeyword = 79, ->ExtendsKeyword : SyntaxKind - - FalseKeyword = 80, ->FalseKeyword : SyntaxKind - - FinallyKeyword = 81, ->FinallyKeyword : SyntaxKind - - ForKeyword = 82, ->ForKeyword : SyntaxKind - - FunctionKeyword = 83, ->FunctionKeyword : SyntaxKind - - IfKeyword = 84, ->IfKeyword : SyntaxKind - - ImportKeyword = 85, ->ImportKeyword : SyntaxKind - - InKeyword = 86, ->InKeyword : SyntaxKind - - InstanceOfKeyword = 87, ->InstanceOfKeyword : SyntaxKind - - NewKeyword = 88, ->NewKeyword : SyntaxKind - - NullKeyword = 89, ->NullKeyword : SyntaxKind - - ReturnKeyword = 90, ->ReturnKeyword : SyntaxKind - - SuperKeyword = 91, ->SuperKeyword : SyntaxKind - - SwitchKeyword = 92, ->SwitchKeyword : SyntaxKind - - ThisKeyword = 93, ->ThisKeyword : SyntaxKind - - ThrowKeyword = 94, ->ThrowKeyword : SyntaxKind - - TrueKeyword = 95, ->TrueKeyword : SyntaxKind - - TryKeyword = 96, ->TryKeyword : SyntaxKind - - TypeOfKeyword = 97, ->TypeOfKeyword : SyntaxKind - - VarKeyword = 98, ->VarKeyword : SyntaxKind - - VoidKeyword = 99, ->VoidKeyword : SyntaxKind - - WhileKeyword = 100, ->WhileKeyword : SyntaxKind - - WithKeyword = 101, ->WithKeyword : SyntaxKind - - AsKeyword = 102, ->AsKeyword : SyntaxKind - - ImplementsKeyword = 103, ->ImplementsKeyword : SyntaxKind - - InterfaceKeyword = 104, ->InterfaceKeyword : SyntaxKind - - LetKeyword = 105, ->LetKeyword : SyntaxKind - - PackageKeyword = 106, ->PackageKeyword : SyntaxKind - - PrivateKeyword = 107, ->PrivateKeyword : SyntaxKind - - ProtectedKeyword = 108, ->ProtectedKeyword : SyntaxKind - - PublicKeyword = 109, ->PublicKeyword : SyntaxKind - - StaticKeyword = 110, ->StaticKeyword : SyntaxKind - - YieldKeyword = 111, ->YieldKeyword : SyntaxKind - - AnyKeyword = 112, ->AnyKeyword : SyntaxKind - - BooleanKeyword = 113, ->BooleanKeyword : SyntaxKind - - ConstructorKeyword = 114, ->ConstructorKeyword : SyntaxKind - - DeclareKeyword = 115, ->DeclareKeyword : SyntaxKind - - GetKeyword = 116, ->GetKeyword : SyntaxKind - - ModuleKeyword = 117, ->ModuleKeyword : SyntaxKind - - RequireKeyword = 118, ->RequireKeyword : SyntaxKind - - NumberKeyword = 119, ->NumberKeyword : SyntaxKind - - SetKeyword = 120, ->SetKeyword : SyntaxKind - - StringKeyword = 121, ->StringKeyword : SyntaxKind - - SymbolKeyword = 122, ->SymbolKeyword : SyntaxKind - - TypeKeyword = 123, ->TypeKeyword : SyntaxKind - - FromKeyword = 124, ->FromKeyword : SyntaxKind - - OfKeyword = 125, ->OfKeyword : SyntaxKind - - QualifiedName = 126, ->QualifiedName : SyntaxKind - - ComputedPropertyName = 127, ->ComputedPropertyName : SyntaxKind - - TypeParameter = 128, ->TypeParameter : SyntaxKind - - Parameter = 129, ->Parameter : SyntaxKind - - Decorator = 130, ->Decorator : SyntaxKind - - PropertySignature = 131, ->PropertySignature : SyntaxKind - - PropertyDeclaration = 132, ->PropertyDeclaration : SyntaxKind - - MethodSignature = 133, ->MethodSignature : SyntaxKind - - MethodDeclaration = 134, ->MethodDeclaration : SyntaxKind - - Constructor = 135, ->Constructor : SyntaxKind - - GetAccessor = 136, ->GetAccessor : SyntaxKind - - SetAccessor = 137, ->SetAccessor : SyntaxKind - - CallSignature = 138, ->CallSignature : SyntaxKind - - ConstructSignature = 139, ->ConstructSignature : SyntaxKind - - IndexSignature = 140, ->IndexSignature : SyntaxKind - - TypeReference = 141, ->TypeReference : SyntaxKind - - FunctionType = 142, ->FunctionType : SyntaxKind - - ConstructorType = 143, ->ConstructorType : SyntaxKind - - TypeQuery = 144, ->TypeQuery : SyntaxKind - - TypeLiteral = 145, ->TypeLiteral : SyntaxKind - - ArrayType = 146, ->ArrayType : SyntaxKind - - TupleType = 147, ->TupleType : SyntaxKind - - UnionType = 148, ->UnionType : SyntaxKind - - ParenthesizedType = 149, ->ParenthesizedType : SyntaxKind - - ObjectBindingPattern = 150, ->ObjectBindingPattern : SyntaxKind - - ArrayBindingPattern = 151, ->ArrayBindingPattern : SyntaxKind - - BindingElement = 152, ->BindingElement : SyntaxKind - - ArrayLiteralExpression = 153, ->ArrayLiteralExpression : SyntaxKind - - ObjectLiteralExpression = 154, ->ObjectLiteralExpression : SyntaxKind - - PropertyAccessExpression = 155, ->PropertyAccessExpression : SyntaxKind - - ElementAccessExpression = 156, ->ElementAccessExpression : SyntaxKind - - CallExpression = 157, ->CallExpression : SyntaxKind - - NewExpression = 158, ->NewExpression : SyntaxKind - - TaggedTemplateExpression = 159, ->TaggedTemplateExpression : SyntaxKind - - TypeAssertionExpression = 160, ->TypeAssertionExpression : SyntaxKind - - ParenthesizedExpression = 161, ->ParenthesizedExpression : SyntaxKind - - FunctionExpression = 162, ->FunctionExpression : SyntaxKind - - ArrowFunction = 163, ->ArrowFunction : SyntaxKind - - DeleteExpression = 164, ->DeleteExpression : SyntaxKind - - TypeOfExpression = 165, ->TypeOfExpression : SyntaxKind - - VoidExpression = 166, ->VoidExpression : SyntaxKind - - PrefixUnaryExpression = 167, ->PrefixUnaryExpression : SyntaxKind - - PostfixUnaryExpression = 168, ->PostfixUnaryExpression : SyntaxKind - - BinaryExpression = 169, ->BinaryExpression : SyntaxKind - - ConditionalExpression = 170, ->ConditionalExpression : SyntaxKind - - TemplateExpression = 171, ->TemplateExpression : SyntaxKind - - YieldExpression = 172, ->YieldExpression : SyntaxKind - - SpreadElementExpression = 173, ->SpreadElementExpression : SyntaxKind - - OmittedExpression = 174, ->OmittedExpression : SyntaxKind - - TemplateSpan = 175, ->TemplateSpan : SyntaxKind - - Block = 176, ->Block : SyntaxKind - - VariableStatement = 177, ->VariableStatement : SyntaxKind - - EmptyStatement = 178, ->EmptyStatement : SyntaxKind - - ExpressionStatement = 179, ->ExpressionStatement : SyntaxKind - - IfStatement = 180, ->IfStatement : SyntaxKind - - DoStatement = 181, ->DoStatement : SyntaxKind - - WhileStatement = 182, ->WhileStatement : SyntaxKind - - ForStatement = 183, ->ForStatement : SyntaxKind - - ForInStatement = 184, ->ForInStatement : SyntaxKind - - ForOfStatement = 185, ->ForOfStatement : SyntaxKind - - ContinueStatement = 186, ->ContinueStatement : SyntaxKind - - BreakStatement = 187, ->BreakStatement : SyntaxKind - - ReturnStatement = 188, ->ReturnStatement : SyntaxKind - - WithStatement = 189, ->WithStatement : SyntaxKind - - SwitchStatement = 190, ->SwitchStatement : SyntaxKind - - LabeledStatement = 191, ->LabeledStatement : SyntaxKind - - ThrowStatement = 192, ->ThrowStatement : SyntaxKind - - TryStatement = 193, ->TryStatement : SyntaxKind - - DebuggerStatement = 194, ->DebuggerStatement : SyntaxKind - - VariableDeclaration = 195, ->VariableDeclaration : SyntaxKind - - VariableDeclarationList = 196, ->VariableDeclarationList : SyntaxKind - - FunctionDeclaration = 197, ->FunctionDeclaration : SyntaxKind - - ClassDeclaration = 198, ->ClassDeclaration : SyntaxKind - - InterfaceDeclaration = 199, ->InterfaceDeclaration : SyntaxKind - - TypeAliasDeclaration = 200, ->TypeAliasDeclaration : SyntaxKind - - EnumDeclaration = 201, ->EnumDeclaration : SyntaxKind - - ModuleDeclaration = 202, ->ModuleDeclaration : SyntaxKind - - ModuleBlock = 203, ->ModuleBlock : SyntaxKind - - CaseBlock = 204, ->CaseBlock : SyntaxKind - - ImportEqualsDeclaration = 205, ->ImportEqualsDeclaration : SyntaxKind - - ImportDeclaration = 206, ->ImportDeclaration : SyntaxKind - - ImportClause = 207, ->ImportClause : SyntaxKind - - NamespaceImport = 208, ->NamespaceImport : SyntaxKind - - NamedImports = 209, ->NamedImports : SyntaxKind - - ImportSpecifier = 210, ->ImportSpecifier : SyntaxKind - - ExportAssignment = 211, ->ExportAssignment : SyntaxKind - - ExportDeclaration = 212, ->ExportDeclaration : SyntaxKind - - NamedExports = 213, ->NamedExports : SyntaxKind - - ExportSpecifier = 214, ->ExportSpecifier : SyntaxKind - - MissingDeclaration = 215, ->MissingDeclaration : SyntaxKind - - ExternalModuleReference = 216, ->ExternalModuleReference : SyntaxKind - - CaseClause = 217, ->CaseClause : SyntaxKind - - DefaultClause = 218, ->DefaultClause : SyntaxKind - - HeritageClause = 219, ->HeritageClause : SyntaxKind - - CatchClause = 220, ->CatchClause : SyntaxKind - - PropertyAssignment = 221, ->PropertyAssignment : SyntaxKind - - ShorthandPropertyAssignment = 222, ->ShorthandPropertyAssignment : SyntaxKind - - EnumMember = 223, ->EnumMember : SyntaxKind - - SourceFile = 224, ->SourceFile : SyntaxKind - - SyntaxList = 225, ->SyntaxList : SyntaxKind - - Count = 226, ->Count : SyntaxKind - - FirstAssignment = 53, ->FirstAssignment : SyntaxKind - - LastAssignment = 64, ->LastAssignment : SyntaxKind - - FirstReservedWord = 66, ->FirstReservedWord : SyntaxKind - - LastReservedWord = 101, ->LastReservedWord : SyntaxKind - - FirstKeyword = 66, ->FirstKeyword : SyntaxKind - - LastKeyword = 125, ->LastKeyword : SyntaxKind - - FirstFutureReservedWord = 103, ->FirstFutureReservedWord : SyntaxKind - - LastFutureReservedWord = 111, ->LastFutureReservedWord : SyntaxKind - - FirstTypeNode = 141, ->FirstTypeNode : SyntaxKind - - LastTypeNode = 149, ->LastTypeNode : SyntaxKind - - FirstPunctuation = 14, ->FirstPunctuation : SyntaxKind - - LastPunctuation = 64, ->LastPunctuation : SyntaxKind - - FirstToken = 0, ->FirstToken : SyntaxKind - - LastToken = 125, ->LastToken : SyntaxKind - - FirstTriviaToken = 2, ->FirstTriviaToken : SyntaxKind - - LastTriviaToken = 6, ->LastTriviaToken : SyntaxKind - - FirstLiteralToken = 7, ->FirstLiteralToken : SyntaxKind - - LastLiteralToken = 10, ->LastLiteralToken : SyntaxKind - - FirstTemplateToken = 10, ->FirstTemplateToken : SyntaxKind - - LastTemplateToken = 13, ->LastTemplateToken : SyntaxKind - - FirstBinaryOperator = 24, ->FirstBinaryOperator : SyntaxKind - - LastBinaryOperator = 64, ->LastBinaryOperator : SyntaxKind - - FirstNode = 126, ->FirstNode : SyntaxKind - } - const enum NodeFlags { ->NodeFlags : NodeFlags - - Export = 1, ->Export : NodeFlags - - Ambient = 2, ->Ambient : NodeFlags - - Public = 16, ->Public : NodeFlags - - Private = 32, ->Private : NodeFlags - - Protected = 64, ->Protected : NodeFlags - - Static = 128, ->Static : NodeFlags - - Default = 256, ->Default : NodeFlags - - MultiLine = 512, ->MultiLine : NodeFlags - - Synthetic = 1024, ->Synthetic : NodeFlags - - DeclarationFile = 2048, ->DeclarationFile : NodeFlags - - Let = 4096, ->Let : NodeFlags - - Const = 8192, ->Const : NodeFlags - - OctalLiteral = 16384, ->OctalLiteral : NodeFlags - - ExportContext = 32768, ->ExportContext : NodeFlags - - Modifier = 499, ->Modifier : NodeFlags - - AccessibilityModifier = 112, ->AccessibilityModifier : NodeFlags - - BlockScoped = 12288, ->BlockScoped : NodeFlags - } - const enum ParserContextFlags { ->ParserContextFlags : ParserContextFlags - - StrictMode = 1, ->StrictMode : ParserContextFlags - - DisallowIn = 2, ->DisallowIn : ParserContextFlags - - Yield = 4, ->Yield : ParserContextFlags - - GeneratorParameter = 8, ->GeneratorParameter : ParserContextFlags - - Decorator = 16, ->Decorator : ParserContextFlags - - ThisNodeHasError = 32, ->ThisNodeHasError : ParserContextFlags - - ParserGeneratedFlags = 63, ->ParserGeneratedFlags : ParserContextFlags - - ThisNodeOrAnySubNodesHasError = 64, ->ThisNodeOrAnySubNodesHasError : ParserContextFlags - - HasAggregatedChildData = 128, ->HasAggregatedChildData : ParserContextFlags - } - const enum RelationComparisonResult { ->RelationComparisonResult : RelationComparisonResult - - Succeeded = 1, ->Succeeded : RelationComparisonResult - - Failed = 2, ->Failed : RelationComparisonResult - - FailedAndReported = 3, ->FailedAndReported : RelationComparisonResult - } - interface Node extends TextRange { ->Node : Node ->TextRange : TextRange - - kind: SyntaxKind; ->kind : SyntaxKind ->SyntaxKind : SyntaxKind - - flags: NodeFlags; ->flags : NodeFlags ->NodeFlags : NodeFlags - - parserContextFlags?: ParserContextFlags; ->parserContextFlags : ParserContextFlags ->ParserContextFlags : ParserContextFlags - - decorators?: NodeArray; ->decorators : NodeArray ->NodeArray : NodeArray ->Decorator : Decorator - - modifiers?: ModifiersArray; ->modifiers : ModifiersArray ->ModifiersArray : ModifiersArray - - id?: number; ->id : number - - parent?: Node; ->parent : Node ->Node : Node - - symbol?: Symbol; ->symbol : Symbol ->Symbol : Symbol - - locals?: SymbolTable; ->locals : SymbolTable ->SymbolTable : SymbolTable - - nextContainer?: Node; ->nextContainer : Node ->Node : Node - - localSymbol?: Symbol; ->localSymbol : Symbol ->Symbol : Symbol - } - interface NodeArray extends Array, TextRange { ->NodeArray : NodeArray ->T : T ->Array : T[] ->T : T ->TextRange : TextRange - - hasTrailingComma?: boolean; ->hasTrailingComma : boolean - } - interface ModifiersArray extends NodeArray { ->ModifiersArray : ModifiersArray ->NodeArray : NodeArray ->Node : Node - - flags: number; ->flags : number - } - interface Identifier extends PrimaryExpression { ->Identifier : Identifier ->PrimaryExpression : PrimaryExpression - - text: string; ->text : string - } - interface QualifiedName extends Node { ->QualifiedName : QualifiedName ->Node : Node - - left: EntityName; ->left : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName - - right: Identifier; ->right : Identifier ->Identifier : Identifier - } - type EntityName = Identifier | QualifiedName; ->EntityName : Identifier | QualifiedName ->Identifier : Identifier ->QualifiedName : QualifiedName - - type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName | BindingPattern; ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->Identifier : Identifier ->LiteralExpression : LiteralExpression ->ComputedPropertyName : ComputedPropertyName ->BindingPattern : BindingPattern - - interface Declaration extends Node { ->Declaration : Declaration ->Node : Node - - _declarationBrand: any; ->_declarationBrand : any - - name?: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - } - interface ComputedPropertyName extends Node { ->ComputedPropertyName : ComputedPropertyName ->Node : Node - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface Decorator extends Node { ->Decorator : Decorator ->Node : Node - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - } - interface TypeParameterDeclaration extends Declaration { ->TypeParameterDeclaration : TypeParameterDeclaration ->Declaration : Declaration - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - constraint?: TypeNode; ->constraint : TypeNode ->TypeNode : TypeNode - - expression?: Expression; ->expression : Expression ->Expression : Expression - } - interface SignatureDeclaration extends Declaration { ->SignatureDeclaration : SignatureDeclaration ->Declaration : Declaration - - typeParameters?: NodeArray; ->typeParameters : NodeArray ->NodeArray : NodeArray ->TypeParameterDeclaration : TypeParameterDeclaration - - parameters: NodeArray; ->parameters : NodeArray ->NodeArray : NodeArray ->ParameterDeclaration : ParameterDeclaration - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface VariableDeclaration extends Declaration { ->VariableDeclaration : VariableDeclaration ->Declaration : Declaration - - parent?: VariableDeclarationList; ->parent : VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList - - name: Identifier | BindingPattern; ->name : Identifier | BindingPattern ->Identifier : Identifier ->BindingPattern : BindingPattern - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface VariableDeclarationList extends Node { ->VariableDeclarationList : VariableDeclarationList ->Node : Node - - declarations: NodeArray; ->declarations : NodeArray ->NodeArray : NodeArray ->VariableDeclaration : VariableDeclaration - } - interface ParameterDeclaration extends Declaration { ->ParameterDeclaration : ParameterDeclaration ->Declaration : Declaration - - dotDotDotToken?: Node; ->dotDotDotToken : Node ->Node : Node - - name: Identifier | BindingPattern; ->name : Identifier | BindingPattern ->Identifier : Identifier ->BindingPattern : BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface BindingElement extends Declaration { ->BindingElement : BindingElement ->Declaration : Declaration - - propertyName?: Identifier; ->propertyName : Identifier ->Identifier : Identifier - - dotDotDotToken?: Node; ->dotDotDotToken : Node ->Node : Node - - name: Identifier | BindingPattern; ->name : Identifier | BindingPattern ->Identifier : Identifier ->BindingPattern : BindingPattern - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface PropertyDeclaration extends Declaration, ClassElement { ->PropertyDeclaration : PropertyDeclaration ->Declaration : Declaration ->ClassElement : ClassElement - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface ObjectLiteralElement extends Declaration { ->ObjectLiteralElement : ObjectLiteralElement ->Declaration : Declaration - - _objectLiteralBrandBrand: any; ->_objectLiteralBrandBrand : any - } - interface PropertyAssignment extends ObjectLiteralElement { ->PropertyAssignment : PropertyAssignment ->ObjectLiteralElement : ObjectLiteralElement - - _propertyAssignmentBrand: any; ->_propertyAssignmentBrand : any - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - initializer: Expression; ->initializer : Expression ->Expression : Expression - } - interface ShorthandPropertyAssignment extends ObjectLiteralElement { ->ShorthandPropertyAssignment : ShorthandPropertyAssignment ->ObjectLiteralElement : ObjectLiteralElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - questionToken?: Node; ->questionToken : Node ->Node : Node - } - interface VariableLikeDeclaration extends Declaration { ->VariableLikeDeclaration : VariableLikeDeclaration ->Declaration : Declaration - - propertyName?: Identifier; ->propertyName : Identifier ->Identifier : Identifier - - dotDotDotToken?: Node; ->dotDotDotToken : Node ->Node : Node - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface BindingPattern extends Node { ->BindingPattern : BindingPattern ->Node : Node - - elements: NodeArray; ->elements : NodeArray ->NodeArray : NodeArray ->BindingElement : BindingElement - } - /** - * Several node kinds share function-like features such as a signature, - * a name, and a body. These nodes should extend FunctionLikeDeclaration. - * Examples: - * FunctionDeclaration - * MethodDeclaration - * AccessorDeclaration - */ - interface FunctionLikeDeclaration extends SignatureDeclaration { ->FunctionLikeDeclaration : FunctionLikeDeclaration ->SignatureDeclaration : SignatureDeclaration - - _functionLikeDeclarationBrand: any; ->_functionLikeDeclarationBrand : any - - asteriskToken?: Node; ->asteriskToken : Node ->Node : Node - - questionToken?: Node; ->questionToken : Node ->Node : Node - - body?: Block | Expression; ->body : Expression | Block ->Block : Block ->Expression : Expression - } - interface FunctionDeclaration extends FunctionLikeDeclaration, Statement { ->FunctionDeclaration : FunctionDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->Statement : Statement - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - body?: Block; ->body : Block ->Block : Block - } - interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { ->MethodDeclaration : MethodDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->ClassElement : ClassElement ->ObjectLiteralElement : ObjectLiteralElement - - body?: Block; ->body : Block ->Block : Block - } - interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { ->ConstructorDeclaration : ConstructorDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->ClassElement : ClassElement - - body?: Block; ->body : Block ->Block : Block - } - interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { ->AccessorDeclaration : AccessorDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->ClassElement : ClassElement ->ObjectLiteralElement : ObjectLiteralElement - - _accessorDeclarationBrand: any; ->_accessorDeclarationBrand : any - - body: Block; ->body : Block ->Block : Block - } - interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement { ->IndexSignatureDeclaration : IndexSignatureDeclaration ->SignatureDeclaration : SignatureDeclaration ->ClassElement : ClassElement - - _indexSignatureDeclarationBrand: any; ->_indexSignatureDeclarationBrand : any - } - interface TypeNode extends Node { ->TypeNode : TypeNode ->Node : Node - - _typeNodeBrand: any; ->_typeNodeBrand : any - } - interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration { ->FunctionOrConstructorTypeNode : FunctionOrConstructorTypeNode ->TypeNode : TypeNode ->SignatureDeclaration : SignatureDeclaration - - _functionOrConstructorTypeNodeBrand: any; ->_functionOrConstructorTypeNodeBrand : any - } - interface TypeReferenceNode extends TypeNode { ->TypeReferenceNode : TypeReferenceNode ->TypeNode : TypeNode - - typeName: EntityName; ->typeName : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName - - typeArguments?: NodeArray; ->typeArguments : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface TypeQueryNode extends TypeNode { ->TypeQueryNode : TypeQueryNode ->TypeNode : TypeNode - - exprName: EntityName; ->exprName : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName - } - interface TypeLiteralNode extends TypeNode, Declaration { ->TypeLiteralNode : TypeLiteralNode ->TypeNode : TypeNode ->Declaration : Declaration - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->Node : Node - } - interface ArrayTypeNode extends TypeNode { ->ArrayTypeNode : ArrayTypeNode ->TypeNode : TypeNode - - elementType: TypeNode; ->elementType : TypeNode ->TypeNode : TypeNode - } - interface TupleTypeNode extends TypeNode { ->TupleTypeNode : TupleTypeNode ->TypeNode : TypeNode - - elementTypes: NodeArray; ->elementTypes : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface UnionTypeNode extends TypeNode { ->UnionTypeNode : UnionTypeNode ->TypeNode : TypeNode - - types: NodeArray; ->types : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface ParenthesizedTypeNode extends TypeNode { ->ParenthesizedTypeNode : ParenthesizedTypeNode ->TypeNode : TypeNode - - type: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface StringLiteralTypeNode extends LiteralExpression, TypeNode { ->StringLiteralTypeNode : StringLiteralTypeNode ->LiteralExpression : LiteralExpression ->TypeNode : TypeNode - } - interface Expression extends Node { ->Expression : Expression ->Node : Node - - _expressionBrand: any; ->_expressionBrand : any - - contextualType?: Type; ->contextualType : Type ->Type : Type - } - interface UnaryExpression extends Expression { ->UnaryExpression : UnaryExpression ->Expression : Expression - - _unaryExpressionBrand: any; ->_unaryExpressionBrand : any - } - interface PrefixUnaryExpression extends UnaryExpression { ->PrefixUnaryExpression : PrefixUnaryExpression ->UnaryExpression : UnaryExpression - - operator: SyntaxKind; ->operator : SyntaxKind ->SyntaxKind : SyntaxKind - - operand: UnaryExpression; ->operand : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface PostfixUnaryExpression extends PostfixExpression { ->PostfixUnaryExpression : PostfixUnaryExpression ->PostfixExpression : PostfixExpression - - operand: LeftHandSideExpression; ->operand : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - operator: SyntaxKind; ->operator : SyntaxKind ->SyntaxKind : SyntaxKind - } - interface PostfixExpression extends UnaryExpression { ->PostfixExpression : PostfixExpression ->UnaryExpression : UnaryExpression - - _postfixExpressionBrand: any; ->_postfixExpressionBrand : any - } - interface LeftHandSideExpression extends PostfixExpression { ->LeftHandSideExpression : LeftHandSideExpression ->PostfixExpression : PostfixExpression - - _leftHandSideExpressionBrand: any; ->_leftHandSideExpressionBrand : any - } - interface MemberExpression extends LeftHandSideExpression { ->MemberExpression : MemberExpression ->LeftHandSideExpression : LeftHandSideExpression - - _memberExpressionBrand: any; ->_memberExpressionBrand : any - } - interface PrimaryExpression extends MemberExpression { ->PrimaryExpression : PrimaryExpression ->MemberExpression : MemberExpression - - _primaryExpressionBrand: any; ->_primaryExpressionBrand : any - } - interface DeleteExpression extends UnaryExpression { ->DeleteExpression : DeleteExpression ->UnaryExpression : UnaryExpression - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface TypeOfExpression extends UnaryExpression { ->TypeOfExpression : TypeOfExpression ->UnaryExpression : UnaryExpression - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface VoidExpression extends UnaryExpression { ->VoidExpression : VoidExpression ->UnaryExpression : UnaryExpression - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface YieldExpression extends Expression { ->YieldExpression : YieldExpression ->Expression : Expression - - asteriskToken?: Node; ->asteriskToken : Node ->Node : Node - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface BinaryExpression extends Expression { ->BinaryExpression : BinaryExpression ->Expression : Expression - - left: Expression; ->left : Expression ->Expression : Expression - - operatorToken: Node; ->operatorToken : Node ->Node : Node - - right: Expression; ->right : Expression ->Expression : Expression - } - interface ConditionalExpression extends Expression { ->ConditionalExpression : ConditionalExpression ->Expression : Expression - - condition: Expression; ->condition : Expression ->Expression : Expression - - questionToken: Node; ->questionToken : Node ->Node : Node - - whenTrue: Expression; ->whenTrue : Expression ->Expression : Expression - - colonToken: Node; ->colonToken : Node ->Node : Node - - whenFalse: Expression; ->whenFalse : Expression ->Expression : Expression - } - interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration { ->FunctionExpression : FunctionExpression ->PrimaryExpression : PrimaryExpression ->FunctionLikeDeclaration : FunctionLikeDeclaration - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - body: Block | Expression; ->body : Expression | Block ->Block : Block ->Expression : Expression - } - interface ArrowFunction extends Expression, FunctionLikeDeclaration { ->ArrowFunction : ArrowFunction ->Expression : Expression ->FunctionLikeDeclaration : FunctionLikeDeclaration - - equalsGreaterThanToken: Node; ->equalsGreaterThanToken : Node ->Node : Node - } - interface LiteralExpression extends PrimaryExpression { ->LiteralExpression : LiteralExpression ->PrimaryExpression : PrimaryExpression - - text: string; ->text : string - - isUnterminated?: boolean; ->isUnterminated : boolean - - hasExtendedUnicodeEscape?: boolean; ->hasExtendedUnicodeEscape : boolean - } - interface StringLiteralExpression extends LiteralExpression { ->StringLiteralExpression : StringLiteralExpression ->LiteralExpression : LiteralExpression - - _stringLiteralExpressionBrand: any; ->_stringLiteralExpressionBrand : any - } - interface TemplateExpression extends PrimaryExpression { ->TemplateExpression : TemplateExpression ->PrimaryExpression : PrimaryExpression - - head: LiteralExpression; ->head : LiteralExpression ->LiteralExpression : LiteralExpression - - templateSpans: NodeArray; ->templateSpans : NodeArray ->NodeArray : NodeArray ->TemplateSpan : TemplateSpan - } - interface TemplateSpan extends Node { ->TemplateSpan : TemplateSpan ->Node : Node - - expression: Expression; ->expression : Expression ->Expression : Expression - - literal: LiteralExpression; ->literal : LiteralExpression ->LiteralExpression : LiteralExpression - } - interface ParenthesizedExpression extends PrimaryExpression { ->ParenthesizedExpression : ParenthesizedExpression ->PrimaryExpression : PrimaryExpression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ArrayLiteralExpression extends PrimaryExpression { ->ArrayLiteralExpression : ArrayLiteralExpression ->PrimaryExpression : PrimaryExpression - - elements: NodeArray; ->elements : NodeArray ->NodeArray : NodeArray ->Expression : Expression - } - interface SpreadElementExpression extends Expression { ->SpreadElementExpression : SpreadElementExpression ->Expression : Expression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ObjectLiteralExpression extends PrimaryExpression, Declaration { ->ObjectLiteralExpression : ObjectLiteralExpression ->PrimaryExpression : PrimaryExpression ->Declaration : Declaration - - properties: NodeArray; ->properties : NodeArray ->NodeArray : NodeArray ->ObjectLiteralElement : ObjectLiteralElement - } - interface PropertyAccessExpression extends MemberExpression { ->PropertyAccessExpression : PropertyAccessExpression ->MemberExpression : MemberExpression - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - dotToken: Node; ->dotToken : Node ->Node : Node - - name: Identifier; ->name : Identifier ->Identifier : Identifier - } - interface ElementAccessExpression extends MemberExpression { ->ElementAccessExpression : ElementAccessExpression ->MemberExpression : MemberExpression - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - argumentExpression?: Expression; ->argumentExpression : Expression ->Expression : Expression - } - interface CallExpression extends LeftHandSideExpression { ->CallExpression : CallExpression ->LeftHandSideExpression : LeftHandSideExpression - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - typeArguments?: NodeArray; ->typeArguments : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - - arguments: NodeArray; ->arguments : NodeArray ->NodeArray : NodeArray ->Expression : Expression - } - interface NewExpression extends CallExpression, PrimaryExpression { ->NewExpression : NewExpression ->CallExpression : CallExpression ->PrimaryExpression : PrimaryExpression - } - interface TaggedTemplateExpression extends MemberExpression { ->TaggedTemplateExpression : TaggedTemplateExpression ->MemberExpression : MemberExpression - - tag: LeftHandSideExpression; ->tag : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - template: LiteralExpression | TemplateExpression; ->template : LiteralExpression | TemplateExpression ->LiteralExpression : LiteralExpression ->TemplateExpression : TemplateExpression - } - type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression; ->CallLikeExpression : CallExpression | NewExpression | TaggedTemplateExpression ->CallExpression : CallExpression ->NewExpression : NewExpression ->TaggedTemplateExpression : TaggedTemplateExpression - - interface TypeAssertion extends UnaryExpression { ->TypeAssertion : TypeAssertion ->UnaryExpression : UnaryExpression - - type: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface Statement extends Node, ModuleElement { ->Statement : Statement ->Node : Node ->ModuleElement : ModuleElement - - _statementBrand: any; ->_statementBrand : any - } - interface Block extends Statement { ->Block : Block ->Statement : Statement - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->Statement : Statement - } - interface VariableStatement extends Statement { ->VariableStatement : VariableStatement ->Statement : Statement - - declarationList: VariableDeclarationList; ->declarationList : VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList - } - interface ExpressionStatement extends Statement { ->ExpressionStatement : ExpressionStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface IfStatement extends Statement { ->IfStatement : IfStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - - thenStatement: Statement; ->thenStatement : Statement ->Statement : Statement - - elseStatement?: Statement; ->elseStatement : Statement ->Statement : Statement - } - interface IterationStatement extends Statement { ->IterationStatement : IterationStatement ->Statement : Statement - - statement: Statement; ->statement : Statement ->Statement : Statement - } - interface DoStatement extends IterationStatement { ->DoStatement : DoStatement ->IterationStatement : IterationStatement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface WhileStatement extends IterationStatement { ->WhileStatement : WhileStatement ->IterationStatement : IterationStatement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ForStatement extends IterationStatement { ->ForStatement : ForStatement ->IterationStatement : IterationStatement - - initializer?: VariableDeclarationList | Expression; ->initializer : Expression | VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList ->Expression : Expression - - condition?: Expression; ->condition : Expression ->Expression : Expression - - iterator?: Expression; ->iterator : Expression ->Expression : Expression - } - interface ForInStatement extends IterationStatement { ->ForInStatement : ForInStatement ->IterationStatement : IterationStatement - - initializer: VariableDeclarationList | Expression; ->initializer : Expression | VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList ->Expression : Expression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ForOfStatement extends IterationStatement { ->ForOfStatement : ForOfStatement ->IterationStatement : IterationStatement - - initializer: VariableDeclarationList | Expression; ->initializer : Expression | VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList ->Expression : Expression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface BreakOrContinueStatement extends Statement { ->BreakOrContinueStatement : BreakOrContinueStatement ->Statement : Statement - - label?: Identifier; ->label : Identifier ->Identifier : Identifier - } - interface ReturnStatement extends Statement { ->ReturnStatement : ReturnStatement ->Statement : Statement - - expression?: Expression; ->expression : Expression ->Expression : Expression - } - interface WithStatement extends Statement { ->WithStatement : WithStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - - statement: Statement; ->statement : Statement ->Statement : Statement - } - interface SwitchStatement extends Statement { ->SwitchStatement : SwitchStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - - caseBlock: CaseBlock; ->caseBlock : CaseBlock ->CaseBlock : CaseBlock - } - interface CaseBlock extends Node { ->CaseBlock : CaseBlock ->Node : Node - - clauses: NodeArray; ->clauses : NodeArray ->NodeArray : NodeArray ->CaseOrDefaultClause : CaseClause | DefaultClause - } - interface CaseClause extends Node { ->CaseClause : CaseClause ->Node : Node - - expression?: Expression; ->expression : Expression ->Expression : Expression - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->Statement : Statement - } - interface DefaultClause extends Node { ->DefaultClause : DefaultClause ->Node : Node - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->Statement : Statement - } - type CaseOrDefaultClause = CaseClause | DefaultClause; ->CaseOrDefaultClause : CaseClause | DefaultClause ->CaseClause : CaseClause ->DefaultClause : DefaultClause - - interface LabeledStatement extends Statement { ->LabeledStatement : LabeledStatement ->Statement : Statement - - label: Identifier; ->label : Identifier ->Identifier : Identifier - - statement: Statement; ->statement : Statement ->Statement : Statement - } - interface ThrowStatement extends Statement { ->ThrowStatement : ThrowStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface TryStatement extends Statement { ->TryStatement : TryStatement ->Statement : Statement - - tryBlock: Block; ->tryBlock : Block ->Block : Block - - catchClause?: CatchClause; ->catchClause : CatchClause ->CatchClause : CatchClause - - finallyBlock?: Block; ->finallyBlock : Block ->Block : Block - } - interface CatchClause extends Node { ->CatchClause : CatchClause ->Node : Node - - variableDeclaration: VariableDeclaration; ->variableDeclaration : VariableDeclaration ->VariableDeclaration : VariableDeclaration - - block: Block; ->block : Block ->Block : Block - } - interface ModuleElement extends Node { ->ModuleElement : ModuleElement ->Node : Node - - _moduleElementBrand: any; ->_moduleElementBrand : any - } - interface ClassDeclaration extends Declaration, ModuleElement { ->ClassDeclaration : ClassDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - typeParameters?: NodeArray; ->typeParameters : NodeArray ->NodeArray : NodeArray ->TypeParameterDeclaration : TypeParameterDeclaration - - heritageClauses?: NodeArray; ->heritageClauses : NodeArray ->NodeArray : NodeArray ->HeritageClause : HeritageClause - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->ClassElement : ClassElement - } - interface ClassElement extends Declaration { ->ClassElement : ClassElement ->Declaration : Declaration - - _classElementBrand: any; ->_classElementBrand : any - } - interface InterfaceDeclaration extends Declaration, ModuleElement { ->InterfaceDeclaration : InterfaceDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - typeParameters?: NodeArray; ->typeParameters : NodeArray ->NodeArray : NodeArray ->TypeParameterDeclaration : TypeParameterDeclaration - - heritageClauses?: NodeArray; ->heritageClauses : NodeArray ->NodeArray : NodeArray ->HeritageClause : HeritageClause - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->Declaration : Declaration - } - interface HeritageClause extends Node { ->HeritageClause : HeritageClause ->Node : Node - - token: SyntaxKind; ->token : SyntaxKind ->SyntaxKind : SyntaxKind - - types?: NodeArray; ->types : NodeArray ->NodeArray : NodeArray ->TypeReferenceNode : TypeReferenceNode - } - interface TypeAliasDeclaration extends Declaration, ModuleElement { ->TypeAliasDeclaration : TypeAliasDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - type: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface EnumMember extends Declaration { ->EnumMember : EnumMember ->Declaration : Declaration - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface EnumDeclaration extends Declaration, ModuleElement { ->EnumDeclaration : EnumDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->EnumMember : EnumMember - } - interface ModuleDeclaration extends Declaration, ModuleElement { ->ModuleDeclaration : ModuleDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier | LiteralExpression; ->name : Identifier | LiteralExpression ->Identifier : Identifier ->LiteralExpression : LiteralExpression - - body: ModuleBlock | ModuleDeclaration; ->body : ModuleDeclaration | ModuleBlock ->ModuleBlock : ModuleBlock ->ModuleDeclaration : ModuleDeclaration - } - interface ModuleBlock extends Node, ModuleElement { ->ModuleBlock : ModuleBlock ->Node : Node ->ModuleElement : ModuleElement - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->ModuleElement : ModuleElement - } - interface ImportEqualsDeclaration extends Declaration, ModuleElement { ->ImportEqualsDeclaration : ImportEqualsDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - moduleReference: EntityName | ExternalModuleReference; ->moduleReference : Identifier | QualifiedName | ExternalModuleReference ->EntityName : Identifier | QualifiedName ->ExternalModuleReference : ExternalModuleReference - } - interface ExternalModuleReference extends Node { ->ExternalModuleReference : ExternalModuleReference ->Node : Node - - expression?: Expression; ->expression : Expression ->Expression : Expression - } - interface ImportDeclaration extends Statement, ModuleElement { ->ImportDeclaration : ImportDeclaration ->Statement : Statement ->ModuleElement : ModuleElement - - importClause?: ImportClause; ->importClause : ImportClause ->ImportClause : ImportClause - - moduleSpecifier: Expression; ->moduleSpecifier : Expression ->Expression : Expression - } - interface ImportClause extends Declaration { ->ImportClause : ImportClause ->Declaration : Declaration - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - namedBindings?: NamespaceImport | NamedImports; ->namedBindings : NamespaceImport | NamedImportsOrExports ->NamespaceImport : NamespaceImport ->NamedImports : NamedImportsOrExports - } - interface NamespaceImport extends Declaration { ->NamespaceImport : NamespaceImport ->Declaration : Declaration - - name: Identifier; ->name : Identifier ->Identifier : Identifier - } - interface ExportDeclaration extends Declaration, ModuleElement { ->ExportDeclaration : ExportDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - exportClause?: NamedExports; ->exportClause : NamedImportsOrExports ->NamedExports : NamedImportsOrExports - - moduleSpecifier?: Expression; ->moduleSpecifier : Expression ->Expression : Expression - } - interface NamedImportsOrExports extends Node { ->NamedImportsOrExports : NamedImportsOrExports ->Node : Node - - elements: NodeArray; ->elements : NodeArray ->NodeArray : NodeArray ->ImportOrExportSpecifier : ImportOrExportSpecifier - } - type NamedImports = NamedImportsOrExports; ->NamedImports : NamedImportsOrExports ->NamedImportsOrExports : NamedImportsOrExports - - type NamedExports = NamedImportsOrExports; ->NamedExports : NamedImportsOrExports ->NamedImportsOrExports : NamedImportsOrExports - - interface ImportOrExportSpecifier extends Declaration { ->ImportOrExportSpecifier : ImportOrExportSpecifier ->Declaration : Declaration - - propertyName?: Identifier; ->propertyName : Identifier ->Identifier : Identifier - - name: Identifier; ->name : Identifier ->Identifier : Identifier - } - type ImportSpecifier = ImportOrExportSpecifier; ->ImportSpecifier : ImportOrExportSpecifier ->ImportOrExportSpecifier : ImportOrExportSpecifier - - type ExportSpecifier = ImportOrExportSpecifier; ->ExportSpecifier : ImportOrExportSpecifier ->ImportOrExportSpecifier : ImportOrExportSpecifier - - interface ExportAssignment extends Declaration, ModuleElement { ->ExportAssignment : ExportAssignment ->Declaration : Declaration ->ModuleElement : ModuleElement - - isExportEquals?: boolean; ->isExportEquals : boolean - - expression?: Expression; ->expression : Expression ->Expression : Expression - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface FileReference extends TextRange { ->FileReference : FileReference ->TextRange : TextRange - - fileName: string; ->fileName : string - } - interface CommentRange extends TextRange { ->CommentRange : CommentRange ->TextRange : TextRange - - hasTrailingNewLine?: boolean; ->hasTrailingNewLine : boolean - } - interface SourceFile extends Declaration { ->SourceFile : SourceFile ->Declaration : Declaration - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->ModuleElement : ModuleElement - - endOfFileToken: Node; ->endOfFileToken : Node ->Node : Node - - fileName: string; ->fileName : string - - text: string; ->text : string - - amdDependencies: { ->amdDependencies : { path: string; name: string; }[] - - path: string; ->path : string - - name: string; ->name : string - - }[]; - amdModuleName: string; ->amdModuleName : string - - referencedFiles: FileReference[]; ->referencedFiles : FileReference[] ->FileReference : FileReference - - hasNoDefaultLib: boolean; ->hasNoDefaultLib : boolean - - externalModuleIndicator: Node; ->externalModuleIndicator : Node ->Node : Node - - languageVersion: ScriptTarget; ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget - - identifiers: Map; ->identifiers : Map ->Map : Map - } - interface ScriptReferenceHost { ->ScriptReferenceHost : ScriptReferenceHost - - getCompilerOptions(): CompilerOptions; ->getCompilerOptions : () => CompilerOptions ->CompilerOptions : CompilerOptions - - getSourceFile(fileName: string): SourceFile; ->getSourceFile : (fileName: string) => SourceFile ->fileName : string ->SourceFile : SourceFile - - getCurrentDirectory(): string; ->getCurrentDirectory : () => string - } - interface WriteFileCallback { ->WriteFileCallback : WriteFileCallback - - (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; ->fileName : string ->data : string ->writeByteOrderMark : boolean ->onError : (message: string) => void ->message : string - } - interface Program extends ScriptReferenceHost { ->Program : Program ->ScriptReferenceHost : ScriptReferenceHost - - getSourceFiles(): SourceFile[]; ->getSourceFiles : () => SourceFile[] ->SourceFile : SourceFile - - /** - * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then - * the JavaScript and declaration files will be produced for all the files in this program. - * If targetSourceFile is specified, then only the JavaScript and declaration for that - * specific file will be generated. - * - * If writeFile is not specified then the writeFile callback from the compiler host will be - * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter - * will be invoked when writing the JavaScript and declaration files. - */ - emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback): EmitResult; ->emit : (targetSourceFile?: SourceFile, writeFile?: WriteFileCallback) => EmitResult ->targetSourceFile : SourceFile ->SourceFile : SourceFile ->writeFile : WriteFileCallback ->WriteFileCallback : WriteFileCallback ->EmitResult : EmitResult - - getSyntacticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; ->getSyntacticDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Diagnostic : Diagnostic - - getGlobalDiagnostics(): Diagnostic[]; ->getGlobalDiagnostics : () => Diagnostic[] ->Diagnostic : Diagnostic - - getSemanticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; ->getSemanticDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Diagnostic : Diagnostic - - getDeclarationDiagnostics(sourceFile?: SourceFile): Diagnostic[]; ->getDeclarationDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Diagnostic : Diagnostic - - getTypeChecker(): TypeChecker; ->getTypeChecker : () => TypeChecker ->TypeChecker : TypeChecker - - getCommonSourceDirectory(): string; ->getCommonSourceDirectory : () => string - } - interface SourceMapSpan { ->SourceMapSpan : SourceMapSpan - - emittedLine: number; ->emittedLine : number - - emittedColumn: number; ->emittedColumn : number - - sourceLine: number; ->sourceLine : number - - sourceColumn: number; ->sourceColumn : number - - nameIndex?: number; ->nameIndex : number - - sourceIndex: number; ->sourceIndex : number - } - interface SourceMapData { ->SourceMapData : SourceMapData - - sourceMapFilePath: string; ->sourceMapFilePath : string - - jsSourceMappingURL: string; ->jsSourceMappingURL : string - - sourceMapFile: string; ->sourceMapFile : string - - sourceMapSourceRoot: string; ->sourceMapSourceRoot : string - - sourceMapSources: string[]; ->sourceMapSources : string[] - - inputSourceFileNames: string[]; ->inputSourceFileNames : string[] - - sourceMapNames?: string[]; ->sourceMapNames : string[] - - sourceMapMappings: string; ->sourceMapMappings : string - - sourceMapDecodedMappings: SourceMapSpan[]; ->sourceMapDecodedMappings : SourceMapSpan[] ->SourceMapSpan : SourceMapSpan - } - enum ExitStatus { ->ExitStatus : ExitStatus - - Success = 0, ->Success : ExitStatus - - DiagnosticsPresent_OutputsSkipped = 1, ->DiagnosticsPresent_OutputsSkipped : ExitStatus - - DiagnosticsPresent_OutputsGenerated = 2, ->DiagnosticsPresent_OutputsGenerated : ExitStatus - } - interface EmitResult { ->EmitResult : EmitResult - - emitSkipped: boolean; ->emitSkipped : boolean - - diagnostics: Diagnostic[]; ->diagnostics : Diagnostic[] ->Diagnostic : Diagnostic - - sourceMaps: SourceMapData[]; ->sourceMaps : SourceMapData[] ->SourceMapData : SourceMapData - } - interface TypeCheckerHost { ->TypeCheckerHost : TypeCheckerHost - - getCompilerOptions(): CompilerOptions; ->getCompilerOptions : () => CompilerOptions ->CompilerOptions : CompilerOptions - - getSourceFiles(): SourceFile[]; ->getSourceFiles : () => SourceFile[] ->SourceFile : SourceFile - - getSourceFile(fileName: string): SourceFile; ->getSourceFile : (fileName: string) => SourceFile ->fileName : string ->SourceFile : SourceFile - } - interface TypeChecker { ->TypeChecker : TypeChecker - - getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; ->getTypeOfSymbolAtLocation : (symbol: Symbol, node: Node) => Type ->symbol : Symbol ->Symbol : Symbol ->node : Node ->Node : Node ->Type : Type - - getDeclaredTypeOfSymbol(symbol: Symbol): Type; ->getDeclaredTypeOfSymbol : (symbol: Symbol) => Type ->symbol : Symbol ->Symbol : Symbol ->Type : Type - - getPropertiesOfType(type: Type): Symbol[]; ->getPropertiesOfType : (type: Type) => Symbol[] ->type : Type ->Type : Type ->Symbol : Symbol - - getPropertyOfType(type: Type, propertyName: string): Symbol; ->getPropertyOfType : (type: Type, propertyName: string) => Symbol ->type : Type ->Type : Type ->propertyName : string ->Symbol : Symbol - - getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; ->getSignaturesOfType : (type: Type, kind: SignatureKind) => Signature[] ->type : Type ->Type : Type ->kind : SignatureKind ->SignatureKind : SignatureKind ->Signature : Signature - - getIndexTypeOfType(type: Type, kind: IndexKind): Type; ->getIndexTypeOfType : (type: Type, kind: IndexKind) => Type ->type : Type ->Type : Type ->kind : IndexKind ->IndexKind : IndexKind ->Type : Type - - getReturnTypeOfSignature(signature: Signature): Type; ->getReturnTypeOfSignature : (signature: Signature) => Type ->signature : Signature ->Signature : Signature ->Type : Type - - getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; ->getSymbolsInScope : (location: Node, meaning: SymbolFlags) => Symbol[] ->location : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags ->Symbol : Symbol - - getSymbolAtLocation(node: Node): Symbol; ->getSymbolAtLocation : (node: Node) => Symbol ->node : Node ->Node : Node ->Symbol : Symbol - - getShorthandAssignmentValueSymbol(location: Node): Symbol; ->getShorthandAssignmentValueSymbol : (location: Node) => Symbol ->location : Node ->Node : Node ->Symbol : Symbol - - getTypeAtLocation(node: Node): Type; ->getTypeAtLocation : (node: Node) => Type ->node : Node ->Node : Node ->Type : Type - - typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; ->typeToString : (type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => string ->type : Type ->Type : Type ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; ->symbolToString : (symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) => string ->symbol : Symbol ->Symbol : Symbol ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags - - getSymbolDisplayBuilder(): SymbolDisplayBuilder; ->getSymbolDisplayBuilder : () => SymbolDisplayBuilder ->SymbolDisplayBuilder : SymbolDisplayBuilder - - getFullyQualifiedName(symbol: Symbol): string; ->getFullyQualifiedName : (symbol: Symbol) => string ->symbol : Symbol ->Symbol : Symbol - - getAugmentedPropertiesOfType(type: Type): Symbol[]; ->getAugmentedPropertiesOfType : (type: Type) => Symbol[] ->type : Type ->Type : Type ->Symbol : Symbol - - getRootSymbols(symbol: Symbol): Symbol[]; ->getRootSymbols : (symbol: Symbol) => Symbol[] ->symbol : Symbol ->Symbol : Symbol ->Symbol : Symbol - - getContextualType(node: Expression): Type; ->getContextualType : (node: Expression) => Type ->node : Expression ->Expression : Expression ->Type : Type - - getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature; ->getResolvedSignature : (node: CallExpression | NewExpression | TaggedTemplateExpression, candidatesOutArray?: Signature[]) => Signature ->node : CallExpression | NewExpression | TaggedTemplateExpression ->CallLikeExpression : CallExpression | NewExpression | TaggedTemplateExpression ->candidatesOutArray : Signature[] ->Signature : Signature ->Signature : Signature - - getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature; ->getSignatureFromDeclaration : (declaration: SignatureDeclaration) => Signature ->declaration : SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration ->Signature : Signature - - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; ->isImplementationOfOverload : (node: FunctionLikeDeclaration) => boolean ->node : FunctionLikeDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration - - isUndefinedSymbol(symbol: Symbol): boolean; ->isUndefinedSymbol : (symbol: Symbol) => boolean ->symbol : Symbol ->Symbol : Symbol - - isArgumentsSymbol(symbol: Symbol): boolean; ->isArgumentsSymbol : (symbol: Symbol) => boolean ->symbol : Symbol ->Symbol : Symbol - - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; ->getConstantValue : (node: PropertyAccessExpression | ElementAccessExpression | EnumMember) => number ->node : PropertyAccessExpression | ElementAccessExpression | EnumMember ->EnumMember : EnumMember ->PropertyAccessExpression : PropertyAccessExpression ->ElementAccessExpression : ElementAccessExpression - - isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; ->isValidPropertyAccess : (node: QualifiedName | PropertyAccessExpression, propertyName: string) => boolean ->node : QualifiedName | PropertyAccessExpression ->PropertyAccessExpression : PropertyAccessExpression ->QualifiedName : QualifiedName ->propertyName : string - - getAliasedSymbol(symbol: Symbol): Symbol; ->getAliasedSymbol : (symbol: Symbol) => Symbol ->symbol : Symbol ->Symbol : Symbol ->Symbol : Symbol - - getExportsOfExternalModule(node: ImportDeclaration): Symbol[]; ->getExportsOfExternalModule : (node: ImportDeclaration) => Symbol[] ->node : ImportDeclaration ->ImportDeclaration : ImportDeclaration ->Symbol : Symbol - } - interface SymbolDisplayBuilder { ->SymbolDisplayBuilder : SymbolDisplayBuilder - - buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildTypeDisplay : (type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->type : Type ->Type : Type ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; ->buildSymbolDisplay : (symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags) => void ->symbol : Symbol ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags ->flags : SymbolFormatFlags ->SymbolFormatFlags : SymbolFormatFlags - - buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildSignatureDisplay : (signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->signatures : Signature ->Signature : Signature ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildParameterDisplay : (parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->parameter : Symbol ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildTypeParameterDisplay : (tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->tp : TypeParameter ->TypeParameter : TypeParameter ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags): void; ->buildTypeParameterDisplayFromSymbol : (symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags) => void ->symbol : Symbol ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaraiton : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildDisplayForParametersAndDelimiters(parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildDisplayForParametersAndDelimiters : (parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->parameters : Symbol[] ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildDisplayForTypeParametersAndDelimiters : (typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->typeParameters : TypeParameter[] ->TypeParameter : TypeParameter ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildReturnTypeDisplay : (signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->signature : Signature ->Signature : Signature ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - } - interface SymbolWriter { ->SymbolWriter : SymbolWriter - - writeKeyword(text: string): void; ->writeKeyword : (text: string) => void ->text : string - - writeOperator(text: string): void; ->writeOperator : (text: string) => void ->text : string - - writePunctuation(text: string): void; ->writePunctuation : (text: string) => void ->text : string - - writeSpace(text: string): void; ->writeSpace : (text: string) => void ->text : string - - writeStringLiteral(text: string): void; ->writeStringLiteral : (text: string) => void ->text : string - - writeParameter(text: string): void; ->writeParameter : (text: string) => void ->text : string - - writeSymbol(text: string, symbol: Symbol): void; ->writeSymbol : (text: string, symbol: Symbol) => void ->text : string ->symbol : Symbol ->Symbol : Symbol - - writeLine(): void; ->writeLine : () => void - - increaseIndent(): void; ->increaseIndent : () => void - - decreaseIndent(): void; ->decreaseIndent : () => void - - clear(): void; ->clear : () => void - - trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; ->trackSymbol : (symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) => void ->symbol : Symbol ->Symbol : Symbol ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags - } - const enum TypeFormatFlags { ->TypeFormatFlags : TypeFormatFlags - - None = 0, ->None : TypeFormatFlags - - WriteArrayAsGenericType = 1, ->WriteArrayAsGenericType : TypeFormatFlags - - UseTypeOfFunction = 2, ->UseTypeOfFunction : TypeFormatFlags - - NoTruncation = 4, ->NoTruncation : TypeFormatFlags - - WriteArrowStyleSignature = 8, ->WriteArrowStyleSignature : TypeFormatFlags - - WriteOwnNameForAnyLike = 16, ->WriteOwnNameForAnyLike : TypeFormatFlags - - WriteTypeArgumentsOfSignature = 32, ->WriteTypeArgumentsOfSignature : TypeFormatFlags - - InElementType = 64, ->InElementType : TypeFormatFlags - - UseFullyQualifiedType = 128, ->UseFullyQualifiedType : TypeFormatFlags - } - const enum SymbolFormatFlags { ->SymbolFormatFlags : SymbolFormatFlags - - None = 0, ->None : SymbolFormatFlags - - WriteTypeParametersOrArguments = 1, ->WriteTypeParametersOrArguments : SymbolFormatFlags - - UseOnlyExternalAliasing = 2, ->UseOnlyExternalAliasing : SymbolFormatFlags - } - const enum SymbolAccessibility { ->SymbolAccessibility : SymbolAccessibility - - Accessible = 0, ->Accessible : SymbolAccessibility - - NotAccessible = 1, ->NotAccessible : SymbolAccessibility - - CannotBeNamed = 2, ->CannotBeNamed : SymbolAccessibility - } - type AnyImportSyntax = ImportDeclaration | ImportEqualsDeclaration; ->AnyImportSyntax : ImportEqualsDeclaration | ImportDeclaration ->ImportDeclaration : ImportDeclaration ->ImportEqualsDeclaration : ImportEqualsDeclaration - - interface SymbolVisibilityResult { ->SymbolVisibilityResult : SymbolVisibilityResult - - accessibility: SymbolAccessibility; ->accessibility : SymbolAccessibility ->SymbolAccessibility : SymbolAccessibility - - aliasesToMakeVisible?: AnyImportSyntax[]; ->aliasesToMakeVisible : (ImportEqualsDeclaration | ImportDeclaration)[] ->AnyImportSyntax : ImportEqualsDeclaration | ImportDeclaration - - errorSymbolName?: string; ->errorSymbolName : string - - errorNode?: Node; ->errorNode : Node ->Node : Node - } - interface SymbolAccessiblityResult extends SymbolVisibilityResult { ->SymbolAccessiblityResult : SymbolAccessiblityResult ->SymbolVisibilityResult : SymbolVisibilityResult - - errorModuleName?: string; ->errorModuleName : string - } - interface EmitResolver { ->EmitResolver : EmitResolver - - hasGlobalName(name: string): boolean; ->hasGlobalName : (name: string) => boolean ->name : string - - getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string; ->getExpressionNameSubstitution : (node: Identifier, getGeneratedNameForNode: (node: Node) => string) => string ->node : Identifier ->Identifier : Identifier ->getGeneratedNameForNode : (node: Node) => string ->node : Node ->Node : Node - - isValueAliasDeclaration(node: Node): boolean; ->isValueAliasDeclaration : (node: Node) => boolean ->node : Node ->Node : Node - - isReferencedAliasDeclaration(node: Node, checkChildren?: boolean): boolean; ->isReferencedAliasDeclaration : (node: Node, checkChildren?: boolean) => boolean ->node : Node ->Node : Node ->checkChildren : boolean - - isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; ->isTopLevelValueImportEqualsWithEntityName : (node: ImportEqualsDeclaration) => boolean ->node : ImportEqualsDeclaration ->ImportEqualsDeclaration : ImportEqualsDeclaration - - getNodeCheckFlags(node: Node): NodeCheckFlags; ->getNodeCheckFlags : (node: Node) => NodeCheckFlags ->node : Node ->Node : Node ->NodeCheckFlags : NodeCheckFlags - - isDeclarationVisible(node: Declaration): boolean; ->isDeclarationVisible : (node: Declaration) => boolean ->node : Declaration ->Declaration : Declaration - - collectLinkedAliases(node: Identifier): Node[]; ->collectLinkedAliases : (node: Identifier) => Node[] ->node : Identifier ->Identifier : Identifier ->Node : Node - - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; ->isImplementationOfOverload : (node: FunctionLikeDeclaration) => boolean ->node : FunctionLikeDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration - - writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; ->writeTypeOfDeclaration : (declaration: VariableLikeDeclaration | AccessorDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void ->declaration : VariableLikeDeclaration | AccessorDeclaration ->AccessorDeclaration : AccessorDeclaration ->VariableLikeDeclaration : VariableLikeDeclaration ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags ->writer : SymbolWriter ->SymbolWriter : SymbolWriter - - writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; ->writeReturnTypeOfSignatureDeclaration : (signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void ->signatureDeclaration : SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags ->writer : SymbolWriter ->SymbolWriter : SymbolWriter - - writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; ->writeTypeOfExpression : (expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void ->expr : Expression ->Expression : Expression ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags ->writer : SymbolWriter ->SymbolWriter : SymbolWriter - - isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult; ->isSymbolAccessible : (symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags) => SymbolAccessiblityResult ->symbol : Symbol ->Symbol : Symbol ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags ->SymbolAccessiblityResult : SymbolAccessiblityResult - - isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult; ->isEntityNameVisible : (entityName: Identifier | QualifiedName, enclosingDeclaration: Node) => SymbolVisibilityResult ->entityName : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName ->enclosingDeclaration : Node ->Node : Node ->SymbolVisibilityResult : SymbolVisibilityResult - - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; ->getConstantValue : (node: PropertyAccessExpression | ElementAccessExpression | EnumMember) => number ->node : PropertyAccessExpression | ElementAccessExpression | EnumMember ->EnumMember : EnumMember ->PropertyAccessExpression : PropertyAccessExpression ->ElementAccessExpression : ElementAccessExpression - - resolvesToSomeValue(location: Node, name: string): boolean; ->resolvesToSomeValue : (location: Node, name: string) => boolean ->location : Node ->Node : Node ->name : string - - getBlockScopedVariableId(node: Identifier): number; ->getBlockScopedVariableId : (node: Identifier) => number ->node : Identifier ->Identifier : Identifier - } - const enum SymbolFlags { ->SymbolFlags : SymbolFlags - - FunctionScopedVariable = 1, ->FunctionScopedVariable : SymbolFlags - - BlockScopedVariable = 2, ->BlockScopedVariable : SymbolFlags - - Property = 4, ->Property : SymbolFlags - - EnumMember = 8, ->EnumMember : SymbolFlags - - Function = 16, ->Function : SymbolFlags - - Class = 32, ->Class : SymbolFlags - - Interface = 64, ->Interface : SymbolFlags - - ConstEnum = 128, ->ConstEnum : SymbolFlags - - RegularEnum = 256, ->RegularEnum : SymbolFlags - - ValueModule = 512, ->ValueModule : SymbolFlags - - NamespaceModule = 1024, ->NamespaceModule : SymbolFlags - - TypeLiteral = 2048, ->TypeLiteral : SymbolFlags - - ObjectLiteral = 4096, ->ObjectLiteral : SymbolFlags - - Method = 8192, ->Method : SymbolFlags - - Constructor = 16384, ->Constructor : SymbolFlags - - GetAccessor = 32768, ->GetAccessor : SymbolFlags - - SetAccessor = 65536, ->SetAccessor : SymbolFlags - - Signature = 131072, ->Signature : SymbolFlags - - TypeParameter = 262144, ->TypeParameter : SymbolFlags - - TypeAlias = 524288, ->TypeAlias : SymbolFlags - - ExportValue = 1048576, ->ExportValue : SymbolFlags - - ExportType = 2097152, ->ExportType : SymbolFlags - - ExportNamespace = 4194304, ->ExportNamespace : SymbolFlags - - Alias = 8388608, ->Alias : SymbolFlags - - Instantiated = 16777216, ->Instantiated : SymbolFlags - - Merged = 33554432, ->Merged : SymbolFlags - - Transient = 67108864, ->Transient : SymbolFlags - - Prototype = 134217728, ->Prototype : SymbolFlags - - UnionProperty = 268435456, ->UnionProperty : SymbolFlags - - Optional = 536870912, ->Optional : SymbolFlags - - ExportStar = 1073741824, ->ExportStar : SymbolFlags - - Enum = 384, ->Enum : SymbolFlags - - Variable = 3, ->Variable : SymbolFlags - - Value = 107455, ->Value : SymbolFlags - - Type = 793056, ->Type : SymbolFlags - - Namespace = 1536, ->Namespace : SymbolFlags - - Module = 1536, ->Module : SymbolFlags - - Accessor = 98304, ->Accessor : SymbolFlags - - FunctionScopedVariableExcludes = 107454, ->FunctionScopedVariableExcludes : SymbolFlags - - BlockScopedVariableExcludes = 107455, ->BlockScopedVariableExcludes : SymbolFlags - - ParameterExcludes = 107455, ->ParameterExcludes : SymbolFlags - - PropertyExcludes = 107455, ->PropertyExcludes : SymbolFlags - - EnumMemberExcludes = 107455, ->EnumMemberExcludes : SymbolFlags - - FunctionExcludes = 106927, ->FunctionExcludes : SymbolFlags - - ClassExcludes = 899583, ->ClassExcludes : SymbolFlags - - InterfaceExcludes = 792992, ->InterfaceExcludes : SymbolFlags - - RegularEnumExcludes = 899327, ->RegularEnumExcludes : SymbolFlags - - ConstEnumExcludes = 899967, ->ConstEnumExcludes : SymbolFlags - - ValueModuleExcludes = 106639, ->ValueModuleExcludes : SymbolFlags - - NamespaceModuleExcludes = 0, ->NamespaceModuleExcludes : SymbolFlags - - MethodExcludes = 99263, ->MethodExcludes : SymbolFlags - - GetAccessorExcludes = 41919, ->GetAccessorExcludes : SymbolFlags - - SetAccessorExcludes = 74687, ->SetAccessorExcludes : SymbolFlags - - TypeParameterExcludes = 530912, ->TypeParameterExcludes : SymbolFlags - - TypeAliasExcludes = 793056, ->TypeAliasExcludes : SymbolFlags - - AliasExcludes = 8388608, ->AliasExcludes : SymbolFlags - - ModuleMember = 8914931, ->ModuleMember : SymbolFlags - - ExportHasLocal = 944, ->ExportHasLocal : SymbolFlags - - HasLocals = 255504, ->HasLocals : SymbolFlags - - HasExports = 1952, ->HasExports : SymbolFlags - - HasMembers = 6240, ->HasMembers : SymbolFlags - - IsContainer = 262128, ->IsContainer : SymbolFlags - - PropertyOrAccessor = 98308, ->PropertyOrAccessor : SymbolFlags - - Export = 7340032, ->Export : SymbolFlags - } - interface Symbol { ->Symbol : Symbol - - flags: SymbolFlags; ->flags : SymbolFlags ->SymbolFlags : SymbolFlags - - name: string; ->name : string - - id?: number; ->id : number - - mergeId?: number; ->mergeId : number - - declarations?: Declaration[]; ->declarations : Declaration[] ->Declaration : Declaration - - parent?: Symbol; ->parent : Symbol ->Symbol : Symbol - - members?: SymbolTable; ->members : SymbolTable ->SymbolTable : SymbolTable - - exports?: SymbolTable; ->exports : SymbolTable ->SymbolTable : SymbolTable - - exportSymbol?: Symbol; ->exportSymbol : Symbol ->Symbol : Symbol - - valueDeclaration?: Declaration; ->valueDeclaration : Declaration ->Declaration : Declaration - - constEnumOnlyModule?: boolean; ->constEnumOnlyModule : boolean - } - interface SymbolLinks { ->SymbolLinks : SymbolLinks - - target?: Symbol; ->target : Symbol ->Symbol : Symbol - - type?: Type; ->type : Type ->Type : Type - - declaredType?: Type; ->declaredType : Type ->Type : Type - - mapper?: TypeMapper; ->mapper : TypeMapper ->TypeMapper : TypeMapper - - referenced?: boolean; ->referenced : boolean - - unionType?: UnionType; ->unionType : UnionType ->UnionType : UnionType - - resolvedExports?: SymbolTable; ->resolvedExports : SymbolTable ->SymbolTable : SymbolTable - - exportsChecked?: boolean; ->exportsChecked : boolean - } - interface TransientSymbol extends Symbol, SymbolLinks { ->TransientSymbol : TransientSymbol ->Symbol : Symbol ->SymbolLinks : SymbolLinks - } - interface SymbolTable { ->SymbolTable : SymbolTable - - [index: string]: Symbol; ->index : string ->Symbol : Symbol - } - const enum NodeCheckFlags { ->NodeCheckFlags : NodeCheckFlags - - TypeChecked = 1, ->TypeChecked : NodeCheckFlags - - LexicalThis = 2, ->LexicalThis : NodeCheckFlags - - CaptureThis = 4, ->CaptureThis : NodeCheckFlags - - EmitExtends = 8, ->EmitExtends : NodeCheckFlags - - SuperInstance = 16, ->SuperInstance : NodeCheckFlags - - SuperStatic = 32, ->SuperStatic : NodeCheckFlags - - ContextChecked = 64, ->ContextChecked : NodeCheckFlags - - EnumValuesComputed = 128, ->EnumValuesComputed : NodeCheckFlags - - BlockScopedBindingInLoop = 256, ->BlockScopedBindingInLoop : NodeCheckFlags - - EmitDecorate = 512, ->EmitDecorate : NodeCheckFlags - } - interface NodeLinks { ->NodeLinks : NodeLinks - - resolvedType?: Type; ->resolvedType : Type ->Type : Type - - resolvedSignature?: Signature; ->resolvedSignature : Signature ->Signature : Signature - - resolvedSymbol?: Symbol; ->resolvedSymbol : Symbol ->Symbol : Symbol - - flags?: NodeCheckFlags; ->flags : NodeCheckFlags ->NodeCheckFlags : NodeCheckFlags - - enumMemberValue?: number; ->enumMemberValue : number - - isIllegalTypeReferenceInConstraint?: boolean; ->isIllegalTypeReferenceInConstraint : boolean - - isVisible?: boolean; ->isVisible : boolean - - generatedName?: string; ->generatedName : string - - generatedNames?: Map; ->generatedNames : Map ->Map : Map - - assignmentChecks?: Map; ->assignmentChecks : Map ->Map : Map - - hasReportedStatementInAmbientContext?: boolean; ->hasReportedStatementInAmbientContext : boolean - - importOnRightSide?: Symbol; ->importOnRightSide : Symbol ->Symbol : Symbol - } - const enum TypeFlags { ->TypeFlags : TypeFlags - - Any = 1, ->Any : TypeFlags - - String = 2, ->String : TypeFlags - - Number = 4, ->Number : TypeFlags - - Boolean = 8, ->Boolean : TypeFlags - - Void = 16, ->Void : TypeFlags - - Undefined = 32, ->Undefined : TypeFlags - - Null = 64, ->Null : TypeFlags - - Enum = 128, ->Enum : TypeFlags - - StringLiteral = 256, ->StringLiteral : TypeFlags - - TypeParameter = 512, ->TypeParameter : TypeFlags - - Class = 1024, ->Class : TypeFlags - - Interface = 2048, ->Interface : TypeFlags - - Reference = 4096, ->Reference : TypeFlags - - Tuple = 8192, ->Tuple : TypeFlags - - Union = 16384, ->Union : TypeFlags - - Anonymous = 32768, ->Anonymous : TypeFlags - - FromSignature = 65536, ->FromSignature : TypeFlags - - ObjectLiteral = 131072, ->ObjectLiteral : TypeFlags - - ContainsUndefinedOrNull = 262144, ->ContainsUndefinedOrNull : TypeFlags - - ContainsObjectLiteral = 524288, ->ContainsObjectLiteral : TypeFlags - - ESSymbol = 1048576, ->ESSymbol : TypeFlags - - Intrinsic = 1048703, ->Intrinsic : TypeFlags - - Primitive = 1049086, ->Primitive : TypeFlags - - StringLike = 258, ->StringLike : TypeFlags - - NumberLike = 132, ->NumberLike : TypeFlags - - ObjectType = 48128, ->ObjectType : TypeFlags - - RequiresWidening = 786432, ->RequiresWidening : TypeFlags - } - interface Type { ->Type : Type - - flags: TypeFlags; ->flags : TypeFlags ->TypeFlags : TypeFlags - - id: number; ->id : number - - symbol?: Symbol; ->symbol : Symbol ->Symbol : Symbol - } - interface IntrinsicType extends Type { ->IntrinsicType : IntrinsicType ->Type : Type - - intrinsicName: string; ->intrinsicName : string - } - interface StringLiteralType extends Type { ->StringLiteralType : StringLiteralType ->Type : Type - - text: string; ->text : string - } - interface ObjectType extends Type { ->ObjectType : ObjectType ->Type : Type - } - interface InterfaceType extends ObjectType { ->InterfaceType : InterfaceType ->ObjectType : ObjectType - - typeParameters: TypeParameter[]; ->typeParameters : TypeParameter[] ->TypeParameter : TypeParameter - - baseTypes: ObjectType[]; ->baseTypes : ObjectType[] ->ObjectType : ObjectType - - declaredProperties: Symbol[]; ->declaredProperties : Symbol[] ->Symbol : Symbol - - declaredCallSignatures: Signature[]; ->declaredCallSignatures : Signature[] ->Signature : Signature - - declaredConstructSignatures: Signature[]; ->declaredConstructSignatures : Signature[] ->Signature : Signature - - declaredStringIndexType: Type; ->declaredStringIndexType : Type ->Type : Type - - declaredNumberIndexType: Type; ->declaredNumberIndexType : Type ->Type : Type - } - interface TypeReference extends ObjectType { ->TypeReference : TypeReference ->ObjectType : ObjectType - - target: GenericType; ->target : GenericType ->GenericType : GenericType - - typeArguments: Type[]; ->typeArguments : Type[] ->Type : Type - } - interface GenericType extends InterfaceType, TypeReference { ->GenericType : GenericType ->InterfaceType : InterfaceType ->TypeReference : TypeReference - - instantiations: Map; ->instantiations : Map ->Map : Map ->TypeReference : TypeReference - } - interface TupleType extends ObjectType { ->TupleType : TupleType ->ObjectType : ObjectType - - elementTypes: Type[]; ->elementTypes : Type[] ->Type : Type - - baseArrayType: TypeReference; ->baseArrayType : TypeReference ->TypeReference : TypeReference - } - interface UnionType extends Type { ->UnionType : UnionType ->Type : Type - - types: Type[]; ->types : Type[] ->Type : Type - - resolvedProperties: SymbolTable; ->resolvedProperties : SymbolTable ->SymbolTable : SymbolTable - } - interface ResolvedType extends ObjectType, UnionType { ->ResolvedType : ResolvedType ->ObjectType : ObjectType ->UnionType : UnionType - - members: SymbolTable; ->members : SymbolTable ->SymbolTable : SymbolTable - - properties: Symbol[]; ->properties : Symbol[] ->Symbol : Symbol - - callSignatures: Signature[]; ->callSignatures : Signature[] ->Signature : Signature - - constructSignatures: Signature[]; ->constructSignatures : Signature[] ->Signature : Signature - - stringIndexType: Type; ->stringIndexType : Type ->Type : Type - - numberIndexType: Type; ->numberIndexType : Type ->Type : Type - } - interface TypeParameter extends Type { ->TypeParameter : TypeParameter ->Type : Type - - constraint: Type; ->constraint : Type ->Type : Type - - target?: TypeParameter; ->target : TypeParameter ->TypeParameter : TypeParameter - - mapper?: TypeMapper; ->mapper : TypeMapper ->TypeMapper : TypeMapper - } - const enum SignatureKind { ->SignatureKind : SignatureKind - - Call = 0, ->Call : SignatureKind - - Construct = 1, ->Construct : SignatureKind - } - interface Signature { ->Signature : Signature - - declaration: SignatureDeclaration; ->declaration : SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration - - typeParameters: TypeParameter[]; ->typeParameters : TypeParameter[] ->TypeParameter : TypeParameter - - parameters: Symbol[]; ->parameters : Symbol[] ->Symbol : Symbol - - resolvedReturnType: Type; ->resolvedReturnType : Type ->Type : Type - - minArgumentCount: number; ->minArgumentCount : number - - hasRestParameter: boolean; ->hasRestParameter : boolean - - hasStringLiterals: boolean; ->hasStringLiterals : boolean - - target?: Signature; ->target : Signature ->Signature : Signature - - mapper?: TypeMapper; ->mapper : TypeMapper ->TypeMapper : TypeMapper - - unionSignatures?: Signature[]; ->unionSignatures : Signature[] ->Signature : Signature - - erasedSignatureCache?: Signature; ->erasedSignatureCache : Signature ->Signature : Signature - - isolatedSignatureType?: ObjectType; ->isolatedSignatureType : ObjectType ->ObjectType : ObjectType - } - const enum IndexKind { ->IndexKind : IndexKind - - String = 0, ->String : IndexKind - - Number = 1, ->Number : IndexKind - } - interface TypeMapper { ->TypeMapper : TypeMapper - - (t: Type): Type; ->t : Type ->Type : Type ->Type : Type - } - interface DiagnosticMessage { ->DiagnosticMessage : DiagnosticMessage - - key: string; ->key : string - - category: DiagnosticCategory; ->category : DiagnosticCategory ->DiagnosticCategory : DiagnosticCategory - - code: number; ->code : number - } - interface DiagnosticMessageChain { ->DiagnosticMessageChain : DiagnosticMessageChain - - messageText: string; ->messageText : string - - category: DiagnosticCategory; ->category : DiagnosticCategory ->DiagnosticCategory : DiagnosticCategory - - code: number; ->code : number - - next?: DiagnosticMessageChain; ->next : DiagnosticMessageChain ->DiagnosticMessageChain : DiagnosticMessageChain - } - interface Diagnostic { ->Diagnostic : Diagnostic - - file: SourceFile; ->file : SourceFile ->SourceFile : SourceFile - - start: number; ->start : number - - length: number; ->length : number - - messageText: string | DiagnosticMessageChain; ->messageText : string | DiagnosticMessageChain ->DiagnosticMessageChain : DiagnosticMessageChain - - category: DiagnosticCategory; ->category : DiagnosticCategory ->DiagnosticCategory : DiagnosticCategory - - code: number; ->code : number - } - enum DiagnosticCategory { ->DiagnosticCategory : DiagnosticCategory - - Warning = 0, ->Warning : DiagnosticCategory - - Error = 1, ->Error : DiagnosticCategory - - Message = 2, ->Message : DiagnosticCategory - } - interface CompilerOptions { ->CompilerOptions : CompilerOptions - - allowNonTsExtensions?: boolean; ->allowNonTsExtensions : boolean - - charset?: string; ->charset : string - - codepage?: number; ->codepage : number - - declaration?: boolean; ->declaration : boolean - - diagnostics?: boolean; ->diagnostics : boolean - - emitBOM?: boolean; ->emitBOM : boolean - - help?: boolean; ->help : boolean - - listFiles?: boolean; ->listFiles : boolean - - locale?: string; ->locale : string - - mapRoot?: string; ->mapRoot : string - - module?: ModuleKind; ->module : ModuleKind ->ModuleKind : ModuleKind - - noEmit?: boolean; ->noEmit : boolean - - noEmitOnError?: boolean; ->noEmitOnError : boolean - - noErrorTruncation?: boolean; ->noErrorTruncation : boolean - - noImplicitAny?: boolean; ->noImplicitAny : boolean - - noLib?: boolean; ->noLib : boolean - - noLibCheck?: boolean; ->noLibCheck : boolean - - noResolve?: boolean; ->noResolve : boolean - - out?: string; ->out : string - - outDir?: string; ->outDir : string - - preserveConstEnums?: boolean; ->preserveConstEnums : boolean - - project?: string; ->project : string - - removeComments?: boolean; ->removeComments : boolean - - sourceMap?: boolean; ->sourceMap : boolean - - sourceRoot?: string; ->sourceRoot : string - - suppressImplicitAnyIndexErrors?: boolean; ->suppressImplicitAnyIndexErrors : boolean - - target?: ScriptTarget; ->target : ScriptTarget ->ScriptTarget : ScriptTarget - - version?: boolean; ->version : boolean - - watch?: boolean; ->watch : boolean - - [option: string]: string | number | boolean; ->option : string - } - const enum ModuleKind { ->ModuleKind : ModuleKind - - None = 0, ->None : ModuleKind - - CommonJS = 1, ->CommonJS : ModuleKind - - AMD = 2, ->AMD : ModuleKind - } - interface LineAndCharacter { ->LineAndCharacter : LineAndCharacter - - line: number; ->line : number - - character: number; ->character : number - } - const enum ScriptTarget { ->ScriptTarget : ScriptTarget - - ES3 = 0, ->ES3 : ScriptTarget - - ES5 = 1, ->ES5 : ScriptTarget - - ES6 = 2, ->ES6 : ScriptTarget - - Latest = 2, ->Latest : ScriptTarget - } - interface ParsedCommandLine { ->ParsedCommandLine : ParsedCommandLine - - options: CompilerOptions; ->options : CompilerOptions ->CompilerOptions : CompilerOptions - - fileNames: string[]; ->fileNames : string[] - - errors: Diagnostic[]; ->errors : Diagnostic[] ->Diagnostic : Diagnostic - } - interface CommandLineOption { ->CommandLineOption : CommandLineOption - - name: string; ->name : string - - type: string | Map; ->type : string | Map ->Map : Map - - isFilePath?: boolean; ->isFilePath : boolean - - shortName?: string; ->shortName : string - - description?: DiagnosticMessage; ->description : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage - - paramType?: DiagnosticMessage; ->paramType : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage - - error?: DiagnosticMessage; ->error : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage - - experimental?: boolean; ->experimental : boolean - } - const enum CharacterCodes { ->CharacterCodes : CharacterCodes - - nullCharacter = 0, ->nullCharacter : CharacterCodes - - maxAsciiCharacter = 127, ->maxAsciiCharacter : CharacterCodes - - lineFeed = 10, ->lineFeed : CharacterCodes - - carriageReturn = 13, ->carriageReturn : CharacterCodes - - lineSeparator = 8232, ->lineSeparator : CharacterCodes - - paragraphSeparator = 8233, ->paragraphSeparator : CharacterCodes - - nextLine = 133, ->nextLine : CharacterCodes - - space = 32, ->space : CharacterCodes - - nonBreakingSpace = 160, ->nonBreakingSpace : CharacterCodes - - enQuad = 8192, ->enQuad : CharacterCodes - - emQuad = 8193, ->emQuad : CharacterCodes - - enSpace = 8194, ->enSpace : CharacterCodes - - emSpace = 8195, ->emSpace : CharacterCodes - - threePerEmSpace = 8196, ->threePerEmSpace : CharacterCodes - - fourPerEmSpace = 8197, ->fourPerEmSpace : CharacterCodes - - sixPerEmSpace = 8198, ->sixPerEmSpace : CharacterCodes - - figureSpace = 8199, ->figureSpace : CharacterCodes - - punctuationSpace = 8200, ->punctuationSpace : CharacterCodes - - thinSpace = 8201, ->thinSpace : CharacterCodes - - hairSpace = 8202, ->hairSpace : CharacterCodes - - zeroWidthSpace = 8203, ->zeroWidthSpace : CharacterCodes - - narrowNoBreakSpace = 8239, ->narrowNoBreakSpace : CharacterCodes - - ideographicSpace = 12288, ->ideographicSpace : CharacterCodes - - mathematicalSpace = 8287, ->mathematicalSpace : CharacterCodes - - ogham = 5760, ->ogham : CharacterCodes - - _ = 95, ->_ : CharacterCodes - - $ = 36, ->$ : CharacterCodes - - _0 = 48, ->_0 : CharacterCodes - - _1 = 49, ->_1 : CharacterCodes - - _2 = 50, ->_2 : CharacterCodes - - _3 = 51, ->_3 : CharacterCodes - - _4 = 52, ->_4 : CharacterCodes - - _5 = 53, ->_5 : CharacterCodes - - _6 = 54, ->_6 : CharacterCodes - - _7 = 55, ->_7 : CharacterCodes - - _8 = 56, ->_8 : CharacterCodes - - _9 = 57, ->_9 : CharacterCodes - - a = 97, ->a : CharacterCodes - - b = 98, ->b : CharacterCodes - - c = 99, ->c : CharacterCodes - - d = 100, ->d : CharacterCodes - - e = 101, ->e : CharacterCodes - - f = 102, ->f : CharacterCodes - - g = 103, ->g : CharacterCodes - - h = 104, ->h : CharacterCodes - - i = 105, ->i : CharacterCodes - - j = 106, ->j : CharacterCodes - - k = 107, ->k : CharacterCodes - - l = 108, ->l : CharacterCodes - - m = 109, ->m : CharacterCodes - - n = 110, ->n : CharacterCodes - - o = 111, ->o : CharacterCodes - - p = 112, ->p : CharacterCodes - - q = 113, ->q : CharacterCodes - - r = 114, ->r : CharacterCodes - - s = 115, ->s : CharacterCodes - - t = 116, ->t : CharacterCodes - - u = 117, ->u : CharacterCodes - - v = 118, ->v : CharacterCodes - - w = 119, ->w : CharacterCodes - - x = 120, ->x : CharacterCodes - - y = 121, ->y : CharacterCodes - - z = 122, ->z : CharacterCodes - - A = 65, ->A : CharacterCodes - - B = 66, ->B : CharacterCodes - - C = 67, ->C : CharacterCodes - - D = 68, ->D : CharacterCodes - - E = 69, ->E : CharacterCodes - - F = 70, ->F : CharacterCodes - - G = 71, ->G : CharacterCodes - - H = 72, ->H : CharacterCodes - - I = 73, ->I : CharacterCodes - - J = 74, ->J : CharacterCodes - - K = 75, ->K : CharacterCodes - - L = 76, ->L : CharacterCodes - - M = 77, ->M : CharacterCodes - - N = 78, ->N : CharacterCodes - - O = 79, ->O : CharacterCodes - - P = 80, ->P : CharacterCodes - - Q = 81, ->Q : CharacterCodes - - R = 82, ->R : CharacterCodes - - S = 83, ->S : CharacterCodes - - T = 84, ->T : CharacterCodes - - U = 85, ->U : CharacterCodes - - V = 86, ->V : CharacterCodes - - W = 87, ->W : CharacterCodes - - X = 88, ->X : CharacterCodes - - Y = 89, ->Y : CharacterCodes - - Z = 90, ->Z : CharacterCodes - - ampersand = 38, ->ampersand : CharacterCodes - - asterisk = 42, ->asterisk : CharacterCodes - - at = 64, ->at : CharacterCodes - - backslash = 92, ->backslash : CharacterCodes - - backtick = 96, ->backtick : CharacterCodes - - bar = 124, ->bar : CharacterCodes - - caret = 94, ->caret : CharacterCodes - - closeBrace = 125, ->closeBrace : CharacterCodes - - closeBracket = 93, ->closeBracket : CharacterCodes - - closeParen = 41, ->closeParen : CharacterCodes - - colon = 58, ->colon : CharacterCodes - - comma = 44, ->comma : CharacterCodes - - dot = 46, ->dot : CharacterCodes - - doubleQuote = 34, ->doubleQuote : CharacterCodes - - equals = 61, ->equals : CharacterCodes - - exclamation = 33, ->exclamation : CharacterCodes - - greaterThan = 62, ->greaterThan : CharacterCodes - - hash = 35, ->hash : CharacterCodes - - lessThan = 60, ->lessThan : CharacterCodes - - minus = 45, ->minus : CharacterCodes - - openBrace = 123, ->openBrace : CharacterCodes - - openBracket = 91, ->openBracket : CharacterCodes - - openParen = 40, ->openParen : CharacterCodes - - percent = 37, ->percent : CharacterCodes - - plus = 43, ->plus : CharacterCodes - - question = 63, ->question : CharacterCodes - - semicolon = 59, ->semicolon : CharacterCodes - - singleQuote = 39, ->singleQuote : CharacterCodes - - slash = 47, ->slash : CharacterCodes - - tilde = 126, ->tilde : CharacterCodes - - backspace = 8, ->backspace : CharacterCodes - - formFeed = 12, ->formFeed : CharacterCodes - - byteOrderMark = 65279, ->byteOrderMark : CharacterCodes - - tab = 9, ->tab : CharacterCodes - - verticalTab = 11, ->verticalTab : CharacterCodes - } - interface CancellationToken { ->CancellationToken : CancellationToken - - isCancellationRequested(): boolean; ->isCancellationRequested : () => boolean - } - interface CompilerHost { ->CompilerHost : CompilerHost - - getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile; ->getSourceFile : (fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void) => SourceFile ->fileName : string ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget ->onError : (message: string) => void ->message : string ->SourceFile : SourceFile - - getDefaultLibFileName(options: CompilerOptions): string; ->getDefaultLibFileName : (options: CompilerOptions) => string ->options : CompilerOptions ->CompilerOptions : CompilerOptions - - getCancellationToken?(): CancellationToken; ->getCancellationToken : () => CancellationToken ->CancellationToken : CancellationToken - - writeFile: WriteFileCallback; ->writeFile : WriteFileCallback ->WriteFileCallback : WriteFileCallback - - getCurrentDirectory(): string; ->getCurrentDirectory : () => string - - getCanonicalFileName(fileName: string): string; ->getCanonicalFileName : (fileName: string) => string ->fileName : string - - useCaseSensitiveFileNames(): boolean; ->useCaseSensitiveFileNames : () => boolean - - getNewLine(): string; ->getNewLine : () => string - } - interface TextSpan { ->TextSpan : TextSpan - - start: number; ->start : number - - length: number; ->length : number - } - interface TextChangeRange { ->TextChangeRange : TextChangeRange - - span: TextSpan; ->span : TextSpan ->TextSpan : TextSpan - - newLength: number; ->newLength : number - } -} -declare module "typescript" { - interface ErrorCallback { ->ErrorCallback : ErrorCallback - - (message: DiagnosticMessage, length: number): void; ->message : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage ->length : number - } - interface Scanner { ->Scanner : Scanner - - getStartPos(): number; ->getStartPos : () => number - - getToken(): SyntaxKind; ->getToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - getTextPos(): number; ->getTextPos : () => number - - getTokenPos(): number; ->getTokenPos : () => number - - getTokenText(): string; ->getTokenText : () => string - - getTokenValue(): string; ->getTokenValue : () => string - - hasExtendedUnicodeEscape(): boolean; ->hasExtendedUnicodeEscape : () => boolean - - hasPrecedingLineBreak(): boolean; ->hasPrecedingLineBreak : () => boolean - - isIdentifier(): boolean; ->isIdentifier : () => boolean - - isReservedWord(): boolean; ->isReservedWord : () => boolean - - isUnterminated(): boolean; ->isUnterminated : () => boolean - - reScanGreaterToken(): SyntaxKind; ->reScanGreaterToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - reScanSlashToken(): SyntaxKind; ->reScanSlashToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - reScanTemplateToken(): SyntaxKind; ->reScanTemplateToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - scan(): SyntaxKind; ->scan : () => SyntaxKind ->SyntaxKind : SyntaxKind - - setText(text: string): void; ->setText : (text: string) => void ->text : string - - setTextPos(textPos: number): void; ->setTextPos : (textPos: number) => void ->textPos : number - - lookAhead(callback: () => T): T; ->lookAhead : (callback: () => T) => T ->T : T ->callback : () => T ->T : T ->T : T - - tryScan(callback: () => T): T; ->tryScan : (callback: () => T) => T ->T : T ->callback : () => T ->T : T ->T : T - } - function tokenToString(t: SyntaxKind): string; ->tokenToString : (t: SyntaxKind) => string ->t : SyntaxKind ->SyntaxKind : SyntaxKind - - function computeLineStarts(text: string): number[]; ->computeLineStarts : (text: string) => number[] ->text : string - - function getPositionOfLineAndCharacter(sourceFile: SourceFile, line: number, character: number): number; ->getPositionOfLineAndCharacter : (sourceFile: SourceFile, line: number, character: number) => number ->sourceFile : SourceFile ->SourceFile : SourceFile ->line : number ->character : number - - function computePositionOfLineAndCharacter(lineStarts: number[], line: number, character: number): number; ->computePositionOfLineAndCharacter : (lineStarts: number[], line: number, character: number) => number ->lineStarts : number[] ->line : number ->character : number - - function getLineStarts(sourceFile: SourceFile): number[]; ->getLineStarts : (sourceFile: SourceFile) => number[] ->sourceFile : SourceFile ->SourceFile : SourceFile - - function computeLineAndCharacterOfPosition(lineStarts: number[], position: number): { ->computeLineAndCharacterOfPosition : (lineStarts: number[], position: number) => { line: number; character: number; } ->lineStarts : number[] ->position : number - - line: number; ->line : number - - character: number; ->character : number - - }; - function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter; ->getLineAndCharacterOfPosition : (sourceFile: SourceFile, position: number) => LineAndCharacter ->sourceFile : SourceFile ->SourceFile : SourceFile ->position : number ->LineAndCharacter : LineAndCharacter - - function isWhiteSpace(ch: number): boolean; ->isWhiteSpace : (ch: number) => boolean ->ch : number - - function isLineBreak(ch: number): boolean; ->isLineBreak : (ch: number) => boolean ->ch : number - - function isOctalDigit(ch: number): boolean; ->isOctalDigit : (ch: number) => boolean ->ch : number - - function skipTrivia(text: string, pos: number, stopAfterLineBreak?: boolean): number; ->skipTrivia : (text: string, pos: number, stopAfterLineBreak?: boolean) => number ->text : string ->pos : number ->stopAfterLineBreak : boolean - - function getLeadingCommentRanges(text: string, pos: number): CommentRange[]; ->getLeadingCommentRanges : (text: string, pos: number) => CommentRange[] ->text : string ->pos : number ->CommentRange : CommentRange - - function getTrailingCommentRanges(text: string, pos: number): CommentRange[]; ->getTrailingCommentRanges : (text: string, pos: number) => CommentRange[] ->text : string ->pos : number ->CommentRange : CommentRange - - function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean; ->isIdentifierStart : (ch: number, languageVersion: ScriptTarget) => boolean ->ch : number ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget - - function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean; ->isIdentifierPart : (ch: number, languageVersion: ScriptTarget) => boolean ->ch : number ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget - - function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback): Scanner; ->createScanner : (languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback) => Scanner ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget ->skipTrivia : boolean ->text : string ->onError : ErrorCallback ->ErrorCallback : ErrorCallback ->Scanner : Scanner -} -declare module "typescript" { - function getNodeConstructor(kind: SyntaxKind): new () => Node; ->getNodeConstructor : (kind: SyntaxKind) => new () => Node ->kind : SyntaxKind ->SyntaxKind : SyntaxKind ->Node : Node - - function createNode(kind: SyntaxKind): Node; ->createNode : (kind: SyntaxKind) => Node ->kind : SyntaxKind ->SyntaxKind : SyntaxKind ->Node : Node - - function forEachChild(node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; ->forEachChild : (node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T) => T ->T : T ->node : Node ->Node : Node ->cbNode : (node: Node) => T ->node : Node ->Node : Node ->T : T ->cbNodeArray : (nodes: Node[]) => T ->nodes : Node[] ->Node : Node ->T : T ->T : T - - function modifierToFlag(token: SyntaxKind): NodeFlags; ->modifierToFlag : (token: SyntaxKind) => NodeFlags ->token : SyntaxKind ->SyntaxKind : SyntaxKind ->NodeFlags : NodeFlags - - function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; ->updateSourceFile : (sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean) => SourceFile ->sourceFile : SourceFile ->SourceFile : SourceFile ->newText : string ->textChangeRange : TextChangeRange ->TextChangeRange : TextChangeRange ->aggressiveChecks : boolean ->SourceFile : SourceFile - - function isEvalOrArgumentsIdentifier(node: Node): boolean; ->isEvalOrArgumentsIdentifier : (node: Node) => boolean ->node : Node ->Node : Node - - function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean): SourceFile; ->createSourceFile : (fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean) => SourceFile ->fileName : string ->sourceText : string ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget ->setParentNodes : boolean ->SourceFile : SourceFile - - function isLeftHandSideExpression(expr: Expression): boolean; ->isLeftHandSideExpression : (expr: Expression) => boolean ->expr : Expression ->Expression : Expression - - function isAssignmentOperator(token: SyntaxKind): boolean; ->isAssignmentOperator : (token: SyntaxKind) => boolean ->token : SyntaxKind ->SyntaxKind : SyntaxKind -} -declare module "typescript" { - function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker; ->createTypeChecker : (host: TypeCheckerHost, produceDiagnostics: boolean) => TypeChecker ->host : TypeCheckerHost ->TypeCheckerHost : TypeCheckerHost ->produceDiagnostics : boolean ->TypeChecker : TypeChecker -} -declare module "typescript" { - /** The version of the TypeScript compiler release */ - let version: string; ->version : string - - function findConfigFile(searchPath: string): string; ->findConfigFile : (searchPath: string) => string ->searchPath : string - - function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; ->createCompilerHost : (options: CompilerOptions, setParentNodes?: boolean) => CompilerHost ->options : CompilerOptions ->CompilerOptions : CompilerOptions ->setParentNodes : boolean ->CompilerHost : CompilerHost - - function getPreEmitDiagnostics(program: Program): Diagnostic[]; ->getPreEmitDiagnostics : (program: Program) => Diagnostic[] ->program : Program ->Program : Program ->Diagnostic : Diagnostic - - function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; ->flattenDiagnosticMessageText : (messageText: string | DiagnosticMessageChain, newLine: string) => string ->messageText : string | DiagnosticMessageChain ->DiagnosticMessageChain : DiagnosticMessageChain ->newLine : string - - function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; ->createProgram : (rootNames: string[], options: CompilerOptions, host?: CompilerHost) => Program ->rootNames : string[] ->options : CompilerOptions ->CompilerOptions : CompilerOptions ->host : CompilerHost ->CompilerHost : CompilerHost ->Program : Program -} -declare module "typescript" { - /** The version of the language service API */ - let servicesVersion: string; ->servicesVersion : string - - interface Node { ->Node : Node - - getSourceFile(): SourceFile; ->getSourceFile : () => SourceFile ->SourceFile : SourceFile - - getChildCount(sourceFile?: SourceFile): number; ->getChildCount : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getChildAt(index: number, sourceFile?: SourceFile): Node; ->getChildAt : (index: number, sourceFile?: SourceFile) => Node ->index : number ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - - getChildren(sourceFile?: SourceFile): Node[]; ->getChildren : (sourceFile?: SourceFile) => Node[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - - getStart(sourceFile?: SourceFile): number; ->getStart : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFullStart(): number; ->getFullStart : () => number - - getEnd(): number; ->getEnd : () => number - - getWidth(sourceFile?: SourceFile): number; ->getWidth : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFullWidth(): number; ->getFullWidth : () => number - - getLeadingTriviaWidth(sourceFile?: SourceFile): number; ->getLeadingTriviaWidth : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFullText(sourceFile?: SourceFile): string; ->getFullText : (sourceFile?: SourceFile) => string ->sourceFile : SourceFile ->SourceFile : SourceFile - - getText(sourceFile?: SourceFile): string; ->getText : (sourceFile?: SourceFile) => string ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFirstToken(sourceFile?: SourceFile): Node; ->getFirstToken : (sourceFile?: SourceFile) => Node ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - - getLastToken(sourceFile?: SourceFile): Node; ->getLastToken : (sourceFile?: SourceFile) => Node ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - } - interface Symbol { ->Symbol : Symbol - - getFlags(): SymbolFlags; ->getFlags : () => SymbolFlags ->SymbolFlags : SymbolFlags - - getName(): string; ->getName : () => string - - getDeclarations(): Declaration[]; ->getDeclarations : () => Declaration[] ->Declaration : Declaration - - getDocumentationComment(): SymbolDisplayPart[]; ->getDocumentationComment : () => SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface Type { ->Type : Type - - getFlags(): TypeFlags; ->getFlags : () => TypeFlags ->TypeFlags : TypeFlags - - getSymbol(): Symbol; ->getSymbol : () => Symbol ->Symbol : Symbol - - getProperties(): Symbol[]; ->getProperties : () => Symbol[] ->Symbol : Symbol - - getProperty(propertyName: string): Symbol; ->getProperty : (propertyName: string) => Symbol ->propertyName : string ->Symbol : Symbol - - getApparentProperties(): Symbol[]; ->getApparentProperties : () => Symbol[] ->Symbol : Symbol - - getCallSignatures(): Signature[]; ->getCallSignatures : () => Signature[] ->Signature : Signature - - getConstructSignatures(): Signature[]; ->getConstructSignatures : () => Signature[] ->Signature : Signature - - getStringIndexType(): Type; ->getStringIndexType : () => Type ->Type : Type - - getNumberIndexType(): Type; ->getNumberIndexType : () => Type ->Type : Type - } - interface Signature { ->Signature : Signature - - getDeclaration(): SignatureDeclaration; ->getDeclaration : () => SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration - - getTypeParameters(): Type[]; ->getTypeParameters : () => Type[] ->Type : Type - - getParameters(): Symbol[]; ->getParameters : () => Symbol[] ->Symbol : Symbol - - getReturnType(): Type; ->getReturnType : () => Type ->Type : Type - - getDocumentationComment(): SymbolDisplayPart[]; ->getDocumentationComment : () => SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface SourceFile { ->SourceFile : SourceFile - - getNamedDeclarations(): Declaration[]; ->getNamedDeclarations : () => Declaration[] ->Declaration : Declaration - - getLineAndCharacterOfPosition(pos: number): LineAndCharacter; ->getLineAndCharacterOfPosition : (pos: number) => LineAndCharacter ->pos : number ->LineAndCharacter : LineAndCharacter - - getLineStarts(): number[]; ->getLineStarts : () => number[] - - getPositionOfLineAndCharacter(line: number, character: number): number; ->getPositionOfLineAndCharacter : (line: number, character: number) => number ->line : number ->character : number - - update(newText: string, textChangeRange: TextChangeRange): SourceFile; ->update : (newText: string, textChangeRange: TextChangeRange) => SourceFile ->newText : string ->textChangeRange : TextChangeRange ->TextChangeRange : TextChangeRange ->SourceFile : SourceFile - } - /** - * Represents an immutable snapshot of a script at a specified time.Once acquired, the - * snapshot is observably immutable. i.e. the same calls with the same parameters will return - * the same values. - */ - interface IScriptSnapshot { ->IScriptSnapshot : IScriptSnapshot - - /** Gets a portion of the script snapshot specified by [start, end). */ - getText(start: number, end: number): string; ->getText : (start: number, end: number) => string ->start : number ->end : number - - /** Gets the length of this script snapshot. */ - getLength(): number; ->getLength : () => number - - /** - * Gets the TextChangeRange that describe how the text changed between this text and - * an older version. This information is used by the incremental parser to determine - * what sections of the script need to be re-parsed. 'undefined' can be returned if the - * change range cannot be determined. However, in that case, incremental parsing will - * not happen and the entire document will be re - parsed. - */ - getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange; ->getChangeRange : (oldSnapshot: IScriptSnapshot) => TextChangeRange ->oldSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->TextChangeRange : TextChangeRange - } - module ScriptSnapshot { ->ScriptSnapshot : typeof ScriptSnapshot - - function fromString(text: string): IScriptSnapshot; ->fromString : (text: string) => IScriptSnapshot ->text : string ->IScriptSnapshot : IScriptSnapshot - } - interface PreProcessedFileInfo { ->PreProcessedFileInfo : PreProcessedFileInfo - - referencedFiles: FileReference[]; ->referencedFiles : FileReference[] ->FileReference : FileReference - - importedFiles: FileReference[]; ->importedFiles : FileReference[] ->FileReference : FileReference - - isLibFile: boolean; ->isLibFile : boolean - } - interface LanguageServiceHost { ->LanguageServiceHost : LanguageServiceHost - - getCompilationSettings(): CompilerOptions; ->getCompilationSettings : () => CompilerOptions ->CompilerOptions : CompilerOptions - - getNewLine?(): string; ->getNewLine : () => string - - getScriptFileNames(): string[]; ->getScriptFileNames : () => string[] - - getScriptVersion(fileName: string): string; ->getScriptVersion : (fileName: string) => string ->fileName : string - - getScriptSnapshot(fileName: string): IScriptSnapshot; ->getScriptSnapshot : (fileName: string) => IScriptSnapshot ->fileName : string ->IScriptSnapshot : IScriptSnapshot - - getLocalizedDiagnosticMessages?(): any; ->getLocalizedDiagnosticMessages : () => any - - getCancellationToken?(): CancellationToken; ->getCancellationToken : () => CancellationToken ->CancellationToken : CancellationToken - - getCurrentDirectory(): string; ->getCurrentDirectory : () => string - - getDefaultLibFileName(options: CompilerOptions): string; ->getDefaultLibFileName : (options: CompilerOptions) => string ->options : CompilerOptions ->CompilerOptions : CompilerOptions - - log?(s: string): void; ->log : (s: string) => void ->s : string - - trace?(s: string): void; ->trace : (s: string) => void ->s : string - - error?(s: string): void; ->error : (s: string) => void ->s : string - } - interface LanguageService { ->LanguageService : LanguageService - - cleanupSemanticCache(): void; ->cleanupSemanticCache : () => void - - getSyntacticDiagnostics(fileName: string): Diagnostic[]; ->getSyntacticDiagnostics : (fileName: string) => Diagnostic[] ->fileName : string ->Diagnostic : Diagnostic - - getSemanticDiagnostics(fileName: string): Diagnostic[]; ->getSemanticDiagnostics : (fileName: string) => Diagnostic[] ->fileName : string ->Diagnostic : Diagnostic - - getCompilerOptionsDiagnostics(): Diagnostic[]; ->getCompilerOptionsDiagnostics : () => Diagnostic[] ->Diagnostic : Diagnostic - - getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; ->getSyntacticClassifications : (fileName: string, span: TextSpan) => ClassifiedSpan[] ->fileName : string ->span : TextSpan ->TextSpan : TextSpan ->ClassifiedSpan : ClassifiedSpan - - getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; ->getSemanticClassifications : (fileName: string, span: TextSpan) => ClassifiedSpan[] ->fileName : string ->span : TextSpan ->TextSpan : TextSpan ->ClassifiedSpan : ClassifiedSpan - - getCompletionsAtPosition(fileName: string, position: number): CompletionInfo; ->getCompletionsAtPosition : (fileName: string, position: number) => CompletionInfo ->fileName : string ->position : number ->CompletionInfo : CompletionInfo - - getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails; ->getCompletionEntryDetails : (fileName: string, position: number, entryName: string) => CompletionEntryDetails ->fileName : string ->position : number ->entryName : string ->CompletionEntryDetails : CompletionEntryDetails - - getQuickInfoAtPosition(fileName: string, position: number): QuickInfo; ->getQuickInfoAtPosition : (fileName: string, position: number) => QuickInfo ->fileName : string ->position : number ->QuickInfo : QuickInfo - - getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan; ->getNameOrDottedNameSpan : (fileName: string, startPos: number, endPos: number) => TextSpan ->fileName : string ->startPos : number ->endPos : number ->TextSpan : TextSpan - - getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan; ->getBreakpointStatementAtPosition : (fileName: string, position: number) => TextSpan ->fileName : string ->position : number ->TextSpan : TextSpan - - getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems; ->getSignatureHelpItems : (fileName: string, position: number) => SignatureHelpItems ->fileName : string ->position : number ->SignatureHelpItems : SignatureHelpItems - - getRenameInfo(fileName: string, position: number): RenameInfo; ->getRenameInfo : (fileName: string, position: number) => RenameInfo ->fileName : string ->position : number ->RenameInfo : RenameInfo - - findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]; ->findRenameLocations : (fileName: string, position: number, findInStrings: boolean, findInComments: boolean) => RenameLocation[] ->fileName : string ->position : number ->findInStrings : boolean ->findInComments : boolean ->RenameLocation : RenameLocation - - getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; ->getDefinitionAtPosition : (fileName: string, position: number) => DefinitionInfo[] ->fileName : string ->position : number ->DefinitionInfo : DefinitionInfo - - getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; ->getReferencesAtPosition : (fileName: string, position: number) => ReferenceEntry[] ->fileName : string ->position : number ->ReferenceEntry : ReferenceEntry - - getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; ->getOccurrencesAtPosition : (fileName: string, position: number) => ReferenceEntry[] ->fileName : string ->position : number ->ReferenceEntry : ReferenceEntry - - findReferences(fileName: string, position: number): ReferencedSymbol[]; ->findReferences : (fileName: string, position: number) => ReferencedSymbol[] ->fileName : string ->position : number ->ReferencedSymbol : ReferencedSymbol - - getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[]; ->getNavigateToItems : (searchValue: string, maxResultCount?: number) => NavigateToItem[] ->searchValue : string ->maxResultCount : number ->NavigateToItem : NavigateToItem - - getNavigationBarItems(fileName: string): NavigationBarItem[]; ->getNavigationBarItems : (fileName: string) => NavigationBarItem[] ->fileName : string ->NavigationBarItem : NavigationBarItem - - getOutliningSpans(fileName: string): OutliningSpan[]; ->getOutliningSpans : (fileName: string) => OutliningSpan[] ->fileName : string ->OutliningSpan : OutliningSpan - - getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[]; ->getTodoComments : (fileName: string, descriptors: TodoCommentDescriptor[]) => TodoComment[] ->fileName : string ->descriptors : TodoCommentDescriptor[] ->TodoCommentDescriptor : TodoCommentDescriptor ->TodoComment : TodoComment - - getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[]; ->getBraceMatchingAtPosition : (fileName: string, position: number) => TextSpan[] ->fileName : string ->position : number ->TextSpan : TextSpan - - getIndentationAtPosition(fileName: string, position: number, options: EditorOptions): number; ->getIndentationAtPosition : (fileName: string, position: number, options: EditorOptions) => number ->fileName : string ->position : number ->options : EditorOptions ->EditorOptions : EditorOptions - - getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions): TextChange[]; ->getFormattingEditsForRange : (fileName: string, start: number, end: number, options: FormatCodeOptions) => TextChange[] ->fileName : string ->start : number ->end : number ->options : FormatCodeOptions ->FormatCodeOptions : FormatCodeOptions ->TextChange : TextChange - - getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): TextChange[]; ->getFormattingEditsForDocument : (fileName: string, options: FormatCodeOptions) => TextChange[] ->fileName : string ->options : FormatCodeOptions ->FormatCodeOptions : FormatCodeOptions ->TextChange : TextChange - - getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextChange[]; ->getFormattingEditsAfterKeystroke : (fileName: string, position: number, key: string, options: FormatCodeOptions) => TextChange[] ->fileName : string ->position : number ->key : string ->options : FormatCodeOptions ->FormatCodeOptions : FormatCodeOptions ->TextChange : TextChange - - getEmitOutput(fileName: string): EmitOutput; ->getEmitOutput : (fileName: string) => EmitOutput ->fileName : string ->EmitOutput : EmitOutput - - getProgram(): Program; ->getProgram : () => Program ->Program : Program - - getSourceFile(fileName: string): SourceFile; ->getSourceFile : (fileName: string) => SourceFile ->fileName : string ->SourceFile : SourceFile - - dispose(): void; ->dispose : () => void - } - interface ClassifiedSpan { ->ClassifiedSpan : ClassifiedSpan - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - classificationType: string; ->classificationType : string - } - interface NavigationBarItem { ->NavigationBarItem : NavigationBarItem - - text: string; ->text : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - spans: TextSpan[]; ->spans : TextSpan[] ->TextSpan : TextSpan - - childItems: NavigationBarItem[]; ->childItems : NavigationBarItem[] ->NavigationBarItem : NavigationBarItem - - indent: number; ->indent : number - - bolded: boolean; ->bolded : boolean - - grayed: boolean; ->grayed : boolean - } - interface TodoCommentDescriptor { ->TodoCommentDescriptor : TodoCommentDescriptor - - text: string; ->text : string - - priority: number; ->priority : number - } - interface TodoComment { ->TodoComment : TodoComment - - descriptor: TodoCommentDescriptor; ->descriptor : TodoCommentDescriptor ->TodoCommentDescriptor : TodoCommentDescriptor - - message: string; ->message : string - - position: number; ->position : number - } - class TextChange { ->TextChange : TextChange - - span: TextSpan; ->span : TextSpan ->TextSpan : TextSpan - - newText: string; ->newText : string - } - interface RenameLocation { ->RenameLocation : RenameLocation - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - fileName: string; ->fileName : string - } - interface ReferenceEntry { ->ReferenceEntry : ReferenceEntry - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - fileName: string; ->fileName : string - - isWriteAccess: boolean; ->isWriteAccess : boolean - } - interface NavigateToItem { ->NavigateToItem : NavigateToItem - - name: string; ->name : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - matchKind: string; ->matchKind : string - - isCaseSensitive: boolean; ->isCaseSensitive : boolean - - fileName: string; ->fileName : string - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - containerName: string; ->containerName : string - - containerKind: string; ->containerKind : string - } - interface EditorOptions { ->EditorOptions : EditorOptions - - IndentSize: number; ->IndentSize : number - - TabSize: number; ->TabSize : number - - NewLineCharacter: string; ->NewLineCharacter : string - - ConvertTabsToSpaces: boolean; ->ConvertTabsToSpaces : boolean - } - interface FormatCodeOptions extends EditorOptions { ->FormatCodeOptions : FormatCodeOptions ->EditorOptions : EditorOptions - - InsertSpaceAfterCommaDelimiter: boolean; ->InsertSpaceAfterCommaDelimiter : boolean - - InsertSpaceAfterSemicolonInForStatements: boolean; ->InsertSpaceAfterSemicolonInForStatements : boolean - - InsertSpaceBeforeAndAfterBinaryOperators: boolean; ->InsertSpaceBeforeAndAfterBinaryOperators : boolean - - InsertSpaceAfterKeywordsInControlFlowStatements: boolean; ->InsertSpaceAfterKeywordsInControlFlowStatements : boolean - - InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; ->InsertSpaceAfterFunctionKeywordForAnonymousFunctions : boolean - - InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; ->InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis : boolean - - PlaceOpenBraceOnNewLineForFunctions: boolean; ->PlaceOpenBraceOnNewLineForFunctions : boolean - - PlaceOpenBraceOnNewLineForControlBlocks: boolean; ->PlaceOpenBraceOnNewLineForControlBlocks : boolean - - [s: string]: boolean | number | string; ->s : string - } - interface DefinitionInfo { ->DefinitionInfo : DefinitionInfo - - fileName: string; ->fileName : string - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - kind: string; ->kind : string - - name: string; ->name : string - - containerKind: string; ->containerKind : string - - containerName: string; ->containerName : string - } - interface ReferencedSymbol { ->ReferencedSymbol : ReferencedSymbol - - definition: DefinitionInfo; ->definition : DefinitionInfo ->DefinitionInfo : DefinitionInfo - - references: ReferenceEntry[]; ->references : ReferenceEntry[] ->ReferenceEntry : ReferenceEntry - } - enum SymbolDisplayPartKind { ->SymbolDisplayPartKind : SymbolDisplayPartKind - - aliasName = 0, ->aliasName : SymbolDisplayPartKind - - className = 1, ->className : SymbolDisplayPartKind - - enumName = 2, ->enumName : SymbolDisplayPartKind - - fieldName = 3, ->fieldName : SymbolDisplayPartKind - - interfaceName = 4, ->interfaceName : SymbolDisplayPartKind - - keyword = 5, ->keyword : SymbolDisplayPartKind - - lineBreak = 6, ->lineBreak : SymbolDisplayPartKind - - numericLiteral = 7, ->numericLiteral : SymbolDisplayPartKind - - stringLiteral = 8, ->stringLiteral : SymbolDisplayPartKind - - localName = 9, ->localName : SymbolDisplayPartKind - - methodName = 10, ->methodName : SymbolDisplayPartKind - - moduleName = 11, ->moduleName : SymbolDisplayPartKind - - operator = 12, ->operator : SymbolDisplayPartKind - - parameterName = 13, ->parameterName : SymbolDisplayPartKind - - propertyName = 14, ->propertyName : SymbolDisplayPartKind - - punctuation = 15, ->punctuation : SymbolDisplayPartKind - - space = 16, ->space : SymbolDisplayPartKind - - text = 17, ->text : SymbolDisplayPartKind - - typeParameterName = 18, ->typeParameterName : SymbolDisplayPartKind - - enumMemberName = 19, ->enumMemberName : SymbolDisplayPartKind - - functionName = 20, ->functionName : SymbolDisplayPartKind - - regularExpressionLiteral = 21, ->regularExpressionLiteral : SymbolDisplayPartKind - } - interface SymbolDisplayPart { ->SymbolDisplayPart : SymbolDisplayPart - - text: string; ->text : string - - kind: string; ->kind : string - } - interface QuickInfo { ->QuickInfo : QuickInfo - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - displayParts: SymbolDisplayPart[]; ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface RenameInfo { ->RenameInfo : RenameInfo - - canRename: boolean; ->canRename : boolean - - localizedErrorMessage: string; ->localizedErrorMessage : string - - displayName: string; ->displayName : string - - fullDisplayName: string; ->fullDisplayName : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - triggerSpan: TextSpan; ->triggerSpan : TextSpan ->TextSpan : TextSpan - } - interface SignatureHelpParameter { ->SignatureHelpParameter : SignatureHelpParameter - - name: string; ->name : string - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - displayParts: SymbolDisplayPart[]; ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - isOptional: boolean; ->isOptional : boolean - } - /** - * Represents a single signature to show in signature help. - * The id is used for subsequent calls into the language service to ask questions about the - * signature help item in the context of any documents that have been updated. i.e. after - * an edit has happened, while signature help is still active, the host can ask important - * questions like 'what parameter is the user currently contained within?'. - */ - interface SignatureHelpItem { ->SignatureHelpItem : SignatureHelpItem - - isVariadic: boolean; ->isVariadic : boolean - - prefixDisplayParts: SymbolDisplayPart[]; ->prefixDisplayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - suffixDisplayParts: SymbolDisplayPart[]; ->suffixDisplayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - separatorDisplayParts: SymbolDisplayPart[]; ->separatorDisplayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - parameters: SignatureHelpParameter[]; ->parameters : SignatureHelpParameter[] ->SignatureHelpParameter : SignatureHelpParameter - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - /** - * Represents a set of signature help items, and the preferred item that should be selected. - */ - interface SignatureHelpItems { ->SignatureHelpItems : SignatureHelpItems - - items: SignatureHelpItem[]; ->items : SignatureHelpItem[] ->SignatureHelpItem : SignatureHelpItem - - applicableSpan: TextSpan; ->applicableSpan : TextSpan ->TextSpan : TextSpan - - selectedItemIndex: number; ->selectedItemIndex : number - - argumentIndex: number; ->argumentIndex : number - - argumentCount: number; ->argumentCount : number - } - interface CompletionInfo { ->CompletionInfo : CompletionInfo - - isMemberCompletion: boolean; ->isMemberCompletion : boolean - - isNewIdentifierLocation: boolean; ->isNewIdentifierLocation : boolean - - entries: CompletionEntry[]; ->entries : CompletionEntry[] ->CompletionEntry : CompletionEntry - } - interface CompletionEntry { ->CompletionEntry : CompletionEntry - - name: string; ->name : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - } - interface CompletionEntryDetails { ->CompletionEntryDetails : CompletionEntryDetails - - name: string; ->name : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - displayParts: SymbolDisplayPart[]; ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface OutliningSpan { ->OutliningSpan : OutliningSpan - - /** The span of the document to actually collapse. */ - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - /** The span of the document to display when the user hovers over the collapsed span. */ - hintSpan: TextSpan; ->hintSpan : TextSpan ->TextSpan : TextSpan - - /** The text to display in the editor for the collapsed region. */ - bannerText: string; ->bannerText : string - - /** - * Whether or not this region should be automatically collapsed when - * the 'Collapse to Definitions' command is invoked. - */ - autoCollapse: boolean; ->autoCollapse : boolean - } - interface EmitOutput { ->EmitOutput : EmitOutput - - outputFiles: OutputFile[]; ->outputFiles : OutputFile[] ->OutputFile : OutputFile - - emitSkipped: boolean; ->emitSkipped : boolean - } - const enum OutputFileType { ->OutputFileType : OutputFileType - - JavaScript = 0, ->JavaScript : OutputFileType - - SourceMap = 1, ->SourceMap : OutputFileType - - Declaration = 2, ->Declaration : OutputFileType - } - interface OutputFile { ->OutputFile : OutputFile - - name: string; ->name : string - - writeByteOrderMark: boolean; ->writeByteOrderMark : boolean - - text: string; ->text : string - } - const enum EndOfLineState { ->EndOfLineState : EndOfLineState - - Start = 0, ->Start : EndOfLineState - - InMultiLineCommentTrivia = 1, ->InMultiLineCommentTrivia : EndOfLineState - - InSingleQuoteStringLiteral = 2, ->InSingleQuoteStringLiteral : EndOfLineState - - InDoubleQuoteStringLiteral = 3, ->InDoubleQuoteStringLiteral : EndOfLineState - - InTemplateHeadOrNoSubstitutionTemplate = 4, ->InTemplateHeadOrNoSubstitutionTemplate : EndOfLineState - - InTemplateMiddleOrTail = 5, ->InTemplateMiddleOrTail : EndOfLineState - - InTemplateSubstitutionPosition = 6, ->InTemplateSubstitutionPosition : EndOfLineState - } - enum TokenClass { ->TokenClass : TokenClass - - Punctuation = 0, ->Punctuation : TokenClass - - Keyword = 1, ->Keyword : TokenClass - - Operator = 2, ->Operator : TokenClass - - Comment = 3, ->Comment : TokenClass - - Whitespace = 4, ->Whitespace : TokenClass - - Identifier = 5, ->Identifier : TokenClass - - NumberLiteral = 6, ->NumberLiteral : TokenClass - - StringLiteral = 7, ->StringLiteral : TokenClass - - RegExpLiteral = 8, ->RegExpLiteral : TokenClass - } - interface ClassificationResult { ->ClassificationResult : ClassificationResult - - finalLexState: EndOfLineState; ->finalLexState : EndOfLineState ->EndOfLineState : EndOfLineState - - entries: ClassificationInfo[]; ->entries : ClassificationInfo[] ->ClassificationInfo : ClassificationInfo - } - interface ClassificationInfo { ->ClassificationInfo : ClassificationInfo - - length: number; ->length : number - - classification: TokenClass; ->classification : TokenClass ->TokenClass : TokenClass - } - interface Classifier { ->Classifier : Classifier - - /** - * Gives lexical classifications of tokens on a line without any syntactic context. - * For instance, a token consisting of the text 'string' can be either an identifier - * named 'string' or the keyword 'string', however, because this classifier is not aware, - * it relies on certain heuristics to give acceptable results. For classifications where - * speed trumps accuracy, this function is preferable; however, for true accuracy, the - * syntactic classifier is ideal. In fact, in certain editing scenarios, combining the - * lexical, syntactic, and semantic classifiers may issue the best user experience. - * - * @param text The text of a line to classify. - * @param lexState The state of the lexical classifier at the end of the previous line. - * @param syntacticClassifierAbsent Whether the client is *not* using a syntactic classifier. - * If there is no syntactic classifier (syntacticClassifierAbsent=true), - * certain heuristics may be used in its place; however, if there is a - * syntactic classifier (syntacticClassifierAbsent=false), certain - * classifications which may be incorrectly categorized will be given - * back as Identifiers in order to allow the syntactic classifier to - * subsume the classification. - */ - getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult; ->getClassificationsForLine : (text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean) => ClassificationResult ->text : string ->lexState : EndOfLineState ->EndOfLineState : EndOfLineState ->syntacticClassifierAbsent : boolean ->ClassificationResult : ClassificationResult - } - /** - * The document registry represents a store of SourceFile objects that can be shared between - * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) - * of files in the context. - * SourceFile objects account for most of the memory usage by the language service. Sharing - * the same DocumentRegistry instance between different instances of LanguageService allow - * for more efficient memory utilization since all projects will share at least the library - * file (lib.d.ts). - * - * A more advanced use of the document registry is to serialize sourceFile objects to disk - * and re-hydrate them when needed. - * - * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it - * to all subsequent createLanguageService calls. - */ - interface DocumentRegistry { ->DocumentRegistry : DocumentRegistry - - /** - * Request a stored SourceFile with a given fileName and compilationSettings. - * The first call to acquire will call createLanguageServiceSourceFile to generate - * the SourceFile if was not found in the registry. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @parm scriptSnapshot Text of the file. Only used if the file was not found - * in the registry and a new one was created. - * @parm version Current version of the file. Only used if the file was not found - * in the registry and a new one was created. - */ - acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; ->acquireDocument : (fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string) => SourceFile ->fileName : string ->compilationSettings : CompilerOptions ->CompilerOptions : CompilerOptions ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->version : string ->SourceFile : SourceFile - - /** - * Request an updated version of an already existing SourceFile with a given fileName - * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile - * to get an updated SourceFile. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @param scriptSnapshot Text of the file. - * @param version Current version of the file. - */ - updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; ->updateDocument : (fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string) => SourceFile ->fileName : string ->compilationSettings : CompilerOptions ->CompilerOptions : CompilerOptions ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->version : string ->SourceFile : SourceFile - - /** - * Informs the DocumentRegistry that a file is not needed any longer. - * - * Note: It is not allowed to call release on a SourceFile that was not acquired from - * this registry originally. - * - * @param fileName The name of the file to be released - * @param compilationSettings The compilation settings used to acquire the file - */ - releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; ->releaseDocument : (fileName: string, compilationSettings: CompilerOptions) => void ->fileName : string ->compilationSettings : CompilerOptions ->CompilerOptions : CompilerOptions - } - class ScriptElementKind { ->ScriptElementKind : ScriptElementKind - - static unknown: string; ->unknown : string - - static keyword: string; ->keyword : string - - static scriptElement: string; ->scriptElement : string - - static moduleElement: string; ->moduleElement : string - - static classElement: string; ->classElement : string - - static interfaceElement: string; ->interfaceElement : string - - static typeElement: string; ->typeElement : string - - static enumElement: string; ->enumElement : string - - static variableElement: string; ->variableElement : string - - static localVariableElement: string; ->localVariableElement : string - - static functionElement: string; ->functionElement : string - - static localFunctionElement: string; ->localFunctionElement : string - - static memberFunctionElement: string; ->memberFunctionElement : string - - static memberGetAccessorElement: string; ->memberGetAccessorElement : string - - static memberSetAccessorElement: string; ->memberSetAccessorElement : string - - static memberVariableElement: string; ->memberVariableElement : string - - static constructorImplementationElement: string; ->constructorImplementationElement : string - - static callSignatureElement: string; ->callSignatureElement : string - - static indexSignatureElement: string; ->indexSignatureElement : string - - static constructSignatureElement: string; ->constructSignatureElement : string - - static parameterElement: string; ->parameterElement : string - - static typeParameterElement: string; ->typeParameterElement : string - - static primitiveType: string; ->primitiveType : string - - static label: string; ->label : string - - static alias: string; ->alias : string - - static constElement: string; ->constElement : string - - static letElement: string; ->letElement : string - } - class ScriptElementKindModifier { ->ScriptElementKindModifier : ScriptElementKindModifier - - static none: string; ->none : string - - static publicMemberModifier: string; ->publicMemberModifier : string - - static privateMemberModifier: string; ->privateMemberModifier : string - - static protectedMemberModifier: string; ->protectedMemberModifier : string - - static exportedModifier: string; ->exportedModifier : string - - static ambientModifier: string; ->ambientModifier : string - - static staticModifier: string; ->staticModifier : string - } - class ClassificationTypeNames { ->ClassificationTypeNames : ClassificationTypeNames - - static comment: string; ->comment : string - - static identifier: string; ->identifier : string - - static keyword: string; ->keyword : string - - static numericLiteral: string; ->numericLiteral : string - - static operator: string; ->operator : string - - static stringLiteral: string; ->stringLiteral : string - - static whiteSpace: string; ->whiteSpace : string - - static text: string; ->text : string - - static punctuation: string; ->punctuation : string - - static className: string; ->className : string - - static enumName: string; ->enumName : string - - static interfaceName: string; ->interfaceName : string - - static moduleName: string; ->moduleName : string - - static typeParameterName: string; ->typeParameterName : string - - static typeAlias: string; ->typeAlias : string - } - interface DisplayPartsSymbolWriter extends SymbolWriter { ->DisplayPartsSymbolWriter : DisplayPartsSymbolWriter ->SymbolWriter : SymbolWriter - - displayParts(): SymbolDisplayPart[]; ->displayParts : () => SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - function displayPartsToString(displayParts: SymbolDisplayPart[]): string; ->displayPartsToString : (displayParts: SymbolDisplayPart[]) => string ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - function getDefaultCompilerOptions(): CompilerOptions; ->getDefaultCompilerOptions : () => CompilerOptions ->CompilerOptions : CompilerOptions - - class OperationCanceledException { ->OperationCanceledException : OperationCanceledException - } - class CancellationTokenObject { ->CancellationTokenObject : CancellationTokenObject - - private cancellationToken; ->cancellationToken : any - - static None: CancellationTokenObject; ->None : CancellationTokenObject ->CancellationTokenObject : CancellationTokenObject - - constructor(cancellationToken: CancellationToken); ->cancellationToken : CancellationToken ->CancellationToken : CancellationToken - - isCancellationRequested(): boolean; ->isCancellationRequested : () => boolean - - throwIfCancellationRequested(): void; ->throwIfCancellationRequested : () => void - } - function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile; ->createLanguageServiceSourceFile : (fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean) => SourceFile ->fileName : string ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->scriptTarget : ScriptTarget ->ScriptTarget : ScriptTarget ->version : string ->setNodeParents : boolean ->SourceFile : SourceFile - - let disableIncrementalParsing: boolean; ->disableIncrementalParsing : boolean - - function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; ->updateLanguageServiceSourceFile : (sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean) => SourceFile ->sourceFile : SourceFile ->SourceFile : SourceFile ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->version : string ->textChangeRange : TextChangeRange ->TextChangeRange : TextChangeRange ->aggressiveChecks : boolean ->SourceFile : SourceFile - - function createDocumentRegistry(): DocumentRegistry; ->createDocumentRegistry : () => DocumentRegistry ->DocumentRegistry : DocumentRegistry - - function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo; ->preProcessFile : (sourceText: string, readImportFiles?: boolean) => PreProcessedFileInfo ->sourceText : string ->readImportFiles : boolean ->PreProcessedFileInfo : PreProcessedFileInfo - - function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; ->createLanguageService : (host: LanguageServiceHost, documentRegistry?: DocumentRegistry) => LanguageService ->host : LanguageServiceHost ->LanguageServiceHost : LanguageServiceHost ->documentRegistry : DocumentRegistry ->DocumentRegistry : DocumentRegistry ->LanguageService : LanguageService - - function createClassifier(): Classifier; ->createClassifier : () => Classifier ->Classifier : Classifier - - /** - * Get the path of the default library file (lib.d.ts) as distributed with the typescript - * node package. - * The functionality is not supported if the ts module is consumed outside of a node module. - */ - function getDefaultLibFilePath(options: CompilerOptions): string; ->getDefaultLibFilePath : (options: CompilerOptions) => string ->options : CompilerOptions ->CompilerOptions : CompilerOptions -} - diff --git a/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.js b/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.js index 74a8a66a8bc..90bed5cfd91 100644 --- a/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.js +++ b/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.js @@ -17,10 +17,7 @@ var cl = Point.Origin; //// [function.js] function Point() { - return { - x: 0, - y: 0 - }; + return { x: 0, y: 0 }; } //// [test.js] var cl; diff --git a/tests/baselines/reference/ArrowFunctionExpression1.js b/tests/baselines/reference/ArrowFunctionExpression1.js index baa75809f65..21c71af243c 100644 --- a/tests/baselines/reference/ArrowFunctionExpression1.js +++ b/tests/baselines/reference/ArrowFunctionExpression1.js @@ -2,5 +2,4 @@ var v = (public x: string) => { }; //// [ArrowFunctionExpression1.js] -var v = function (x) { -}; +var v = function (x) { }; diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.js b/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.js index a3ccfbe2f41..b27c2ce5a30 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.js @@ -58,8 +58,7 @@ var clodule1 = (function () { })(); var clodule1; (function (clodule1) { - function f(x) { - } + function f(x) { } })(clodule1 || (clodule1 = {})); var clodule2 = (function () { function clodule2() { @@ -82,9 +81,7 @@ var clodule3 = (function () { })(); var clodule3; (function (clodule3) { - clodule3.y = { - id: T - }; + clodule3.y = { id: T }; })(clodule3 || (clodule3 = {})); var clodule4 = (function () { function clodule4() { diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.js index cf39aa6c11b..255e74631a3 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.js @@ -19,8 +19,7 @@ module clodule { var clodule = (function () { function clodule() { } - clodule.fn = function (id) { - }; + clodule.fn = function (id) { }; return clodule; })(); var clodule; diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.js index 69f72e3b4a7..76ba858306c 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.js @@ -19,8 +19,7 @@ module clodule { var clodule = (function () { function clodule() { } - clodule.fn = function (id) { - }; + clodule.fn = function (id) { }; return clodule; })(); var clodule; diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.js b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.js index 827557bdbad..5f01b6acff1 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.js @@ -19,9 +19,7 @@ module clodule { var clodule = (function () { function clodule() { } - clodule.sfn = function (id) { - return 42; - }; + clodule.sfn = function (id) { return 42; }; return clodule; })(); var clodule; diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js index 13483b591d9..a86bc7d2e90 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js @@ -28,19 +28,12 @@ var Point = (function () { this.x = x; this.y = y; } - Point.Origin = function () { - return { - x: 0, - y: 0 - }; - }; // unexpected error here bug 840246 + Point.Origin = function () { return { x: 0, y: 0 }; }; // unexpected error here bug 840246 return Point; })(); var Point; (function (Point) { - function Origin() { - return null; - } + function Origin() { return null; } Point.Origin = Origin; //expected duplicate identifier error })(Point || (Point = {})); var A; @@ -50,20 +43,13 @@ var A; this.x = x; this.y = y; } - Point.Origin = function () { - return { - x: 0, - y: 0 - }; - }; // unexpected error here bug 840246 + Point.Origin = function () { return { x: 0, y: 0 }; }; // unexpected error here bug 840246 return Point; })(); A.Point = Point; var Point; (function (Point) { - function Origin() { - return ""; - } + function Origin() { return ""; } Point.Origin = Origin; //expected duplicate identifier error })(Point = A.Point || (A.Point = {})); })(A || (A = {})); diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.js index 188a69a18f7..f462ea9eaa9 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.js @@ -28,19 +28,12 @@ var Point = (function () { this.x = x; this.y = y; } - Point.Origin = function () { - return { - x: 0, - y: 0 - }; - }; + Point.Origin = function () { return { x: 0, y: 0 }; }; return Point; })(); var Point; (function (Point) { - function Origin() { - return ""; - } // not an error, since not exported + function Origin() { return ""; } // not an error, since not exported })(Point || (Point = {})); var A; (function (A) { @@ -49,19 +42,12 @@ var A; this.x = x; this.y = y; } - Point.Origin = function () { - return { - x: 0, - y: 0 - }; - }; + Point.Origin = function () { return { x: 0, y: 0 }; }; return Point; })(); A.Point = Point; var Point; (function (Point) { - function Origin() { - return ""; - } // not an error since not exported + function Origin() { return ""; } // not an error since not exported })(Point = A.Point || (A.Point = {})); })(A || (A = {})); diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js index c2c20f7f7ff..45958ad62d4 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js @@ -28,10 +28,7 @@ var Point = (function () { this.x = x; this.y = y; } - Point.Origin = { - x: 0, - y: 0 - }; + Point.Origin = { x: 0, y: 0 }; return Point; })(); var Point; @@ -45,10 +42,7 @@ var A; this.x = x; this.y = y; } - Point.Origin = { - x: 0, - y: 0 - }; + Point.Origin = { x: 0, y: 0 }; return Point; })(); A.Point = Point; diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.js index 241e1db7b0d..ae56fd1acdc 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.js @@ -28,10 +28,7 @@ var Point = (function () { this.x = x; this.y = y; } - Point.Origin = { - x: 0, - y: 0 - }; + Point.Origin = { x: 0, y: 0 }; return Point; })(); var Point; @@ -45,10 +42,7 @@ var A; this.x = x; this.y = y; } - Point.Origin = { - x: 0, - y: 0 - }; + Point.Origin = { x: 0, y: 0 }; return Point; })(); A.Point = Point; diff --git a/tests/baselines/reference/ClassDeclaration11.js b/tests/baselines/reference/ClassDeclaration11.js index 6c4ba4ac6ec..6284af07676 100644 --- a/tests/baselines/reference/ClassDeclaration11.js +++ b/tests/baselines/reference/ClassDeclaration11.js @@ -8,7 +8,6 @@ class C { var C = (function () { function C() { } - C.prototype.foo = function () { - }; + C.prototype.foo = function () { }; return C; })(); diff --git a/tests/baselines/reference/ClassDeclaration13.js b/tests/baselines/reference/ClassDeclaration13.js index 4c4324eb1e1..7791b77eae6 100644 --- a/tests/baselines/reference/ClassDeclaration13.js +++ b/tests/baselines/reference/ClassDeclaration13.js @@ -8,7 +8,6 @@ class C { var C = (function () { function C() { } - C.prototype.bar = function () { - }; + C.prototype.bar = function () { }; return C; })(); diff --git a/tests/baselines/reference/ClassDeclaration21.js b/tests/baselines/reference/ClassDeclaration21.js index 94cf3587c8d..b5144b607d1 100644 --- a/tests/baselines/reference/ClassDeclaration21.js +++ b/tests/baselines/reference/ClassDeclaration21.js @@ -8,7 +8,6 @@ class C { var C = (function () { function C() { } - C.prototype[1] = function () { - }; + C.prototype[1] = function () { }; return C; })(); diff --git a/tests/baselines/reference/ClassDeclaration22.js b/tests/baselines/reference/ClassDeclaration22.js index c44ba4ba43b..0074813e77e 100644 --- a/tests/baselines/reference/ClassDeclaration22.js +++ b/tests/baselines/reference/ClassDeclaration22.js @@ -8,7 +8,6 @@ class C { var C = (function () { function C() { } - C.prototype["bar"] = function () { - }; + C.prototype["bar"] = function () { }; return C; })(); diff --git a/tests/baselines/reference/ES3For-ofTypeCheck2.js b/tests/baselines/reference/ES3For-ofTypeCheck2.js index 952eade6cfb..865a5493a0c 100644 --- a/tests/baselines/reference/ES3For-ofTypeCheck2.js +++ b/tests/baselines/reference/ES3For-ofTypeCheck2.js @@ -2,8 +2,6 @@ for (var v of [true]) { } //// [ES3For-ofTypeCheck2.js] -for (var _i = 0, _a = [ - true -]; _i < _a.length; _i++) { +for (var _i = 0, _a = [true]; _i < _a.length; _i++) { var v = _a[_i]; } diff --git a/tests/baselines/reference/ES5For-of1.js b/tests/baselines/reference/ES5For-of1.js index afdded3418c..dffe843399f 100644 --- a/tests/baselines/reference/ES5For-of1.js +++ b/tests/baselines/reference/ES5For-of1.js @@ -4,11 +4,7 @@ for (var v of ['a', 'b', 'c']) { } //// [ES5For-of1.js] -for (var _i = 0, _a = [ - 'a', - 'b', - 'c' -]; _i < _a.length; _i++) { +for (var _i = 0, _a = ['a', 'b', 'c']; _i < _a.length; _i++) { var v = _a[_i]; console.log(v); } diff --git a/tests/baselines/reference/ES5For-of1.js.map b/tests/baselines/reference/ES5For-of1.js.map index 4fa49b0f02b..568ac1987e7 100644 --- a/tests/baselines/reference/ES5For-of1.js.map +++ b/tests/baselines/reference/ES5For-of1.js.map @@ -1,2 +1,2 @@ //// [ES5For-of1.js.map] -{"version":3,"file":"ES5For-of1.js","sourceRoot":"","sources":["ES5For-of1.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAU,UAAe,EAAf;IAAC,GAAG;IAAE,GAAG;IAAE,GAAG;CAAC,EAAxB,cAAK,EAAL,IAAwB,CAAC;IAAzB,IAAI,CAAC,SAAA;IACN,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAClB"} \ No newline at end of file +{"version":3,"file":"ES5For-of1.js","sourceRoot":"","sources":["ES5For-of1.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAU,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAxB,cAAK,EAAL,IAAwB,CAAC;IAAzB,IAAI,CAAC,SAAA;IACN,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAClB"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of1.sourcemap.txt b/tests/baselines/reference/ES5For-of1.sourcemap.txt index c07414d1d85..7bdd7edfa13 100644 --- a/tests/baselines/reference/ES5For-of1.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of1.sourcemap.txt @@ -8,72 +8,61 @@ sources: ES5For-of1.ts emittedFile:tests/cases/conformance/statements/for-ofStatements/ES5For-of1.js sourceFile:ES5For-of1.ts ------------------------------------------------------------------- ->>>for (var _i = 0, _a = [ +>>>for (var _i = 0, _a = ['a', 'b', 'c']; _i < _a.length; _i++) { 1 > 2 >^^^ 3 > ^ 4 > ^ 5 > ^^^^^^^^^^ 6 > ^^ +7 > ^^^^^^ +8 > ^^^ +9 > ^^ +10> ^^^ +11> ^^ +12> ^^^ +13> ^ +14> ^^ +15> ^^^^^^^^^^^^^^ +16> ^^ +17> ^^^^ +18> ^ 1 > 2 >for 3 > 4 > (var v of 5 > ['a', 'b', 'c'] 6 > +7 > [ +8 > 'a' +9 > , +10> 'b' +11> , +12> 'c' +13> ] +14> +15> var v +16> +17> var v of ['a', 'b', 'c'] +18> ) 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) 2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0) 3 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) 4 >Emitted(1, 6) Source(1, 15) + SourceIndex(0) 5 >Emitted(1, 16) Source(1, 30) + SourceIndex(0) 6 >Emitted(1, 18) Source(1, 15) + SourceIndex(0) ---- ->>> 'a', -1 >^^^^ -2 > ^^^ -3 > ^^-> -1 >[ -2 > 'a' -1 >Emitted(2, 5) Source(1, 16) + SourceIndex(0) -2 >Emitted(2, 8) Source(1, 19) + SourceIndex(0) ---- ->>> 'b', -1->^^^^ -2 > ^^^ -3 > ^-> -1->, -2 > 'b' -1->Emitted(3, 5) Source(1, 21) + SourceIndex(0) -2 >Emitted(3, 8) Source(1, 24) + SourceIndex(0) ---- ->>> 'c' -1->^^^^ -2 > ^^^ -3 > ^^^^^^^^^^^^^^^^^^^^-> -1->, -2 > 'c' -1->Emitted(4, 5) Source(1, 26) + SourceIndex(0) -2 >Emitted(4, 8) Source(1, 29) + SourceIndex(0) ---- ->>>]; _i < _a.length; _i++) { -1->^ -2 > ^^ -3 > ^^^^^^^^^^^^^^ -4 > ^^ -5 > ^^^^ -6 > ^ -1->] -2 > -3 > var v -4 > -5 > var v of ['a', 'b', 'c'] -6 > ) -1->Emitted(5, 2) Source(1, 30) + SourceIndex(0) -2 >Emitted(5, 4) Source(1, 6) + SourceIndex(0) -3 >Emitted(5, 18) Source(1, 11) + SourceIndex(0) -4 >Emitted(5, 20) Source(1, 6) + SourceIndex(0) -5 >Emitted(5, 24) Source(1, 30) + SourceIndex(0) -6 >Emitted(5, 25) Source(1, 31) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 16) + SourceIndex(0) +8 >Emitted(1, 27) Source(1, 19) + SourceIndex(0) +9 >Emitted(1, 29) Source(1, 21) + SourceIndex(0) +10>Emitted(1, 32) Source(1, 24) + SourceIndex(0) +11>Emitted(1, 34) Source(1, 26) + SourceIndex(0) +12>Emitted(1, 37) Source(1, 29) + SourceIndex(0) +13>Emitted(1, 38) Source(1, 30) + SourceIndex(0) +14>Emitted(1, 40) Source(1, 6) + SourceIndex(0) +15>Emitted(1, 54) Source(1, 11) + SourceIndex(0) +16>Emitted(1, 56) Source(1, 6) + SourceIndex(0) +17>Emitted(1, 60) Source(1, 30) + SourceIndex(0) +18>Emitted(1, 61) Source(1, 31) + SourceIndex(0) --- >>> var v = _a[_i]; 1 >^^^^ @@ -85,10 +74,10 @@ sourceFile:ES5For-of1.ts 2 > var 3 > v 4 > -1 >Emitted(6, 5) Source(1, 6) + SourceIndex(0) -2 >Emitted(6, 9) Source(1, 10) + SourceIndex(0) -3 >Emitted(6, 10) Source(1, 11) + SourceIndex(0) -4 >Emitted(6, 19) Source(1, 11) + SourceIndex(0) +1 >Emitted(2, 5) Source(1, 6) + SourceIndex(0) +2 >Emitted(2, 9) Source(1, 10) + SourceIndex(0) +3 >Emitted(2, 10) Source(1, 11) + SourceIndex(0) +4 >Emitted(2, 19) Source(1, 11) + SourceIndex(0) --- >>> console.log(v); 1->^^^^ @@ -108,20 +97,20 @@ sourceFile:ES5For-of1.ts 6 > v 7 > ) 8 > ; -1->Emitted(7, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(7, 12) Source(2, 12) + SourceIndex(0) -3 >Emitted(7, 13) Source(2, 13) + SourceIndex(0) -4 >Emitted(7, 16) Source(2, 16) + SourceIndex(0) -5 >Emitted(7, 17) Source(2, 17) + SourceIndex(0) -6 >Emitted(7, 18) Source(2, 18) + SourceIndex(0) -7 >Emitted(7, 19) Source(2, 19) + SourceIndex(0) -8 >Emitted(7, 20) Source(2, 20) + SourceIndex(0) +1->Emitted(3, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(3, 12) Source(2, 12) + SourceIndex(0) +3 >Emitted(3, 13) Source(2, 13) + SourceIndex(0) +4 >Emitted(3, 16) Source(2, 16) + SourceIndex(0) +5 >Emitted(3, 17) Source(2, 17) + SourceIndex(0) +6 >Emitted(3, 18) Source(2, 18) + SourceIndex(0) +7 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) +8 >Emitted(3, 20) Source(2, 20) + SourceIndex(0) --- >>>} 1 >^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > >} -1 >Emitted(8, 2) Source(3, 2) + SourceIndex(0) +1 >Emitted(4, 2) Source(3, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=ES5For-of1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of10.js b/tests/baselines/reference/ES5For-of10.js index 673e2ae0f77..f12dc9d8acb 100644 --- a/tests/baselines/reference/ES5For-of10.js +++ b/tests/baselines/reference/ES5For-of10.js @@ -9,9 +9,7 @@ for (foo().x of []) { //// [ES5For-of10.js] function foo() { - return { - x: 0 - }; + return { x: 0 }; } for (var _i = 0, _a = []; _i < _a.length; _i++) { foo().x = _a[_i]; diff --git a/tests/baselines/reference/ES5For-of12.js b/tests/baselines/reference/ES5For-of12.js index 7a5534f4aa1..99c5fad5fad 100644 --- a/tests/baselines/reference/ES5For-of12.js +++ b/tests/baselines/reference/ES5For-of12.js @@ -2,10 +2,6 @@ for ([""] of [[""]]) { } //// [ES5For-of12.js] -for (var _i = 0, _a = [ - [ - "" - ] -]; _i < _a.length; _i++) { +for (var _i = 0, _a = [[""]]; _i < _a.length; _i++) { "" = _a[_i][0]; } diff --git a/tests/baselines/reference/ES5For-of13.js b/tests/baselines/reference/ES5For-of13.js index ba9c24eebfe..2bcf98e14f1 100644 --- a/tests/baselines/reference/ES5For-of13.js +++ b/tests/baselines/reference/ES5For-of13.js @@ -4,11 +4,7 @@ for (let v of ['a', 'b', 'c']) { } //// [ES5For-of13.js] -for (var _i = 0, _a = [ - 'a', - 'b', - 'c' -]; _i < _a.length; _i++) { +for (var _i = 0, _a = ['a', 'b', 'c']; _i < _a.length; _i++) { var v = _a[_i]; var x = v; } diff --git a/tests/baselines/reference/ES5For-of13.js.map b/tests/baselines/reference/ES5For-of13.js.map index 3027624c54d..5ff54bb8816 100644 --- a/tests/baselines/reference/ES5For-of13.js.map +++ b/tests/baselines/reference/ES5For-of13.js.map @@ -1,2 +1,2 @@ //// [ES5For-of13.js.map] -{"version":3,"file":"ES5For-of13.js","sourceRoot":"","sources":["ES5For-of13.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAU,UAAe,EAAf;IAAC,GAAG;IAAE,GAAG;IAAE,GAAG;CAAC,EAAxB,cAAK,EAAL,IAAwB,CAAC;IAAzB,IAAI,CAAC,SAAA;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;CACb"} \ No newline at end of file +{"version":3,"file":"ES5For-of13.js","sourceRoot":"","sources":["ES5For-of13.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAU,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAxB,cAAK,EAAL,IAAwB,CAAC;IAAzB,IAAI,CAAC,SAAA;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;CACb"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of13.sourcemap.txt b/tests/baselines/reference/ES5For-of13.sourcemap.txt index d2c3b6847e6..c3a188e7221 100644 --- a/tests/baselines/reference/ES5For-of13.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of13.sourcemap.txt @@ -8,72 +8,61 @@ sources: ES5For-of13.ts emittedFile:tests/cases/conformance/statements/for-ofStatements/ES5For-of13.js sourceFile:ES5For-of13.ts ------------------------------------------------------------------- ->>>for (var _i = 0, _a = [ +>>>for (var _i = 0, _a = ['a', 'b', 'c']; _i < _a.length; _i++) { 1 > 2 >^^^ 3 > ^ 4 > ^ 5 > ^^^^^^^^^^ 6 > ^^ +7 > ^^^^^^ +8 > ^^^ +9 > ^^ +10> ^^^ +11> ^^ +12> ^^^ +13> ^ +14> ^^ +15> ^^^^^^^^^^^^^^ +16> ^^ +17> ^^^^ +18> ^ 1 > 2 >for 3 > 4 > (let v of 5 > ['a', 'b', 'c'] 6 > +7 > [ +8 > 'a' +9 > , +10> 'b' +11> , +12> 'c' +13> ] +14> +15> let v +16> +17> let v of ['a', 'b', 'c'] +18> ) 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) 2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0) 3 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) 4 >Emitted(1, 6) Source(1, 15) + SourceIndex(0) 5 >Emitted(1, 16) Source(1, 30) + SourceIndex(0) 6 >Emitted(1, 18) Source(1, 15) + SourceIndex(0) ---- ->>> 'a', -1 >^^^^ -2 > ^^^ -3 > ^^-> -1 >[ -2 > 'a' -1 >Emitted(2, 5) Source(1, 16) + SourceIndex(0) -2 >Emitted(2, 8) Source(1, 19) + SourceIndex(0) ---- ->>> 'b', -1->^^^^ -2 > ^^^ -3 > ^-> -1->, -2 > 'b' -1->Emitted(3, 5) Source(1, 21) + SourceIndex(0) -2 >Emitted(3, 8) Source(1, 24) + SourceIndex(0) ---- ->>> 'c' -1->^^^^ -2 > ^^^ -3 > ^^^^^^^^^^^^^^^^^^^^-> -1->, -2 > 'c' -1->Emitted(4, 5) Source(1, 26) + SourceIndex(0) -2 >Emitted(4, 8) Source(1, 29) + SourceIndex(0) ---- ->>>]; _i < _a.length; _i++) { -1->^ -2 > ^^ -3 > ^^^^^^^^^^^^^^ -4 > ^^ -5 > ^^^^ -6 > ^ -1->] -2 > -3 > let v -4 > -5 > let v of ['a', 'b', 'c'] -6 > ) -1->Emitted(5, 2) Source(1, 30) + SourceIndex(0) -2 >Emitted(5, 4) Source(1, 6) + SourceIndex(0) -3 >Emitted(5, 18) Source(1, 11) + SourceIndex(0) -4 >Emitted(5, 20) Source(1, 6) + SourceIndex(0) -5 >Emitted(5, 24) Source(1, 30) + SourceIndex(0) -6 >Emitted(5, 25) Source(1, 31) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 16) + SourceIndex(0) +8 >Emitted(1, 27) Source(1, 19) + SourceIndex(0) +9 >Emitted(1, 29) Source(1, 21) + SourceIndex(0) +10>Emitted(1, 32) Source(1, 24) + SourceIndex(0) +11>Emitted(1, 34) Source(1, 26) + SourceIndex(0) +12>Emitted(1, 37) Source(1, 29) + SourceIndex(0) +13>Emitted(1, 38) Source(1, 30) + SourceIndex(0) +14>Emitted(1, 40) Source(1, 6) + SourceIndex(0) +15>Emitted(1, 54) Source(1, 11) + SourceIndex(0) +16>Emitted(1, 56) Source(1, 6) + SourceIndex(0) +17>Emitted(1, 60) Source(1, 30) + SourceIndex(0) +18>Emitted(1, 61) Source(1, 31) + SourceIndex(0) --- >>> var v = _a[_i]; 1 >^^^^ @@ -84,10 +73,10 @@ sourceFile:ES5For-of13.ts 2 > let 3 > v 4 > -1 >Emitted(6, 5) Source(1, 6) + SourceIndex(0) -2 >Emitted(6, 9) Source(1, 10) + SourceIndex(0) -3 >Emitted(6, 10) Source(1, 11) + SourceIndex(0) -4 >Emitted(6, 19) Source(1, 11) + SourceIndex(0) +1 >Emitted(2, 5) Source(1, 6) + SourceIndex(0) +2 >Emitted(2, 9) Source(1, 10) + SourceIndex(0) +3 >Emitted(2, 10) Source(1, 11) + SourceIndex(0) +4 >Emitted(2, 19) Source(1, 11) + SourceIndex(0) --- >>> var x = v; 1 >^^^^ @@ -103,18 +92,18 @@ sourceFile:ES5For-of13.ts 4 > = 5 > v 6 > ; -1 >Emitted(7, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(7, 9) Source(2, 9) + SourceIndex(0) -3 >Emitted(7, 10) Source(2, 10) + SourceIndex(0) -4 >Emitted(7, 13) Source(2, 13) + SourceIndex(0) -5 >Emitted(7, 14) Source(2, 14) + SourceIndex(0) -6 >Emitted(7, 15) Source(2, 15) + SourceIndex(0) +1 >Emitted(3, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 9) + SourceIndex(0) +3 >Emitted(3, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(3, 13) Source(2, 13) + SourceIndex(0) +5 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) +6 >Emitted(3, 15) Source(2, 15) + SourceIndex(0) --- >>>} 1 >^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > >} -1 >Emitted(8, 2) Source(3, 2) + SourceIndex(0) +1 >Emitted(4, 2) Source(3, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=ES5For-of13.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of17.js b/tests/baselines/reference/ES5For-of17.js index 4752f1be90f..50064d82932 100644 --- a/tests/baselines/reference/ES5For-of17.js +++ b/tests/baselines/reference/ES5For-of17.js @@ -11,9 +11,7 @@ for (let v of []) { for (var _i = 0, _a = []; _i < _a.length; _i++) { var v = _a[_i]; v; - for (var _b = 0, _c = [ - v - ]; _b < _c.length; _b++) { + for (var _b = 0, _c = [v]; _b < _c.length; _b++) { var v_1 = _c[_b]; var x = v_1; v_1++; diff --git a/tests/baselines/reference/ES5For-of20.js b/tests/baselines/reference/ES5For-of20.js index d3f44e4922a..c6376ab05d7 100644 --- a/tests/baselines/reference/ES5For-of20.js +++ b/tests/baselines/reference/ES5For-of20.js @@ -10,9 +10,7 @@ for (let v of []) { for (var _i = 0, _a = []; _i < _a.length; _i++) { var v = _a[_i]; var v_1; - for (var _b = 0, _c = [ - v - ]; _b < _c.length; _b++) { + for (var _b = 0, _c = [v]; _b < _c.length; _b++) { var v_2 = _c[_b]; var v_3; } diff --git a/tests/baselines/reference/ES5For-of21.js b/tests/baselines/reference/ES5For-of21.js index 9356514ea6b..d7e4db63c3b 100644 --- a/tests/baselines/reference/ES5For-of21.js +++ b/tests/baselines/reference/ES5For-of21.js @@ -4,9 +4,9 @@ for (let v of []) { } //// [ES5For-of21.js] -for (var _i = 0, _a = []; _i < _a.length; _i++) { - var v = _a[_i]; - for (var _b = 0, _c = []; _b < _c.length; _b++) { - var _i_1 = _c[_b]; +for (var _a = 0, _b = []; _a < _b.length; _a++) { + var v = _b[_a]; + for (var _c = 0, _d = []; _c < _d.length; _c++) { + var _i = _d[_c]; } } diff --git a/tests/baselines/reference/ES5For-of22.js b/tests/baselines/reference/ES5For-of22.js index 63608f36e51..6e88a5c4d71 100644 --- a/tests/baselines/reference/ES5For-of22.js +++ b/tests/baselines/reference/ES5For-of22.js @@ -5,12 +5,8 @@ for (var x of [1, 2, 3]) { } //// [ES5For-of22.js] -for (var _i = 0, _a = [ - 1, - 2, - 3 -]; _i < _a.length; _i++) { - var x = _a[_i]; - var _a_1 = 0; +for (var _i = 0, _b = [1, 2, 3]; _i < _b.length; _i++) { + var x = _b[_i]; + var _a = 0; console.log(x); } diff --git a/tests/baselines/reference/ES5For-of23.js b/tests/baselines/reference/ES5For-of23.js index dcecfac69df..3842591820f 100644 --- a/tests/baselines/reference/ES5For-of23.js +++ b/tests/baselines/reference/ES5For-of23.js @@ -5,11 +5,7 @@ for (var x of [1, 2, 3]) { } //// [ES5For-of23.js] -for (var _i = 0, _b = [ - 1, - 2, - 3 -]; _i < _b.length; _i++) { +for (var _i = 0, _b = [1, 2, 3]; _i < _b.length; _i++) { var x = _b[_i]; var _a = 0; console.log(x); diff --git a/tests/baselines/reference/ES5For-of24.js b/tests/baselines/reference/ES5For-of24.js index 00cd24ea280..cdc0876692f 100644 --- a/tests/baselines/reference/ES5For-of24.js +++ b/tests/baselines/reference/ES5For-of24.js @@ -5,11 +5,7 @@ for (var v of a) { } //// [ES5For-of24.js] -var a = [ - 1, - 2, - 3 -]; +var a = [1, 2, 3]; for (var _i = 0; _i < a.length; _i++) { var v = a[_i]; var a_1 = 0; diff --git a/tests/baselines/reference/ES5For-of25.js b/tests/baselines/reference/ES5For-of25.js index 14e59a472fc..756c14fbe81 100644 --- a/tests/baselines/reference/ES5For-of25.js +++ b/tests/baselines/reference/ES5For-of25.js @@ -6,11 +6,7 @@ for (var v of a) { } //// [ES5For-of25.js] -var a = [ - 1, - 2, - 3 -]; +var a = [1, 2, 3]; for (var _i = 0; _i < a.length; _i++) { var v = a[_i]; v; diff --git a/tests/baselines/reference/ES5For-of25.js.map b/tests/baselines/reference/ES5For-of25.js.map index 90f1b9c0750..cc31767128b 100644 --- a/tests/baselines/reference/ES5For-of25.js.map +++ b/tests/baselines/reference/ES5For-of25.js.map @@ -1,2 +1,2 @@ //// [ES5For-of25.js.map] -{"version":3,"file":"ES5For-of25.js","sourceRoot":"","sources":["ES5For-of25.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG;IAAC,CAAC;IAAE,CAAC;IAAE,CAAC;CAAC,CAAC;AAClB,GAAG,CAAC,CAAU,UAAC,EAAV,aAAK,EAAL,IAAU,CAAC;IAAX,IAAI,CAAC,GAAI,CAAC,IAAL;IACN,CAAC,CAAC;IACF,CAAC,CAAC;CACL"} \ No newline at end of file +{"version":3,"file":"ES5For-of25.js","sourceRoot":"","sources":["ES5For-of25.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAClB,GAAG,CAAC,CAAU,UAAC,EAAV,aAAK,EAAL,IAAU,CAAC;IAAX,IAAI,CAAC,GAAI,CAAC,IAAL;IACN,CAAC,CAAC;IACF,CAAC,CAAC;CACL"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of25.sourcemap.txt b/tests/baselines/reference/ES5For-of25.sourcemap.txt index 1031764b03a..623627fde20 100644 --- a/tests/baselines/reference/ES5For-of25.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of25.sourcemap.txt @@ -8,54 +8,44 @@ sources: ES5For-of25.ts emittedFile:tests/cases/conformance/statements/for-ofStatements/ES5For-of25.js sourceFile:ES5For-of25.ts ------------------------------------------------------------------- ->>>var a = [ +>>>var a = [1, 2, 3]; 1 > 2 >^^^^ 3 > ^ 4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^ +9 > ^^ +10> ^ +11> ^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^-> 1 > 2 >var 3 > a 4 > = +5 > [ +6 > 1 +7 > , +8 > 2 +9 > , +10> 3 +11> ] +12> ; 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) 2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) 3 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) 4 >Emitted(1, 9) Source(1, 9) + SourceIndex(0) ---- ->>> 1, -1 >^^^^ -2 > ^ -3 > ^^-> -1 >[ -2 > 1 -1 >Emitted(2, 5) Source(1, 10) + SourceIndex(0) -2 >Emitted(2, 6) Source(1, 11) + SourceIndex(0) ---- ->>> 2, -1->^^^^ -2 > ^ -3 > ^-> -1->, -2 > 2 -1->Emitted(3, 5) Source(1, 13) + SourceIndex(0) -2 >Emitted(3, 6) Source(1, 14) + SourceIndex(0) ---- ->>> 3 -1->^^^^ -2 > ^ -1->, -2 > 3 -1->Emitted(4, 5) Source(1, 16) + SourceIndex(0) -2 >Emitted(4, 6) Source(1, 17) + SourceIndex(0) ---- ->>>]; -1 >^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 >] -2 > ; -1 >Emitted(5, 2) Source(1, 18) + SourceIndex(0) -2 >Emitted(5, 3) Source(1, 19) + SourceIndex(0) +5 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +6 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) +7 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +8 >Emitted(1, 14) Source(1, 14) + SourceIndex(0) +9 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +10>Emitted(1, 17) Source(1, 17) + SourceIndex(0) +11>Emitted(1, 18) Source(1, 18) + SourceIndex(0) +12>Emitted(1, 19) Source(1, 19) + SourceIndex(0) --- >>>for (var _i = 0; _i < a.length; _i++) { 1-> @@ -79,16 +69,16 @@ sourceFile:ES5For-of25.ts 8 > 9 > var v of a 10> ) -1->Emitted(6, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(6, 4) Source(2, 4) + SourceIndex(0) -3 >Emitted(6, 5) Source(2, 5) + SourceIndex(0) -4 >Emitted(6, 6) Source(2, 15) + SourceIndex(0) -5 >Emitted(6, 16) Source(2, 16) + SourceIndex(0) -6 >Emitted(6, 18) Source(2, 6) + SourceIndex(0) -7 >Emitted(6, 31) Source(2, 11) + SourceIndex(0) -8 >Emitted(6, 33) Source(2, 6) + SourceIndex(0) -9 >Emitted(6, 37) Source(2, 16) + SourceIndex(0) -10>Emitted(6, 38) Source(2, 17) + SourceIndex(0) +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 4) Source(2, 4) + SourceIndex(0) +3 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +4 >Emitted(2, 6) Source(2, 15) + SourceIndex(0) +5 >Emitted(2, 16) Source(2, 16) + SourceIndex(0) +6 >Emitted(2, 18) Source(2, 6) + SourceIndex(0) +7 >Emitted(2, 31) Source(2, 11) + SourceIndex(0) +8 >Emitted(2, 33) Source(2, 6) + SourceIndex(0) +9 >Emitted(2, 37) Source(2, 16) + SourceIndex(0) +10>Emitted(2, 38) Source(2, 17) + SourceIndex(0) --- >>> var v = a[_i]; 1 >^^^^ @@ -103,12 +93,12 @@ sourceFile:ES5For-of25.ts 4 > of 5 > a 6 > -1 >Emitted(7, 5) Source(2, 6) + SourceIndex(0) -2 >Emitted(7, 9) Source(2, 10) + SourceIndex(0) -3 >Emitted(7, 10) Source(2, 11) + SourceIndex(0) -4 >Emitted(7, 13) Source(2, 15) + SourceIndex(0) -5 >Emitted(7, 14) Source(2, 16) + SourceIndex(0) -6 >Emitted(7, 18) Source(2, 11) + SourceIndex(0) +1 >Emitted(3, 5) Source(2, 6) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 10) + SourceIndex(0) +3 >Emitted(3, 10) Source(2, 11) + SourceIndex(0) +4 >Emitted(3, 13) Source(2, 15) + SourceIndex(0) +5 >Emitted(3, 14) Source(2, 16) + SourceIndex(0) +6 >Emitted(3, 18) Source(2, 11) + SourceIndex(0) --- >>> v; 1 >^^^^ @@ -119,9 +109,9 @@ sourceFile:ES5For-of25.ts > 2 > v 3 > ; -1 >Emitted(8, 5) Source(3, 5) + SourceIndex(0) -2 >Emitted(8, 6) Source(3, 6) + SourceIndex(0) -3 >Emitted(8, 7) Source(3, 7) + SourceIndex(0) +1 >Emitted(4, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(4, 6) Source(3, 6) + SourceIndex(0) +3 >Emitted(4, 7) Source(3, 7) + SourceIndex(0) --- >>> a; 1->^^^^ @@ -131,15 +121,15 @@ sourceFile:ES5For-of25.ts > 2 > a 3 > ; -1->Emitted(9, 5) Source(4, 5) + SourceIndex(0) -2 >Emitted(9, 6) Source(4, 6) + SourceIndex(0) -3 >Emitted(9, 7) Source(4, 7) + SourceIndex(0) +1->Emitted(5, 5) Source(4, 5) + SourceIndex(0) +2 >Emitted(5, 6) Source(4, 6) + SourceIndex(0) +3 >Emitted(5, 7) Source(4, 7) + SourceIndex(0) --- >>>} 1 >^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > >} -1 >Emitted(10, 2) Source(5, 2) + SourceIndex(0) +1 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=ES5For-of25.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of26.js b/tests/baselines/reference/ES5For-of26.js index 2cbb65ad790..4571cc660a3 100644 --- a/tests/baselines/reference/ES5For-of26.js +++ b/tests/baselines/reference/ES5For-of26.js @@ -5,10 +5,7 @@ for (var [a = 0, b = 1] of [2, 3]) { } //// [ES5For-of26.js] -for (var _i = 0, _a = [ - 2, - 3 -]; _i < _a.length; _i++) { +for (var _i = 0, _a = [2, 3]; _i < _a.length; _i++) { var _b = _a[_i], _c = _b[0], a = _c === void 0 ? 0 : _c, _d = _b[1], b = _d === void 0 ? 1 : _d; a; b; diff --git a/tests/baselines/reference/ES5For-of26.js.map b/tests/baselines/reference/ES5For-of26.js.map index d80a8a75951..704a3a24f2a 100644 --- a/tests/baselines/reference/ES5For-of26.js.map +++ b/tests/baselines/reference/ES5For-of26.js.map @@ -1,2 +1,2 @@ //// [ES5For-of26.js.map] -{"version":3,"file":"ES5For-of26.js","sourceRoot":"","sources":["ES5For-of26.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAuB,UAAM,EAAN;IAAC,CAAC;IAAE,CAAC;CAAC,EAA5B,cAAkB,EAAlB,IAA4B,CAAC;IAA7B,6BAAK,CAAC,mBAAG,CAAC,mBAAE,CAAC,mBAAG,CAAC,KAAC;IACnB,CAAC,CAAC;IACF,CAAC,CAAC;CACL"} \ No newline at end of file +{"version":3,"file":"ES5For-of26.js","sourceRoot":"","sources":["ES5For-of26.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAuB,UAAM,EAAN,MAAC,CAAC,EAAE,CAAC,CAAC,EAA5B,cAAkB,EAAlB,IAA4B,CAAC;IAA7B,6BAAK,CAAC,mBAAG,CAAC,mBAAE,CAAC,mBAAG,CAAC,KAAC;IACnB,CAAC,CAAC;IACF,CAAC,CAAC;CACL"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of26.sourcemap.txt b/tests/baselines/reference/ES5For-of26.sourcemap.txt index 4fcc759dca8..c9942b1e861 100644 --- a/tests/baselines/reference/ES5For-of26.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of26.sourcemap.txt @@ -8,64 +8,56 @@ sources: ES5For-of26.ts emittedFile:tests/cases/conformance/statements/for-ofStatements/ES5For-of26.js sourceFile:ES5For-of26.ts ------------------------------------------------------------------- ->>>for (var _i = 0, _a = [ +>>>for (var _i = 0, _a = [2, 3]; _i < _a.length; _i++) { 1 > 2 >^^^ 3 > ^ 4 > ^ 5 > ^^^^^^^^^^ 6 > ^^ +7 > ^^^^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > 2 >for 3 > 4 > (var [a = 0, b = 1] of 5 > [2, 3] 6 > +7 > [ +8 > 2 +9 > , +10> 3 +11> ] +12> +13> var [a = 0, b = 1] +14> +15> var [a = 0, b = 1] of [2, 3] +16> ) 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) 2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0) 3 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) 4 >Emitted(1, 6) Source(1, 28) + SourceIndex(0) 5 >Emitted(1, 16) Source(1, 34) + SourceIndex(0) 6 >Emitted(1, 18) Source(1, 28) + SourceIndex(0) ---- ->>> 2, -1 >^^^^ -2 > ^ -3 > ^-> -1 >[ -2 > 2 -1 >Emitted(2, 5) Source(1, 29) + SourceIndex(0) -2 >Emitted(2, 6) Source(1, 30) + SourceIndex(0) ---- ->>> 3 -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1->, -2 > 3 -1->Emitted(3, 5) Source(1, 32) + SourceIndex(0) -2 >Emitted(3, 6) Source(1, 33) + SourceIndex(0) ---- ->>>]; _i < _a.length; _i++) { -1->^ -2 > ^^ -3 > ^^^^^^^^^^^^^^ -4 > ^^ -5 > ^^^^ -6 > ^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1->] -2 > -3 > var [a = 0, b = 1] -4 > -5 > var [a = 0, b = 1] of [2, 3] -6 > ) -1->Emitted(4, 2) Source(1, 34) + SourceIndex(0) -2 >Emitted(4, 4) Source(1, 6) + SourceIndex(0) -3 >Emitted(4, 18) Source(1, 24) + SourceIndex(0) -4 >Emitted(4, 20) Source(1, 6) + SourceIndex(0) -5 >Emitted(4, 24) Source(1, 34) + SourceIndex(0) -6 >Emitted(4, 25) Source(1, 35) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 29) + SourceIndex(0) +8 >Emitted(1, 25) Source(1, 30) + SourceIndex(0) +9 >Emitted(1, 27) Source(1, 32) + SourceIndex(0) +10>Emitted(1, 28) Source(1, 33) + SourceIndex(0) +11>Emitted(1, 29) Source(1, 34) + SourceIndex(0) +12>Emitted(1, 31) Source(1, 6) + SourceIndex(0) +13>Emitted(1, 45) Source(1, 24) + SourceIndex(0) +14>Emitted(1, 47) Source(1, 6) + SourceIndex(0) +15>Emitted(1, 51) Source(1, 34) + SourceIndex(0) +16>Emitted(1, 52) Source(1, 35) + SourceIndex(0) --- >>> var _b = _a[_i], _c = _b[0], a = _c === void 0 ? 0 : _c, _d = _b[1], b = _d === void 0 ? 1 : _d; 1->^^^^ @@ -88,16 +80,16 @@ sourceFile:ES5For-of26.ts 8 > = 9 > 1 10> ] -1->Emitted(5, 5) Source(1, 6) + SourceIndex(0) -2 >Emitted(5, 34) Source(1, 11) + SourceIndex(0) -3 >Emitted(5, 35) Source(1, 12) + SourceIndex(0) -4 >Emitted(5, 54) Source(1, 15) + SourceIndex(0) -5 >Emitted(5, 55) Source(1, 16) + SourceIndex(0) -6 >Emitted(5, 74) Source(1, 18) + SourceIndex(0) -7 >Emitted(5, 75) Source(1, 19) + SourceIndex(0) -8 >Emitted(5, 94) Source(1, 22) + SourceIndex(0) -9 >Emitted(5, 95) Source(1, 23) + SourceIndex(0) -10>Emitted(5, 100) Source(1, 24) + SourceIndex(0) +1->Emitted(2, 5) Source(1, 6) + SourceIndex(0) +2 >Emitted(2, 34) Source(1, 11) + SourceIndex(0) +3 >Emitted(2, 35) Source(1, 12) + SourceIndex(0) +4 >Emitted(2, 54) Source(1, 15) + SourceIndex(0) +5 >Emitted(2, 55) Source(1, 16) + SourceIndex(0) +6 >Emitted(2, 74) Source(1, 18) + SourceIndex(0) +7 >Emitted(2, 75) Source(1, 19) + SourceIndex(0) +8 >Emitted(2, 94) Source(1, 22) + SourceIndex(0) +9 >Emitted(2, 95) Source(1, 23) + SourceIndex(0) +10>Emitted(2, 100) Source(1, 24) + SourceIndex(0) --- >>> a; 1 >^^^^ @@ -108,9 +100,9 @@ sourceFile:ES5For-of26.ts > 2 > a 3 > ; -1 >Emitted(6, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(6, 6) Source(2, 6) + SourceIndex(0) -3 >Emitted(6, 7) Source(2, 7) + SourceIndex(0) +1 >Emitted(3, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(3, 6) Source(2, 6) + SourceIndex(0) +3 >Emitted(3, 7) Source(2, 7) + SourceIndex(0) --- >>> b; 1->^^^^ @@ -120,15 +112,15 @@ sourceFile:ES5For-of26.ts > 2 > b 3 > ; -1->Emitted(7, 5) Source(3, 5) + SourceIndex(0) -2 >Emitted(7, 6) Source(3, 6) + SourceIndex(0) -3 >Emitted(7, 7) Source(3, 7) + SourceIndex(0) +1->Emitted(4, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(4, 6) Source(3, 6) + SourceIndex(0) +3 >Emitted(4, 7) Source(3, 7) + SourceIndex(0) --- >>>} 1 >^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > >} -1 >Emitted(8, 2) Source(4, 2) + SourceIndex(0) +1 >Emitted(5, 2) Source(4, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=ES5For-of26.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of27.js b/tests/baselines/reference/ES5For-of27.js index c3993f6da52..c8e5a03b114 100644 --- a/tests/baselines/reference/ES5For-of27.js +++ b/tests/baselines/reference/ES5For-of27.js @@ -5,10 +5,7 @@ for (var {x: a = 0, y: b = 1} of [2, 3]) { } //// [ES5For-of27.js] -for (var _i = 0, _a = [ - 2, - 3 -]; _i < _a.length; _i++) { +for (var _i = 0, _a = [2, 3]; _i < _a.length; _i++) { var _b = _a[_i], _c = _b.x, a = _c === void 0 ? 0 : _c, _d = _b.y, b = _d === void 0 ? 1 : _d; a; b; diff --git a/tests/baselines/reference/ES5For-of28.js b/tests/baselines/reference/ES5For-of28.js index f1fa44a8453..362b8835212 100644 --- a/tests/baselines/reference/ES5For-of28.js +++ b/tests/baselines/reference/ES5For-of28.js @@ -5,10 +5,7 @@ for (let [a = 0, b = 1] of [2, 3]) { } //// [ES5For-of28.js] -for (var _i = 0, _a = [ - 2, - 3 -]; _i < _a.length; _i++) { +for (var _i = 0, _a = [2, 3]; _i < _a.length; _i++) { var _b = _a[_i], _c = _b[0], a = _c === void 0 ? 0 : _c, _d = _b[1], b = _d === void 0 ? 1 : _d; a; b; diff --git a/tests/baselines/reference/ES5For-of29.js b/tests/baselines/reference/ES5For-of29.js index 11f847262e9..338ff311dba 100644 --- a/tests/baselines/reference/ES5For-of29.js +++ b/tests/baselines/reference/ES5For-of29.js @@ -5,10 +5,7 @@ for (const {x: a = 0, y: b = 1} of [2, 3]) { } //// [ES5For-of29.js] -for (var _i = 0, _a = [ - 2, - 3 -]; _i < _a.length; _i++) { +for (var _i = 0, _a = [2, 3]; _i < _a.length; _i++) { var _b = _a[_i], _c = _b.x, a = _c === void 0 ? 0 : _c, _d = _b.y, b = _d === void 0 ? 1 : _d; a; b; diff --git a/tests/baselines/reference/ES5For-of3.js b/tests/baselines/reference/ES5For-of3.js index 9c2808edbba..648d34a9b16 100644 --- a/tests/baselines/reference/ES5For-of3.js +++ b/tests/baselines/reference/ES5For-of3.js @@ -3,11 +3,7 @@ for (var v of ['a', 'b', 'c']) var x = v; //// [ES5For-of3.js] -for (var _i = 0, _a = [ - 'a', - 'b', - 'c' -]; _i < _a.length; _i++) { +for (var _i = 0, _a = ['a', 'b', 'c']; _i < _a.length; _i++) { var v = _a[_i]; var x = v; } diff --git a/tests/baselines/reference/ES5For-of3.js.map b/tests/baselines/reference/ES5For-of3.js.map index bfc09619d8e..7454e1ca85d 100644 --- a/tests/baselines/reference/ES5For-of3.js.map +++ b/tests/baselines/reference/ES5For-of3.js.map @@ -1,2 +1,2 @@ //// [ES5For-of3.js.map] -{"version":3,"file":"ES5For-of3.js","sourceRoot":"","sources":["ES5For-of3.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAU,UAAe,EAAf;IAAC,GAAG;IAAE,GAAG;IAAE,GAAG;CAAC,EAAxB,cAAK,EAAL,IAAwB,CAAC;IAAzB,IAAI,CAAC,SAAA;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;CAAA"} \ No newline at end of file +{"version":3,"file":"ES5For-of3.js","sourceRoot":"","sources":["ES5For-of3.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAU,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAxB,cAAK,EAAL,IAAwB,CAAC;IAAzB,IAAI,CAAC,SAAA;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of3.sourcemap.txt b/tests/baselines/reference/ES5For-of3.sourcemap.txt index 252a4a7414c..dd0bca37b68 100644 --- a/tests/baselines/reference/ES5For-of3.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of3.sourcemap.txt @@ -8,72 +8,61 @@ sources: ES5For-of3.ts emittedFile:tests/cases/conformance/statements/for-ofStatements/ES5For-of3.js sourceFile:ES5For-of3.ts ------------------------------------------------------------------- ->>>for (var _i = 0, _a = [ +>>>for (var _i = 0, _a = ['a', 'b', 'c']; _i < _a.length; _i++) { 1 > 2 >^^^ 3 > ^ 4 > ^ 5 > ^^^^^^^^^^ 6 > ^^ +7 > ^^^^^^ +8 > ^^^ +9 > ^^ +10> ^^^ +11> ^^ +12> ^^^ +13> ^ +14> ^^ +15> ^^^^^^^^^^^^^^ +16> ^^ +17> ^^^^ +18> ^ 1 > 2 >for 3 > 4 > (var v of 5 > ['a', 'b', 'c'] 6 > +7 > [ +8 > 'a' +9 > , +10> 'b' +11> , +12> 'c' +13> ] +14> +15> var v +16> +17> var v of ['a', 'b', 'c'] +18> ) 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) 2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0) 3 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) 4 >Emitted(1, 6) Source(1, 15) + SourceIndex(0) 5 >Emitted(1, 16) Source(1, 30) + SourceIndex(0) 6 >Emitted(1, 18) Source(1, 15) + SourceIndex(0) ---- ->>> 'a', -1 >^^^^ -2 > ^^^ -3 > ^^-> -1 >[ -2 > 'a' -1 >Emitted(2, 5) Source(1, 16) + SourceIndex(0) -2 >Emitted(2, 8) Source(1, 19) + SourceIndex(0) ---- ->>> 'b', -1->^^^^ -2 > ^^^ -3 > ^-> -1->, -2 > 'b' -1->Emitted(3, 5) Source(1, 21) + SourceIndex(0) -2 >Emitted(3, 8) Source(1, 24) + SourceIndex(0) ---- ->>> 'c' -1->^^^^ -2 > ^^^ -3 > ^^^^^^^^^^^^^^^^^^^^-> -1->, -2 > 'c' -1->Emitted(4, 5) Source(1, 26) + SourceIndex(0) -2 >Emitted(4, 8) Source(1, 29) + SourceIndex(0) ---- ->>>]; _i < _a.length; _i++) { -1->^ -2 > ^^ -3 > ^^^^^^^^^^^^^^ -4 > ^^ -5 > ^^^^ -6 > ^ -1->] -2 > -3 > var v -4 > -5 > var v of ['a', 'b', 'c'] -6 > ) -1->Emitted(5, 2) Source(1, 30) + SourceIndex(0) -2 >Emitted(5, 4) Source(1, 6) + SourceIndex(0) -3 >Emitted(5, 18) Source(1, 11) + SourceIndex(0) -4 >Emitted(5, 20) Source(1, 6) + SourceIndex(0) -5 >Emitted(5, 24) Source(1, 30) + SourceIndex(0) -6 >Emitted(5, 25) Source(1, 31) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 16) + SourceIndex(0) +8 >Emitted(1, 27) Source(1, 19) + SourceIndex(0) +9 >Emitted(1, 29) Source(1, 21) + SourceIndex(0) +10>Emitted(1, 32) Source(1, 24) + SourceIndex(0) +11>Emitted(1, 34) Source(1, 26) + SourceIndex(0) +12>Emitted(1, 37) Source(1, 29) + SourceIndex(0) +13>Emitted(1, 38) Source(1, 30) + SourceIndex(0) +14>Emitted(1, 40) Source(1, 6) + SourceIndex(0) +15>Emitted(1, 54) Source(1, 11) + SourceIndex(0) +16>Emitted(1, 56) Source(1, 6) + SourceIndex(0) +17>Emitted(1, 60) Source(1, 30) + SourceIndex(0) +18>Emitted(1, 61) Source(1, 31) + SourceIndex(0) --- >>> var v = _a[_i]; 1 >^^^^ @@ -84,10 +73,10 @@ sourceFile:ES5For-of3.ts 2 > var 3 > v 4 > -1 >Emitted(6, 5) Source(1, 6) + SourceIndex(0) -2 >Emitted(6, 9) Source(1, 10) + SourceIndex(0) -3 >Emitted(6, 10) Source(1, 11) + SourceIndex(0) -4 >Emitted(6, 19) Source(1, 11) + SourceIndex(0) +1 >Emitted(2, 5) Source(1, 6) + SourceIndex(0) +2 >Emitted(2, 9) Source(1, 10) + SourceIndex(0) +3 >Emitted(2, 10) Source(1, 11) + SourceIndex(0) +4 >Emitted(2, 19) Source(1, 11) + SourceIndex(0) --- >>> var x = v; 1 >^^^^ @@ -103,17 +92,17 @@ sourceFile:ES5For-of3.ts 4 > = 5 > v 6 > ; -1 >Emitted(7, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(7, 9) Source(2, 9) + SourceIndex(0) -3 >Emitted(7, 10) Source(2, 10) + SourceIndex(0) -4 >Emitted(7, 13) Source(2, 13) + SourceIndex(0) -5 >Emitted(7, 14) Source(2, 14) + SourceIndex(0) -6 >Emitted(7, 15) Source(2, 15) + SourceIndex(0) +1 >Emitted(3, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 9) + SourceIndex(0) +3 >Emitted(3, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(3, 13) Source(2, 13) + SourceIndex(0) +5 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) +6 >Emitted(3, 15) Source(2, 15) + SourceIndex(0) --- >>>} 1 >^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > -1 >Emitted(8, 2) Source(2, 15) + SourceIndex(0) +1 >Emitted(4, 2) Source(2, 15) + SourceIndex(0) --- >>>//# sourceMappingURL=ES5For-of3.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of30.js b/tests/baselines/reference/ES5For-of30.js index f76a7938dcb..2a1dc5a3399 100644 --- a/tests/baselines/reference/ES5For-of30.js +++ b/tests/baselines/reference/ES5For-of30.js @@ -8,10 +8,7 @@ for ([a = 1, b = ""] of tuple) { //// [ES5For-of30.js] var a, b; -var tuple = [ - 2, - "3" -]; +var tuple = [2, "3"]; for (var _i = 0; _i < tuple.length; _i++) { _a = tuple[_i], _b = _a[0], a = _b === void 0 ? 1 : _b, _c = _a[1], b = _c === void 0 ? "" : _c; a; diff --git a/tests/baselines/reference/ES5For-of6.js b/tests/baselines/reference/ES5For-of6.js index ac740814d80..bf966a0a5ae 100644 --- a/tests/baselines/reference/ES5For-of6.js +++ b/tests/baselines/reference/ES5For-of6.js @@ -10,9 +10,6 @@ for (var _i = 0, _a = []; _i < _a.length; _i++) { var w = _a[_i]; for (var _b = 0, _c = []; _b < _c.length; _b++) { var v = _c[_b]; - var x = [ - w, - v - ]; + var x = [w, v]; } } diff --git a/tests/baselines/reference/ES5For-of7.js b/tests/baselines/reference/ES5For-of7.js index b88b6c055ac..ad2302cdc5c 100644 --- a/tests/baselines/reference/ES5For-of7.js +++ b/tests/baselines/reference/ES5For-of7.js @@ -14,8 +14,5 @@ for (var _i = 0, _a = []; _i < _a.length; _i++) { } for (var _b = 0, _c = []; _b < _c.length; _b++) { var v = _c[_b]; - var x = [ - w, - v - ]; + var x = [w, v]; } diff --git a/tests/baselines/reference/ES5For-of8.js b/tests/baselines/reference/ES5For-of8.js index 6bf7dc37d1f..dbe747b9690 100644 --- a/tests/baselines/reference/ES5For-of8.js +++ b/tests/baselines/reference/ES5For-of8.js @@ -8,15 +8,9 @@ for (foo().x of ['a', 'b', 'c']) { //// [ES5For-of8.js] function foo() { - return { - x: 0 - }; + return { x: 0 }; } -for (var _i = 0, _a = [ - 'a', - 'b', - 'c' -]; _i < _a.length; _i++) { +for (var _i = 0, _a = ['a', 'b', 'c']; _i < _a.length; _i++) { foo().x = _a[_i]; var p = foo().x; } diff --git a/tests/baselines/reference/ES5For-of8.js.map b/tests/baselines/reference/ES5For-of8.js.map index eadf5e8430e..be14106e77c 100644 --- a/tests/baselines/reference/ES5For-of8.js.map +++ b/tests/baselines/reference/ES5For-of8.js.map @@ -1,2 +1,2 @@ //// [ES5For-of8.js.map] -{"version":3,"file":"ES5For-of8.js","sourceRoot":"","sources":["ES5For-of8.ts"],"names":["foo"],"mappings":"AAAA;IACIA,MAAMA,CAACA;QAAEA,CAACA,EAAEA,CAACA;KAAEA,CAACA;AACpBA,CAACA;AACD,GAAG,CAAC,CAAY,UAAe,EAAf;IAAC,GAAG;IAAE,GAAG;IAAE,GAAG;CAAC,EAA1B,cAAO,EAAP,IAA0B,CAAC;IAA3B,GAAG,EAAE,CAAC,CAAC,SAAA;IACR,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;CACnB"} \ No newline at end of file +{"version":3,"file":"ES5For-of8.js","sourceRoot":"","sources":["ES5For-of8.ts"],"names":["foo"],"mappings":"AAAA;IACIA,MAAMA,CAACA,EAAEA,CAACA,EAAEA,CAACA,EAAEA,CAACA;AACpBA,CAACA;AACD,GAAG,CAAC,CAAY,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAA1B,cAAO,EAAP,IAA0B,CAAC;IAA3B,GAAG,EAAE,CAAC,CAAC,SAAA;IACR,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;CACnB"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of8.sourcemap.txt b/tests/baselines/reference/ES5For-of8.sourcemap.txt index f4b97ebe696..814f4364dc6 100644 --- a/tests/baselines/reference/ES5For-of8.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of8.sourcemap.txt @@ -10,62 +10,69 @@ sourceFile:ES5For-of8.ts ------------------------------------------------------------------- >>>function foo() { 1 > -2 >^^^^^^^^^^^^^-> +2 >^^^^^^^^^^^^^^^^^^^^^-> 1 > 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) --- ->>> return { +>>> return { x: 0 }; 1->^^^^ 2 > ^^^^^^ 3 > ^ -4 > ^^-> +4 > ^^ +5 > ^ +6 > ^^ +7 > ^ +8 > ^^ +9 > ^ 1->function foo() { > 2 > return 3 > +4 > { +5 > x +6 > : +7 > 0 +8 > } +9 > ; 1->Emitted(2, 5) Source(2, 5) + SourceIndex(0) name (foo) 2 >Emitted(2, 11) Source(2, 11) + SourceIndex(0) name (foo) 3 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) name (foo) ---- ->>> x: 0 -1->^^^^^^^^ -2 > ^ -3 > ^^ -4 > ^ -1->{ -2 > x -3 > : -4 > 0 -1->Emitted(3, 9) Source(2, 14) + SourceIndex(0) name (foo) -2 >Emitted(3, 10) Source(2, 15) + SourceIndex(0) name (foo) -3 >Emitted(3, 12) Source(2, 17) + SourceIndex(0) name (foo) -4 >Emitted(3, 13) Source(2, 18) + SourceIndex(0) name (foo) ---- ->>> }; -1 >^^^^^ -2 > ^ -1 > } -2 > ; -1 >Emitted(4, 6) Source(2, 20) + SourceIndex(0) name (foo) -2 >Emitted(4, 7) Source(2, 21) + SourceIndex(0) name (foo) +4 >Emitted(2, 14) Source(2, 14) + SourceIndex(0) name (foo) +5 >Emitted(2, 15) Source(2, 15) + SourceIndex(0) name (foo) +6 >Emitted(2, 17) Source(2, 17) + SourceIndex(0) name (foo) +7 >Emitted(2, 18) Source(2, 18) + SourceIndex(0) name (foo) +8 >Emitted(2, 20) Source(2, 20) + SourceIndex(0) name (foo) +9 >Emitted(2, 21) Source(2, 21) + SourceIndex(0) name (foo) --- >>>} 1 > 2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 >} -1 >Emitted(5, 1) Source(3, 1) + SourceIndex(0) name (foo) -2 >Emitted(5, 2) Source(3, 2) + SourceIndex(0) name (foo) +1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) name (foo) +2 >Emitted(3, 2) Source(3, 2) + SourceIndex(0) name (foo) --- ->>>for (var _i = 0, _a = [ +>>>for (var _i = 0, _a = ['a', 'b', 'c']; _i < _a.length; _i++) { 1-> 2 >^^^ 3 > ^ 4 > ^ 5 > ^^^^^^^^^^ 6 > ^^ +7 > ^^^^^^ +8 > ^^^ +9 > ^^ +10> ^^^ +11> ^^ +12> ^^^ +13> ^ +14> ^^ +15> ^^^^^^^^^^^^^^ +16> ^^ +17> ^^^^ +18> ^ 1-> > 2 >for @@ -73,59 +80,36 @@ sourceFile:ES5For-of8.ts 4 > (foo().x of 5 > ['a', 'b', 'c'] 6 > -1->Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 4) Source(4, 4) + SourceIndex(0) -3 >Emitted(6, 5) Source(4, 5) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 17) + SourceIndex(0) -5 >Emitted(6, 16) Source(4, 32) + SourceIndex(0) -6 >Emitted(6, 18) Source(4, 17) + SourceIndex(0) ---- ->>> 'a', -1 >^^^^ -2 > ^^^ -3 > ^^-> -1 >[ -2 > 'a' -1 >Emitted(7, 5) Source(4, 18) + SourceIndex(0) -2 >Emitted(7, 8) Source(4, 21) + SourceIndex(0) ---- ->>> 'b', -1->^^^^ -2 > ^^^ -3 > ^-> -1->, -2 > 'b' -1->Emitted(8, 5) Source(4, 23) + SourceIndex(0) -2 >Emitted(8, 8) Source(4, 26) + SourceIndex(0) ---- ->>> 'c' -1->^^^^ -2 > ^^^ -3 > ^^^^^^^^^^^^^^^^^^^^-> -1->, -2 > 'c' -1->Emitted(9, 5) Source(4, 28) + SourceIndex(0) -2 >Emitted(9, 8) Source(4, 31) + SourceIndex(0) ---- ->>>]; _i < _a.length; _i++) { -1->^ -2 > ^^ -3 > ^^^^^^^^^^^^^^ -4 > ^^ -5 > ^^^^ -6 > ^ -1->] -2 > -3 > foo().x -4 > -5 > foo().x of ['a', 'b', 'c'] -6 > ) -1->Emitted(10, 2) Source(4, 32) + SourceIndex(0) -2 >Emitted(10, 4) Source(4, 6) + SourceIndex(0) -3 >Emitted(10, 18) Source(4, 13) + SourceIndex(0) -4 >Emitted(10, 20) Source(4, 6) + SourceIndex(0) -5 >Emitted(10, 24) Source(4, 32) + SourceIndex(0) -6 >Emitted(10, 25) Source(4, 33) + SourceIndex(0) +7 > [ +8 > 'a' +9 > , +10> 'b' +11> , +12> 'c' +13> ] +14> +15> foo().x +16> +17> foo().x of ['a', 'b', 'c'] +18> ) +1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 4) Source(4, 4) + SourceIndex(0) +3 >Emitted(4, 5) Source(4, 5) + SourceIndex(0) +4 >Emitted(4, 6) Source(4, 17) + SourceIndex(0) +5 >Emitted(4, 16) Source(4, 32) + SourceIndex(0) +6 >Emitted(4, 18) Source(4, 17) + SourceIndex(0) +7 >Emitted(4, 24) Source(4, 18) + SourceIndex(0) +8 >Emitted(4, 27) Source(4, 21) + SourceIndex(0) +9 >Emitted(4, 29) Source(4, 23) + SourceIndex(0) +10>Emitted(4, 32) Source(4, 26) + SourceIndex(0) +11>Emitted(4, 34) Source(4, 28) + SourceIndex(0) +12>Emitted(4, 37) Source(4, 31) + SourceIndex(0) +13>Emitted(4, 38) Source(4, 32) + SourceIndex(0) +14>Emitted(4, 40) Source(4, 6) + SourceIndex(0) +15>Emitted(4, 54) Source(4, 13) + SourceIndex(0) +16>Emitted(4, 56) Source(4, 6) + SourceIndex(0) +17>Emitted(4, 60) Source(4, 32) + SourceIndex(0) +18>Emitted(4, 61) Source(4, 33) + SourceIndex(0) --- >>> foo().x = _a[_i]; 1 >^^^^ @@ -141,12 +125,12 @@ sourceFile:ES5For-of8.ts 4 > . 5 > x 6 > -1 >Emitted(11, 5) Source(4, 6) + SourceIndex(0) -2 >Emitted(11, 8) Source(4, 9) + SourceIndex(0) -3 >Emitted(11, 10) Source(4, 11) + SourceIndex(0) -4 >Emitted(11, 11) Source(4, 12) + SourceIndex(0) -5 >Emitted(11, 12) Source(4, 13) + SourceIndex(0) -6 >Emitted(11, 21) Source(4, 13) + SourceIndex(0) +1 >Emitted(5, 5) Source(4, 6) + SourceIndex(0) +2 >Emitted(5, 8) Source(4, 9) + SourceIndex(0) +3 >Emitted(5, 10) Source(4, 11) + SourceIndex(0) +4 >Emitted(5, 11) Source(4, 12) + SourceIndex(0) +5 >Emitted(5, 12) Source(4, 13) + SourceIndex(0) +6 >Emitted(5, 21) Source(4, 13) + SourceIndex(0) --- >>> var p = foo().x; 1->^^^^ @@ -168,21 +152,21 @@ sourceFile:ES5For-of8.ts 7 > . 8 > x 9 > ; -1->Emitted(12, 5) Source(5, 5) + SourceIndex(0) -2 >Emitted(12, 9) Source(5, 9) + SourceIndex(0) -3 >Emitted(12, 10) Source(5, 10) + SourceIndex(0) -4 >Emitted(12, 13) Source(5, 13) + SourceIndex(0) -5 >Emitted(12, 16) Source(5, 16) + SourceIndex(0) -6 >Emitted(12, 18) Source(5, 18) + SourceIndex(0) -7 >Emitted(12, 19) Source(5, 19) + SourceIndex(0) -8 >Emitted(12, 20) Source(5, 20) + SourceIndex(0) -9 >Emitted(12, 21) Source(5, 21) + SourceIndex(0) +1->Emitted(6, 5) Source(5, 5) + SourceIndex(0) +2 >Emitted(6, 9) Source(5, 9) + SourceIndex(0) +3 >Emitted(6, 10) Source(5, 10) + SourceIndex(0) +4 >Emitted(6, 13) Source(5, 13) + SourceIndex(0) +5 >Emitted(6, 16) Source(5, 16) + SourceIndex(0) +6 >Emitted(6, 18) Source(5, 18) + SourceIndex(0) +7 >Emitted(6, 19) Source(5, 19) + SourceIndex(0) +8 >Emitted(6, 20) Source(5, 20) + SourceIndex(0) +9 >Emitted(6, 21) Source(5, 21) + SourceIndex(0) --- >>>} 1 >^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > >} -1 >Emitted(13, 2) Source(6, 2) + SourceIndex(0) +1 >Emitted(7, 2) Source(6, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=ES5For-of8.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of9.js b/tests/baselines/reference/ES5For-of9.js index bef83118864..3a2cd2b1f74 100644 --- a/tests/baselines/reference/ES5For-of9.js +++ b/tests/baselines/reference/ES5For-of9.js @@ -10,9 +10,7 @@ for (foo().x of []) { //// [ES5For-of9.js] function foo() { - return { - x: 0 - }; + return { x: 0 }; } for (var _i = 0, _a = []; _i < _a.length; _i++) { foo().x = _a[_i]; diff --git a/tests/baselines/reference/ES5For-ofTypeCheck2.js b/tests/baselines/reference/ES5For-ofTypeCheck2.js index 2c79054affc..587de4f82ff 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck2.js +++ b/tests/baselines/reference/ES5For-ofTypeCheck2.js @@ -2,8 +2,6 @@ for (var v of [true]) { } //// [ES5For-ofTypeCheck2.js] -for (var _i = 0, _a = [ - true -]; _i < _a.length; _i++) { +for (var _i = 0, _a = [true]; _i < _a.length; _i++) { var v = _a[_i]; } diff --git a/tests/baselines/reference/ES5For-ofTypeCheck3.js b/tests/baselines/reference/ES5For-ofTypeCheck3.js index b398f04e0ce..76d8237997b 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck3.js +++ b/tests/baselines/reference/ES5For-ofTypeCheck3.js @@ -3,10 +3,7 @@ var tuple: [string, number] = ["", 0]; for (var v of tuple) { } //// [ES5For-ofTypeCheck3.js] -var tuple = [ - "", - 0 -]; +var tuple = ["", 0]; for (var _i = 0; _i < tuple.length; _i++) { var v = tuple[_i]; } diff --git a/tests/baselines/reference/ES5SymbolProperty1.js b/tests/baselines/reference/ES5SymbolProperty1.js index ab3f420c95c..1073a33163d 100644 --- a/tests/baselines/reference/ES5SymbolProperty1.js +++ b/tests/baselines/reference/ES5SymbolProperty1.js @@ -14,6 +14,7 @@ obj[Symbol.foo]; var Symbol; var obj = (_a = {}, _a[Symbol.foo] = 0, - _a); + _a +); obj[Symbol.foo]; var _a; diff --git a/tests/baselines/reference/ES5SymbolProperty2.js b/tests/baselines/reference/ES5SymbolProperty2.js index a1efd6ae7ba..effd1e610f4 100644 --- a/tests/baselines/reference/ES5SymbolProperty2.js +++ b/tests/baselines/reference/ES5SymbolProperty2.js @@ -17,8 +17,7 @@ var M; var C = (function () { function C() { } - C.prototype[Symbol.iterator] = function () { - }; + C.prototype[Symbol.iterator] = function () { }; return C; })(); M.C = C; diff --git a/tests/baselines/reference/ES5SymbolProperty3.js b/tests/baselines/reference/ES5SymbolProperty3.js index 7ef892cb3c4..52ea7e091ee 100644 --- a/tests/baselines/reference/ES5SymbolProperty3.js +++ b/tests/baselines/reference/ES5SymbolProperty3.js @@ -12,8 +12,7 @@ var Symbol; var C = (function () { function C() { } - C.prototype[Symbol.iterator] = function () { - }; + C.prototype[Symbol.iterator] = function () { }; return C; })(); (new C)[Symbol.iterator]; diff --git a/tests/baselines/reference/ES5SymbolProperty4.js b/tests/baselines/reference/ES5SymbolProperty4.js index d4022066bb8..ae8a539f351 100644 --- a/tests/baselines/reference/ES5SymbolProperty4.js +++ b/tests/baselines/reference/ES5SymbolProperty4.js @@ -12,8 +12,7 @@ var Symbol; var C = (function () { function C() { } - C.prototype[Symbol.iterator] = function () { - }; + C.prototype[Symbol.iterator] = function () { }; return C; })(); (new C)[Symbol.iterator]; diff --git a/tests/baselines/reference/ES5SymbolProperty5.js b/tests/baselines/reference/ES5SymbolProperty5.js index c433b0ab443..63b12667d0f 100644 --- a/tests/baselines/reference/ES5SymbolProperty5.js +++ b/tests/baselines/reference/ES5SymbolProperty5.js @@ -12,8 +12,7 @@ var Symbol; var C = (function () { function C() { } - C.prototype[Symbol.iterator] = function () { - }; + C.prototype[Symbol.iterator] = function () { }; return C; })(); (new C)[Symbol.iterator](0); // Should error diff --git a/tests/baselines/reference/ES5SymbolProperty6.js b/tests/baselines/reference/ES5SymbolProperty6.js index 949ce722aa7..10eda091e5e 100644 --- a/tests/baselines/reference/ES5SymbolProperty6.js +++ b/tests/baselines/reference/ES5SymbolProperty6.js @@ -9,8 +9,7 @@ class C { var C = (function () { function C() { } - C.prototype[Symbol.iterator] = function () { - }; + C.prototype[Symbol.iterator] = function () { }; return C; })(); (new C)[Symbol.iterator]; diff --git a/tests/baselines/reference/ES5SymbolProperty7.js b/tests/baselines/reference/ES5SymbolProperty7.js index f98e792e8cd..d3f796ce758 100644 --- a/tests/baselines/reference/ES5SymbolProperty7.js +++ b/tests/baselines/reference/ES5SymbolProperty7.js @@ -12,8 +12,7 @@ var Symbol; var C = (function () { function C() { } - C.prototype[Symbol.iterator] = function () { - }; + C.prototype[Symbol.iterator] = function () { }; return C; })(); (new C)[Symbol.iterator]; diff --git a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js index 8fa04691498..bfa243937d6 100644 --- a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js +++ b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js @@ -35,10 +35,7 @@ var A; return Point; })(); A.Point = Point; - A.Origin = { - x: 0, - y: 0 - }; + A.Origin = { x: 0, y: 0 }; var Point3d = (function (_super) { __extends(Point3d, _super); function Point3d() { @@ -47,11 +44,7 @@ var A; return Point3d; })(Point); A.Point3d = Point3d; - A.Origin3d = { - x: 0, - y: 0, - z: 0 - }; + A.Origin3d = { x: 0, y: 0, z: 0 }; var Line = (function () { function Line(start, end) { this.start = start; diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js index 9c7e3d5db2b..71a43788c55 100644 --- a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js +++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js @@ -38,10 +38,7 @@ var A; } return Point; })(); - A.Origin = { - x: 0, - y: 0 - }; + A.Origin = { x: 0, y: 0 }; var Point3d = (function (_super) { __extends(Point3d, _super); function Point3d() { @@ -50,11 +47,7 @@ var A; return Point3d; })(Point); A.Point3d = Point3d; - A.Origin3d = { - x: 0, - y: 0, - z: 0 - }; + A.Origin3d = { x: 0, y: 0, z: 0 }; var Line = (function () { function Line(start, end) { this.start = start; diff --git a/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.js b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.js index 56f50afa97b..21d969d242c 100644 --- a/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.js +++ b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.js @@ -33,10 +33,7 @@ var A; })(); A.Line = Line; function fromOrigin(p) { - return new Line({ - x: 0, - y: 0 - }, p); + return new Line({ x: 0, y: 0 }, p); } A.fromOrigin = fromOrigin; })(A || (A = {})); diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.js b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.js index d669ce248d7..99831f10629 100644 --- a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.js +++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.js @@ -32,10 +32,7 @@ var A; })(); A.Line = Line; function fromOrigin(p) { - return new Line({ - x: 0, - y: 0 - }, p); + return new Line({ x: 0, y: 0 }, p); } A.fromOrigin = fromOrigin; })(A || (A = {})); diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.js b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.js index a7ad139f68e..3037e33d880 100644 --- a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.js +++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.js @@ -32,10 +32,7 @@ var A; return Line; })(); function fromOrigin(p) { - return new Line({ - x: 0, - y: 0 - }, p); + return new Line({ x: 0, y: 0 }, p); } A.fromOrigin = fromOrigin; })(A || (A = {})); diff --git a/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js b/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js index a5ce37fb363..e2b32a3bca4 100644 --- a/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js +++ b/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js @@ -25,13 +25,6 @@ module A { //// [ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js] var A; (function (A) { - A.Origin = { - x: 0, - y: 0 - }; - A.Origin3d = { - x: 0, - y: 0, - z: 0 - }; + A.Origin = { x: 0, y: 0 }; + A.Origin3d = { x: 0, y: 0, z: 0 }; })(A || (A = {})); diff --git a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.js b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.js index 77db9879e3b..7625500a1d0 100644 --- a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.js +++ b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.js @@ -26,13 +26,6 @@ module A { //// [ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.js] var A; (function (A) { - A.Origin = { - x: 0, - y: 0 - }; - A.Origin3d = { - x: 0, - y: 0, - z: 0 - }; + A.Origin = { x: 0, y: 0 }; + A.Origin3d = { x: 0, y: 0, z: 0 }; })(A || (A = {})); diff --git a/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.js b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.js index c2c4b64ece6..df6645df3b3 100644 --- a/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.js +++ b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.js @@ -38,10 +38,7 @@ var A; function Line(start, end) { } Line.fromOrigin = function (p) { - return new Line({ - x: 0, - y: 0 - }, p); + return new Line({ x: 0, y: 0 }, p); }; return Line; })(); diff --git a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.js b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.js index 50da60f7113..46361dd41bb 100644 --- a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.js +++ b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.js @@ -21,12 +21,6 @@ var A; } return Point; })(); - A.Origin = { - x: 0, - y: 0 - }; - A.Unity = { - start: new Point(0, 0), - end: new Point(1, 0) - }; + A.Origin = { x: 0, y: 0 }; + A.Unity = { start: new Point(0, 0), end: new Point(1, 0) }; })(A || (A = {})); diff --git a/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.js b/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.js index a4d203cc363..591845b627e 100644 --- a/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.js +++ b/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.js @@ -15,8 +15,5 @@ module A { var A; (function (A) { // valid since Point is exported - A.Origin = { - x: 0, - y: 0 - }; + A.Origin = { x: 0, y: 0 }; })(A || (A = {})); diff --git a/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.js b/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.js index de0b6e706ad..d63edb65569 100644 --- a/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.js +++ b/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.js @@ -22,14 +22,7 @@ module A { var A; (function (A) { // valid since Point is exported - A.Origin = { - x: 0, - y: 0 - }; + A.Origin = { x: 0, y: 0 }; // invalid Point3d is not exported - A.Origin3d = { - x: 0, - y: 0, - z: 0 - }; + A.Origin3d = { x: 0, y: 0, z: 0 }; })(A || (A = {})); diff --git a/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.js b/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.js index 26b2b17de38..369a5b4dd52 100644 --- a/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.js +++ b/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.js @@ -47,10 +47,7 @@ var cl = B.Point.Origin; var A; (function (A) { function Point() { - return { - x: 0, - y: 0 - }; + return { x: 0, y: 0 }; } A.Point = Point; })(A || (A = {})); @@ -59,10 +56,7 @@ var A; (function (A) { var Point; (function (Point) { - Point.Origin = { - x: 0, - y: 0 - }; + Point.Origin = { x: 0, y: 0 }; })(Point = A.Point || (A.Point = {})); })(A || (A = {})); //// [test.js] @@ -75,18 +69,12 @@ var cl = A.Point.Origin; // not expected to be an error. var B; (function (B) { function Point() { - return { - x: 0, - y: 0 - }; + return { x: 0, y: 0 }; } B.Point = Point; var Point; (function (Point) { - Point.Origin = { - x: 0, - y: 0 - }; + Point.Origin = { x: 0, y: 0 }; })(Point = B.Point || (B.Point = {})); })(B || (B = {})); var fn; diff --git a/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.js b/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.js index 8c84896b926..13302ea391a 100644 --- a/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.js +++ b/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.js @@ -26,10 +26,7 @@ var cl = B.Point.Origin; var A; (function (A) { function Point() { - return { - x: 0, - y: 0 - }; + return { x: 0, y: 0 }; } A.Point = Point; })(A || (A = {})); @@ -38,10 +35,7 @@ var B; (function (B) { var Point; (function (Point) { - Point.Origin = { - x: 0, - y: 0 - }; + Point.Origin = { x: 0, y: 0 }; })(Point = B.Point || (B.Point = {})); })(B || (B = {})); //// [test.js] diff --git a/tests/baselines/reference/FunctionDeclaration10_es6.js b/tests/baselines/reference/FunctionDeclaration10_es6.js index 96d32200564..51694533964 100644 --- a/tests/baselines/reference/FunctionDeclaration10_es6.js +++ b/tests/baselines/reference/FunctionDeclaration10_es6.js @@ -4,7 +4,5 @@ function * foo(a = yield => yield) { //// [FunctionDeclaration10_es6.js] function foo(a) { - if (a === void 0) { a = function (yield) { - return yield; - }; } + if (a === void 0) { a = function (yield) { return yield; }; } } diff --git a/tests/baselines/reference/FunctionDeclaration12_es6.js b/tests/baselines/reference/FunctionDeclaration12_es6.js index da9cea3f9c6..d9c1739cb49 100644 --- a/tests/baselines/reference/FunctionDeclaration12_es6.js +++ b/tests/baselines/reference/FunctionDeclaration12_es6.js @@ -2,5 +2,4 @@ var v = function * yield() { } //// [FunctionDeclaration12_es6.js] -var v = , yield = function () { -}; +var v = , yield = function () { }; diff --git a/tests/baselines/reference/FunctionDeclaration4.js b/tests/baselines/reference/FunctionDeclaration4.js index 53e040b28fc..b50970965f0 100644 --- a/tests/baselines/reference/FunctionDeclaration4.js +++ b/tests/baselines/reference/FunctionDeclaration4.js @@ -3,5 +3,4 @@ function foo(); function bar() { } //// [FunctionDeclaration4.js] -function bar() { -} +function bar() { } diff --git a/tests/baselines/reference/FunctionDeclaration6.js b/tests/baselines/reference/FunctionDeclaration6.js index 093fac7ed7c..721d4d80b6d 100644 --- a/tests/baselines/reference/FunctionDeclaration6.js +++ b/tests/baselines/reference/FunctionDeclaration6.js @@ -6,6 +6,5 @@ //// [FunctionDeclaration6.js] { - function bar() { - } + function bar() { } } diff --git a/tests/baselines/reference/FunctionDeclaration8_es6.js b/tests/baselines/reference/FunctionDeclaration8_es6.js index 62692997a91..64f6bff50c0 100644 --- a/tests/baselines/reference/FunctionDeclaration8_es6.js +++ b/tests/baselines/reference/FunctionDeclaration8_es6.js @@ -2,7 +2,5 @@ var v = { [yield]: foo } //// [FunctionDeclaration8_es6.js] -var v = (_a = {}, - _a[yield] = foo, - _a); +var v = (_a = {}, _a[yield] = foo, _a); var _a; diff --git a/tests/baselines/reference/FunctionDeclaration9_es6.js b/tests/baselines/reference/FunctionDeclaration9_es6.js index c63cf5bb458..bca309d2d62 100644 --- a/tests/baselines/reference/FunctionDeclaration9_es6.js +++ b/tests/baselines/reference/FunctionDeclaration9_es6.js @@ -5,8 +5,6 @@ function * foo() { //// [FunctionDeclaration9_es6.js] function foo() { - var v = (_a = {}, - _a[] = foo, - _a); + var v = (_a = {}, _a[] = foo, _a); var _a; } diff --git a/tests/baselines/reference/FunctionExpression1_es6.js b/tests/baselines/reference/FunctionExpression1_es6.js index 7c8d82f4ca8..97e5d28887d 100644 --- a/tests/baselines/reference/FunctionExpression1_es6.js +++ b/tests/baselines/reference/FunctionExpression1_es6.js @@ -2,5 +2,4 @@ var v = function * () { } //// [FunctionExpression1_es6.js] -var v = function () { -}; +var v = function () { }; diff --git a/tests/baselines/reference/FunctionExpression2_es6.js b/tests/baselines/reference/FunctionExpression2_es6.js index 0a2468bcb8c..87960e37128 100644 --- a/tests/baselines/reference/FunctionExpression2_es6.js +++ b/tests/baselines/reference/FunctionExpression2_es6.js @@ -2,5 +2,4 @@ var v = function * foo() { } //// [FunctionExpression2_es6.js] -var v = function foo() { -}; +var v = function foo() { }; diff --git a/tests/baselines/reference/FunctionPropertyAssignments1_es6.js b/tests/baselines/reference/FunctionPropertyAssignments1_es6.js index 49c2605e177..0176b412713 100644 --- a/tests/baselines/reference/FunctionPropertyAssignments1_es6.js +++ b/tests/baselines/reference/FunctionPropertyAssignments1_es6.js @@ -2,7 +2,4 @@ var v = { *foo() { } } //// [FunctionPropertyAssignments1_es6.js] -var v = { - foo: function () { - } -}; +var v = { foo: function () { } }; diff --git a/tests/baselines/reference/FunctionPropertyAssignments2_es6.js b/tests/baselines/reference/FunctionPropertyAssignments2_es6.js index 996bd08af0b..fc86a6a48d6 100644 --- a/tests/baselines/reference/FunctionPropertyAssignments2_es6.js +++ b/tests/baselines/reference/FunctionPropertyAssignments2_es6.js @@ -2,7 +2,4 @@ var v = { *() { } } //// [FunctionPropertyAssignments2_es6.js] -var v = { - : function () { - } -}; +var v = { : function () { } }; diff --git a/tests/baselines/reference/FunctionPropertyAssignments3_es6.js b/tests/baselines/reference/FunctionPropertyAssignments3_es6.js index 64edd61828c..89963edbc6e 100644 --- a/tests/baselines/reference/FunctionPropertyAssignments3_es6.js +++ b/tests/baselines/reference/FunctionPropertyAssignments3_es6.js @@ -2,7 +2,4 @@ var v = { *{ } } //// [FunctionPropertyAssignments3_es6.js] -var v = { - : function () { - } -}; +var v = { : function () { } }; diff --git a/tests/baselines/reference/FunctionPropertyAssignments4_es6.js b/tests/baselines/reference/FunctionPropertyAssignments4_es6.js index ee6e35defe8..71076523414 100644 --- a/tests/baselines/reference/FunctionPropertyAssignments4_es6.js +++ b/tests/baselines/reference/FunctionPropertyAssignments4_es6.js @@ -2,6 +2,4 @@ var v = { * } //// [FunctionPropertyAssignments4_es6.js] -var v = { - : function () { } -}; +var v = { : function () { } }; diff --git a/tests/baselines/reference/FunctionPropertyAssignments5_es6.js b/tests/baselines/reference/FunctionPropertyAssignments5_es6.js index f41bd0d3ffa..188a843f751 100644 --- a/tests/baselines/reference/FunctionPropertyAssignments5_es6.js +++ b/tests/baselines/reference/FunctionPropertyAssignments5_es6.js @@ -2,8 +2,5 @@ var v = { *[foo()]() { } } //// [FunctionPropertyAssignments5_es6.js] -var v = (_a = {}, - _a[foo()] = function () { - }, - _a); +var v = (_a = {}, _a[foo()] = function () { }, _a); var _a; diff --git a/tests/baselines/reference/FunctionPropertyAssignments6_es6.js b/tests/baselines/reference/FunctionPropertyAssignments6_es6.js index f7e9576c7a0..60f3677f108 100644 --- a/tests/baselines/reference/FunctionPropertyAssignments6_es6.js +++ b/tests/baselines/reference/FunctionPropertyAssignments6_es6.js @@ -2,7 +2,4 @@ var v = { *() { } } //// [FunctionPropertyAssignments6_es6.js] -var v = { - : function () { - } -}; +var v = { : function () { } }; diff --git a/tests/baselines/reference/MemberAccessorDeclaration15.js b/tests/baselines/reference/MemberAccessorDeclaration15.js index 41ed265a878..85bbfa62238 100644 --- a/tests/baselines/reference/MemberAccessorDeclaration15.js +++ b/tests/baselines/reference/MemberAccessorDeclaration15.js @@ -8,8 +8,7 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { - set: function (a) { - }, + set: function (a) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/MemberFunctionDeclaration1_es6.js b/tests/baselines/reference/MemberFunctionDeclaration1_es6.js index 86e7c9d418a..121376d5265 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration1_es6.js +++ b/tests/baselines/reference/MemberFunctionDeclaration1_es6.js @@ -7,7 +7,6 @@ class C { var C = (function () { function C() { } - C.prototype.foo = function () { - }; + C.prototype.foo = function () { }; return C; })(); diff --git a/tests/baselines/reference/MemberFunctionDeclaration2_es6.js b/tests/baselines/reference/MemberFunctionDeclaration2_es6.js index efd60844dc7..dcb494b3d13 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration2_es6.js +++ b/tests/baselines/reference/MemberFunctionDeclaration2_es6.js @@ -7,7 +7,6 @@ class C { var C = (function () { function C() { } - C.prototype.foo = function () { - }; + C.prototype.foo = function () { }; return C; })(); diff --git a/tests/baselines/reference/MemberFunctionDeclaration3_es6.js b/tests/baselines/reference/MemberFunctionDeclaration3_es6.js index 357f9175b42..e858ab15582 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration3_es6.js +++ b/tests/baselines/reference/MemberFunctionDeclaration3_es6.js @@ -7,7 +7,6 @@ class C { var C = (function () { function C() { } - C.prototype[foo] = function () { - }; + C.prototype[foo] = function () { }; return C; })(); diff --git a/tests/baselines/reference/MemberFunctionDeclaration4_es6.js b/tests/baselines/reference/MemberFunctionDeclaration4_es6.js index 9c6d76bfca5..26b08681441 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration4_es6.js +++ b/tests/baselines/reference/MemberFunctionDeclaration4_es6.js @@ -7,7 +7,6 @@ class C { var C = (function () { function C() { } - C.prototype. = function () { - }; + C.prototype. = function () { }; return C; })(); diff --git a/tests/baselines/reference/MemberFunctionDeclaration7_es6.js b/tests/baselines/reference/MemberFunctionDeclaration7_es6.js index 211713c6e14..8f942d87f9f 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration7_es6.js +++ b/tests/baselines/reference/MemberFunctionDeclaration7_es6.js @@ -7,7 +7,6 @@ class C { var C = (function () { function C() { } - C.prototype.foo = function () { - }; + C.prototype.foo = function () { }; return C; })(); diff --git a/tests/baselines/reference/ModuleAndFunctionWithSameNameAndCommonRoot.js b/tests/baselines/reference/ModuleAndFunctionWithSameNameAndCommonRoot.js index 6b110cbb0f2..e9b8f44f895 100644 --- a/tests/baselines/reference/ModuleAndFunctionWithSameNameAndCommonRoot.js +++ b/tests/baselines/reference/ModuleAndFunctionWithSameNameAndCommonRoot.js @@ -34,10 +34,7 @@ var A; (function (A) { var Point; (function (Point) { - Point.Origin = { - x: 0, - y: 0 - }; + Point.Origin = { x: 0, y: 0 }; })(Point = A.Point || (A.Point = {})); })(A || (A = {})); //// [function.js] @@ -45,10 +42,7 @@ var A; (function (A) { // duplicate identifier error function Point() { - return { - x: 0, - y: 0 - }; + return { x: 0, y: 0 }; } A.Point = Point; })(A || (A = {})); @@ -57,17 +51,11 @@ var B; (function (B) { var Point; (function (Point) { - Point.Origin = { - x: 0, - y: 0 - }; + Point.Origin = { x: 0, y: 0 }; })(Point = B.Point || (B.Point = {})); // duplicate identifier error function Point() { - return { - x: 0, - y: 0 - }; + return { x: 0, y: 0 }; } B.Point = Point; })(B || (B = {})); diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.js b/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.js index 0211c85af9d..e31ca5d5885 100644 --- a/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.js +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.js @@ -54,15 +54,9 @@ var B; var Geometry; (function (Geometry) { var Lines = B; - Geometry.Origin = { - x: 0, - y: 0 - }; + Geometry.Origin = { x: 0, y: 0 }; // this is valid since B.Line _is_ visible outside Geometry - Geometry.Unit = new Lines.Line(Geometry.Origin, { - x: 1, - y: 0 - }); + Geometry.Unit = new Lines.Line(Geometry.Origin, { x: 1, y: 0 }); })(Geometry || (Geometry = {})); // expected to work since all are exported var p; diff --git a/tests/baselines/reference/Protected4.js b/tests/baselines/reference/Protected4.js index 665a182ef33..9c23a1be884 100644 --- a/tests/baselines/reference/Protected4.js +++ b/tests/baselines/reference/Protected4.js @@ -7,7 +7,6 @@ class C { var C = (function () { function C() { } - C.prototype.m = function () { - }; + C.prototype.m = function () { }; return C; })(); diff --git a/tests/baselines/reference/Protected5.js b/tests/baselines/reference/Protected5.js index 8834cc488cb..8426a8765d7 100644 --- a/tests/baselines/reference/Protected5.js +++ b/tests/baselines/reference/Protected5.js @@ -7,7 +7,6 @@ class C { var C = (function () { function C() { } - C.m = function () { - }; + C.m = function () { }; return C; })(); diff --git a/tests/baselines/reference/Protected6.js b/tests/baselines/reference/Protected6.js index 004f30b27f8..10b59551737 100644 --- a/tests/baselines/reference/Protected6.js +++ b/tests/baselines/reference/Protected6.js @@ -7,7 +7,6 @@ class C { var C = (function () { function C() { } - C.m = function () { - }; + C.m = function () { }; return C; })(); diff --git a/tests/baselines/reference/Protected7.js b/tests/baselines/reference/Protected7.js index 466f6909d67..16c24edb8cb 100644 --- a/tests/baselines/reference/Protected7.js +++ b/tests/baselines/reference/Protected7.js @@ -7,7 +7,6 @@ class C { var C = (function () { function C() { } - C.prototype.m = function () { - }; + C.prototype.m = function () { }; return C; })(); diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.js b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.js index 52810fa0178..deb2f3aa59d 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.js +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.js @@ -56,10 +56,7 @@ var A; function Point() { } Point.prototype.fromCarthesian = function (p) { - return { - x: p.x, - y: p.y - }; + return { x: p.x, y: p.y }; }; return Point; })(); diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.js b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.js index 227b28f44db..125a803ff39 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.js +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.js @@ -47,17 +47,11 @@ var A; var Utils; (function (Utils) { function mirror(p) { - return { - x: p.y, - y: p.x - }; + return { x: p.y, y: p.x }; } Utils.mirror = mirror; })(Utils = A.Utils || (A.Utils = {})); - A.Origin = { - x: 0, - y: 0 - }; + A.Origin = { x: 0, y: 0 }; })(A || (A = {})); //// [part2.js] var A; @@ -84,7 +78,4 @@ var o = A.Origin; var o = A.Utils.mirror(o); var p; var p; -var p = new A.Utils.Plane(o, { - x: 1, - y: 1 -}); +var p = new A.Utils.Plane(o, { x: 1, y: 1 }); diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.js b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.js index 3f5f3bd8986..c7f55d0a2df 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.js +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.js @@ -35,26 +35,17 @@ var A; var Utils; (function (Utils) { function mirror(p) { - return { - x: p.y, - y: p.x - }; + return { x: p.y, y: p.x }; } Utils.mirror = mirror; })(Utils = A.Utils || (A.Utils = {})); - A.Origin = { - x: 0, - y: 0 - }; + A.Origin = { x: 0, y: 0 }; })(A = exports.A || (exports.A = {})); //// [part2.js] var A; (function (A) { // collision with 'Origin' var in other part of merged module - A.Origin = { - x: 0, - y: 0 - }; + A.Origin = { x: 0, y: 0 }; var Utils; (function (Utils) { var Plane = (function () { diff --git a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.js b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.js index 32b5ed538d8..a854dff15c6 100644 --- a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.js +++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.js @@ -38,10 +38,7 @@ var Root; var Utils; (function (Utils) { function mirror(p) { - return { - x: p.y, - y: p.x - }; + return { x: p.y, y: p.x }; } Utils.mirror = mirror; })(Utils = A.Utils || (A.Utils = {})); @@ -53,10 +50,7 @@ var otherRoot; var A; (function (A) { // have to be fully qualified since in different root - A.Origin = { - x: 0, - y: 0 - }; + A.Origin = { x: 0, y: 0 }; var Utils; (function (Utils) { var Plane = (function () { diff --git a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.js b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.js index ba77d51ef69..82c9afd0787 100644 --- a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.js +++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.js @@ -45,10 +45,7 @@ var A; var Utils; (function (Utils) { function mirror(p) { - return { - x: p.y, - y: p.x - }; + return { x: p.y, y: p.x }; } Utils.mirror = mirror; })(Utils = A.Utils || (A.Utils = {})); @@ -56,10 +53,7 @@ var A; //// [part2.js] var A; (function (A) { - A.Origin = { - x: 0, - y: 0 - }; + A.Origin = { x: 0, y: 0 }; var Utils; (function (Utils) { var Plane = (function () { @@ -80,7 +74,4 @@ var o = A.Origin; var o = A.Utils.mirror(o); var p; var p; -var p = new A.Utils.Plane(o, { - x: 1, - y: 1 -}); +var p = new A.Utils.Plane(o, { x: 1, y: 1 }); diff --git a/tests/baselines/reference/YieldExpression10_es6.js b/tests/baselines/reference/YieldExpression10_es6.js index 345f76fc190..3bae1b645fe 100644 --- a/tests/baselines/reference/YieldExpression10_es6.js +++ b/tests/baselines/reference/YieldExpression10_es6.js @@ -6,8 +6,7 @@ var v = { * foo() { //// [YieldExpression10_es6.js] -var v = { - foo: function () { +var v = { foo: function () { ; } }; diff --git a/tests/baselines/reference/YieldExpression13_es6.js b/tests/baselines/reference/YieldExpression13_es6.js index 328fc80dbdd..093759e6bd9 100644 --- a/tests/baselines/reference/YieldExpression13_es6.js +++ b/tests/baselines/reference/YieldExpression13_es6.js @@ -2,6 +2,4 @@ function* foo() { yield } //// [YieldExpression13_es6.js] -function foo() { - ; -} +function foo() { ; } diff --git a/tests/baselines/reference/YieldExpression17_es6.js b/tests/baselines/reference/YieldExpression17_es6.js index 5ac8093395a..cefe4ca28df 100644 --- a/tests/baselines/reference/YieldExpression17_es6.js +++ b/tests/baselines/reference/YieldExpression17_es6.js @@ -2,8 +2,4 @@ var v = { get foo() { yield foo; } } //// [YieldExpression17_es6.js] -var v = { - get foo() { - ; - } -}; +var v = { get foo() { ; } }; diff --git a/tests/baselines/reference/accessibilityModifiers.js b/tests/baselines/reference/accessibilityModifiers.js index 901b3a29c2e..ebc801ac136 100644 --- a/tests/baselines/reference/accessibilityModifiers.js +++ b/tests/baselines/reference/accessibilityModifiers.js @@ -50,48 +50,36 @@ class E { var C = (function () { function C() { } - C.privateMethod = function () { - }; + C.privateMethod = function () { }; Object.defineProperty(C, "privateGetter", { - get: function () { - return 0; - }, + get: function () { return 0; }, enumerable: true, configurable: true }); Object.defineProperty(C, "privateSetter", { - set: function (a) { - }, + set: function (a) { }, enumerable: true, configurable: true }); - C.protectedMethod = function () { - }; + C.protectedMethod = function () { }; Object.defineProperty(C, "protectedGetter", { - get: function () { - return 0; - }, + get: function () { return 0; }, enumerable: true, configurable: true }); Object.defineProperty(C, "protectedSetter", { - set: function (a) { - }, + set: function (a) { }, enumerable: true, configurable: true }); - C.publicMethod = function () { - }; + C.publicMethod = function () { }; Object.defineProperty(C, "publicGetter", { - get: function () { - return 0; - }, + get: function () { return 0; }, enumerable: true, configurable: true }); Object.defineProperty(C, "publicSetter", { - set: function (a) { - }, + set: function (a) { }, enumerable: true, configurable: true }); @@ -101,48 +89,36 @@ var C = (function () { var D = (function () { function D() { } - D.privateMethod = function () { - }; + D.privateMethod = function () { }; Object.defineProperty(D, "privateGetter", { - get: function () { - return 0; - }, + get: function () { return 0; }, enumerable: true, configurable: true }); Object.defineProperty(D, "privateSetter", { - set: function (a) { - }, + set: function (a) { }, enumerable: true, configurable: true }); - D.protectedMethod = function () { - }; + D.protectedMethod = function () { }; Object.defineProperty(D, "protectedGetter", { - get: function () { - return 0; - }, + get: function () { return 0; }, enumerable: true, configurable: true }); Object.defineProperty(D, "protectedSetter", { - set: function (a) { - }, + set: function (a) { }, enumerable: true, configurable: true }); - D.publicMethod = function () { - }; + D.publicMethod = function () { }; Object.defineProperty(D, "publicGetter", { - get: function () { - return 0; - }, + get: function () { return 0; }, enumerable: true, configurable: true }); Object.defineProperty(D, "publicSetter", { - set: function (a) { - }, + set: function (a) { }, enumerable: true, configurable: true }); @@ -152,18 +128,14 @@ var D = (function () { var E = (function () { function E() { } - E.prototype.method = function () { - }; + E.prototype.method = function () { }; Object.defineProperty(E.prototype, "getter", { - get: function () { - return 0; - }, + get: function () { return 0; }, enumerable: true, configurable: true }); Object.defineProperty(E.prototype, "setter", { - set: function (a) { - }, + set: function (a) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/accessorParameterAccessibilityModifier.js b/tests/baselines/reference/accessorParameterAccessibilityModifier.js index 89a511e6c5c..8b5ee6196e0 100644 --- a/tests/baselines/reference/accessorParameterAccessibilityModifier.js +++ b/tests/baselines/reference/accessorParameterAccessibilityModifier.js @@ -10,14 +10,12 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "X", { - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); Object.defineProperty(C, "X", { - set: function (v2) { - }, + set: function (v2) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/accessorWithES3.js b/tests/baselines/reference/accessorWithES3.js index 6eba5238a91..1eecaa68d64 100644 --- a/tests/baselines/reference/accessorWithES3.js +++ b/tests/baselines/reference/accessorWithES3.js @@ -47,11 +47,8 @@ var D = (function () { return D; })(); var x = { - get a() { - return 1; - } + get a() { return 1; } }; var y = { - set b(v) { - } + set b(v) { } }; diff --git a/tests/baselines/reference/accessorWithES5.js b/tests/baselines/reference/accessorWithES5.js index 1a3690556e0..746703bce52 100644 --- a/tests/baselines/reference/accessorWithES5.js +++ b/tests/baselines/reference/accessorWithES5.js @@ -44,11 +44,8 @@ var D = (function () { return D; })(); var x = { - get a() { - return 1; - } + get a() { return 1; } }; var y = { - set b(v) { - } + set b(v) { } }; diff --git a/tests/baselines/reference/accessorWithoutBody1.js b/tests/baselines/reference/accessorWithoutBody1.js index 8f357b89490..e06e305e161 100644 --- a/tests/baselines/reference/accessorWithoutBody1.js +++ b/tests/baselines/reference/accessorWithoutBody1.js @@ -2,6 +2,4 @@ var v = { get foo() } //// [accessorWithoutBody1.js] -var v = { - get foo() { } -}; +var v = { get foo() { } }; diff --git a/tests/baselines/reference/accessorWithoutBody2.js b/tests/baselines/reference/accessorWithoutBody2.js index d9405daeb93..3b5a821d580 100644 --- a/tests/baselines/reference/accessorWithoutBody2.js +++ b/tests/baselines/reference/accessorWithoutBody2.js @@ -2,6 +2,4 @@ var v = { set foo(a) } //// [accessorWithoutBody2.js] -var v = { - set foo(a) { } -}; +var v = { set foo(a) { } }; diff --git a/tests/baselines/reference/accessorsAreNotContextuallyTyped.js b/tests/baselines/reference/accessorsAreNotContextuallyTyped.js index d8cb761bb9b..8c01173a13c 100644 --- a/tests/baselines/reference/accessorsAreNotContextuallyTyped.js +++ b/tests/baselines/reference/accessorsAreNotContextuallyTyped.js @@ -20,9 +20,7 @@ var C = (function () { } Object.defineProperty(C.prototype, "x", { get: function () { - return function (x) { - return ""; - }; + return function (x) { return ""; }; }, set: function (v) { }, diff --git a/tests/baselines/reference/accessorsNotAllowedInES3.js b/tests/baselines/reference/accessorsNotAllowedInES3.js index 7dab1283e84..0843a39191c 100644 --- a/tests/baselines/reference/accessorsNotAllowedInES3.js +++ b/tests/baselines/reference/accessorsNotAllowedInES3.js @@ -11,16 +11,10 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "x", { - get: function () { - return 1; - }, + get: function () { return 1; }, enumerable: true, configurable: true }); return C; })(); -var y = { - get foo() { - return 3; - } -}; +var y = { get foo() { return 3; } }; diff --git a/tests/baselines/reference/accessors_spec_section-4.5_error-cases.js b/tests/baselines/reference/accessors_spec_section-4.5_error-cases.js index 6a3b3773aa6..5e527aef3e9 100644 --- a/tests/baselines/reference/accessors_spec_section-4.5_error-cases.js +++ b/tests/baselines/reference/accessors_spec_section-4.5_error-cases.js @@ -18,40 +18,26 @@ var LanguageSpec_section_4_5_error_cases = (function () { function LanguageSpec_section_4_5_error_cases() { } Object.defineProperty(LanguageSpec_section_4_5_error_cases.prototype, "AnnotatedSetter_SetterFirst", { - get: function () { - return ""; - }, - set: function (a) { - }, + get: function () { return ""; }, + set: function (a) { }, enumerable: true, configurable: true }); Object.defineProperty(LanguageSpec_section_4_5_error_cases.prototype, "AnnotatedSetter_SetterLast", { - get: function () { - return ""; - }, - set: function (a) { - }, + get: function () { return ""; }, + set: function (a) { }, enumerable: true, configurable: true }); Object.defineProperty(LanguageSpec_section_4_5_error_cases.prototype, "AnnotatedGetter_GetterFirst", { - get: function () { - return ""; - }, - set: function (aStr) { - aStr = 0; - }, + get: function () { return ""; }, + set: function (aStr) { aStr = 0; }, enumerable: true, configurable: true }); Object.defineProperty(LanguageSpec_section_4_5_error_cases.prototype, "AnnotatedGetter_GetterLast", { - get: function () { - return ""; - }, - set: function (aStr) { - aStr = 0; - }, + get: function () { return ""; }, + set: function (aStr) { aStr = 0; }, enumerable: true, configurable: true }); 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 b140e565b29..9aa7ce2f408 100644 --- a/tests/baselines/reference/accessors_spec_section-4.5_inference.js +++ b/tests/baselines/reference/accessors_spec_section-4.5_inference.js @@ -47,56 +47,38 @@ var LanguageSpec_section_4_5_inference = (function () { function LanguageSpec_section_4_5_inference() { } Object.defineProperty(LanguageSpec_section_4_5_inference.prototype, "InferredGetterFromSetterAnnotation", { - get: function () { - return new B(); - }, - set: function (a) { - }, + get: function () { return new B(); }, + set: function (a) { }, enumerable: true, configurable: true }); Object.defineProperty(LanguageSpec_section_4_5_inference.prototype, "InferredGetterFromSetterAnnotation_GetterFirst", { - get: function () { - return new B(); - }, - set: function (a) { - }, + get: function () { return new B(); }, + set: function (a) { }, enumerable: true, configurable: true }); Object.defineProperty(LanguageSpec_section_4_5_inference.prototype, "InferredFromGetter", { - get: function () { - return new B(); - }, - set: function (a) { - }, + get: function () { return new B(); }, + set: function (a) { }, enumerable: true, configurable: true }); Object.defineProperty(LanguageSpec_section_4_5_inference.prototype, "InferredFromGetter_SetterFirst", { - get: function () { - return new B(); - }, - set: function (a) { - }, + get: function () { return new B(); }, + set: function (a) { }, enumerable: true, configurable: true }); Object.defineProperty(LanguageSpec_section_4_5_inference.prototype, "InferredSetterFromGetterAnnotation", { - get: function () { - return new B(); - }, - set: function (a) { - }, + get: function () { return new B(); }, + set: function (a) { }, enumerable: true, configurable: true }); Object.defineProperty(LanguageSpec_section_4_5_inference.prototype, "InferredSetterFromGetterAnnotation_GetterFirst", { - get: function () { - return new B(); - }, - set: function (a) { - }, + get: function () { return new B(); }, + set: function (a) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/additionOperatorWithAnyAndEveryType.js b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.js index d68af6c23c3..04fb5a143c6 100644 --- a/tests/baselines/reference/additionOperatorWithAnyAndEveryType.js +++ b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.js @@ -40,13 +40,11 @@ var r19 = a + { a: '' }; var r20 = a + ((a: string) => { return a }); //// [additionOperatorWithAnyAndEveryType.js] -function foo() { -} +function foo() { } var C = (function () { function C() { } - C.foo = function () { - }; + C.foo = function () { }; return C; })(); var E; @@ -85,9 +83,5 @@ var r15 = a + E.a; var r16 = a + M; var r17 = a + ''; var r18 = a + 123; -var r19 = a + { - a: '' -}; -var r20 = a + (function (a) { - return a; -}); +var r19 = a + { a: '' }; +var r20 = a + (function (a) { return a; }); diff --git a/tests/baselines/reference/additionOperatorWithInvalidOperands.js b/tests/baselines/reference/additionOperatorWithInvalidOperands.js index f2403bc1670..a8edb4b1879 100644 --- a/tests/baselines/reference/additionOperatorWithInvalidOperands.js +++ b/tests/baselines/reference/additionOperatorWithInvalidOperands.js @@ -41,13 +41,11 @@ var r19 = E.a + C.foo(); var r20 = E.a + M; //// [additionOperatorWithInvalidOperands.js] -function foo() { -} +function foo() { } var C = (function () { function C() { } - C.foo = function () { - }; + C.foo = function () { }; return C; })(); var E; diff --git a/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.js b/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.js index 5ec03e15b6c..79d3c0b9b8d 100644 --- a/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.js +++ b/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.js @@ -25,9 +25,7 @@ var r11 = null + (() => { }); //// [additionOperatorWithNullValueAndInvalidOperator.js] // If one operand is the null or undefined value, it is treated as having the type of the other operand. -function foo() { - return undefined; -} +function foo() { return undefined; } var a; var b; var c; @@ -42,9 +40,6 @@ var r6 = null + c; // other cases var r7 = null + d; var r8 = null + true; -var r9 = null + { - a: '' -}; +var r9 = null + { a: '' }; var r10 = null + foo(); -var r11 = null + (function () { -}); +var r11 = null + (function () { }); diff --git a/tests/baselines/reference/additionOperatorWithStringAndEveryType.js b/tests/baselines/reference/additionOperatorWithStringAndEveryType.js index 56949533e09..03456020c80 100644 --- a/tests/baselines/reference/additionOperatorWithStringAndEveryType.js +++ b/tests/baselines/reference/additionOperatorWithStringAndEveryType.js @@ -75,7 +75,5 @@ var r15 = x + E; var r16 = x + E.a; var r17 = x + ''; var r18 = x + 0; -var r19 = x + { - a: '' -}; +var r19 = x + { a: '' }; var r20 = x + []; diff --git a/tests/baselines/reference/additionOperatorWithTypeParameter.js b/tests/baselines/reference/additionOperatorWithTypeParameter.js index 23a6b95b147..a568f420a32 100644 --- a/tests/baselines/reference/additionOperatorWithTypeParameter.js +++ b/tests/baselines/reference/additionOperatorWithTypeParameter.js @@ -74,7 +74,6 @@ function foo(t, u) { var r16 = t + undefined; var r17 = t + t; var r18 = t + u; - var r19 = t + (function () { - }); + var r19 = t + (function () { }); var r20 = t + []; } diff --git a/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.js b/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.js index 6bf55f351a5..98935db2b86 100644 --- a/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.js +++ b/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.js @@ -25,9 +25,7 @@ var r11 = undefined + (() => { }); //// [additionOperatorWithUndefinedValueAndInvalidOperands.js] // If one operand is the null or undefined value, it is treated as having the type of the other operand. -function foo() { - return undefined; -} +function foo() { return undefined; } var a; var b; var c; @@ -42,9 +40,6 @@ var r6 = undefined + c; // other cases var r7 = undefined + d; var r8 = undefined + true; -var r9 = undefined + { - a: '' -}; +var r9 = undefined + { a: '' }; var r10 = undefined + foo(); -var r11 = undefined + (function () { -}); +var r11 = undefined + (function () { }); diff --git a/tests/baselines/reference/aliasUsageInAccessorsOfClass.types b/tests/baselines/reference/aliasUsageInAccessorsOfClass.types index c300ae861ac..a666d2cee98 100644 --- a/tests/baselines/reference/aliasUsageInAccessorsOfClass.types +++ b/tests/baselines/reference/aliasUsageInAccessorsOfClass.types @@ -52,7 +52,7 @@ import Backbone = require("aliasUsage1_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel ->Backbone : unknown +>Backbone : typeof Backbone >Model : Backbone.Model // interesting stuff here diff --git a/tests/baselines/reference/aliasUsageInArray.js b/tests/baselines/reference/aliasUsageInArray.js index 1c7f8381be0..5712abf3443 100644 --- a/tests/baselines/reference/aliasUsageInArray.js +++ b/tests/baselines/reference/aliasUsageInArray.js @@ -46,9 +46,5 @@ var VisualizationModel = (function (_super) { exports.VisualizationModel = VisualizationModel; //// [aliasUsageInArray_main.js] var moduleA = require("aliasUsageInArray_moduleA"); -var xs = [ - moduleA -]; -var xs2 = [ - moduleA -]; +var xs = [moduleA]; +var xs2 = [moduleA]; diff --git a/tests/baselines/reference/aliasUsageInArray.types b/tests/baselines/reference/aliasUsageInArray.types index 2e792d39603..f7e2beb49dd 100644 --- a/tests/baselines/reference/aliasUsageInArray.types +++ b/tests/baselines/reference/aliasUsageInArray.types @@ -40,7 +40,7 @@ import Backbone = require("aliasUsageInArray_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel ->Backbone : unknown +>Backbone : typeof Backbone >Model : Backbone.Model // interesting stuff here diff --git a/tests/baselines/reference/aliasUsageInFunctionExpression.js b/tests/baselines/reference/aliasUsageInFunctionExpression.js index e101cd49aba..661c8fd91e7 100644 --- a/tests/baselines/reference/aliasUsageInFunctionExpression.js +++ b/tests/baselines/reference/aliasUsageInFunctionExpression.js @@ -45,9 +45,5 @@ var VisualizationModel = (function (_super) { exports.VisualizationModel = VisualizationModel; //// [aliasUsageInFunctionExpression_main.js] var moduleA = require("aliasUsageInFunctionExpression_moduleA"); -var f = function (x) { - return x; -}; -f = function (x) { - return moduleA; -}; +var f = function (x) { return x; }; +f = function (x) { return moduleA; }; diff --git a/tests/baselines/reference/aliasUsageInFunctionExpression.types b/tests/baselines/reference/aliasUsageInFunctionExpression.types index ba66a0f1c7c..392481d2d02 100644 --- a/tests/baselines/reference/aliasUsageInFunctionExpression.types +++ b/tests/baselines/reference/aliasUsageInFunctionExpression.types @@ -41,7 +41,7 @@ import Backbone = require("aliasUsageInFunctionExpression_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel ->Backbone : unknown +>Backbone : typeof Backbone >Model : Backbone.Model // interesting stuff here diff --git a/tests/baselines/reference/aliasUsageInGenericFunction.js b/tests/baselines/reference/aliasUsageInGenericFunction.js index fc0cd51be50..1070036adea 100644 --- a/tests/baselines/reference/aliasUsageInGenericFunction.js +++ b/tests/baselines/reference/aliasUsageInGenericFunction.js @@ -52,9 +52,5 @@ var moduleA = require("aliasUsageInGenericFunction_moduleA"); function foo(x) { return x; } -var r = foo({ - a: moduleA -}); -var r2 = foo({ - a: null -}); +var r = foo({ a: moduleA }); +var r2 = foo({ a: null }); diff --git a/tests/baselines/reference/aliasUsageInGenericFunction.types b/tests/baselines/reference/aliasUsageInGenericFunction.types index cf63eba6a61..568e885f51f 100644 --- a/tests/baselines/reference/aliasUsageInGenericFunction.types +++ b/tests/baselines/reference/aliasUsageInGenericFunction.types @@ -55,7 +55,7 @@ import Backbone = require("aliasUsageInGenericFunction_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel ->Backbone : unknown +>Backbone : typeof Backbone >Model : Backbone.Model // interesting stuff here diff --git a/tests/baselines/reference/aliasUsageInIndexerOfClass.types b/tests/baselines/reference/aliasUsageInIndexerOfClass.types index cc4b2377099..e968abe597f 100644 --- a/tests/baselines/reference/aliasUsageInIndexerOfClass.types +++ b/tests/baselines/reference/aliasUsageInIndexerOfClass.types @@ -49,7 +49,7 @@ import Backbone = require("aliasUsageInIndexerOfClass_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel ->Backbone : unknown +>Backbone : typeof Backbone >Model : Backbone.Model // interesting stuff here diff --git a/tests/baselines/reference/aliasUsageInObjectLiteral.js b/tests/baselines/reference/aliasUsageInObjectLiteral.js index 7e6cc1340e8..50ccfaf944d 100644 --- a/tests/baselines/reference/aliasUsageInObjectLiteral.js +++ b/tests/baselines/reference/aliasUsageInObjectLiteral.js @@ -46,14 +46,6 @@ var VisualizationModel = (function (_super) { exports.VisualizationModel = VisualizationModel; //// [aliasUsageInObjectLiteral_main.js] var moduleA = require("aliasUsageInObjectLiteral_moduleA"); -var a = { - x: moduleA -}; -var b = { - x: moduleA -}; -var c = { - y: { - z: moduleA - } -}; +var a = { x: moduleA }; +var b = { x: moduleA }; +var c = { y: { z: moduleA } }; diff --git a/tests/baselines/reference/aliasUsageInObjectLiteral.types b/tests/baselines/reference/aliasUsageInObjectLiteral.types index b34a4300c52..2e631a41cdf 100644 --- a/tests/baselines/reference/aliasUsageInObjectLiteral.types +++ b/tests/baselines/reference/aliasUsageInObjectLiteral.types @@ -54,7 +54,7 @@ import Backbone = require("aliasUsageInObjectLiteral_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel ->Backbone : unknown +>Backbone : typeof Backbone >Model : Backbone.Model // interesting stuff here diff --git a/tests/baselines/reference/aliasUsageInOrExpression.js b/tests/baselines/reference/aliasUsageInOrExpression.js index 8a29a7f998b..07a382ebca1 100644 --- a/tests/baselines/reference/aliasUsageInOrExpression.js +++ b/tests/baselines/reference/aliasUsageInOrExpression.js @@ -53,9 +53,5 @@ var i; var d1 = i || moduleA; var d2 = i || moduleA; var d2 = moduleA || i; -var e = null || { - x: moduleA -}; -var f = null ? { - x: moduleA -} : null; +var e = null || { x: moduleA }; +var f = null ? { x: moduleA } : null; diff --git a/tests/baselines/reference/aliasUsageInOrExpression.types b/tests/baselines/reference/aliasUsageInOrExpression.types index c937187f049..1a4dae90356 100644 --- a/tests/baselines/reference/aliasUsageInOrExpression.types +++ b/tests/baselines/reference/aliasUsageInOrExpression.types @@ -75,7 +75,7 @@ import Backbone = require("aliasUsageInOrExpression_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel ->Backbone : unknown +>Backbone : typeof Backbone >Model : Backbone.Model // interesting stuff here diff --git a/tests/baselines/reference/aliasUsageInOrExpression.types.pull b/tests/baselines/reference/aliasUsageInOrExpression.types.pull index cc45af29f86..3b138d1404a 100644 --- a/tests/baselines/reference/aliasUsageInOrExpression.types.pull +++ b/tests/baselines/reference/aliasUsageInOrExpression.types.pull @@ -75,7 +75,7 @@ import Backbone = require("aliasUsageInOrExpression_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel ->Backbone : unknown +>Backbone : typeof Backbone >Model : Backbone.Model // interesting stuff here diff --git a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.types b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.types index e2e8b57b94f..72f0aaf9e20 100644 --- a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.types +++ b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.types @@ -45,7 +45,7 @@ import Backbone = require("aliasUsageInTypeArgumentOfExtendsClause_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel ->Backbone : unknown +>Backbone : typeof Backbone >Model : Backbone.Model // interesting stuff here diff --git a/tests/baselines/reference/aliasUsageInVarAssignment.types b/tests/baselines/reference/aliasUsageInVarAssignment.types index 7ca745b3d23..6b1c097ad97 100644 --- a/tests/baselines/reference/aliasUsageInVarAssignment.types +++ b/tests/baselines/reference/aliasUsageInVarAssignment.types @@ -36,7 +36,7 @@ import Backbone = require("aliasUsageInVarAssignment_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel ->Backbone : unknown +>Backbone : typeof Backbone >Model : Backbone.Model // interesting stuff here diff --git a/tests/baselines/reference/aliasUsedAsNameValue.js b/tests/baselines/reference/aliasUsedAsNameValue.js index 4b6debf4c98..fb909181529 100644 --- a/tests/baselines/reference/aliasUsedAsNameValue.js +++ b/tests/baselines/reference/aliasUsedAsNameValue.js @@ -21,9 +21,7 @@ export var a = function () { //// [aliasUsedAsNameValue_0.js] exports.id; //// [aliasUsedAsNameValue_1.js] -function b(a) { - return null; -} +function b(a) { return null; } exports.b = b; //// [aliasUsedAsNameValue_2.js] /// diff --git a/tests/baselines/reference/ambientClassOverloadForFunction.js b/tests/baselines/reference/ambientClassOverloadForFunction.js index cf3a59a465d..402eca63381 100644 --- a/tests/baselines/reference/ambientClassOverloadForFunction.js +++ b/tests/baselines/reference/ambientClassOverloadForFunction.js @@ -5,6 +5,4 @@ function foo() { return null; } //// [ambientClassOverloadForFunction.js] ; -function foo() { - return null; -} +function foo() { return null; } diff --git a/tests/baselines/reference/ambiguousGenericAssertion1.js b/tests/baselines/reference/ambiguousGenericAssertion1.js index 06804387585..8d40873036c 100644 --- a/tests/baselines/reference/ambiguousGenericAssertion1.js +++ b/tests/baselines/reference/ambiguousGenericAssertion1.js @@ -6,12 +6,8 @@ var r3 = <(x: T) => T>f; // ambiguous, appears to the parser as a << operatio //// [ambiguousGenericAssertion1.js] -function f(x) { - return null; -} -var r = function (x) { - return x; -}; +function f(x) { return null; } +var r = function (x) { return x; }; var r2 = f; // valid var r3 = << T > (x), T; T > f; // ambiguous, appears to the parser as a << operation diff --git a/tests/baselines/reference/ambiguousOverload.js b/tests/baselines/reference/ambiguousOverload.js index fd373c075a2..642f09dca16 100644 --- a/tests/baselines/reference/ambiguousOverload.js +++ b/tests/baselines/reference/ambiguousOverload.js @@ -12,15 +12,11 @@ var x2: string = foof2("s", null); var y2: number = foof2("s", null); //// [ambiguousOverload.js] -function foof(bar) { - return bar; -} +function foof(bar) { return bar; } ; var x = foof("s", null); var y = foof("s", null); -function foof2(bar) { - return bar; -} +function foof2(bar) { return bar; } ; var x2 = foof2("s", null); var y2 = foof2("s", null); diff --git a/tests/baselines/reference/anonterface.js b/tests/baselines/reference/anonterface.js index 59d055b29d7..12bfbc4ec9d 100644 --- a/tests/baselines/reference/anonterface.js +++ b/tests/baselines/reference/anonterface.js @@ -28,6 +28,4 @@ var M; M.C = C; })(M || (M = {})); var c = new M.C(); -c.m(function (n) { - return "hello: " + n; -}, 18); +c.m(function (n) { return "hello: " + n; }, 18); diff --git a/tests/baselines/reference/anonymousClassExpression1.errors.txt b/tests/baselines/reference/anonymousClassExpression1.errors.txt new file mode 100644 index 00000000000..db4c5b4ce3d --- /dev/null +++ b/tests/baselines/reference/anonymousClassExpression1.errors.txt @@ -0,0 +1,9 @@ +tests/cases/compiler/anonymousClassExpression1.ts(2,19): error TS9003: 'class' expressions are not currently supported. + + +==== tests/cases/compiler/anonymousClassExpression1.ts (1 errors) ==== + function f() { + return typeof class {} === "function"; + ~~~~~ +!!! error TS9003: 'class' expressions are not currently supported. + } \ No newline at end of file diff --git a/tests/baselines/reference/anonymousClassExpression1.js b/tests/baselines/reference/anonymousClassExpression1.js new file mode 100644 index 00000000000..78cf5b05c51 --- /dev/null +++ b/tests/baselines/reference/anonymousClassExpression1.js @@ -0,0 +1,13 @@ +//// [anonymousClassExpression1.ts] +function f() { + return typeof class {} === "function"; +} + +//// [anonymousClassExpression1.js] +function f() { + return typeof (function () { + function default_1() { + } + return default_1; + })() === "function"; +} diff --git a/tests/baselines/reference/anyAssignabilityInInheritance.js b/tests/baselines/reference/anyAssignabilityInInheritance.js index bc9ebb02f42..04e3e91761d 100644 --- a/tests/baselines/reference/anyAssignabilityInInheritance.js +++ b/tests/baselines/reference/anyAssignabilityInInheritance.js @@ -118,8 +118,7 @@ var E; E[E["A"] = 0] = "A"; })(E || (E = {})); var r3 = foo3(a); // any -function f() { -} +function f() { } var f; (function (f) { f.bar = 1; diff --git a/tests/baselines/reference/anyAssignableToEveryType2.js b/tests/baselines/reference/anyAssignableToEveryType2.js index 41cedb73215..530d8eb0439 100644 --- a/tests/baselines/reference/anyAssignableToEveryType2.js +++ b/tests/baselines/reference/anyAssignableToEveryType2.js @@ -146,8 +146,7 @@ var E; (function (E) { E[E["A"] = 0] = "A"; })(E || (E = {})); -function f() { -} +function f() { } var f; (function (f) { f.bar = 1; diff --git a/tests/baselines/reference/anyDeclare.js b/tests/baselines/reference/anyDeclare.js index a46a2529491..8bb2f55eb84 100644 --- a/tests/baselines/reference/anyDeclare.js +++ b/tests/baselines/reference/anyDeclare.js @@ -10,6 +10,5 @@ module myMod { var myMod; (function (myMod) { var myFn; - function myFn() { - } + function myFn() { } })(myMod || (myMod = {})); diff --git a/tests/baselines/reference/anyIdenticalToItself.js b/tests/baselines/reference/anyIdenticalToItself.js index dc221b69aa7..b7b9b25e418 100644 --- a/tests/baselines/reference/anyIdenticalToItself.js +++ b/tests/baselines/reference/anyIdenticalToItself.js @@ -13,8 +13,7 @@ class C { } //// [anyIdenticalToItself.js] -function foo(x, y) { -} +function foo(x, y) { } var C = (function () { function C() { } diff --git a/tests/baselines/reference/anyInferenceAnonymousFunctions.js b/tests/baselines/reference/anyInferenceAnonymousFunctions.js index 03e45113b26..df921965994 100644 --- a/tests/baselines/reference/anyInferenceAnonymousFunctions.js +++ b/tests/baselines/reference/anyInferenceAnonymousFunctions.js @@ -25,12 +25,6 @@ paired.reduce(function (a1, a2) { paired.reduce(function (b1, b2) { return b1.concat({}); }, []); -paired.reduce(function (b3, b4) { - return b3.concat({}); -}, []); -paired.map(function (c1) { - return c1.count; -}); -paired.map(function (c2) { - return c2.count; -}); +paired.reduce(function (b3, b4) { return b3.concat({}); }, []); +paired.map(function (c1) { return c1.count; }); +paired.map(function (c2) { return c2.count; }); diff --git a/tests/baselines/reference/arrayAssignmentTest1.js b/tests/baselines/reference/arrayAssignmentTest1.js index aed3d0cdf06..0abfa889bed 100644 --- a/tests/baselines/reference/arrayAssignmentTest1.js +++ b/tests/baselines/reference/arrayAssignmentTest1.js @@ -95,12 +95,8 @@ var __extends = this.__extends || function (d, b) { var C1 = (function () { function C1() { } - C1.prototype.IM1 = function () { - return null; - }; - C1.prototype.C1M1 = function () { - return null; - }; + C1.prototype.IM1 = function () { return null; }; + C1.prototype.C1M1 = function () { return null; }; return C1; })(); var C2 = (function (_super) { @@ -108,17 +104,13 @@ var C2 = (function (_super) { function C2() { _super.apply(this, arguments); } - C2.prototype.C2M1 = function () { - return null; - }; + C2.prototype.C2M1 = function () { return null; }; return C2; })(C1); var C3 = (function () { function C3() { } - C3.prototype.CM3M1 = function () { - return 3; - }; + C3.prototype.CM3M1 = function () { return 3; }; return C3; })(); /* @@ -137,12 +129,8 @@ var c1 = new C1(); var i1 = c1; var c2 = new C2(); var c3 = new C3(); -var o1 = { - one: 1 -}; -var f1 = function () { - return new C1(); -}; +var o1 = { one: 1 }; +var f1 = function () { return new C1(); }; var arr_any = []; var arr_i1 = []; var arr_c1 = []; diff --git a/tests/baselines/reference/arrayAssignmentTest2.js b/tests/baselines/reference/arrayAssignmentTest2.js index 0e6a9837573..977862866ed 100644 --- a/tests/baselines/reference/arrayAssignmentTest2.js +++ b/tests/baselines/reference/arrayAssignmentTest2.js @@ -69,12 +69,8 @@ var __extends = this.__extends || function (d, b) { var C1 = (function () { function C1() { } - C1.prototype.IM1 = function () { - return null; - }; - C1.prototype.C1M1 = function () { - return null; - }; + C1.prototype.IM1 = function () { return null; }; + C1.prototype.C1M1 = function () { return null; }; return C1; })(); var C2 = (function (_super) { @@ -82,17 +78,13 @@ var C2 = (function (_super) { function C2() { _super.apply(this, arguments); } - C2.prototype.C2M1 = function () { - return null; - }; + C2.prototype.C2M1 = function () { return null; }; return C2; })(C1); var C3 = (function () { function C3() { } - C3.prototype.CM3M1 = function () { - return 3; - }; + C3.prototype.CM3M1 = function () { return 3; }; return C3; })(); /* @@ -111,12 +103,8 @@ var c1 = new C1(); var i1 = c1; var c2 = new C2(); var c3 = new C3(); -var o1 = { - one: 1 -}; -var f1 = function () { - return new C1(); -}; +var o1 = { one: 1 }; +var f1 = function () { return new C1(); }; var arr_any = []; var arr_i1 = []; var arr_c1 = []; @@ -130,9 +118,7 @@ arr_c3 = arr_c2_2; // should be an error - is arr_c3 = arr_c1_2; // should be an error - is arr_c3 = arr_i1_2; // should be an error - is arr_any = f1; // should be an error - is -arr_any = function () { - return null; -}; // should be an error - is +arr_any = function () { return null; }; // should be an error - is arr_any = o1; // should be an error - is arr_any = a1; // should be ok - is arr_any = c1; // should be an error - is diff --git a/tests/baselines/reference/arrayAssignmentTest4.js b/tests/baselines/reference/arrayAssignmentTest4.js index 43c7f2f4144..c38cdebc06c 100644 --- a/tests/baselines/reference/arrayAssignmentTest4.js +++ b/tests/baselines/reference/arrayAssignmentTest4.js @@ -30,9 +30,7 @@ arr_any = c3; // should be an error - is var C3 = (function () { function C3() { } - C3.prototype.CM3M1 = function () { - return 3; - }; + C3.prototype.CM3M1 = function () { return 3; }; return C3; })(); /* @@ -47,11 +45,7 @@ Type 1 of any[]: */ var c3 = new C3(); -var o1 = { - one: 1 -}; +var o1 = { one: 1 }; var arr_any = []; -arr_any = function () { - return null; -}; // should be an error - is +arr_any = function () { return null; }; // should be an error - is arr_any = c3; // should be an error - is diff --git a/tests/baselines/reference/arrayAugment.js b/tests/baselines/reference/arrayAugment.js index fcd2ee6987b..20cf510712a 100644 --- a/tests/baselines/reference/arrayAugment.js +++ b/tests/baselines/reference/arrayAugment.js @@ -9,8 +9,6 @@ var y: string[][]; // Expect no error here //// [arrayAugment.js] -var x = [ - '' -]; +var x = ['']; var y = x.split(4); var y; // Expect no error here diff --git a/tests/baselines/reference/arrayBestCommonTypes.js b/tests/baselines/reference/arrayBestCommonTypes.js index 29da9f0737d..f8e158e5b02 100644 --- a/tests/baselines/reference/arrayBestCommonTypes.js +++ b/tests/baselines/reference/arrayBestCommonTypes.js @@ -141,170 +141,34 @@ var EmptyTypes; return null; }; f.prototype.x = function () { - (this.voidIfAny([ - 4, - 2 - ][0])); - (this.voidIfAny([ - 4, - 2, - undefined - ][0])); - (this.voidIfAny([ - undefined, - 2, - 4 - ][0])); - (this.voidIfAny([ - null, - 2, - 4 - ][0])); - (this.voidIfAny([ - 2, - 4, - null - ][0])); - (this.voidIfAny([ - undefined, - 4, - null - ][0])); - (this.voidIfAny([ - '', - "q" - ][0])); - (this.voidIfAny([ - '', - "q", - undefined - ][0])); - (this.voidIfAny([ - undefined, - "q", - '' - ][0])); - (this.voidIfAny([ - null, - "q", - '' - ][0])); - (this.voidIfAny([ - "q", - '', - null - ][0])); - (this.voidIfAny([ - undefined, - '', - null - ][0])); - (this.voidIfAny([ - [ - 3, - 4 - ], - [ - null - ] - ][0][0])); - var t1 = [ - { - x: 7, - y: new derived() - }, - { - x: 5, - y: new base() - } - ]; - var t2 = [ - { - x: true, - y: new derived() - }, - { - x: false, - y: new base() - } - ]; - var t3 = [ - { - x: undefined, - y: new base() - }, - { - x: '', - y: new derived() - } - ]; + (this.voidIfAny([4, 2][0])); + (this.voidIfAny([4, 2, undefined][0])); + (this.voidIfAny([undefined, 2, 4][0])); + (this.voidIfAny([null, 2, 4][0])); + (this.voidIfAny([2, 4, null][0])); + (this.voidIfAny([undefined, 4, null][0])); + (this.voidIfAny(['', "q"][0])); + (this.voidIfAny(['', "q", undefined][0])); + (this.voidIfAny([undefined, "q", ''][0])); + (this.voidIfAny([null, "q", ''][0])); + (this.voidIfAny(["q", '', null][0])); + (this.voidIfAny([undefined, '', null][0])); + (this.voidIfAny([[3, 4], [null]][0][0])); + var t1 = [{ x: 7, y: new derived() }, { x: 5, y: new base() }]; + var t2 = [{ x: true, y: new derived() }, { x: false, y: new base() }]; + var t3 = [{ x: undefined, y: new base() }, { x: '', y: new derived() }]; var anyObj = null; // Order matters here so test all the variants - var a1 = [ - { - x: 0, - y: 'a' - }, - { - x: 'a', - y: 'a' - }, - { - x: anyObj, - y: 'a' - } - ]; - var a2 = [ - { - x: anyObj, - y: 'a' - }, - { - x: 0, - y: 'a' - }, - { - x: 'a', - y: 'a' - } - ]; - var a3 = [ - { - x: 0, - y: 'a' - }, - { - x: anyObj, - y: 'a' - }, - { - x: 'a', - y: 'a' - } - ]; + var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }]; + var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }]; + var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }]; var ifaceObj = null; var baseObj = new base(); var base2Obj = new base2(); - var b1 = [ - baseObj, - base2Obj, - ifaceObj - ]; - var b2 = [ - base2Obj, - baseObj, - ifaceObj - ]; - var b3 = [ - baseObj, - ifaceObj, - base2Obj - ]; - var b4 = [ - ifaceObj, - baseObj, - base2Obj - ]; + var b1 = [baseObj, base2Obj, ifaceObj]; + var b2 = [base2Obj, baseObj, ifaceObj]; + var b3 = [baseObj, ifaceObj, base2Obj]; + var b4 = [ifaceObj, baseObj, base2Obj]; }; return f; })(); @@ -336,170 +200,34 @@ var NonEmptyTypes; return null; }; f.prototype.x = function () { - (this.voidIfAny([ - 4, - 2 - ][0])); - (this.voidIfAny([ - 4, - 2, - undefined - ][0])); - (this.voidIfAny([ - undefined, - 2, - 4 - ][0])); - (this.voidIfAny([ - null, - 2, - 4 - ][0])); - (this.voidIfAny([ - 2, - 4, - null - ][0])); - (this.voidIfAny([ - undefined, - 4, - null - ][0])); - (this.voidIfAny([ - '', - "q" - ][0])); - (this.voidIfAny([ - '', - "q", - undefined - ][0])); - (this.voidIfAny([ - undefined, - "q", - '' - ][0])); - (this.voidIfAny([ - null, - "q", - '' - ][0])); - (this.voidIfAny([ - "q", - '', - null - ][0])); - (this.voidIfAny([ - undefined, - '', - null - ][0])); - (this.voidIfAny([ - [ - 3, - 4 - ], - [ - null - ] - ][0][0])); - var t1 = [ - { - x: 7, - y: new derived() - }, - { - x: 5, - y: new base() - } - ]; - var t2 = [ - { - x: true, - y: new derived() - }, - { - x: false, - y: new base() - } - ]; - var t3 = [ - { - x: undefined, - y: new base() - }, - { - x: '', - y: new derived() - } - ]; + (this.voidIfAny([4, 2][0])); + (this.voidIfAny([4, 2, undefined][0])); + (this.voidIfAny([undefined, 2, 4][0])); + (this.voidIfAny([null, 2, 4][0])); + (this.voidIfAny([2, 4, null][0])); + (this.voidIfAny([undefined, 4, null][0])); + (this.voidIfAny(['', "q"][0])); + (this.voidIfAny(['', "q", undefined][0])); + (this.voidIfAny([undefined, "q", ''][0])); + (this.voidIfAny([null, "q", ''][0])); + (this.voidIfAny(["q", '', null][0])); + (this.voidIfAny([undefined, '', null][0])); + (this.voidIfAny([[3, 4], [null]][0][0])); + var t1 = [{ x: 7, y: new derived() }, { x: 5, y: new base() }]; + var t2 = [{ x: true, y: new derived() }, { x: false, y: new base() }]; + var t3 = [{ x: undefined, y: new base() }, { x: '', y: new derived() }]; var anyObj = null; // Order matters here so test all the variants - var a1 = [ - { - x: 0, - y: 'a' - }, - { - x: 'a', - y: 'a' - }, - { - x: anyObj, - y: 'a' - } - ]; - var a2 = [ - { - x: anyObj, - y: 'a' - }, - { - x: 0, - y: 'a' - }, - { - x: 'a', - y: 'a' - } - ]; - var a3 = [ - { - x: 0, - y: 'a' - }, - { - x: anyObj, - y: 'a' - }, - { - x: 'a', - y: 'a' - } - ]; + var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }]; + var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }]; + var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }]; var ifaceObj = null; var baseObj = new base(); var base2Obj = new base2(); - var b1 = [ - baseObj, - base2Obj, - ifaceObj - ]; - var b2 = [ - base2Obj, - baseObj, - ifaceObj - ]; - var b3 = [ - baseObj, - ifaceObj, - base2Obj - ]; - var b4 = [ - ifaceObj, - baseObj, - base2Obj - ]; + var b1 = [baseObj, base2Obj, ifaceObj]; + var b2 = [base2Obj, baseObj, ifaceObj]; + var b3 = [baseObj, ifaceObj, base2Obj]; + var b4 = [ifaceObj, baseObj, base2Obj]; }; return f; })(); diff --git a/tests/baselines/reference/arrayBindingPatternOmittedExpressions.js b/tests/baselines/reference/arrayBindingPatternOmittedExpressions.js new file mode 100644 index 00000000000..a6f01d7b75c --- /dev/null +++ b/tests/baselines/reference/arrayBindingPatternOmittedExpressions.js @@ -0,0 +1,31 @@ +//// [arrayBindingPatternOmittedExpressions.ts] + +var results: string[]; + +{ + let [, b, , a] = results; + let x = { + a, + b + } +} + + +function f([, a, , b, , , , s, , , ] = results) { + a = s[1]; + b = s[2]; +} + +//// [arrayBindingPatternOmittedExpressions.js] +var results; +{ + let [, b, , a] = results; + let x = { + a, + b + }; +} +function f([, a, , b, , , , s, , ,] = results) { + a = s[1]; + b = s[2]; +} diff --git a/tests/baselines/reference/arrayBindingPatternOmittedExpressions.types b/tests/baselines/reference/arrayBindingPatternOmittedExpressions.types new file mode 100644 index 00000000000..ba1ac955b85 --- /dev/null +++ b/tests/baselines/reference/arrayBindingPatternOmittedExpressions.types @@ -0,0 +1,43 @@ +=== tests/cases/compiler/arrayBindingPatternOmittedExpressions.ts === + +var results: string[]; +>results : string[] + +{ + let [, b, , a] = results; +>b : string +>a : string +>results : string[] + + let x = { +>x : { a: string; b: string; } +>{ a, b } : { a: string; b: string; } + + a, +>a : string + + b +>b : string + } +} + + +function f([, a, , b, , , , s, , , ] = results) { +>f : ([, a, , b, , , , s, , , ]?: string[]) => void +>a : string +>b : string +>s : string +>results : string[] + + a = s[1]; +>a = s[1] : string +>a : string +>s[1] : string +>s : string + + b = s[2]; +>b = s[2] : string +>b : string +>s[2] : string +>s : string +} diff --git a/tests/baselines/reference/arrayCast.js b/tests/baselines/reference/arrayCast.js index 7a6482fb39b..214bf642250 100644 --- a/tests/baselines/reference/arrayCast.js +++ b/tests/baselines/reference/arrayCast.js @@ -9,15 +9,6 @@ //// [arrayCast.js] // Should fail. Even though the array is contextually typed with { id: number }[], it still // has type { foo: string }[], which is not assignable to { id: number }[]. -[ - { - foo: "s" - } -]; +[{ foo: "s" }]; // Should succeed, as the {} element causes the type of the array to be {}[] -[ - { - foo: "s" - }, - {} -]; +[{ foo: "s" }, {}]; diff --git a/tests/baselines/reference/arrayConcatMap.js b/tests/baselines/reference/arrayConcatMap.js index 992c8eb7ce3..715ca158a43 100644 --- a/tests/baselines/reference/arrayConcatMap.js +++ b/tests/baselines/reference/arrayConcatMap.js @@ -3,14 +3,5 @@ var x = [].concat([{ a: 1 }], [{ a: 2 }]) .map(b => b.a); //// [arrayConcatMap.js] -var x = [].concat([ - { - a: 1 - } -], [ - { - a: 2 - } -]).map(function (b) { - return b.a; -}); +var x = [].concat([{ a: 1 }], [{ a: 2 }]) + .map(function (b) { return b.a; }); diff --git a/tests/baselines/reference/arrayLiteral.js b/tests/baselines/reference/arrayLiteral.js index f2d6c998175..ae210aabd42 100644 --- a/tests/baselines/reference/arrayLiteral.js +++ b/tests/baselines/reference/arrayLiteral.js @@ -19,21 +19,11 @@ var y2: number[] = new Array(); // valid uses of array literals var x = []; var x = new Array(1); -var y = [ - 1 -]; -var y = [ - 1, - 2 -]; +var y = [1]; +var y = [1, 2]; var y = new Array(); var x2 = []; var x2 = new Array(1); -var y2 = [ - 1 -]; -var y2 = [ - 1, - 2 -]; +var y2 = [1]; +var y2 = [1, 2]; var y2 = new Array(); diff --git a/tests/baselines/reference/arrayLiteral1.js b/tests/baselines/reference/arrayLiteral1.js index 8949ae684f0..b84e7414f24 100644 --- a/tests/baselines/reference/arrayLiteral1.js +++ b/tests/baselines/reference/arrayLiteral1.js @@ -2,7 +2,4 @@ var v30 = [1, 2]; //// [arrayLiteral1.js] -var v30 = [ - 1, - 2 -]; +var v30 = [1, 2]; diff --git a/tests/baselines/reference/arrayLiteral2.js b/tests/baselines/reference/arrayLiteral2.js index 42d05fe9169..fb1b8059305 100644 --- a/tests/baselines/reference/arrayLiteral2.js +++ b/tests/baselines/reference/arrayLiteral2.js @@ -2,7 +2,4 @@ var v30 = [1, 2], v31; //// [arrayLiteral2.js] -var v30 = [ - 1, - 2 -], v31; +var v30 = [1, 2], v31; diff --git a/tests/baselines/reference/arrayLiteralContextualType.js b/tests/baselines/reference/arrayLiteralContextualType.js index c86347cb028..0edf5c45164 100644 --- a/tests/baselines/reference/arrayLiteralContextualType.js +++ b/tests/baselines/reference/arrayLiteralContextualType.js @@ -44,10 +44,8 @@ var Elephant = (function () { } return Elephant; })(); -function foo(animals) { -} -function bar(animals) { -} +function foo(animals) { } +function bar(animals) { } foo([ new Giraffe(), new Elephant() @@ -56,9 +54,6 @@ bar([ new Giraffe(), new Elephant() ]); // Legal because of the contextual type IAnimal provided by the parameter -var arr = [ - new Giraffe(), - new Elephant() -]; +var arr = [new Giraffe(), new Elephant()]; foo(arr); // ok because arr is Array not {}[] bar(arr); // ok because arr is Array not {}[] diff --git a/tests/baselines/reference/arrayLiteralSpread.js b/tests/baselines/reference/arrayLiteralSpread.js index 6cb0335e55d..73a60714526 100644 --- a/tests/baselines/reference/arrayLiteralSpread.js +++ b/tests/baselines/reference/arrayLiteralSpread.js @@ -25,11 +25,7 @@ function f2() { //// [arrayLiteralSpread.js] function f0() { - var a = [ - 1, - 2, - 3 - ]; + var a = [1, 2, 3]; var a1 = a; var a2 = [1].concat(a); var a3 = [1, 2].concat(a); @@ -40,17 +36,11 @@ function f0() { var a8 = a.concat(a, a); } function f1() { - var a = [ - 1, - 2, - 3 - ]; + var a = [1, 2, 3]; var b = ["hello"].concat(a, [true]); var b; } function f2() { var a = []; - var b = [ - 5 - ]; + var b = [5]; } diff --git a/tests/baselines/reference/arrayLiteralTypeInference.js b/tests/baselines/reference/arrayLiteralTypeInference.js index 8d74e6f1444..28aa143fa61 100644 --- a/tests/baselines/reference/arrayLiteralTypeInference.js +++ b/tests/baselines/reference/arrayLiteralTypeInference.js @@ -78,14 +78,8 @@ var ActionB = (function (_super) { return ActionB; })(Action); var x1 = [ - { - id: 2, - trueness: false - }, - { - id: 3, - name: "three" - } + { id: 2, trueness: false }, + { id: 3, name: "three" } ]; var x2 = [ new ActionA(), @@ -97,14 +91,8 @@ var x3 = [ new ActionB() ]; var z1 = [ - { - id: 2, - trueness: false - }, - { - id: 3, - name: "three" - } + { id: 2, trueness: false }, + { id: 3, name: "three" } ]; var z2 = [ new ActionA(), diff --git a/tests/baselines/reference/arrayLiteralWidened.js b/tests/baselines/reference/arrayLiteralWidened.js index 02f9e0c6544..a250c47849d 100644 --- a/tests/baselines/reference/arrayLiteralWidened.js +++ b/tests/baselines/reference/arrayLiteralWidened.js @@ -17,43 +17,10 @@ var c = [[[null]],[undefined]] //// [arrayLiteralWidened.js] // array literals are widened upon assignment according to their element type var a = []; // any[] -var a = [ - null, - null -]; -var a = [ - undefined, - undefined -]; -var b = [ - [], - [ - null, - null - ] -]; // any[][] -var b = [ - [], - [] -]; -var b = [ - [ - undefined, - undefined - ] -]; -var c = [ - [ - [] - ] -]; // any[][][] -var c = [ - [ - [ - null - ] - ], - [ - undefined - ] -]; +var a = [null, null]; +var a = [undefined, undefined]; +var b = [[], [null, null]]; // any[][] +var b = [[], []]; +var b = [[undefined, undefined]]; +var c = [[[]]]; // any[][][] +var c = [[[null]], [undefined]]; diff --git a/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.js b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.js index 9855abefb2c..b4f869d499e 100644 --- a/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.js +++ b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.js @@ -20,48 +20,10 @@ var gs = [(b: { x: number; z?: number }) => 2, (a: { x: number; y?: number }) => var a; var b; var c; -var as = [ - a, - b -]; // { x: number; y?: number };[] -var bs = [ - b, - a -]; // { x: number; z?: number };[] -var cs = [ - a, - b, - c -]; // { x: number; y?: number };[] -var ds = [ - function (x) { - return 1; - }, - function (x) { - return 2; - } -]; // { (x:Object) => number }[] -var es = [ - function (x) { - return 2; - }, - function (x) { - return 1; - } -]; // { (x:string) => number }[] -var fs = [ - function (a) { - return 1; - }, - function (b) { - return 2; - } -]; // (a: { x: number; y?: number }) => number[] -var gs = [ - function (b) { - return 2; - }, - function (a) { - return 1; - } -]; // (b: { x: number; z?: number }) => number[] +var as = [a, b]; // { x: number; y?: number };[] +var bs = [b, a]; // { x: number; z?: number };[] +var cs = [a, b, c]; // { x: number; y?: number };[] +var ds = [function (x) { return 1; }, function (x) { return 2; }]; // { (x:Object) => number }[] +var es = [function (x) { return 2; }, function (x) { return 1; }]; // { (x:string) => number }[] +var fs = [function (a) { return 1; }, function (b) { return 2; }]; // (a: { x: number; y?: number }) => number[] +var gs = [function (b) { return 2; }, function (a) { return 1; }]; // (b: { x: number; z?: number }) => number[] diff --git a/tests/baselines/reference/arrayLiterals.js b/tests/baselines/reference/arrayLiterals.js index e55d14e2994..16e5ec7eee4 100644 --- a/tests/baselines/reference/arrayLiterals.js +++ b/tests/baselines/reference/arrayLiterals.js @@ -44,91 +44,24 @@ var __extends = this.__extends || function (d, b) { __.prototype = b.prototype; d.prototype = new __(); }; -var arr1 = [ - [], - [ - 1 - ], - [ - '' - ] -]; -var arr2 = [ - [ - null - ], - [ - 1 - ], - [ - '' - ] -]; +var arr1 = [[], [1], ['']]; +var arr2 = [[null], [1], ['']]; // Array literal with elements of only EveryType E has type E[] -var stringArrArr = [ - [ - '' - ], - [ - "" - ] -]; -var stringArr = [ - '', - "" -]; -var numberArr = [ - 0, - 0.0, - 0x00, - 1e1 -]; -var boolArr = [ - false, - true, - false, - true -]; +var stringArrArr = [[''], [""]]; +var stringArr = ['', ""]; +var numberArr = [0, 0.0, 0x00, 1e1]; +var boolArr = [false, true, false, true]; var C = (function () { function C() { } return C; })(); -var classArr = [ - new C(), - new C() -]; -var classTypeArray = [ - C, - C, - C -]; +var classArr = [new C(), new C()]; +var classTypeArray = [C, C, C]; var classTypeArray; // Should OK, not be a parse error // Contextual type C with numeric index signature makes array literal of EveryType E of type BCT(E,C)[] -var context1 = [ - { - a: '', - b: 0, - c: '' - }, - { - a: "", - b: 3, - c: 0 - } -]; -var context2 = [ - { - a: '', - b: 0, - c: '' - }, - { - a: "", - b: 3, - c: 0 - } -]; +var context1 = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; +var context2 = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; // Contextual type C with numeric index signature of type Base makes array literal of Derived have type Base[] var Base = (function () { function Base() { @@ -151,12 +84,6 @@ var Derived2 = (function (_super) { return Derived2; })(Base); ; -var context3 = [ - new Derived1(), - new Derived2() -]; +var context3 = [new Derived1(), new Derived2()]; // Contextual type C with numeric index signature of type Base makes array literal of Derived1 and Derived2 have type Base[] -var context4 = [ - new Derived1(), - new Derived1() -]; +var context4 = [new Derived1(), new Derived1()]; diff --git a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js index cce02199052..f15215a88eb 100644 --- a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js +++ b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js @@ -52,20 +52,8 @@ var MyList = (function () { var list; var list2; var myList; -var xs = [ - list, - myList -]; // {}[] -var ys = [ - list, - list2 -]; // {}[] -var zs = [ - list, - null -]; // List[] +var xs = [list, myList]; // {}[] +var ys = [list, list2]; // {}[] +var zs = [list, null]; // List[] var myDerivedList; -var as = [ - list, - myDerivedList -]; // List[] +var as = [list, myDerivedList]; // List[] diff --git a/tests/baselines/reference/arrayOfFunctionTypes3.js b/tests/baselines/reference/arrayOfFunctionTypes3.js index 036fc2d85ae..c0829418dd7 100644 --- a/tests/baselines/reference/arrayOfFunctionTypes3.js +++ b/tests/baselines/reference/arrayOfFunctionTypes3.js @@ -28,42 +28,25 @@ var r7 = r6(''); // any not string //// [arrayOfFunctionTypes3.js] // valid uses of arrays of function types -var x = [ - function () { - return 1; - }, - function () { - } -]; +var x = [function () { return 1; }, function () { }]; var r2 = x[0](); var C = (function () { function C() { } return C; })(); -var y = [ - C, - C -]; +var y = [C, C]; var r3 = new y[0](); var a; var b; var c; -var z = [ - a, - b, - c -]; +var z = [a, b, c]; var r4 = z[0]; var r5 = r4(''); // any not string var r5b = r4(1); var a2; var b2; var c2; -var z2 = [ - a2, - b2, - c2 -]; +var z2 = [a2, b2, c2]; var r6 = z2[0]; var r7 = r6(''); // any not string diff --git a/tests/baselines/reference/arrayReferenceWithoutTypeArgs.js b/tests/baselines/reference/arrayReferenceWithoutTypeArgs.js index 3b0f2c11aa7..6fcdae657e9 100644 --- a/tests/baselines/reference/arrayReferenceWithoutTypeArgs.js +++ b/tests/baselines/reference/arrayReferenceWithoutTypeArgs.js @@ -7,7 +7,6 @@ class X { var X = (function () { function X() { } - X.prototype.f = function (a) { - }; + X.prototype.f = function (a) { }; return X; })(); diff --git a/tests/baselines/reference/arraySigChecking.js b/tests/baselines/reference/arraySigChecking.js index 82ef3d059ef..16189305ead 100644 --- a/tests/baselines/reference/arraySigChecking.js +++ b/tests/baselines/reference/arraySigChecking.js @@ -34,22 +34,13 @@ isEmpty(['a']); //// [arraySigChecking.js] var myVar; -var strArray = [ - myVar.voidFn() -]; +var strArray = [myVar.voidFn()]; var myArray; -myArray = [ - [ - 1, - 2 - ] -]; +myArray = [[1, 2]]; function isEmpty(l) { return l.length === 0; } isEmpty([]); isEmpty(new Array(3)); isEmpty(new Array(3)); -isEmpty([ - 'a' -]); +isEmpty(['a']); diff --git a/tests/baselines/reference/arrowFunctionContexts.js b/tests/baselines/reference/arrowFunctionContexts.js index 3a47b787418..a10e3955ae0 100644 --- a/tests/baselines/reference/arrowFunctionContexts.js +++ b/tests/baselines/reference/arrowFunctionContexts.js @@ -105,9 +105,7 @@ var __extends = this.__extends || function (d, b) { }; // Arrow function used in with statement with (window) { - var p = function () { - return this; - }; + var p = function () { return this; }; } // Arrow function as argument to super call var Base = (function () { @@ -119,55 +117,35 @@ var Derived = (function (_super) { __extends(Derived, _super); function Derived() { var _this = this; - _super.call(this, function () { - return _this; - }); + _super.call(this, function () { return _this; }); } return Derived; })(Base); // Arrow function as function argument -window.setTimeout(function () { - return null; -}, 100); +window.setTimeout(function () { return null; }, 100); // Arrow function as value in array literal -var obj = function (n) { - return ''; -}; +var obj = function (n) { return ''; }; var obj; // OK -var arr = [ - function (n) { - return ''; - } -]; +var arr = [function (n) { return ''; }]; var arr; // Incorrect error here (bug 829597) // Arrow function as enum value var E; (function (E) { - E[E["x"] = function () { - return 4; - }] = "x"; - E[E["y"] = (function () { - return _this; - }).length] = "y"; // error, can't use this in enum + E[E["x"] = function () { return 4; }] = "x"; + E[E["y"] = (function () { return _this; }).length] = "y"; // error, can't use this in enum })(E || (E = {})); // Arrow function as module variable initializer var M; (function (M) { - M.a = function (s) { - return ''; - }; - var b = function (s) { - return s; - }; + M.a = function (s) { return ''; }; + var b = function (s) { return s; }; })(M || (M = {})); // Repeat above for module members that are functions? (necessary to redo all of them?) var M2; (function (M2) { // Arrow function used in with statement with (window) { - var p = function () { - return this; - }; + var p = function () { return this; }; } // Arrow function as argument to super call var Base = (function () { @@ -179,69 +157,37 @@ var M2; __extends(Derived, _super); function Derived() { var _this = this; - _super.call(this, function () { - return _this; - }); + _super.call(this, function () { return _this; }); } return Derived; })(Base); // Arrow function as function argument - window.setTimeout(function () { - return null; - }, 100); + window.setTimeout(function () { return null; }, 100); // Arrow function as value in array literal - var obj = function (n) { - return ''; - }; + var obj = function (n) { return ''; }; var obj; // OK - var arr = [ - function (n) { - return ''; - } - ]; + var arr = [function (n) { return ''; }]; var arr; // Incorrect error here (bug 829597) // Arrow function as enum value var E; (function (E) { - E[E["x"] = function () { - return 4; - }] = "x"; - E[E["y"] = (function () { - return _this; - }).length] = "y"; + E[E["x"] = function () { return 4; }] = "x"; + E[E["y"] = (function () { return _this; }).length] = "y"; })(E || (E = {})); // Arrow function as module variable initializer var M; (function (M) { - M.a = function (s) { - return ''; - }; - var b = function (s) { - return s; - }; + M.a = function (s) { return ''; }; + var b = function (s) { return s; }; })(M || (M = {})); })(M2 || (M2 = {})); // (ParamList) => { ... } is a generic arrow function -var generic1 = function (n) { - return [ - n - ]; -}; +var generic1 = function (n) { return [n]; }; var generic1; // Incorrect error, Bug 829597 -var generic2 = function (n) { - return [ - n - ]; -}; +var generic2 = function (n) { return [n]; }; var generic2; // ((ParamList) => { ... } ) is a type assertion to an arrow function -var asserted1 = (function (n) { - return [ - n - ]; -}); +var asserted1 = (function (n) { return [n]; }); var asserted1; -var asserted2 = (function (n) { - return n; -}); +var asserted2 = (function (n) { return n; }); var asserted2; diff --git a/tests/baselines/reference/arrowFunctionExpressions.js b/tests/baselines/reference/arrowFunctionExpressions.js index 760ba23627b..68516b52cb2 100644 --- a/tests/baselines/reference/arrowFunctionExpressions.js +++ b/tests/baselines/reference/arrowFunctionExpressions.js @@ -90,84 +90,49 @@ function tryCatchFn() { //// [arrowFunctionExpressions.js] // ArrowFormalParameters => AssignmentExpression is equivalent to ArrowFormalParameters => { return AssignmentExpression; } -var a = function (p) { - return p.length; -}; -var a = function (p) { - return p.length; -}; +var a = function (p) { return p.length; }; +var a = function (p) { return p.length; }; // Identifier => Block is equivalent to(Identifier) => Block -var b = function (j) { - return 0; -}; -var b = function (j) { - return 0; -}; +var b = function (j) { return 0; }; +var b = function (j) { return 0; }; // Identifier => AssignmentExpression is equivalent to(Identifier) => AssignmentExpression var c; -var d = function (n) { - return c = n; -}; -var d = function (n) { - return c = n; -}; +var d = function (n) { return c = n; }; +var d = function (n) { return c = n; }; var d; // Arrow function used in class member initializer // Arrow function used in class member function var MyClass = (function () { function MyClass() { var _this = this; - this.m = function (n) { - return n + 1; - }; - this.p = function (n) { - return n && _this; - }; + this.m = function (n) { return n + 1; }; + this.p = function (n) { return n && _this; }; } MyClass.prototype.fn = function () { var _this = this; - var m = function (n) { - return n + 1; - }; - var p = function (n) { - return n && _this; - }; + var m = function (n) { return n + 1; }; + var p = function (n) { return n && _this; }; }; return MyClass; })(); // Arrow function used in arrow function -var arrrr = function () { - return function (m) { - return function () { - return function (n) { - return m + n; - }; - }; - }; -}; +var arrrr = function () { return function (m) { return function () { return function (n) { return m + n; }; }; }; }; var e = arrrr()(3)()(4); var e; // Arrow function used in arrow function used in function function someFn() { - var arr = function (n) { - return function (p) { - return p * n; - }; - }; + var arr = function (n) { return function (p) { return p * n; }; }; arr(3)(4).toExponential(); } // Arrow function used in function function someOtherFn() { - var arr = function (n) { - return '' + n; - }; + var arr = function (n) { return '' + n; }; arr(4).charAt(0); } // Arrow function used in nested function in function function outerFn() { function innerFn() { - var arrowFn = function () { - }; + var arrowFn = function () { }; var p = arrowFn(); var p; } @@ -175,9 +140,7 @@ function outerFn() { // Arrow function used in nested function in arrow function var f = function (n) { function fn(x) { - return function () { - return n + x; - }; + return function () { return n + x; }; } return fn(4); }; @@ -187,9 +150,7 @@ var g; function someOuterFn() { var arr = function (n) { function innerFn() { - return function () { - return n.length; - }; + return function () { return n.length; }; } return innerFn; }; @@ -201,18 +162,12 @@ h.toExponential(); function tryCatchFn() { var _this = this; try { - var x = function () { - return _this; - }; + var x = function () { return _this; }; } catch (e) { - var t = function () { - return e + _this; - }; + var t = function () { return e + _this; }; } finally { - var m = function () { - return _this + ''; - }; + var m = function () { return _this + ''; }; } } diff --git a/tests/baselines/reference/arrowFunctionInConstructorArgument1.js b/tests/baselines/reference/arrowFunctionInConstructorArgument1.js index 3cfc18d2cf7..0f9c3f81b3b 100644 --- a/tests/baselines/reference/arrowFunctionInConstructorArgument1.js +++ b/tests/baselines/reference/arrowFunctionInConstructorArgument1.js @@ -11,6 +11,4 @@ var C = (function () { } return C; })(); -var c = new C(function () { - return asdf; -}); // should error +var c = new C(function () { return asdf; }); // should error diff --git a/tests/baselines/reference/arrowFunctionInExpressionStatement1.js b/tests/baselines/reference/arrowFunctionInExpressionStatement1.js index 55a6d2781fb..9969a28b6ce 100644 --- a/tests/baselines/reference/arrowFunctionInExpressionStatement1.js +++ b/tests/baselines/reference/arrowFunctionInExpressionStatement1.js @@ -2,6 +2,4 @@ () => 0; //// [arrowFunctionInExpressionStatement1.js] -(function () { - return 0; -}); +(function () { return 0; }); diff --git a/tests/baselines/reference/arrowFunctionInExpressionStatement2.js b/tests/baselines/reference/arrowFunctionInExpressionStatement2.js index 63f3facd858..2cc6aca998e 100644 --- a/tests/baselines/reference/arrowFunctionInExpressionStatement2.js +++ b/tests/baselines/reference/arrowFunctionInExpressionStatement2.js @@ -6,7 +6,5 @@ module M { //// [arrowFunctionInExpressionStatement2.js] var M; (function (M) { - (function () { - return 0; - }); + (function () { return 0; }); })(M || (M = {})); diff --git a/tests/baselines/reference/arrowFunctionMissingCurlyWithSemicolon.js b/tests/baselines/reference/arrowFunctionMissingCurlyWithSemicolon.js index 51ddc0f6dac..931520294e9 100644 --- a/tests/baselines/reference/arrowFunctionMissingCurlyWithSemicolon.js +++ b/tests/baselines/reference/arrowFunctionMissingCurlyWithSemicolon.js @@ -8,6 +8,4 @@ var square = (x: number) => x * x; // Should error at semicolon. var f = ; var b = 1 * 2 * 3 * 4; -var square = function (x) { - return x * x; -}; +var square = function (x) { return x * x; }; diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody1.js b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody1.js index e3ff7583448..d53f33deadc 100644 --- a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody1.js +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody1.js @@ -2,6 +2,4 @@ var v = a => {} //// [arrowFunctionWithObjectLiteralBody1.js] -var v = function (a) { - return {}; -}; +var v = function (a) { return {}; }; diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody2.js b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody2.js index 384cdc2d48b..f2fc086c082 100644 --- a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody2.js +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody2.js @@ -2,6 +2,4 @@ var v = a => {} //// [arrowFunctionWithObjectLiteralBody2.js] -var v = function (a) { - return {}; -}; +var v = function (a) { return {}; }; diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.js b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.js index f2d27ea4a63..77f5c2d4c3d 100644 --- a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.js +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.js @@ -8,27 +8,7 @@ var c = () => ({ name: "foo", message: "bar" }); var d = () => ((({ name: "foo", message: "bar" }))); //// [arrowFunctionWithObjectLiteralBody5.js] -var a = function () { - return { - name: "foo", - message: "bar" - }; -}; -var b = function () { - return ({ - name: "foo", - message: "bar" - }); -}; -var c = function () { - return ({ - name: "foo", - message: "bar" - }); -}; -var d = function () { - return (({ - name: "foo", - message: "bar" - })); -}; +var a = function () { return { name: "foo", message: "bar" }; }; +var b = function () { return ({ name: "foo", message: "bar" }); }; +var c = function () { return ({ name: "foo", message: "bar" }); }; +var d = function () { return (({ name: "foo", message: "bar" })); }; diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.js b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.js index ac2af4046eb..6128a6bef86 100644 --- a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.js +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.js @@ -8,19 +8,7 @@ var c = () => ({ name: "foo", message: "bar" }); var d = () => ((({ name: "foo", message: "bar" }))); //// [arrowFunctionWithObjectLiteralBody6.js] -var a = () => ({ - name: "foo", - message: "bar" -}); -var b = () => ({ - name: "foo", - message: "bar" -}); -var c = () => ({ - name: "foo", - message: "bar" -}); -var d = () => (({ - name: "foo", - message: "bar" -})); +var a = () => ({ name: "foo", message: "bar" }); +var b = () => ({ name: "foo", message: "bar" }); +var c = () => ({ name: "foo", message: "bar" }); +var d = () => (({ name: "foo", message: "bar" })); diff --git a/tests/baselines/reference/arrowFunctionsMissingTokens.js b/tests/baselines/reference/arrowFunctionsMissingTokens.js index 7bd24f07577..e0e22578ac6 100644 --- a/tests/baselines/reference/arrowFunctionsMissingTokens.js +++ b/tests/baselines/reference/arrowFunctionsMissingTokens.js @@ -69,39 +69,22 @@ module okay { //// [arrowFunctionsMissingTokens.js] var missingArrowsWithCurly; (function (missingArrowsWithCurly) { - var a = function () { - }; - var b = function () { - }; - var c = function (x) { - }; - var d = function (x, y) { - }; - var e = function (x, y) { - }; + var a = function () { }; + var b = function () { }; + var c = function (x) { }; + var d = function (x, y) { }; + var e = function (x, y) { }; })(missingArrowsWithCurly || (missingArrowsWithCurly = {})); var missingCurliesWithArrow; (function (missingCurliesWithArrow) { var withStatement; (function (withStatement) { - var a = function () { - var k = 10; - }; - var b = function () { - var k = 10; - }; - var c = function (x) { - var k = 10; - }; - var d = function (x, y) { - var k = 10; - }; - var e = function (x, y) { - var k = 10; - }; - var f = function () { - var k = 10; - }; + var a = function () { var k = 10; }; + var b = function () { var k = 10; }; + var c = function (x) { var k = 10; }; + var d = function (x, y) { var k = 10; }; + var e = function (x, y) { var k = 10; }; + var f = function () { var k = 10; }; })(withStatement || (withStatement = {})); var withoutStatement; (function (withoutStatement) { @@ -127,14 +110,9 @@ var ce_nEst_pas_une_arrow_function; })(ce_nEst_pas_une_arrow_function || (ce_nEst_pas_une_arrow_function = {})); var okay; (function (okay) { - var a = function () { - }; - var b = function () { - }; - var c = function (x) { - }; - var d = function (x, y) { - }; - var e = function (x, y) { - }; + var a = function () { }; + var b = function () { }; + var c = function (x) { }; + var d = function (x, y) { }; + var e = function (x, y) { }; })(okay || (okay = {})); diff --git a/tests/baselines/reference/asiArith.js b/tests/baselines/reference/asiArith.js index 6d7b964c8d0..d552fd5ee77 100644 --- a/tests/baselines/reference/asiArith.js +++ b/tests/baselines/reference/asiArith.js @@ -37,7 +37,11 @@ y //// [asiArith.js] var x = 1; var y = 1; -var z = x + + +y; +var z = x + + + + +y; var a = 1; var b = 1; -var c = x - - -y; +var c = x + - + - -y; diff --git a/tests/baselines/reference/assign1.js b/tests/baselines/reference/assign1.js index f29f5a2a9de..fa18c8f287b 100644 --- a/tests/baselines/reference/assign1.js +++ b/tests/baselines/reference/assign1.js @@ -12,8 +12,5 @@ module M { //// [assign1.js] var M; (function (M) { - var x = { - salt: 2, - pepper: 0 - }; + var x = { salt: 2, pepper: 0 }; })(M || (M = {})); diff --git a/tests/baselines/reference/assignEveryTypeToAny.js b/tests/baselines/reference/assignEveryTypeToAny.js index ed1911ef995..bbe622b3300 100644 --- a/tests/baselines/reference/assignEveryTypeToAny.js +++ b/tests/baselines/reference/assignEveryTypeToAny.js @@ -91,16 +91,8 @@ var h; x = h; var i; x = i; -x = { - f: function () { - return 1; - } -}; -x = { - f: function (x) { - return x; - } -}; +x = { f: function () { return 1; } }; +x = { f: function (x) { return x; } }; function j(a) { x = a; } diff --git a/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.js b/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.js index 182ceec9821..fe6142cafe0 100644 --- a/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.js +++ b/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.js @@ -10,11 +10,6 @@ fn(function (a, b) { return true; }) //// [assignLambdaToNominalSubtypeOfFunction.js] -function fn(cb) { -} -fn(function (a, b) { - return true; -}); -fn(function (a, b) { - return true; -}); +function fn(cb) { } +fn(function (a, b) { return true; }); +fn(function (a, b) { return true; }); diff --git a/tests/baselines/reference/assignToExistingClass.js b/tests/baselines/reference/assignToExistingClass.js index c739279c85b..f12979f3142 100644 --- a/tests/baselines/reference/assignToExistingClass.js +++ b/tests/baselines/reference/assignToExistingClass.js @@ -28,9 +28,7 @@ var Test; } Tester.prototype.willThrowError = function () { Mocked = Mocked || function () { - return { - myProp: "test" - }; + return { myProp: "test" }; }; }; return Tester; diff --git a/tests/baselines/reference/assignToFn.js b/tests/baselines/reference/assignToFn.js index a565b9ab1ad..2ff8ceedfa6 100644 --- a/tests/baselines/reference/assignToFn.js +++ b/tests/baselines/reference/assignToFn.js @@ -13,10 +13,6 @@ module M { //// [assignToFn.js] var M; (function (M) { - var x = { - f: function (n) { - return true; - } - }; + var x = { f: function (n) { return true; } }; x.f = "hello"; })(M || (M = {})); diff --git a/tests/baselines/reference/assignmentCompat1.js b/tests/baselines/reference/assignmentCompat1.js index 99b6d592afd..09546b7165e 100644 --- a/tests/baselines/reference/assignmentCompat1.js +++ b/tests/baselines/reference/assignmentCompat1.js @@ -6,9 +6,7 @@ x = y; y = x; //// [assignmentCompat1.js] -var x = { - one: 1 -}; +var x = { one: 1 }; var y; x = y; y = x; diff --git a/tests/baselines/reference/assignmentCompatBug2.js b/tests/baselines/reference/assignmentCompatBug2.js index 6f4ebd585ed..5545cc7d19c 100644 --- a/tests/baselines/reference/assignmentCompatBug2.js +++ b/tests/baselines/reference/assignmentCompatBug2.js @@ -39,62 +39,33 @@ b3 = { }; // error //// [assignmentCompatBug2.js] -var b2 = { - a: 0 -}; // error -b2 = { - a: 0 -}; // error -b2 = { - b: 0, - a: 0 -}; +var b2 = { a: 0 }; // error +b2 = { a: 0 }; // error +b2 = { b: 0, a: 0 }; var b3; b3 = { - f: function (n) { - return 0; - }, - g: function (s) { - return 0; - }, + f: function (n) { return 0; }, + g: function (s) { return 0; }, m: 0 }; // ok b3 = { - f: function (n) { - return 0; - }, - g: function (s) { - return 0; - } + f: function (n) { return 0; }, + g: function (s) { return 0; } }; // error b3 = { - f: function (n) { - return 0; - }, + f: function (n) { return 0; }, m: 0 }; // error b3 = { - f: function (n) { - return 0; - }, - g: function (s) { - return 0; - }, + f: function (n) { return 0; }, + g: function (s) { return 0; }, m: 0, n: 0, - k: function (a) { - return null; - } + k: function (a) { return null; } }; // ok b3 = { - f: function (n) { - return 0; - }, - g: function (s) { - return 0; - }, + f: function (n) { return 0; }, + g: function (s) { return 0; }, n: 0, - k: function (a) { - return null; - } + k: function (a) { return null; } }; // error diff --git a/tests/baselines/reference/assignmentCompatBug3.js b/tests/baselines/reference/assignmentCompatBug3.js index 6d3deedc5b8..049e7090335 100644 --- a/tests/baselines/reference/assignmentCompatBug3.js +++ b/tests/baselines/reference/assignmentCompatBug3.js @@ -28,12 +28,8 @@ foo(x + y); //// [assignmentCompatBug3.js] function makePoint(x, y) { return { - get x() { - return x; - }, - get y() { - return y; - }, + get x() { return x; }, + get y() { return y; }, //x: "yo", //y: "boo", dist: function () { @@ -53,8 +49,7 @@ var C = (function () { }); return C; })(); -function foo(test) { -} +function foo(test) { } var x; var y; foo(x); diff --git a/tests/baselines/reference/assignmentCompatBug5.js b/tests/baselines/reference/assignmentCompatBug5.js index d769e9afd25..ae444c3dad6 100644 --- a/tests/baselines/reference/assignmentCompatBug5.js +++ b/tests/baselines/reference/assignmentCompatBug5.js @@ -12,22 +12,11 @@ foo3((n) => { return; }); //// [assignmentCompatBug5.js] -function foo1(x) { -} -foo1({ - b: 5 -}); -function foo2(x) { -} -foo2([ - "s", - "t" -]); -function foo3(x) { -} +function foo1(x) { } +foo1({ b: 5 }); +function foo2(x) { } +foo2(["s", "t"]); +function foo3(x) { } ; -foo3(function (s) { -}); -foo3(function (n) { - return; -}); +foo3(function (s) { }); +foo3(function (n) { return; }); diff --git a/tests/baselines/reference/assignmentCompatForEnums.js b/tests/baselines/reference/assignmentCompatForEnums.js index 4bca6a514d2..8db85399fa8 100644 --- a/tests/baselines/reference/assignmentCompatForEnums.js +++ b/tests/baselines/reference/assignmentCompatForEnums.js @@ -22,9 +22,7 @@ var TokenType; })(TokenType || (TokenType = {})); ; var list = {}; -function returnType() { - return null; -} +function returnType() { return null; } function foo() { var x = returnType(); var x = list['one']; diff --git a/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.js b/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.js index b56a09ff7e7..c96c739bf3c 100644 --- a/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.js +++ b/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.js @@ -6,17 +6,7 @@ foo({ id: 1234, name: false }); // Error, name of wrong type foo({ name: "hello" }); // Error, id required but missing //// [assignmentCompatFunctionsWithOptionalArgs.js] -foo({ - id: 1234 -}); // Ok -foo({ - id: 1234, - name: "hello" -}); // Ok -foo({ - id: 1234, - name: false -}); // Error, name of wrong type -foo({ - name: "hello" -}); // Error, id required but missing +foo({ id: 1234 }); // Ok +foo({ id: 1234, name: "hello" }); // Ok +foo({ id: 1234, name: false }); // Error, name of wrong type +foo({ name: "hello" }); // Error, id required but missing diff --git a/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.js b/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.js index 2eac9cdb476..bb6817bb60e 100644 --- a/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.js +++ b/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.js @@ -20,10 +20,8 @@ Biz(new Foo()); var Foo = (function () { function Foo() { } - Foo.prototype.Boz = function () { - }; + Foo.prototype.Boz = function () { }; return Foo; })(); -function Biz(map) { -} +function Biz(map) { } Biz(new Foo()); diff --git a/tests/baselines/reference/assignmentCompatOnNew.js b/tests/baselines/reference/assignmentCompatOnNew.js index bc3b7e6ba96..1b8cfdcc3bf 100644 --- a/tests/baselines/reference/assignmentCompatOnNew.js +++ b/tests/baselines/reference/assignmentCompatOnNew.js @@ -13,6 +13,5 @@ var Foo = (function () { return Foo; })(); ; -function bar(x) { -} +function bar(x) { } bar(Foo); // Error, but should be allowed diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures.js b/tests/baselines/reference/assignmentCompatWithCallSignatures.js index 9cd0a8c8bac..12fc6159fac 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures.js @@ -55,40 +55,20 @@ t = s; t = a2; a = s; a = a2; -t = function (x) { - return 1; -}; -t = function () { - return 1; -}; -t = function (x) { - return ''; -}; -a = function (x) { - return 1; -}; -a = function () { - return 1; -}; -a = function (x) { - return ''; -}; +t = function (x) { return 1; }; +t = function () { return 1; }; +t = function (x) { return ''; }; +a = function (x) { return 1; }; +a = function () { return 1; }; +a = function (x) { return ''; }; var s2; var a3; // these are errors t = s2; t = a3; -t = function (x) { - return 1; -}; -t = function (x) { - return ''; -}; +t = function (x) { return 1; }; +t = function (x) { return ''; }; a = s2; a = a3; -a = function (x) { - return 1; -}; -a = function (x) { - return ''; -}; +a = function (x) { return 1; }; +a = function (x) { return ''; }; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures2.js b/tests/baselines/reference/assignmentCompatWithCallSignatures2.js index 288a2bdf435..6bfc1b6c0d6 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures2.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures2.js @@ -62,70 +62,26 @@ t = s; t = a2; a = s; a = a2; -t = { - f: function () { - return 1; - } -}; -t = { - f: function (x) { - return 1; - } -}; -t = { - f: function f() { - return 1; - } -}; -t = { - f: function (x) { - return ''; - } -}; -a = { - f: function () { - return 1; - } -}; -a = { - f: function (x) { - return 1; - } -}; -a = { - f: function (x) { - return ''; - } -}; +t = { f: function () { return 1; } }; +t = { f: function (x) { return 1; } }; +t = { f: function f() { return 1; } }; +t = { f: function (x) { return ''; } }; +a = { f: function () { return 1; } }; +a = { f: function (x) { return 1; } }; +a = { f: function (x) { return ''; } }; // errors -t = function () { - return 1; -}; -t = function (x) { - return ''; -}; -a = function () { - return 1; -}; -a = function (x) { - return ''; -}; +t = function () { return 1; }; +t = function (x) { return ''; }; +a = function () { return 1; }; +a = function (x) { return ''; }; var s2; var a3; // these are errors t = s2; t = a3; -t = function (x) { - return 1; -}; -t = function (x) { - return ''; -}; +t = function (x) { return 1; }; +t = function (x) { return ''; }; a = s2; a = a3; -a = function (x) { - return 1; -}; -a = function (x) { - return ''; -}; +a = function (x) { return 1; }; +a = function (x) { return ''; }; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.js b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.js index 3aa9d5a9a9e..e12a741cd0f 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.js @@ -73,15 +73,9 @@ var a5: (x?: number, y?: number) => number; // call signatures in derived types must have the same or fewer optional parameters as the base type var b; var a; -a = function () { - return 1; -}; // ok, same number of required params -a = function (x) { - return 1; -}; // ok, same number of required params -a = function (x) { - return 1; -}; // error, too many required params +a = function () { return 1; }; // ok, same number of required params +a = function (x) { return 1; }; // ok, same number of required params +a = function (x) { return 1; }; // error, too many required params a = b.a; // ok a = b.a2; // ok a = b.a3; // error @@ -89,15 +83,9 @@ a = b.a4; // error a = b.a5; // ok a = b.a6; // error var a2; -a2 = function () { - return 1; -}; // ok, same number of required params -a2 = function (x) { - return 1; -}; // ok, same number of required params -a2 = function (x) { - return 1; -}; // ok, same number of params +a2 = function () { return 1; }; // ok, same number of required params +a2 = function (x) { return 1; }; // ok, same number of required params +a2 = function (x) { return 1; }; // ok, same number of params a2 = b.a; // ok a2 = b.a2; // ok a2 = b.a3; // ok, same number of params @@ -105,18 +93,10 @@ a2 = b.a4; // ok, excess params are optional in b.a3 a2 = b.a5; // ok a2 = b.a6; // error var a3; -a3 = function () { - return 1; -}; // ok, fewer required params -a3 = function (x) { - return 1; -}; // ok, fewer required params -a3 = function (x) { - return 1; -}; // ok, same number of required params -a3 = function (x, y) { - return 1; -}; // error, too many required params +a3 = function () { return 1; }; // ok, fewer required params +a3 = function (x) { return 1; }; // ok, fewer required params +a3 = function (x) { return 1; }; // ok, same number of required params +a3 = function (x, y) { return 1; }; // error, too many required params a3 = b.a; // ok a3 = b.a2; // ok a3 = b.a3; // ok @@ -124,18 +104,10 @@ a3 = b.a4; // ok a3 = b.a5; // ok a3 = b.a6; // error var a4; -a4 = function () { - return 1; -}; // ok, fewer required params -a4 = function (x, y) { - return 1; -}; // ok, fewer required params -a4 = function (x) { - return 1; -}; // ok, same number of required params -a4 = function (x, y) { - return 1; -}; // ok, same number of params +a4 = function () { return 1; }; // ok, fewer required params +a4 = function (x, y) { return 1; }; // ok, fewer required params +a4 = function (x) { return 1; }; // ok, same number of required params +a4 = function (x, y) { return 1; }; // ok, same number of params a4 = b.a; // ok a4 = b.a2; // ok a4 = b.a3; // ok @@ -143,18 +115,10 @@ a4 = b.a4; // ok a4 = b.a5; // ok a4 = b.a6; // ok, same number of params var a5; -a5 = function () { - return 1; -}; // ok, fewer required params -a5 = function (x, y) { - return 1; -}; // ok, fewer required params -a5 = function (x) { - return 1; -}; // ok, fewer params in lambda -a5 = function (x, y) { - return 1; -}; // ok, same number of params +a5 = function () { return 1; }; // ok, fewer required params +a5 = function (x, y) { return 1; }; // ok, fewer required params +a5 = function (x) { return 1; }; // ok, fewer params in lambda +a5 = function (x, y) { return 1; }; // ok, same number of params a5 = b.a; // ok a5 = b.a2; // ok a5 = b.a3; // ok, fewer params in b.a3 diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.js b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.js index 054e865eb45..f4cf5cc79e2 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.js @@ -48,9 +48,7 @@ var a4: (x?: number, y?: string, ...z: number[]) => number; //// [assignmentCompatWithCallSignaturesWithRestParameters.js] // call signatures in derived types must have the same or fewer optional parameters as the target for assignment var a; // ok, same number of required params -a = function () { - return 1; -}; // ok, same number of required params +a = function () { return 1; }; // ok, same number of required params a = function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -65,22 +63,12 @@ a = function () { } return 1; }; // error, type mismatch -a = function (x) { - return 1; -}; // ok, same number of required params -a = function (x, y, z) { - return 1; -}; // ok, same number of required params -a = function (x) { - return 1; -}; // ok, rest param corresponds to infinite number of params -a = function (x) { - return 1; -}; // error, incompatible type +a = function (x) { return 1; }; // ok, same number of required params +a = function (x, y, z) { return 1; }; // ok, same number of required params +a = function (x) { return 1; }; // ok, rest param corresponds to infinite number of params +a = function (x) { return 1; }; // error, incompatible type var a2; -a2 = function () { - return 1; -}; // ok, fewer required params +a2 = function () { return 1; }; // ok, fewer required params a2 = function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -88,12 +76,8 @@ a2 = function () { } return 1; }; // ok, fewer required params -a2 = function (x) { - return 1; -}; // ok, fewer required params -a2 = function (x) { - return 1; -}; // ok, same number of required params +a2 = function (x) { return 1; }; // ok, fewer required params +a2 = function (x) { return 1; }; // ok, same number of required params a2 = function (x) { var args = []; for (var _i = 1; _i < arguments.length; _i++) { @@ -108,28 +92,14 @@ a2 = function (x) { } return 1; }; // should be type mismatch error -a2 = function (x, y) { - return 1; -}; // ok, rest param corresponds to infinite number of params -a2 = function (x, y) { - return 1; -}; // ok, same number of required params +a2 = function (x, y) { return 1; }; // ok, rest param corresponds to infinite number of params +a2 = function (x, y) { return 1; }; // ok, same number of required params var a3; -a3 = function () { - return 1; -}; // ok, fewer required params -a3 = function (x) { - return 1; -}; // ok, fewer required params -a3 = function (x) { - return 1; -}; // ok, same number of required params -a3 = function (x, y) { - return 1; -}; // ok, all present params match -a3 = function (x, y, z) { - return 1; -}; // error +a3 = function () { return 1; }; // ok, fewer required params +a3 = function (x) { return 1; }; // ok, fewer required params +a3 = function (x) { return 1; }; // ok, same number of required params +a3 = function (x, y) { return 1; }; // ok, all present params match +a3 = function (x, y, z) { return 1; }; // error a3 = function (x) { var z = []; for (var _i = 1; _i < arguments.length; _i++) { @@ -137,25 +107,13 @@ a3 = function (x) { } return 1; }; // error -a3 = function (x, y, z) { - return 1; -}; // error +a3 = function (x, y, z) { return 1; }; // error var a4; -a4 = function () { - return 1; -}; // ok, fewer required params -a4 = function (x, y) { - return 1; -}; // error, type mismatch -a4 = function (x) { - return 1; -}; // ok, all present params match -a4 = function (x, y) { - return 1; -}; // error, second param has type mismatch -a4 = function (x, y) { - return 1; -}; // ok, same number of required params with matching types +a4 = function () { return 1; }; // ok, fewer required params +a4 = function (x, y) { return 1; }; // error, type mismatch +a4 = function (x) { return 1; }; // ok, all present params match +a4 = function (x, y) { return 1; }; // error, second param has type mismatch +a4 = function (x, y) { return 1; }; // ok, same number of required params with matching types a4 = function (x) { var args = []; for (var _i = 1; _i < arguments.length; _i++) { diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures.js index 3b38bce1590..c00aa121712 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures.js @@ -53,17 +53,9 @@ var a3; // these are errors t = s2; t = a3; -t = function (x) { - return 1; -}; -t = function (x) { - return ''; -}; +t = function (x) { return 1; }; +t = function (x) { return ''; }; a = s2; a = a3; -a = function (x) { - return 1; -}; -a = function (x) { - return ''; -}; +a = function (x) { return 1; }; +a = function (x) { return ''; }; diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures2.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures2.js index ac3accc6b5b..d00762aa1c5 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures2.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures2.js @@ -55,34 +55,18 @@ t = a2; a = s; a = a2; // errors -t = function () { - return 1; -}; -t = function (x) { - return ''; -}; -a = function () { - return 1; -}; -a = function (x) { - return ''; -}; +t = function () { return 1; }; +t = function (x) { return ''; }; +a = function () { return 1; }; +a = function (x) { return ''; }; var s2; var a3; // these are errors t = s2; t = a3; -t = function (x) { - return 1; -}; -t = function (x) { - return ''; -}; +t = function (x) { return 1; }; +t = function (x) { return ''; }; a = s2; a = a3; -a = function (x) { - return 1; -}; -a = function (x) { - return ''; -}; +a = function (x) { return 1; }; +a = function (x) { return ''; }; diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.js b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.js index 1a5efce1ac8..f5a3499c8cc 100644 --- a/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.js +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.js @@ -138,60 +138,24 @@ var ClassTypeParam; function Base() { var _this = this; this.init = function () { - _this.a = function () { - return null; - }; // ok, same T of required params - _this.a = function (x) { - return null; - }; // ok, same T of required params - _this.a = function (x) { - return null; - }; // error, too many required params - _this.a2 = function () { - return null; - }; // ok, same T of required params - _this.a2 = function (x) { - return null; - }; // ok, same T of required params - _this.a2 = function (x) { - return null; - }; // ok, same number of params - _this.a3 = function () { - return null; - }; // ok, fewer required params - _this.a3 = function (x) { - return null; - }; // ok, fewer required params - _this.a3 = function (x) { - return null; - }; // ok, same T of required params - _this.a3 = function (x, y) { - return null; - }; // error, too many required params - _this.a4 = function () { - return null; - }; // ok, fewer required params - _this.a4 = function (x, y) { - return null; - }; // ok, fewer required params - _this.a4 = function (x) { - return null; - }; // ok, same T of required params - _this.a4 = function (x, y) { - return null; - }; // ok, same number of params - _this.a5 = function () { - return null; - }; // ok, fewer required params - _this.a5 = function (x, y) { - return null; - }; // ok, fewer required params - _this.a5 = function (x) { - return null; - }; // ok, all present params match - _this.a5 = function (x, y) { - return null; - }; // ok, same number of params + _this.a = function () { return null; }; // ok, same T of required params + _this.a = function (x) { return null; }; // ok, same T of required params + _this.a = function (x) { return null; }; // error, too many required params + _this.a2 = function () { return null; }; // ok, same T of required params + _this.a2 = function (x) { return null; }; // ok, same T of required params + _this.a2 = function (x) { return null; }; // ok, same number of params + _this.a3 = function () { return null; }; // ok, fewer required params + _this.a3 = function (x) { return null; }; // ok, fewer required params + _this.a3 = function (x) { return null; }; // ok, same T of required params + _this.a3 = function (x, y) { return null; }; // error, too many required params + _this.a4 = function () { return null; }; // ok, fewer required params + _this.a4 = function (x, y) { return null; }; // ok, fewer required params + _this.a4 = function (x) { return null; }; // ok, same T of required params + _this.a4 = function (x, y) { return null; }; // ok, same number of params + _this.a5 = function () { return null; }; // ok, fewer required params + _this.a5 = function (x, y) { return null; }; // ok, fewer required params + _this.a5 = function (x) { return null; }; // ok, all present params match + _this.a5 = function (x, y) { return null; }; // ok, same number of params }; } return Base; @@ -246,60 +210,24 @@ var GenericSignaturesValid; function Base2() { var _this = this; this.init = function () { - _this.a = function () { - return null; - }; // ok, same T of required params - _this.a = function (x) { - return null; - }; // ok, same T of required params - _this.a = function (x) { - return null; - }; // error, too many required params - _this.a2 = function () { - return null; - }; // ok, same T of required params - _this.a2 = function (x) { - return null; - }; // ok, same T of required params - _this.a2 = function (x) { - return null; - }; // ok, same number of params - _this.a3 = function () { - return null; - }; // ok, fewer required params - _this.a3 = function (x) { - return null; - }; // ok, fewer required params - _this.a3 = function (x) { - return null; - }; // ok, same T of required params - _this.a3 = function (x, y) { - return null; - }; // error, too many required params - _this.a4 = function () { - return null; - }; // ok, fewer required params - _this.a4 = function (x, y) { - return null; - }; // ok, fewer required params - _this.a4 = function (x) { - return null; - }; // ok, same T of required params - _this.a4 = function (x, y) { - return null; - }; // ok, same number of params - _this.a5 = function () { - return null; - }; // ok, fewer required params - _this.a5 = function (x, y) { - return null; - }; // ok, fewer required params - _this.a5 = function (x) { - return null; - }; // ok, all present params match - _this.a5 = function (x, y) { - return null; - }; // ok, same number of params + _this.a = function () { return null; }; // ok, same T of required params + _this.a = function (x) { return null; }; // ok, same T of required params + _this.a = function (x) { return null; }; // error, too many required params + _this.a2 = function () { return null; }; // ok, same T of required params + _this.a2 = function (x) { return null; }; // ok, same T of required params + _this.a2 = function (x) { return null; }; // ok, same number of params + _this.a3 = function () { return null; }; // ok, fewer required params + _this.a3 = function (x) { return null; }; // ok, fewer required params + _this.a3 = function (x) { return null; }; // ok, same T of required params + _this.a3 = function (x, y) { return null; }; // error, too many required params + _this.a4 = function () { return null; }; // ok, fewer required params + _this.a4 = function (x, y) { return null; }; // ok, fewer required params + _this.a4 = function (x) { return null; }; // ok, same T of required params + _this.a4 = function (x, y) { return null; }; // ok, same number of params + _this.a5 = function () { return null; }; // ok, fewer required params + _this.a5 = function (x, y) { return null; }; // ok, fewer required params + _this.a5 = function (x) { return null; }; // ok, all present params match + _this.a5 = function (x, y) { return null; }; // ok, same number of params }; } return Base2; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers.js b/tests/baselines/reference/assignmentCompatWithObjectMembers.js index d3dfe7f93fc..3bd457f19d3 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers.js @@ -106,12 +106,8 @@ var SimpleTypes; var t2; var a; var b; - var a2 = { - foo: '' - }; - var b2 = { - foo: '' - }; + var a2 = { foo: '' }; + var b2 = { foo: '' }; s = t; t = s; s = s2; @@ -150,12 +146,8 @@ var ObjectTypes; var t2; var a; var b; - var a2 = { - foo: a2 - }; - var b2 = { - foo: b2 - }; + var a2 = { foo: a2 }; + var b2 = { foo: b2 }; s = t; t = s; s = s2; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers2.js b/tests/baselines/reference/assignmentCompatWithObjectMembers2.js index 5eb2a07ac11..ea565e9545c 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers2.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers2.js @@ -61,12 +61,8 @@ var s2; var t2; var a; var b; -var a2 = { - foo: '' -}; -var b2 = { - foo: '' -}; +var a2 = { foo: '' }; +var b2 = { foo: '' }; s = t; t = s; s = s2; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers3.js b/tests/baselines/reference/assignmentCompatWithObjectMembers3.js index f65b06931c0..091a1e53d15 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers3.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers3.js @@ -61,12 +61,8 @@ var s2; var t2; var a; var b; -var a2 = { - foo: '' -}; -var b2 = { - foo: '' -}; +var a2 = { foo: '' }; +var b2 = { foo: '' }; s = t; t = s; s = s2; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers4.js b/tests/baselines/reference/assignmentCompatWithObjectMembers4.js index f9933a3e04f..0d535cbb20d 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers4.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers4.js @@ -136,12 +136,8 @@ var OnlyDerived; var t2; var a; var b; - var a2 = { - foo: new Derived() - }; - var b2 = { - foo: new Derived2() - }; + var a2 = { foo: new Derived() }; + var b2 = { foo: new Derived2() }; s = t; // error t = s; // error s = s2; // ok @@ -199,12 +195,8 @@ var WithBase; var t2; var a; var b; - var a2 = { - foo: new Base() - }; - var b2 = { - foo: new Derived2() - }; + var a2 = { foo: new Base() }; + var b2 = { foo: new Derived2() }; s = t; // ok t = s; // error s = s2; // ok diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.js b/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.js index dc2e1244ef5..2a1a08a97ed 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.js @@ -61,12 +61,8 @@ var s2; var t2; var a; var b; -var a2 = { - 1.0: '' -}; -var b2 = { - 1: '' -}; +var a2 = { 1.0: '' }; +var b2 = { 1: '' }; s = t; t = s; s = s2; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js index ca3ada064f8..5525b623ecc 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js @@ -119,9 +119,7 @@ var TargetHasOptional; (function (TargetHasOptional) { var c; var a; - var b = { - opt: new Base() - }; + var b = { opt: new Base() }; var d; var e; var f; @@ -144,9 +142,7 @@ var SourceHasOptional; (function (SourceHasOptional) { var c; var a; - var b = { - opt: new Base() - }; + var b = { opt: new Base() }; var d; var e; var f; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js index cf65e181cb9..8859a4c9ab0 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js @@ -121,9 +121,7 @@ var TargetHasOptional; (function (TargetHasOptional) { var c; var a; - var b = { - opt: new Base() - }; + var b = { opt: new Base() }; var d; var e; var f; @@ -146,9 +144,7 @@ var SourceHasOptional; (function (SourceHasOptional) { var c; var a; - var b = { - opt: new Base() - }; + var b = { opt: new Base() }; var d; var e; var f; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.js b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.js index 06f398401ca..a042897ba57 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.js @@ -106,12 +106,8 @@ var JustStrings; var t2; var a; var b; - var a2 = { - '1.0': '' - }; - var b2 = { - '1': '' - }; + var a2 = { '1.0': '' }; + var b2 = { '1': '' }; s = t; t = s; s = s2; // ok @@ -150,12 +146,8 @@ var NumbersAndStrings; var t2; var a; var b; - var a2 = { - '1.0': '' - }; - var b2 = { - 1.: '' - }; + var a2 = { '1.0': '' }; + var b2 = { 1.: '' }; s = t; // ok t = s; // ok s = s2; // ok diff --git a/tests/baselines/reference/assignmentCompatWithOverloads.js b/tests/baselines/reference/assignmentCompatWithOverloads.js index 472ebec2967..ca3dc0e2294 100644 --- a/tests/baselines/reference/assignmentCompatWithOverloads.js +++ b/tests/baselines/reference/assignmentCompatWithOverloads.js @@ -31,18 +31,10 @@ var d: new(x: number) => void; d = C; // Error //// [assignmentCompatWithOverloads.js] -function f1(x) { - return null; -} -function f2(x) { - return null; -} -function f3(x) { - return null; -} -function f4(x) { - return undefined; -} +function f1(x) { return null; } +function f2(x) { return null; } +function f3(x) { return null; } +function f4(x) { return undefined; } var g; g = f1; // OK g = f2; // Error diff --git a/tests/baselines/reference/assignmentCompatability1.js b/tests/baselines/reference/assignmentCompatability1.js index 61ac5d22058..f629d5eba27 100644 --- a/tests/baselines/reference/assignmentCompatability1.js +++ b/tests/baselines/reference/assignmentCompatability1.js @@ -13,9 +13,7 @@ __test2__.__val__aa = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability10.js b/tests/baselines/reference/assignmentCompatability10.js index a494e30f6cf..bbcc8e879e3 100644 --- a/tests/baselines/reference/assignmentCompatability10.js +++ b/tests/baselines/reference/assignmentCompatability10.js @@ -13,9 +13,7 @@ __test2__.__val__x4 = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability11.js b/tests/baselines/reference/assignmentCompatability11.js index 929a8f1bca3..992e38f7726 100644 --- a/tests/baselines/reference/assignmentCompatability11.js +++ b/tests/baselines/reference/assignmentCompatability11.js @@ -13,17 +13,13 @@ __test2__.__val__obj = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); var __test2__; (function (__test2__) { - __test2__.obj = { - two: 1 - }; + __test2__.obj = { two: 1 }; __test2__.__val__obj = __test2__.obj; })(__test2__ || (__test2__ = {})); __test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability12.js b/tests/baselines/reference/assignmentCompatability12.js index f0ccb00833d..3c802aab6e3 100644 --- a/tests/baselines/reference/assignmentCompatability12.js +++ b/tests/baselines/reference/assignmentCompatability12.js @@ -13,17 +13,13 @@ __test2__.__val__obj = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); var __test2__; (function (__test2__) { - __test2__.obj = { - one: "1" - }; + __test2__.obj = { one: "1" }; __test2__.__val__obj = __test2__.obj; })(__test2__ || (__test2__ = {})); __test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability13.js b/tests/baselines/reference/assignmentCompatability13.js index 084ef7ebeb1..ef4f24f7100 100644 --- a/tests/baselines/reference/assignmentCompatability13.js +++ b/tests/baselines/reference/assignmentCompatability13.js @@ -13,17 +13,13 @@ __test2__.__val__obj = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); var __test2__; (function (__test2__) { - __test2__.obj = { - two: "1" - }; + __test2__.obj = { two: "1" }; __test2__.__val__obj = __test2__.obj; })(__test2__ || (__test2__ = {})); __test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability14.js b/tests/baselines/reference/assignmentCompatability14.js index 4bfe397bc60..bd4445cb515 100644 --- a/tests/baselines/reference/assignmentCompatability14.js +++ b/tests/baselines/reference/assignmentCompatability14.js @@ -13,17 +13,13 @@ __test2__.__val__obj = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); var __test2__; (function (__test2__) { - __test2__.obj = { - one: true - }; + __test2__.obj = { one: true }; __test2__.__val__obj = __test2__.obj; })(__test2__ || (__test2__ = {})); __test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability15.js b/tests/baselines/reference/assignmentCompatability15.js index 0fffe4bd539..37f1be4bc99 100644 --- a/tests/baselines/reference/assignmentCompatability15.js +++ b/tests/baselines/reference/assignmentCompatability15.js @@ -13,17 +13,13 @@ __test2__.__val__obj = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); var __test2__; (function (__test2__) { - __test2__.obj = { - two: true - }; + __test2__.obj = { two: true }; __test2__.__val__obj = __test2__.obj; })(__test2__ || (__test2__ = {})); __test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability16.js b/tests/baselines/reference/assignmentCompatability16.js index 6b20f1be30b..43c832016b0 100644 --- a/tests/baselines/reference/assignmentCompatability16.js +++ b/tests/baselines/reference/assignmentCompatability16.js @@ -13,19 +13,13 @@ __test2__.__val__obj = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); var __test2__; (function (__test2__) { - __test2__.obj = { - one: [ - 1 - ] - }; + __test2__.obj = { one: [1] }; __test2__.__val__obj = __test2__.obj; })(__test2__ || (__test2__ = {})); __test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability17.js b/tests/baselines/reference/assignmentCompatability17.js index b44ce12bb12..09ce24b8f5d 100644 --- a/tests/baselines/reference/assignmentCompatability17.js +++ b/tests/baselines/reference/assignmentCompatability17.js @@ -13,19 +13,13 @@ __test2__.__val__obj = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); var __test2__; (function (__test2__) { - __test2__.obj = { - two: [ - 1 - ] - }; + __test2__.obj = { two: [1] }; __test2__.__val__obj = __test2__.obj; })(__test2__ || (__test2__ = {})); __test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability18.js b/tests/baselines/reference/assignmentCompatability18.js index 1120d349d0b..ad93e96303f 100644 --- a/tests/baselines/reference/assignmentCompatability18.js +++ b/tests/baselines/reference/assignmentCompatability18.js @@ -13,19 +13,13 @@ __test2__.__val__obj = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); var __test2__; (function (__test2__) { - __test2__.obj = { - one: [ - 1 - ] - }; + __test2__.obj = { one: [1] }; __test2__.__val__obj = __test2__.obj; })(__test2__ || (__test2__ = {})); __test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability19.js b/tests/baselines/reference/assignmentCompatability19.js index 6bc4c762ee6..f330f94e81c 100644 --- a/tests/baselines/reference/assignmentCompatability19.js +++ b/tests/baselines/reference/assignmentCompatability19.js @@ -13,19 +13,13 @@ __test2__.__val__obj = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); var __test2__; (function (__test2__) { - __test2__.obj = { - two: [ - 1 - ] - }; + __test2__.obj = { two: [1] }; __test2__.__val__obj = __test2__.obj; })(__test2__ || (__test2__ = {})); __test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability2.js b/tests/baselines/reference/assignmentCompatability2.js index b280ce83c2c..207942875bf 100644 --- a/tests/baselines/reference/assignmentCompatability2.js +++ b/tests/baselines/reference/assignmentCompatability2.js @@ -13,9 +13,7 @@ __test2__.__val__aa = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability20.js b/tests/baselines/reference/assignmentCompatability20.js index aed14360279..321ec78ee17 100644 --- a/tests/baselines/reference/assignmentCompatability20.js +++ b/tests/baselines/reference/assignmentCompatability20.js @@ -13,19 +13,13 @@ __test2__.__val__obj = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); var __test2__; (function (__test2__) { - __test2__.obj = { - one: [ - "1" - ] - }; + __test2__.obj = { one: ["1"] }; __test2__.__val__obj = __test2__.obj; })(__test2__ || (__test2__ = {})); __test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability21.js b/tests/baselines/reference/assignmentCompatability21.js index 6ede7ac66eb..215ab5dc397 100644 --- a/tests/baselines/reference/assignmentCompatability21.js +++ b/tests/baselines/reference/assignmentCompatability21.js @@ -13,19 +13,13 @@ __test2__.__val__obj = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); var __test2__; (function (__test2__) { - __test2__.obj = { - two: [ - "1" - ] - }; + __test2__.obj = { two: ["1"] }; __test2__.__val__obj = __test2__.obj; })(__test2__ || (__test2__ = {})); __test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability22.js b/tests/baselines/reference/assignmentCompatability22.js index 41d60442790..04cc2a2d0ab 100644 --- a/tests/baselines/reference/assignmentCompatability22.js +++ b/tests/baselines/reference/assignmentCompatability22.js @@ -13,19 +13,13 @@ __test2__.__val__obj = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); var __test2__; (function (__test2__) { - __test2__.obj = { - one: [ - true - ] - }; + __test2__.obj = { one: [true] }; __test2__.__val__obj = __test2__.obj; })(__test2__ || (__test2__ = {})); __test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability23.js b/tests/baselines/reference/assignmentCompatability23.js index 4604fd2ba41..1d032364360 100644 --- a/tests/baselines/reference/assignmentCompatability23.js +++ b/tests/baselines/reference/assignmentCompatability23.js @@ -13,19 +13,13 @@ __test2__.__val__obj = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); var __test2__; (function (__test2__) { - __test2__.obj = { - two: [ - true - ] - }; + __test2__.obj = { two: [true] }; __test2__.__val__obj = __test2__.obj; })(__test2__ || (__test2__ = {})); __test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability24.js b/tests/baselines/reference/assignmentCompatability24.js index 5fa5e612d05..e6961264de8 100644 --- a/tests/baselines/reference/assignmentCompatability24.js +++ b/tests/baselines/reference/assignmentCompatability24.js @@ -13,17 +13,13 @@ __test2__.__val__obj = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); var __test2__; (function (__test2__) { - __test2__.obj = function f(a) { - return a; - }; + __test2__.obj = function f(a) { return a; }; ; __test2__.__val__obj = __test2__.obj; })(__test2__ || (__test2__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability25.js b/tests/baselines/reference/assignmentCompatability25.js index 7bc941c3450..4f365e9049c 100644 --- a/tests/baselines/reference/assignmentCompatability25.js +++ b/tests/baselines/reference/assignmentCompatability25.js @@ -13,9 +13,7 @@ __test2__.__val__aa = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability26.js b/tests/baselines/reference/assignmentCompatability26.js index b01d3e19a0e..e2ae6b766df 100644 --- a/tests/baselines/reference/assignmentCompatability26.js +++ b/tests/baselines/reference/assignmentCompatability26.js @@ -13,9 +13,7 @@ __test2__.__val__aa = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability27.js b/tests/baselines/reference/assignmentCompatability27.js index 5460ed7f6c5..be5b06dab7c 100644 --- a/tests/baselines/reference/assignmentCompatability27.js +++ b/tests/baselines/reference/assignmentCompatability27.js @@ -13,9 +13,7 @@ __test2__.__val__aa = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability28.js b/tests/baselines/reference/assignmentCompatability28.js index 6358375ed3a..eef6f0a5ef0 100644 --- a/tests/baselines/reference/assignmentCompatability28.js +++ b/tests/baselines/reference/assignmentCompatability28.js @@ -13,9 +13,7 @@ __test2__.__val__aa = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability29.js b/tests/baselines/reference/assignmentCompatability29.js index 251a580015d..c3410a943ca 100644 --- a/tests/baselines/reference/assignmentCompatability29.js +++ b/tests/baselines/reference/assignmentCompatability29.js @@ -13,9 +13,7 @@ __test2__.__val__aa = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability3.js b/tests/baselines/reference/assignmentCompatability3.js index e32ae5da7ba..7120e6ce3e2 100644 --- a/tests/baselines/reference/assignmentCompatability3.js +++ b/tests/baselines/reference/assignmentCompatability3.js @@ -13,17 +13,13 @@ __test2__.__val__obj = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); var __test2__; (function (__test2__) { - __test2__.obj = { - one: 1 - }; + __test2__.obj = { one: 1 }; __test2__.__val__obj = __test2__.obj; })(__test2__ || (__test2__ = {})); __test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability30.js b/tests/baselines/reference/assignmentCompatability30.js index 3d519971fa8..261c86ad584 100644 --- a/tests/baselines/reference/assignmentCompatability30.js +++ b/tests/baselines/reference/assignmentCompatability30.js @@ -13,9 +13,7 @@ __test2__.__val__aa = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability31.js b/tests/baselines/reference/assignmentCompatability31.js index ad0954e2dc8..152b588b72c 100644 --- a/tests/baselines/reference/assignmentCompatability31.js +++ b/tests/baselines/reference/assignmentCompatability31.js @@ -13,9 +13,7 @@ __test2__.__val__aa = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability32.js b/tests/baselines/reference/assignmentCompatability32.js index e321f02c649..b9ddacff90c 100644 --- a/tests/baselines/reference/assignmentCompatability32.js +++ b/tests/baselines/reference/assignmentCompatability32.js @@ -13,9 +13,7 @@ __test2__.__val__aa = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability33.js b/tests/baselines/reference/assignmentCompatability33.js index 44d42b4bd49..80dfcfc4f7a 100644 --- a/tests/baselines/reference/assignmentCompatability33.js +++ b/tests/baselines/reference/assignmentCompatability33.js @@ -13,9 +13,7 @@ __test2__.__val__obj = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability34.js b/tests/baselines/reference/assignmentCompatability34.js index 67167192653..ab324a10396 100644 --- a/tests/baselines/reference/assignmentCompatability34.js +++ b/tests/baselines/reference/assignmentCompatability34.js @@ -13,9 +13,7 @@ __test2__.__val__obj = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability35.js b/tests/baselines/reference/assignmentCompatability35.js index f01c63390ed..1b79a83146b 100644 --- a/tests/baselines/reference/assignmentCompatability35.js +++ b/tests/baselines/reference/assignmentCompatability35.js @@ -13,9 +13,7 @@ __test2__.__val__aa = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability36.js b/tests/baselines/reference/assignmentCompatability36.js index 7c939ceb282..62332f741d4 100644 --- a/tests/baselines/reference/assignmentCompatability36.js +++ b/tests/baselines/reference/assignmentCompatability36.js @@ -13,9 +13,7 @@ __test2__.__val__aa = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability37.js b/tests/baselines/reference/assignmentCompatability37.js index 5741b181151..8625cae42e5 100644 --- a/tests/baselines/reference/assignmentCompatability37.js +++ b/tests/baselines/reference/assignmentCompatability37.js @@ -13,9 +13,7 @@ __test2__.__val__aa = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability38.js b/tests/baselines/reference/assignmentCompatability38.js index 81a7692f62f..22096b68f25 100644 --- a/tests/baselines/reference/assignmentCompatability38.js +++ b/tests/baselines/reference/assignmentCompatability38.js @@ -13,9 +13,7 @@ __test2__.__val__aa = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability39.js b/tests/baselines/reference/assignmentCompatability39.js index fe2f499270a..70e8a692290 100644 --- a/tests/baselines/reference/assignmentCompatability39.js +++ b/tests/baselines/reference/assignmentCompatability39.js @@ -13,9 +13,7 @@ __test2__.__val__x2 = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability4.js b/tests/baselines/reference/assignmentCompatability4.js index 853164790ce..2f7d33b8d55 100644 --- a/tests/baselines/reference/assignmentCompatability4.js +++ b/tests/baselines/reference/assignmentCompatability4.js @@ -13,9 +13,7 @@ __test2__.__val__aa = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability40.js b/tests/baselines/reference/assignmentCompatability40.js index 26923029392..801ddfe7596 100644 --- a/tests/baselines/reference/assignmentCompatability40.js +++ b/tests/baselines/reference/assignmentCompatability40.js @@ -13,9 +13,7 @@ __test2__.__val__x5 = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability41.js b/tests/baselines/reference/assignmentCompatability41.js index 101eee5ae3c..2ebd35a6caa 100644 --- a/tests/baselines/reference/assignmentCompatability41.js +++ b/tests/baselines/reference/assignmentCompatability41.js @@ -13,9 +13,7 @@ __test2__.__val__x6 = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability42.js b/tests/baselines/reference/assignmentCompatability42.js index d819f748af4..39dab170d35 100644 --- a/tests/baselines/reference/assignmentCompatability42.js +++ b/tests/baselines/reference/assignmentCompatability42.js @@ -13,9 +13,7 @@ __test2__.__val__x7 = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability43.js b/tests/baselines/reference/assignmentCompatability43.js index 5c13de6fa53..0ff9bdb4819 100644 --- a/tests/baselines/reference/assignmentCompatability43.js +++ b/tests/baselines/reference/assignmentCompatability43.js @@ -13,19 +13,14 @@ __test2__.__val__obj2 = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); var __test2__; (function (__test2__) { ; - var obj2 = { - one: 1, - two: "a" - }; + var obj2 = { one: 1, two: "a" }; ; __test2__.__val__obj2 = obj2; })(__test2__ || (__test2__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability5.js b/tests/baselines/reference/assignmentCompatability5.js index b94a00de732..ef38b738ad3 100644 --- a/tests/baselines/reference/assignmentCompatability5.js +++ b/tests/baselines/reference/assignmentCompatability5.js @@ -13,18 +13,14 @@ __test2__.__val__obj1 = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); var __test2__; (function (__test2__) { ; - var obj1 = { - one: 1 - }; + var obj1 = { one: 1 }; ; __test2__.__val__obj1 = obj1; })(__test2__ || (__test2__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability6.js b/tests/baselines/reference/assignmentCompatability6.js index cd87bd10641..7b1e2bb65d6 100644 --- a/tests/baselines/reference/assignmentCompatability6.js +++ b/tests/baselines/reference/assignmentCompatability6.js @@ -13,9 +13,7 @@ __test2__.__val__obj3 = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability7.js b/tests/baselines/reference/assignmentCompatability7.js index a668bc34906..c6bf8e53bc1 100644 --- a/tests/baselines/reference/assignmentCompatability7.js +++ b/tests/baselines/reference/assignmentCompatability7.js @@ -13,18 +13,14 @@ __test2__.__val__obj4 = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); var __test2__; (function (__test2__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test2__.__val__obj4 = obj4; })(__test2__ || (__test2__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability8.js b/tests/baselines/reference/assignmentCompatability8.js index e022ddf7bdd..65e4240aac5 100644 --- a/tests/baselines/reference/assignmentCompatability8.js +++ b/tests/baselines/reference/assignmentCompatability8.js @@ -13,9 +13,7 @@ __test2__.__val__x1 = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability9.js b/tests/baselines/reference/assignmentCompatability9.js index cbc34de158b..98932380b3e 100644 --- a/tests/baselines/reference/assignmentCompatability9.js +++ b/tests/baselines/reference/assignmentCompatability9.js @@ -13,9 +13,7 @@ __test2__.__val__x3 = __test1__.__val__obj4 var __test1__; (function (__test1__) { ; - var obj4 = { - one: 1 - }; + var obj4 = { one: 1 }; ; __test1__.__val__obj4 = obj4; })(__test1__ || (__test1__ = {})); diff --git a/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.js b/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.js index 7346f601dac..760631ffbb5 100644 --- a/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.js +++ b/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.js @@ -35,25 +35,18 @@ fn(a => { }); var x; // Should fail x = ''; -x = [ - '' -]; +x = ['']; x = 4; x = {}; // Should work -function f() { -} +function f() { } ; x = f; -function fn(c) { -} +function fn(c) { } // Should Fail fn(''); -fn([ - '' -]); +fn(['']); fn(4); fn({}); // Should work -fn(function (a) { -}); +fn(function (a) { }); diff --git a/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.js b/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.js index 4e5ed88699c..2e61521eefb 100644 --- a/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.js +++ b/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.js @@ -35,25 +35,18 @@ fn(a => { }); var x; // Should fail x = ''; -x = [ - '' -]; +x = ['']; x = 4; x = {}; // Should work -function f() { -} +function f() { } ; x = f; -function fn(c) { -} +function fn(c) { } // Should Fail fn(''); -fn([ - '' -]); +fn(['']); fn(4); fn({}); // Should work -fn(function (a) { -}); +fn(function (a) { }); diff --git a/tests/baselines/reference/assignmentLHSIsValue.js b/tests/baselines/reference/assignmentLHSIsValue.js index e6975e70146..4b17f855171 100644 --- a/tests/baselines/reference/assignmentLHSIsValue.js +++ b/tests/baselines/reference/assignmentLHSIsValue.js @@ -84,17 +84,11 @@ var C = (function () { function C() { this = value; } - C.prototype.foo = function () { - this = value; - }; - C.sfoo = function () { - this = value; - }; + C.prototype.foo = function () { this = value; }; + C.sfoo = function () { this = value; }; return C; })(); -function foo() { - this = value; -} +function foo() { this = value; } this = value; // identifiers: module, class, enum, function var M; @@ -129,20 +123,14 @@ var Derived = (function (_super) { _super.call(this); _super.prototype. = value; } - Derived.prototype.foo = function () { - _super.prototype. = value; - }; - Derived.sfoo = function () { - _super. = value; - }; + Derived.prototype.foo = function () { _super.prototype. = value; }; + Derived.sfoo = function () { _super. = value; }; return Derived; })(C); // function expression -function bar() { -} +function bar() { } value; -(function () { -}); +(function () { }); value; // function calls foo() = value; @@ -159,6 +147,5 @@ foo() = value; (/d+/) = value; ({}) = value; ([]) = value; -(function baz() { -}) = value; +(function baz() { }) = value; (foo()) = value; diff --git a/tests/baselines/reference/assignmentStricterConstraints.js b/tests/baselines/reference/assignmentStricterConstraints.js index f8f4ce6d1b6..a7f554ade7d 100644 --- a/tests/baselines/reference/assignmentStricterConstraints.js +++ b/tests/baselines/reference/assignmentStricterConstraints.js @@ -13,7 +13,6 @@ g(1, "") var f = function (x, y) { x = y; }; -var g = function (x, y) { -}; +var g = function (x, y) { }; g = f; g(1, ""); diff --git a/tests/baselines/reference/assignmentToFunction.js b/tests/baselines/reference/assignmentToFunction.js index 275107e05b0..7462fdfcf3f 100644 --- a/tests/baselines/reference/assignmentToFunction.js +++ b/tests/baselines/reference/assignmentToFunction.js @@ -11,11 +11,8 @@ module foo { } //// [assignmentToFunction.js] -function fn() { -} -fn = function () { - return 3; -}; +function fn() { } +fn = function () { return 3; }; var foo; (function (foo) { function xyz() { diff --git a/tests/baselines/reference/assignmentToObject.js b/tests/baselines/reference/assignmentToObject.js index 666350b50ee..d8134080c6a 100644 --- a/tests/baselines/reference/assignmentToObject.js +++ b/tests/baselines/reference/assignmentToObject.js @@ -5,8 +5,6 @@ var c: Object = a; // should be error //// [assignmentToObject.js] -var a = { - toString: 5 -}; +var a = { toString: 5 }; var b = a; // ok var c = a; // should be error diff --git a/tests/baselines/reference/assignmentToObjectAndFunction.js b/tests/baselines/reference/assignmentToObjectAndFunction.js index bd09a7a8e16..a3c4785b18b 100644 --- a/tests/baselines/reference/assignmentToObjectAndFunction.js +++ b/tests/baselines/reference/assignmentToObjectAndFunction.js @@ -30,33 +30,27 @@ module bad { var badFundule: Function = bad; // error //// [assignmentToObjectAndFunction.js] -var errObj = { - toString: 0 -}; // Error, incompatible toString +var errObj = { toString: 0 }; // Error, incompatible toString var goodObj = { toString: function (x) { return ""; } }; // Ok, because toString is a subtype of Object's toString var errFun = {}; // Error for no call signature -function foo() { -} +function foo() { } var foo; (function (foo) { foo.boom = 0; })(foo || (foo = {})); var goodFundule = foo; // ok -function bar() { -} +function bar() { } var bar; (function (bar) { - function apply(thisArg, argArray) { - } + function apply(thisArg, argArray) { } bar.apply = apply; })(bar || (bar = {})); var goodFundule2 = bar; // ok -function bad() { -} +function bad() { } var bad; (function (bad) { bad.apply = 0; diff --git a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.js b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.js index 584934ea774..9526cb08bef 100644 --- a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.js +++ b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.js @@ -87,48 +87,25 @@ M.y = 3; // OK M.y = ''; // Error (M).y = ''; // Error (M.y) = ''; // Error -M = { - y: 3 -}; // Error -(M) = { - y: 3 -}; // Error +M = { y: 3 }; // Error +(M) = { y: 3 }; // Error var M2; (function (M2) { var M3; (function (M3) { M3.x; })(M3 = M2.M3 || (M2.M3 = {})); - M3 = { - x: 3 - }; // Error + M3 = { x: 3 }; // Error })(M2 || (M2 = {})); -M2.M3 = { - x: 3 -}; // OK -(M2).M3 = { - x: 3 -}; // OK -(M2.M3) = { - x: 3 -}; // OK -M2.M3 = { - x: '' -}; // Error -(M2).M3 = { - x: '' -}; // Error -(M2.M3) = { - x: '' -}; // Error -function fn() { -} -fn = function () { - return 3; -}; // Bug 823548: Should be error (fn is not a reference) -(fn) = function () { - return 3; -}; // Should be error +M2.M3 = { x: 3 }; // OK +(M2).M3 = { x: 3 }; // OK +(M2.M3) = { x: 3 }; // OK +M2.M3 = { x: '' }; // Error +(M2).M3 = { x: '' }; // Error +(M2.M3) = { x: '' }; // Error +function fn() { } +fn = function () { return 3; }; // Bug 823548: Should be error (fn is not a reference) +(fn) = function () { return 3; }; // Should be error function fn2(x, y) { x = 3; (x) = 3; // OK diff --git a/tests/baselines/reference/assignmentToReferenceTypes.js b/tests/baselines/reference/assignmentToReferenceTypes.js index 214e10b9c6c..1aec3c2051d 100644 --- a/tests/baselines/reference/assignmentToReferenceTypes.js +++ b/tests/baselines/reference/assignmentToReferenceTypes.js @@ -36,8 +36,7 @@ var E; (function (E) { })(E || (E = {})); E = null; -function f() { -} +function f() { } f = null; var x = 1; x = null; diff --git a/tests/baselines/reference/assignments.js b/tests/baselines/reference/assignments.js index f6ca508384b..e2c9c90d375 100644 --- a/tests/baselines/reference/assignments.js +++ b/tests/baselines/reference/assignments.js @@ -53,8 +53,7 @@ var E; })(E || (E = {})); E = null; // Error E.A = null; // OK per spec, Error per implementation (509581) -function fn() { -} +function fn() { } fn = null; // Should be error var v; v = null; // OK diff --git a/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.js b/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.js index 88996de1553..32fed237a2e 100644 --- a/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.js +++ b/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.js @@ -23,7 +23,6 @@ var v2: { //// [augmentedTypeAssignmentCompatIndexSignature.js] var o = {}; -var f = function () { -}; +var f = function () { }; var v1 = o; // Should be allowed var v2 = f; // Should be allowed diff --git a/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.js b/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.js index a1b6bf6805c..8d2c94899dc 100644 --- a/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.js +++ b/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.js @@ -15,5 +15,4 @@ var b = (() => { })[0]; // Should be Bar //// [augmentedTypeBracketAccessIndexSignature.js] var a = {}[0]; // Should be Foo -var b = (function () { -})[0]; // Should be Bar +var b = (function () { })[0]; // Should be Bar diff --git a/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.js b/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.js index 5bc184df667..6ec653c69b5 100644 --- a/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.js +++ b/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.js @@ -15,8 +15,7 @@ var r4 = f['data']; // Should be number //// [augmentedTypeBracketNamedPropertyAccess.js] var o = {}; -var f = function () { -}; +var f = function () { }; var r1 = o['data']; // Should be number var r2 = o['functionData']; // Should be any (no property found) var r3 = f['functionData']; // Should be string diff --git a/tests/baselines/reference/augmentedTypesClass.js b/tests/baselines/reference/augmentedTypesClass.js index 5d0d8ab75d6..30b75483d80 100644 --- a/tests/baselines/reference/augmentedTypesClass.js +++ b/tests/baselines/reference/augmentedTypesClass.js @@ -12,8 +12,7 @@ enum c4 { One } // error var c1 = (function () { function c1() { } - c1.prototype.foo = function () { - }; + c1.prototype.foo = function () { }; return c1; })(); var c1 = 1; // error @@ -21,8 +20,7 @@ var c1 = 1; // error var c4 = (function () { function c4() { } - c4.prototype.foo = function () { - }; + c4.prototype.foo = function () { }; return c4; })(); var c4; diff --git a/tests/baselines/reference/augmentedTypesClass2a.js b/tests/baselines/reference/augmentedTypesClass2a.js index fe31f0964c2..b2c6fa1e373 100644 --- a/tests/baselines/reference/augmentedTypesClass2a.js +++ b/tests/baselines/reference/augmentedTypesClass2a.js @@ -9,11 +9,8 @@ var c2 = () => { } var c2 = (function () { function c2() { } - c2.prototype.foo = function () { - }; + c2.prototype.foo = function () { }; return c2; })(); // error -function c2() { -} // error -var c2 = function () { -}; +function c2() { } // error +var c2 = function () { }; diff --git a/tests/baselines/reference/augmentedTypesClass3.js b/tests/baselines/reference/augmentedTypesClass3.js index b42d9dda356..11d3f0a0d9f 100644 --- a/tests/baselines/reference/augmentedTypesClass3.js +++ b/tests/baselines/reference/augmentedTypesClass3.js @@ -18,15 +18,13 @@ class c5c { public foo() { } } var c5 = (function () { function c5() { } - c5.prototype.foo = function () { - }; + c5.prototype.foo = function () { }; return c5; })(); var c5a = (function () { function c5a() { } - c5a.prototype.foo = function () { - }; + c5a.prototype.foo = function () { }; return c5a; })(); var c5a; @@ -36,8 +34,7 @@ var c5a; var c5b = (function () { function c5b() { } - c5b.prototype.foo = function () { - }; + c5b.prototype.foo = function () { }; return c5b; })(); var c5b; @@ -48,8 +45,7 @@ var c5b; var c5c = (function () { function c5c() { } - c5c.prototype.foo = function () { - }; + c5c.prototype.foo = function () { }; return c5c; })(); //import c5c = require(''); diff --git a/tests/baselines/reference/augmentedTypesClass4.js b/tests/baselines/reference/augmentedTypesClass4.js index 71fc61d6659..f178567d843 100644 --- a/tests/baselines/reference/augmentedTypesClass4.js +++ b/tests/baselines/reference/augmentedTypesClass4.js @@ -9,14 +9,12 @@ class c3 { public bar() { } } // error var c3 = (function () { function c3() { } - c3.prototype.foo = function () { - }; + c3.prototype.foo = function () { }; return c3; })(); // error var c3 = (function () { function c3() { } - c3.prototype.bar = function () { - }; + c3.prototype.bar = function () { }; return c3; })(); // error diff --git a/tests/baselines/reference/augmentedTypesEnum.js b/tests/baselines/reference/augmentedTypesEnum.js index 484b0addd58..cb1ec3e844f 100644 --- a/tests/baselines/reference/augmentedTypesEnum.js +++ b/tests/baselines/reference/augmentedTypesEnum.js @@ -47,14 +47,12 @@ var e2; (function (e2) { e2[e2["One"] = 0] = "One"; })(e2 || (e2 = {})); // error -function e2() { -} // error +function e2() { } // error var e3; (function (e3) { e3[e3["One"] = 0] = "One"; })(e3 || (e3 = {})); // error -var e3 = function () { -}; // error +var e3 = function () { }; // error // enum then class var e4; (function (e4) { @@ -63,8 +61,7 @@ var e4; var e4 = (function () { function e4() { } - e4.prototype.foo = function () { - }; + e4.prototype.foo = function () { }; return e4; })(); // error // enum then enum diff --git a/tests/baselines/reference/augmentedTypesExternalModule1.js b/tests/baselines/reference/augmentedTypesExternalModule1.js index 69cc810668c..104559396cc 100644 --- a/tests/baselines/reference/augmentedTypesExternalModule1.js +++ b/tests/baselines/reference/augmentedTypesExternalModule1.js @@ -9,8 +9,7 @@ define(["require", "exports"], function (require, exports) { var c5 = (function () { function c5() { } - c5.prototype.foo = function () { - }; + c5.prototype.foo = function () { }; return c5; })(); }); diff --git a/tests/baselines/reference/augmentedTypesFunction.js b/tests/baselines/reference/augmentedTypesFunction.js index 34567c77e8c..1cd1423b7c4 100644 --- a/tests/baselines/reference/augmentedTypesFunction.js +++ b/tests/baselines/reference/augmentedTypesFunction.js @@ -40,59 +40,46 @@ module y5c { export interface I { foo(): void } } // should be an error //// [augmentedTypesFunction.js] // function then var -function y1() { -} // error +function y1() { } // error var y1 = 1; // error // function then function -function y2() { -} // error -function y2() { -} // error -function y2a() { -} // error -var y2a = function () { -}; // error +function y2() { } // error +function y2() { } // error +function y2a() { } // error +var y2a = function () { }; // error // function then class -function y3() { -} // error +function y3() { } // error var y3 = (function () { function y3() { } return y3; })(); // error -function y3a() { -} // error +function y3a() { } // error var y3a = (function () { function y3a() { } - y3a.prototype.foo = function () { - }; + y3a.prototype.foo = function () { }; return y3a; })(); // error // function then enum -function y4() { -} // error +function y4() { } // error var y4; (function (y4) { y4[y4["One"] = 0] = "One"; })(y4 || (y4 = {})); // error // function then internal module -function y5() { -} -function y5a() { -} +function y5() { } +function y5a() { } var y5a; (function (y5a) { var y = 2; })(y5a || (y5a = {})); // should be an error -function y5b() { -} +function y5b() { } var y5b; (function (y5b) { y5b.y = 3; })(y5b || (y5b = {})); // should be an error -function y5c() { -} +function y5c() { } // function then import, messes with other errors //function y6() { } //import y6 = require(''); diff --git a/tests/baselines/reference/augmentedTypesModules.js b/tests/baselines/reference/augmentedTypesModules.js index 3b7544996a1..558ea6609f5 100644 --- a/tests/baselines/reference/augmentedTypesModules.js +++ b/tests/baselines/reference/augmentedTypesModules.js @@ -115,51 +115,43 @@ var m1d; var I = (function () { function I() { } - I.prototype.foo = function () { - }; + I.prototype.foo = function () { }; return I; })(); m1d.I = I; })(m1d || (m1d = {})); var m1d = 1; // error -function m2() { -} +function m2() { } ; // ok since the module is not instantiated var m2a; (function (m2a) { var y = 2; })(m2a || (m2a = {})); -function m2a() { -} +function m2a() { } ; // error since the module is instantiated var m2b; (function (m2b) { m2b.y = 2; })(m2b || (m2b = {})); -function m2b() { -} +function m2b() { } ; // error since the module is instantiated // should be errors to have function first -function m2c() { -} +function m2c() { } ; var m2c; (function (m2c) { m2c.y = 2; })(m2c || (m2c = {})); -function m2f() { -} +function m2f() { } ; -function m2g() { -} +function m2g() { } ; var m2g; (function (m2g) { var C = (function () { function C() { } - C.prototype.foo = function () { - }; + C.prototype.foo = function () { }; return C; })(); m2g.C = C; @@ -176,15 +168,13 @@ var m3a; var m3a = (function () { function m3a() { } - m3a.prototype.foo = function () { - }; + m3a.prototype.foo = function () { }; return m3a; })(); // error, class isn't ambient or declared before the module var m3b = (function () { function m3b() { } - m3b.prototype.foo = function () { - }; + m3b.prototype.foo = function () { }; return m3b; })(); var m3b; @@ -194,8 +184,7 @@ var m3b; var m3c = (function () { function m3c() { } - m3c.prototype.foo = function () { - }; + m3c.prototype.foo = function () { }; return m3c; })(); var m3c; @@ -215,8 +204,7 @@ var m3g; var C = (function () { function C() { } - C.prototype.foo = function () { - }; + C.prototype.foo = function () { }; return C; })(); m3g.C = C; @@ -249,8 +237,7 @@ var m4d; var C = (function () { function C() { } - C.prototype.foo = function () { - }; + C.prototype.foo = function () { }; return C; })(); })(m4d || (m4d = {})); diff --git a/tests/baselines/reference/augmentedTypesModules2.js b/tests/baselines/reference/augmentedTypesModules2.js index 70fd31f03e0..5cc805a848f 100644 --- a/tests/baselines/reference/augmentedTypesModules2.js +++ b/tests/baselines/reference/augmentedTypesModules2.js @@ -29,25 +29,21 @@ module m2g { export class C { foo() { } } } //// [augmentedTypesModules2.js] -function m2() { -} +function m2() { } ; // ok since the module is not instantiated var m2a; (function (m2a) { var y = 2; })(m2a || (m2a = {})); -function m2a() { -} +function m2a() { } ; // error since the module is instantiated var m2b; (function (m2b) { m2b.y = 2; })(m2b || (m2b = {})); -function m2b() { -} +function m2b() { } ; // error since the module is instantiated -function m2c() { -} +function m2c() { } ; var m2c; (function (m2c) { @@ -57,22 +53,18 @@ var m2cc; (function (m2cc) { m2cc.y = 2; })(m2cc || (m2cc = {})); -function m2cc() { -} +function m2cc() { } ; // error to have module first -function m2f() { -} +function m2f() { } ; -function m2g() { -} +function m2g() { } ; var m2g; (function (m2g) { var C = (function () { function C() { } - C.prototype.foo = function () { - }; + C.prototype.foo = function () { }; return C; })(); m2g.C = C; diff --git a/tests/baselines/reference/augmentedTypesModules3.js b/tests/baselines/reference/augmentedTypesModules3.js index 7f5c390ea3a..fb1c7ef6e70 100644 --- a/tests/baselines/reference/augmentedTypesModules3.js +++ b/tests/baselines/reference/augmentedTypesModules3.js @@ -19,7 +19,6 @@ var m3a; var m3a = (function () { function m3a() { } - m3a.prototype.foo = function () { - }; + m3a.prototype.foo = function () { }; return m3a; })(); // error, class isn't ambient or declared before the module diff --git a/tests/baselines/reference/augmentedTypesModules3b.js b/tests/baselines/reference/augmentedTypesModules3b.js index 2d250ab2822..080a5e72ada 100644 --- a/tests/baselines/reference/augmentedTypesModules3b.js +++ b/tests/baselines/reference/augmentedTypesModules3b.js @@ -22,8 +22,7 @@ module m3g { export class C { foo() { } } } var m3b = (function () { function m3b() { } - m3b.prototype.foo = function () { - }; + m3b.prototype.foo = function () { }; return m3b; })(); var m3b; @@ -33,8 +32,7 @@ var m3b; var m3c = (function () { function m3c() { } - m3c.prototype.foo = function () { - }; + m3c.prototype.foo = function () { }; return m3c; })(); var m3c; @@ -54,8 +52,7 @@ var m3g; var C = (function () { function C() { } - C.prototype.foo = function () { - }; + C.prototype.foo = function () { }; return C; })(); m3g.C = C; diff --git a/tests/baselines/reference/augmentedTypesModules4.js b/tests/baselines/reference/augmentedTypesModules4.js index f8407e2e36f..82f08851efd 100644 --- a/tests/baselines/reference/augmentedTypesModules4.js +++ b/tests/baselines/reference/augmentedTypesModules4.js @@ -51,8 +51,7 @@ var m4d; var C = (function () { function C() { } - C.prototype.foo = function () { - }; + C.prototype.foo = function () { }; return C; })(); })(m4d || (m4d = {})); diff --git a/tests/baselines/reference/augmentedTypesVar.js b/tests/baselines/reference/augmentedTypesVar.js index f4404cecb3d..b4e412acc05 100644 --- a/tests/baselines/reference/augmentedTypesVar.js +++ b/tests/baselines/reference/augmentedTypesVar.js @@ -42,11 +42,9 @@ var x1 = 1; var x1 = 2; // var then function var x2 = 1; // error -function x2() { -} // error +function x2() { } // error var x3 = 1; -var x3 = function () { -}; // error +var x3 = function () { }; // error // var then class var x4 = 1; // error var x4 = (function () { @@ -58,8 +56,7 @@ var x4a = 1; // error var x4a = (function () { function x4a() { } - x4a.prototype.foo = function () { - }; + x4a.prototype.foo = function () { }; return x4a; })(); // error // var then enum diff --git a/tests/baselines/reference/autoLift2.js b/tests/baselines/reference/autoLift2.js index 45790dc2f6e..cf840277d70 100644 --- a/tests/baselines/reference/autoLift2.js +++ b/tests/baselines/reference/autoLift2.js @@ -43,18 +43,8 @@ var A = (function () { var _this = this; this.foo = "foo"; this.bar = "bar"; - [ - 1, - 2 - ].forEach(function (p) { - return _this.foo; - }); - [ - 1, - 2 - ].forEach(function (p) { - return _this.bar; - }); + [1, 2].forEach(function (p) { return _this.foo; }); + [1, 2].forEach(function (p) { return _this.bar; }); }; return A; })(); diff --git a/tests/baselines/reference/autolift3.js b/tests/baselines/reference/autolift3.js index cc3bcaaae97..e04501daf46 100644 --- a/tests/baselines/reference/autolift3.js +++ b/tests/baselines/reference/autolift3.js @@ -33,8 +33,7 @@ b.foo(); //// [autolift3.js] var B = (function () { function B() { - function foo() { - } + function foo() { } foo(); var a = 0; var inner = (function () { diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js index 69fe778c047..49bc535dbfe 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js @@ -63,15 +63,9 @@ var r = true ? 1 : 2; var r3 = true ? 1 : {}; var r4 = true ? a : b; // typeof a var r5 = true ? b : a; // typeof b -var r6 = true ? function (x) { -} : function (x) { -}; // returns number => void -var r7 = true ? function (x) { -} : function (x) { -}; -var r8 = true ? function (x) { -} : function (x) { -}; // returns Object => void +var r6 = true ? function (x) { } : function (x) { }; // returns number => void +var r7 = true ? function (x) { } : function (x) { }; +var r8 = true ? function (x) { } : function (x) { }; // returns Object => void var r10 = true ? derived : derived2; // no error since we use the contextual type in BCT var r11 = true ? base : derived2; function foo5(t, u) { diff --git a/tests/baselines/reference/bestCommonTypeOfTuple.js b/tests/baselines/reference/bestCommonTypeOfTuple.js index d5cbe7e67c8..81cfa752f5d 100644 --- a/tests/baselines/reference/bestCommonTypeOfTuple.js +++ b/tests/baselines/reference/bestCommonTypeOfTuple.js @@ -26,15 +26,9 @@ var e3 = t3[2]; // any var e4 = t4[3]; // number //// [bestCommonTypeOfTuple.js] -function f1(x) { - return "foo"; -} -function f2(x) { - return 10; -} -function f3(x) { - return true; -} +function f1(x) { return "foo"; } +function f2(x) { return 10; } +function f3(x) { return true; } var E1; (function (E1) { E1[E1["one"] = 0] = "one"; @@ -48,23 +42,10 @@ var t2; var t3; var t4; // no error -t1 = [ - f1, - f2 -]; -t2 = [ - E1.one, - E2.two -]; -t3 = [ - 5, - undefined -]; -t4 = [ - E1.one, - E2.two, - 20 -]; +t1 = [f1, f2]; +t2 = [E1.one, E2.two]; +t3 = [5, undefined]; +t4 = [E1.one, E2.two, 20]; var e1 = t1[2]; // {} var e2 = t2[2]; // {} var e3 = t3[2]; // any diff --git a/tests/baselines/reference/bestCommonTypeReturnStatement.js b/tests/baselines/reference/bestCommonTypeReturnStatement.js index 232ffc07c54..f4ab98ed1c6 100644 --- a/tests/baselines/reference/bestCommonTypeReturnStatement.js +++ b/tests/baselines/reference/bestCommonTypeReturnStatement.js @@ -18,9 +18,5 @@ function f() { return b(); return d(); } -function b() { - return null; -} -function d() { - return null; -} +function b() { return null; } +function d() { return null; } diff --git a/tests/baselines/reference/bestCommonTypeWithContextualTyping.js b/tests/baselines/reference/bestCommonTypeWithContextualTyping.js index afe18e3f282..c45ae88458f 100644 --- a/tests/baselines/reference/bestCommonTypeWithContextualTyping.js +++ b/tests/baselines/reference/bestCommonTypeWithContextualTyping.js @@ -25,11 +25,7 @@ var e; // All of these should pass. Neither type is a supertype of the other, but the RHS should // always use Ellement in these examples (not Contextual). Because Ellement is assignable // to Contextual, no errors. -var arr = [ - e -]; // Ellement[] -var obj = { - s: e -}; // { s: Ellement; [s: string]: Ellement } +var arr = [e]; // Ellement[] +var obj = { s: e }; // { s: Ellement; [s: string]: Ellement } var conditional = null ? e : e; // Ellement var contextualOr = e || e; // Ellement diff --git a/tests/baselines/reference/bestCommonTypeWithOptionalProperties.js b/tests/baselines/reference/bestCommonTypeWithOptionalProperties.js index 6a8741097aa..25622c3d4f3 100644 --- a/tests/baselines/reference/bestCommonTypeWithOptionalProperties.js +++ b/tests/baselines/reference/bestCommonTypeWithOptionalProperties.js @@ -20,33 +20,9 @@ var x; var y; var z; // All these arrays should be X[] -var b1 = [ - x, - y, - z -]; -var b2 = [ - x, - z, - y -]; -var b3 = [ - y, - x, - z -]; -var b4 = [ - y, - z, - x -]; -var b5 = [ - z, - x, - y -]; -var b6 = [ - z, - y, - x -]; +var b1 = [x, y, z]; +var b2 = [x, z, y]; +var b3 = [y, x, z]; +var b4 = [y, z, x]; +var b5 = [z, x, y]; +var b6 = [z, y, x]; diff --git a/tests/baselines/reference/bitwiseNotOperatorInvalidOperations.js b/tests/baselines/reference/bitwiseNotOperatorInvalidOperations.js index b730569bd6a..1b64091c048 100644 --- a/tests/baselines/reference/bitwiseNotOperatorInvalidOperations.js +++ b/tests/baselines/reference/bitwiseNotOperatorInvalidOperations.js @@ -18,11 +18,7 @@ var q; var a = q; ~; //expect error // multiple operands after ~ -var mul = ~[ - 1, - 2, - "abc" -]; +var mul = ~[1, 2, "abc"]; ""; //expect error // miss an operand var b = ~; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.js b/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.js index a73d851668e..3ee3f28ad9e 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.js +++ b/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.js @@ -66,16 +66,9 @@ var ResultIsNumber20 = ~~~(ANY + ANY1); // ~ operator on any type var ANY; var ANY1; -var ANY2 = [ - "", - "" -]; +var ANY2 = ["", ""]; var obj; -var obj1 = { - x: "", - y: function () { - } -}; +var obj1 = { x: "", y: function () { } }; function foo() { var a; return a; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.js b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.js index 1b2c93307d8..fb573a7523f 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.js +++ b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.js @@ -41,15 +41,11 @@ var ResultIsNumber8 = ~~BOOLEAN; //// [bitwiseNotOperatorWithBooleanType.js] // ~ operator on boolean type var BOOLEAN; -function foo() { - return true; -} +function foo() { return true; } var A = (function () { function A() { } - A.foo = function () { - return false; - }; + A.foo = function () { return false; }; return A; })(); var M; @@ -61,10 +57,7 @@ var objA = new A(); var ResultIsNumber1 = ~BOOLEAN; // boolean type literal var ResultIsNumber2 = ~true; -var ResultIsNumber3 = ~{ - x: true, - y: false -}; +var ResultIsNumber3 = ~{ x: true, y: false }; // boolean type expressions var ResultIsNumber4 = ~objA.a; var ResultIsNumber5 = ~M.n; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.js b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.js index ac274bf8c18..ac439f02903 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.js +++ b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.js @@ -47,19 +47,12 @@ var ResultIsNumber13 = ~~~(NUMBER + NUMBER); //// [bitwiseNotOperatorWithNumberType.js] // ~ operator on number type var NUMBER; -var NUMBER1 = [ - 1, - 2 -]; -function foo() { - return 1; -} +var NUMBER1 = [1, 2]; +function foo() { return 1; } var A = (function () { function A() { } - A.foo = function () { - return 1; - }; + A.foo = function () { return 1; }; return A; })(); var M; @@ -72,16 +65,8 @@ var ResultIsNumber1 = ~NUMBER; var ResultIsNumber2 = ~NUMBER1; // number type literal var ResultIsNumber3 = ~1; -var ResultIsNumber4 = ~{ - x: 1, - y: 2 -}; -var ResultIsNumber5 = ~{ - x: 1, - y: function (n) { - return n; - } -}; +var ResultIsNumber4 = ~{ x: 1, y: 2 }; +var ResultIsNumber5 = ~{ x: 1, y: function (n) { return n; } }; // number type expressions var ResultIsNumber6 = ~objA.a; var ResultIsNumber7 = ~M.n; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithStringType.js b/tests/baselines/reference/bitwiseNotOperatorWithStringType.js index f13cf39bd6f..a553712e16b 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithStringType.js +++ b/tests/baselines/reference/bitwiseNotOperatorWithStringType.js @@ -46,19 +46,12 @@ var ResultIsNumber14 = ~~~(STRING + STRING); //// [bitwiseNotOperatorWithStringType.js] // ~ operator on string type var STRING; -var STRING1 = [ - "", - "abc" -]; -function foo() { - return "abc"; -} +var STRING1 = ["", "abc"]; +function foo() { return "abc"; } var A = (function () { function A() { } - A.foo = function () { - return ""; - }; + A.foo = function () { return ""; }; return A; })(); var M; @@ -71,16 +64,8 @@ var ResultIsNumber1 = ~STRING; var ResultIsNumber2 = ~STRING1; // string type literal var ResultIsNumber3 = ~""; -var ResultIsNumber4 = ~{ - x: "", - y: "" -}; -var ResultIsNumber5 = ~{ - x: "", - y: function (s) { - return s; - } -}; +var ResultIsNumber4 = ~{ x: "", y: "" }; +var ResultIsNumber5 = ~{ x: "", y: function (s) { return s; } }; // string type expressions var ResultIsNumber6 = ~objA.a; var ResultIsNumber7 = ~M.n; diff --git a/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.js b/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.js index 59bfabd21d6..f1028956e16 100644 --- a/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.js +++ b/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.js @@ -47,14 +47,10 @@ var r7b = i2.f(1, ''); //// [callGenericFunctionWithIncorrectNumberOfTypeArguments.js] // type parameter lists must exactly match type argument lists // all of these invocations are errors -function f(x, y) { - return null; -} +function f(x, y) { return null; } var r1 = f(1, ''); var r1b = f(1, ''); -var f2 = function (x, y) { - return null; -}; +var f2 = function (x, y) { return null; }; var r2 = f2(1, ''); var r2b = f2(1, ''); var f3; diff --git a/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.js b/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.js index 04edc93f5d9..26b9d33a55d 100644 --- a/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.js +++ b/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.js @@ -38,13 +38,9 @@ var r7 = i2.f(1); //// [callGenericFunctionWithZeroTypeArguments.js] // valid invocations of generic functions with no explicit type arguments provided -function f(x) { - return null; -} +function f(x) { return null; } var r = f(1); -var f2 = function (x) { - return null; -}; +var f2 = function (x) { return null; }; var r2 = f2(1); var f3; var r3 = f3(1); diff --git a/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.js b/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.js index 306b4c70362..7b0355533e3 100644 --- a/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.js +++ b/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.js @@ -46,13 +46,9 @@ var r8 = a2(); //// [callNonGenericFunctionWithTypeArguments.js] // it is always illegal to provide type arguments to a non-generic function // all invocations here are illegal -function f(x) { - return null; -} +function f(x) { return null; } var r = f(1); -var f2 = function (x) { - return null; -}; +var f2 = function (x) { return null; }; var r2 = f2(1); var f3; var r3 = f3(1); diff --git a/tests/baselines/reference/callOverloads1.js b/tests/baselines/reference/callOverloads1.js index 86cb951f853..b1148c12420 100644 --- a/tests/baselines/reference/callOverloads1.js +++ b/tests/baselines/reference/callOverloads1.js @@ -22,13 +22,10 @@ var Foo = (function () { function Foo(x) { // WScript.Echo("Constructor function has executed"); } - Foo.prototype.bar1 = function () { - }; + Foo.prototype.bar1 = function () { }; return Foo; })(); -function F1(a) { - return a; -} +function F1(a) { return a; } var f1 = new Foo("hey"); f1.bar1(); Foo(); diff --git a/tests/baselines/reference/callOverloads2.js b/tests/baselines/reference/callOverloads2.js index e3cbceb177a..b336911eeb0 100644 --- a/tests/baselines/reference/callOverloads2.js +++ b/tests/baselines/reference/callOverloads2.js @@ -30,16 +30,11 @@ var Foo = (function () { function Foo(x) { // WScript.Echo("Constructor function has executed"); } - Foo.prototype.bar1 = function () { - }; + Foo.prototype.bar1 = function () { }; return Foo; })(); -function F1(s) { - return s; -} // error -function F1(a) { - return a; -} // error +function F1(s) { return s; } // error +function F1(a) { return a; } // error var f1 = new Foo("hey"); f1.bar1(); Foo(); diff --git a/tests/baselines/reference/callOverloads3.js b/tests/baselines/reference/callOverloads3.js index 85c16fe85a6..3b615438ccd 100644 --- a/tests/baselines/reference/callOverloads3.js +++ b/tests/baselines/reference/callOverloads3.js @@ -23,8 +23,7 @@ var Foo = (function () { function Foo(x) { // WScript.Echo("Constructor function has executed"); } - Foo.prototype.bar1 = function () { - }; + Foo.prototype.bar1 = function () { }; return Foo; })(); //class Foo(s: String); diff --git a/tests/baselines/reference/callOverloads4.js b/tests/baselines/reference/callOverloads4.js index 6aab555b721..529b63ad3b8 100644 --- a/tests/baselines/reference/callOverloads4.js +++ b/tests/baselines/reference/callOverloads4.js @@ -23,8 +23,7 @@ var Foo = (function () { function Foo(x) { // WScript.Echo("Constructor function has executed"); } - Foo.prototype.bar1 = function () { - }; + Foo.prototype.bar1 = function () { }; return Foo; })(); var f1 = new Foo("hey"); diff --git a/tests/baselines/reference/callOverloads5.js b/tests/baselines/reference/callOverloads5.js index 2220568e4c2..dc508b3b8ed 100644 --- a/tests/baselines/reference/callOverloads5.js +++ b/tests/baselines/reference/callOverloads5.js @@ -24,8 +24,7 @@ var Foo = (function () { function Foo(x) { // WScript.Echo("Constructor function has executed"); } - Foo.prototype.bar1 = function (a) { - }; + Foo.prototype.bar1 = function (a) { }; return Foo; })(); //class Foo(s: String); diff --git a/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.js b/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.js index 6daa62f83a8..24c71c98505 100644 --- a/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.js +++ b/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.js @@ -21,8 +21,7 @@ var r5 = a.f(); //// [callSignatureWithoutAnnotationsOrBody.js] // Call signatures without a return type annotation and function body return 'any' -function foo(x) { -} +function foo(x) { } var r = foo(1); // void since there's a body var i; var r2 = i(); diff --git a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.js b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.js index f37d4c06861..0e78aac2b1b 100644 --- a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.js +++ b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.js @@ -165,9 +165,7 @@ function foo7(x) { var r7 = foo7(1); // object types function foo8(x) { - return { - x: x - }; + return { x: x }; } var r8 = foo8(1); function foo9(x) { @@ -204,9 +202,7 @@ function foo12() { return i2; } var r12 = foo12(); -function m1() { - return 1; -} +function m1() { return 1; } var m1; (function (m1) { m1.y = 2; diff --git a/tests/baselines/reference/callSignaturesWithAccessibilityModifiersOnParameters.js b/tests/baselines/reference/callSignaturesWithAccessibilityModifiersOnParameters.js index 22b312e2570..5584dd7b216 100644 --- a/tests/baselines/reference/callSignaturesWithAccessibilityModifiersOnParameters.js +++ b/tests/baselines/reference/callSignaturesWithAccessibilityModifiersOnParameters.js @@ -40,43 +40,27 @@ var b = { //// [callSignaturesWithAccessibilityModifiersOnParameters.js] // Call signature parameters do not allow accessibility modifiers -function foo(x, y) { -} -var f = function foo(x, y) { -}; -var f2 = function (x, y) { -}; -var f3 = function (x, y) { -}; -var f4 = function (x, y) { -}; -function foo2(x, y) { -} -var f5 = function foo(x, y) { -}; -var f6 = function (x, y) { -}; -var f7 = function (x, y) { -}; -var f8 = function (x, y) { -}; +function foo(x, y) { } +var f = function foo(x, y) { }; +var f2 = function (x, y) { }; +var f3 = function (x, y) { }; +var f4 = function (x, y) { }; +function foo2(x, y) { } +var f5 = function foo(x, y) { }; +var f6 = function (x, y) { }; +var f7 = function (x, y) { }; +var f8 = function (x, y) { }; var C = (function () { function C() { } - C.prototype.foo = function (x, y) { - }; - C.prototype.foo2 = function (x, y) { - }; - C.prototype.foo3 = function (x, y) { - }; + C.prototype.foo = function (x, y) { }; + C.prototype.foo2 = function (x, y) { }; + C.prototype.foo3 = function (x, y) { }; return C; })(); var a; var b = { - foo: function (x, y) { - }, - a: function foo(x, y) { - }, - b: function (x, y) { - } + foo: function (x, y) { }, + a: function foo(x, y) { }, + b: function (x, y) { } }; diff --git a/tests/baselines/reference/callSignaturesWithDuplicateParameters.js b/tests/baselines/reference/callSignaturesWithDuplicateParameters.js index 49e20266dad..6ed7f6f7fe5 100644 --- a/tests/baselines/reference/callSignaturesWithDuplicateParameters.js +++ b/tests/baselines/reference/callSignaturesWithDuplicateParameters.js @@ -40,43 +40,27 @@ var b = { //// [callSignaturesWithDuplicateParameters.js] // Duplicate parameter names are always an error -function foo(x, x) { -} -var f = function foo(x, x) { -}; -var f2 = function (x, x) { -}; -var f3 = function (x, x) { -}; -var f4 = function (x, x) { -}; -function foo2(x, x) { -} -var f5 = function foo(x, x) { -}; -var f6 = function (x, x) { -}; -var f7 = function (x, x) { -}; -var f8 = function (x, y) { -}; +function foo(x, x) { } +var f = function foo(x, x) { }; +var f2 = function (x, x) { }; +var f3 = function (x, x) { }; +var f4 = function (x, x) { }; +function foo2(x, x) { } +var f5 = function foo(x, x) { }; +var f6 = function (x, x) { }; +var f7 = function (x, x) { }; +var f8 = function (x, y) { }; var C = (function () { function C() { } - C.prototype.foo = function (x, x) { - }; - C.prototype.foo2 = function (x, x) { - }; - C.prototype.foo3 = function (x, x) { - }; + C.prototype.foo = function (x, x) { }; + C.prototype.foo2 = function (x, x) { }; + C.prototype.foo3 = function (x, x) { }; return C; })(); var a; var b = { - foo: function (x, x) { - }, - a: function foo(x, x) { - }, - b: function (x, x) { - } + foo: function (x, x) { }, + a: function foo(x, x) { }, + b: function (x, x) { } }; diff --git a/tests/baselines/reference/callSignaturesWithOptionalParameters.js b/tests/baselines/reference/callSignaturesWithOptionalParameters.js index fa2126fb6c5..2f4876fb2de 100644 --- a/tests/baselines/reference/callSignaturesWithOptionalParameters.js +++ b/tests/baselines/reference/callSignaturesWithOptionalParameters.js @@ -57,12 +57,9 @@ b.b(1); //// [callSignaturesWithOptionalParameters.js] // Optional parameters should be valid in all the below casts -function foo(x) { -} -var f = function foo(x) { -}; -var f2 = function (x, y) { -}; +function foo(x) { } +var f = function foo(x) { }; +var f2 = function (x, y) { }; foo(1); foo(); f(1); @@ -72,8 +69,7 @@ f2(1, 2); var C = (function () { function C() { } - C.prototype.foo = function (x) { - }; + C.prototype.foo = function (x) { }; return C; })(); var c; @@ -90,12 +86,9 @@ a(1); a.foo(); a.foo(1); var b = { - foo: function (x) { - }, - a: function foo(x, y) { - }, - b: function (x) { - } + foo: function (x) { }, + a: function foo(x, y) { }, + b: function (x) { } }; b.foo(); b.foo(1); diff --git a/tests/baselines/reference/callSignaturesWithOptionalParameters2.js b/tests/baselines/reference/callSignaturesWithOptionalParameters2.js index 95ecb3a0e9c..a3fb2fe7a85 100644 --- a/tests/baselines/reference/callSignaturesWithOptionalParameters2.js +++ b/tests/baselines/reference/callSignaturesWithOptionalParameters2.js @@ -61,21 +61,17 @@ a.foo(1, 2, 3); //// [callSignaturesWithOptionalParameters2.js] // Optional parameters should be valid in all the below casts -function foo(x) { -} +function foo(x) { } foo(1); foo(); -function foo2(x, y) { -} +function foo2(x, y) { } foo2(1); foo2(1, 2); var C = (function () { function C() { } - C.prototype.foo = function (x) { - }; - C.prototype.foo2 = function (x, y) { - }; + C.prototype.foo = function (x) { }; + C.prototype.foo2 = function (x, y) { }; return C; })(); var c; diff --git a/tests/baselines/reference/callWithSpread.js b/tests/baselines/reference/callWithSpread.js index 4cb52f41d3c..d676c0f2a33 100644 --- a/tests/baselines/reference/callWithSpread.js +++ b/tests/baselines/reference/callWithSpread.js @@ -82,11 +82,7 @@ obj.foo.apply(obj, [1, 2].concat(a, ["abc"])); xa[1].foo(1, 2, "abc"); (_a = xa[1]).foo.apply(_a, [1, 2].concat(a)); (_b = xa[1]).foo.apply(_b, [1, 2].concat(a, ["abc"])); -(_c = xa[1]).foo.apply(_c, [ - 1, - 2, - "abc" -]); +(_c = xa[1]).foo.apply(_c, [1, 2, "abc"]); var C = (function () { function C(x, y) { var z = []; diff --git a/tests/baselines/reference/callWithSpreadES6.js b/tests/baselines/reference/callWithSpreadES6.js index d1589d7f6fa..d6a915f5f36 100644 --- a/tests/baselines/reference/callWithSpreadES6.js +++ b/tests/baselines/reference/callWithSpreadES6.js @@ -73,11 +73,7 @@ obj.foo(1, 2, ...a, "abc"); xa[1].foo(1, 2, "abc"); xa[1].foo(1, 2, ...a); xa[1].foo(1, 2, ...a, "abc"); -xa[1].foo(...[ - 1, - 2, - "abc" -]); +xa[1].foo(...[1, 2, "abc"]); class C { constructor(x, y, ...z) { this.foo(x, y); diff --git a/tests/baselines/reference/callWithWrongNumberOfTypeArguments.js b/tests/baselines/reference/callWithWrongNumberOfTypeArguments.js index f7bc46a7724..74ea401ae3b 100644 --- a/tests/baselines/reference/callWithWrongNumberOfTypeArguments.js +++ b/tests/baselines/reference/callWithWrongNumberOfTypeArguments.js @@ -6,8 +6,7 @@ f(); f(); //// [callWithWrongNumberOfTypeArguments.js] -function f() { -} +function f() { } f(); f(); f(); diff --git a/tests/baselines/reference/callbacksDontShareTypes.js b/tests/baselines/reference/callbacksDontShareTypes.js index 649ed1cb6ca..e6483638058 100644 --- a/tests/baselines/reference/callbacksDontShareTypes.js +++ b/tests/baselines/reference/callbacksDontShareTypes.js @@ -21,14 +21,8 @@ var r5b = _.map(c2, rf1); //// [callbacksDontShareTypes.js] var _; var c2; -var rf1 = function (x) { - return x.toFixed(); -}; -var r1a = _.map(c2, function (x) { - return x.toFixed(); -}); +var rf1 = function (x) { return x.toFixed(); }; +var r1a = _.map(c2, function (x) { return x.toFixed(); }); var r1b = _.map(c2, rf1); // this line should not cause the following 2 to have errors -var r5a = _.map(c2, function (x) { - return x.toFixed(); -}); +var r5a = _.map(c2, function (x) { return x.toFixed(); }); var r5b = _.map(c2, rf1); diff --git a/tests/baselines/reference/captureThisInSuperCall.js b/tests/baselines/reference/captureThisInSuperCall.js index cbb41afea3b..7200fabd8c4 100644 --- a/tests/baselines/reference/captureThisInSuperCall.js +++ b/tests/baselines/reference/captureThisInSuperCall.js @@ -24,13 +24,8 @@ var B = (function (_super) { __extends(B, _super); function B() { var _this = this; - _super.call(this, { - test: function () { - return _this.someMethod(); - } - }); + _super.call(this, { test: function () { return _this.someMethod(); } }); } - B.prototype.someMethod = function () { - }; + B.prototype.someMethod = function () { }; return B; })(A); diff --git a/tests/baselines/reference/castExpressionParentheses.js b/tests/baselines/reference/castExpressionParentheses.js index c217b5e7b2f..ec18d6e373e 100644 --- a/tests/baselines/reference/castExpressionParentheses.js +++ b/tests/baselines/reference/castExpressionParentheses.js @@ -42,13 +42,8 @@ new (A()); //// [castExpressionParentheses.js] // parentheses should be omitted // literals -{ - a: 0 -}; -[ - 1, - 3, -]; +{ a: 0 }; +[1, 3,]; "string"; 23.0; /regexp/g; @@ -68,10 +63,8 @@ a().x; (typeof A).x; (-A).x; new (A()); -(function () { -})(); -(function foo() { -})(); +(function () { })(); +(function foo() { })(); (-A).x; // nested cast, should keep one pair of parenthese (-A).x; diff --git a/tests/baselines/reference/castTest.js b/tests/baselines/reference/castTest.js index 5afa67026b9..ef9ef084d98 100644 --- a/tests/baselines/reference/castTest.js +++ b/tests/baselines/reference/castTest.js @@ -47,7 +47,5 @@ var p_cast = ({ add: function (dx, dy) { return new Point(this.x + dx, this.y + dy); }, - mult: function (p) { - return p; - } + mult: function (p) { return p; } }); diff --git a/tests/baselines/reference/castingTuple.js b/tests/baselines/reference/castingTuple.js index e615590ea7d..2c41d81cd6a 100644 --- a/tests/baselines/reference/castingTuple.js +++ b/tests/baselines/reference/castingTuple.js @@ -82,39 +82,20 @@ var E2; E2[E2["one"] = 0] = "one"; })(E2 || (E2 = {})); // no error -var numStrTuple = [ - 5, - "foo" -]; +var numStrTuple = [5, "foo"]; var emptyObjTuple = numStrTuple; var numStrBoolTuple = numStrTuple; -var classCDTuple = [ - new C(), - new D() -]; +var classCDTuple = [new C(), new D()]; var interfaceIITuple = classCDTuple; var classCDATuple = classCDTuple; var eleFromCDA1 = classCDATuple[2]; // A var eleFromCDA2 = classCDATuple[5]; // C | D | A -var t10 = [ - E1.one, - E2.one -]; +var t10 = [E1.one, E2.one]; var t11 = t10; var array1 = emptyObjTuple; -var unionTuple = [ - new C(), - "foo" -]; -var unionTuple2 = [ - new C(), - "foo", - new D() -]; -var unionTuple3 = [ - 10, - "foo" -]; +var unionTuple = [new C(), "foo"]; +var unionTuple2 = [new C(), "foo", new D()]; +var unionTuple3 = [10, "foo"]; var unionTuple4 = unionTuple3; // error var t3 = numStrTuple; diff --git a/tests/baselines/reference/catch.js b/tests/baselines/reference/catch.js index c6b13cf4d68..d3babf1f31d 100644 --- a/tests/baselines/reference/catch.js +++ b/tests/baselines/reference/catch.js @@ -7,12 +7,8 @@ function f() { //// [catch.js] function f() { - try { - } - catch (e) { - } - try { - } - catch (e) { - } + try { } + catch (e) { } + try { } + catch (e) { } } diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js index 3795994c64c..70456b9e9d1 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js @@ -55,12 +55,4 @@ var C = (function (_super) { return C; })(B); // Ok to go down the chain, but error to try to climb back up -(new Chain(new A)).then(function (a) { - return new B; -}).then(function (b) { - return new C; -}).then(function (c) { - return new B; -}).then(function (b) { - return new A; -}); +(new Chain(new A)).then(function (a) { return new B; }).then(function (b) { return new C; }).then(function (c) { return new B; }).then(function (b) { return new A; }); diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.js b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.js index dbf55d4ec30..3b9b8b80ecf 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.js +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.js @@ -50,30 +50,12 @@ var Chain = (function () { var t; var s; // Ok to go down the chain, but error to climb up the chain - (new Chain(t)).then(function (tt) { - return s; - }).then(function (ss) { - return t; - }); + (new Chain(t)).then(function (tt) { return s; }).then(function (ss) { return t; }); // But error to try to climb up the chain - (new Chain(s)).then(function (ss) { - return t; - }); + (new Chain(s)).then(function (ss) { return t; }); // Staying at T or S should be fine - (new Chain(t)).then(function (tt) { - return t; - }).then(function (tt) { - return t; - }).then(function (tt) { - return t; - }); - (new Chain(s)).then(function (ss) { - return s; - }).then(function (ss) { - return s; - }).then(function (ss) { - return s; - }); + (new Chain(t)).then(function (tt) { return t; }).then(function (tt) { return t; }).then(function (tt) { return t; }); + (new Chain(s)).then(function (ss) { return s; }).then(function (ss) { return s; }).then(function (ss) { return s; }); return null; }; return Chain; @@ -88,31 +70,11 @@ var Chain2 = (function () { var s; // Ok to go down the chain, check the constraint at the end. // Should get an error that we are assigning a string to a number - (new Chain2(i)).then(function (ii) { - return t; - }).then(function (tt) { - return s; - }).value.x = ""; + (new Chain2(i)).then(function (ii) { return t; }).then(function (tt) { return s; }).value.x = ""; // Staying at T or S should keep the constraint. // Get an error when we assign a string to a number in both cases - (new Chain2(i)).then(function (ii) { - return t; - }).then(function (tt) { - return t; - }).then(function (tt) { - return t; - }).then(function (tt) { - return t; - }).value.x = ""; - (new Chain2(i)).then(function (ii) { - return s; - }).then(function (ss) { - return s; - }).then(function (ss) { - return s; - }).then(function (ss) { - return s; - }).value.x = ""; + (new Chain2(i)).then(function (ii) { return t; }).then(function (tt) { return t; }).then(function (tt) { return t; }).then(function (tt) { return t; }).value.x = ""; + (new Chain2(i)).then(function (ii) { return s; }).then(function (ss) { return s; }).then(function (ss) { return s; }).then(function (ss) { return s; }).value.x = ""; return null; }; return Chain2; diff --git a/tests/baselines/reference/chainedImportAlias.js b/tests/baselines/reference/chainedImportAlias.js index f2b3c6c6cff..077a92d7450 100644 --- a/tests/baselines/reference/chainedImportAlias.js +++ b/tests/baselines/reference/chainedImportAlias.js @@ -14,8 +14,7 @@ y.m.foo(); //// [chainedImportAlias_file0.js] var m; (function (m) { - function foo() { - } + function foo() { } m.foo = foo; })(m = exports.m || (exports.m = {})); //// [chainedImportAlias_file1.js] diff --git a/tests/baselines/reference/chainedSpecializationToObjectTypeLiteral.js b/tests/baselines/reference/chainedSpecializationToObjectTypeLiteral.js index e10a41d9fbf..1884967aa9e 100644 --- a/tests/baselines/reference/chainedSpecializationToObjectTypeLiteral.js +++ b/tests/baselines/reference/chainedSpecializationToObjectTypeLiteral.js @@ -13,9 +13,5 @@ var s3 = s2.each(x => { x.key /* Type is K, should be number */ }); //// [chainedSpecializationToObjectTypeLiteral.js] var s; -var s2 = s.groupBy(function (s) { - return s.length; -}); -var s3 = s2.each(function (x) { - x.key; /* Type is K, should be number */ -}); +var s2 = s.groupBy(function (s) { return s.length; }); +var s3 = s2.each(function (x) { x.key; /* Type is K, should be number */ }); diff --git a/tests/baselines/reference/circularImportAlias.types b/tests/baselines/reference/circularImportAlias.types index ab8de414e30..b61f91d460e 100644 --- a/tests/baselines/reference/circularImportAlias.types +++ b/tests/baselines/reference/circularImportAlias.types @@ -10,7 +10,7 @@ module B { export class D extends a.C { >D : D ->a : unknown +>a : typeof a >C : a.C id: number; diff --git a/tests/baselines/reference/classBodyWithStatements.js b/tests/baselines/reference/classBodyWithStatements.js index bae4860f722..2324fe0d791 100644 --- a/tests/baselines/reference/classBodyWithStatements.js +++ b/tests/baselines/reference/classBodyWithStatements.js @@ -25,8 +25,7 @@ var C2 = (function () { } return C2; })(); -function foo() { -} +function foo() { } var x = 1; var y = 2; var C3 = (function () { diff --git a/tests/baselines/reference/classDeclarationBlockScoping1.errors.txt b/tests/baselines/reference/classDeclarationBlockScoping1.errors.txt new file mode 100644 index 00000000000..4f15007bb2a --- /dev/null +++ b/tests/baselines/reference/classDeclarationBlockScoping1.errors.txt @@ -0,0 +1,13 @@ +tests/cases/compiler/classDeclarationBlockScoping1.ts(5,11): error TS9004: 'class' declarations are only supported directly inside a module or as a top level declaration. + + +==== tests/cases/compiler/classDeclarationBlockScoping1.ts (1 errors) ==== + class C { + } + + { + class C { + ~ +!!! error TS9004: 'class' declarations are only supported directly inside a module or as a top level declaration. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/classDeclarationBlockScoping1.js b/tests/baselines/reference/classDeclarationBlockScoping1.js new file mode 100644 index 00000000000..717c2f788c3 --- /dev/null +++ b/tests/baselines/reference/classDeclarationBlockScoping1.js @@ -0,0 +1,22 @@ +//// [classDeclarationBlockScoping1.ts] +class C { +} + +{ + class C { + } +} + +//// [classDeclarationBlockScoping1.js] +var C = (function () { + function C() { + } + return C; +})(); +{ + var C = (function () { + function C() { + } + return C; + })(); +} diff --git a/tests/baselines/reference/classDeclarationBlockScoping2.errors.txt b/tests/baselines/reference/classDeclarationBlockScoping2.errors.txt new file mode 100644 index 00000000000..2a9885e110b --- /dev/null +++ b/tests/baselines/reference/classDeclarationBlockScoping2.errors.txt @@ -0,0 +1,18 @@ +tests/cases/compiler/classDeclarationBlockScoping2.ts(2,11): error TS9004: 'class' declarations are only supported directly inside a module or as a top level declaration. +tests/cases/compiler/classDeclarationBlockScoping2.ts(5,15): error TS9004: 'class' declarations are only supported directly inside a module or as a top level declaration. + + +==== tests/cases/compiler/classDeclarationBlockScoping2.ts (2 errors) ==== + function f() { + class C {} + ~ +!!! error TS9004: 'class' declarations are only supported directly inside a module or as a top level declaration. + var c1 = C; + { + class C {} + ~ +!!! error TS9004: 'class' declarations are only supported directly inside a module or as a top level declaration. + var c2 = C; + } + return C === c1; + } \ No newline at end of file diff --git a/tests/baselines/reference/classDeclarationBlockScoping2.js b/tests/baselines/reference/classDeclarationBlockScoping2.js new file mode 100644 index 00000000000..9e468077119 --- /dev/null +++ b/tests/baselines/reference/classDeclarationBlockScoping2.js @@ -0,0 +1,29 @@ +//// [classDeclarationBlockScoping2.ts] +function f() { + class C {} + var c1 = C; + { + class C {} + var c2 = C; + } + return C === c1; +} + +//// [classDeclarationBlockScoping2.js] +function f() { + var C = (function () { + function C() { + } + return C; + })(); + var c1 = C; + { + var C = (function () { + function C() { + } + return C; + })(); + var c2 = C; + } + return C === c1; +} diff --git a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.types b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.types index b39d65c3d65..623515a7ec0 100644 --- a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.types +++ b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.types @@ -18,7 +18,7 @@ module M { export class O extends M.N { >O : O ->M : unknown +>M : typeof M >N : N } } diff --git a/tests/baselines/reference/classExpression.errors.txt b/tests/baselines/reference/classExpression.errors.txt index f5028814acc..c8266d0e879 100644 --- a/tests/baselines/reference/classExpression.errors.txt +++ b/tests/baselines/reference/classExpression.errors.txt @@ -1,36 +1,24 @@ -tests/cases/conformance/classes/classExpression.ts(1,9): error TS1109: Expression expected. -tests/cases/conformance/classes/classExpression.ts(5,10): error TS1109: Expression expected. -tests/cases/conformance/classes/classExpression.ts(5,16): error TS1005: ':' expected. -tests/cases/conformance/classes/classExpression.ts(5,16): error TS2304: Cannot find name 'C2'. -tests/cases/conformance/classes/classExpression.ts(5,19): error TS1005: ',' expected. -tests/cases/conformance/classes/classExpression.ts(7,1): error TS1128: Declaration or statement expected. -tests/cases/conformance/classes/classExpression.ts(10,13): error TS1109: Expression expected. +tests/cases/conformance/classes/classExpression.ts(1,15): error TS9003: 'class' expressions are not currently supported. +tests/cases/conformance/classes/classExpression.ts(5,16): error TS9003: 'class' expressions are not currently supported. +tests/cases/conformance/classes/classExpression.ts(10,19): error TS9003: 'class' expressions are not currently supported. -==== tests/cases/conformance/classes/classExpression.ts (7 errors) ==== +==== tests/cases/conformance/classes/classExpression.ts (3 errors) ==== var x = class C { - ~~~~~ -!!! error TS1109: Expression expected. + ~ +!!! error TS9003: 'class' expressions are not currently supported. } var y = { foo: class C2 { - ~~~~~ -!!! error TS1109: Expression expected. ~~ -!!! error TS1005: ':' expected. - ~~ -!!! error TS2304: Cannot find name 'C2'. - ~ -!!! error TS1005: ',' expected. +!!! error TS9003: 'class' expressions are not currently supported. } } - ~ -!!! error TS1128: Declaration or statement expected. module M { var z = class C4 { - ~~~~~ -!!! error TS1109: Expression expected. + ~~ +!!! error TS9003: 'class' expressions are not currently supported. } } \ No newline at end of file diff --git a/tests/baselines/reference/classExpression.js b/tests/baselines/reference/classExpression.js index 9d902abbf52..8f3270d13e7 100644 --- a/tests/baselines/reference/classExpression.js +++ b/tests/baselines/reference/classExpression.js @@ -13,20 +13,21 @@ module M { } //// [classExpression.js] -var x = ; -var C = (function () { +var x = (function () { function C() { } return C; })(); var y = { - foo: , - class: C2 -}, _a = void 0; + foo: (function () { + function C2() { + } + return C2; + })() +}; var M; (function (M) { - var z = ; - var C4 = (function () { + var z = (function () { function C4() { } return C4; diff --git a/tests/baselines/reference/classExpression1.errors.txt b/tests/baselines/reference/classExpression1.errors.txt new file mode 100644 index 00000000000..9d7d14d8571 --- /dev/null +++ b/tests/baselines/reference/classExpression1.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/classes/classExpressions/classExpression1.ts(1,15): error TS9003: 'class' expressions are not currently supported. + + +==== tests/cases/conformance/classes/classExpressions/classExpression1.ts (1 errors) ==== + var v = class C {}; + ~ +!!! error TS9003: 'class' expressions are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/classExpression1.js b/tests/baselines/reference/classExpression1.js new file mode 100644 index 00000000000..68c7bc5e1e7 --- /dev/null +++ b/tests/baselines/reference/classExpression1.js @@ -0,0 +1,9 @@ +//// [classExpression1.ts] +var v = class C {}; + +//// [classExpression1.js] +var v = (function () { + function C() { + } + return C; +})(); diff --git a/tests/baselines/reference/classExpression2.errors.txt b/tests/baselines/reference/classExpression2.errors.txt new file mode 100644 index 00000000000..e2f3ccd77cd --- /dev/null +++ b/tests/baselines/reference/classExpression2.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/classes/classExpressions/classExpression2.ts(2,15): error TS9003: 'class' expressions are not currently supported. + + +==== tests/cases/conformance/classes/classExpressions/classExpression2.ts (1 errors) ==== + class D { } + var v = class C extends D {}; + ~ +!!! error TS9003: 'class' expressions are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/classExpression2.js b/tests/baselines/reference/classExpression2.js new file mode 100644 index 00000000000..4220b88fb11 --- /dev/null +++ b/tests/baselines/reference/classExpression2.js @@ -0,0 +1,17 @@ +//// [classExpression2.ts] +class D { } +var v = class C extends D {}; + +//// [classExpression2.js] +var D = (function () { + function D() { + } + return D; +})(); +var v = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + return C; +})(D); diff --git a/tests/baselines/reference/classExpressionES61.errors.txt b/tests/baselines/reference/classExpressionES61.errors.txt new file mode 100644 index 00000000000..abaa5ab893c --- /dev/null +++ b/tests/baselines/reference/classExpressionES61.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/classExpressions/classExpressionES61.ts(1,15): error TS9003: 'class' expressions are not currently supported. + + +==== tests/cases/conformance/es6/classExpressions/classExpressionES61.ts (1 errors) ==== + var v = class C {}; + ~ +!!! error TS9003: 'class' expressions are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionES61.js b/tests/baselines/reference/classExpressionES61.js new file mode 100644 index 00000000000..afef0909039 --- /dev/null +++ b/tests/baselines/reference/classExpressionES61.js @@ -0,0 +1,7 @@ +//// [classExpressionES61.ts] +var v = class C {}; + +//// [classExpressionES61.js] +var v = class C { +} +; diff --git a/tests/baselines/reference/classExpressionES62.errors.txt b/tests/baselines/reference/classExpressionES62.errors.txt new file mode 100644 index 00000000000..1e28367a17e --- /dev/null +++ b/tests/baselines/reference/classExpressionES62.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/es6/classExpressions/classExpressionES62.ts(2,15): error TS9003: 'class' expressions are not currently supported. + + +==== tests/cases/conformance/es6/classExpressions/classExpressionES62.ts (1 errors) ==== + class D { } + var v = class C extends D {}; + ~ +!!! error TS9003: 'class' expressions are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionES62.js b/tests/baselines/reference/classExpressionES62.js new file mode 100644 index 00000000000..79cede7300d --- /dev/null +++ b/tests/baselines/reference/classExpressionES62.js @@ -0,0 +1,10 @@ +//// [classExpressionES62.ts] +class D { } +var v = class C extends D {}; + +//// [classExpressionES62.js] +class D { +} +var v = class C extends D { +} +; diff --git a/tests/baselines/reference/classExpressionTest1.errors.txt b/tests/baselines/reference/classExpressionTest1.errors.txt new file mode 100644 index 00000000000..4d7e1cda639 --- /dev/null +++ b/tests/baselines/reference/classExpressionTest1.errors.txt @@ -0,0 +1,18 @@ +tests/cases/compiler/classExpressionTest1.ts(2,11): error TS9004: 'class' declarations are only supported directly inside a module or as a top level declaration. + + +==== tests/cases/compiler/classExpressionTest1.ts (1 errors) ==== + function M() { + class C { + ~ +!!! error TS9004: 'class' declarations are only supported directly inside a module or as a top level declaration. + f() { + var t: T; + var x: X; + return { t, x }; + } + } + + var v = new C(); + return v.f(); + } \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionTest1.js b/tests/baselines/reference/classExpressionTest1.js new file mode 100644 index 00000000000..e91cdebb8c1 --- /dev/null +++ b/tests/baselines/reference/classExpressionTest1.js @@ -0,0 +1,29 @@ +//// [classExpressionTest1.ts] +function M() { + class C { + f() { + var t: T; + var x: X; + return { t, x }; + } + } + + var v = new C(); + return v.f(); +} + +//// [classExpressionTest1.js] +function M() { + var C = (function () { + function C() { + } + C.prototype.f = function () { + var t; + var x; + return { t: t, x: x }; + }; + return C; + })(); + var v = new C(); + return v.f(); +} diff --git a/tests/baselines/reference/classExpressionTest2.errors.txt b/tests/baselines/reference/classExpressionTest2.errors.txt new file mode 100644 index 00000000000..424eb590611 --- /dev/null +++ b/tests/baselines/reference/classExpressionTest2.errors.txt @@ -0,0 +1,21 @@ +tests/cases/compiler/classExpressionTest2.ts(2,19): error TS9003: 'class' expressions are not currently supported. +tests/cases/compiler/classExpressionTest2.ts(5,20): error TS2304: Cannot find name 'X'. + + +==== tests/cases/compiler/classExpressionTest2.ts (2 errors) ==== + function M() { + var m = class C { + ~ +!!! error TS9003: 'class' expressions are not currently supported. + f() { + var t: T; + var x: X; + ~ +!!! error TS2304: Cannot find name 'X'. + return { t, x }; + } + } + + var v = new m(); + return v.f(); + } \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionTest2.js b/tests/baselines/reference/classExpressionTest2.js new file mode 100644 index 00000000000..ebb5c1e21b6 --- /dev/null +++ b/tests/baselines/reference/classExpressionTest2.js @@ -0,0 +1,29 @@ +//// [classExpressionTest2.ts] +function M() { + var m = class C { + f() { + var t: T; + var x: X; + return { t, x }; + } + } + + var v = new m(); + return v.f(); +} + +//// [classExpressionTest2.js] +function M() { + var m = (function () { + function C() { + } + C.prototype.f = function () { + var t; + var x; + return { t: t, x: x }; + }; + return C; + })(); + var v = new m(); + return v.f(); +} diff --git a/tests/baselines/reference/classExpressionWithDecorator1.errors.txt b/tests/baselines/reference/classExpressionWithDecorator1.errors.txt new file mode 100644 index 00000000000..10f0d8aa376 --- /dev/null +++ b/tests/baselines/reference/classExpressionWithDecorator1.errors.txt @@ -0,0 +1,10 @@ +tests/cases/compiler/classExpressionWithDecorator1.ts(1,9): error TS1109: Expression expected. +tests/cases/compiler/classExpressionWithDecorator1.ts(1,10): error TS2304: Cannot find name 'decorate'. + + +==== tests/cases/compiler/classExpressionWithDecorator1.ts (2 errors) ==== + var v = @decorate class C { static p = 1 }; + ~ +!!! error TS1109: Expression expected. + ~~~~~~~~ +!!! error TS2304: Cannot find name 'decorate'. \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionWithDecorator1.js b/tests/baselines/reference/classExpressionWithDecorator1.js new file mode 100644 index 00000000000..3e255398904 --- /dev/null +++ b/tests/baselines/reference/classExpressionWithDecorator1.js @@ -0,0 +1,22 @@ +//// [classExpressionWithDecorator1.ts] +var v = @decorate class C { static p = 1 }; + +//// [classExpressionWithDecorator1.js] +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +var v = ; +var C = (function () { + function C() { + } + C.p = 1; + C = __decorate([ + decorate + ], C); + return C; +})(); +; diff --git a/tests/baselines/reference/classExpressionWithStaticProperties1.errors.txt b/tests/baselines/reference/classExpressionWithStaticProperties1.errors.txt new file mode 100644 index 00000000000..28e42dd33f1 --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticProperties1.errors.txt @@ -0,0 +1,7 @@ +tests/cases/compiler/classExpressionWithStaticProperties1.ts(1,15): error TS9003: 'class' expressions are not currently supported. + + +==== tests/cases/compiler/classExpressionWithStaticProperties1.ts (1 errors) ==== + var v = class C { static a = 1; static b = 2 }; + ~ +!!! error TS9003: 'class' expressions are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionWithStaticProperties1.js b/tests/baselines/reference/classExpressionWithStaticProperties1.js new file mode 100644 index 00000000000..344dbff50ed --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticProperties1.js @@ -0,0 +1,11 @@ +//// [classExpressionWithStaticProperties1.ts] +var v = class C { static a = 1; static b = 2 }; + +//// [classExpressionWithStaticProperties1.js] +var v = (function () { + function C() { + } + C.a = 1; + C.b = 2; + return C; +})(); diff --git a/tests/baselines/reference/classExpressionWithStaticProperties2.errors.txt b/tests/baselines/reference/classExpressionWithStaticProperties2.errors.txt new file mode 100644 index 00000000000..9a915f70193 --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticProperties2.errors.txt @@ -0,0 +1,7 @@ +tests/cases/compiler/classExpressionWithStaticProperties2.ts(1,15): error TS9003: 'class' expressions are not currently supported. + + +==== tests/cases/compiler/classExpressionWithStaticProperties2.ts (1 errors) ==== + var v = class C { static a = 1; static b }; + ~ +!!! error TS9003: 'class' expressions are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionWithStaticProperties2.js b/tests/baselines/reference/classExpressionWithStaticProperties2.js new file mode 100644 index 00000000000..9ff9c06ffe4 --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticProperties2.js @@ -0,0 +1,10 @@ +//// [classExpressionWithStaticProperties2.ts] +var v = class C { static a = 1; static b }; + +//// [classExpressionWithStaticProperties2.js] +var v = (function () { + function C() { + } + C.a = 1; + return C; +})(); diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES61.errors.txt b/tests/baselines/reference/classExpressionWithStaticPropertiesES61.errors.txt new file mode 100644 index 00000000000..bc015a3d8f0 --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticPropertiesES61.errors.txt @@ -0,0 +1,7 @@ +tests/cases/compiler/classExpressionWithStaticPropertiesES61.ts(1,15): error TS9003: 'class' expressions are not currently supported. + + +==== tests/cases/compiler/classExpressionWithStaticPropertiesES61.ts (1 errors) ==== + var v = class C { static a = 1; static b = 2 }; + ~ +!!! error TS9003: 'class' expressions are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES61.js b/tests/baselines/reference/classExpressionWithStaticPropertiesES61.js new file mode 100644 index 00000000000..43f5e7415c4 --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticPropertiesES61.js @@ -0,0 +1,10 @@ +//// [classExpressionWithStaticPropertiesES61.ts] +var v = class C { static a = 1; static b = 2 }; + +//// [classExpressionWithStaticPropertiesES61.js] +var v = (_a = class C { + }, + _a.a = 1, + _a.b = 2, + _a); +var _a; diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES62.errors.txt b/tests/baselines/reference/classExpressionWithStaticPropertiesES62.errors.txt new file mode 100644 index 00000000000..bed4b2c01aa --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticPropertiesES62.errors.txt @@ -0,0 +1,7 @@ +tests/cases/compiler/classExpressionWithStaticPropertiesES62.ts(1,15): error TS9003: 'class' expressions are not currently supported. + + +==== tests/cases/compiler/classExpressionWithStaticPropertiesES62.ts (1 errors) ==== + var v = class C { static a = 1; static b }; + ~ +!!! error TS9003: 'class' expressions are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES62.js b/tests/baselines/reference/classExpressionWithStaticPropertiesES62.js new file mode 100644 index 00000000000..1efa56ecaa2 --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticPropertiesES62.js @@ -0,0 +1,9 @@ +//// [classExpressionWithStaticPropertiesES62.ts] +var v = class C { static a = 1; static b }; + +//// [classExpressionWithStaticPropertiesES62.js] +var v = (_a = class C { + }, + _a.a = 1, + _a); +var _a; diff --git a/tests/baselines/reference/classExtendingClass.js b/tests/baselines/reference/classExtendingClass.js index 6c7d9fe679b..130bf5818ee 100644 --- a/tests/baselines/reference/classExtendingClass.js +++ b/tests/baselines/reference/classExtendingClass.js @@ -41,10 +41,8 @@ var __extends = this.__extends || function (d, b) { var C = (function () { function C() { } - C.prototype.thing = function () { - }; - C.other = function () { - }; + C.prototype.thing = function () { }; + C.other = function () { }; return C; })(); var D = (function (_super) { @@ -62,10 +60,8 @@ var r4 = D.other(); var C2 = (function () { function C2() { } - C2.prototype.thing = function (x) { - }; - C2.other = function (x) { - }; + C2.prototype.thing = function (x) { }; + C2.other = function (x) { }; return C2; })(); var D2 = (function (_super) { diff --git a/tests/baselines/reference/classExtendingPrimitive.errors.txt b/tests/baselines/reference/classExtendingPrimitive.errors.txt index d46439eba1c..ae039640e99 100644 --- a/tests/baselines/reference/classExtendingPrimitive.errors.txt +++ b/tests/baselines/reference/classExtendingPrimitive.errors.txt @@ -2,16 +2,15 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(4,18): error TS2304: Cannot find name 'string'. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(5,18): error TS2304: Cannot find name 'boolean'. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(6,18): error TS2304: Cannot find name 'Void'. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(7,19): error TS1133: Type reference expected. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(7,19): error TS1109: Expression expected. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(8,18): error TS2304: Cannot find name 'Null'. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(9,19): error TS1133: Type reference expected. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(9,24): error TS1005: ';' expected. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(9,19): error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(10,18): error TS2304: Cannot find name 'undefined'. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(11,18): error TS2304: Cannot find name 'Undefined'. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(14,18): error TS2311: A class may only extend another class. -==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts (11 errors) ==== +==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts (10 errors) ==== // classes cannot extend primitives class C extends number { } @@ -28,15 +27,13 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla !!! error TS2304: Cannot find name 'Void'. class C4a extends void {} ~~~~ -!!! error TS1133: Type reference expected. +!!! error TS1109: Expression expected. class C5 extends Null { } ~~~~ !!! error TS2304: Cannot find name 'Null'. class C5a extends null { } ~~~~ -!!! error TS1133: Type reference expected. - ~ -!!! error TS1005: ';' expected. +!!! error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. class C6 extends undefined { } ~~~~~~~~~ !!! error TS2304: Cannot find name 'undefined'. diff --git a/tests/baselines/reference/classExtendingPrimitive.js b/tests/baselines/reference/classExtendingPrimitive.js index b69bc3403f4..45e92dde5f8 100644 --- a/tests/baselines/reference/classExtendingPrimitive.js +++ b/tests/baselines/reference/classExtendingPrimitive.js @@ -63,14 +63,13 @@ var C5 = (function (_super) { } return C5; })(Null); -var C5a = (function () { +var C5a = (function (_super) { + __extends(C5a, _super); function C5a() { + _super.apply(this, arguments); } return C5a; -})(); -null; -{ -} +})(null); var C6 = (function (_super) { __extends(C6, _super); function C6() { diff --git a/tests/baselines/reference/classExtendingPrimitive2.errors.txt b/tests/baselines/reference/classExtendingPrimitive2.errors.txt index cc7da5de821..3bba9b9e041 100644 --- a/tests/baselines/reference/classExtendingPrimitive2.errors.txt +++ b/tests/baselines/reference/classExtendingPrimitive2.errors.txt @@ -1,16 +1,13 @@ -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts(3,19): error TS1133: Type reference expected. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts(4,19): error TS1133: Type reference expected. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts(4,24): error TS1005: ';' expected. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts(3,19): error TS1109: Expression expected. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts(4,19): error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. -==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts (3 errors) ==== +==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts (2 errors) ==== // classes cannot extend primitives class C4a extends void {} ~~~~ -!!! error TS1133: Type reference expected. +!!! error TS1109: Expression expected. class C5a extends null { } ~~~~ -!!! error TS1133: Type reference expected. - ~ -!!! error TS1005: ';' expected. \ No newline at end of file +!!! error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendingPrimitive2.js b/tests/baselines/reference/classExtendingPrimitive2.js index 9a507934455..4ac6b14121a 100644 --- a/tests/baselines/reference/classExtendingPrimitive2.js +++ b/tests/baselines/reference/classExtendingPrimitive2.js @@ -6,17 +6,22 @@ class C5a extends null { } //// [classExtendingPrimitive2.js] // classes cannot extend primitives +var __extends = this.__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 C4a = (function () { function C4a() { } return C4a; })(); void {}; -var C5a = (function () { +var C5a = (function (_super) { + __extends(C5a, _super); function C5a() { + _super.apply(this, arguments); } return C5a; -})(); -null; -{ -} +})(null); diff --git a/tests/baselines/reference/classExtendingQualifiedName2.types b/tests/baselines/reference/classExtendingQualifiedName2.types index 7706f6bada9..ba96058d9b2 100644 --- a/tests/baselines/reference/classExtendingQualifiedName2.types +++ b/tests/baselines/reference/classExtendingQualifiedName2.types @@ -8,7 +8,7 @@ module M { class D extends M.C { >D : D ->M : unknown +>M : typeof M >C : C } } diff --git a/tests/baselines/reference/classExtendsEveryObjectType.errors.txt b/tests/baselines/reference/classExtendsEveryObjectType.errors.txt index f1870d71391..75eced53139 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType.errors.txt +++ b/tests/baselines/reference/classExtendsEveryObjectType.errors.txt @@ -1,12 +1,13 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(4,17): error TS2311: A class may only extend another class. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(6,18): error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(6,31): error TS1005: ',' expected. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(8,18): error TS2304: Cannot find name 'x'. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(11,18): error TS2304: Cannot find name 'M'. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(14,18): error TS2304: Cannot find name 'foo'. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(16,18): error TS1133: Type reference expected. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(16,20): error TS1005: ';' expected. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(16,18): error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. -==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts (6 errors) ==== +==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts (7 errors) ==== interface I { foo: string; } @@ -15,6 +16,10 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla !!! error TS2311: A class may only extend another class. class C2 extends { foo: string; } { } // error + ~~~~~~~~~~~~~~~~ +!!! error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. + ~ +!!! error TS1005: ',' expected. var x: { foo: string; } class C3 extends x { } // error ~ @@ -31,7 +36,5 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla !!! error TS2304: Cannot find name 'foo'. class C6 extends []{ } // error - ~ -!!! error TS1133: Type reference expected. - ~ -!!! error TS1005: ';' expected. \ No newline at end of file + ~~ +!!! error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsEveryObjectType.js b/tests/baselines/reference/classExtendsEveryObjectType.js index 2adb974bb28..30966fedafc 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType.js +++ b/tests/baselines/reference/classExtendsEveryObjectType.js @@ -30,13 +30,13 @@ var C = (function (_super) { } return C; })(I); // error -var C2 = (function () { +var C2 = (function (_super) { + __extends(C2, _super); function C2() { + _super.apply(this, arguments); } return C2; -})(); -{ -} // error +})({ foo: string }); // error var x; var C3 = (function (_super) { __extends(C3, _super); @@ -56,8 +56,7 @@ var C4 = (function (_super) { } return C4; })(M); // error -function foo() { -} +function foo() { } var C5 = (function (_super) { __extends(C5, _super); function C5() { @@ -65,11 +64,10 @@ var C5 = (function (_super) { } return C5; })(foo); // error -var C6 = (function () { +var C6 = (function (_super) { + __extends(C6, _super); function C6() { + _super.apply(this, arguments); } return C6; -})(); -[]; -{ -} // error +})([]); // error diff --git a/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt b/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt index ce5d8aed7a9..45a63030d00 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt +++ b/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt @@ -1,12 +1,15 @@ -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(3,18): error TS1133: Type reference expected. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(3,20): error TS1005: ';' expected. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(1,18): error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(1,31): error TS1005: ',' expected. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(3,18): error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. -==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts (2 errors) ==== +==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts (3 errors) ==== class C2 extends { foo: string; } { } // error + ~~~~~~~~~~~~~~~~ +!!! error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. + ~ +!!! error TS1005: ',' expected. class C6 extends []{ } // error - ~ -!!! error TS1133: Type reference expected. - ~ -!!! error TS1005: ';' expected. \ No newline at end of file + ~~ +!!! error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsEveryObjectType2.js b/tests/baselines/reference/classExtendsEveryObjectType2.js index f2bcb02fee4..37c0861f5ec 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType2.js +++ b/tests/baselines/reference/classExtendsEveryObjectType2.js @@ -4,18 +4,23 @@ class C2 extends { foo: string; } { } // error class C6 extends []{ } // error //// [classExtendsEveryObjectType2.js] -var C2 = (function () { +var __extends = this.__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 C2 = (function (_super) { + __extends(C2, _super); function C2() { + _super.apply(this, arguments); } return C2; -})(); -{ -} // error -var C6 = (function () { +})({ foo: string }); // error +var C6 = (function (_super) { + __extends(C6, _super); function C6() { + _super.apply(this, arguments); } return C6; -})(); -[]; -{ -} // error +})([]); // error diff --git a/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.js b/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.js index ed6e3138b07..907b6bd6fd2 100644 --- a/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.js +++ b/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.js @@ -19,20 +19,14 @@ var C = (function () { function C() { this.x = 1; } - C.prototype.foo = function (x) { - return x; - }; + C.prototype.foo = function (x) { return x; }; return C; })(); var D2 = (function () { function D2() { this.x = 3; } - D2.prototype.foo = function (x) { - return x; - }; - D2.prototype.other = function (x) { - return x; - }; + D2.prototype.foo = function (x) { return x; }; + D2.prototype.other = function (x) { return x; }; return D2; })(); diff --git a/tests/baselines/reference/classExtendsValidConstructorFunction.js b/tests/baselines/reference/classExtendsValidConstructorFunction.js index a0876e8f709..c2f0f17e534 100644 --- a/tests/baselines/reference/classExtendsValidConstructorFunction.js +++ b/tests/baselines/reference/classExtendsValidConstructorFunction.js @@ -12,8 +12,7 @@ var __extends = this.__extends || function (d, b) { __.prototype = b.prototype; d.prototype = new __(); }; -function foo() { -} +function foo() { } var x = new foo(); // can be used as a constructor function var C = (function (_super) { __extends(C, _super); diff --git a/tests/baselines/reference/classImplementsClass2.js b/tests/baselines/reference/classImplementsClass2.js index 98554944bc9..bc4f6b6748c 100644 --- a/tests/baselines/reference/classImplementsClass2.js +++ b/tests/baselines/reference/classImplementsClass2.js @@ -23,9 +23,7 @@ var __extends = this.__extends || function (d, b) { var A = (function () { function A() { } - A.prototype.foo = function () { - return 1; - }; + A.prototype.foo = function () { return 1; }; return A; })(); var C = (function () { diff --git a/tests/baselines/reference/classImplementsClass3.js b/tests/baselines/reference/classImplementsClass3.js index 9dbfc4388e9..450263d00c9 100644 --- a/tests/baselines/reference/classImplementsClass3.js +++ b/tests/baselines/reference/classImplementsClass3.js @@ -24,9 +24,7 @@ var __extends = this.__extends || function (d, b) { var A = (function () { function A() { } - A.prototype.foo = function () { - return 1; - }; + A.prototype.foo = function () { return 1; }; return A; })(); var C = (function () { diff --git a/tests/baselines/reference/classImplementsClass4.js b/tests/baselines/reference/classImplementsClass4.js index 0e08e508fb5..ac5c899bbbf 100644 --- a/tests/baselines/reference/classImplementsClass4.js +++ b/tests/baselines/reference/classImplementsClass4.js @@ -27,9 +27,7 @@ var A = (function () { function A() { this.x = 1; } - A.prototype.foo = function () { - return 1; - }; + A.prototype.foo = function () { return 1; }; return A; })(); var C = (function () { diff --git a/tests/baselines/reference/classImplementsClass5.js b/tests/baselines/reference/classImplementsClass5.js index 46e826683e7..a0971904cc3 100644 --- a/tests/baselines/reference/classImplementsClass5.js +++ b/tests/baselines/reference/classImplementsClass5.js @@ -28,9 +28,7 @@ var A = (function () { function A() { this.x = 1; } - A.prototype.foo = function () { - return 1; - }; + A.prototype.foo = function () { return 1; }; return A; })(); var C = (function () { diff --git a/tests/baselines/reference/classImplementsClass6.js b/tests/baselines/reference/classImplementsClass6.js index 386cd6685ae..931218e2bea 100644 --- a/tests/baselines/reference/classImplementsClass6.js +++ b/tests/baselines/reference/classImplementsClass6.js @@ -34,9 +34,7 @@ var A = (function () { A.bar = function () { return ""; }; - A.prototype.foo = function () { - return 1; - }; + A.prototype.foo = function () { return 1; }; return A; })(); var C = (function () { diff --git a/tests/baselines/reference/classImplementsImportedInterface.js b/tests/baselines/reference/classImplementsImportedInterface.js index c76a026b58a..a2af2083a2a 100644 --- a/tests/baselines/reference/classImplementsImportedInterface.js +++ b/tests/baselines/reference/classImplementsImportedInterface.js @@ -18,8 +18,7 @@ var M2; var C = (function () { function C() { } - C.prototype.foo = function () { - }; + C.prototype.foo = function () { }; return C; })(); })(M2 || (M2 = {})); diff --git a/tests/baselines/reference/classInsideBlock.errors.txt b/tests/baselines/reference/classInsideBlock.errors.txt new file mode 100644 index 00000000000..369e77735e2 --- /dev/null +++ b/tests/baselines/reference/classInsideBlock.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/classes/classDeclarations/classInsideBlock.ts(2,11): error TS9004: 'class' declarations are only supported directly inside a module or as a top level declaration. + + +==== tests/cases/conformance/classes/classDeclarations/classInsideBlock.ts (1 errors) ==== + function foo() { + class C { } + ~ +!!! error TS9004: 'class' declarations are only supported directly inside a module or as a top level declaration. + } \ No newline at end of file diff --git a/tests/baselines/reference/classInsideBlock.js b/tests/baselines/reference/classInsideBlock.js new file mode 100644 index 00000000000..55b3b0bbead --- /dev/null +++ b/tests/baselines/reference/classInsideBlock.js @@ -0,0 +1,13 @@ +//// [classInsideBlock.ts] +function foo() { + class C { } +} + +//// [classInsideBlock.js] +function foo() { + var C = (function () { + function C() { + } + return C; + })(); +} diff --git a/tests/baselines/reference/classMethodWithKeywordName1.js b/tests/baselines/reference/classMethodWithKeywordName1.js index 9b6b7595f04..ba5bb72632a 100644 --- a/tests/baselines/reference/classMethodWithKeywordName1.js +++ b/tests/baselines/reference/classMethodWithKeywordName1.js @@ -7,7 +7,6 @@ class C { var C = (function () { function C() { } - C.try = function () { - }; + C.try = function () { }; return C; })(); diff --git a/tests/baselines/reference/classOrder2.js b/tests/baselines/reference/classOrder2.js index 179be456028..4bc1c3f790c 100644 --- a/tests/baselines/reference/classOrder2.js +++ b/tests/baselines/reference/classOrder2.js @@ -31,16 +31,13 @@ var A = (function (_super) { function A() { _super.apply(this, arguments); } - A.prototype.foo = function () { - this.bar(); - }; + A.prototype.foo = function () { this.bar(); }; return A; })(B); var B = (function () { function B() { } - B.prototype.bar = function () { - }; + B.prototype.bar = function () { }; return B; })(); var a = new A(); diff --git a/tests/baselines/reference/classOverloadForFunction.js b/tests/baselines/reference/classOverloadForFunction.js index 47c787986da..40f076b0f2c 100644 --- a/tests/baselines/reference/classOverloadForFunction.js +++ b/tests/baselines/reference/classOverloadForFunction.js @@ -10,5 +10,4 @@ var foo = (function () { return foo; })(); ; -function foo() { -} +function foo() { } diff --git a/tests/baselines/reference/classPropertyAsPrivate.js b/tests/baselines/reference/classPropertyAsPrivate.js index 8b59dcde771..51d08b48ec5 100644 --- a/tests/baselines/reference/classPropertyAsPrivate.js +++ b/tests/baselines/reference/classPropertyAsPrivate.js @@ -28,27 +28,19 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "y", { - get: function () { - return null; - }, - set: function (x) { - }, + get: function () { return null; }, + set: function (x) { }, enumerable: true, configurable: true }); - C.prototype.foo = function () { - }; + C.prototype.foo = function () { }; Object.defineProperty(C, "b", { - get: function () { - return null; - }, - set: function (x) { - }, + get: function () { return null; }, + set: function (x) { }, enumerable: true, configurable: true }); - C.foo = function () { - }; + C.foo = function () { }; return C; })(); var c; diff --git a/tests/baselines/reference/classPropertyAsProtected.js b/tests/baselines/reference/classPropertyAsProtected.js index ddb193f072a..1cd74089816 100644 --- a/tests/baselines/reference/classPropertyAsProtected.js +++ b/tests/baselines/reference/classPropertyAsProtected.js @@ -28,27 +28,19 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "y", { - get: function () { - return null; - }, - set: function (x) { - }, + get: function () { return null; }, + set: function (x) { }, enumerable: true, configurable: true }); - C.prototype.foo = function () { - }; + C.prototype.foo = function () { }; Object.defineProperty(C, "b", { - get: function () { - return null; - }, - set: function (x) { - }, + get: function () { return null; }, + set: function (x) { }, enumerable: true, configurable: true }); - C.foo = function () { - }; + C.foo = function () { }; return C; })(); var c; diff --git a/tests/baselines/reference/classPropertyIsPublicByDefault.js b/tests/baselines/reference/classPropertyIsPublicByDefault.js index db1eca56c11..a0b61a08922 100644 --- a/tests/baselines/reference/classPropertyIsPublicByDefault.js +++ b/tests/baselines/reference/classPropertyIsPublicByDefault.js @@ -27,27 +27,19 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "y", { - get: function () { - return null; - }, - set: function (x) { - }, + get: function () { return null; }, + set: function (x) { }, enumerable: true, configurable: true }); - C.prototype.foo = function () { - }; + C.prototype.foo = function () { }; Object.defineProperty(C, "b", { - get: function () { - return null; - }, - set: function (x) { - }, + get: function () { return null; }, + set: function (x) { }, enumerable: true, configurable: true }); - C.foo = function () { - }; + C.foo = function () { }; return C; })(); var c; diff --git a/tests/baselines/reference/classSideInheritance1.js b/tests/baselines/reference/classSideInheritance1.js index 38b84b77bd3..74df624a78c 100644 --- a/tests/baselines/reference/classSideInheritance1.js +++ b/tests/baselines/reference/classSideInheritance1.js @@ -28,9 +28,7 @@ var A = (function () { A.bar = function () { return ""; }; - A.prototype.foo = function () { - return 1; - }; + A.prototype.foo = function () { return 1; }; return A; })(); var C2 = (function (_super) { diff --git a/tests/baselines/reference/classWithEmptyBody.js b/tests/baselines/reference/classWithEmptyBody.js index df9bc857106..16c50ccec77 100644 --- a/tests/baselines/reference/classWithEmptyBody.js +++ b/tests/baselines/reference/classWithEmptyBody.js @@ -29,11 +29,8 @@ var C = (function () { var c; var o = c; c = 1; -c = { - foo: '' -}; -c = function () { -}; +c = { foo: '' }; +c = function () { }; var D = (function () { function D() { return 1; @@ -43,8 +40,5 @@ var D = (function () { var d; var o = d; d = 1; -d = { - foo: '' -}; -d = function () { -}; +d = { foo: '' }; +d = function () { }; diff --git a/tests/baselines/reference/classWithMultipleBaseClasses.js b/tests/baselines/reference/classWithMultipleBaseClasses.js index c6900f526cb..0e101d61dc9 100644 --- a/tests/baselines/reference/classWithMultipleBaseClasses.js +++ b/tests/baselines/reference/classWithMultipleBaseClasses.js @@ -28,23 +28,19 @@ interface I extends A, B { var A = (function () { function A() { } - A.prototype.foo = function () { - }; + A.prototype.foo = function () { }; return A; })(); var B = (function () { function B() { } - B.prototype.bar = function () { - }; + B.prototype.bar = function () { }; return B; })(); var D = (function () { function D() { } - D.prototype.baz = function () { - }; - D.prototype.bat = function () { - }; + D.prototype.baz = function () { }; + D.prototype.bat = function () { }; return D; })(); diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.js b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.js index acb802d0f97..1c07449c994 100644 --- a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.js +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.js @@ -30,15 +30,10 @@ i = c; var C = (function () { function C() { } - C.prototype.y = function (a) { - return null; - }; + C.prototype.y = function (a) { return null; }; Object.defineProperty(C.prototype, "z", { - get: function () { - return 1; - }, - set: function (v) { - }, + get: function () { return 1; }, + set: function (v) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.js b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.js index 1048c2e5124..78e5cb05861 100644 --- a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.js +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.js @@ -32,15 +32,10 @@ i = c; var C = (function () { function C() { } - C.prototype.y = function (a) { - return null; - }; + C.prototype.y = function (a) { return null; }; Object.defineProperty(C.prototype, "z", { - get: function () { - return 1; - }, - set: function (v) { - }, + get: function () { return 1; }, + set: function (v) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/classWithOptionalParameter.js b/tests/baselines/reference/classWithOptionalParameter.js index 082e624916a..2f11f15febe 100644 --- a/tests/baselines/reference/classWithOptionalParameter.js +++ b/tests/baselines/reference/classWithOptionalParameter.js @@ -16,14 +16,12 @@ class C2 { var C = (function () { function C() { } - C.prototype.f = function () { - }; + C.prototype.f = function () { }; return C; })(); var C2 = (function () { function C2() { } - C2.prototype.f = function (x) { - }; + C2.prototype.f = function (x) { }; return C2; })(); diff --git a/tests/baselines/reference/classWithOverloadImplementationOfWrongName.js b/tests/baselines/reference/classWithOverloadImplementationOfWrongName.js index f8cb9bf4c5b..4ac6548483e 100644 --- a/tests/baselines/reference/classWithOverloadImplementationOfWrongName.js +++ b/tests/baselines/reference/classWithOverloadImplementationOfWrongName.js @@ -9,7 +9,6 @@ class C { var C = (function () { function C() { } - C.prototype.bar = function (x) { - }; + C.prototype.bar = function (x) { }; return C; })(); diff --git a/tests/baselines/reference/classWithOverloadImplementationOfWrongName2.js b/tests/baselines/reference/classWithOverloadImplementationOfWrongName2.js index 5caba8f3fd5..fd28ae3d9eb 100644 --- a/tests/baselines/reference/classWithOverloadImplementationOfWrongName2.js +++ b/tests/baselines/reference/classWithOverloadImplementationOfWrongName2.js @@ -9,7 +9,6 @@ class C { var C = (function () { function C() { } - C.prototype.bar = function (x) { - }; + C.prototype.bar = function (x) { }; return C; })(); diff --git a/tests/baselines/reference/classWithPredefinedTypesAsNames2.errors.txt b/tests/baselines/reference/classWithPredefinedTypesAsNames2.errors.txt index 73cb373180c..84c258b550d 100644 --- a/tests/baselines/reference/classWithPredefinedTypesAsNames2.errors.txt +++ b/tests/baselines/reference/classWithPredefinedTypesAsNames2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/classes/classDeclarations/classWithPredefinedTypesAsNames2.ts(3,7): error TS1003: Identifier expected. +tests/cases/conformance/classes/classDeclarations/classWithPredefinedTypesAsNames2.ts(3,7): error TS1005: '{' expected. ==== tests/cases/conformance/classes/classDeclarations/classWithPredefinedTypesAsNames2.ts (1 errors) ==== @@ -6,4 +6,4 @@ tests/cases/conformance/classes/classDeclarations/classWithPredefinedTypesAsName class void {} ~~~~ -!!! error TS1003: Identifier expected. \ No newline at end of file +!!! error TS1005: '{' expected. \ No newline at end of file diff --git a/tests/baselines/reference/classWithPredefinedTypesAsNames2.js b/tests/baselines/reference/classWithPredefinedTypesAsNames2.js index a47adcbe32f..91ff735accc 100644 --- a/tests/baselines/reference/classWithPredefinedTypesAsNames2.js +++ b/tests/baselines/reference/classWithPredefinedTypesAsNames2.js @@ -5,9 +5,9 @@ class void {} //// [classWithPredefinedTypesAsNames2.js] // classes cannot use predefined types as names -var = (function () { - function () { +var default_1 = (function () { + function default_1() { } - return ; + return default_1; })(); void {}; diff --git a/tests/baselines/reference/classWithPrivateProperty.js b/tests/baselines/reference/classWithPrivateProperty.js index 47ff7c91421..0529fd8d694 100644 --- a/tests/baselines/reference/classWithPrivateProperty.js +++ b/tests/baselines/reference/classWithPrivateProperty.js @@ -28,19 +28,11 @@ var C = (function () { function C() { this.a = ''; this.b = ''; - this.d = function () { - return ''; - }; + this.d = function () { return ''; }; } - C.prototype.c = function () { - return ''; - }; - C.f = function () { - return ''; - }; - C.g = function () { - return ''; - }; + C.prototype.c = function () { return ''; }; + C.f = function () { return ''; }; + C.g = function () { return ''; }; return C; })(); var c = new C(); diff --git a/tests/baselines/reference/classWithProtectedProperty.js b/tests/baselines/reference/classWithProtectedProperty.js index c8b15c1396c..4de87229ad0 100644 --- a/tests/baselines/reference/classWithProtectedProperty.js +++ b/tests/baselines/reference/classWithProtectedProperty.js @@ -39,19 +39,11 @@ var C = (function () { function C() { this.a = ''; this.b = ''; - this.d = function () { - return ''; - }; + this.d = function () { return ''; }; } - C.prototype.c = function () { - return ''; - }; - C.f = function () { - return ''; - }; - C.g = function () { - return ''; - }; + C.prototype.c = function () { return ''; }; + C.f = function () { return ''; }; + C.g = function () { return ''; }; return C; })(); var D = (function (_super) { diff --git a/tests/baselines/reference/classWithPublicProperty.js b/tests/baselines/reference/classWithPublicProperty.js index 88dc9d8de10..cc1b0aad64f 100644 --- a/tests/baselines/reference/classWithPublicProperty.js +++ b/tests/baselines/reference/classWithPublicProperty.js @@ -26,19 +26,11 @@ var C = (function () { function C() { this.a = ''; this.b = ''; - this.d = function () { - return ''; - }; + this.d = function () { return ''; }; } - C.prototype.c = function () { - return ''; - }; - C.f = function () { - return ''; - }; - C.g = function () { - return ''; - }; + C.prototype.c = function () { return ''; }; + C.f = function () { return ''; }; + C.g = function () { return ''; }; return C; })(); // all of these are valid diff --git a/tests/baselines/reference/classWithSemicolonClassElement1.js b/tests/baselines/reference/classWithSemicolonClassElement1.js new file mode 100644 index 00000000000..3838316e113 --- /dev/null +++ b/tests/baselines/reference/classWithSemicolonClassElement1.js @@ -0,0 +1,12 @@ +//// [classWithSemicolonClassElement1.ts] +class C { + ; +} + +//// [classWithSemicolonClassElement1.js] +var C = (function () { + function C() { + } + ; + return C; +})(); diff --git a/tests/baselines/reference/classWithSemicolonClassElement1.types b/tests/baselines/reference/classWithSemicolonClassElement1.types new file mode 100644 index 00000000000..d3315c4cd03 --- /dev/null +++ b/tests/baselines/reference/classWithSemicolonClassElement1.types @@ -0,0 +1,6 @@ +=== tests/cases/conformance/classes/classDeclarations/classWithSemicolonClassElement1.ts === +class C { +>C : C + + ; +} diff --git a/tests/baselines/reference/classWithSemicolonClassElement2.js b/tests/baselines/reference/classWithSemicolonClassElement2.js new file mode 100644 index 00000000000..77af51bce60 --- /dev/null +++ b/tests/baselines/reference/classWithSemicolonClassElement2.js @@ -0,0 +1,14 @@ +//// [classWithSemicolonClassElement2.ts] +class C { + ; + ; +} + +//// [classWithSemicolonClassElement2.js] +var C = (function () { + function C() { + } + ; + ; + return C; +})(); diff --git a/tests/baselines/reference/classWithSemicolonClassElement2.types b/tests/baselines/reference/classWithSemicolonClassElement2.types new file mode 100644 index 00000000000..ce638e79fc0 --- /dev/null +++ b/tests/baselines/reference/classWithSemicolonClassElement2.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/classes/classDeclarations/classWithSemicolonClassElement2.ts === +class C { +>C : C + + ; + ; +} diff --git a/tests/baselines/reference/classWithSemicolonClassElementES61.js b/tests/baselines/reference/classWithSemicolonClassElementES61.js new file mode 100644 index 00000000000..27f020257f5 --- /dev/null +++ b/tests/baselines/reference/classWithSemicolonClassElementES61.js @@ -0,0 +1,9 @@ +//// [classWithSemicolonClassElementES61.ts] +class C { + ; +} + +//// [classWithSemicolonClassElementES61.js] +class C { + ; +} diff --git a/tests/baselines/reference/classWithSemicolonClassElementES61.types b/tests/baselines/reference/classWithSemicolonClassElementES61.types new file mode 100644 index 00000000000..974f269d33c --- /dev/null +++ b/tests/baselines/reference/classWithSemicolonClassElementES61.types @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/classDeclaration/classWithSemicolonClassElementES61.ts === +class C { +>C : C + + ; +} diff --git a/tests/baselines/reference/classWithSemicolonClassElementES62.js b/tests/baselines/reference/classWithSemicolonClassElementES62.js new file mode 100644 index 00000000000..068286c25ce --- /dev/null +++ b/tests/baselines/reference/classWithSemicolonClassElementES62.js @@ -0,0 +1,11 @@ +//// [classWithSemicolonClassElementES62.ts] +class C { + ; + ; +} + +//// [classWithSemicolonClassElementES62.js] +class C { + ; + ; +} diff --git a/tests/baselines/reference/classWithSemicolonClassElementES62.types b/tests/baselines/reference/classWithSemicolonClassElementES62.types new file mode 100644 index 00000000000..9f96fbb5ebd --- /dev/null +++ b/tests/baselines/reference/classWithSemicolonClassElementES62.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/classDeclaration/classWithSemicolonClassElementES62.ts === +class C { +>C : C + + ; + ; +} diff --git a/tests/baselines/reference/classWithStaticMembers.js b/tests/baselines/reference/classWithStaticMembers.js index 2cded4b1f2e..36b8bd0af64 100644 --- a/tests/baselines/reference/classWithStaticMembers.js +++ b/tests/baselines/reference/classWithStaticMembers.js @@ -31,15 +31,10 @@ var C = (function () { this.a = a; this.b = b; } - C.fn = function () { - return this; - }; + C.fn = function () { return this; }; Object.defineProperty(C, "x", { - get: function () { - return 1; - }, - set: function (v) { - }, + get: function () { return 1; }, + set: function (v) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/classdecl.js b/tests/baselines/reference/classdecl.js index 1f588b785e9..e9253b61cac 100644 --- a/tests/baselines/reference/classdecl.js +++ b/tests/baselines/reference/classdecl.js @@ -103,8 +103,7 @@ var __extends = this.__extends || function (d, b) { var a = (function () { function a(ns) { } - a.prototype.pgF = function () { - }; + a.prototype.pgF = function () { }; Object.defineProperty(a.prototype, "d", { get: function () { return 30; @@ -116,10 +115,7 @@ var a = (function () { }); Object.defineProperty(a, "p2", { get: function () { - return { - x: 30, - y: 40 - }; + return { x: 30, y: 40 }; }, enumerable: true, configurable: true diff --git a/tests/baselines/reference/cloduleAcrossModuleDefinitions.js b/tests/baselines/reference/cloduleAcrossModuleDefinitions.js index 9772af20434..c877de38a00 100644 --- a/tests/baselines/reference/cloduleAcrossModuleDefinitions.js +++ b/tests/baselines/reference/cloduleAcrossModuleDefinitions.js @@ -21,10 +21,8 @@ var A; var B = (function () { function B() { } - B.prototype.foo = function () { - }; - B.bar = function () { - }; + B.prototype.foo = function () { }; + B.bar = function () { }; return B; })(); A.B = B; diff --git a/tests/baselines/reference/cloduleTest1.js b/tests/baselines/reference/cloduleTest1.js index f79f1e5c46f..9e7edc77c71 100644 --- a/tests/baselines/reference/cloduleTest1.js +++ b/tests/baselines/reference/cloduleTest1.js @@ -14,8 +14,7 @@ //// [cloduleTest1.js] var $; (function ($) { - function ajax(options) { - } + function ajax(options) { } $.ajax = ajax; })($ || ($ = {})); var it = $('.foo').addClass('bar'); diff --git a/tests/baselines/reference/cloduleWithDuplicateMember1.js b/tests/baselines/reference/cloduleWithDuplicateMember1.js index ed4d69545fc..e3cb8f83fed 100644 --- a/tests/baselines/reference/cloduleWithDuplicateMember1.js +++ b/tests/baselines/reference/cloduleWithDuplicateMember1.js @@ -20,9 +20,7 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "x", { - get: function () { - return 1; - }, + get: function () { return 1; }, enumerable: true, configurable: true }); @@ -33,8 +31,7 @@ var C = (function () { enumerable: true, configurable: true }); - C.foo = function () { - }; + C.foo = function () { }; return C; })(); var C; @@ -43,10 +40,8 @@ var C; })(C || (C = {})); var C; (function (C) { - function foo() { - } + function foo() { } C.foo = foo; - function x() { - } + function x() { } C.x = x; })(C || (C = {})); diff --git a/tests/baselines/reference/cloduleWithDuplicateMember2.js b/tests/baselines/reference/cloduleWithDuplicateMember2.js index 461930c02ae..c16c6c9af8a 100644 --- a/tests/baselines/reference/cloduleWithDuplicateMember2.js +++ b/tests/baselines/reference/cloduleWithDuplicateMember2.js @@ -16,14 +16,12 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "x", { - set: function (y) { - }, + set: function (y) { }, enumerable: true, configurable: true }); Object.defineProperty(C, "y", { - set: function (z) { - }, + set: function (z) { }, enumerable: true, configurable: true }); @@ -35,7 +33,6 @@ var C; })(C || (C = {})); var C; (function (C) { - function x() { - } + function x() { } C.x = x; })(C || (C = {})); diff --git a/tests/baselines/reference/clodulesDerivedClasses.js b/tests/baselines/reference/clodulesDerivedClasses.js index f249a7d5589..b4b31e59d3e 100644 --- a/tests/baselines/reference/clodulesDerivedClasses.js +++ b/tests/baselines/reference/clodulesDerivedClasses.js @@ -38,9 +38,7 @@ var Shape; (function (Shape) { var Utils; (function (Utils) { - function convert() { - return null; - } + function convert() { return null; } Utils.convert = convert; })(Utils = Shape.Utils || (Shape.Utils = {})); })(Shape || (Shape = {})); diff --git a/tests/baselines/reference/collisionArgumentsClassConstructor.errors.txt b/tests/baselines/reference/collisionArgumentsClassConstructor.errors.txt index f2ec9429eb7..03bf4f9e38b 100644 --- a/tests/baselines/reference/collisionArgumentsClassConstructor.errors.txt +++ b/tests/baselines/reference/collisionArgumentsClassConstructor.errors.txt @@ -1,40 +1,89 @@ tests/cases/compiler/collisionArgumentsClassConstructor.ts(3,28): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(3,31): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(4,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(8,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. tests/cases/compiler/collisionArgumentsClassConstructor.ts(8,17): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(9,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(13,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(14,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(20,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(25,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. tests/cases/compiler/collisionArgumentsClassConstructor.ts(30,17): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(30,24): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(31,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(35,24): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(36,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(41,31): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(44,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(47,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(51,31): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(52,31): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. tests/cases/compiler/collisionArgumentsClassConstructor.ts(53,25): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(53,28): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(54,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(59,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(60,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(61,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. tests/cases/compiler/collisionArgumentsClassConstructor.ts(61,17): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(62,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(67,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(68,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(69,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(70,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(75,31): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(76,31): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(79,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(80,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(84,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(85,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. -==== tests/cases/compiler/collisionArgumentsClassConstructor.ts (5 errors) ==== +==== tests/cases/compiler/collisionArgumentsClassConstructor.ts (38 errors) ==== // Constructors class c1 { constructor(i: number, ...arguments) { // error ~~~~~~~~~~~~ !!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. var arguments: any[]; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } } class c12 { constructor(arguments: number, ...rest) { // error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. ~~~~~~~~~~~~~~~~~ !!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } } class c1NoError { constructor(arguments: number) { // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } } class c2 { constructor(...restParameters) { var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } } class c2NoError { constructor() { var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } } @@ -42,63 +91,113 @@ tests/cases/compiler/collisionArgumentsClassConstructor.ts(61,17): error TS2396: constructor(public arguments: number, ...restParameters) { //arguments is error ~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } } class c3NoError { constructor(public arguments: number) { // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } } declare class c4 { constructor(i: number, ...arguments); // No error - no code gen + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } declare class c42 { constructor(arguments: number, ...rest); // No error - no code gen + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } declare class c4NoError { constructor(arguments: number); // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } class c5 { constructor(i: number, ...arguments); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. constructor(i: string, ...arguments); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. constructor(i: any, ...arguments) { // error ~~~~~~~~~~~~ !!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. var arguments: any[]; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } } class c52 { constructor(arguments: number, ...rest); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. constructor(arguments: string, ...rest); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. constructor(arguments: any, ...rest) { // error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. ~~~~~~~~~~~~~~ !!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments: any; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } } class c5NoError { constructor(arguments: number); // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. constructor(arguments: string); // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. constructor(arguments: any) { // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. var arguments: any; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } } declare class c6 { constructor(i: number, ...arguments); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. constructor(i: string, ...arguments); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } declare class c62 { constructor(arguments: number, ...rest); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. constructor(arguments: string, ...rest); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } declare class c6NoError { constructor(arguments: number); // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. constructor(arguments: string); // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } \ No newline at end of file diff --git a/tests/baselines/reference/collisionArgumentsClassMethod.errors.txt b/tests/baselines/reference/collisionArgumentsClassMethod.errors.txt index 38ad6867200..ea699414f17 100644 --- a/tests/baselines/reference/collisionArgumentsClassMethod.errors.txt +++ b/tests/baselines/reference/collisionArgumentsClassMethod.errors.txt @@ -1,63 +1,150 @@ tests/cases/compiler/collisionArgumentsClassMethod.ts(2,27): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsClassMethod.ts(2,30): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(3,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(5,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. tests/cases/compiler/collisionArgumentsClassMethod.ts(5,17): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsClassMethod.ts(6,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(8,23): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(9,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(11,29): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(12,29): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. tests/cases/compiler/collisionArgumentsClassMethod.ts(13,23): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsClassMethod.ts(13,26): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(14,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(16,16): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(17,16): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(18,16): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. tests/cases/compiler/collisionArgumentsClassMethod.ts(18,16): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsClassMethod.ts(19,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(21,22): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(22,22): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(23,22): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(24,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(29,30): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(30,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(31,23): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(33,29): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(34,29): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(35,16): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(36,16): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(37,22): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(38,22): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(43,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(46,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. -==== tests/cases/compiler/collisionArgumentsClassMethod.ts (4 errors) ==== +==== tests/cases/compiler/collisionArgumentsClassMethod.ts (33 errors) ==== class c1 { public foo(i: number, ...arguments) { //arguments is error ~~~~~~~~~~~~ !!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. var arguments: any[]; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } public foo1(arguments: number, ...rest) { //arguments is error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. ~~~~~~~~~~~~~~~~~ !!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } public fooNoError(arguments: number) { // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } public f4(i: number, ...arguments); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. public f4(i: string, ...arguments); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. public f4(i: any, ...arguments) { // error ~~~~~~~~~~~~ !!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. var arguments: any[]; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } public f41(arguments: number, ...rest); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. public f41(arguments: string, ...rest); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. public f41(arguments: any, ...rest) { // error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. ~~~~~~~~~~~~~~ !!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments: any; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } public f4NoError(arguments: number); // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. public f4NoError(arguments: string); // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. public f4NoError(arguments: any) { // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. var arguments: any; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } } declare class c2 { public foo(i: number, ...arguments); // No error - no code gen + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. public foo1(arguments: number, ...rest); // No error - no code gen + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. public fooNoError(arguments: number); // No error - no code gen + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. public f4(i: number, ...arguments); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. public f4(i: string, ...arguments); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. public f41(arguments: number, ...rest); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. public f41(arguments: string, ...rest); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. public f4NoError(arguments: number); // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. public f4NoError(arguments: string); // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } class c3 { public foo(...restParameters) { var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } public fooNoError() { var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } } \ No newline at end of file diff --git a/tests/baselines/reference/collisionSuperAndParameter.js b/tests/baselines/reference/collisionSuperAndParameter.js index f7198dfbf04..be9e0ce3f68 100644 --- a/tests/baselines/reference/collisionSuperAndParameter.js +++ b/tests/baselines/reference/collisionSuperAndParameter.js @@ -75,17 +75,13 @@ var Foo = (function () { Foo.prototype.a = function () { var _this = this; var lamda = function (_super) { - return function (x) { - return _this; - }; // New scope. So should inject new _this capture + return function (x) { return _this; }; // New scope. So should inject new _this capture }; }; Foo.prototype.b = function (_super) { var _this = this; var lambda = function () { - return function (x) { - return _this; - }; // New scope. So should inject new _this capture + return function (x) { return _this; }; // New scope. So should inject new _this capture }; }; Object.defineProperty(Foo.prototype, "c", { @@ -108,17 +104,13 @@ var Foo2 = (function (_super) { Foo2.prototype.x = function () { var _this = this; var lamda = function (_super) { - return function (x) { - return _this; - }; // New scope. So should inject new _this capture + return function (x) { return _this; }; // New scope. So should inject new _this capture }; }; Foo2.prototype.y = function (_super) { var _this = this; var lambda = function () { - return function (x) { - return _this; - }; // New scope. So should inject new _this capture + return function (x) { return _this; }; // New scope. So should inject new _this capture }; }; Object.defineProperty(Foo2.prototype, "z", { @@ -137,9 +129,7 @@ var Foo4 = (function (_super) { Foo4.prototype.y = function (_super) { var _this = this; var lambda = function () { - return function (x) { - return _this; - }; // New scope. So should inject new _this capture + return function (x) { return _this; }; // New scope. So should inject new _this capture }; }; return Foo4; diff --git a/tests/baselines/reference/collisionThisExpressionAndAliasInGlobal.js b/tests/baselines/reference/collisionThisExpressionAndAliasInGlobal.js index b1db7f12ea5..1f613798642 100644 --- a/tests/baselines/reference/collisionThisExpressionAndAliasInGlobal.js +++ b/tests/baselines/reference/collisionThisExpressionAndAliasInGlobal.js @@ -11,7 +11,5 @@ var a; (function (a) { a.b = 10; })(a || (a = {})); -var f = function () { - return _this; -}; +var f = function () { return _this; }; var _this = a; // Error diff --git a/tests/baselines/reference/collisionThisExpressionAndAmbientClassInGlobal.js b/tests/baselines/reference/collisionThisExpressionAndAmbientClassInGlobal.js index 7c617b25756..b99311b0c3e 100644 --- a/tests/baselines/reference/collisionThisExpressionAndAmbientClassInGlobal.js +++ b/tests/baselines/reference/collisionThisExpressionAndAmbientClassInGlobal.js @@ -6,7 +6,5 @@ var a = new _this(); // Error //// [collisionThisExpressionAndAmbientClassInGlobal.js] var _this = this; -var f = function () { - return _this; -}; +var f = function () { return _this; }; var a = new _this(); // Error diff --git a/tests/baselines/reference/collisionThisExpressionAndAmbientVarInGlobal.js b/tests/baselines/reference/collisionThisExpressionAndAmbientVarInGlobal.js index 8aec5140caf..c6c54869056 100644 --- a/tests/baselines/reference/collisionThisExpressionAndAmbientVarInGlobal.js +++ b/tests/baselines/reference/collisionThisExpressionAndAmbientVarInGlobal.js @@ -5,7 +5,5 @@ _this = 10; // Error //// [collisionThisExpressionAndAmbientVarInGlobal.js] var _this = this; -var f = function () { - return _this; -}; +var f = function () { return _this; }; _this = 10; // Error diff --git a/tests/baselines/reference/collisionThisExpressionAndClassInGlobal.js b/tests/baselines/reference/collisionThisExpressionAndClassInGlobal.js index c31d03bed9b..ccaa335d80e 100644 --- a/tests/baselines/reference/collisionThisExpressionAndClassInGlobal.js +++ b/tests/baselines/reference/collisionThisExpressionAndClassInGlobal.js @@ -10,6 +10,4 @@ var _this = (function () { } return _this; })(); -var f = function () { - return _this; -}; +var f = function () { return _this; }; diff --git a/tests/baselines/reference/collisionThisExpressionAndEnumInGlobal.js b/tests/baselines/reference/collisionThisExpressionAndEnumInGlobal.js index 3de272e51a7..4ab929a3877 100644 --- a/tests/baselines/reference/collisionThisExpressionAndEnumInGlobal.js +++ b/tests/baselines/reference/collisionThisExpressionAndEnumInGlobal.js @@ -12,6 +12,4 @@ var _this; _this[_this["_thisVal1"] = 0] = "_thisVal1"; _this[_this["_thisVal2"] = 1] = "_thisVal2"; })(_this || (_this = {})); -var f = function () { - return _this; -}; +var f = function () { return _this; }; diff --git a/tests/baselines/reference/collisionThisExpressionAndFunctionInGlobal.js b/tests/baselines/reference/collisionThisExpressionAndFunctionInGlobal.js index 07e2a1358f6..3c6232ba0ba 100644 --- a/tests/baselines/reference/collisionThisExpressionAndFunctionInGlobal.js +++ b/tests/baselines/reference/collisionThisExpressionAndFunctionInGlobal.js @@ -9,6 +9,4 @@ var _this = this; function _this() { return 10; } -var f = function () { - return _this; -}; +var f = function () { return _this; }; diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInAccessors.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarInAccessors.js index 0e3384feb29..53df2984544 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarInAccessors.js +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInAccessors.js @@ -51,24 +51,20 @@ var class1 = (function () { get: function () { var _this = this; var x2 = { - doStuff: function (callback) { - return function () { - var _this = 2; - return callback(_this); - }; - } + doStuff: function (callback) { return function () { + var _this = 2; + return callback(_this); + }; } }; return 10; }, set: function (val) { var _this = this; var x2 = { - doStuff: function (callback) { - return function () { - var _this = 2; - return callback(_this); - }; - } + doStuff: function (callback) { return function () { + var _this = 2; + return callback(_this); + }; } }; }, enumerable: true, @@ -84,11 +80,9 @@ var class2 = (function () { var _this = this; var _this = 2; var x2 = { - doStuff: function (callback) { - return function () { - return callback(_this); - }; - } + doStuff: function (callback) { return function () { + return callback(_this); + }; } }; return 10; }, @@ -96,11 +90,9 @@ var class2 = (function () { var _this = this; var _this = 2; var x2 = { - doStuff: function (callback) { - return function () { - return callback(_this); - }; - } + doStuff: function (callback) { return function () { + return callback(_this); + }; } }; }, enumerable: true, diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInConstructor.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarInConstructor.js index e4c1c7ac9ba..d0ed79da530 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarInConstructor.js +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInConstructor.js @@ -26,12 +26,10 @@ var class1 = (function () { function class1() { var _this = this; var x2 = { - doStuff: function (callback) { - return function () { - var _this = 2; - return callback(_this); - }; - } + doStuff: function (callback) { return function () { + var _this = 2; + return callback(_this); + }; } }; } return class1; @@ -41,11 +39,9 @@ var class2 = (function () { var _this = this; var _this = 2; var x2 = { - doStuff: function (callback) { - return function () { - return callback(_this); - }; - } + doStuff: function (callback) { return function () { + return callback(_this); + }; } }; } return class2; diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInFunction.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarInFunction.js index 967d01819ec..879dd83d778 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarInFunction.js +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInFunction.js @@ -12,7 +12,5 @@ var console; function x() { var _this = this; var _this = 5; - (function (x) { - console.log(_this.x); - }); + (function (x) { console.log(_this.x); }); } diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInLambda.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarInLambda.js index a799ec36eae..e8b7a0db7f3 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarInLambda.js +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInLambda.js @@ -12,13 +12,9 @@ alert(x.doStuff(x => alert(x))); //// [collisionThisExpressionAndLocalVarInLambda.js] var _this = this; var x = { - doStuff: function (callback) { - return function () { - var _this = 2; - return callback(_this); - }; - } + doStuff: function (callback) { return function () { + var _this = 2; + return callback(_this); + }; } }; -alert(x.doStuff(function (x) { - return alert(x); -})); +alert(x.doStuff(function (x) { return alert(x); })); diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInMethod.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarInMethod.js index 398ed393794..63b536bd8b6 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarInMethod.js +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInMethod.js @@ -25,23 +25,19 @@ var a = (function () { a.prototype.method1 = function () { var _this = this; return { - doStuff: function (callback) { - return function () { - var _this = 2; - return callback(_this); - }; - } + doStuff: function (callback) { return function () { + var _this = 2; + return callback(_this); + }; } }; }; a.prototype.method2 = function () { var _this = this; var _this = 2; return { - doStuff: function (callback) { - return function () { - return callback(_this); - }; - } + doStuff: function (callback) { return function () { + return callback(_this); + }; } }; }; return a; diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInProperty.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarInProperty.js index f884c93a62e..65d181921d5 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarInProperty.js +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInProperty.js @@ -24,12 +24,10 @@ var class1 = (function () { function class1() { var _this = this; this.prop1 = { - doStuff: function (callback) { - return function () { - var _this = 2; - return callback(_this); - }; - } + doStuff: function (callback) { return function () { + var _this = 2; + return callback(_this); + }; } }; } return class1; @@ -38,11 +36,9 @@ var class2 = (function () { function class2() { var _this = this; this.prop1 = { - doStuff: function (callback) { - return function () { - return callback(_this); - }; - } + doStuff: function (callback) { return function () { + return callback(_this); + }; } }; var _this = 2; } diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js index 5ac394520e4..d502fc5c03a 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js @@ -40,9 +40,7 @@ var b = (function (_super) { b.prototype.foo = function () { var _this = this; var _this = 10; - var f = function () { - return _super.prototype.foo.call(_this); - }; + var f = function () { return _super.prototype.foo.call(_this); }; }; return b; })(a); diff --git a/tests/baselines/reference/collisionThisExpressionAndModuleInGlobal.js b/tests/baselines/reference/collisionThisExpressionAndModuleInGlobal.js index 2bf6987c86f..777f141451b 100644 --- a/tests/baselines/reference/collisionThisExpressionAndModuleInGlobal.js +++ b/tests/baselines/reference/collisionThisExpressionAndModuleInGlobal.js @@ -15,6 +15,4 @@ var _this; return c; })(); })(_this || (_this = {})); -var f = function () { - return _this; -}; +var f = function () { return _this; }; diff --git a/tests/baselines/reference/collisionThisExpressionAndNameResolution.js b/tests/baselines/reference/collisionThisExpressionAndNameResolution.js index 12398920f50..8b128d92946 100644 --- a/tests/baselines/reference/collisionThisExpressionAndNameResolution.js +++ b/tests/baselines/reference/collisionThisExpressionAndNameResolution.js @@ -22,9 +22,7 @@ var Foo = (function () { function inner() { var _this = this; console.log(_this); // Error as this doesnt not resolve to user defined _this - return function (x) { - return _this; - }; // New scope. So should inject new _this capture into function inner + return function (x) { return _this; }; // New scope. So should inject new _this capture into function inner } }; return Foo; diff --git a/tests/baselines/reference/collisionThisExpressionAndParameter.js b/tests/baselines/reference/collisionThisExpressionAndParameter.js index 95ade61d202..3a19cf20d5a 100644 --- a/tests/baselines/reference/collisionThisExpressionAndParameter.js +++ b/tests/baselines/reference/collisionThisExpressionAndParameter.js @@ -101,25 +101,19 @@ var Foo = (function () { var _this = 10; // Local var. No this capture in x(), so no conflict. function inner(_this) { var _this = this; - return function (x) { - return _this; - }; // New scope. So should inject new _this capture into function inner + return function (x) { return _this; }; // New scope. So should inject new _this capture into function inner } }; Foo.prototype.y = function () { var _this = this; var lamda = function (_this) { - return function (x) { - return _this; - }; // New scope. So should inject new _this capture + return function (x) { return _this; }; // New scope. So should inject new _this capture }; }; Foo.prototype.z = function (_this) { var _this = this; var lambda = function () { - return function (x) { - return _this; - }; // New scope. So should inject new _this capture + return function (x) { return _this; }; // New scope. So should inject new _this capture }; }; Foo.prototype.x1 = function () { @@ -141,45 +135,35 @@ var Foo1 = (function () { function Foo1(_this) { var _this = this; var x2 = { - doStuff: function (callback) { - return function () { - return callback(_this); - }; - } + doStuff: function (callback) { return function () { + return callback(_this); + }; } }; } return Foo1; })(); function f1(_this) { var _this = this; - (function (x) { - console.log(_this.x); - }); + (function (x) { console.log(_this.x); }); } var Foo3 = (function () { function Foo3(_this) { var _this = this; var x2 = { - doStuff: function (callback) { - return function () { - return callback(_this); - }; - } + doStuff: function (callback) { return function () { + return callback(_this); + }; } }; } Foo3.prototype.z = function (_this) { var _this = this; var lambda = function () { - return function (x) { - return _this; - }; // New scope. So should inject new _this capture + return function (x) { return _this; }; // New scope. So should inject new _this capture }; }; return Foo3; })(); function f3(_this) { var _this = this; - (function (x) { - console.log(_this.x); - }); + (function (x) { console.log(_this.x); }); } diff --git a/tests/baselines/reference/collisionThisExpressionAndPropertyNameAsConstuctorParameter.js b/tests/baselines/reference/collisionThisExpressionAndPropertyNameAsConstuctorParameter.js index 75e4a60bfd3..a77098739ec 100644 --- a/tests/baselines/reference/collisionThisExpressionAndPropertyNameAsConstuctorParameter.js +++ b/tests/baselines/reference/collisionThisExpressionAndPropertyNameAsConstuctorParameter.js @@ -40,9 +40,7 @@ var Foo2 = (function () { function Foo2(_this) { var _this = this; var lambda = function () { - return function (x) { - return _this; - }; // New scope. So should inject new _this capture + return function (x) { return _this; }; // New scope. So should inject new _this capture }; } return Foo2; @@ -52,9 +50,7 @@ var Foo3 = (function () { var _this = this; this._this = _this; var lambda = function () { - return function (x) { - return _this; - }; // New scope. So should inject new _this capture + return function (x) { return _this; }; // New scope. So should inject new _this capture }; } return Foo3; @@ -63,9 +59,7 @@ var Foo4 = (function () { function Foo4(_this) { var _this = this; var lambda = function () { - return function (x) { - return _this; - }; // New scope. So should inject new _this capture + return function (x) { return _this; }; // New scope. So should inject new _this capture }; } return Foo4; @@ -75,9 +69,7 @@ var Foo5 = (function () { var _this = this; this._this = _this; var lambda = function () { - return function (x) { - return _this; - }; // New scope. So should inject new _this capture + return function (x) { return _this; }; // New scope. So should inject new _this capture }; } return Foo5; diff --git a/tests/baselines/reference/collisionThisExpressionAndVarInGlobal.js b/tests/baselines/reference/collisionThisExpressionAndVarInGlobal.js index 77a6a28e283..7057ad7ac55 100644 --- a/tests/baselines/reference/collisionThisExpressionAndVarInGlobal.js +++ b/tests/baselines/reference/collisionThisExpressionAndVarInGlobal.js @@ -5,6 +5,4 @@ var f = () => this; //// [collisionThisExpressionAndVarInGlobal.js] var _this = this; var _this = 1; -var f = function () { - return _this; -}; +var f = function () { return _this; }; diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.js b/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.js index 903a77c1ac4..522bbbe4e19 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.js +++ b/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.js @@ -59,14 +59,8 @@ var resultIsAny5 = (OBJECT, ANY); var x; 1, ANY; ++NUMBER, ANY; -"string", [ - null, - 1 -]; -"string".charAt(0), [ - null, - 1 -]; +"string", [null, 1]; +"string".charAt(0), [null, 1]; true, x("any"); !BOOLEAN, x.doSomeThing(); var resultIsAny6 = (1, ANY); diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.js b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.js index 6e3df849004..dfaba1a93ca 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.js +++ b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.js @@ -58,27 +58,11 @@ null, BOOLEAN; ANY = undefined, BOOLEAN; 1, true; ++NUMBER, true; -[ - 1, - 2, - 3 -], !BOOLEAN; -OBJECT = [ - 1, - 2, - 3 -], BOOLEAN = false; +[1, 2, 3], !BOOLEAN; +OBJECT = [1, 2, 3], BOOLEAN = false; var resultIsBoolean6 = (null, BOOLEAN); var resultIsBoolean7 = (ANY = undefined, BOOLEAN); var resultIsBoolean8 = (1, true); var resultIsBoolean9 = (++NUMBER, true); -var resultIsBoolean10 = ([ - 1, - 2, - 3 -], !BOOLEAN); -var resultIsBoolean11 = (OBJECT = [ - 1, - 2, - 3 -], BOOLEAN = false); +var resultIsBoolean10 = ([1, 2, 3], !BOOLEAN); +var resultIsBoolean11 = (OBJECT = [1, 2, 3], BOOLEAN = false); diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.js b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.js index 452d74d7cf6..90c16543ff2 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.js +++ b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.js @@ -72,9 +72,6 @@ STRING.toLowerCase(), new CLASS(); var resultIsObject6 = (null, OBJECT); var resultIsObject7 = (ANY = null, OBJECT); var resultIsObject8 = (true, {}); -var resultIsObject9 = (!BOOLEAN, { - a: 1, - b: "s" -}); +var resultIsObject9 = (!BOOLEAN, { a: 1, b: "s" }); var resultIsObject10 = ("string", new Date()); var resultIsObject11 = (STRING.toLowerCase(), new CLASS()); diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.js b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.js index 163679b3373..412e9e83121 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.js +++ b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.js @@ -61,17 +61,11 @@ null, STRING; ANY = new Date(), STRING; true, ""; BOOLEAN == undefined, ""; -[ - "a", - "b" -], NUMBER.toString(); +["a", "b"], NUMBER.toString(); OBJECT = new Object, STRING + "string"; var resultIsString6 = (null, STRING); var resultIsString7 = (ANY = new Date(), STRING); var resultIsString8 = (true, ""); var resultIsString9 = (BOOLEAN == undefined, ""); -var resultIsString10 = ([ - "a", - "b" -], NUMBER.toString()); +var resultIsString10 = (["a", "b"], NUMBER.toString()); var resultIsString11 = (new Object, STRING + "string"); diff --git a/tests/baselines/reference/commentEmitAtEndOfFile1.js b/tests/baselines/reference/commentEmitAtEndOfFile1.js index 1a1f7cb8900..1be031fa84a 100644 --- a/tests/baselines/reference/commentEmitAtEndOfFile1.js +++ b/tests/baselines/reference/commentEmitAtEndOfFile1.js @@ -16,7 +16,6 @@ var f = ''; // test #2 var foo; (function (foo) { - function bar() { - } + function bar() { } })(foo || (foo = {})); // test #4 diff --git a/tests/baselines/reference/commentInMethodCall.js b/tests/baselines/reference/commentInMethodCall.js index 0f304df0b35..4ad2fc552d7 100644 --- a/tests/baselines/reference/commentInMethodCall.js +++ b/tests/baselines/reference/commentInMethodCall.js @@ -8,5 +8,4 @@ s.map(// do something //// [commentInMethodCall.js] //commment here var s; -s.map(function () { -}); +s.map(function () { }); diff --git a/tests/baselines/reference/commentOnAmbientModule.types b/tests/baselines/reference/commentOnAmbientModule.types index bf57d9d11bd..f0056decc29 100644 --- a/tests/baselines/reference/commentOnAmbientModule.types +++ b/tests/baselines/reference/commentOnAmbientModule.types @@ -5,7 +5,7 @@ declare module E { class foobar extends D.bar { >foobar : foobar ->D : unknown +>D : typeof D >bar : D.bar foo(); diff --git a/tests/baselines/reference/commentOnBlock1.js b/tests/baselines/reference/commentOnBlock1.js index ff557c1fc9b..ed5437c1f66 100644 --- a/tests/baselines/reference/commentOnBlock1.js +++ b/tests/baselines/reference/commentOnBlock1.js @@ -7,6 +7,5 @@ function f() { //// [commentOnBlock1.js] // asdf function f() { - /*asdf*/ { - } + /*asdf*/ { } } diff --git a/tests/baselines/reference/commentOnClassAccessor1.js b/tests/baselines/reference/commentOnClassAccessor1.js index cdd14a829fc..428e500da55 100644 --- a/tests/baselines/reference/commentOnClassAccessor1.js +++ b/tests/baselines/reference/commentOnClassAccessor1.js @@ -14,9 +14,7 @@ var C = (function () { /** * @type {number} */ - get: function () { - return 1; - }, + get: function () { return 1; }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/commentOnClassAccessor2.js b/tests/baselines/reference/commentOnClassAccessor2.js index c85d17e6e19..22a6b69f6c3 100644 --- a/tests/baselines/reference/commentOnClassAccessor2.js +++ b/tests/baselines/reference/commentOnClassAccessor2.js @@ -19,14 +19,11 @@ var C = (function () { /** * Getter. */ - get: function () { - return 1; - }, + get: function () { return 1; }, /** * Setter. */ - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/commentsBeforeFunctionExpression1.js b/tests/baselines/reference/commentsBeforeFunctionExpression1.js index bd7a1896a5d..0e23722faf3 100644 --- a/tests/baselines/reference/commentsBeforeFunctionExpression1.js +++ b/tests/baselines/reference/commentsBeforeFunctionExpression1.js @@ -6,7 +6,5 @@ var v = { //// [commentsBeforeFunctionExpression1.js] var v = { - f: function (a) { - return 0; - } + f: function (a) { return 0; } }; diff --git a/tests/baselines/reference/commentsFunction.js b/tests/baselines/reference/commentsFunction.js index f5779be524d..0ffb2714108 100644 --- a/tests/baselines/reference/commentsFunction.js +++ b/tests/baselines/reference/commentsFunction.js @@ -74,12 +74,8 @@ var fooFunc = function FooFunctionValue(/** fooFunctionValue param */ b) { return b; }; /// lamdaFoo var comment -var lambdaFoo = function (/**param a*/ a, /**param b*/ b) { - return a + b; -}; -var lambddaNoVarComment = function (/**param a*/ a, /**param b*/ b) { - return a * b; -}; +var lambdaFoo = function (/**param a*/ a, /**param b*/ b) { return a + b; }; +var lambddaNoVarComment = function (/**param a*/ a, /**param b*/ b) { return a * b; }; lambdaFoo(10, 20); lambddaNoVarComment(10, 20); function blah(a /* multiline trailing comment @@ -90,15 +86,9 @@ function blah2(a /* single line multiple trailing comments */ /* second */) { function blah3(a // trailing commen single line ) { } -lambdaFoo = function (a, b) { - return a * b; -}; // This is trailing comment -/*leading comment*/ (function () { - return 0; -}); // Needs to be wrapped in parens to be a valid expression (not declaration) -/*leading comment*/ (function () { - return 0; -}); //trailing comment +lambdaFoo = function (a, b) { return a * b; }; // This is trailing comment +/*leading comment*/ (function () { return 0; }); // Needs to be wrapped in parens to be a valid expression (not declaration) +/*leading comment*/ (function () { return 0; }); //trailing comment function blah4(/*1*/ a /*2*/, /*3*/ b /*4*/) { } function foo1() { diff --git a/tests/baselines/reference/commentsInterface.js b/tests/baselines/reference/commentsInterface.js index dfffedaea1b..bff79a02aa5 100644 --- a/tests/baselines/reference/commentsInterface.js +++ b/tests/baselines/reference/commentsInterface.js @@ -89,9 +89,7 @@ var i2_i_nc_fnfoo = i2_i.nc_fnfoo; var i2_i_nc_fnfoo_r = i2_i.nc_fnfoo(10); var i3_i; i3_i = { - f: function (/**i3_i a*/ a) { - return "Hello" + a; - }, + f: function (/**i3_i a*/ a) { return "Hello" + a; }, l: this.f, /** own x*/ x: this.f(10), diff --git a/tests/baselines/reference/commentsOnObjectLiteral3.js b/tests/baselines/reference/commentsOnObjectLiteral3.js index 5d57b76991e..49f2a6ffbf9 100644 --- a/tests/baselines/reference/commentsOnObjectLiteral3.js +++ b/tests/baselines/reference/commentsOnObjectLiteral3.js @@ -27,8 +27,7 @@ var v = { func: function () { }, //PropertyName + CallSignature - func1: function () { - }, + func1: function () { }, //getter get a() { return this.prop; diff --git a/tests/baselines/reference/commentsVarDecl.js b/tests/baselines/reference/commentsVarDecl.js index d76b43fafb6..5ff2a3c1c6a 100644 --- a/tests/baselines/reference/commentsVarDecl.js +++ b/tests/baselines/reference/commentsVarDecl.js @@ -70,9 +70,7 @@ var yy = /// value comment 20; /** comment2 */ -var z = function (x, y) { - return x + y; -}; +var z = function (x, y) { return x + y; }; var z2; var x2 = z2; var n4; diff --git a/tests/baselines/reference/complexClassRelationships.js b/tests/baselines/reference/complexClassRelationships.js index a1e982e4b4d..e8dc954e14c 100644 --- a/tests/baselines/reference/complexClassRelationships.js +++ b/tests/baselines/reference/complexClassRelationships.js @@ -68,11 +68,7 @@ var Derived = (function (_super) { })(Base); var BaseCollection = (function () { function BaseCollection(f) { - (function (item) { - return [ - item.Components - ]; - }); + (function (item) { return [item.Components]; }); } return BaseCollection; })(); @@ -85,9 +81,7 @@ var Thing = (function () { function Thing() { } Object.defineProperty(Thing.prototype, "Components", { - get: function () { - return null; - }, + get: function () { return null; }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/compositeGenericFunction.js b/tests/baselines/reference/compositeGenericFunction.js index 0fe2e7d6f41..106c724ea24 100644 --- a/tests/baselines/reference/compositeGenericFunction.js +++ b/tests/baselines/reference/compositeGenericFunction.js @@ -7,12 +7,8 @@ var z: number = h(f); var z: number = h(f); //// [compositeGenericFunction.js] -function f(value) { - return value; -} +function f(value) { return value; } ; -function h(func) { - return null; -} +function h(func) { return null; } var z = h(f); var z = h(f); diff --git a/tests/baselines/reference/compoundAssignmentLHSIsValue.js b/tests/baselines/reference/compoundAssignmentLHSIsValue.js index 40c8a3d7ad1..d85d053f8eb 100644 --- a/tests/baselines/reference/compoundAssignmentLHSIsValue.js +++ b/tests/baselines/reference/compoundAssignmentLHSIsValue.js @@ -192,14 +192,8 @@ value; } value; // array literals -[ - '', - '' -] *= value; -[ - '', - '' -] += value; +['', ''] *= value; +['', ''] += value; // super var Derived = (function (_super) { __extends(Derived, _super); @@ -219,17 +213,13 @@ var Derived = (function (_super) { return Derived; })(C); // function expression -function bar1() { -} +function bar1() { } value; -function bar2() { -} +function bar2() { } value; -(function () { -}); +(function () { }); value; -(function () { -}); +(function () { }); value; // function calls foo() *= value; @@ -259,9 +249,7 @@ foo() += value; ({}) += value; ([]) *= value; ([]) += value; -(function baz1() { -}) *= value; -(function baz2() { -}) += value; +(function baz1() { }) *= value; +(function baz2() { }) += value; (foo()) *= value; (foo()) += value; diff --git a/tests/baselines/reference/computedPropertyNames10_ES5.js b/tests/baselines/reference/computedPropertyNames10_ES5.js index 5d8ff398d6c..14d9235b12b 100644 --- a/tests/baselines/reference/computedPropertyNames10_ES5.js +++ b/tests/baselines/reference/computedPropertyNames10_ES5.js @@ -21,27 +21,17 @@ var s; var n; var a; var v = (_a = {}, - _a[s] = function () { - }, - _a[n] = function () { - }, - _a[s + s] = function () { - }, - _a[s + n] = function () { - }, - _a[+s] = function () { - }, - _a[""] = function () { - }, - _a[0] = function () { - }, - _a[a] = function () { - }, - _a[true] = function () { - }, - _a["hello bye"] = function () { - }, - _a["hello " + a + " bye"] = function () { - }, - _a); + _a[s] = function () { }, + _a[n] = function () { }, + _a[s + s] = function () { }, + _a[s + n] = function () { }, + _a[+s] = function () { }, + _a[""] = function () { }, + _a[0] = function () { }, + _a[a] = function () { }, + _a[true] = function () { }, + _a["hello bye"] = function () { }, + _a["hello " + a + " bye"] = function () { }, + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames10_ES6.js b/tests/baselines/reference/computedPropertyNames10_ES6.js index 72613b5c829..0a55fabecd8 100644 --- a/tests/baselines/reference/computedPropertyNames10_ES6.js +++ b/tests/baselines/reference/computedPropertyNames10_ES6.js @@ -21,26 +21,15 @@ var s; var n; var a; var v = { - [s]() { - }, - [n]() { - }, - [s + s]() { - }, - [s + n]() { - }, - [+s]() { - }, - [""]() { - }, - [0]() { - }, - [a]() { - }, - [true]() { - }, - [`hello bye`]() { - }, - [`hello ${a} bye`]() { - } + [s]() { }, + [n]() { }, + [s + s]() { }, + [s + n]() { }, + [+s]() { }, + [""]() { }, + [0]() { }, + [a]() { }, + [true]() { }, + [`hello bye`]() { }, + [`hello ${a} bye`]() { } }; diff --git a/tests/baselines/reference/computedPropertyNames11_ES5.js b/tests/baselines/reference/computedPropertyNames11_ES5.js index 2b56eeb29f2..64c0b0bd67e 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES5.js +++ b/tests/baselines/reference/computedPropertyNames11_ES5.js @@ -21,77 +21,61 @@ var s; var n; var a; var v = (_a = {}, - _a[s] = Object.defineProperty({ - get: function () { - return 0; - }, + Object.defineProperty(_a, s, { + get: function () { return 0; }, enumerable: true, configurable: true }), - _a[n] = Object.defineProperty({ - set: function (v) { - }, + Object.defineProperty(_a, n, { + set: function (v) { }, enumerable: true, configurable: true }), - _a[s + s] = Object.defineProperty({ - get: function () { - return 0; - }, + Object.defineProperty(_a, s + s, { + get: function () { return 0; }, enumerable: true, configurable: true }), - _a[s + n] = Object.defineProperty({ - set: function (v) { - }, + Object.defineProperty(_a, s + n, { + set: function (v) { }, enumerable: true, configurable: true }), - _a[+s] = Object.defineProperty({ - get: function () { - return 0; - }, + Object.defineProperty(_a, +s, { + get: function () { return 0; }, enumerable: true, configurable: true }), - _a[""] = Object.defineProperty({ - set: function (v) { - }, + Object.defineProperty(_a, "", { + set: function (v) { }, enumerable: true, configurable: true }), - _a[0] = Object.defineProperty({ - get: function () { - return 0; - }, + Object.defineProperty(_a, 0, { + get: function () { return 0; }, enumerable: true, configurable: true }), - _a[a] = Object.defineProperty({ - set: function (v) { - }, + Object.defineProperty(_a, a, { + set: function (v) { }, enumerable: true, configurable: true }), - _a[true] = Object.defineProperty({ - get: function () { - return 0; - }, + Object.defineProperty(_a, true, { + get: function () { return 0; }, enumerable: true, configurable: true }), - _a["hello bye"] = Object.defineProperty({ - set: function (v) { - }, + Object.defineProperty(_a, "hello bye", { + set: function (v) { }, enumerable: true, configurable: true }), - _a["hello " + a + " bye"] = Object.defineProperty({ - get: function () { - return 0; - }, + Object.defineProperty(_a, "hello " + a + " bye", { + get: function () { return 0; }, enumerable: true, configurable: true }), - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames11_ES6.js b/tests/baselines/reference/computedPropertyNames11_ES6.js index 63f786e4634..f1a774b88fe 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES6.js +++ b/tests/baselines/reference/computedPropertyNames11_ES6.js @@ -21,32 +21,15 @@ var s; var n; var a; var v = { - get [s]() { - return 0; - }, - set [n](v) { - }, - get [s + s]() { - return 0; - }, - set [s + n](v) { - }, - get [+s]() { - return 0; - }, - set [""](v) { - }, - get [0]() { - return 0; - }, - set [a](v) { - }, - get [true]() { - return 0; - }, - set [`hello bye`](v) { - }, - get [`hello ${a} bye`]() { - return 0; - } + get [s]() { return 0; }, + set [n](v) { }, + get [s + s]() { return 0; }, + set [s + n](v) { }, + get [+s]() { return 0; }, + set [""](v) { }, + get [0]() { return 0; }, + set [a](v) { }, + get [true]() { return 0; }, + set [`hello bye`](v) { }, + get [`hello ${a} bye`]() { return 0; } }; diff --git a/tests/baselines/reference/computedPropertyNames13_ES5.js b/tests/baselines/reference/computedPropertyNames13_ES5.js index 7933d6f9830..89562162911 100644 --- a/tests/baselines/reference/computedPropertyNames13_ES5.js +++ b/tests/baselines/reference/computedPropertyNames13_ES5.js @@ -23,27 +23,16 @@ var a; var C = (function () { function C() { } - C.prototype[s] = function () { - }; - C.prototype[n] = function () { - }; - C[s + s] = function () { - }; - C.prototype[s + n] = function () { - }; - C.prototype[+s] = function () { - }; - C[""] = function () { - }; - C.prototype[0] = function () { - }; - C.prototype[a] = function () { - }; - C[true] = function () { - }; - C.prototype["hello bye"] = function () { - }; - C["hello " + a + " bye"] = function () { - }; + C.prototype[s] = function () { }; + C.prototype[n] = function () { }; + C[s + s] = function () { }; + C.prototype[s + n] = function () { }; + C.prototype[+s] = function () { }; + C[""] = function () { }; + C.prototype[0] = function () { }; + C.prototype[a] = function () { }; + C[true] = function () { }; + C.prototype["hello bye"] = function () { }; + C["hello " + a + " bye"] = function () { }; return C; })(); diff --git a/tests/baselines/reference/computedPropertyNames13_ES6.js b/tests/baselines/reference/computedPropertyNames13_ES6.js index 18d81fcec59..4d4c4372ebf 100644 --- a/tests/baselines/reference/computedPropertyNames13_ES6.js +++ b/tests/baselines/reference/computedPropertyNames13_ES6.js @@ -21,26 +21,15 @@ var s; var n; var a; class C { - [s]() { - } - [n]() { - } - static [s + s]() { - } - [s + n]() { - } - [+s]() { - } - static [""]() { - } - [0]() { - } - [a]() { - } - static [true]() { - } - [`hello bye`]() { - } - static [`hello ${a} bye`]() { - } + [s]() { } + [n]() { } + static [s + s]() { } + [s + n]() { } + [+s]() { } + static [""]() { } + [0]() { } + [a]() { } + static [true]() { } + [`hello bye`]() { } + static [`hello ${a} bye`]() { } } diff --git a/tests/baselines/reference/computedPropertyNames14_ES5.js b/tests/baselines/reference/computedPropertyNames14_ES5.js index 3a53e4106fc..5db5e842a2a 100644 --- a/tests/baselines/reference/computedPropertyNames14_ES5.js +++ b/tests/baselines/reference/computedPropertyNames14_ES5.js @@ -14,17 +14,11 @@ var b; var C = (function () { function C() { } - C.prototype[b] = function () { - }; - C[true] = function () { - }; - C.prototype[[]] = function () { - }; - C[{}] = function () { - }; - C.prototype[undefined] = function () { - }; - C[null] = function () { - }; + C.prototype[b] = function () { }; + C[true] = function () { }; + C.prototype[[]] = function () { }; + C[{}] = function () { }; + C.prototype[undefined] = function () { }; + C[null] = function () { }; return C; })(); diff --git a/tests/baselines/reference/computedPropertyNames14_ES6.js b/tests/baselines/reference/computedPropertyNames14_ES6.js index b1b2a9bf285..e925d6af9d4 100644 --- a/tests/baselines/reference/computedPropertyNames14_ES6.js +++ b/tests/baselines/reference/computedPropertyNames14_ES6.js @@ -12,16 +12,10 @@ class C { //// [computedPropertyNames14_ES6.js] var b; class C { - [b]() { - } - static [true]() { - } - [[]]() { - } - static [{}]() { - } - [undefined]() { - } - static [null]() { - } + [b]() { } + static [true]() { } + [[]]() { } + static [{}]() { } + [undefined]() { } + static [null]() { } } diff --git a/tests/baselines/reference/computedPropertyNames15_ES5.js b/tests/baselines/reference/computedPropertyNames15_ES5.js index 7e0db9855dd..93258b64c75 100644 --- a/tests/baselines/reference/computedPropertyNames15_ES5.js +++ b/tests/baselines/reference/computedPropertyNames15_ES5.js @@ -15,11 +15,8 @@ var p3; var C = (function () { function C() { } - C.prototype[p1] = function () { - }; - C.prototype[p2] = function () { - }; - C.prototype[p3] = function () { - }; + C.prototype[p1] = function () { }; + C.prototype[p2] = function () { }; + C.prototype[p3] = function () { }; return C; })(); diff --git a/tests/baselines/reference/computedPropertyNames15_ES6.js b/tests/baselines/reference/computedPropertyNames15_ES6.js index 1a9141ab13d..4cf6ca88146 100644 --- a/tests/baselines/reference/computedPropertyNames15_ES6.js +++ b/tests/baselines/reference/computedPropertyNames15_ES6.js @@ -13,10 +13,7 @@ var p1; var p2; var p3; class C { - [p1]() { - } - [p2]() { - } - [p3]() { - } + [p1]() { } + [p2]() { } + [p3]() { } } diff --git a/tests/baselines/reference/computedPropertyNames16_ES5.js b/tests/baselines/reference/computedPropertyNames16_ES5.js index b8c4991bee4..2c7316e1398 100644 --- a/tests/baselines/reference/computedPropertyNames16_ES5.js +++ b/tests/baselines/reference/computedPropertyNames16_ES5.js @@ -24,74 +24,57 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, s, { - get: function () { - return 0; - }, + get: function () { return 0; }, enumerable: true, configurable: true }); Object.defineProperty(C.prototype, n, { - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); Object.defineProperty(C, s + s, { - get: function () { - return 0; - }, + get: function () { return 0; }, enumerable: true, configurable: true }); Object.defineProperty(C.prototype, s + n, { - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); Object.defineProperty(C.prototype, +s, { - get: function () { - return 0; - }, + get: function () { return 0; }, enumerable: true, configurable: true }); Object.defineProperty(C, "", { - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); Object.defineProperty(C.prototype, 0, { - get: function () { - return 0; - }, + get: function () { return 0; }, enumerable: true, configurable: true }); Object.defineProperty(C.prototype, a, { - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); Object.defineProperty(C, true, { - get: function () { - return 0; - }, + get: function () { return 0; }, enumerable: true, configurable: true }); Object.defineProperty(C.prototype, "hello bye", { - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); Object.defineProperty(C.prototype, "hello " + a + " bye", { - get: function () { - return 0; - }, + get: function () { return 0; }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/computedPropertyNames16_ES6.js b/tests/baselines/reference/computedPropertyNames16_ES6.js index 96e175976da..aaec8db01a3 100644 --- a/tests/baselines/reference/computedPropertyNames16_ES6.js +++ b/tests/baselines/reference/computedPropertyNames16_ES6.js @@ -21,32 +21,15 @@ var s; var n; var a; class C { - get [s]() { - return 0; - } - set [n](v) { - } - static get [s + s]() { - return 0; - } - set [s + n](v) { - } - get [+s]() { - return 0; - } - static set [""](v) { - } - get [0]() { - return 0; - } - set [a](v) { - } - static get [true]() { - return 0; - } - set [`hello bye`](v) { - } - get [`hello ${a} bye`]() { - return 0; - } + get [s]() { return 0; } + set [n](v) { } + static get [s + s]() { return 0; } + set [s + n](v) { } + get [+s]() { return 0; } + static set [""](v) { } + get [0]() { return 0; } + set [a](v) { } + static get [true]() { return 0; } + set [`hello bye`](v) { } + get [`hello ${a} bye`]() { return 0; } } diff --git a/tests/baselines/reference/computedPropertyNames17_ES5.js b/tests/baselines/reference/computedPropertyNames17_ES5.js index 33bc5bfd3c8..3b5c100694d 100644 --- a/tests/baselines/reference/computedPropertyNames17_ES5.js +++ b/tests/baselines/reference/computedPropertyNames17_ES5.js @@ -15,41 +15,32 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, b, { - get: function () { - return 0; - }, + get: function () { return 0; }, enumerable: true, configurable: true }); Object.defineProperty(C, true, { - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); Object.defineProperty(C.prototype, [], { - get: function () { - return 0; - }, + get: function () { return 0; }, enumerable: true, configurable: true }); Object.defineProperty(C.prototype, {}, { - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); Object.defineProperty(C, undefined, { - get: function () { - return 0; - }, + get: function () { return 0; }, enumerable: true, configurable: true }); Object.defineProperty(C.prototype, null, { - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/computedPropertyNames17_ES6.js b/tests/baselines/reference/computedPropertyNames17_ES6.js index a181a61004e..5b1e87744c4 100644 --- a/tests/baselines/reference/computedPropertyNames17_ES6.js +++ b/tests/baselines/reference/computedPropertyNames17_ES6.js @@ -12,19 +12,10 @@ class C { //// [computedPropertyNames17_ES6.js] var b; class C { - get [b]() { - return 0; - } - static set [true](v) { - } - get [[]]() { - return 0; - } - set [{}](v) { - } - static get [undefined]() { - return 0; - } - set [null](v) { - } + get [b]() { return 0; } + static set [true](v) { } + get [[]]() { return 0; } + set [{}](v) { } + static get [undefined]() { return 0; } + set [null](v) { } } diff --git a/tests/baselines/reference/computedPropertyNames18_ES5.js b/tests/baselines/reference/computedPropertyNames18_ES5.js index a62af506531..b65c7fd4f7d 100644 --- a/tests/baselines/reference/computedPropertyNames18_ES5.js +++ b/tests/baselines/reference/computedPropertyNames18_ES5.js @@ -9,6 +9,7 @@ function foo() { function foo() { var obj = (_a = {}, _a[this.bar] = 0, - _a); + _a + ); var _a; } diff --git a/tests/baselines/reference/computedPropertyNames19_ES5.js b/tests/baselines/reference/computedPropertyNames19_ES5.js index bda3e01bbed..36f3e66c7c2 100644 --- a/tests/baselines/reference/computedPropertyNames19_ES5.js +++ b/tests/baselines/reference/computedPropertyNames19_ES5.js @@ -10,6 +10,7 @@ var M; (function (M) { var obj = (_a = {}, _a[this.bar] = 0, - _a); + _a + ); var _a; })(M || (M = {})); diff --git a/tests/baselines/reference/computedPropertyNames1_ES5.js b/tests/baselines/reference/computedPropertyNames1_ES5.js index 9acf507ecbc..4fdec28c7aa 100644 --- a/tests/baselines/reference/computedPropertyNames1_ES5.js +++ b/tests/baselines/reference/computedPropertyNames1_ES5.js @@ -6,18 +6,17 @@ var v = { //// [computedPropertyNames1_ES5.js] var v = (_a = {}, - _a[0 + 1] = Object.defineProperty({ - get: function () { - return 0; - }, + Object.defineProperty(_a, 0 + 1, { + get: function () { return 0; }, enumerable: true, configurable: true }), - _a[0 + 1] = Object.defineProperty({ - set: function (v) { - }, + Object.defineProperty(_a, 0 + 1, { + set: function (v) { } //No error + , enumerable: true, configurable: true }), - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames1_ES6.js b/tests/baselines/reference/computedPropertyNames1_ES6.js index 86cdd9c4333..80a7d2ecdd2 100644 --- a/tests/baselines/reference/computedPropertyNames1_ES6.js +++ b/tests/baselines/reference/computedPropertyNames1_ES6.js @@ -6,9 +6,6 @@ var v = { //// [computedPropertyNames1_ES6.js] var v = { - get [0 + 1]() { - return 0; - }, - set [0 + 1](v) { - } //No error + get [0 + 1]() { return 0; }, + set [0 + 1](v) { } //No error }; diff --git a/tests/baselines/reference/computedPropertyNames20_ES5.js b/tests/baselines/reference/computedPropertyNames20_ES5.js index 1eec0a7bcdb..65acd7fa08f 100644 --- a/tests/baselines/reference/computedPropertyNames20_ES5.js +++ b/tests/baselines/reference/computedPropertyNames20_ES5.js @@ -6,5 +6,6 @@ var obj = { //// [computedPropertyNames20_ES5.js] var obj = (_a = {}, _a[this.bar] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames21_ES5.js b/tests/baselines/reference/computedPropertyNames21_ES5.js index 2678cdc2286..81f95cd824d 100644 --- a/tests/baselines/reference/computedPropertyNames21_ES5.js +++ b/tests/baselines/reference/computedPropertyNames21_ES5.js @@ -13,7 +13,6 @@ var C = (function () { C.prototype.bar = function () { return 0; }; - C.prototype[this.bar()] = function () { - }; + C.prototype[this.bar()] = function () { }; return C; })(); diff --git a/tests/baselines/reference/computedPropertyNames21_ES6.js b/tests/baselines/reference/computedPropertyNames21_ES6.js index c5f6b4e22b1..5cee093bc4c 100644 --- a/tests/baselines/reference/computedPropertyNames21_ES6.js +++ b/tests/baselines/reference/computedPropertyNames21_ES6.js @@ -11,6 +11,5 @@ class C { bar() { return 0; } - [this.bar()]() { - } + [this.bar()]() { } } diff --git a/tests/baselines/reference/computedPropertyNames22_ES5.js b/tests/baselines/reference/computedPropertyNames22_ES5.js index b28e0ea68e2..e82bf673b52 100644 --- a/tests/baselines/reference/computedPropertyNames22_ES5.js +++ b/tests/baselines/reference/computedPropertyNames22_ES5.js @@ -14,9 +14,9 @@ var C = (function () { } C.prototype.bar = function () { var obj = (_a = {}, - _a[this.bar()] = function () { - }, - _a); + _a[this.bar()] = function () { }, + _a + ); return 0; var _a; }; diff --git a/tests/baselines/reference/computedPropertyNames22_ES6.js b/tests/baselines/reference/computedPropertyNames22_ES6.js index c88ceb6bc8f..5fd0487d233 100644 --- a/tests/baselines/reference/computedPropertyNames22_ES6.js +++ b/tests/baselines/reference/computedPropertyNames22_ES6.js @@ -12,8 +12,7 @@ class C { class C { bar() { var obj = { - [this.bar()]() { - } + [this.bar()]() { } }; return 0; } diff --git a/tests/baselines/reference/computedPropertyNames23_ES5.js b/tests/baselines/reference/computedPropertyNames23_ES5.js index 34eb0896376..8e42a29f7e7 100644 --- a/tests/baselines/reference/computedPropertyNames23_ES5.js +++ b/tests/baselines/reference/computedPropertyNames23_ES5.js @@ -15,10 +15,7 @@ var C = (function () { C.prototype.bar = function () { return 0; }; - C.prototype[(_a = {}, - _a[this.bar()] = 1, - _a)[0]] = function () { - }; + C.prototype[(_a = {}, _a[this.bar()] = 1, _a)[0]] = function () { }; return C; var _a; })(); diff --git a/tests/baselines/reference/computedPropertyNames23_ES6.js b/tests/baselines/reference/computedPropertyNames23_ES6.js index 0bae1abdad2..2103c26d197 100644 --- a/tests/baselines/reference/computedPropertyNames23_ES6.js +++ b/tests/baselines/reference/computedPropertyNames23_ES6.js @@ -13,8 +13,5 @@ class C { bar() { return 0; } - [{ - [this.bar()]: 1 - }[0]]() { - } + [{ [this.bar()]: 1 }[0]]() { } } diff --git a/tests/baselines/reference/computedPropertyNames24_ES5.js b/tests/baselines/reference/computedPropertyNames24_ES5.js index cea5240003b..3fd4d41d0c2 100644 --- a/tests/baselines/reference/computedPropertyNames24_ES5.js +++ b/tests/baselines/reference/computedPropertyNames24_ES5.js @@ -28,7 +28,6 @@ var C = (function (_super) { function C() { _super.apply(this, arguments); } - C.prototype[_super.bar.call(this)] = function () { - }; + C.prototype[_super.bar.call(this)] = function () { }; return C; })(Base); diff --git a/tests/baselines/reference/computedPropertyNames24_ES6.js b/tests/baselines/reference/computedPropertyNames24_ES6.js index 8d33db10f71..8441ae9111e 100644 --- a/tests/baselines/reference/computedPropertyNames24_ES6.js +++ b/tests/baselines/reference/computedPropertyNames24_ES6.js @@ -19,6 +19,5 @@ class Base { class C extends Base { // Gets emitted as super, not _super, which is consistent with // use of super in static properties initializers. - [super.bar()]() { - } + [super.bar()]() { } } diff --git a/tests/baselines/reference/computedPropertyNames25_ES5.js b/tests/baselines/reference/computedPropertyNames25_ES5.js index 4bcf877c571..b6a8d254b26 100644 --- a/tests/baselines/reference/computedPropertyNames25_ES5.js +++ b/tests/baselines/reference/computedPropertyNames25_ES5.js @@ -35,9 +35,9 @@ var C = (function (_super) { } C.prototype.foo = function () { var obj = (_a = {}, - _a[_super.prototype.bar.call(this)] = function () { - }, - _a); + _a[_super.prototype.bar.call(this)] = function () { }, + _a + ); return 0; var _a; }; diff --git a/tests/baselines/reference/computedPropertyNames25_ES6.js b/tests/baselines/reference/computedPropertyNames25_ES6.js index cc6a0670b21..5fa7071c652 100644 --- a/tests/baselines/reference/computedPropertyNames25_ES6.js +++ b/tests/baselines/reference/computedPropertyNames25_ES6.js @@ -22,8 +22,7 @@ class Base { class C extends Base { foo() { var obj = { - [super.bar()]() { - } + [super.bar()]() { } }; return 0; } diff --git a/tests/baselines/reference/computedPropertyNames26_ES5.js b/tests/baselines/reference/computedPropertyNames26_ES5.js index cac71f734a6..7a0a982eb41 100644 --- a/tests/baselines/reference/computedPropertyNames26_ES5.js +++ b/tests/baselines/reference/computedPropertyNames26_ES5.js @@ -30,10 +30,7 @@ var C = (function (_super) { function C() { _super.apply(this, arguments); } - C.prototype[(_a = {}, - _a[_super.bar.call(this)] = 1, - _a)[0]] = function () { - }; + C.prototype[(_a = {}, _a[_super.bar.call(this)] = 1, _a)[0]] = function () { }; return C; var _a; })(Base); diff --git a/tests/baselines/reference/computedPropertyNames26_ES6.js b/tests/baselines/reference/computedPropertyNames26_ES6.js index 4526368de7a..bdf65456e48 100644 --- a/tests/baselines/reference/computedPropertyNames26_ES6.js +++ b/tests/baselines/reference/computedPropertyNames26_ES6.js @@ -21,8 +21,5 @@ class Base { class C extends Base { // Gets emitted as super, not _super, which is consistent with // use of super in static properties initializers. - [{ - [super.bar()]: 1 - }[0]]() { - } + [{ [super.bar()]: 1 }[0]]() { } } diff --git a/tests/baselines/reference/computedPropertyNames27_ES5.js b/tests/baselines/reference/computedPropertyNames27_ES5.js index 2f550731dfb..df1fed09724 100644 --- a/tests/baselines/reference/computedPropertyNames27_ES5.js +++ b/tests/baselines/reference/computedPropertyNames27_ES5.js @@ -22,7 +22,6 @@ var C = (function (_super) { function C() { _super.apply(this, arguments); } - C.prototype[(_super.call(this), "prop")] = function () { - }; + C.prototype[(_super.call(this), "prop")] = function () { }; return C; })(Base); diff --git a/tests/baselines/reference/computedPropertyNames27_ES6.js b/tests/baselines/reference/computedPropertyNames27_ES6.js index 57589dfcaf5..947d9fafe13 100644 --- a/tests/baselines/reference/computedPropertyNames27_ES6.js +++ b/tests/baselines/reference/computedPropertyNames27_ES6.js @@ -9,6 +9,5 @@ class C extends Base { class Base { } class C extends Base { - [(super(), "prop")]() { - } + [(super(), "prop")]() { } } diff --git a/tests/baselines/reference/computedPropertyNames28_ES5.js b/tests/baselines/reference/computedPropertyNames28_ES5.js index 418252784a2..5940c498db8 100644 --- a/tests/baselines/reference/computedPropertyNames28_ES5.js +++ b/tests/baselines/reference/computedPropertyNames28_ES5.js @@ -27,9 +27,9 @@ var C = (function (_super) { function C() { _super.call(this); var obj = (_a = {}, - _a[(_super.call(this), "prop")] = function () { - }, - _a); + _a[(_super.call(this), "prop")] = function () { }, + _a + ); var _a; } return C; diff --git a/tests/baselines/reference/computedPropertyNames28_ES6.js b/tests/baselines/reference/computedPropertyNames28_ES6.js index bc0e32593de..0897df3d338 100644 --- a/tests/baselines/reference/computedPropertyNames28_ES6.js +++ b/tests/baselines/reference/computedPropertyNames28_ES6.js @@ -17,8 +17,7 @@ class C extends Base { constructor() { super(); var obj = { - [(super(), "prop")]() { - } + [(super(), "prop")]() { } }; } } diff --git a/tests/baselines/reference/computedPropertyNames29_ES5.js b/tests/baselines/reference/computedPropertyNames29_ES5.js index 93a80128d98..4682ae9105e 100644 --- a/tests/baselines/reference/computedPropertyNames29_ES5.js +++ b/tests/baselines/reference/computedPropertyNames29_ES5.js @@ -18,9 +18,9 @@ var C = (function () { var _this = this; (function () { var obj = (_a = {}, - _a[_this.bar()] = function () { - }, - _a); + _a[_this.bar()] = function () { }, + _a + ); var _a; }); return 0; diff --git a/tests/baselines/reference/computedPropertyNames29_ES6.js b/tests/baselines/reference/computedPropertyNames29_ES6.js index 35958b372b0..1aa479555d4 100644 --- a/tests/baselines/reference/computedPropertyNames29_ES6.js +++ b/tests/baselines/reference/computedPropertyNames29_ES6.js @@ -15,8 +15,7 @@ class C { bar() { (() => { var obj = { - [this.bar()]() { - } // needs capture + [this.bar()]() { } // needs capture }; }); return 0; diff --git a/tests/baselines/reference/computedPropertyNames2_ES5.js b/tests/baselines/reference/computedPropertyNames2_ES5.js index 97d9a673bbb..581b581d87b 100644 --- a/tests/baselines/reference/computedPropertyNames2_ES5.js +++ b/tests/baselines/reference/computedPropertyNames2_ES5.js @@ -16,31 +16,25 @@ var accessorName = "accessor"; var C = (function () { function C() { } - C.prototype[methodName] = function () { - }; - C[methodName] = function () { - }; + C.prototype[methodName] = function () { }; + C[methodName] = function () { }; Object.defineProperty(C.prototype, accessorName, { - get: function () { - }, + get: function () { }, enumerable: true, configurable: true }); Object.defineProperty(C.prototype, accessorName, { - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); Object.defineProperty(C, accessorName, { - get: function () { - }, + get: function () { }, enumerable: true, configurable: true }); Object.defineProperty(C, accessorName, { - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/computedPropertyNames2_ES6.js b/tests/baselines/reference/computedPropertyNames2_ES6.js index 4287cb2c4b8..9eeb1a609fd 100644 --- a/tests/baselines/reference/computedPropertyNames2_ES6.js +++ b/tests/baselines/reference/computedPropertyNames2_ES6.js @@ -14,16 +14,10 @@ class C { var methodName = "method"; var accessorName = "accessor"; class C { - [methodName]() { - } - static [methodName]() { - } - get [accessorName]() { - } - set [accessorName](v) { - } - static get [accessorName]() { - } - static set [accessorName](v) { - } + [methodName]() { } + static [methodName]() { } + get [accessorName]() { } + set [accessorName](v) { } + static get [accessorName]() { } + static set [accessorName](v) { } } diff --git a/tests/baselines/reference/computedPropertyNames30_ES5.js b/tests/baselines/reference/computedPropertyNames30_ES5.js index b11b651a0d5..05196e23c5b 100644 --- a/tests/baselines/reference/computedPropertyNames30_ES5.js +++ b/tests/baselines/reference/computedPropertyNames30_ES5.js @@ -33,9 +33,12 @@ var C = (function (_super) { _super.call(this); (function () { var obj = (_a = {}, - _a[(_super.call(this), "prop")] = function () { - }, - _a); + // Ideally, we would capture this. But the reference is + // illegal, and not capturing this is consistent with + //treatment of other similar violations. + _a[(_super.call(this), "prop")] = function () { }, + _a + ); var _a; }); } diff --git a/tests/baselines/reference/computedPropertyNames30_ES6.js b/tests/baselines/reference/computedPropertyNames30_ES6.js index cda2a278d47..44a475fed92 100644 --- a/tests/baselines/reference/computedPropertyNames30_ES6.js +++ b/tests/baselines/reference/computedPropertyNames30_ES6.js @@ -26,8 +26,7 @@ class C extends Base { // Ideally, we would capture this. But the reference is // illegal, and not capturing this is consistent with //treatment of other similar violations. - [(super(), "prop")]() { - } + [(super(), "prop")]() { } }; }); } diff --git a/tests/baselines/reference/computedPropertyNames31_ES5.js b/tests/baselines/reference/computedPropertyNames31_ES5.js index a079b3fa449..173e3c7222b 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES5.js +++ b/tests/baselines/reference/computedPropertyNames31_ES5.js @@ -39,9 +39,9 @@ var C = (function (_super) { var _this = this; (function () { var obj = (_a = {}, - _a[_super.prototype.bar.call(_this)] = function () { - }, - _a); + _a[_super.prototype.bar.call(_this)] = function () { }, + _a + ); var _a; }); return 0; diff --git a/tests/baselines/reference/computedPropertyNames31_ES6.js b/tests/baselines/reference/computedPropertyNames31_ES6.js index 777e03bbcac..2c63dcee077 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES6.js +++ b/tests/baselines/reference/computedPropertyNames31_ES6.js @@ -26,8 +26,7 @@ class C extends Base { var _this = this; (() => { var obj = { - [super.bar()]() { - } // needs capture + [super.bar()]() { } // needs capture }; }); return 0; diff --git a/tests/baselines/reference/computedPropertyNames32_ES5.js b/tests/baselines/reference/computedPropertyNames32_ES5.js index 5a541202582..a0d8b066b5c 100644 --- a/tests/baselines/reference/computedPropertyNames32_ES5.js +++ b/tests/baselines/reference/computedPropertyNames32_ES5.js @@ -8,16 +8,13 @@ class C { } //// [computedPropertyNames32_ES5.js] -function foo() { - return ''; -} +function foo() { return ''; } var C = (function () { function C() { } C.prototype.bar = function () { return 0; }; - C.prototype[foo()] = function () { - }; + C.prototype[foo()] = function () { }; return C; })(); diff --git a/tests/baselines/reference/computedPropertyNames32_ES6.js b/tests/baselines/reference/computedPropertyNames32_ES6.js index 198c5e9981e..07d331d923b 100644 --- a/tests/baselines/reference/computedPropertyNames32_ES6.js +++ b/tests/baselines/reference/computedPropertyNames32_ES6.js @@ -8,13 +8,10 @@ class C { } //// [computedPropertyNames32_ES6.js] -function foo() { - return ''; -} +function foo() { return ''; } class C { bar() { return 0; } - [foo()]() { - } + [foo()]() { } } diff --git a/tests/baselines/reference/computedPropertyNames33_ES5.js b/tests/baselines/reference/computedPropertyNames33_ES5.js index 24362351196..38029893bb1 100644 --- a/tests/baselines/reference/computedPropertyNames33_ES5.js +++ b/tests/baselines/reference/computedPropertyNames33_ES5.js @@ -10,17 +10,15 @@ class C { } //// [computedPropertyNames33_ES5.js] -function foo() { - return ''; -} +function foo() { return ''; } var C = (function () { function C() { } C.prototype.bar = function () { var obj = (_a = {}, - _a[foo()] = function () { - }, - _a); + _a[foo()] = function () { }, + _a + ); return 0; var _a; }; diff --git a/tests/baselines/reference/computedPropertyNames33_ES6.js b/tests/baselines/reference/computedPropertyNames33_ES6.js index 7fb08d2852d..2a74f486342 100644 --- a/tests/baselines/reference/computedPropertyNames33_ES6.js +++ b/tests/baselines/reference/computedPropertyNames33_ES6.js @@ -10,14 +10,11 @@ class C { } //// [computedPropertyNames33_ES6.js] -function foo() { - return ''; -} +function foo() { return ''; } class C { bar() { var obj = { - [foo()]() { - } + [foo()]() { } }; return 0; } diff --git a/tests/baselines/reference/computedPropertyNames34_ES5.js b/tests/baselines/reference/computedPropertyNames34_ES5.js index 83e757222b0..4e5790c53b1 100644 --- a/tests/baselines/reference/computedPropertyNames34_ES5.js +++ b/tests/baselines/reference/computedPropertyNames34_ES5.js @@ -10,17 +10,15 @@ class C { } //// [computedPropertyNames34_ES5.js] -function foo() { - return ''; -} +function foo() { return ''; } var C = (function () { function C() { } C.bar = function () { var obj = (_a = {}, - _a[foo()] = function () { - }, - _a); + _a[foo()] = function () { }, + _a + ); return 0; var _a; }; diff --git a/tests/baselines/reference/computedPropertyNames34_ES6.js b/tests/baselines/reference/computedPropertyNames34_ES6.js index e73d349bcd7..69528052849 100644 --- a/tests/baselines/reference/computedPropertyNames34_ES6.js +++ b/tests/baselines/reference/computedPropertyNames34_ES6.js @@ -10,14 +10,11 @@ class C { } //// [computedPropertyNames34_ES6.js] -function foo() { - return ''; -} +function foo() { return ''; } class C { static bar() { var obj = { - [foo()]() { - } + [foo()]() { } }; return 0; } diff --git a/tests/baselines/reference/computedPropertyNames35_ES5.js b/tests/baselines/reference/computedPropertyNames35_ES5.js index b55743a2d83..0804c946f1f 100644 --- a/tests/baselines/reference/computedPropertyNames35_ES5.js +++ b/tests/baselines/reference/computedPropertyNames35_ES5.js @@ -6,6 +6,4 @@ interface I { } //// [computedPropertyNames35_ES5.js] -function foo() { - return ''; -} +function foo() { return ''; } diff --git a/tests/baselines/reference/computedPropertyNames35_ES6.js b/tests/baselines/reference/computedPropertyNames35_ES6.js index b08d7c0f312..2d3f4088315 100644 --- a/tests/baselines/reference/computedPropertyNames35_ES6.js +++ b/tests/baselines/reference/computedPropertyNames35_ES6.js @@ -6,6 +6,4 @@ interface I { } //// [computedPropertyNames35_ES6.js] -function foo() { - return ''; -} +function foo() { return ''; } diff --git a/tests/baselines/reference/computedPropertyNames36_ES5.js b/tests/baselines/reference/computedPropertyNames36_ES5.js index fa92da7b7b6..5519a6d284c 100644 --- a/tests/baselines/reference/computedPropertyNames36_ES5.js +++ b/tests/baselines/reference/computedPropertyNames36_ES5.js @@ -26,15 +26,12 @@ var C = (function () { } Object.defineProperty(C.prototype, "get1", { // Computed properties - get: function () { - return new Foo; - }, + get: function () { return new Foo; }, enumerable: true, configurable: true }); Object.defineProperty(C.prototype, "set1", { - set: function (p) { - }, + set: function (p) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/computedPropertyNames36_ES6.js b/tests/baselines/reference/computedPropertyNames36_ES6.js index 573b8fa0c17..5d10ceef310 100644 --- a/tests/baselines/reference/computedPropertyNames36_ES6.js +++ b/tests/baselines/reference/computedPropertyNames36_ES6.js @@ -17,9 +17,6 @@ class Foo2 { } class C { // Computed properties - get ["get1"]() { - return new Foo; - } - set ["set1"](p) { - } + get ["get1"]() { return new Foo; } + set ["set1"](p) { } } diff --git a/tests/baselines/reference/computedPropertyNames37_ES5.js b/tests/baselines/reference/computedPropertyNames37_ES5.js index f185e93db3c..54a7243f3fa 100644 --- a/tests/baselines/reference/computedPropertyNames37_ES5.js +++ b/tests/baselines/reference/computedPropertyNames37_ES5.js @@ -26,15 +26,12 @@ var C = (function () { } Object.defineProperty(C.prototype, "get1", { // Computed properties - get: function () { - return new Foo; - }, + get: function () { return new Foo; }, enumerable: true, configurable: true }); Object.defineProperty(C.prototype, "set1", { - set: function (p) { - }, + set: function (p) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/computedPropertyNames37_ES6.js b/tests/baselines/reference/computedPropertyNames37_ES6.js index d62c95e6f8c..025df25d055 100644 --- a/tests/baselines/reference/computedPropertyNames37_ES6.js +++ b/tests/baselines/reference/computedPropertyNames37_ES6.js @@ -17,9 +17,6 @@ class Foo2 { } class C { // Computed properties - get ["get1"]() { - return new Foo; - } - set ["set1"](p) { - } + get ["get1"]() { return new Foo; } + set ["set1"](p) { } } diff --git a/tests/baselines/reference/computedPropertyNames38_ES5.js b/tests/baselines/reference/computedPropertyNames38_ES5.js index 42115927b30..49af4d00d51 100644 --- a/tests/baselines/reference/computedPropertyNames38_ES5.js +++ b/tests/baselines/reference/computedPropertyNames38_ES5.js @@ -26,15 +26,12 @@ var C = (function () { } Object.defineProperty(C.prototype, 1 << 6, { // Computed properties - get: function () { - return new Foo; - }, + get: function () { return new Foo; }, enumerable: true, configurable: true }); Object.defineProperty(C.prototype, 1 << 6, { - set: function (p) { - }, + set: function (p) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/computedPropertyNames38_ES6.js b/tests/baselines/reference/computedPropertyNames38_ES6.js index cf1d01873f2..ea87afedcc4 100644 --- a/tests/baselines/reference/computedPropertyNames38_ES6.js +++ b/tests/baselines/reference/computedPropertyNames38_ES6.js @@ -17,9 +17,6 @@ class Foo2 { } class C { // Computed properties - get [1 << 6]() { - return new Foo; - } - set [1 << 6](p) { - } + get [1 << 6]() { return new Foo; } + set [1 << 6](p) { } } diff --git a/tests/baselines/reference/computedPropertyNames39_ES5.js b/tests/baselines/reference/computedPropertyNames39_ES5.js index 12cc55f1315..1b8d3aab2ff 100644 --- a/tests/baselines/reference/computedPropertyNames39_ES5.js +++ b/tests/baselines/reference/computedPropertyNames39_ES5.js @@ -26,15 +26,12 @@ var C = (function () { } Object.defineProperty(C.prototype, 1 << 6, { // Computed properties - get: function () { - return new Foo; - }, + get: function () { return new Foo; }, enumerable: true, configurable: true }); Object.defineProperty(C.prototype, 1 << 6, { - set: function (p) { - }, + set: function (p) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/computedPropertyNames39_ES6.js b/tests/baselines/reference/computedPropertyNames39_ES6.js index 9afd60b6464..a874140da0f 100644 --- a/tests/baselines/reference/computedPropertyNames39_ES6.js +++ b/tests/baselines/reference/computedPropertyNames39_ES6.js @@ -17,9 +17,6 @@ class Foo2 { } class C { // Computed properties - get [1 << 6]() { - return new Foo; - } - set [1 << 6](p) { - } + get [1 << 6]() { return new Foo; } + set [1 << 6](p) { } } diff --git a/tests/baselines/reference/computedPropertyNames3_ES5.errors.txt b/tests/baselines/reference/computedPropertyNames3_ES5.errors.txt index 82e4b71b33b..a31965dc69e 100644 --- a/tests/baselines/reference/computedPropertyNames3_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNames3_ES5.errors.txt @@ -1,12 +1,13 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(4,12): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(5,9): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(5,9): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. +tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(5,17): error TS1102: 'delete' cannot be called on an identifier in strict mode. tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(6,9): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(7,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(7,16): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. -==== tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts (6 errors) ==== +==== tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts (7 errors) ==== var id; class C { [0 + 1]() { } @@ -18,6 +19,8 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(7,1 !!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. ~~~~~~~~~~~ !!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. + ~~ +!!! error TS1102: 'delete' cannot be called on an identifier in strict mode. set [[0, 1]](v) { } ~~~~~~~~ !!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. diff --git a/tests/baselines/reference/computedPropertyNames3_ES5.js b/tests/baselines/reference/computedPropertyNames3_ES5.js index 09440d5601f..f5a063f91e6 100644 --- a/tests/baselines/reference/computedPropertyNames3_ES5.js +++ b/tests/baselines/reference/computedPropertyNames3_ES5.js @@ -14,35 +14,25 @@ var id; var C = (function () { function C() { } - C.prototype[0 + 1] = function () { - }; - C[function () { - }] = function () { - }; + C.prototype[0 + 1] = function () { }; + C[function () { }] = function () { }; Object.defineProperty(C.prototype, delete id, { - get: function () { - }, + get: function () { }, enumerable: true, configurable: true }); - Object.defineProperty(C.prototype, [ - 0, - 1 - ], { - set: function (v) { - }, + Object.defineProperty(C.prototype, [0, 1], { + set: function (v) { }, enumerable: true, configurable: true }); Object.defineProperty(C, "", { - get: function () { - }, + get: function () { }, enumerable: true, configurable: true }); Object.defineProperty(C, id.toString(), { - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/computedPropertyNames3_ES6.js b/tests/baselines/reference/computedPropertyNames3_ES6.js index b5fb9e88001..d12d7d18660 100644 --- a/tests/baselines/reference/computedPropertyNames3_ES6.js +++ b/tests/baselines/reference/computedPropertyNames3_ES6.js @@ -12,20 +12,10 @@ class C { //// [computedPropertyNames3_ES6.js] var id; class C { - [0 + 1]() { - } - static [() => { - }]() { - } - get [delete id]() { - } - set [[ - 0, - 1 - ]](v) { - } - static get [""]() { - } - static set [id.toString()](v) { - } + [0 + 1]() { } + static [() => { }]() { } + get [delete id]() { } + set [[0, 1]](v) { } + static get [""]() { } + static set [id.toString()](v) { } } diff --git a/tests/baselines/reference/computedPropertyNames40_ES5.js b/tests/baselines/reference/computedPropertyNames40_ES5.js index 887c5c3847e..e8063762026 100644 --- a/tests/baselines/reference/computedPropertyNames40_ES5.js +++ b/tests/baselines/reference/computedPropertyNames40_ES5.js @@ -25,11 +25,7 @@ var C = (function () { function C() { } // Computed properties - C.prototype[""] = function () { - return new Foo; - }; - C.prototype[""] = function () { - return new Foo2; - }; + C.prototype[""] = function () { return new Foo; }; + C.prototype[""] = function () { return new Foo2; }; return C; })(); diff --git a/tests/baselines/reference/computedPropertyNames40_ES6.js b/tests/baselines/reference/computedPropertyNames40_ES6.js index c4820e0ca98..af566425d56 100644 --- a/tests/baselines/reference/computedPropertyNames40_ES6.js +++ b/tests/baselines/reference/computedPropertyNames40_ES6.js @@ -17,10 +17,6 @@ class Foo2 { } class C { // Computed properties - [""]() { - return new Foo; - } - [""]() { - return new Foo2; - } + [""]() { return new Foo; } + [""]() { return new Foo2; } } diff --git a/tests/baselines/reference/computedPropertyNames41_ES5.js b/tests/baselines/reference/computedPropertyNames41_ES5.js index b4223ec5217..7d7c390bf3e 100644 --- a/tests/baselines/reference/computedPropertyNames41_ES5.js +++ b/tests/baselines/reference/computedPropertyNames41_ES5.js @@ -24,8 +24,6 @@ var C = (function () { function C() { } // Computed properties - C[""] = function () { - return new Foo; - }; + C[""] = function () { return new Foo; }; return C; })(); diff --git a/tests/baselines/reference/computedPropertyNames41_ES6.js b/tests/baselines/reference/computedPropertyNames41_ES6.js index 5773f892fd5..b27f8da01d1 100644 --- a/tests/baselines/reference/computedPropertyNames41_ES6.js +++ b/tests/baselines/reference/computedPropertyNames41_ES6.js @@ -16,7 +16,5 @@ class Foo2 { } class C { // Computed properties - static [""]() { - return new Foo; - } + static [""]() { return new Foo; } } diff --git a/tests/baselines/reference/computedPropertyNames43_ES5.js b/tests/baselines/reference/computedPropertyNames43_ES5.js index f7faa347986..b689f02ee98 100644 --- a/tests/baselines/reference/computedPropertyNames43_ES5.js +++ b/tests/baselines/reference/computedPropertyNames43_ES5.js @@ -41,15 +41,12 @@ var D = (function (_super) { } Object.defineProperty(D.prototype, "get1", { // Computed properties - get: function () { - return new Foo; - }, + get: function () { return new Foo; }, enumerable: true, configurable: true }); Object.defineProperty(D.prototype, "set1", { - set: function (p) { - }, + set: function (p) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/computedPropertyNames43_ES6.js b/tests/baselines/reference/computedPropertyNames43_ES6.js index ab9d09834d2..346c2a0d30d 100644 --- a/tests/baselines/reference/computedPropertyNames43_ES6.js +++ b/tests/baselines/reference/computedPropertyNames43_ES6.js @@ -21,9 +21,6 @@ class C { } class D extends C { // Computed properties - get ["get1"]() { - return new Foo; - } - set ["set1"](p) { - } + get ["get1"]() { return new Foo; } + set ["set1"](p) { } } diff --git a/tests/baselines/reference/computedPropertyNames44_ES5.js b/tests/baselines/reference/computedPropertyNames44_ES5.js index 072b3e90681..32d3505e252 100644 --- a/tests/baselines/reference/computedPropertyNames44_ES5.js +++ b/tests/baselines/reference/computedPropertyNames44_ES5.js @@ -32,9 +32,7 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "get1", { - get: function () { - return new Foo; - }, + get: function () { return new Foo; }, enumerable: true, configurable: true }); @@ -46,8 +44,7 @@ var D = (function (_super) { _super.apply(this, arguments); } Object.defineProperty(D.prototype, "set1", { - set: function (p) { - }, + set: function (p) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/computedPropertyNames44_ES6.js b/tests/baselines/reference/computedPropertyNames44_ES6.js index 13d46131e92..cd1b8c5da2d 100644 --- a/tests/baselines/reference/computedPropertyNames44_ES6.js +++ b/tests/baselines/reference/computedPropertyNames44_ES6.js @@ -17,11 +17,8 @@ class Foo { class Foo2 { } class C { - get ["get1"]() { - return new Foo; - } + get ["get1"]() { return new Foo; } } class D extends C { - set ["set1"](p) { - } + set ["set1"](p) { } } diff --git a/tests/baselines/reference/computedPropertyNames45_ES5.js b/tests/baselines/reference/computedPropertyNames45_ES5.js index 4389b32a835..3d924b00b73 100644 --- a/tests/baselines/reference/computedPropertyNames45_ES5.js +++ b/tests/baselines/reference/computedPropertyNames45_ES5.js @@ -33,9 +33,7 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "get1", { - get: function () { - return new Foo; - }, + get: function () { return new Foo; }, enumerable: true, configurable: true }); @@ -47,8 +45,7 @@ var D = (function (_super) { _super.apply(this, arguments); } Object.defineProperty(D.prototype, "set1", { - set: function (p) { - }, + set: function (p) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/computedPropertyNames45_ES6.js b/tests/baselines/reference/computedPropertyNames45_ES6.js index bea5f5211ea..2c01d7625ec 100644 --- a/tests/baselines/reference/computedPropertyNames45_ES6.js +++ b/tests/baselines/reference/computedPropertyNames45_ES6.js @@ -18,11 +18,8 @@ class Foo { class Foo2 { } class C { - get ["get1"]() { - return new Foo; - } + get ["get1"]() { return new Foo; } } class D extends C { - set ["set1"](p) { - } + set ["set1"](p) { } } diff --git a/tests/baselines/reference/computedPropertyNames46_ES5.js b/tests/baselines/reference/computedPropertyNames46_ES5.js index 815f5769f3b..307dadcbe91 100644 --- a/tests/baselines/reference/computedPropertyNames46_ES5.js +++ b/tests/baselines/reference/computedPropertyNames46_ES5.js @@ -6,5 +6,6 @@ var o = { //// [computedPropertyNames46_ES5.js] var o = (_a = {}, _a["" || 0] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames47_ES5.js b/tests/baselines/reference/computedPropertyNames47_ES5.js index a2fff2110b4..d03b614b29b 100644 --- a/tests/baselines/reference/computedPropertyNames47_ES5.js +++ b/tests/baselines/reference/computedPropertyNames47_ES5.js @@ -16,5 +16,6 @@ var E2; })(E2 || (E2 = {})); var o = (_a = {}, _a[E1.x || E2.x] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames48_ES5.js b/tests/baselines/reference/computedPropertyNames48_ES5.js index 55b08ef8301..15123a98f30 100644 --- a/tests/baselines/reference/computedPropertyNames48_ES5.js +++ b/tests/baselines/reference/computedPropertyNames48_ES5.js @@ -25,11 +25,14 @@ var E; var a; extractIndexer((_a = {}, _a[a] = "", - _a)); // Should return string + _a +)); // Should return string extractIndexer((_b = {}, _b[E.x] = "", - _b)); // Should return string + _b +)); // Should return string extractIndexer((_c = {}, _c["" || 0] = "", - _c)); // Should return any (widened form of undefined) + _c +)); // Should return any (widened form of undefined) var _a, _b, _c; diff --git a/tests/baselines/reference/computedPropertyNames49_ES5.js b/tests/baselines/reference/computedPropertyNames49_ES5.js index 27730d56df8..3427ea665a0 100644 --- a/tests/baselines/reference/computedPropertyNames49_ES5.js +++ b/tests/baselines/reference/computedPropertyNames49_ES5.js @@ -27,24 +27,23 @@ var x = { //// [computedPropertyNames49_ES5.js] var x = (_a = { - p1: 10 -}, - _a.p1 = 10, - _a[1 + 1] = Object.defineProperty({ + p1: 10 + }, + Object.defineProperty(_a, 1 + 1, { get: function () { throw 10; }, enumerable: true, configurable: true }), - _a[1 + 1] = Object.defineProperty({ + Object.defineProperty(_a, 1 + 1, { get: function () { return 10; }, enumerable: true, configurable: true }), - _a[1 + 1] = Object.defineProperty({ + Object.defineProperty(_a, 1 + 1, { set: function () { // just throw throw 10; @@ -52,7 +51,7 @@ var x = (_a = { enumerable: true, configurable: true }), - _a.foo = Object.defineProperty({ + Object.defineProperty(_a, "foo", { get: function () { if (1 == 1) { return 10; @@ -61,6 +60,8 @@ var x = (_a = { enumerable: true, configurable: true }), + , _a.p2 = 20, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames4_ES5.js b/tests/baselines/reference/computedPropertyNames4_ES5.js index ac0fa8ec937..f91476c79c1 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES5.js +++ b/tests/baselines/reference/computedPropertyNames4_ES5.js @@ -32,5 +32,6 @@ var v = (_a = {}, _a[true] = 0, _a["hello bye"] = 0, _a["hello " + a + " bye"] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames50_ES5.js b/tests/baselines/reference/computedPropertyNames50_ES5.js index 4221a21a763..a74561295be 100644 --- a/tests/baselines/reference/computedPropertyNames50_ES5.js +++ b/tests/baselines/reference/computedPropertyNames50_ES5.js @@ -27,31 +27,21 @@ var x = { //// [computedPropertyNames50_ES5.js] var x = (_a = { - p1: 10, - get foo() { - if (1 == 1) { - return 10; - } - } -}, - _a.p1 = 10, - _a.foo = Object.defineProperty({ - get: function () { + p1: 10, + get foo() { if (1 == 1) { return 10; } - }, - enumerable: true, - configurable: true - }), - _a[1 + 1] = Object.defineProperty({ + } + }, + Object.defineProperty(_a, 1 + 1, { get: function () { throw 10; }, enumerable: true, configurable: true }), - _a[1 + 1] = Object.defineProperty({ + Object.defineProperty(_a, 1 + 1, { set: function () { // just throw throw 10; @@ -59,13 +49,15 @@ var x = (_a = { enumerable: true, configurable: true }), - _a[1 + 1] = Object.defineProperty({ + Object.defineProperty(_a, 1 + 1, { get: function () { return 10; }, enumerable: true, configurable: true }), + , _a.p2 = 20, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames5_ES5.js b/tests/baselines/reference/computedPropertyNames5_ES5.js index 3367faa2c20..58c5af2efa3 100644 --- a/tests/baselines/reference/computedPropertyNames5_ES5.js +++ b/tests/baselines/reference/computedPropertyNames5_ES5.js @@ -18,5 +18,6 @@ var v = (_a = {}, _a[{}] = 0, _a[undefined] = undefined, _a[null] = null, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames6_ES5.js b/tests/baselines/reference/computedPropertyNames6_ES5.js index 29d035bfcbf..7e9c6202940 100644 --- a/tests/baselines/reference/computedPropertyNames6_ES5.js +++ b/tests/baselines/reference/computedPropertyNames6_ES5.js @@ -16,5 +16,6 @@ var v = (_a = {}, _a[p1] = 0, _a[p2] = 1, _a[p3] = 2, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames7_ES5.js b/tests/baselines/reference/computedPropertyNames7_ES5.js index 01cf2efc030..3311ec7e092 100644 --- a/tests/baselines/reference/computedPropertyNames7_ES5.js +++ b/tests/baselines/reference/computedPropertyNames7_ES5.js @@ -13,5 +13,6 @@ var E; })(E || (E = {})); var v = (_a = {}, _a[E.member] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames8_ES5.js b/tests/baselines/reference/computedPropertyNames8_ES5.js index 82d262c7e4e..6eceee81adb 100644 --- a/tests/baselines/reference/computedPropertyNames8_ES5.js +++ b/tests/baselines/reference/computedPropertyNames8_ES5.js @@ -15,6 +15,7 @@ function f() { var v = (_a = {}, _a[t] = 0, _a[u] = 1, - _a); + _a + ); var _a; } diff --git a/tests/baselines/reference/computedPropertyNames9_ES5.js b/tests/baselines/reference/computedPropertyNames9_ES5.js index 1b4fa16de2d..6c1d7bcb4d0 100644 --- a/tests/baselines/reference/computedPropertyNames9_ES5.js +++ b/tests/baselines/reference/computedPropertyNames9_ES5.js @@ -11,11 +11,11 @@ var v = { } //// [computedPropertyNames9_ES5.js] -function f(x) { -} +function f(x) { } var v = (_a = {}, _a[f("")] = 0, _a[f(0)] = 0, _a[f(true)] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames9_ES6.js b/tests/baselines/reference/computedPropertyNames9_ES6.js index 8f111935b06..b0e66c81cbd 100644 --- a/tests/baselines/reference/computedPropertyNames9_ES6.js +++ b/tests/baselines/reference/computedPropertyNames9_ES6.js @@ -11,8 +11,7 @@ var v = { } //// [computedPropertyNames9_ES6.js] -function f(x) { -} +function f(x) { } var v = { [f("")]: 0, [f(0)]: 0, diff --git a/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.js index d8a33951d4a..1f7a3ae123e 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.js @@ -12,5 +12,6 @@ var o: I = { var o = (_a = {}, _a[+"foo"] = "", _a[+"bar"] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.js index a74e04937c0..c4bfde03531 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.js @@ -11,11 +11,8 @@ var o: I = { //// [computedPropertyNamesContextualType1_ES5.js] var o = (_a = {}, - _a["" + 0] = function (y) { - return y.length; - }, - _a["" + 1] = function (y) { - return y.length; - }, - _a); + _a["" + 0] = function (y) { return y.length; }, + _a["" + 1] = function (y) { return y.length; }, + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.js b/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.js index b202d656b73..4c4dfb9f9a6 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.js @@ -11,8 +11,6 @@ var o: I = { //// [computedPropertyNamesContextualType1_ES6.js] var o = { - ["" + 0](y) { - return y.length; - }, + ["" + 0](y) { return y.length; }, ["" + 1]: y => y.length }; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.js index b33ff276fcd..945475f8533 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.js @@ -11,11 +11,8 @@ var o: I = { //// [computedPropertyNamesContextualType2_ES5.js] var o = (_a = {}, - _a[+"foo"] = function (y) { - return y.length; - }, - _a[+"bar"] = function (y) { - return y.length; - }, - _a); + _a[+"foo"] = function (y) { return y.length; }, + _a[+"bar"] = function (y) { return y.length; }, + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.js b/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.js index 6be2c11cc5e..1f0704ce8a7 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.js @@ -11,8 +11,6 @@ var o: I = { //// [computedPropertyNamesContextualType2_ES6.js] var o = { - [+"foo"](y) { - return y.length; - }, + [+"foo"](y) { return y.length; }, [+"bar"]: y => y.length }; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.js index c3f189a5780..98042f201e3 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.js @@ -10,11 +10,8 @@ var o: I = { //// [computedPropertyNamesContextualType3_ES5.js] var o = (_a = {}, - _a[+"foo"] = function (y) { - return y.length; - }, - _a[+"bar"] = function (y) { - return y.length; - }, - _a); + _a[+"foo"] = function (y) { return y.length; }, + _a[+"bar"] = function (y) { return y.length; }, + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.js b/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.js index 6124271a576..08d39bbeae3 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.js @@ -10,8 +10,6 @@ var o: I = { //// [computedPropertyNamesContextualType3_ES6.js] var o = { - [+"foo"](y) { - return y.length; - }, + [+"foo"](y) { return y.length; }, [+"bar"]: y => y.length }; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.js index 0c319a526f4..b17f91be38b 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.js @@ -13,5 +13,6 @@ var o: I = { var o = (_a = {}, _a["" + "foo"] = "", _a["" + "bar"] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.js index 51d78be59d4..c7a728e5ef8 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.js @@ -13,5 +13,6 @@ var o: I = { var o = (_a = {}, _a[+"foo"] = "", _a[+"bar"] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.js index d60690a249e..c97b7c5b1f8 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.js @@ -15,17 +15,12 @@ foo({ //// [computedPropertyNamesContextualType6_ES5.js] foo((_a = { - p: "", - 0: function () { - } -}, - _a.p = "", - _a[0] = function () { + p: "", + 0: function () { } }, _a["hi" + "bye"] = true, _a[0 + 1] = 0, - _a[+"hi"] = [ - 0 - ], - _a)); + _a[+"hi"] = [0], + _a +)); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.js b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.js index e7218fff232..1360cc20028 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.js @@ -16,11 +16,8 @@ foo({ //// [computedPropertyNamesContextualType6_ES6.js] foo({ p: "", - 0: () => { - }, + 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, - [+"hi"]: [ - 0 - ] + [+"hi"]: [0] }); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.js index 02c2ffa734a..9ca7e826aa7 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.js @@ -15,17 +15,12 @@ foo({ //// [computedPropertyNamesContextualType7_ES5.js] foo((_a = { - p: "", - 0: function () { - } -}, - _a.p = "", - _a[0] = function () { + p: "", + 0: function () { } }, _a["hi" + "bye"] = true, _a[0 + 1] = 0, - _a[+"hi"] = [ - 0 - ], - _a)); + _a[+"hi"] = [0], + _a +)); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.js b/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.js index d6b50e93aeb..185ccd72ead 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.js @@ -16,11 +16,8 @@ foo({ //// [computedPropertyNamesContextualType7_ES6.js] foo({ p: "", - 0: () => { - }, + 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, - [+"hi"]: [ - 0 - ] + [+"hi"]: [0] }); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.js index 24f6218864c..419ea906550 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.js @@ -13,5 +13,6 @@ var o: I = { var o = (_a = {}, _a["" + "foo"] = "", _a["" + "bar"] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.js index 340802da2af..d3beb8b8deb 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.js @@ -13,5 +13,6 @@ var o: I = { var o = (_a = {}, _a[+"foo"] = "", _a[+"bar"] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.js index c091003735c..84b92f6c92d 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.js @@ -9,18 +9,14 @@ class C { var C = (function () { function C() { } - C.prototype["" + ""] = function () { - }; + C.prototype["" + ""] = function () { }; Object.defineProperty(C.prototype, "" + "", { - get: function () { - return 0; - }, + get: function () { return 0; }, enumerable: true, configurable: true }); Object.defineProperty(C.prototype, "" + "", { - set: function (x) { - }, + set: function (x) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.js index f234ae0d97e..2cdb6e34608 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.js @@ -7,13 +7,9 @@ class C { //// [computedPropertyNamesDeclarationEmit1_ES6.js] class C { - ["" + ""]() { - } - get ["" + ""]() { - return 0; - } - set ["" + ""](x) { - } + ["" + ""]() { } + get ["" + ""]() { return 0; } + set ["" + ""](x) { } } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.js index 22a5b0d305d..9847ea8b7ef 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.js @@ -9,18 +9,14 @@ class C { var C = (function () { function C() { } - C["" + ""] = function () { - }; + C["" + ""] = function () { }; Object.defineProperty(C, "" + "", { - get: function () { - return 0; - }, + get: function () { return 0; }, enumerable: true, configurable: true }); Object.defineProperty(C, "" + "", { - set: function (x) { - }, + set: function (x) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.js index b5e70193b0d..d8934f6c809 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.js @@ -7,13 +7,9 @@ class C { //// [computedPropertyNamesDeclarationEmit2_ES6.js] class C { - static ["" + ""]() { - } - static get ["" + ""]() { - return 0; - } - static set ["" + ""](x) { - } + static ["" + ""]() { } + static get ["" + ""]() { return 0; } + static set ["" + ""](x) { } } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.js index 047a8cdb333..e77eb79dc70 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.js @@ -9,22 +9,19 @@ var v = { //// [computedPropertyNamesDeclarationEmit5_ES5.js] var v = (_a = {}, _a["" + ""] = 0, - _a["" + ""] = function () { - }, - _a["" + ""] = Object.defineProperty({ - get: function () { - return 0; - }, + _a["" + ""] = function () { }, + Object.defineProperty(_a, "" + "", { + get: function () { return 0; }, enumerable: true, configurable: true }), - _a["" + ""] = Object.defineProperty({ - set: function (x) { - }, + Object.defineProperty(_a, "" + "", { + set: function (x) { }, enumerable: true, configurable: true }), - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.js index 0ae3eaf62b5..e19ac43656e 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.js @@ -9,13 +9,9 @@ var v = { //// [computedPropertyNamesDeclarationEmit5_ES6.js] var v = { ["" + ""]: 0, - ["" + ""]() { - }, - get ["" + ""]() { - return 0; - }, - set ["" + ""](x) { - } + ["" + ""]() { }, + get ["" + ""]() { return 0; }, + set ["" + ""](x) { } }; diff --git a/tests/baselines/reference/computedPropertyNamesOnOverloads_ES5.js b/tests/baselines/reference/computedPropertyNamesOnOverloads_ES5.js index c922b87f470..1470605413a 100644 --- a/tests/baselines/reference/computedPropertyNamesOnOverloads_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesOnOverloads_ES5.js @@ -13,7 +13,6 @@ var accessorName = "accessor"; var C = (function () { function C() { } - C.prototype[methodName] = function (v) { - }; + C.prototype[methodName] = function (v) { }; return C; })(); diff --git a/tests/baselines/reference/computedPropertyNamesOnOverloads_ES6.js b/tests/baselines/reference/computedPropertyNamesOnOverloads_ES6.js index ced0a8d449a..5f09cb5f318 100644 --- a/tests/baselines/reference/computedPropertyNamesOnOverloads_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesOnOverloads_ES6.js @@ -11,6 +11,5 @@ class C { var methodName = "method"; var accessorName = "accessor"; class C { - [methodName](v) { - } + [methodName](v) { } } diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js index 972aaf9b52f..39e393c46cc 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js @@ -10,6 +10,7 @@ var v = (_a = {}, _a["hello"] = function () { debugger; }, - _a); + _a +); var _a; //# sourceMappingURL=computedPropertyNamesSourceMap2_ES5.js.map \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js.map b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js.map index 413c98fa456..d36428a0379 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js.map +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js.map @@ -1,2 +1,2 @@ //// [computedPropertyNamesSourceMap2_ES5.js.map] -{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG;OACH,OAAO;QACJ,QAAQ,CAAC;IACb,CAAC;OACJ,CAAA"} \ No newline at end of file +{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":["[\"hello\"]"],"mappings":"AAAA,IAAI,CAAC,GAAG;IACJ,GAAC,OAAO,CAAC;QACLA,QAAQA,CAACA;IACbA,CAACA;;CACJ,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt index 03eec606718..74d69f566a0 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt @@ -24,45 +24,53 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts 4 >Emitted(1, 9) Source(1, 9) + SourceIndex(0) --- >>> _a["hello"] = function () { -1->^^^^^^^ -2 > ^^^^^^^ -3 > ^^^^-> +1->^^^^ +2 > ^^^ +3 > ^^^^^^^ +4 > ^ +5 > ^^^-> 1->{ - > [ -2 > "hello" -1->Emitted(2, 8) Source(2, 6) + SourceIndex(0) -2 >Emitted(2, 15) Source(2, 13) + SourceIndex(0) + > +2 > [ +3 > "hello" +4 > ] +1->Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 8) Source(2, 6) + SourceIndex(0) +3 >Emitted(2, 15) Source(2, 13) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 14) + SourceIndex(0) --- >>> debugger; 1->^^^^^^^^ 2 > ^^^^^^^^ 3 > ^ -1->]() { +1->() { > 2 > debugger 3 > ; -1->Emitted(3, 9) Source(3, 9) + SourceIndex(0) -2 >Emitted(3, 17) Source(3, 17) + SourceIndex(0) -3 >Emitted(3, 18) Source(3, 18) + SourceIndex(0) +1->Emitted(3, 9) Source(3, 9) + SourceIndex(0) name (["hello"]) +2 >Emitted(3, 17) Source(3, 17) + SourceIndex(0) name (["hello"]) +3 >Emitted(3, 18) Source(3, 18) + SourceIndex(0) name (["hello"]) --- >>> }, 1 >^^^^ 2 > ^ -3 > ^^^^-> +3 > ^^-> 1 > > 2 > } -1 >Emitted(4, 5) Source(4, 5) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 6) + SourceIndex(0) +1 >Emitted(4, 5) Source(4, 5) + SourceIndex(0) name (["hello"]) +2 >Emitted(4, 6) Source(4, 6) + SourceIndex(0) name (["hello"]) --- ->>> _a); -1->^^^^^^^ -2 > ^ +>>> _a +>>>); +1->^ +2 > ^ +3 > ^^^^^^-> 1-> >} -2 > -1->Emitted(5, 8) Source(5, 2) + SourceIndex(0) -2 >Emitted(5, 9) Source(5, 2) + SourceIndex(0) +2 > +1->Emitted(6, 2) Source(5, 2) + SourceIndex(0) +2 >Emitted(6, 3) Source(5, 2) + SourceIndex(0) --- >>>var _a; >>>//# sourceMappingURL=computedPropertyNamesSourceMap2_ES5.js.map \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesWithStaticProperty.js b/tests/baselines/reference/computedPropertyNamesWithStaticProperty.js index e6b7bd5aae2..9f0407588a8 100644 --- a/tests/baselines/reference/computedPropertyNamesWithStaticProperty.js +++ b/tests/baselines/reference/computedPropertyNamesWithStaticProperty.js @@ -18,7 +18,6 @@ class C { set [C.staticProp](x) { var y = x; } - [C.staticProp]() { - } + [C.staticProp]() { } } C.staticProp = 10; diff --git a/tests/baselines/reference/concatError.js b/tests/baselines/reference/concatError.js index 1b7ff27be68..dee3d8a30e3 100644 --- a/tests/baselines/reference/concatError.js +++ b/tests/baselines/reference/concatError.js @@ -41,9 +41,7 @@ interface Array { } */ var fa; -fa = fa.concat([ - 0 -]); +fa = fa.concat([0]); fa = fa.concat(0); /* diff --git a/tests/baselines/reference/conditionalExpressions2.js b/tests/baselines/reference/conditionalExpressions2.js index 5510a78ad6e..6749a2c0ac0 100644 --- a/tests/baselines/reference/conditionalExpressions2.js +++ b/tests/baselines/reference/conditionalExpressions2.js @@ -16,22 +16,11 @@ var c = false ? 1 : 0; var d = false ? false : true; var e = false ? "foo" : "bar"; var f = false ? null : undefined; -var g = true ? { - g: 5 -} : null; -var h = [ - { - h: 5 - }, - null -]; -function i() { - if (true) { - return { - x: 5 - }; - } - else { - return null; - } +var g = true ? { g: 5 } : null; +var h = [{ h: 5 }, null]; +function i() { if (true) { + return { x: 5 }; } +else { + return null; +} } diff --git a/tests/baselines/reference/conditionalOperatorConditionIsNumberType.js b/tests/baselines/reference/conditionalOperatorConditionIsNumberType.js index 1cd71e68873..f8fbe708e1a 100644 --- a/tests/baselines/reference/conditionalOperatorConditionIsNumberType.js +++ b/tests/baselines/reference/conditionalOperatorConditionIsNumberType.js @@ -91,15 +91,9 @@ condNumber ? exprString1 : exprBoolean1; // Union 1000000000000 ? exprIsObject1 : exprIsObject2; 10000 ? exprString1 : exprBoolean1; // Union //Cond is a number type expression -function foo() { - return 1; -} +function foo() { return 1; } ; -var array = [ - 1, - 2, - 3 -]; +var array = [1, 2, 3]; 1 * 0 ? exprAny1 : exprAny2; 1 + 1 ? exprBoolean1 : exprBoolean2; "string".length ? exprNumber1 : exprNumber2; diff --git a/tests/baselines/reference/conditionalOperatorConditionIsObjectType.js b/tests/baselines/reference/conditionalOperatorConditionIsObjectType.js index 17f64c71421..b2830e4d1d6 100644 --- a/tests/baselines/reference/conditionalOperatorConditionIsObjectType.js +++ b/tests/baselines/reference/conditionalOperatorConditionIsObjectType.js @@ -77,8 +77,7 @@ var exprBoolean2; var exprNumber2; var exprString2; var exprIsObject2; -function foo() { -} +function foo() { } ; var C = (function () { function C() { @@ -94,25 +93,12 @@ condObject ? exprString1 : exprString2; condObject ? exprIsObject1 : exprIsObject2; condObject ? exprString1 : exprBoolean1; // union //Cond is an object type literal -(function (a) { - return a.length; -}) ? exprAny1 : exprAny2; -(function (a) { - return a.length; -}) ? exprBoolean1 : exprBoolean2; +(function (a) { return a.length; }) ? exprAny1 : exprAny2; +(function (a) { return a.length; }) ? exprBoolean1 : exprBoolean2; ({}) ? exprNumber1 : exprNumber2; -({ - a: 1, - b: "s" -}) ? exprString1 : exprString2; -({ - a: 1, - b: "s" -}) ? exprIsObject1 : exprIsObject2; -({ - a: 1, - b: "s" -}) ? exprString1 : exprBoolean1; // union +({ a: 1, b: "s" }) ? exprString1 : exprString2; +({ a: 1, b: "s" }) ? exprIsObject1 : exprIsObject2; +({ a: 1, b: "s" }) ? exprString1 : exprBoolean1; // union //Cond is an object type expression foo() ? exprAny1 : exprAny2; new Date() ? exprBoolean1 : exprBoolean2; @@ -127,25 +113,12 @@ var resultIsNumber1 = condObject ? exprNumber1 : exprNumber2; var resultIsString1 = condObject ? exprString1 : exprString2; var resultIsObject1 = condObject ? exprIsObject1 : exprIsObject2; var resultIsStringOrBoolean1 = condObject ? exprString1 : exprBoolean1; // union -var resultIsAny2 = (function (a) { - return a.length; -}) ? exprAny1 : exprAny2; -var resultIsBoolean2 = (function (a) { - return a.length; -}) ? exprBoolean1 : exprBoolean2; +var resultIsAny2 = (function (a) { return a.length; }) ? exprAny1 : exprAny2; +var resultIsBoolean2 = (function (a) { return a.length; }) ? exprBoolean1 : exprBoolean2; var resultIsNumber2 = ({}) ? exprNumber1 : exprNumber2; -var resultIsString2 = ({ - a: 1, - b: "s" -}) ? exprString1 : exprString2; -var resultIsObject2 = ({ - a: 1, - b: "s" -}) ? exprIsObject1 : exprIsObject2; -var resultIsStringOrBoolean2 = ({ - a: 1, - b: "s" -}) ? exprString1 : exprBoolean1; // union +var resultIsString2 = ({ a: 1, b: "s" }) ? exprString1 : exprString2; +var resultIsObject2 = ({ a: 1, b: "s" }) ? exprIsObject1 : exprIsObject2; +var resultIsStringOrBoolean2 = ({ a: 1, b: "s" }) ? exprString1 : exprBoolean1; // union var resultIsAny3 = foo() ? exprAny1 : exprAny2; var resultIsBoolean3 = new Date() ? exprBoolean1 : exprBoolean2; var resultIsNumber3 = new C() ? exprNumber1 : exprNumber2; diff --git a/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.js b/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.js index 30d90a8b27d..80cfaf97f26 100644 --- a/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.js +++ b/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.js @@ -88,14 +88,8 @@ condAny ? exprString1 : exprBoolean1; // union null ? exprAny1 : exprAny2; null ? exprBoolean1 : exprBoolean2; undefined ? exprNumber1 : exprNumber2; -[ - null, - undefined -] ? exprString1 : exprString2; -[ - null, - undefined -] ? exprIsObject1 : exprIsObject2; +[null, undefined] ? exprString1 : exprString2; +[null, undefined] ? exprIsObject1 : exprIsObject2; undefined ? exprString1 : exprBoolean1; // union //Cond is an any type expression x.doSomeThing() ? exprAny1 : exprAny2; @@ -114,20 +108,11 @@ var resultIsStringOrBoolean1 = condAny ? exprString1 : exprBoolean1; // union var resultIsAny2 = null ? exprAny1 : exprAny2; var resultIsBoolean2 = null ? exprBoolean1 : exprBoolean2; var resultIsNumber2 = undefined ? exprNumber1 : exprNumber2; -var resultIsString2 = [ - null, - undefined -] ? exprString1 : exprString2; -var resultIsObject2 = [ - null, - undefined -] ? exprIsObject1 : exprIsObject2; +var resultIsString2 = [null, undefined] ? exprString1 : exprString2; +var resultIsObject2 = [null, undefined] ? exprIsObject1 : exprIsObject2; var resultIsStringOrBoolean2 = null ? exprString1 : exprBoolean1; // union var resultIsStringOrBoolean3 = undefined ? exprString1 : exprBoolean1; // union -var resultIsStringOrBoolean4 = [ - null, - undefined -] ? exprString1 : exprBoolean1; // union +var resultIsStringOrBoolean4 = [null, undefined] ? exprString1 : exprBoolean1; // union var resultIsAny3 = x.doSomeThing() ? exprAny1 : exprAny2; var resultIsBoolean3 = x("x") ? exprBoolean1 : exprBoolean2; var resultIsNumber3 = x(x) ? exprNumber1 : exprNumber2; diff --git a/tests/baselines/reference/conditionalOperatorConditoinIsStringType.js b/tests/baselines/reference/conditionalOperatorConditoinIsStringType.js index ce4fd985235..dbd68d9f009 100644 --- a/tests/baselines/reference/conditionalOperatorConditoinIsStringType.js +++ b/tests/baselines/reference/conditionalOperatorConditoinIsStringType.js @@ -92,15 +92,9 @@ condString ? exprString1 : exprBoolean1; // union " " ? exprIsObject1 : exprIsObject2; "hello " ? exprString1 : exprBoolean1; // union //Cond is a string type expression -function foo() { - return "string"; -} +function foo() { return "string"; } ; -var array = [ - "1", - "2", - "3" -]; +var array = ["1", "2", "3"]; typeof condString ? exprAny1 : exprAny2; condString.toUpperCase ? exprBoolean1 : exprBoolean2; condString + "string" ? exprNumber1 : exprNumber2; diff --git a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js index 592c5a6ca10..722310815ae 100644 --- a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js +++ b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js @@ -86,59 +86,27 @@ true ? x : a; var result1 = true ? x : a; //Expr1 and Expr2 are literals true ? {} : 1; -true ? { - a: 1 -} : { - a: 2, - b: 'string' -}; +true ? { a: 1 } : { a: 2, b: 'string' }; var result2 = true ? {} : 1; -var result3 = true ? { - a: 1 -} : { - a: 2, - b: 'string' -}; +var result3 = true ? { a: 1 } : { a: 2, b: 'string' }; //Contextually typed var resultIsX1 = true ? x : a; -var result4 = true ? function (m) { - return m.propertyX; -} : function (n) { - return n.propertyA; -}; +var result4 = true ? function (m) { return m.propertyX; } : function (n) { return n.propertyA; }; //Cond ? Expr1 : Expr2, Expr2 is supertype //Be Not contextually typed true ? a : x; var result5 = true ? a : x; //Expr1 and Expr2 are literals true ? 1 : {}; -true ? { - a: 2, - b: 'string' -} : { - a: 1 -}; +true ? { a: 2, b: 'string' } : { a: 1 }; var result6 = true ? 1 : {}; -var result7 = true ? { - a: 2, - b: 'string' -} : { - a: 1 -}; +var result7 = true ? { a: 2, b: 'string' } : { a: 1 }; //Contextually typed var resultIsX2 = true ? x : a; -var result8 = true ? function (m) { - return m.propertyA; -} : function (n) { - return n.propertyX; -}; +var result8 = true ? function (m) { return m.propertyA; } : function (n) { return n.propertyX; }; //Result = Cond ? Expr1 : Expr2, Result is supertype //Contextually typed var resultIsX3 = true ? a : b; -var result10 = true ? function (m) { - return m.propertyX1; -} : function (n) { - return n.propertyX2; -}; +var result10 = true ? function (m) { return m.propertyX1; } : function (n) { return n.propertyX2; }; //Expr1 and Expr2 are literals var result11 = true ? 1 : 'string'; diff --git a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js index 78c7569c0fa..83262ed1301 100644 --- a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js +++ b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js @@ -63,23 +63,7 @@ var result1 = true ? a : b; var result2 = true ? a : b; var result3 = true ? a : b; var result31 = true ? a : b; -var result4 = true ? function (m) { - return m.propertyX1; -} : function (n) { - return n.propertyX2; -}; -var result5 = true ? function (m) { - return m.propertyX1; -} : function (n) { - return n.propertyX2; -}; -var result6 = true ? function (m) { - return m.propertyX1; -} : function (n) { - return n.propertyX2; -}; -var result61 = true ? function (m) { - return m.propertyX1; -} : function (n) { - return n.propertyX2; -}; +var result4 = true ? function (m) { return m.propertyX1; } : function (n) { return n.propertyX2; }; +var result5 = true ? function (m) { return m.propertyX1; } : function (n) { return n.propertyX2; }; +var result6 = true ? function (m) { return m.propertyX1; } : function (n) { return n.propertyX2; }; +var result61 = true ? function (m) { return m.propertyX1; } : function (n) { return n.propertyX2; }; diff --git a/tests/baselines/reference/conditionallyDuplicateOverloadsCausedByOverloadResolution.js b/tests/baselines/reference/conditionallyDuplicateOverloadsCausedByOverloadResolution.js index e2029d1bf37..d8a36f9e09e 100644 --- a/tests/baselines/reference/conditionallyDuplicateOverloadsCausedByOverloadResolution.js +++ b/tests/baselines/reference/conditionallyDuplicateOverloadsCausedByOverloadResolution.js @@ -22,8 +22,7 @@ var out2 = foo2((x, y) => { //// [conditionallyDuplicateOverloadsCausedByOverloadResolution.js] var out = foo(function (x, y) { - function bar() { - } + function bar() { } return bar; }); var out2 = foo2(function (x, y) { diff --git a/tests/baselines/reference/conflictMarkerTrivia2.js b/tests/baselines/reference/conflictMarkerTrivia2.js index bbb631de388..bbf6726b994 100644 --- a/tests/baselines/reference/conflictMarkerTrivia2.js +++ b/tests/baselines/reference/conflictMarkerTrivia2.js @@ -20,7 +20,6 @@ var C = (function () { C.prototype.foo = function () { a(); }; - C.prototype.bar = function () { - }; + C.prototype.bar = function () { }; return C; })(); diff --git a/tests/baselines/reference/conflictingTypeAnnotatedVar.js b/tests/baselines/reference/conflictingTypeAnnotatedVar.js index b44dc6f1e33..283912c487b 100644 --- a/tests/baselines/reference/conflictingTypeAnnotatedVar.js +++ b/tests/baselines/reference/conflictingTypeAnnotatedVar.js @@ -5,7 +5,5 @@ function foo(): number { } //// [conflictingTypeAnnotatedVar.js] var foo; -function foo() { -} -function foo() { -} +function foo() { } +function foo() { } diff --git a/tests/baselines/reference/constDeclarations-access2.js b/tests/baselines/reference/constDeclarations-access2.js index fd51c932636..ae8dae70646 100644 --- a/tests/baselines/reference/constDeclarations-access2.js +++ b/tests/baselines/reference/constDeclarations-access2.js @@ -62,11 +62,9 @@ x--; ++((x)); // OK var a = x + 1; -function f(v) { -} +function f(v) { } f(x); -if (x) { -} +if (x) { } x; (x); -x; diff --git a/tests/baselines/reference/constDeclarations-access3.js b/tests/baselines/reference/constDeclarations-access3.js index 9ac4880bdd1..9140da965c3 100644 --- a/tests/baselines/reference/constDeclarations-access3.js +++ b/tests/baselines/reference/constDeclarations-access3.js @@ -71,11 +71,9 @@ M.x--; M["x"] = 0; // OK var a = M.x + 1; -function f(v) { -} +function f(v) { } f(M.x); -if (M.x) { -} +if (M.x) { } M.x; (M.x); -M.x; diff --git a/tests/baselines/reference/constDeclarations-access4.js b/tests/baselines/reference/constDeclarations-access4.js index b226e746bba..608d950526a 100644 --- a/tests/baselines/reference/constDeclarations-access4.js +++ b/tests/baselines/reference/constDeclarations-access4.js @@ -67,11 +67,9 @@ M.x--; M["x"] = 0; // OK var a = M.x + 1; -function f(v) { -} +function f(v) { } f(M.x); -if (M.x) { -} +if (M.x) { } M.x; (M.x); -M.x; diff --git a/tests/baselines/reference/constDeclarations-access5.js b/tests/baselines/reference/constDeclarations-access5.js index 313ce3db21a..7735e37d2b0 100644 --- a/tests/baselines/reference/constDeclarations-access5.js +++ b/tests/baselines/reference/constDeclarations-access5.js @@ -73,11 +73,9 @@ m.x--; m["x"] = 0; // OK var a = m.x + 1; -function f(v) { -} +function f(v) { } f(m.x); -if (m.x) { -} +if (m.x) { } m.x; (m.x); -m.x; diff --git a/tests/baselines/reference/constDeclarations-errors.js b/tests/baselines/reference/constDeclarations-errors.js index e1e68032f8d..e7143f2564a 100644 --- a/tests/baselines/reference/constDeclarations-errors.js +++ b/tests/baselines/reference/constDeclarations-errors.js @@ -21,14 +21,10 @@ for(const c10 = 0, c11; c10 < 1;) { } const c1; const c2; const c3, c4, c5, c6; // error, missing initialicer -for (const c in {}) { -} +for (const c in {}) { } // error, assigning to a const -for (const c8 = 0; c8 < 1; c8++) { -} +for (const c8 = 0; c8 < 1; c8++) { } // error, can not be unintalized -for (const c9; c9 < 1;) { -} +for (const c9; c9 < 1;) { } // error, can not be unintalized -for (const c10 = 0, c11; c10 < 1;) { -} +for (const c10 = 0, c11; c10 < 1;) { } diff --git a/tests/baselines/reference/constEnumErrors.js b/tests/baselines/reference/constEnumErrors.js index ca5e3f87e6e..4afd98982f0 100644 --- a/tests/baselines/reference/constEnumErrors.js +++ b/tests/baselines/reference/constEnumErrors.js @@ -52,9 +52,7 @@ var y0 = E2[1]; var name = "A"; var y1 = E2[name]; var x = E2; -var y = [ - E2 -]; +var y = [E2]; function foo(t) { } foo(E2); diff --git a/tests/baselines/reference/constEnums.js b/tests/baselines/reference/constEnums.js index b7077c74df1..4f85cc59d0e 100644 --- a/tests/baselines/reference/constEnums.js +++ b/tests/baselines/reference/constEnums.js @@ -216,11 +216,8 @@ function foo(x) { } function bar(e) { switch (e) { - case 1 /* V1 */: - return 1; - case 101 /* V2 */: - return 1; - case 64 /* V3 */: - return 1; + case 1 /* V1 */: return 1; + case 101 /* V2 */: return 1; + case 64 /* V3 */: return 1; } } diff --git a/tests/baselines/reference/constantOverloadFunction.js b/tests/baselines/reference/constantOverloadFunction.js index 12e84e2077f..408b56805fb 100644 --- a/tests/baselines/reference/constantOverloadFunction.js +++ b/tests/baselines/reference/constantOverloadFunction.js @@ -23,8 +23,7 @@ var __extends = this.__extends || function (d, b) { var Base = (function () { function Base() { } - Base.prototype.foo = function () { - }; + Base.prototype.foo = function () { }; return Base; })(); var Derived1 = (function (_super) { @@ -32,8 +31,7 @@ var Derived1 = (function (_super) { function Derived1() { _super.apply(this, arguments); } - Derived1.prototype.bar = function () { - }; + Derived1.prototype.bar = function () { }; return Derived1; })(Base); var Derived2 = (function (_super) { @@ -41,8 +39,7 @@ var Derived2 = (function (_super) { function Derived2() { _super.apply(this, arguments); } - Derived2.prototype.baz = function () { - }; + Derived2.prototype.baz = function () { }; return Derived2; })(Base); var Derived3 = (function (_super) { @@ -50,8 +47,7 @@ var Derived3 = (function (_super) { function Derived3() { _super.apply(this, arguments); } - Derived3.prototype.biz = function () { - }; + Derived3.prototype.biz = function () { }; return Derived3; })(Base); function foo(tagName) { diff --git a/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js b/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js index 563b73d7e5b..591d6171dbe 100644 --- a/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js +++ b/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js @@ -24,8 +24,7 @@ var __extends = this.__extends || function (d, b) { var Base = (function () { function Base() { } - Base.prototype.foo = function () { - }; + Base.prototype.foo = function () { }; return Base; })(); var Derived1 = (function (_super) { @@ -33,8 +32,7 @@ var Derived1 = (function (_super) { function Derived1() { _super.apply(this, arguments); } - Derived1.prototype.bar = function () { - }; + Derived1.prototype.bar = function () { }; return Derived1; })(Base); var Derived2 = (function (_super) { @@ -42,8 +40,7 @@ var Derived2 = (function (_super) { function Derived2() { _super.apply(this, arguments); } - Derived2.prototype.baz = function () { - }; + Derived2.prototype.baz = function () { }; return Derived2; })(Base); var Derived3 = (function (_super) { @@ -51,8 +48,7 @@ var Derived3 = (function (_super) { function Derived3() { _super.apply(this, arguments); } - Derived3.prototype.biz = function () { - }; + Derived3.prototype.biz = function () { }; return Derived3; })(Base); function foo(tagName) { diff --git a/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js b/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js index 3d99e07bb5e..caeb2d32ee4 100644 --- a/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js +++ b/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js @@ -30,8 +30,7 @@ var __extends = this.__extends || function (d, b) { var Constraint = (function () { function Constraint() { } - Constraint.prototype.method = function () { - }; + Constraint.prototype.method = function () { }; return Constraint; })(); var GenericBase = (function () { diff --git a/tests/baselines/reference/constraintErrors1.js b/tests/baselines/reference/constraintErrors1.js index c8da89d574c..71723130b55 100644 --- a/tests/baselines/reference/constraintErrors1.js +++ b/tests/baselines/reference/constraintErrors1.js @@ -2,5 +2,4 @@ function foo5(test: T) { } //// [constraintErrors1.js] -function foo5(test) { -} +function foo5(test) { } diff --git a/tests/baselines/reference/constraintSatisfactionWithAny.js b/tests/baselines/reference/constraintSatisfactionWithAny.js index 924c2ab1700..06d8b17690a 100644 --- a/tests/baselines/reference/constraintSatisfactionWithAny.js +++ b/tests/baselines/reference/constraintSatisfactionWithAny.js @@ -54,16 +54,10 @@ var c8 = new C4(b); //// [constraintSatisfactionWithAny.js] // any is not a valid type argument unless there is no constraint, or the constraint is any -function foo(x) { - return null; -} -function foo2(x) { - return null; -} +function foo(x) { return null; } +function foo2(x) { return null; } //function foo3(x: T): T { return null; } -function foo4(x) { - return null; -} +function foo4(x) { return null; } var a; foo(a); foo2(a); diff --git a/tests/baselines/reference/constraintSatisfactionWithEmptyObject.js b/tests/baselines/reference/constraintSatisfactionWithEmptyObject.js index 5f9e902141b..7850b0ebd01 100644 --- a/tests/baselines/reference/constraintSatisfactionWithEmptyObject.js +++ b/tests/baselines/reference/constraintSatisfactionWithEmptyObject.js @@ -40,8 +40,7 @@ var i2: I2<{}>; //// [constraintSatisfactionWithEmptyObject.js] // valid uses of a basic object constraint, no errors expected // Object constraint -function foo(x) { -} +function foo(x) { } var r = foo({}); var a = {}; var r = foo({}); @@ -54,8 +53,7 @@ var C = (function () { var r2 = new C({}); var i; // {} constraint -function foo2(x) { -} +function foo2(x) { } var r = foo2({}); var a = {}; var r = foo2({}); diff --git a/tests/baselines/reference/constructorArgWithGenericCallSignature.js b/tests/baselines/reference/constructorArgWithGenericCallSignature.js index 5fa7c46124b..ca859869850 100644 --- a/tests/baselines/reference/constructorArgWithGenericCallSignature.js +++ b/tests/baselines/reference/constructorArgWithGenericCallSignature.js @@ -23,8 +23,7 @@ var Test; return MyClass; })(); Test.MyClass = MyClass; - function F(func) { - } + function F(func) { } Test.F = F; })(Test || (Test = {})); var func; diff --git a/tests/baselines/reference/constructorAsType.js b/tests/baselines/reference/constructorAsType.js index d2029e5899f..9f8c14ce743 100644 --- a/tests/baselines/reference/constructorAsType.js +++ b/tests/baselines/reference/constructorAsType.js @@ -6,10 +6,6 @@ var Person2:{new() : {name:string;};}; Person = Person2; //// [constructorAsType.js] -var Person = function () { - return { - name: "joe" - }; -}; +var Person = function () { return { name: "joe" }; }; var Person2; Person = Person2; diff --git a/tests/baselines/reference/constructorOverloads1.js b/tests/baselines/reference/constructorOverloads1.js index 6f834d0bf6d..97f33dca862 100644 --- a/tests/baselines/reference/constructorOverloads1.js +++ b/tests/baselines/reference/constructorOverloads1.js @@ -25,19 +25,13 @@ f1.bar2(); var Foo = (function () { function Foo(x) { } - Foo.prototype.bar1 = function () { - }; - Foo.prototype.bar2 = function () { - }; + Foo.prototype.bar1 = function () { }; + Foo.prototype.bar2 = function () { }; return Foo; })(); var f1 = new Foo("hey"); var f2 = new Foo(0); var f3 = new Foo(f1); -var f4 = new Foo([ - f1, - f2, - f3 -]); +var f4 = new Foo([f1, f2, f3]); f1.bar1(); f1.bar2(); diff --git a/tests/baselines/reference/constructorOverloads2.js b/tests/baselines/reference/constructorOverloads2.js index 753eca4a1fb..e3eae0ed5a9 100644 --- a/tests/baselines/reference/constructorOverloads2.js +++ b/tests/baselines/reference/constructorOverloads2.js @@ -35,8 +35,7 @@ var __extends = this.__extends || function (d, b) { var FooBase = (function () { function FooBase(x) { } - FooBase.prototype.bar1 = function () { - }; + FooBase.prototype.bar1 = function () { }; return FooBase; })(); var Foo = (function (_super) { @@ -44,16 +43,11 @@ var Foo = (function (_super) { function Foo(x, y) { _super.call(this, x); } - Foo.prototype.bar1 = function () { - }; + Foo.prototype.bar1 = function () { }; return Foo; })(FooBase); var f1 = new Foo("hey"); var f2 = new Foo(0); var f3 = new Foo(f1); -var f4 = new Foo([ - f1, - f2, - f3 -]); +var f4 = new Foo([f1, f2, f3]); f1.bar1(); diff --git a/tests/baselines/reference/constructorOverloads3.js b/tests/baselines/reference/constructorOverloads3.js index 382a7cd8913..c54226745c2 100644 --- a/tests/baselines/reference/constructorOverloads3.js +++ b/tests/baselines/reference/constructorOverloads3.js @@ -33,16 +33,11 @@ var Foo = (function (_super) { __extends(Foo, _super); function Foo(x, y) { } - Foo.prototype.bar1 = function () { - }; + Foo.prototype.bar1 = function () { }; return Foo; })(FooBase); var f1 = new Foo("hey"); var f2 = new Foo(0); var f3 = new Foo(f1); -var f4 = new Foo([ - f1, - f2, - f3 -]); +var f4 = new Foo([f1, f2, f3]); f1.bar1(); diff --git a/tests/baselines/reference/constructorOverloads6.js b/tests/baselines/reference/constructorOverloads6.js index aef68fcd863..1996449165c 100644 --- a/tests/baselines/reference/constructorOverloads6.js +++ b/tests/baselines/reference/constructorOverloads6.js @@ -28,9 +28,5 @@ f1.bar1(); var f1 = new Foo("hey"); var f2 = new Foo(0); var f3 = new Foo(f1); -var f4 = new Foo([ - f1, - f2, - f3 -]); +var f4 = new Foo([f1, f2, f3]); f1.bar1(); diff --git a/tests/baselines/reference/constructorOverloads7.js b/tests/baselines/reference/constructorOverloads7.js index b7e152c66e1..5b7e407e806 100644 --- a/tests/baselines/reference/constructorOverloads7.js +++ b/tests/baselines/reference/constructorOverloads7.js @@ -34,6 +34,4 @@ function Point(x, y) { this.y = y; return this; } -function EF1(a, b) { - return a + b; -} +function EF1(a, b) { return a + b; } diff --git a/tests/baselines/reference/constructorParametersInVariableDeclarations.js b/tests/baselines/reference/constructorParametersInVariableDeclarations.js index 3528a9574af..984c8c392b1 100644 --- a/tests/baselines/reference/constructorParametersInVariableDeclarations.js +++ b/tests/baselines/reference/constructorParametersInVariableDeclarations.js @@ -20,24 +20,16 @@ class B { var A = (function () { function A(x) { this.a = x; - this.b = { - p: x - }; - this.c = function () { - return x; - }; + this.b = { p: x }; + this.c = function () { return x; }; } return A; })(); var B = (function () { function B() { this.a = x; - this.b = { - p: x - }; - this.c = function () { - return x; - }; + this.b = { p: x }; + this.c = function () { return x; }; var x = 1; } return B; diff --git a/tests/baselines/reference/constructorReturnsInvalidType.js b/tests/baselines/reference/constructorReturnsInvalidType.js index 92afb41a3fe..7f6119cc8bd 100644 --- a/tests/baselines/reference/constructorReturnsInvalidType.js +++ b/tests/baselines/reference/constructorReturnsInvalidType.js @@ -14,8 +14,7 @@ var X = (function () { function X() { return 1; } - X.prototype.foo = function () { - }; + X.prototype.foo = function () { }; return X; })(); var x = new X(); diff --git a/tests/baselines/reference/constructorStaticParamName.errors.txt b/tests/baselines/reference/constructorStaticParamName.errors.txt new file mode 100644 index 00000000000..ac50edd22f1 --- /dev/null +++ b/tests/baselines/reference/constructorStaticParamName.errors.txt @@ -0,0 +1,12 @@ +tests/cases/compiler/constructorStaticParamName.ts(4,18): error TS1003: Identifier expected. + + +==== tests/cases/compiler/constructorStaticParamName.ts (1 errors) ==== + // static as constructor parameter name should only give error if 'use strict' + + class test { + constructor (static) { } + ~~~~~~ +!!! error TS1003: Identifier expected. + } + \ No newline at end of file diff --git a/tests/baselines/reference/constructorStaticParamName.js b/tests/baselines/reference/constructorStaticParamName.js index cf74aed2ebc..85b22867442 100644 --- a/tests/baselines/reference/constructorStaticParamName.js +++ b/tests/baselines/reference/constructorStaticParamName.js @@ -9,7 +9,7 @@ class test { //// [constructorStaticParamName.js] // static as constructor parameter name should only give error if 'use strict' var test = (function () { - function test(static) { + function test() { } return test; })(); diff --git a/tests/baselines/reference/constructorStaticParamName.types b/tests/baselines/reference/constructorStaticParamName.types deleted file mode 100644 index 9fdc94e4a73..00000000000 --- a/tests/baselines/reference/constructorStaticParamName.types +++ /dev/null @@ -1,10 +0,0 @@ -=== tests/cases/compiler/constructorStaticParamName.ts === -// static as constructor parameter name should only give error if 'use strict' - -class test { ->test : test - - constructor (static) { } ->static : any -} - diff --git a/tests/baselines/reference/constructorWithAssignableReturnExpression.js b/tests/baselines/reference/constructorWithAssignableReturnExpression.js index b56e63e8e4e..238f2e18aea 100644 --- a/tests/baselines/reference/constructorWithAssignableReturnExpression.js +++ b/tests/baselines/reference/constructorWithAssignableReturnExpression.js @@ -51,25 +51,19 @@ var D = (function () { })(); var E = (function () { function E() { - return { - x: 1 - }; + return { x: 1 }; } return E; })(); var F = (function () { function F() { - return { - x: 1 - }; // error + return { x: 1 }; // error } return F; })(); var G = (function () { function G() { - return { - x: null - }; + return { x: null }; } return G; })(); diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt index fa1c6bea381..75de7c32ebc 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt @@ -21,27 +21,47 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(47,17): error TS tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(49,13): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(53,13): error TS2304: Cannot find name 'console'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(58,5): error TS1128: Declaration or statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(65,29): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(69,13): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(72,37): error TS1127: Invalid character. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(81,13): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(89,23): error TS2364: Invalid left-hand side of assignment expression. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(90,13): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(94,17): error TS1134: Variable declaration expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(95,13): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(105,29): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(106,13): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(108,24): error TS2365: Operator '+' cannot be applied to types 'number' and 'boolean'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(108,24): error TS2304: Cannot find name 'any'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(108,30): error TS2304: Cannot find name 'bool'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(108,37): error TS2304: Cannot find name 'declare'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(108,47): error TS2304: Cannot find name 'constructor'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(108,61): error TS2304: Cannot find name 'get'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(108,67): error TS2304: Cannot find name 'implements'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(111,9): error TS1128: Declaration or statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(118,9): error TS2304: Cannot find name 'STATEMENTS'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(118,21): error TS1005: ',' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(118,30): error TS1005: ';' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(118,39): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(138,13): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(141,32): error TS1005: '{' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(143,13): error TS1005: 'try' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(155,9): error TS1128: Declaration or statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(155,16): error TS2304: Cannot find name 'TYPES'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(155,23): error TS1005: ';' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(155,32): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,24): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,30): error TS1005: '(' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,31): error TS2304: Cannot find name 'Property'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(166,13): error TS2365: Operator '+=' cannot be applied to types 'number' and 'void'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(176,9): error TS1128: Declaration or statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(176,16): error TS2304: Cannot find name 'OPERATOR'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(176,26): error TS1005: ';' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(176,35): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(180,40): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(205,28): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(210,5): error TS1128: Declaration or statement expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(213,16): error TS2304: Cannot find name 'bool'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(218,10): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(218,29): error TS2304: Cannot find name 'yield'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(218,36): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(223,23): error TS2304: Cannot find name 'bool'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(227,13): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(234,14): error TS1005: '{' expected. @@ -49,7 +69,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,9): error TS tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,16): error TS2304: Cannot find name 'method1'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,24): error TS2304: Cannot find name 'val'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,27): error TS1005: ',' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,28): error TS2304: Cannot find name 'number'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,36): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,9): error TS1128: Declaration or statement expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,16): error TS2304: Cannot find name 'method2'. @@ -64,27 +83,23 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,9): error TS tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,16): error TS2304: Cannot find name 'Overloads'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,26): error TS2304: Cannot find name 'value'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,31): error TS1005: ',' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,33): error TS2304: Cannot find name 'string'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,9): error TS1128: Declaration or statement expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,16): error TS2304: Cannot find name 'Overloads'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,27): error TS1135: Argument expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,33): error TS1005: '(' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,35): error TS2304: Cannot find name 'string'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,43): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,52): error TS2304: Cannot find name 'string'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,60): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,65): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,9): error TS2304: Cannot find name 'public'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,16): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,16): error TS2304: Cannot find name 'DefaultValue'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,29): error TS2304: Cannot find name 'value'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,35): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error TS2304: Cannot find name 'string'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error TS2322: Type 'string' is not assignable to type 'boolean'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,55): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS1128: Declaration or statement expected. -==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (84 errors) ==== +==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (99 errors) ==== declare module "fs" { export class File { constructor(filename: string); @@ -199,6 +214,8 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS /// /// public VARIABLES(): number { + ~~~~~~ +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. var local = Number.MAX_VALUE; var min = Number.MIN_VALUE; var inf = Number.NEGATIVE_INFINITY - @@ -238,7 +255,11 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS var constructor = 0; var get = 0; var implements = 0; + ~~~~~~~~~~ +!!! error TS1134: Variable declaration expected. var interface = 0; + ~~~ +!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. var let = 0; var module = 0; var number = 0; @@ -256,11 +277,23 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS !!! error TS1109: Expression expected. var sum3 = any + bool + declare + constructor + get + implements + interface + let + module + number + package + private + protected + public + set + static + string + yield; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'number' and 'boolean'. + ~~~ +!!! error TS2304: Cannot find name 'any'. + ~~~~ +!!! error TS2304: Cannot find name 'bool'. + ~~~~~~~ +!!! error TS2304: Cannot find name 'declare'. + ~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'constructor'. + ~~~ +!!! error TS2304: Cannot find name 'get'. + ~~~~~~~~~~ +!!! error TS2304: Cannot find name 'implements'. return 0; } + ~ +!!! error TS1128: Declaration or statement expected. /// /// Test different statements. Including if-else,swith,foreach,(un)checked,lock,using,try-catch-finally @@ -268,6 +301,14 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS /// /// STATEMENTS(i: number): number { + ~~~~~~~~~~ +!!! error TS2304: Cannot find name 'STATEMENTS'. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1005: ';' expected. var retVal = 0; if (i == 1) retVal = 1; @@ -311,6 +352,14 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS /// /// public TYPES(): number { + ~~~~~~ +!!! error TS1128: Declaration or statement expected. + ~~~~~ +!!! error TS2304: Cannot find name 'TYPES'. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1005: ';' expected. var retVal = 0; var c = new CLASS(); var xx: IF = c; @@ -340,6 +389,14 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS ///// ///// public OPERATOR(): number { + ~~~~~~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~ +!!! error TS2304: Cannot find name 'OPERATOR'. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1005: ';' expected. var a: number[] = [1, 2, 3, 4, 5, ];/*[] bug*/ // YES [] var i = a[1];/*[]*/ i = i + i - i * i / i % i & i | i ^ i;/*+ - * / % & | ^*/ @@ -378,6 +435,8 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS } } + ~ +!!! error TS1128: Declaration or statement expected. interface IF { Foo(): bool; @@ -390,10 +449,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS case d = () => { yield 0; }; ~~~~ !!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. - ~~~~~ -!!! error TS2304: Cannot find name 'yield'. - ~ -!!! error TS1005: ';' expected. public get Property() { return 0; } public Member() { return 0; @@ -425,8 +480,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS !!! error TS2304: Cannot find name 'val'. ~ !!! error TS1005: ',' expected. - ~~~~~~ -!!! error TS2304: Cannot find name 'number'. ~ !!! error TS1005: ';' expected. return val; @@ -476,8 +529,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS !!! error TS2304: Cannot find name 'value'. ~ !!! error TS1005: ',' expected. - ~~~~~~ -!!! error TS2304: Cannot find name 'string'. public Overloads( while : string, ...rest: string[]) { & ~~~~~~ !!! error TS1128: Declaration or statement expected. @@ -487,20 +538,14 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS !!! error TS1135: Argument expression expected. ~ !!! error TS1005: '(' expected. - ~~~~~~ -!!! error TS2304: Cannot find name 'string'. ~~~ !!! error TS1109: Expression expected. - ~~~~~~ -!!! error TS2304: Cannot find name 'string'. ~ !!! error TS1005: ';' expected. ~ !!! error TS1109: Expression expected. public DefaultValue(value?: string = "Hello") { } - ~~~~~~ -!!! error TS2304: Cannot find name 'public'. ~~~~~~~~~~~~ !!! error TS1005: ';' expected. ~~~~~~~~~~~~ @@ -510,7 +555,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS ~ !!! error TS1109: Expression expected. ~~~~~~ -!!! error TS2304: Cannot find name 'string'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. ~ !!! error TS1005: ';' expected. } diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js index 0bc51e90c5c..4fb940bc9ec 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js @@ -314,10 +314,12 @@ var TypeScriptAllInOne; Program.prototype.if = function (retValue) { if (retValue === void 0) { retValue = != 0; } return 1; - ^ retValue; + ^ + retValue; bfs.TYPES(); if (retValue != 0) { - return 1 && ; + return 1 && + ; } retValue = bfs.OPERATOR; ' );; @@ -340,6 +342,7 @@ var TypeScriptAllInOne; })(TypeScriptAllInOne || (TypeScriptAllInOne = {})); var BasicFeatures = (function () { function BasicFeatures() { + this.implements = 0; } /// /// Test various of variables. Including nullable,key world as variable,special format @@ -348,7 +351,8 @@ var BasicFeatures = (function () { BasicFeatures.prototype.VARIABLES = function () { var local = Number.MAX_VALUE; var min = Number.MIN_VALUE; - var inf = Number.NEGATIVE_INFINITY - ; + var inf = Number.NEGATIVE_INFINITY - + ; var nan = Number.NaN; var undef = undefined; var _\uD4A5\u7204\uC316, uE59F = local; @@ -357,163 +361,135 @@ var BasicFeatures = (function () { var local6 = local5 instanceof fs.File; var hex = 0xBADC0DE, Hex = 0XDEADBEEF; var float = 6.02e23, float2 = 6.02E-23; - var char = 'c', \u0066 = '\u0066', hexchar = '\x42' != ; + var char = 'c', \u0066 = '\u0066', hexchar = '\x42' != + ; var quoted = '"', quoted2 = "'"; var reg = /\w*/; - var objLit = { - "var": number = 42, - equals: function (x) { - return x["var"] === 42; - }, - instanceof: function () { - return 'objLit{42}'; - } - }; + var objLit = { "var": number = 42, equals: function (x) { return x["var"] === 42; }, instanceof: function () { return 'objLit{42}'; } }; var weekday = Weekdays.Monday; var con = char + f + hexchar + float.toString() + float2.toString() + reg.toString() + objLit + weekday; // - var any = 0 ^= ; + var any = 0 ^= + ; var bool = 0; var declare = 0; var constructor = 0; var get = 0; - var implements = 0; - var interface = 0; - var let = 0; - var module = 0; - var number = 0; - var package = 0; - var private = 0; - var protected = 0; - var public = 0; - var set = 0; - var static = 0; - var string = 0 / > ; - var yield = 0; - var sum3 = any + bool + declare + constructor + get + implements + interface + let + module + number + package + private + protected + public + set + static + string + yield; - return 0; - }; - /// - /// Test different statements. Including if-else,swith,foreach,(un)checked,lock,using,try-catch-finally - /// - /// - /// - BasicFeatures.prototype.STATEMENTS = function (i) { - var retVal = 0; - if (i == 1) - retVal = 1; - else - retVal = 0; - switch (i) { - case 2: - retVal = 1; - break; - case 3: - retVal = 1; - break; - default: - break; - } - for (var x in { - x: 0, - y: 1 - }) { - !; - try { - throw null; - } - catch (Exception) { - } - } - try { - } - finally { - try { - } - catch (Exception) { - } - } - return retVal; - }; - /// - /// Test types in ts language. Including class,struct,interface,delegate,anonymous type - /// - /// - BasicFeatures.prototype.TYPES = function () { - var retVal = 0; - var c = new CLASS(); - var xx = c; - retVal += ; - try { - } - catch () { - } - Property; - retVal += c.Member(); - retVal += xx.Foo() ? 0 : 1; - //anonymous type - var anony = { - a: new CLASS() - }; - retVal += anony.a.d(); - return retVal; - }; - ///// - ///// Test different operators - ///// - ///// - BasicFeatures.prototype.OPERATOR = function () { - var a = [ - 1, - 2, - 3, - 4, - 5, - ]; /*[] bug*/ // YES [] - var i = a[1]; /*[]*/ - i = i + i - i * i / i % i & i | i ^ i; /*+ - * / % & | ^*/ - var b = true && false || true ^ false; /*& | ^*/ - b = !b; /*!*/ - i = ~i; /*~i*/ - b = i < (i - 1) && (i + 1) > i; /*< && >*/ - var f = true ? 1 : 0; /*? :*/ // YES : - i++; /*++*/ - i--; /*--*/ - b = true && false || true; /*&& ||*/ - i = i << 5; /*<<*/ - i = i >> 5; /*>>*/ - var j = i; - b = i == j && i != j && i <= j && i >= j; /*= == && != <= >=*/ - i += 5.0; /*+=*/ - i -= i; /*-=*/ - i *= i; /**=*/ - if (i == 0) - i++; - i /= i; /*/=*/ - i %= i; /*%=*/ - i &= i; /*&=*/ - i |= i; /*|=*/ - i ^= i; /*^=*/ - i <<= i; /*<<=*/ - i >>= i; /*>>=*/ - if (i == 0 && != b && f == 1) - return 0; - else - return 1; + var ; }; return BasicFeatures; })(); +var interface = 0; +var let = 0; +var module = 0; +var number = 0; +var package = 0; +var private = 0; +var protected = 0; +var public = 0; +var set = 0; +var static = 0; +var string = 0 / > +; +var yield = 0; +var sum3 = any + bool + declare + constructor + get + implements + interface + let + module + number + package + private + protected + public + set + static + string + yield; +return 0; +/// +/// Test different statements. Including if-else,swith,foreach,(un)checked,lock,using,try-catch-finally +/// +/// +/// +STATEMENTS(i, number); +number; +{ + var retVal = 0; + if (i == 1) + retVal = 1; + else + retVal = 0; + switch (i) { + case 2: + retVal = 1; + break; + case 3: + retVal = 1; + break; + default: + break; + } + for (var x in { x: 0, y: 1 }) { + !; + try { + throw null; + } + catch (Exception) { } + } + try { + } + finally { + try { } + catch (Exception) { } + } + return retVal; +} +TYPES(); +number; +{ + var retVal = 0; + var c = new CLASS(); + var xx = c; + retVal += ; + try { } + catch () { } + Property; + retVal += c.Member(); + retVal += xx.Foo() ? 0 : 1; + //anonymous type + var anony = { a: new CLASS() }; + retVal += anony.a.d(); + return retVal; +} +OPERATOR(); +number; +{ + var a = [1, 2, 3, 4, 5,]; /*[] bug*/ // YES [] + var i = a[1]; /*[]*/ + i = i + i - i * i / i % i & i | i ^ i; /*+ - * / % & | ^*/ + var b = true && false || true ^ false; /*& | ^*/ + b = !b; /*!*/ + i = ~i; /*~i*/ + b = i < (i - 1) && (i + 1) > i; /*< && >*/ + var f = true ? 1 : 0; /*? :*/ // YES : + i++; /*++*/ + i--; /*--*/ + b = true && false || true; /*&& ||*/ + i = i << 5; /*<<*/ + i = i >> 5; /*>>*/ + var j = i; + b = i == j && i != j && i <= j && i >= j; /*= == && != <= >=*/ + i += 5.0; /*+=*/ + i -= i; /*-=*/ + i *= i; /**=*/ + if (i == 0) + i++; + i /= i; /*/=*/ + i %= i; /*%=*/ + i &= i; /*&=*/ + i |= i; /*|=*/ + i ^= i; /*^=*/ + i <<= i; /*<<=*/ + i >>= i; /*>>=*/ + if (i == 0 && != b && f == 1) + return 0; + else + return 1; +} var CLASS = (function () { function CLASS() { - this.d = function () { - yield; - 0; - }; + this.d = function () { ; }; } Object.defineProperty(CLASS.prototype, "Property", { - get: function () { - return 0; - }, + get: function () { return 0; }, enumerable: true, configurable: true }); @@ -521,11 +497,11 @@ var CLASS = (function () { return 0; }; CLASS.prototype.Foo = function () { - var myEvent = function () { - return 1; - }; + var myEvent = function () { return 1; }; if (myEvent() == 1) - return true ? : ; + return true ? + : + ; else return false; }; @@ -567,10 +543,10 @@ while () : string, ; rest: string[]; { - & public; + & + public; DefaultValue(value ? : string = "Hello"); - { - } + { } } var Weekdays; (function (Weekdays) { diff --git a/tests/baselines/reference/contextualSignatureInstantiation1.js b/tests/baselines/reference/contextualSignatureInstantiation1.js index a9abab149bb..843ac5140f0 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation1.js +++ b/tests/baselines/reference/contextualSignatureInstantiation1.js @@ -8,11 +8,7 @@ var e2 = (x: string, y?: K) => x.length; var r100 = map2(e2); // type arg inference should fail for S since a generic lambda is not inferentially typed. Falls back to { length: number } //// [contextualSignatureInstantiation1.js] -var e = function (x, y) { - return x.length; -}; +var e = function (x, y) { return x.length; }; var r99 = map(e); // should be {}[] for S since a generic lambda is not inferentially typed -var e2 = function (x, y) { - return x.length; -}; +var e2 = function (x, y) { return x.length; }; var r100 = map2(e2); // type arg inference should fail for S since a generic lambda is not inferentially typed. Falls back to { length: number } diff --git a/tests/baselines/reference/contextualSignatureInstantiation2.js b/tests/baselines/reference/contextualSignatureInstantiation2.js index 8b29b432ce6..78bc5a88856 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation2.js +++ b/tests/baselines/reference/contextualSignatureInstantiation2.js @@ -8,12 +8,6 @@ var r23 = dot(id)(id); //// [contextualSignatureInstantiation2.js] // dot f g x = f(g(x)) var dot; -dot = function (f) { - return function (g) { - return function (x) { - return f(g(x)); - }; - }; -}; +dot = function (f) { return function (g) { return function (x) { return f(g(x)); }; }; }; var id; var r23 = dot(id)(id); diff --git a/tests/baselines/reference/contextualSignatureInstantiation3.js b/tests/baselines/reference/contextualSignatureInstantiation3.js index ccc5e584368..9198a02ccda 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation3.js +++ b/tests/baselines/reference/contextualSignatureInstantiation3.js @@ -31,15 +31,9 @@ function identity(x) { return x; } function singleton(x) { - return [ - x - ]; + return [x]; } -var xs = [ - 1, - 2, - 3 -]; +var xs = [1, 2, 3]; // Have compiler check that we get the correct types var v1; var v1 = xs.map(identity); // Error if not number[] diff --git a/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.js b/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.js index bd76a746ac9..726d45bffe5 100644 --- a/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.js +++ b/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.js @@ -8,9 +8,7 @@ var x = h("", f()); // Call should succeed and x should be string. All t //// [contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.js] function f() { - function g(u) { - return null; - } + function g(u) { return null; } return g; } var h; diff --git a/tests/baselines/reference/contextualTypeAny.js b/tests/baselines/reference/contextualTypeAny.js index 1a3918ba0d2..a88b353a890 100644 --- a/tests/baselines/reference/contextualTypeAny.js +++ b/tests/baselines/reference/contextualTypeAny.js @@ -7,11 +7,5 @@ var arr: number[] = ["", x]; //// [contextualTypeAny.js] var x; -var obj = { - p: "", - q: x -}; -var arr = [ - "", - x -]; +var obj = { p: "", q: x }; +var arr = ["", x]; diff --git a/tests/baselines/reference/contextualTypeAppliedToVarArgs.js b/tests/baselines/reference/contextualTypeAppliedToVarArgs.js index c4e78318a9c..77ce90ec737 100644 --- a/tests/baselines/reference/contextualTypeAppliedToVarArgs.js +++ b/tests/baselines/reference/contextualTypeAppliedToVarArgs.js @@ -18,8 +18,7 @@ class Foo{ //// [contextualTypeAppliedToVarArgs.js] function delegate(instance, method, data) { - return function () { - }; + return function () { }; } var Foo = (function () { function Foo() { diff --git a/tests/baselines/reference/contextualTypeArrayReturnType.js b/tests/baselines/reference/contextualTypeArrayReturnType.js index d84b93ec953..adc568d5230 100644 --- a/tests/baselines/reference/contextualTypeArrayReturnType.js +++ b/tests/baselines/reference/contextualTypeArrayReturnType.js @@ -24,9 +24,7 @@ var style: IBookStyle = { var style = { initialLeftPageTransforms: function (width) { return [ - { - 'ry': null - } + { 'ry': null } ]; } }; diff --git a/tests/baselines/reference/contextualTypeWithTuple.js b/tests/baselines/reference/contextualTypeWithTuple.js index d5c8fa83874..cfcdd13f7d0 100644 --- a/tests/baselines/reference/contextualTypeWithTuple.js +++ b/tests/baselines/reference/contextualTypeWithTuple.js @@ -27,36 +27,11 @@ numStrTuple = unionTuple3; //// [contextualTypeWithTuple.js] // no error -var numStrTuple = [ - 5, - "hello" -]; -var numStrTuple2 = [ - 5, - "foo", - true -]; -var numStrBoolTuple = [ - 5, - "foo", - true -]; -var objNumTuple = [ - { - a: "world" - }, - 5 -]; -var strTupleTuple = [ - "bar", - [ - 5, - { - x: 1, - y: 1 - } - ] -]; +var numStrTuple = [5, "hello"]; +var numStrTuple2 = [5, "foo", true]; +var numStrBoolTuple = [5, "foo", true]; +var objNumTuple = [{ a: "world" }, 5]; +var strTupleTuple = ["bar", [5, { x: 1, y: 1 }]]; var C = (function () { function C() { } @@ -67,36 +42,16 @@ var D = (function () { } return D; })(); -var unionTuple = [ - new C(), - "foo" -]; -var unionTuple1 = [ - new C(), - "foo" -]; -var unionTuple2 = [ - new C(), - "foo", - new D() -]; -var unionTuple3 = [ - 10, - "foo" -]; +var unionTuple = [new C(), "foo"]; +var unionTuple1 = [new C(), "foo"]; +var unionTuple2 = [new C(), "foo", new D()]; +var unionTuple3 = [10, "foo"]; numStrTuple = numStrTuple2; numStrTuple = numStrBoolTuple; // error -objNumTuple = [ - {}, - 5 -]; +objNumTuple = [{}, 5]; numStrBoolTuple = numStrTuple; -var strStrTuple = [ - "foo", - "bar", - 5 -]; +var strStrTuple = ["foo", "bar", 5]; unionTuple = unionTuple1; unionTuple = unionTuple2; unionTuple2 = unionTuple; diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.js b/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.js index 9daf108f1cd..e29d4720cbc 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.js +++ b/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.js @@ -40,21 +40,11 @@ var x4: IWithCallSignatures | IWithCallSignatures4 = a => /*here a should be any //When used as a contextual type, a union type U has those members that are present in any of // its constituent types, with types that are unions of the respective members in the constituent types. // With no call signature | callSignatures -var x = function (a) { - return a.toString(); -}; +var x = function (a) { return a.toString(); }; // With call signatures with different return type -var x2 = function (a) { - return a.toString(); -}; // Like iWithCallSignatures -var x2 = function (a) { - return a; -}; // Like iWithCallSignatures2 +var x2 = function (a) { return a.toString(); }; // Like iWithCallSignatures +var x2 = function (a) { return a; }; // Like iWithCallSignatures2 // With call signatures of mismatching parameter type -var x3 = function (a) { - return a.toString(); -}; +var x3 = function (a) { return a.toString(); }; // With call signature count mismatch -var x4 = function (a) { - return a.toString(); -}; +var x4 = function (a) { return a.toString(); }; diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.js b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.js index 7dfcb683010..2c07f461424 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.js +++ b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.js @@ -65,52 +65,16 @@ var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a }; // Let S be the set of types in U that has a string index signature. // If S is not empty, U has a string index signature of a union type of // the types of the string index signatures from each type in S. -var x = { - z: function (a) { - return a; - } -}; // a should be number -var x = { - foo: function (a) { - return a; - } -}; // a should be any -var x = { - foo: "hello" -}; -var x2 = { - z: function (a) { - return a.toString(); - } -}; // a should be number -var x2 = { - z: function (a) { - return a; - } -}; // a should be number +var x = { z: function (a) { return a; } }; // a should be number +var x = { foo: function (a) { return a; } }; // a should be any +var x = { foo: "hello" }; +var x2 = { z: function (a) { return a.toString(); } }; // a should be number +var x2 = { z: function (a) { return a; } }; // a should be number // Let S be the set of types in U that has a numeric index signature. // If S is not empty, U has a numeric index signature of a union type of // the types of the numeric index signatures from each type in S. -var x3 = { - 1: function (a) { - return a; - } -}; // a should be number -var x3 = { - 0: function (a) { - return a; - } -}; // a should be any -var x3 = { - 0: "hello" -}; -var x4 = { - 1: function (a) { - return a.toString(); - } -}; // a should be number -var x4 = { - 1: function (a) { - return a; - } -}; // a should be number +var x3 = { 1: function (a) { return a; } }; // a should be number +var x3 = { 0: function (a) { return a; } }; // a should be any +var x3 = { 0: "hello" }; +var x4 = { 1: function (a) { return a.toString(); } }; // a should be number +var x4 = { 1: function (a) { return a; } }; // a should be number diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeMembers.js b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.js index 7fd30a635a8..10672d86796 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeMembers.js +++ b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.js @@ -128,94 +128,49 @@ var i1Ori2 = i1; var i1Ori2 = i2; var i1Ori2 = { commonPropertyType: "hello", - commonMethodType: function (a) { - return a; - }, - commonMethodWithTypeParameter: function (a) { - return a; - }, - methodOnlyInI1: function (a) { - return a; - }, + commonMethodType: function (a) { return a; }, + commonMethodWithTypeParameter: function (a) { return a; }, + methodOnlyInI1: function (a) { return a; }, propertyOnlyInI1: "Hello" }; var i1Ori2 = { commonPropertyType: "hello", - commonMethodType: function (a) { - return a; - }, - commonMethodWithTypeParameter: function (a) { - return a; - }, - methodOnlyInI2: function (a) { - return a; - }, + commonMethodType: function (a) { return a; }, + commonMethodWithTypeParameter: function (a) { return a; }, + methodOnlyInI2: function (a) { return a; }, propertyOnlyInI2: "Hello" }; var i1Ori2 = { commonPropertyType: "hello", - commonMethodType: function (a) { - return a; - }, - commonMethodWithTypeParameter: function (a) { - return a; - }, - methodOnlyInI1: function (a) { - return a; - }, + commonMethodType: function (a) { return a; }, + commonMethodWithTypeParameter: function (a) { return a; }, + methodOnlyInI1: function (a) { return a; }, propertyOnlyInI1: "Hello", - methodOnlyInI2: function (a) { - return a; - }, + methodOnlyInI2: function (a) { return a; }, propertyOnlyInI2: "Hello" }; -var arrayI1OrI2 = [ - i1, - i2, - { +var arrayI1OrI2 = [i1, i2, { commonPropertyType: "hello", - commonMethodType: function (a) { - return a; - }, - commonMethodWithTypeParameter: function (a) { - return a; - }, - methodOnlyInI1: function (a) { - return a; - }, + commonMethodType: function (a) { return a; }, + commonMethodWithTypeParameter: function (a) { return a; }, + methodOnlyInI1: function (a) { return a; }, propertyOnlyInI1: "Hello" }, { commonPropertyType: "hello", - commonMethodType: function (a) { - return a; - }, - commonMethodWithTypeParameter: function (a) { - return a; - }, - methodOnlyInI2: function (a) { - return a; - }, + commonMethodType: function (a) { return a; }, + commonMethodWithTypeParameter: function (a) { return a; }, + methodOnlyInI2: function (a) { return a; }, propertyOnlyInI2: "Hello" - }, - { + }, { commonPropertyType: "hello", - commonMethodType: function (a) { - return a; - }, - commonMethodWithTypeParameter: function (a) { - return a; - }, - methodOnlyInI1: function (a) { - return a; - }, + commonMethodType: function (a) { return a; }, + commonMethodWithTypeParameter: function (a) { return a; }, + methodOnlyInI1: function (a) { return a; }, propertyOnlyInI1: "Hello", - methodOnlyInI2: function (a) { - return a; - }, + methodOnlyInI2: function (a) { return a; }, propertyOnlyInI2: "Hello" - } -]; + }]; var i11; var i21; var i11Ori21 = i11; @@ -236,24 +191,18 @@ var i11Ori21 = { }, commonPropertyDifferentType: 10 }; -var arrayOrI11OrI21 = [ - i11, - i21, - i11 || i21, - { +var arrayOrI11OrI21 = [i11, i21, i11 || i21, { // Like i1 commonMethodDifferentReturnType: function (a, b) { var z = a.charAt(b); return z; }, commonPropertyDifferentType: "hello" - }, - { + }, { // Like i2 commonMethodDifferentReturnType: function (a, b) { var z = a.charCodeAt(b); return z; }, commonPropertyDifferentType: 10 - } -]; + }]; diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.js b/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.js index d58b497a18d..dc8f07823b6 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.js +++ b/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.js @@ -79,9 +79,7 @@ var objStrOrNum3 = { var objStrOrNum4 = { prop: strOrNumber }; -var objStrOrNum5 = { - prop: strOrNumber -}; +var objStrOrNum5 = { prop: strOrNumber }; var objStrOrNum6 = { prop: strOrNumber, anotherP: str @@ -113,7 +111,5 @@ var i11Ori21 = { }; var strOrNumber; var i11Ori21 = { - commonMethodDifferentReturnType: function (a, b) { - return strOrNumber; - } + commonMethodDifferentReturnType: function (a, b) { return strOrNumber; } }; diff --git a/tests/baselines/reference/contextualTyping.js b/tests/baselines/reference/contextualTyping.js index b4c565c5091..75b98b16c33 100644 --- a/tests/baselines/reference/contextualTyping.js +++ b/tests/baselines/reference/contextualTyping.js @@ -249,48 +249,24 @@ var C2T5; }; })(C2T5 || (C2T5 = {})); // CONTEXT: Variable declaration -var c3t1 = (function (s) { - return s; -}); +var c3t1 = (function (s) { return s; }); var c3t2 = ({ n: 1 }); var c3t3 = []; -var c3t4 = function () { - return ({}); -}; -var c3t5 = function (n) { - return ({}); -}; -var c3t6 = function (n, s) { - return ({}); -}; -var c3t7 = function (n) { - return n; -}; -var c3t8 = function (n) { - return n; -}; -var c3t9 = [ - [], - [] -]; -var c3t10 = [ - ({}), - ({}) -]; -var c3t11 = [ - function (n, s) { - return s; - } -]; +var c3t4 = function () { return ({}); }; +var c3t5 = function (n) { return ({}); }; +var c3t6 = function (n, s) { return ({}); }; +var c3t7 = function (n) { return n; }; +var c3t8 = function (n) { return n; }; +var c3t9 = [[], []]; +var c3t10 = [({}), ({})]; +var c3t11 = [function (n, s) { return s; }]; var c3t12 = { foo: ({}) }; var c3t13 = ({ - f: function (i, s) { - return s; - } + f: function (i, s) { return s; } }); var c3t14 = ({ a: [] @@ -314,74 +290,41 @@ var C5T5; })(C5T5 || (C5T5 = {})); // CONTEXT: Variable assignment var c6t5; -c6t5 = function (n) { - return ({}); -}; +c6t5 = function (n) { return ({}); }; // CONTEXT: Array index assignment var c7t2; -c7t2[0] = ({ - n: 1 -}); +c7t2[0] = ({ n: 1 }); var objc8 = ({}); -objc8.t1 = (function (s) { - return s; -}); +objc8.t1 = (function (s) { return s; }); objc8.t2 = ({ n: 1 }); objc8.t3 = []; -objc8.t4 = function () { - return ({}); -}; -objc8.t5 = function (n) { - return ({}); -}; -objc8.t6 = function (n, s) { - return ({}); -}; -objc8.t7 = function (n) { - return n; -}; -objc8.t8 = function (n) { - return n; -}; -objc8.t9 = [ - [], - [] -]; -objc8.t10 = [ - ({}), - ({}) -]; -objc8.t11 = [ - function (n, s) { - return s; - } -]; +objc8.t4 = function () { return ({}); }; +objc8.t5 = function (n) { return ({}); }; +objc8.t6 = function (n, s) { return ({}); }; +objc8.t7 = function (n) { return n; }; +objc8.t8 = function (n) { return n; }; +objc8.t9 = [[], []]; +objc8.t10 = [({}), ({})]; +objc8.t11 = [function (n, s) { return s; }]; objc8.t12 = { foo: ({}) }; objc8.t13 = ({ - f: function (i, s) { - return s; - } + f: function (i, s) { return s; } }); objc8.t14 = ({ a: [] }); // CONTEXT: Function call -function c9t5(f) { -} +function c9t5(f) { } ; c9t5(function (n) { return ({}); }); // CONTEXT: Return statement -var c10t5 = function () { - return function (n) { - return ({}); - }; -}; +var c10t5 = function () { return function (n) { return ({}); }; }; // CONTEXT: Newing a class var C11t5 = (function () { function C11t5(f) { @@ -389,59 +332,31 @@ var C11t5 = (function () { return C11t5; })(); ; -var i = new C11t5(function (n) { - return ({}); -}); +var i = new C11t5(function (n) { return ({}); }); // CONTEXT: Type annotated expression -var c12t1 = (function (s) { - return s; -}); +var c12t1 = (function (s) { return s; }); var c12t2 = ({ n: 1 }); var c12t3 = []; -var c12t4 = function () { - return ({}); -}; -var c12t5 = function (n) { - return ({}); -}; -var c12t6 = function (n, s) { - return ({}); -}; -var c12t7 = function (n) { - return n; -}; -var c12t8 = function (n) { - return n; -}; -var c12t9 = [ - [], - [] -]; -var c12t10 = [ - ({}), - ({}) -]; -var c12t11 = [ - function (n, s) { - return s; - } -]; +var c12t4 = function () { return ({}); }; +var c12t5 = function (n) { return ({}); }; +var c12t6 = function (n, s) { return ({}); }; +var c12t7 = function (n) { return n; }; +var c12t8 = function (n) { return n; }; +var c12t9 = [[], []]; +var c12t10 = [({}), ({})]; +var c12t11 = [function (n, s) { return s; }]; var c12t12 = { foo: ({}) }; var c12t13 = ({ - f: function (i, s) { - return s; - } + f: function (i, s) { return s; } }); var c12t14 = ({ a: [] }); -function EF1(a, b) { - return a + b; -} +function EF1(a, b) { return a + b; } var efv = EF1(1, 2); function Point(x, y) { this.x = x; diff --git a/tests/baselines/reference/contextualTyping.js.map b/tests/baselines/reference/contextualTyping.js.map index 0b38517f9cc..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":"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;AAAC,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;IAAa,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA;AAAC,CAAC,CAAC;AACxD,IAAI,IAAI,GAAwB,UAAS,CAAC;IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA;AAAC,CAAC,CAAC;AAClE,IAAI,IAAI,GAAmC,UAAS,CAAC,EAAE,CAAC;IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA;AAAC,CAAC,CAAC;AAChF,IAAI,IAAI,GAGJ,UAAS,CAAC;IAAI,MAAM,CAAC,CAAC,CAAC;AAAC,CAAC,CAAC;AAE9B,IAAI,IAAI,GAAqC,UAAS,CAAC;IAAI,MAAM,CAAC,CAAC,CAAC;AAAC,CAAC,CAAC;AACvE,IAAI,IAAI,GAAe;IAAC,EAAE;IAAC,EAAE;CAAC,CAAC;AAC/B,IAAI,KAAK,GAAW;IAAO,CAAC,EAAE,CAAC;IAAO,CAAC,EAAE,CAAC;CAAC,CAAC;AAC5C,IAAI,KAAK,GAAwC;IAAC,UAAS,CAAC,EAAE,CAAC;QAAI,MAAM,CAAC,CAAC,CAAC;IAAC,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;QAAI,MAAM,CAAC,CAAC,CAAC;IAAC,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;AAAC,CAAC,CAAC;AAG9D,AADA,kCAAkC;IAC9B,IAAY,CAAC;AACjB,IAAI,CAAC,CAAC,CAAC,GAAS,CAAC;IAAC,CAAC,EAAE,CAAC;CAAC,CAAC,CAAC;AAuBzB,IAAI,KAAK,GAkBS,CAAC,EAAE,CAAC,CAAC;AAEvB,KAAK,CAAC,EAAE,GAAG,CAAC,UAAS,CAAC;IAAI,MAAM,CAAC,CAAC,CAAA;AAAC,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;IAAa,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA;AAAC,CAAC,CAAC;AAC5C,KAAK,CAAC,EAAE,GAAG,UAAS,CAAC;IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA;AAAC,CAAC,CAAC;AAC7C,KAAK,CAAC,EAAE,GAAG,UAAS,CAAC,EAAE,CAAC;IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA;AAAC,CAAC,CAAC;AAChD,KAAK,CAAC,EAAE,GAAG,UAAS,CAAS;IAAI,MAAM,CAAC,CAAC,CAAA;AAAC,CAAC,CAAC;AAE5C,KAAK,CAAC,EAAE,GAAG,UAAS,CAAC;IAAI,MAAM,CAAC,CAAC,CAAC;AAAC,CAAC,CAAC;AACrC,KAAK,CAAC,EAAE,GAAG;IAAC,EAAE;IAAC,EAAE;CAAC,CAAC;AACnB,KAAK,CAAC,GAAG,GAAG;IAAO,CAAC,EAAE,CAAC;IAAO,CAAC,EAAE,CAAC;CAAC,CAAC;AACpC,KAAK,CAAC,GAAG,GAAG;IAAC,UAAS,CAAC,EAAE,CAAC;QAAI,MAAM,CAAC,CAAC,CAAC;IAAC,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;QAAI,MAAM,CAAC,CAAC,CAAC;IAAC,CAAC;CAClC,CAAC,CAAA;AACF,KAAK,CAAC,GAAG,GAAS,CAAC;IACf,CAAC,EAAE,EAAE;CACR,CAAC,CAAA;AAEF,AADA,yBAAyB;cACX,CAAsB;AAAGC,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;IAAa,MAAM,CAAC,UAAS,CAAC;QAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA;IAAC,CAAC,CAAA;AAAC,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;AAAC,CAAC,CAAC,CAAC;AAGrD,AADA,qCAAqC;IACjC,KAAK,GAA2B,CAAC,UAAS,CAAC;IAAI,MAAM,CAAC,CAAC,CAAA;AAAC,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;IAAa,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA;AAAC,CAAC,CAAC;AAC1D,IAAI,KAAK,GAAyB,UAAS,CAAC;IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA;AAAC,CAAC,CAAC;AACpE,IAAI,KAAK,GAAoC,UAAS,CAAC,EAAE,CAAC;IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA;AAAC,CAAC,CAAC;AAClF,IAAI,KAAK,GAGN,UAAS,CAAQ;IAAI,MAAM,CAAC,CAAC,CAAA;AAAC,CAAC,CAAC;AAEnC,IAAI,KAAK,GAAsC,UAAS,CAAC;IAAI,MAAM,CAAC,CAAC,CAAC;AAAC,CAAC,CAAC;AACzE,IAAI,KAAK,GAAgB;IAAC,EAAE;IAAC,EAAE;CAAC,CAAC;AACjC,IAAI,MAAM,GAAY;IAAO,CAAC,EAAE,CAAC;IAAO,CAAC,EAAE,CAAC;CAAC,CAAC;AAC9C,IAAI,MAAM,GAAyC;IAAC,UAAS,CAAC,EAAE,CAAC;QAAI,MAAM,CAAC,CAAC,CAAC;IAAC,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;QAAI,MAAM,CAAC,CAAC,CAAC;IAAC,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;AAACA,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 225aa3285ff..085f6a439ff 100644 --- a/tests/baselines/reference/contextualTyping.sourcemap.txt +++ b/tests/baselines/reference/contextualTyping.sourcemap.txt @@ -259,6 +259,7 @@ sourceFile:contextualTyping.ts 1-> 2 > 3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^-> 1-> > >// CONTEXT: Variable declaration @@ -269,76 +270,71 @@ sourceFile:contextualTyping.ts 2 >Emitted(17, 1) Source(27, 1) + SourceIndex(0) 3 >Emitted(17, 33) Source(27, 33) + SourceIndex(0) --- ->>>var c3t1 = (function (s) { -1 >^^^^ +>>>var c3t1 = (function (s) { return s; }); +1->^^^^ 2 > ^^^^ 3 > ^^^ 4 > ^ 5 > ^^^^^^^^^^ 6 > ^ -1 > +7 > ^^^^ +8 > ^^^^^^ +9 > ^ +10> ^ +11> ^ +12> ^ +13> ^ +14> ^ +15> ^ +1-> >var 2 > c3t1 3 > : (s: string) => string = 4 > ( 5 > function( 6 > s -1 >Emitted(18, 5) Source(28, 5) + SourceIndex(0) +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) ---- ->>> return s; -1 >^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^ -1 >) { -2 > return -3 > -4 > s -5 > -1 >Emitted(19, 5) Source(28, 50) + SourceIndex(0) -2 >Emitted(19, 11) Source(28, 56) + SourceIndex(0) -3 >Emitted(19, 12) Source(28, 57) + SourceIndex(0) -4 >Emitted(19, 13) Source(28, 58) + SourceIndex(0) -5 >Emitted(19, 14) Source(28, 58) + SourceIndex(0) ---- ->>>}); -1 > -2 >^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^-> -1 > -2 >} -3 > ) -4 > ; -1 >Emitted(20, 1) Source(28, 59) + SourceIndex(0) -2 >Emitted(20, 2) Source(28, 60) + SourceIndex(0) -3 >Emitted(20, 3) Source(28, 61) + SourceIndex(0) -4 >Emitted(20, 4) Source(28, 62) + 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-> +1 > 2 >^^^^ 3 > ^^^^ 4 > ^^^ 5 > ^ -1-> +1 > > 2 >var 3 > c3t2 4 > = 5 > ( -1->Emitted(21, 1) Source(29, 1) + SourceIndex(0) -2 >Emitted(21, 5) Source(29, 5) + SourceIndex(0) -3 >Emitted(21, 9) Source(29, 9) + SourceIndex(0) -4 >Emitted(21, 12) Source(29, 18) + SourceIndex(0) -5 >Emitted(21, 13) Source(29, 19) + SourceIndex(0) +1 >Emitted(19, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(19, 5) Source(29, 5) + SourceIndex(0) +3 >Emitted(19, 9) Source(29, 9) + SourceIndex(0) +4 >Emitted(19, 12) Source(29, 18) + SourceIndex(0) +5 >Emitted(19, 13) Source(29, 19) + SourceIndex(0) --- >>> n: 1 1 >^^^^ @@ -350,10 +346,10 @@ sourceFile:contextualTyping.ts 2 > n 3 > : 4 > 1 -1 >Emitted(22, 5) Source(30, 5) + SourceIndex(0) -2 >Emitted(22, 6) Source(30, 6) + SourceIndex(0) -3 >Emitted(22, 8) Source(30, 8) + SourceIndex(0) -4 >Emitted(22, 9) Source(30, 9) + SourceIndex(0) +1 >Emitted(20, 5) Source(30, 5) + SourceIndex(0) +2 >Emitted(20, 6) Source(30, 6) + SourceIndex(0) +3 >Emitted(20, 8) Source(30, 8) + SourceIndex(0) +4 >Emitted(20, 9) Source(30, 9) + SourceIndex(0) --- >>>}); 1 >^ @@ -364,9 +360,9 @@ sourceFile:contextualTyping.ts >} 2 > ) 3 > -1 >Emitted(23, 2) Source(31, 2) + SourceIndex(0) -2 >Emitted(23, 3) Source(31, 3) + SourceIndex(0) -3 >Emitted(23, 4) Source(31, 3) + SourceIndex(0) +1 >Emitted(21, 2) Source(31, 2) + SourceIndex(0) +2 >Emitted(21, 3) Source(31, 3) + SourceIndex(0) +3 >Emitted(21, 4) Source(31, 3) + SourceIndex(0) --- >>>var c3t3 = []; 1-> @@ -375,7 +371,7 @@ sourceFile:contextualTyping.ts 4 > ^^^ 5 > ^^ 6 > ^ -7 > ^^^^^^^^^^^-> +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > 2 >var @@ -383,71 +379,77 @@ sourceFile:contextualTyping.ts 4 > : number[] = 5 > [] 6 > ; -1->Emitted(24, 1) Source(32, 1) + SourceIndex(0) -2 >Emitted(24, 5) Source(32, 5) + SourceIndex(0) -3 >Emitted(24, 9) Source(32, 9) + SourceIndex(0) -4 >Emitted(24, 12) Source(32, 22) + SourceIndex(0) -5 >Emitted(24, 14) Source(32, 24) + SourceIndex(0) -6 >Emitted(24, 15) Source(32, 25) + SourceIndex(0) +1->Emitted(22, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(22, 5) Source(32, 5) + SourceIndex(0) +3 >Emitted(22, 9) Source(32, 9) + SourceIndex(0) +4 >Emitted(22, 12) Source(32, 22) + SourceIndex(0) +5 >Emitted(22, 14) Source(32, 24) + SourceIndex(0) +6 >Emitted(22, 15) Source(32, 25) + SourceIndex(0) --- ->>>var c3t4 = function () { +>>>var c3t4 = function () { return ({}); }; 1-> 2 >^^^^ 3 > ^^^^ 4 > ^^^ -5 > ^^^^^^-> +5 > ^^^^^^^^^^^^^^ +6 > ^^^^^^ +7 > ^ +8 > ^ +9 > ^^ +10> ^ +11> ^ +12> ^ +13> ^ +14> ^ +15> ^^-> 1-> > 2 >var 3 > c3t4 4 > : () => IFoo = -1->Emitted(25, 1) Source(33, 1) + SourceIndex(0) -2 >Emitted(25, 5) Source(33, 5) + SourceIndex(0) -3 >Emitted(25, 9) Source(33, 9) + SourceIndex(0) -4 >Emitted(25, 12) Source(33, 24) + SourceIndex(0) +5 > function() { +6 > return +7 > +8 > ( +9 > {} +10> ) +11> +12> +13> } +14> ; +1->Emitted(23, 1) Source(33, 1) + SourceIndex(0) +2 >Emitted(23, 5) Source(33, 5) + SourceIndex(0) +3 >Emitted(23, 9) Source(33, 9) + SourceIndex(0) +4 >Emitted(23, 12) Source(33, 24) + SourceIndex(0) +5 >Emitted(23, 26) Source(33, 37) + SourceIndex(0) +6 >Emitted(23, 32) Source(33, 43) + SourceIndex(0) +7 >Emitted(23, 33) Source(33, 50) + SourceIndex(0) +8 >Emitted(23, 34) Source(33, 51) + SourceIndex(0) +9 >Emitted(23, 36) Source(33, 53) + SourceIndex(0) +10>Emitted(23, 37) Source(33, 54) + SourceIndex(0) +11>Emitted(23, 38) Source(33, 54) + SourceIndex(0) +12>Emitted(23, 39) Source(33, 55) + SourceIndex(0) +13>Emitted(23, 40) Source(33, 56) + SourceIndex(0) +14>Emitted(23, 41) Source(33, 57) + SourceIndex(0) --- ->>> return ({}); -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^^ -6 > ^ -7 > ^ -1->function() { -2 > return -3 > -4 > ( -5 > {} -6 > ) -7 > -1->Emitted(26, 5) Source(33, 37) + SourceIndex(0) -2 >Emitted(26, 11) Source(33, 43) + SourceIndex(0) -3 >Emitted(26, 12) Source(33, 50) + SourceIndex(0) -4 >Emitted(26, 13) Source(33, 51) + SourceIndex(0) -5 >Emitted(26, 15) Source(33, 53) + SourceIndex(0) -6 >Emitted(26, 16) Source(33, 54) + SourceIndex(0) -7 >Emitted(26, 17) Source(33, 54) + SourceIndex(0) ---- ->>>}; -1 > -2 >^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > ; -1 >Emitted(27, 1) Source(33, 55) + SourceIndex(0) -2 >Emitted(27, 2) Source(33, 56) + SourceIndex(0) -3 >Emitted(27, 3) Source(33, 57) + SourceIndex(0) ---- ->>>var c3t5 = function (n) { +>>>var c3t5 = function (n) { return ({}); }; 1-> 2 >^^^^ 3 > ^^^^ 4 > ^^^ 5 > ^^^^^^^^^^ 6 > ^ +7 > ^^^^ +8 > ^^^^^^ +9 > ^ +10> ^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^ +16> ^ +17> ^^^^-> 1-> > 2 >var @@ -455,49 +457,34 @@ sourceFile:contextualTyping.ts 4 > : (n: number) => IFoo = 5 > function( 6 > n -1->Emitted(28, 1) Source(34, 1) + SourceIndex(0) -2 >Emitted(28, 5) Source(34, 5) + SourceIndex(0) -3 >Emitted(28, 9) Source(34, 9) + SourceIndex(0) -4 >Emitted(28, 12) Source(34, 33) + SourceIndex(0) -5 >Emitted(28, 22) Source(34, 42) + SourceIndex(0) -6 >Emitted(28, 23) Source(34, 43) + SourceIndex(0) +7 > ) { +8 > return +9 > +10> ( +11> {} +12> ) +13> +14> +15> } +16> ; +1->Emitted(24, 1) Source(34, 1) + SourceIndex(0) +2 >Emitted(24, 5) Source(34, 5) + SourceIndex(0) +3 >Emitted(24, 9) Source(34, 9) + SourceIndex(0) +4 >Emitted(24, 12) Source(34, 33) + SourceIndex(0) +5 >Emitted(24, 22) Source(34, 42) + SourceIndex(0) +6 >Emitted(24, 23) Source(34, 43) + SourceIndex(0) +7 >Emitted(24, 27) Source(34, 47) + SourceIndex(0) +8 >Emitted(24, 33) Source(34, 53) + SourceIndex(0) +9 >Emitted(24, 34) Source(34, 60) + SourceIndex(0) +10>Emitted(24, 35) Source(34, 61) + SourceIndex(0) +11>Emitted(24, 37) Source(34, 63) + SourceIndex(0) +12>Emitted(24, 38) Source(34, 64) + SourceIndex(0) +13>Emitted(24, 39) Source(34, 64) + SourceIndex(0) +14>Emitted(24, 40) Source(34, 65) + SourceIndex(0) +15>Emitted(24, 41) Source(34, 66) + SourceIndex(0) +16>Emitted(24, 42) Source(34, 67) + SourceIndex(0) --- ->>> return ({}); -1 >^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^^ -6 > ^ -7 > ^ -1 >) { -2 > return -3 > -4 > ( -5 > {} -6 > ) -7 > -1 >Emitted(29, 5) Source(34, 47) + SourceIndex(0) -2 >Emitted(29, 11) Source(34, 53) + SourceIndex(0) -3 >Emitted(29, 12) Source(34, 60) + SourceIndex(0) -4 >Emitted(29, 13) Source(34, 61) + SourceIndex(0) -5 >Emitted(29, 15) Source(34, 63) + SourceIndex(0) -6 >Emitted(29, 16) Source(34, 64) + SourceIndex(0) -7 >Emitted(29, 17) Source(34, 64) + SourceIndex(0) ---- ->>>}; -1 > -2 >^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > ; -1 >Emitted(30, 1) Source(34, 65) + SourceIndex(0) -2 >Emitted(30, 2) Source(34, 66) + SourceIndex(0) -3 >Emitted(30, 3) Source(34, 67) + SourceIndex(0) ---- ->>>var c3t6 = function (n, s) { +>>>var c3t6 = function (n, s) { return ({}); }; 1-> 2 >^^^^ 3 > ^^^^ @@ -506,6 +493,16 @@ sourceFile:contextualTyping.ts 6 > ^ 7 > ^^ 8 > ^ +9 > ^^^^ +10> ^^^^^^ +11> ^ +12> ^ +13> ^^ +14> ^ +15> ^ +16> ^ +17> ^ +18> ^ 1-> > 2 >var @@ -515,58 +512,52 @@ sourceFile:contextualTyping.ts 6 > n 7 > , 8 > s -1->Emitted(31, 1) Source(35, 1) + SourceIndex(0) -2 >Emitted(31, 5) Source(35, 5) + SourceIndex(0) -3 >Emitted(31, 9) Source(35, 9) + SourceIndex(0) -4 >Emitted(31, 12) Source(35, 44) + SourceIndex(0) -5 >Emitted(31, 22) Source(35, 53) + SourceIndex(0) -6 >Emitted(31, 23) Source(35, 54) + SourceIndex(0) -7 >Emitted(31, 25) Source(35, 56) + SourceIndex(0) -8 >Emitted(31, 26) Source(35, 57) + SourceIndex(0) +9 > ) { +10> return +11> +12> ( +13> {} +14> ) +15> +16> +17> } +18> ; +1->Emitted(25, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(25, 5) Source(35, 5) + SourceIndex(0) +3 >Emitted(25, 9) Source(35, 9) + SourceIndex(0) +4 >Emitted(25, 12) Source(35, 44) + SourceIndex(0) +5 >Emitted(25, 22) Source(35, 53) + SourceIndex(0) +6 >Emitted(25, 23) Source(35, 54) + SourceIndex(0) +7 >Emitted(25, 25) Source(35, 56) + SourceIndex(0) +8 >Emitted(25, 26) Source(35, 57) + SourceIndex(0) +9 >Emitted(25, 30) Source(35, 61) + SourceIndex(0) +10>Emitted(25, 36) Source(35, 67) + SourceIndex(0) +11>Emitted(25, 37) Source(35, 74) + SourceIndex(0) +12>Emitted(25, 38) Source(35, 75) + SourceIndex(0) +13>Emitted(25, 40) Source(35, 77) + SourceIndex(0) +14>Emitted(25, 41) Source(35, 78) + SourceIndex(0) +15>Emitted(25, 42) Source(35, 78) + SourceIndex(0) +16>Emitted(25, 43) Source(35, 79) + SourceIndex(0) +17>Emitted(25, 44) Source(35, 80) + SourceIndex(0) +18>Emitted(25, 45) Source(35, 81) + SourceIndex(0) --- ->>> return ({}); -1 >^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^^ -6 > ^ -7 > ^ -1 >) { -2 > return -3 > -4 > ( -5 > {} -6 > ) -7 > -1 >Emitted(32, 5) Source(35, 61) + SourceIndex(0) -2 >Emitted(32, 11) Source(35, 67) + SourceIndex(0) -3 >Emitted(32, 12) Source(35, 74) + SourceIndex(0) -4 >Emitted(32, 13) Source(35, 75) + SourceIndex(0) -5 >Emitted(32, 15) Source(35, 77) + SourceIndex(0) -6 >Emitted(32, 16) Source(35, 78) + SourceIndex(0) -7 >Emitted(32, 17) Source(35, 78) + SourceIndex(0) ---- ->>>}; +>>>var c3t7 = function (n) { return n; }; 1 > -2 >^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > ; -1 >Emitted(33, 1) Source(35, 79) + SourceIndex(0) -2 >Emitted(33, 2) Source(35, 80) + SourceIndex(0) -3 >Emitted(33, 3) Source(35, 81) + SourceIndex(0) ---- ->>>var c3t7 = function (n) { -1-> 2 >^^^^ 3 > ^^^^ 4 > ^^^ 5 > ^^^^^^^^^^ 6 > ^ -1-> +7 > ^^^^ +8 > ^^^^^^ +9 > ^ +10> ^ +11> ^ +12> ^ +13> ^ +14> ^ +15> ^-> +1 > > 2 >var 3 > c3t7 @@ -576,49 +567,44 @@ sourceFile:contextualTyping.ts > } = 5 > function( 6 > n -1->Emitted(34, 1) Source(36, 1) + SourceIndex(0) -2 >Emitted(34, 5) Source(36, 5) + SourceIndex(0) -3 >Emitted(34, 9) Source(36, 9) + SourceIndex(0) -4 >Emitted(34, 12) Source(39, 5) + SourceIndex(0) -5 >Emitted(34, 22) Source(39, 14) + SourceIndex(0) -6 >Emitted(34, 23) Source(39, 15) + SourceIndex(0) +7 > ) { +8 > return +9 > +10> n +11> ; +12> +13> } +14> ; +1 >Emitted(26, 1) Source(36, 1) + SourceIndex(0) +2 >Emitted(26, 5) Source(36, 5) + SourceIndex(0) +3 >Emitted(26, 9) Source(36, 9) + SourceIndex(0) +4 >Emitted(26, 12) Source(39, 5) + SourceIndex(0) +5 >Emitted(26, 22) Source(39, 14) + SourceIndex(0) +6 >Emitted(26, 23) Source(39, 15) + SourceIndex(0) +7 >Emitted(26, 27) Source(39, 19) + SourceIndex(0) +8 >Emitted(26, 33) Source(39, 25) + SourceIndex(0) +9 >Emitted(26, 34) Source(39, 26) + SourceIndex(0) +10>Emitted(26, 35) Source(39, 27) + SourceIndex(0) +11>Emitted(26, 36) Source(39, 28) + SourceIndex(0) +12>Emitted(26, 37) Source(39, 29) + SourceIndex(0) +13>Emitted(26, 38) Source(39, 30) + SourceIndex(0) +14>Emitted(26, 39) Source(39, 31) + SourceIndex(0) --- ->>> return n; -1 >^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^ -1 >) { -2 > return -3 > -4 > n -5 > ; -1 >Emitted(35, 5) Source(39, 19) + SourceIndex(0) -2 >Emitted(35, 11) Source(39, 25) + SourceIndex(0) -3 >Emitted(35, 12) Source(39, 26) + SourceIndex(0) -4 >Emitted(35, 13) Source(39, 27) + SourceIndex(0) -5 >Emitted(35, 14) Source(39, 28) + SourceIndex(0) ---- ->>>}; -1 > -2 >^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > ; -1 >Emitted(36, 1) Source(39, 29) + SourceIndex(0) -2 >Emitted(36, 2) Source(39, 30) + SourceIndex(0) -3 >Emitted(36, 3) Source(39, 31) + SourceIndex(0) ---- ->>>var c3t8 = function (n) { +>>>var c3t8 = function (n) { return n; }; 1-> 2 >^^^^ 3 > ^^^^ 4 > ^^^ 5 > ^^^^^^^^^^ 6 > ^ +7 > ^^^^ +8 > ^^^^^^ +9 > ^ +10> ^ +11> ^ +12> ^ +13> ^ +14> ^ 1-> > > @@ -627,218 +613,181 @@ sourceFile:contextualTyping.ts 4 > : (n: number, s: string) => number = 5 > function( 6 > n -1->Emitted(37, 1) Source(41, 1) + SourceIndex(0) -2 >Emitted(37, 5) Source(41, 5) + SourceIndex(0) -3 >Emitted(37, 9) Source(41, 9) + SourceIndex(0) -4 >Emitted(37, 12) Source(41, 46) + SourceIndex(0) -5 >Emitted(37, 22) Source(41, 55) + SourceIndex(0) -6 >Emitted(37, 23) Source(41, 56) + SourceIndex(0) +7 > ) { +8 > return +9 > +10> n +11> ; +12> +13> } +14> ; +1->Emitted(27, 1) Source(41, 1) + SourceIndex(0) +2 >Emitted(27, 5) Source(41, 5) + SourceIndex(0) +3 >Emitted(27, 9) Source(41, 9) + SourceIndex(0) +4 >Emitted(27, 12) Source(41, 46) + SourceIndex(0) +5 >Emitted(27, 22) Source(41, 55) + SourceIndex(0) +6 >Emitted(27, 23) Source(41, 56) + SourceIndex(0) +7 >Emitted(27, 27) Source(41, 60) + SourceIndex(0) +8 >Emitted(27, 33) Source(41, 66) + SourceIndex(0) +9 >Emitted(27, 34) Source(41, 67) + SourceIndex(0) +10>Emitted(27, 35) Source(41, 68) + SourceIndex(0) +11>Emitted(27, 36) Source(41, 69) + SourceIndex(0) +12>Emitted(27, 37) Source(41, 70) + SourceIndex(0) +13>Emitted(27, 38) Source(41, 71) + SourceIndex(0) +14>Emitted(27, 39) Source(41, 72) + SourceIndex(0) --- ->>> return n; -1 >^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^ -1 >) { -2 > return -3 > -4 > n -5 > ; -1 >Emitted(38, 5) Source(41, 60) + SourceIndex(0) -2 >Emitted(38, 11) Source(41, 66) + SourceIndex(0) -3 >Emitted(38, 12) Source(41, 67) + SourceIndex(0) -4 >Emitted(38, 13) Source(41, 68) + SourceIndex(0) -5 >Emitted(38, 14) Source(41, 69) + SourceIndex(0) ---- ->>>}; +>>>var c3t9 = [[], []]; 1 > -2 >^ -3 > ^ -4 > ^^^^^^^^^^^-> -1 > -2 >} -3 > ; -1 >Emitted(39, 1) Source(41, 70) + SourceIndex(0) -2 >Emitted(39, 2) Source(41, 71) + SourceIndex(0) -3 >Emitted(39, 3) Source(41, 72) + SourceIndex(0) ---- ->>>var c3t9 = [ -1-> 2 >^^^^ 3 > ^^^^ 4 > ^^^ -1-> +5 > ^ +6 > ^^ +7 > ^^ +8 > ^^ +9 > ^ +10> ^ +11> ^^^^^^-> +1 > > 2 >var 3 > c3t9 4 > : number[][] = -1->Emitted(40, 1) Source(42, 1) + SourceIndex(0) -2 >Emitted(40, 5) Source(42, 5) + SourceIndex(0) -3 >Emitted(40, 9) Source(42, 9) + SourceIndex(0) -4 >Emitted(40, 12) Source(42, 24) + SourceIndex(0) +5 > [ +6 > [] +7 > , +8 > [] +9 > ] +10> ; +1 >Emitted(28, 1) Source(42, 1) + SourceIndex(0) +2 >Emitted(28, 5) Source(42, 5) + SourceIndex(0) +3 >Emitted(28, 9) Source(42, 9) + SourceIndex(0) +4 >Emitted(28, 12) Source(42, 24) + SourceIndex(0) +5 >Emitted(28, 13) Source(42, 25) + SourceIndex(0) +6 >Emitted(28, 15) Source(42, 27) + SourceIndex(0) +7 >Emitted(28, 17) Source(42, 28) + SourceIndex(0) +8 >Emitted(28, 19) Source(42, 30) + SourceIndex(0) +9 >Emitted(28, 20) Source(42, 31) + SourceIndex(0) +10>Emitted(28, 21) Source(42, 32) + SourceIndex(0) --- ->>> [], -1 >^^^^ -2 > ^^ -3 > ^-> -1 >[ -2 > [] -1 >Emitted(41, 5) Source(42, 25) + SourceIndex(0) -2 >Emitted(41, 7) Source(42, 27) + SourceIndex(0) ---- ->>> [] -1->^^^^ -2 > ^^ -1->, -2 > [] -1->Emitted(42, 5) Source(42, 28) + SourceIndex(0) -2 >Emitted(42, 7) Source(42, 30) + SourceIndex(0) ---- ->>>]; -1 >^ -2 > ^ -3 > ^^^^^^^^^^^^-> -1 >] -2 > ; -1 >Emitted(43, 2) Source(42, 31) + SourceIndex(0) -2 >Emitted(43, 3) Source(42, 32) + SourceIndex(0) ---- ->>>var c3t10 = [ +>>>var c3t10 = [({}), ({})]; 1-> 2 >^^^^ 3 > ^^^^^ 4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^-> 1-> > 2 >var 3 > c3t10 4 > : IFoo[] = -1->Emitted(44, 1) Source(43, 1) + SourceIndex(0) -2 >Emitted(44, 5) Source(43, 5) + SourceIndex(0) -3 >Emitted(44, 10) Source(43, 10) + SourceIndex(0) -4 >Emitted(44, 13) Source(43, 21) + SourceIndex(0) +5 > [ +6 > ( +7 > {} +8 > ) +9 > , +10> ( +11> {} +12> ) +13> ] +14> ; +1->Emitted(29, 1) Source(43, 1) + SourceIndex(0) +2 >Emitted(29, 5) Source(43, 5) + SourceIndex(0) +3 >Emitted(29, 10) Source(43, 10) + SourceIndex(0) +4 >Emitted(29, 13) Source(43, 21) + SourceIndex(0) +5 >Emitted(29, 14) Source(43, 28) + SourceIndex(0) +6 >Emitted(29, 15) Source(43, 29) + SourceIndex(0) +7 >Emitted(29, 17) Source(43, 31) + SourceIndex(0) +8 >Emitted(29, 18) Source(43, 32) + SourceIndex(0) +9 >Emitted(29, 20) Source(43, 39) + SourceIndex(0) +10>Emitted(29, 21) Source(43, 40) + SourceIndex(0) +11>Emitted(29, 23) Source(43, 42) + SourceIndex(0) +12>Emitted(29, 24) Source(43, 43) + SourceIndex(0) +13>Emitted(29, 25) Source(43, 44) + SourceIndex(0) +14>Emitted(29, 26) Source(43, 45) + SourceIndex(0) --- ->>> ({}), -1 >^^^^ -2 > ^ -3 > ^^ -4 > ^ -5 > ^-> -1 >[ -2 > ( -3 > {} -4 > ) -1 >Emitted(45, 5) Source(43, 28) + SourceIndex(0) -2 >Emitted(45, 6) Source(43, 29) + SourceIndex(0) -3 >Emitted(45, 8) Source(43, 31) + SourceIndex(0) -4 >Emitted(45, 9) Source(43, 32) + SourceIndex(0) ---- ->>> ({}) -1->^^^^ -2 > ^ -3 > ^^ -4 > ^ -1->, -2 > ( -3 > {} -4 > ) -1->Emitted(46, 5) Source(43, 39) + SourceIndex(0) -2 >Emitted(46, 6) Source(43, 40) + SourceIndex(0) -3 >Emitted(46, 8) Source(43, 42) + SourceIndex(0) -4 >Emitted(46, 9) Source(43, 43) + SourceIndex(0) ---- ->>>]; -1 >^ -2 > ^ -3 > ^^^^^^^^^^^^-> -1 >] -2 > ; -1 >Emitted(47, 2) Source(43, 44) + SourceIndex(0) -2 >Emitted(47, 3) Source(43, 45) + SourceIndex(0) ---- ->>>var c3t11 = [ +>>>var c3t11 = [function (n, s) { return s; }]; 1-> 2 >^^^^ 3 > ^^^^^ 4 > ^^^ -5 > ^^^^^^^^^^-> +5 > ^ +6 > ^^^^^^^^^^ +7 > ^ +8 > ^^ +9 > ^ +10> ^^^^ +11> ^^^^^^ +12> ^ +13> ^ +14> ^ +15> ^ +16> ^ +17> ^ +18> ^ 1-> > 2 >var 3 > c3t11 4 > : {(n: number, s: string): string;}[] = -1->Emitted(48, 1) Source(44, 1) + SourceIndex(0) -2 >Emitted(48, 5) Source(44, 5) + SourceIndex(0) -3 >Emitted(48, 10) Source(44, 10) + SourceIndex(0) -4 >Emitted(48, 13) Source(44, 50) + SourceIndex(0) ---- ->>> function (n, s) { -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^ -4 > ^^ -5 > ^ -1->[ -2 > function( -3 > n -4 > , -5 > s -1->Emitted(49, 5) Source(44, 51) + SourceIndex(0) -2 >Emitted(49, 15) Source(44, 60) + SourceIndex(0) -3 >Emitted(49, 16) Source(44, 61) + SourceIndex(0) -4 >Emitted(49, 18) Source(44, 63) + SourceIndex(0) -5 >Emitted(49, 19) Source(44, 64) + SourceIndex(0) ---- ->>> return s; -1 >^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^ -1 >) { -2 > return -3 > -4 > s -5 > ; -1 >Emitted(50, 9) Source(44, 68) + SourceIndex(0) -2 >Emitted(50, 15) Source(44, 74) + SourceIndex(0) -3 >Emitted(50, 16) Source(44, 75) + SourceIndex(0) -4 >Emitted(50, 17) Source(44, 76) + SourceIndex(0) -5 >Emitted(50, 18) Source(44, 77) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -1 > -2 > } -1 >Emitted(51, 5) Source(44, 78) + SourceIndex(0) -2 >Emitted(51, 6) Source(44, 79) + SourceIndex(0) ---- ->>>]; -1 >^ -2 > ^ -3 > ^^^^^^^^^^^^-> -1 >] -2 > ; -1 >Emitted(52, 2) Source(44, 80) + SourceIndex(0) -2 >Emitted(52, 3) Source(44, 81) + SourceIndex(0) +5 > [ +6 > function( +7 > n +8 > , +9 > s +10> ) { +11> return +12> +13> s +14> ; +15> +16> } +17> ] +18> ; +1->Emitted(30, 1) Source(44, 1) + SourceIndex(0) +2 >Emitted(30, 5) Source(44, 5) + SourceIndex(0) +3 >Emitted(30, 10) Source(44, 10) + SourceIndex(0) +4 >Emitted(30, 13) Source(44, 50) + SourceIndex(0) +5 >Emitted(30, 14) Source(44, 51) + SourceIndex(0) +6 >Emitted(30, 24) Source(44, 60) + SourceIndex(0) +7 >Emitted(30, 25) Source(44, 61) + SourceIndex(0) +8 >Emitted(30, 27) Source(44, 63) + SourceIndex(0) +9 >Emitted(30, 28) Source(44, 64) + SourceIndex(0) +10>Emitted(30, 32) Source(44, 68) + SourceIndex(0) +11>Emitted(30, 38) Source(44, 74) + SourceIndex(0) +12>Emitted(30, 39) Source(44, 75) + SourceIndex(0) +13>Emitted(30, 40) Source(44, 76) + SourceIndex(0) +14>Emitted(30, 41) Source(44, 77) + SourceIndex(0) +15>Emitted(30, 42) Source(44, 78) + SourceIndex(0) +16>Emitted(30, 43) Source(44, 79) + SourceIndex(0) +17>Emitted(30, 44) Source(44, 80) + SourceIndex(0) +18>Emitted(30, 45) Source(44, 81) + SourceIndex(0) --- >>>var c3t12 = { -1-> +1 > 2 >^^^^ 3 > ^^^^^ 4 > ^^^ 5 > ^^-> -1-> +1 > > 2 >var 3 > c3t12 4 > : IBar = -1->Emitted(53, 1) Source(45, 1) + SourceIndex(0) -2 >Emitted(53, 5) Source(45, 5) + SourceIndex(0) -3 >Emitted(53, 10) Source(45, 10) + SourceIndex(0) -4 >Emitted(53, 13) Source(45, 19) + SourceIndex(0) +1 >Emitted(31, 1) Source(45, 1) + SourceIndex(0) +2 >Emitted(31, 5) Source(45, 5) + SourceIndex(0) +3 >Emitted(31, 10) Source(45, 10) + SourceIndex(0) +4 >Emitted(31, 13) Source(45, 19) + SourceIndex(0) --- >>> foo: ({}) 1->^^^^ @@ -854,12 +803,12 @@ sourceFile:contextualTyping.ts 4 > ( 5 > {} 6 > ) -1->Emitted(54, 5) Source(46, 5) + SourceIndex(0) -2 >Emitted(54, 8) Source(46, 8) + SourceIndex(0) -3 >Emitted(54, 10) Source(46, 16) + SourceIndex(0) -4 >Emitted(54, 11) Source(46, 17) + SourceIndex(0) -5 >Emitted(54, 13) Source(46, 19) + SourceIndex(0) -6 >Emitted(54, 14) Source(46, 20) + SourceIndex(0) +1->Emitted(32, 5) Source(46, 5) + SourceIndex(0) +2 >Emitted(32, 8) Source(46, 8) + SourceIndex(0) +3 >Emitted(32, 10) Source(46, 16) + SourceIndex(0) +4 >Emitted(32, 11) Source(46, 17) + SourceIndex(0) +5 >Emitted(32, 13) Source(46, 19) + SourceIndex(0) +6 >Emitted(32, 14) Source(46, 20) + SourceIndex(0) --- >>>}; 1 >^ @@ -868,8 +817,8 @@ sourceFile:contextualTyping.ts 1 > >} 2 > -1 >Emitted(55, 2) Source(47, 2) + SourceIndex(0) -2 >Emitted(55, 3) Source(47, 2) + SourceIndex(0) +1 >Emitted(33, 2) Source(47, 2) + SourceIndex(0) +2 >Emitted(33, 3) Source(47, 2) + SourceIndex(0) --- >>>var c3t13 = ({ 1-> @@ -877,20 +826,20 @@ sourceFile:contextualTyping.ts 3 > ^^^^^ 4 > ^^^ 5 > ^ -6 > ^^^^^^^^^^^^-> +6 > ^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > 2 >var 3 > c3t13 4 > = 5 > ( -1->Emitted(56, 1) Source(48, 1) + SourceIndex(0) -2 >Emitted(56, 5) Source(48, 5) + SourceIndex(0) -3 >Emitted(56, 10) Source(48, 10) + SourceIndex(0) -4 >Emitted(56, 13) Source(48, 19) + SourceIndex(0) -5 >Emitted(56, 14) Source(48, 20) + SourceIndex(0) +1->Emitted(34, 1) Source(48, 1) + SourceIndex(0) +2 >Emitted(34, 5) Source(48, 5) + SourceIndex(0) +3 >Emitted(34, 10) Source(48, 10) + SourceIndex(0) +4 >Emitted(34, 13) Source(48, 19) + SourceIndex(0) +5 >Emitted(34, 14) Source(48, 20) + SourceIndex(0) --- ->>> f: function (i, s) { +>>> f: function (i, s) { return s; } 1->^^^^ 2 > ^ 3 > ^^ @@ -898,6 +847,13 @@ sourceFile:contextualTyping.ts 5 > ^ 6 > ^^ 7 > ^ +8 > ^^^^ +9 > ^^^^^^ +10> ^ +11> ^ +12> ^ +13> ^ +14> ^ 1->{ > 2 > f @@ -906,38 +862,27 @@ sourceFile:contextualTyping.ts 5 > i 6 > , 7 > s -1->Emitted(57, 5) Source(49, 5) + SourceIndex(0) -2 >Emitted(57, 6) Source(49, 6) + SourceIndex(0) -3 >Emitted(57, 8) Source(49, 8) + SourceIndex(0) -4 >Emitted(57, 18) Source(49, 17) + SourceIndex(0) -5 >Emitted(57, 19) Source(49, 18) + SourceIndex(0) -6 >Emitted(57, 21) Source(49, 20) + SourceIndex(0) -7 >Emitted(57, 22) Source(49, 21) + SourceIndex(0) ---- ->>> return s; -1 >^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^ -1 >) { -2 > return -3 > -4 > s -5 > ; -1 >Emitted(58, 9) Source(49, 25) + SourceIndex(0) -2 >Emitted(58, 15) Source(49, 31) + SourceIndex(0) -3 >Emitted(58, 16) Source(49, 32) + SourceIndex(0) -4 >Emitted(58, 17) Source(49, 33) + SourceIndex(0) -5 >Emitted(58, 18) Source(49, 34) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -1 > -2 > } -1 >Emitted(59, 5) Source(49, 35) + SourceIndex(0) -2 >Emitted(59, 6) Source(49, 36) + SourceIndex(0) +8 > ) { +9 > return +10> +11> s +12> ; +13> +14> } +1->Emitted(35, 5) Source(49, 5) + SourceIndex(0) +2 >Emitted(35, 6) Source(49, 6) + SourceIndex(0) +3 >Emitted(35, 8) Source(49, 8) + SourceIndex(0) +4 >Emitted(35, 18) Source(49, 17) + SourceIndex(0) +5 >Emitted(35, 19) Source(49, 18) + SourceIndex(0) +6 >Emitted(35, 21) Source(49, 20) + SourceIndex(0) +7 >Emitted(35, 22) Source(49, 21) + SourceIndex(0) +8 >Emitted(35, 26) Source(49, 25) + SourceIndex(0) +9 >Emitted(35, 32) Source(49, 31) + SourceIndex(0) +10>Emitted(35, 33) Source(49, 32) + SourceIndex(0) +11>Emitted(35, 34) Source(49, 33) + SourceIndex(0) +12>Emitted(35, 35) Source(49, 34) + SourceIndex(0) +13>Emitted(35, 36) Source(49, 35) + SourceIndex(0) +14>Emitted(35, 37) Source(49, 36) + SourceIndex(0) --- >>>}); 1 >^ @@ -948,9 +893,9 @@ sourceFile:contextualTyping.ts >} 2 > ) 3 > -1 >Emitted(60, 2) Source(50, 2) + SourceIndex(0) -2 >Emitted(60, 3) Source(50, 3) + SourceIndex(0) -3 >Emitted(60, 4) Source(50, 3) + SourceIndex(0) +1 >Emitted(36, 2) Source(50, 2) + SourceIndex(0) +2 >Emitted(36, 3) Source(50, 3) + SourceIndex(0) +3 >Emitted(36, 4) Source(50, 3) + SourceIndex(0) --- >>>var c3t14 = ({ 1-> @@ -964,11 +909,11 @@ sourceFile:contextualTyping.ts 3 > c3t14 4 > = 5 > ( -1->Emitted(61, 1) Source(51, 1) + SourceIndex(0) -2 >Emitted(61, 5) Source(51, 5) + SourceIndex(0) -3 >Emitted(61, 10) Source(51, 10) + SourceIndex(0) -4 >Emitted(61, 13) Source(51, 19) + SourceIndex(0) -5 >Emitted(61, 14) Source(51, 20) + SourceIndex(0) +1->Emitted(37, 1) Source(51, 1) + SourceIndex(0) +2 >Emitted(37, 5) Source(51, 5) + SourceIndex(0) +3 >Emitted(37, 10) Source(51, 10) + SourceIndex(0) +4 >Emitted(37, 13) Source(51, 19) + SourceIndex(0) +5 >Emitted(37, 14) Source(51, 20) + SourceIndex(0) --- >>> a: [] 1 >^^^^ @@ -980,10 +925,10 @@ sourceFile:contextualTyping.ts 2 > a 3 > : 4 > [] -1 >Emitted(62, 5) Source(52, 5) + SourceIndex(0) -2 >Emitted(62, 6) Source(52, 6) + SourceIndex(0) -3 >Emitted(62, 8) Source(52, 8) + SourceIndex(0) -4 >Emitted(62, 10) Source(52, 10) + SourceIndex(0) +1 >Emitted(38, 5) Source(52, 5) + SourceIndex(0) +2 >Emitted(38, 6) Source(52, 6) + SourceIndex(0) +3 >Emitted(38, 8) Source(52, 8) + SourceIndex(0) +4 >Emitted(38, 10) Source(52, 10) + SourceIndex(0) --- >>>}); 1 >^ @@ -994,9 +939,9 @@ sourceFile:contextualTyping.ts >} 2 > ) 3 > -1 >Emitted(63, 2) Source(53, 2) + SourceIndex(0) -2 >Emitted(63, 3) Source(53, 3) + SourceIndex(0) -3 >Emitted(63, 4) Source(53, 3) + SourceIndex(0) +1 >Emitted(39, 2) Source(53, 2) + SourceIndex(0) +2 >Emitted(39, 3) Source(53, 3) + SourceIndex(0) +3 >Emitted(39, 4) Source(53, 3) + SourceIndex(0) --- >>>// CONTEXT: Class property assignment 1-> @@ -1008,9 +953,9 @@ sourceFile:contextualTyping.ts > 2 > 3 >// CONTEXT: Class property assignment -1->Emitted(64, 1) Source(56, 1) + SourceIndex(0) -2 >Emitted(64, 1) Source(55, 1) + SourceIndex(0) -3 >Emitted(64, 38) Source(55, 38) + SourceIndex(0) +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 () { >>> function C4T5() { @@ -1020,7 +965,7 @@ sourceFile:contextualTyping.ts >class C4T5 { > foo: (i: number, s: string) => string; > -1 >Emitted(66, 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->^^^^^^^^ @@ -1042,15 +987,15 @@ sourceFile:contextualTyping.ts 7 > i 8 > , 9 > s -1->Emitted(67, 9) Source(59, 9) + SourceIndex(0) name (C4T5.constructor) -2 >Emitted(67, 13) Source(59, 13) + SourceIndex(0) name (C4T5.constructor) -3 >Emitted(67, 14) Source(59, 14) + SourceIndex(0) name (C4T5.constructor) -4 >Emitted(67, 17) Source(59, 17) + SourceIndex(0) name (C4T5.constructor) -5 >Emitted(67, 20) Source(59, 20) + SourceIndex(0) name (C4T5.constructor) -6 >Emitted(67, 30) Source(59, 29) + SourceIndex(0) name (C4T5.constructor) -7 >Emitted(67, 31) Source(59, 30) + SourceIndex(0) name (C4T5.constructor) -8 >Emitted(67, 33) Source(59, 32) + SourceIndex(0) name (C4T5.constructor) -9 >Emitted(67, 34) Source(59, 33) + SourceIndex(0) name (C4T5.constructor) +1->Emitted(43, 9) Source(59, 9) + SourceIndex(0) name (C4T5.constructor) +2 >Emitted(43, 13) Source(59, 13) + SourceIndex(0) name (C4T5.constructor) +3 >Emitted(43, 14) Source(59, 14) + SourceIndex(0) name (C4T5.constructor) +4 >Emitted(43, 17) Source(59, 17) + SourceIndex(0) name (C4T5.constructor) +5 >Emitted(43, 20) Source(59, 20) + SourceIndex(0) name (C4T5.constructor) +6 >Emitted(43, 30) Source(59, 29) + SourceIndex(0) name (C4T5.constructor) +7 >Emitted(43, 31) Source(59, 30) + SourceIndex(0) name (C4T5.constructor) +8 >Emitted(43, 33) Source(59, 32) + SourceIndex(0) name (C4T5.constructor) +9 >Emitted(43, 34) Source(59, 33) + SourceIndex(0) name (C4T5.constructor) --- >>> return s; 1 >^^^^^^^^^^^^ @@ -1064,11 +1009,11 @@ sourceFile:contextualTyping.ts 3 > 4 > s 5 > ; -1 >Emitted(68, 13) Source(60, 13) + SourceIndex(0) -2 >Emitted(68, 19) Source(60, 19) + SourceIndex(0) -3 >Emitted(68, 20) Source(60, 20) + SourceIndex(0) -4 >Emitted(68, 21) Source(60, 21) + SourceIndex(0) -5 >Emitted(68, 22) Source(60, 22) + SourceIndex(0) +1 >Emitted(44, 13) Source(60, 13) + SourceIndex(0) +2 >Emitted(44, 19) Source(60, 19) + SourceIndex(0) +3 >Emitted(44, 20) Source(60, 20) + SourceIndex(0) +4 >Emitted(44, 21) Source(60, 21) + SourceIndex(0) +5 >Emitted(44, 22) Source(60, 22) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^ @@ -1078,9 +1023,9 @@ sourceFile:contextualTyping.ts > 2 > } 3 > -1 >Emitted(69, 9) Source(61, 9) + SourceIndex(0) -2 >Emitted(69, 10) Source(61, 10) + SourceIndex(0) -3 >Emitted(69, 11) Source(61, 10) + SourceIndex(0) name (C4T5.constructor) +1 >Emitted(45, 9) Source(61, 9) + SourceIndex(0) +2 >Emitted(45, 10) Source(61, 10) + SourceIndex(0) +3 >Emitted(45, 11) Source(61, 10) + SourceIndex(0) name (C4T5.constructor) --- >>> } 1 >^^^^ @@ -1089,8 +1034,8 @@ sourceFile:contextualTyping.ts 1 > > 2 > } -1 >Emitted(70, 5) Source(62, 5) + SourceIndex(0) name (C4T5.constructor) -2 >Emitted(70, 6) Source(62, 6) + SourceIndex(0) name (C4T5.constructor) +1 >Emitted(46, 5) Source(62, 5) + SourceIndex(0) name (C4T5.constructor) +2 >Emitted(46, 6) Source(62, 6) + SourceIndex(0) name (C4T5.constructor) --- >>> return C4T5; 1->^^^^ @@ -1098,8 +1043,8 @@ sourceFile:contextualTyping.ts 1-> > 2 > } -1->Emitted(71, 5) Source(63, 1) + SourceIndex(0) name (C4T5) -2 >Emitted(71, 16) Source(63, 2) + SourceIndex(0) name (C4T5) +1->Emitted(47, 5) Source(63, 1) + SourceIndex(0) name (C4T5) +2 >Emitted(47, 16) Source(63, 2) + SourceIndex(0) name (C4T5) --- >>>})(); 1 > @@ -1118,10 +1063,10 @@ sourceFile:contextualTyping.ts > } > } > } -1 >Emitted(72, 1) Source(63, 1) + SourceIndex(0) name (C4T5) -2 >Emitted(72, 2) Source(63, 2) + SourceIndex(0) name (C4T5) -3 >Emitted(72, 2) Source(56, 1) + SourceIndex(0) -4 >Emitted(72, 6) Source(63, 2) + SourceIndex(0) +1 >Emitted(48, 1) Source(63, 1) + SourceIndex(0) name (C4T5) +2 >Emitted(48, 2) Source(63, 2) + SourceIndex(0) name (C4T5) +3 >Emitted(48, 2) Source(56, 1) + SourceIndex(0) +4 >Emitted(48, 6) Source(63, 2) + SourceIndex(0) --- >>>// CONTEXT: Module property assignment 1-> @@ -1133,9 +1078,9 @@ sourceFile:contextualTyping.ts > 2 > 3 >// CONTEXT: Module property assignment -1->Emitted(73, 1) Source(66, 1) + SourceIndex(0) -2 >Emitted(73, 1) Source(65, 1) + SourceIndex(0) -3 >Emitted(73, 39) Source(65, 39) + SourceIndex(0) +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 > @@ -1153,10 +1098,10 @@ sourceFile:contextualTyping.ts > return s; > } > } -1 >Emitted(74, 1) Source(66, 1) + SourceIndex(0) -2 >Emitted(74, 5) Source(66, 8) + SourceIndex(0) -3 >Emitted(74, 9) Source(66, 12) + SourceIndex(0) -4 >Emitted(74, 10) Source(71, 2) + SourceIndex(0) +1 >Emitted(50, 1) Source(66, 1) + SourceIndex(0) +2 >Emitted(50, 5) Source(66, 8) + SourceIndex(0) +3 >Emitted(50, 9) Source(66, 12) + SourceIndex(0) +4 >Emitted(50, 10) Source(71, 2) + SourceIndex(0) --- >>>(function (C5T5) { 1-> @@ -1169,11 +1114,11 @@ sourceFile:contextualTyping.ts 3 > C5T5 4 > 5 > { -1->Emitted(75, 1) Source(66, 1) + SourceIndex(0) -2 >Emitted(75, 12) Source(66, 8) + SourceIndex(0) -3 >Emitted(75, 16) Source(66, 12) + SourceIndex(0) -4 >Emitted(75, 18) Source(66, 13) + SourceIndex(0) -5 >Emitted(75, 19) Source(66, 14) + SourceIndex(0) +1->Emitted(51, 1) Source(66, 1) + SourceIndex(0) +2 >Emitted(51, 12) Source(66, 8) + SourceIndex(0) +3 >Emitted(51, 16) Source(66, 12) + SourceIndex(0) +4 >Emitted(51, 18) Source(66, 13) + SourceIndex(0) +5 >Emitted(51, 19) Source(66, 14) + SourceIndex(0) --- >>> C5T5.foo; 1 >^^^^ @@ -1184,9 +1129,9 @@ sourceFile:contextualTyping.ts > export var 2 > foo: (i: number, s: string) => string 3 > ; -1 >Emitted(76, 5) Source(67, 16) + SourceIndex(0) name (C5T5) -2 >Emitted(76, 13) Source(67, 53) + SourceIndex(0) name (C5T5) -3 >Emitted(76, 14) Source(67, 54) + SourceIndex(0) name (C5T5) +1 >Emitted(52, 5) Source(67, 16) + SourceIndex(0) name (C5T5) +2 >Emitted(52, 13) Source(67, 53) + SourceIndex(0) name (C5T5) +3 >Emitted(52, 14) Source(67, 54) + SourceIndex(0) name (C5T5) --- >>> C5T5.foo = function (i, s) { 1->^^^^ @@ -1204,13 +1149,13 @@ sourceFile:contextualTyping.ts 5 > i 6 > , 7 > s -1->Emitted(77, 5) Source(68, 5) + SourceIndex(0) name (C5T5) -2 >Emitted(77, 13) Source(68, 8) + SourceIndex(0) name (C5T5) -3 >Emitted(77, 16) Source(68, 11) + SourceIndex(0) name (C5T5) -4 >Emitted(77, 26) Source(68, 20) + SourceIndex(0) name (C5T5) -5 >Emitted(77, 27) Source(68, 21) + SourceIndex(0) name (C5T5) -6 >Emitted(77, 29) Source(68, 23) + SourceIndex(0) name (C5T5) -7 >Emitted(77, 30) Source(68, 24) + SourceIndex(0) name (C5T5) +1->Emitted(53, 5) Source(68, 5) + SourceIndex(0) name (C5T5) +2 >Emitted(53, 13) Source(68, 8) + SourceIndex(0) name (C5T5) +3 >Emitted(53, 16) Source(68, 11) + SourceIndex(0) name (C5T5) +4 >Emitted(53, 26) Source(68, 20) + SourceIndex(0) name (C5T5) +5 >Emitted(53, 27) Source(68, 21) + SourceIndex(0) name (C5T5) +6 >Emitted(53, 29) Source(68, 23) + SourceIndex(0) name (C5T5) +7 >Emitted(53, 30) Source(68, 24) + SourceIndex(0) name (C5T5) --- >>> return s; 1 >^^^^^^^^ @@ -1224,11 +1169,11 @@ sourceFile:contextualTyping.ts 3 > 4 > s 5 > ; -1 >Emitted(78, 9) Source(69, 9) + SourceIndex(0) -2 >Emitted(78, 15) Source(69, 15) + SourceIndex(0) -3 >Emitted(78, 16) Source(69, 16) + SourceIndex(0) -4 >Emitted(78, 17) Source(69, 17) + SourceIndex(0) -5 >Emitted(78, 18) Source(69, 18) + SourceIndex(0) +1 >Emitted(54, 9) Source(69, 9) + SourceIndex(0) +2 >Emitted(54, 15) Source(69, 15) + SourceIndex(0) +3 >Emitted(54, 16) Source(69, 16) + SourceIndex(0) +4 >Emitted(54, 17) Source(69, 17) + SourceIndex(0) +5 >Emitted(54, 18) Source(69, 18) + SourceIndex(0) --- >>> }; 1 >^^^^ @@ -1239,9 +1184,9 @@ sourceFile:contextualTyping.ts > 2 > } 3 > -1 >Emitted(79, 5) Source(70, 5) + SourceIndex(0) -2 >Emitted(79, 6) Source(70, 6) + SourceIndex(0) -3 >Emitted(79, 7) Source(70, 6) + SourceIndex(0) name (C5T5) +1 >Emitted(55, 5) Source(70, 5) + SourceIndex(0) +2 >Emitted(55, 6) Source(70, 6) + SourceIndex(0) +3 >Emitted(55, 7) Source(70, 6) + SourceIndex(0) name (C5T5) --- >>>})(C5T5 || (C5T5 = {})); 1-> @@ -1265,13 +1210,13 @@ sourceFile:contextualTyping.ts > return s; > } > } -1->Emitted(80, 1) Source(71, 1) + SourceIndex(0) name (C5T5) -2 >Emitted(80, 2) Source(71, 2) + SourceIndex(0) name (C5T5) -3 >Emitted(80, 4) Source(66, 8) + SourceIndex(0) -4 >Emitted(80, 8) Source(66, 12) + SourceIndex(0) -5 >Emitted(80, 13) Source(66, 8) + SourceIndex(0) -6 >Emitted(80, 17) Source(66, 12) + SourceIndex(0) -7 >Emitted(80, 25) Source(71, 2) + SourceIndex(0) +1->Emitted(56, 1) Source(71, 1) + SourceIndex(0) name (C5T5) +2 >Emitted(56, 2) Source(71, 2) + SourceIndex(0) name (C5T5) +3 >Emitted(56, 4) Source(66, 8) + SourceIndex(0) +4 >Emitted(56, 8) Source(66, 12) + SourceIndex(0) +5 >Emitted(56, 13) Source(66, 8) + SourceIndex(0) +6 >Emitted(56, 17) Source(66, 12) + SourceIndex(0) +7 >Emitted(56, 25) Source(71, 2) + SourceIndex(0) --- >>>// CONTEXT: Variable assignment 1-> @@ -1283,104 +1228,99 @@ sourceFile:contextualTyping.ts > 2 > 3 >// CONTEXT: Variable assignment -1->Emitted(81, 1) Source(74, 1) + SourceIndex(0) -2 >Emitted(81, 1) Source(73, 1) + SourceIndex(0) -3 >Emitted(81, 32) Source(73, 32) + SourceIndex(0) +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 > ^^^^^^^^^^^^^-> +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > >var 2 > c6t5: (n: number) => IFoo 3 > ; -1 >Emitted(82, 5) Source(74, 5) + SourceIndex(0) -2 >Emitted(82, 9) Source(74, 30) + SourceIndex(0) -3 >Emitted(82, 10) Source(74, 31) + SourceIndex(0) +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) { +>>>c6t5 = function (n) { return ({}); }; 1-> 2 >^^^^ 3 > ^^^ 4 > ^^^^^^^^^^ 5 > ^ +6 > ^^^^ +7 > ^^^^^^ +8 > ^ +9 > ^ +10> ^^ +11> ^ +12> ^ +13> ^ +14> ^ +15> ^ 1-> > 2 >c6t5 3 > = <(n: number) => IFoo> 4 > function( 5 > n -1->Emitted(83, 1) Source(75, 1) + SourceIndex(0) -2 >Emitted(83, 5) Source(75, 5) + SourceIndex(0) -3 >Emitted(83, 8) Source(75, 29) + SourceIndex(0) -4 >Emitted(83, 18) Source(75, 38) + SourceIndex(0) -5 >Emitted(83, 19) Source(75, 39) + SourceIndex(0) ---- ->>> return ({}); -1 >^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^^ -6 > ^ -7 > ^ -1 >) { -2 > return -3 > -4 > ( -5 > {} -6 > ) -7 > -1 >Emitted(84, 5) Source(75, 43) + SourceIndex(0) -2 >Emitted(84, 11) Source(75, 49) + SourceIndex(0) -3 >Emitted(84, 12) Source(75, 56) + SourceIndex(0) -4 >Emitted(84, 13) Source(75, 57) + SourceIndex(0) -5 >Emitted(84, 15) Source(75, 59) + SourceIndex(0) -6 >Emitted(84, 16) Source(75, 60) + SourceIndex(0) -7 >Emitted(84, 17) Source(75, 60) + SourceIndex(0) ---- ->>>}; -1 > -2 >^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > ; -1 >Emitted(85, 1) Source(75, 61) + SourceIndex(0) -2 >Emitted(85, 2) Source(75, 62) + SourceIndex(0) -3 >Emitted(85, 3) Source(75, 63) + SourceIndex(0) +6 > ) { +7 > return +8 > +9 > ( +10> {} +11> ) +12> +13> +14> } +15> ; +1->Emitted(59, 1) Source(75, 1) + SourceIndex(0) +2 >Emitted(59, 5) Source(75, 5) + SourceIndex(0) +3 >Emitted(59, 8) Source(75, 29) + SourceIndex(0) +4 >Emitted(59, 18) Source(75, 38) + SourceIndex(0) +5 >Emitted(59, 19) Source(75, 39) + SourceIndex(0) +6 >Emitted(59, 23) Source(75, 43) + SourceIndex(0) +7 >Emitted(59, 29) Source(75, 49) + SourceIndex(0) +8 >Emitted(59, 30) Source(75, 56) + SourceIndex(0) +9 >Emitted(59, 31) Source(75, 57) + SourceIndex(0) +10>Emitted(59, 33) Source(75, 59) + SourceIndex(0) +11>Emitted(59, 34) Source(75, 60) + SourceIndex(0) +12>Emitted(59, 35) Source(75, 60) + SourceIndex(0) +13>Emitted(59, 36) Source(75, 61) + SourceIndex(0) +14>Emitted(59, 37) Source(75, 62) + SourceIndex(0) +15>Emitted(59, 38) Source(75, 63) + SourceIndex(0) --- >>>// CONTEXT: Array index assignment -1-> +1 > 2 > 3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> +1 > > >// CONTEXT: Array index assignment > 2 > 3 >// CONTEXT: Array index assignment -1->Emitted(86, 1) Source(78, 1) + SourceIndex(0) -2 >Emitted(86, 1) Source(77, 1) + SourceIndex(0) -3 >Emitted(86, 35) Source(77, 35) + SourceIndex(0) +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 > ^^^^-> +4 > ^^^^^^^^^^^^^-> 1 > >var 2 > c7t2: IFoo[] 3 > ; -1 >Emitted(87, 5) Source(78, 5) + SourceIndex(0) -2 >Emitted(87, 9) Source(78, 17) + SourceIndex(0) -3 >Emitted(87, 10) Source(78, 18) + SourceIndex(0) +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] = ({ +>>>c7t2[0] = ({ n: 1 }); 1-> 2 >^^^^ 3 > ^ @@ -1388,6 +1328,13 @@ sourceFile:contextualTyping.ts 5 > ^ 6 > ^^^ 7 > ^ +8 > ^^ +9 > ^ +10> ^^ +11> ^ +12> ^^ +13> ^ +14> ^ 1-> > 2 >c7t2 @@ -1396,42 +1343,30 @@ sourceFile:contextualTyping.ts 5 > ] 6 > = 7 > ( -1->Emitted(88, 1) Source(79, 1) + SourceIndex(0) -2 >Emitted(88, 5) Source(79, 5) + SourceIndex(0) -3 >Emitted(88, 6) Source(79, 6) + SourceIndex(0) -4 >Emitted(88, 7) Source(79, 7) + SourceIndex(0) -5 >Emitted(88, 8) Source(79, 8) + SourceIndex(0) -6 >Emitted(88, 11) Source(79, 17) + SourceIndex(0) -7 >Emitted(88, 12) Source(79, 18) + SourceIndex(0) ---- ->>> n: 1 -1 >^^^^ -2 > ^ -3 > ^^ -4 > ^ -1 >{ -2 > n -3 > : -4 > 1 -1 >Emitted(89, 5) Source(79, 19) + SourceIndex(0) -2 >Emitted(89, 6) Source(79, 20) + SourceIndex(0) -3 >Emitted(89, 8) Source(79, 22) + SourceIndex(0) -4 >Emitted(89, 9) Source(79, 23) + SourceIndex(0) ---- ->>>}); -1 >^ -2 > ^ -3 > ^ -4 > ^^^^^^^^^^^^^^^-> -1 >} -2 > ) -3 > ; -1 >Emitted(90, 2) Source(79, 24) + SourceIndex(0) -2 >Emitted(90, 3) Source(79, 25) + SourceIndex(0) -3 >Emitted(90, 4) Source(79, 26) + SourceIndex(0) +8 > { +9 > n +10> : +11> 1 +12> } +13> ) +14> ; +1->Emitted(62, 1) Source(79, 1) + SourceIndex(0) +2 >Emitted(62, 5) Source(79, 5) + SourceIndex(0) +3 >Emitted(62, 6) Source(79, 6) + SourceIndex(0) +4 >Emitted(62, 7) Source(79, 7) + SourceIndex(0) +5 >Emitted(62, 8) Source(79, 8) + SourceIndex(0) +6 >Emitted(62, 11) Source(79, 17) + SourceIndex(0) +7 >Emitted(62, 12) Source(79, 18) + SourceIndex(0) +8 >Emitted(62, 14) Source(79, 19) + SourceIndex(0) +9 >Emitted(62, 15) Source(79, 20) + SourceIndex(0) +10>Emitted(62, 17) Source(79, 22) + SourceIndex(0) +11>Emitted(62, 18) Source(79, 23) + SourceIndex(0) +12>Emitted(62, 20) Source(79, 24) + SourceIndex(0) +13>Emitted(62, 21) Source(79, 25) + SourceIndex(0) +14>Emitted(62, 22) Source(79, 26) + SourceIndex(0) --- >>>var objc8 = ({}); -1-> +1 > 2 >^^^^ 3 > ^^^^^ 4 > ^^^ @@ -1439,8 +1374,8 @@ sourceFile:contextualTyping.ts 6 > ^^ 7 > ^ 8 > ^ -9 > ^^^^^^^^^^-> -1-> +9 > ^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > > >// CONTEXT: Object property assignment >interface IPlaceHolder { @@ -1489,16 +1424,16 @@ sourceFile:contextualTyping.ts 6 > {} 7 > ) 8 > ; -1->Emitted(91, 1) Source(102, 1) + SourceIndex(0) -2 >Emitted(91, 5) Source(102, 5) + SourceIndex(0) -3 >Emitted(91, 10) Source(102, 10) + SourceIndex(0) -4 >Emitted(91, 13) Source(120, 19) + SourceIndex(0) -5 >Emitted(91, 14) Source(120, 20) + SourceIndex(0) -6 >Emitted(91, 16) Source(120, 22) + SourceIndex(0) -7 >Emitted(91, 17) Source(120, 23) + SourceIndex(0) -8 >Emitted(91, 18) Source(120, 24) + SourceIndex(0) +1 >Emitted(63, 1) Source(102, 1) + SourceIndex(0) +2 >Emitted(63, 5) Source(102, 5) + SourceIndex(0) +3 >Emitted(63, 10) Source(102, 10) + SourceIndex(0) +4 >Emitted(63, 13) Source(120, 19) + SourceIndex(0) +5 >Emitted(63, 14) Source(120, 20) + SourceIndex(0) +6 >Emitted(63, 16) Source(120, 22) + SourceIndex(0) +7 >Emitted(63, 17) Source(120, 23) + SourceIndex(0) +8 >Emitted(63, 18) Source(120, 24) + SourceIndex(0) --- ->>>objc8.t1 = (function (s) { +>>>objc8.t1 = (function (s) { return s; }); 1-> 2 >^^^^^ 3 > ^ @@ -1507,6 +1442,15 @@ sourceFile:contextualTyping.ts 6 > ^ 7 > ^^^^^^^^^^ 8 > ^ +9 > ^^^^ +10> ^^^^^^ +11> ^ +12> ^ +13> ^ +14> ^ +15> ^ +16> ^ +17> ^ 1-> > > @@ -1517,67 +1461,53 @@ sourceFile:contextualTyping.ts 6 > ( 7 > function( 8 > s -1->Emitted(92, 1) Source(122, 1) + SourceIndex(0) -2 >Emitted(92, 6) Source(122, 6) + SourceIndex(0) -3 >Emitted(92, 7) Source(122, 7) + SourceIndex(0) -4 >Emitted(92, 9) Source(122, 9) + SourceIndex(0) -5 >Emitted(92, 12) Source(122, 12) + SourceIndex(0) -6 >Emitted(92, 13) Source(122, 13) + SourceIndex(0) -7 >Emitted(92, 23) Source(122, 22) + SourceIndex(0) -8 >Emitted(92, 24) Source(122, 23) + SourceIndex(0) ---- ->>> return s; -1 >^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^ -1 >) { -2 > return -3 > -4 > s -5 > -1 >Emitted(93, 5) Source(122, 27) + SourceIndex(0) -2 >Emitted(93, 11) Source(122, 33) + SourceIndex(0) -3 >Emitted(93, 12) Source(122, 34) + SourceIndex(0) -4 >Emitted(93, 13) Source(122, 35) + SourceIndex(0) -5 >Emitted(93, 14) Source(122, 35) + SourceIndex(0) ---- ->>>}); -1 > -2 >^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^-> -1 > -2 >} -3 > ) -4 > ; -1 >Emitted(94, 1) Source(122, 36) + SourceIndex(0) -2 >Emitted(94, 2) Source(122, 37) + SourceIndex(0) -3 >Emitted(94, 3) Source(122, 38) + SourceIndex(0) -4 >Emitted(94, 4) Source(122, 39) + SourceIndex(0) +9 > ) { +10> return +11> +12> s +13> +14> +15> } +16> ) +17> ; +1->Emitted(64, 1) Source(122, 1) + SourceIndex(0) +2 >Emitted(64, 6) Source(122, 6) + SourceIndex(0) +3 >Emitted(64, 7) Source(122, 7) + SourceIndex(0) +4 >Emitted(64, 9) Source(122, 9) + SourceIndex(0) +5 >Emitted(64, 12) Source(122, 12) + SourceIndex(0) +6 >Emitted(64, 13) Source(122, 13) + SourceIndex(0) +7 >Emitted(64, 23) Source(122, 22) + SourceIndex(0) +8 >Emitted(64, 24) Source(122, 23) + SourceIndex(0) +9 >Emitted(64, 28) Source(122, 27) + SourceIndex(0) +10>Emitted(64, 34) Source(122, 33) + SourceIndex(0) +11>Emitted(64, 35) Source(122, 34) + SourceIndex(0) +12>Emitted(64, 36) Source(122, 35) + SourceIndex(0) +13>Emitted(64, 37) Source(122, 35) + SourceIndex(0) +14>Emitted(64, 38) Source(122, 36) + SourceIndex(0) +15>Emitted(64, 39) Source(122, 37) + SourceIndex(0) +16>Emitted(64, 40) Source(122, 38) + SourceIndex(0) +17>Emitted(64, 41) Source(122, 39) + SourceIndex(0) --- >>>objc8.t2 = ({ -1-> +1 > 2 >^^^^^ 3 > ^ 4 > ^^ 5 > ^^^ 6 > ^ -1-> +1 > > 2 >objc8 3 > . 4 > t2 5 > = 6 > ( -1->Emitted(95, 1) Source(123, 1) + SourceIndex(0) -2 >Emitted(95, 6) Source(123, 6) + SourceIndex(0) -3 >Emitted(95, 7) Source(123, 7) + SourceIndex(0) -4 >Emitted(95, 9) Source(123, 9) + SourceIndex(0) -5 >Emitted(95, 12) Source(123, 18) + SourceIndex(0) -6 >Emitted(95, 13) Source(123, 19) + SourceIndex(0) +1 >Emitted(65, 1) Source(123, 1) + SourceIndex(0) +2 >Emitted(65, 6) Source(123, 6) + SourceIndex(0) +3 >Emitted(65, 7) Source(123, 7) + SourceIndex(0) +4 >Emitted(65, 9) Source(123, 9) + SourceIndex(0) +5 >Emitted(65, 12) Source(123, 18) + SourceIndex(0) +6 >Emitted(65, 13) Source(123, 19) + SourceIndex(0) --- >>> n: 1 1 >^^^^ @@ -1589,10 +1519,10 @@ sourceFile:contextualTyping.ts 2 > n 3 > : 4 > 1 -1 >Emitted(96, 5) Source(124, 5) + SourceIndex(0) -2 >Emitted(96, 6) Source(124, 6) + SourceIndex(0) -3 >Emitted(96, 8) Source(124, 8) + SourceIndex(0) -4 >Emitted(96, 9) Source(124, 9) + SourceIndex(0) +1 >Emitted(66, 5) Source(124, 5) + SourceIndex(0) +2 >Emitted(66, 6) Source(124, 6) + SourceIndex(0) +3 >Emitted(66, 8) Source(124, 8) + SourceIndex(0) +4 >Emitted(66, 9) Source(124, 9) + SourceIndex(0) --- >>>}); 1 >^ @@ -1603,9 +1533,9 @@ sourceFile:contextualTyping.ts >} 2 > ) 3 > ; -1 >Emitted(97, 2) Source(125, 2) + SourceIndex(0) -2 >Emitted(97, 3) Source(125, 3) + SourceIndex(0) -3 >Emitted(97, 4) Source(125, 4) + SourceIndex(0) +1 >Emitted(67, 2) Source(125, 2) + SourceIndex(0) +2 >Emitted(67, 3) Source(125, 3) + SourceIndex(0) +3 >Emitted(67, 4) Source(125, 4) + SourceIndex(0) --- >>>objc8.t3 = []; 1-> @@ -1615,7 +1545,7 @@ sourceFile:contextualTyping.ts 5 > ^^^ 6 > ^^ 7 > ^ -8 > ^^^^^^^^^^^-> +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > 2 >objc8 @@ -1624,69 +1554,64 @@ sourceFile:contextualTyping.ts 5 > = 6 > [] 7 > ; -1->Emitted(98, 1) Source(126, 1) + SourceIndex(0) -2 >Emitted(98, 6) Source(126, 6) + SourceIndex(0) -3 >Emitted(98, 7) Source(126, 7) + SourceIndex(0) -4 >Emitted(98, 9) Source(126, 9) + SourceIndex(0) -5 >Emitted(98, 12) Source(126, 12) + SourceIndex(0) -6 >Emitted(98, 14) Source(126, 14) + SourceIndex(0) -7 >Emitted(98, 15) Source(126, 15) + SourceIndex(0) +1->Emitted(68, 1) Source(126, 1) + SourceIndex(0) +2 >Emitted(68, 6) Source(126, 6) + SourceIndex(0) +3 >Emitted(68, 7) Source(126, 7) + SourceIndex(0) +4 >Emitted(68, 9) Source(126, 9) + SourceIndex(0) +5 >Emitted(68, 12) Source(126, 12) + SourceIndex(0) +6 >Emitted(68, 14) Source(126, 14) + SourceIndex(0) +7 >Emitted(68, 15) Source(126, 15) + SourceIndex(0) --- ->>>objc8.t4 = function () { +>>>objc8.t4 = function () { return ({}); }; 1-> 2 >^^^^^ 3 > ^ 4 > ^^ 5 > ^^^ -6 > ^^^^^^-> +6 > ^^^^^^^^^^^^^^ +7 > ^^^^^^ +8 > ^ +9 > ^ +10> ^^ +11> ^ +12> ^ +13> ^ +14> ^ +15> ^ +16> ^^-> 1-> > 2 >objc8 3 > . 4 > t4 5 > = -1->Emitted(99, 1) Source(127, 1) + SourceIndex(0) -2 >Emitted(99, 6) Source(127, 6) + SourceIndex(0) -3 >Emitted(99, 7) Source(127, 7) + SourceIndex(0) -4 >Emitted(99, 9) Source(127, 9) + SourceIndex(0) -5 >Emitted(99, 12) Source(127, 12) + SourceIndex(0) +6 > function() { +7 > return +8 > +9 > ( +10> {} +11> ) +12> +13> +14> } +15> ; +1->Emitted(69, 1) Source(127, 1) + SourceIndex(0) +2 >Emitted(69, 6) Source(127, 6) + SourceIndex(0) +3 >Emitted(69, 7) Source(127, 7) + SourceIndex(0) +4 >Emitted(69, 9) Source(127, 9) + SourceIndex(0) +5 >Emitted(69, 12) Source(127, 12) + SourceIndex(0) +6 >Emitted(69, 26) Source(127, 25) + SourceIndex(0) +7 >Emitted(69, 32) Source(127, 31) + SourceIndex(0) +8 >Emitted(69, 33) Source(127, 38) + SourceIndex(0) +9 >Emitted(69, 34) Source(127, 39) + SourceIndex(0) +10>Emitted(69, 36) Source(127, 41) + SourceIndex(0) +11>Emitted(69, 37) Source(127, 42) + SourceIndex(0) +12>Emitted(69, 38) Source(127, 42) + SourceIndex(0) +13>Emitted(69, 39) Source(127, 43) + SourceIndex(0) +14>Emitted(69, 40) Source(127, 44) + SourceIndex(0) +15>Emitted(69, 41) Source(127, 45) + SourceIndex(0) --- ->>> return ({}); -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^^ -6 > ^ -7 > ^ -1->function() { -2 > return -3 > -4 > ( -5 > {} -6 > ) -7 > -1->Emitted(100, 5) Source(127, 25) + SourceIndex(0) -2 >Emitted(100, 11) Source(127, 31) + SourceIndex(0) -3 >Emitted(100, 12) Source(127, 38) + SourceIndex(0) -4 >Emitted(100, 13) Source(127, 39) + SourceIndex(0) -5 >Emitted(100, 15) Source(127, 41) + SourceIndex(0) -6 >Emitted(100, 16) Source(127, 42) + SourceIndex(0) -7 >Emitted(100, 17) Source(127, 42) + SourceIndex(0) ---- ->>>}; -1 > -2 >^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > ; -1 >Emitted(101, 1) Source(127, 43) + SourceIndex(0) -2 >Emitted(101, 2) Source(127, 44) + SourceIndex(0) -3 >Emitted(101, 3) Source(127, 45) + SourceIndex(0) ---- ->>>objc8.t5 = function (n) { +>>>objc8.t5 = function (n) { return ({}); }; 1-> 2 >^^^^^ 3 > ^ @@ -1694,6 +1619,17 @@ sourceFile:contextualTyping.ts 5 > ^^^ 6 > ^^^^^^^^^^ 7 > ^ +8 > ^^^^ +9 > ^^^^^^ +10> ^ +11> ^ +12> ^^ +13> ^ +14> ^ +15> ^ +16> ^ +17> ^ +18> ^^^^-> 1-> > 2 >objc8 @@ -1702,50 +1638,35 @@ sourceFile:contextualTyping.ts 5 > = 6 > function( 7 > n -1->Emitted(102, 1) Source(128, 1) + SourceIndex(0) -2 >Emitted(102, 6) Source(128, 6) + SourceIndex(0) -3 >Emitted(102, 7) Source(128, 7) + SourceIndex(0) -4 >Emitted(102, 9) Source(128, 9) + SourceIndex(0) -5 >Emitted(102, 12) Source(128, 12) + SourceIndex(0) -6 >Emitted(102, 22) Source(128, 21) + SourceIndex(0) -7 >Emitted(102, 23) Source(128, 22) + SourceIndex(0) +8 > ) { +9 > return +10> +11> ( +12> {} +13> ) +14> +15> +16> } +17> ; +1->Emitted(70, 1) Source(128, 1) + SourceIndex(0) +2 >Emitted(70, 6) Source(128, 6) + SourceIndex(0) +3 >Emitted(70, 7) Source(128, 7) + SourceIndex(0) +4 >Emitted(70, 9) Source(128, 9) + SourceIndex(0) +5 >Emitted(70, 12) Source(128, 12) + SourceIndex(0) +6 >Emitted(70, 22) Source(128, 21) + SourceIndex(0) +7 >Emitted(70, 23) Source(128, 22) + SourceIndex(0) +8 >Emitted(70, 27) Source(128, 26) + SourceIndex(0) +9 >Emitted(70, 33) Source(128, 32) + SourceIndex(0) +10>Emitted(70, 34) Source(128, 39) + SourceIndex(0) +11>Emitted(70, 35) Source(128, 40) + SourceIndex(0) +12>Emitted(70, 37) Source(128, 42) + SourceIndex(0) +13>Emitted(70, 38) Source(128, 43) + SourceIndex(0) +14>Emitted(70, 39) Source(128, 43) + SourceIndex(0) +15>Emitted(70, 40) Source(128, 44) + SourceIndex(0) +16>Emitted(70, 41) Source(128, 45) + SourceIndex(0) +17>Emitted(70, 42) Source(128, 46) + SourceIndex(0) --- ->>> return ({}); -1 >^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^^ -6 > ^ -7 > ^ -1 >) { -2 > return -3 > -4 > ( -5 > {} -6 > ) -7 > -1 >Emitted(103, 5) Source(128, 26) + SourceIndex(0) -2 >Emitted(103, 11) Source(128, 32) + SourceIndex(0) -3 >Emitted(103, 12) Source(128, 39) + SourceIndex(0) -4 >Emitted(103, 13) Source(128, 40) + SourceIndex(0) -5 >Emitted(103, 15) Source(128, 42) + SourceIndex(0) -6 >Emitted(103, 16) Source(128, 43) + SourceIndex(0) -7 >Emitted(103, 17) Source(128, 43) + SourceIndex(0) ---- ->>>}; -1 > -2 >^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > ; -1 >Emitted(104, 1) Source(128, 44) + SourceIndex(0) -2 >Emitted(104, 2) Source(128, 45) + SourceIndex(0) -3 >Emitted(104, 3) Source(128, 46) + SourceIndex(0) ---- ->>>objc8.t6 = function (n, s) { +>>>objc8.t6 = function (n, s) { return ({}); }; 1-> 2 >^^^^^ 3 > ^ @@ -1755,6 +1676,16 @@ sourceFile:contextualTyping.ts 7 > ^ 8 > ^^ 9 > ^ +10> ^^^^ +11> ^^^^^^ +12> ^ +13> ^ +14> ^^ +15> ^ +16> ^ +17> ^ +18> ^ +19> ^ 1-> > 2 >objc8 @@ -1765,60 +1696,54 @@ sourceFile:contextualTyping.ts 7 > n 8 > , 9 > s -1->Emitted(105, 1) Source(129, 1) + SourceIndex(0) -2 >Emitted(105, 6) Source(129, 6) + SourceIndex(0) -3 >Emitted(105, 7) Source(129, 7) + SourceIndex(0) -4 >Emitted(105, 9) Source(129, 9) + SourceIndex(0) -5 >Emitted(105, 12) Source(129, 12) + SourceIndex(0) -6 >Emitted(105, 22) Source(129, 21) + SourceIndex(0) -7 >Emitted(105, 23) Source(129, 22) + SourceIndex(0) -8 >Emitted(105, 25) Source(129, 24) + SourceIndex(0) -9 >Emitted(105, 26) Source(129, 25) + SourceIndex(0) +10> ) { +11> return +12> +13> ( +14> {} +15> ) +16> +17> +18> } +19> ; +1->Emitted(71, 1) Source(129, 1) + SourceIndex(0) +2 >Emitted(71, 6) Source(129, 6) + SourceIndex(0) +3 >Emitted(71, 7) Source(129, 7) + SourceIndex(0) +4 >Emitted(71, 9) Source(129, 9) + SourceIndex(0) +5 >Emitted(71, 12) Source(129, 12) + SourceIndex(0) +6 >Emitted(71, 22) Source(129, 21) + SourceIndex(0) +7 >Emitted(71, 23) Source(129, 22) + SourceIndex(0) +8 >Emitted(71, 25) Source(129, 24) + SourceIndex(0) +9 >Emitted(71, 26) Source(129, 25) + SourceIndex(0) +10>Emitted(71, 30) Source(129, 29) + SourceIndex(0) +11>Emitted(71, 36) Source(129, 35) + SourceIndex(0) +12>Emitted(71, 37) Source(129, 42) + SourceIndex(0) +13>Emitted(71, 38) Source(129, 43) + SourceIndex(0) +14>Emitted(71, 40) Source(129, 45) + SourceIndex(0) +15>Emitted(71, 41) Source(129, 46) + SourceIndex(0) +16>Emitted(71, 42) Source(129, 46) + SourceIndex(0) +17>Emitted(71, 43) Source(129, 47) + SourceIndex(0) +18>Emitted(71, 44) Source(129, 48) + SourceIndex(0) +19>Emitted(71, 45) Source(129, 49) + SourceIndex(0) --- ->>> return ({}); -1 >^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^^ -6 > ^ -7 > ^ -1 >) { -2 > return -3 > -4 > ( -5 > {} -6 > ) -7 > -1 >Emitted(106, 5) Source(129, 29) + SourceIndex(0) -2 >Emitted(106, 11) Source(129, 35) + SourceIndex(0) -3 >Emitted(106, 12) Source(129, 42) + SourceIndex(0) -4 >Emitted(106, 13) Source(129, 43) + SourceIndex(0) -5 >Emitted(106, 15) Source(129, 45) + SourceIndex(0) -6 >Emitted(106, 16) Source(129, 46) + SourceIndex(0) -7 >Emitted(106, 17) Source(129, 46) + SourceIndex(0) ---- ->>>}; +>>>objc8.t7 = function (n) { return n; }; 1 > -2 >^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > ; -1 >Emitted(107, 1) Source(129, 47) + SourceIndex(0) -2 >Emitted(107, 2) Source(129, 48) + SourceIndex(0) -3 >Emitted(107, 3) Source(129, 49) + SourceIndex(0) ---- ->>>objc8.t7 = function (n) { -1-> 2 >^^^^^ 3 > ^ 4 > ^^ 5 > ^^^ 6 > ^^^^^^^^^^ 7 > ^ -1-> +8 > ^^^^ +9 > ^^^^^^ +10> ^ +11> ^ +12> ^ +13> ^ +14> ^ +15> ^ +16> ^-> +1 > > 2 >objc8 3 > . @@ -1826,44 +1751,31 @@ sourceFile:contextualTyping.ts 5 > = 6 > function( 7 > n: number -1->Emitted(108, 1) Source(130, 1) + SourceIndex(0) -2 >Emitted(108, 6) Source(130, 6) + SourceIndex(0) -3 >Emitted(108, 7) Source(130, 7) + SourceIndex(0) -4 >Emitted(108, 9) Source(130, 9) + SourceIndex(0) -5 >Emitted(108, 12) Source(130, 12) + SourceIndex(0) -6 >Emitted(108, 22) Source(130, 21) + SourceIndex(0) -7 >Emitted(108, 23) Source(130, 30) + SourceIndex(0) +8 > ) { +9 > return +10> +11> n +12> +13> +14> } +15> ; +1 >Emitted(72, 1) Source(130, 1) + SourceIndex(0) +2 >Emitted(72, 6) Source(130, 6) + SourceIndex(0) +3 >Emitted(72, 7) Source(130, 7) + SourceIndex(0) +4 >Emitted(72, 9) Source(130, 9) + SourceIndex(0) +5 >Emitted(72, 12) Source(130, 12) + SourceIndex(0) +6 >Emitted(72, 22) Source(130, 21) + SourceIndex(0) +7 >Emitted(72, 23) Source(130, 30) + SourceIndex(0) +8 >Emitted(72, 27) Source(130, 34) + SourceIndex(0) +9 >Emitted(72, 33) Source(130, 40) + SourceIndex(0) +10>Emitted(72, 34) Source(130, 41) + SourceIndex(0) +11>Emitted(72, 35) Source(130, 42) + SourceIndex(0) +12>Emitted(72, 36) Source(130, 42) + SourceIndex(0) +13>Emitted(72, 37) Source(130, 43) + SourceIndex(0) +14>Emitted(72, 38) Source(130, 44) + SourceIndex(0) +15>Emitted(72, 39) Source(130, 45) + SourceIndex(0) --- ->>> return n; -1 >^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^ -1 >) { -2 > return -3 > -4 > n -5 > -1 >Emitted(109, 5) Source(130, 34) + SourceIndex(0) -2 >Emitted(109, 11) Source(130, 40) + SourceIndex(0) -3 >Emitted(109, 12) Source(130, 41) + SourceIndex(0) -4 >Emitted(109, 13) Source(130, 42) + SourceIndex(0) -5 >Emitted(109, 14) Source(130, 42) + SourceIndex(0) ---- ->>>}; -1 > -2 >^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > ; -1 >Emitted(110, 1) Source(130, 43) + SourceIndex(0) -2 >Emitted(110, 2) Source(130, 44) + SourceIndex(0) -3 >Emitted(110, 3) Source(130, 45) + SourceIndex(0) ---- ->>>objc8.t8 = function (n) { +>>>objc8.t8 = function (n) { return n; }; 1-> 2 >^^^^^ 3 > ^ @@ -1871,6 +1783,14 @@ sourceFile:contextualTyping.ts 5 > ^^^ 6 > ^^^^^^^^^^ 7 > ^ +8 > ^^^^ +9 > ^^^^^^ +10> ^ +11> ^ +12> ^ +13> ^ +14> ^ +15> ^ 1-> > > @@ -1880,231 +1800,194 @@ sourceFile:contextualTyping.ts 5 > = 6 > function( 7 > n -1->Emitted(111, 1) Source(132, 1) + SourceIndex(0) -2 >Emitted(111, 6) Source(132, 6) + SourceIndex(0) -3 >Emitted(111, 7) Source(132, 7) + SourceIndex(0) -4 >Emitted(111, 9) Source(132, 9) + SourceIndex(0) -5 >Emitted(111, 12) Source(132, 12) + SourceIndex(0) -6 >Emitted(111, 22) Source(132, 21) + SourceIndex(0) -7 >Emitted(111, 23) Source(132, 22) + SourceIndex(0) +8 > ) { +9 > return +10> +11> n +12> ; +13> +14> } +15> ; +1->Emitted(73, 1) Source(132, 1) + SourceIndex(0) +2 >Emitted(73, 6) Source(132, 6) + SourceIndex(0) +3 >Emitted(73, 7) Source(132, 7) + SourceIndex(0) +4 >Emitted(73, 9) Source(132, 9) + SourceIndex(0) +5 >Emitted(73, 12) Source(132, 12) + SourceIndex(0) +6 >Emitted(73, 22) Source(132, 21) + SourceIndex(0) +7 >Emitted(73, 23) Source(132, 22) + SourceIndex(0) +8 >Emitted(73, 27) Source(132, 26) + SourceIndex(0) +9 >Emitted(73, 33) Source(132, 32) + SourceIndex(0) +10>Emitted(73, 34) Source(132, 33) + SourceIndex(0) +11>Emitted(73, 35) Source(132, 34) + SourceIndex(0) +12>Emitted(73, 36) Source(132, 35) + SourceIndex(0) +13>Emitted(73, 37) Source(132, 36) + SourceIndex(0) +14>Emitted(73, 38) Source(132, 37) + SourceIndex(0) +15>Emitted(73, 39) Source(132, 38) + SourceIndex(0) --- ->>> return n; -1 >^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^ -1 >) { -2 > return -3 > -4 > n -5 > ; -1 >Emitted(112, 5) Source(132, 26) + SourceIndex(0) -2 >Emitted(112, 11) Source(132, 32) + SourceIndex(0) -3 >Emitted(112, 12) Source(132, 33) + SourceIndex(0) -4 >Emitted(112, 13) Source(132, 34) + SourceIndex(0) -5 >Emitted(112, 14) Source(132, 35) + SourceIndex(0) ---- ->>>}; +>>>objc8.t9 = [[], []]; 1 > -2 >^ -3 > ^ -4 > ^^^^^^^^^^^-> -1 > -2 >} -3 > ; -1 >Emitted(113, 1) Source(132, 36) + SourceIndex(0) -2 >Emitted(113, 2) Source(132, 37) + SourceIndex(0) -3 >Emitted(113, 3) Source(132, 38) + SourceIndex(0) ---- ->>>objc8.t9 = [ -1-> 2 >^^^^^ 3 > ^ 4 > ^^ 5 > ^^^ -1-> +6 > ^ +7 > ^^ +8 > ^^ +9 > ^^ +10> ^ +11> ^ +12> ^^^^^^-> +1 > > 2 >objc8 3 > . 4 > t9 5 > = -1->Emitted(114, 1) Source(133, 1) + SourceIndex(0) -2 >Emitted(114, 6) Source(133, 6) + SourceIndex(0) -3 >Emitted(114, 7) Source(133, 7) + SourceIndex(0) -4 >Emitted(114, 9) Source(133, 9) + SourceIndex(0) -5 >Emitted(114, 12) Source(133, 12) + SourceIndex(0) +6 > [ +7 > [] +8 > , +9 > [] +10> ] +11> ; +1 >Emitted(74, 1) Source(133, 1) + SourceIndex(0) +2 >Emitted(74, 6) Source(133, 6) + SourceIndex(0) +3 >Emitted(74, 7) Source(133, 7) + SourceIndex(0) +4 >Emitted(74, 9) Source(133, 9) + SourceIndex(0) +5 >Emitted(74, 12) Source(133, 12) + SourceIndex(0) +6 >Emitted(74, 13) Source(133, 13) + SourceIndex(0) +7 >Emitted(74, 15) Source(133, 15) + SourceIndex(0) +8 >Emitted(74, 17) Source(133, 16) + SourceIndex(0) +9 >Emitted(74, 19) Source(133, 18) + SourceIndex(0) +10>Emitted(74, 20) Source(133, 19) + SourceIndex(0) +11>Emitted(74, 21) Source(133, 20) + SourceIndex(0) --- ->>> [], -1 >^^^^ -2 > ^^ -3 > ^-> -1 >[ -2 > [] -1 >Emitted(115, 5) Source(133, 13) + SourceIndex(0) -2 >Emitted(115, 7) Source(133, 15) + SourceIndex(0) ---- ->>> [] -1->^^^^ -2 > ^^ -1->, -2 > [] -1->Emitted(116, 5) Source(133, 16) + SourceIndex(0) -2 >Emitted(116, 7) Source(133, 18) + SourceIndex(0) ---- ->>>]; -1 >^ -2 > ^ -3 > ^^^^^^^^^^^^-> -1 >] -2 > ; -1 >Emitted(117, 2) Source(133, 19) + SourceIndex(0) -2 >Emitted(117, 3) Source(133, 20) + SourceIndex(0) ---- ->>>objc8.t10 = [ +>>>objc8.t10 = [({}), ({})]; 1-> 2 >^^^^^ 3 > ^ 4 > ^^^ 5 > ^^^ +6 > ^ +7 > ^ +8 > ^^ +9 > ^ +10> ^^ +11> ^ +12> ^^ +13> ^ +14> ^ +15> ^ +16> ^^^^^^^^^^^^^^^^^^^^-> 1-> > 2 >objc8 3 > . 4 > t10 5 > = -1->Emitted(118, 1) Source(134, 1) + SourceIndex(0) -2 >Emitted(118, 6) Source(134, 6) + SourceIndex(0) -3 >Emitted(118, 7) Source(134, 7) + SourceIndex(0) -4 >Emitted(118, 10) Source(134, 10) + SourceIndex(0) -5 >Emitted(118, 13) Source(134, 13) + SourceIndex(0) +6 > [ +7 > ( +8 > {} +9 > ) +10> , +11> ( +12> {} +13> ) +14> ] +15> ; +1->Emitted(75, 1) Source(134, 1) + SourceIndex(0) +2 >Emitted(75, 6) Source(134, 6) + SourceIndex(0) +3 >Emitted(75, 7) Source(134, 7) + SourceIndex(0) +4 >Emitted(75, 10) Source(134, 10) + SourceIndex(0) +5 >Emitted(75, 13) Source(134, 13) + SourceIndex(0) +6 >Emitted(75, 14) Source(134, 20) + SourceIndex(0) +7 >Emitted(75, 15) Source(134, 21) + SourceIndex(0) +8 >Emitted(75, 17) Source(134, 23) + SourceIndex(0) +9 >Emitted(75, 18) Source(134, 24) + SourceIndex(0) +10>Emitted(75, 20) Source(134, 31) + SourceIndex(0) +11>Emitted(75, 21) Source(134, 32) + SourceIndex(0) +12>Emitted(75, 23) Source(134, 34) + SourceIndex(0) +13>Emitted(75, 24) Source(134, 35) + SourceIndex(0) +14>Emitted(75, 25) Source(134, 36) + SourceIndex(0) +15>Emitted(75, 26) Source(134, 37) + SourceIndex(0) --- ->>> ({}), -1 >^^^^ -2 > ^ -3 > ^^ -4 > ^ -5 > ^-> -1 >[ -2 > ( -3 > {} -4 > ) -1 >Emitted(119, 5) Source(134, 20) + SourceIndex(0) -2 >Emitted(119, 6) Source(134, 21) + SourceIndex(0) -3 >Emitted(119, 8) Source(134, 23) + SourceIndex(0) -4 >Emitted(119, 9) Source(134, 24) + SourceIndex(0) ---- ->>> ({}) -1->^^^^ -2 > ^ -3 > ^^ -4 > ^ -1->, -2 > ( -3 > {} -4 > ) -1->Emitted(120, 5) Source(134, 31) + SourceIndex(0) -2 >Emitted(120, 6) Source(134, 32) + SourceIndex(0) -3 >Emitted(120, 8) Source(134, 34) + SourceIndex(0) -4 >Emitted(120, 9) Source(134, 35) + SourceIndex(0) ---- ->>>]; -1 >^ -2 > ^ -3 > ^^^^^^^^^^^^-> -1 >] -2 > ; -1 >Emitted(121, 2) Source(134, 36) + SourceIndex(0) -2 >Emitted(121, 3) Source(134, 37) + SourceIndex(0) ---- ->>>objc8.t11 = [ +>>>objc8.t11 = [function (n, s) { return s; }]; 1-> 2 >^^^^^ 3 > ^ 4 > ^^^ 5 > ^^^ -6 > ^^^^^^^^^^-> +6 > ^ +7 > ^^^^^^^^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^^ +12> ^^^^^^ +13> ^ +14> ^ +15> ^ +16> ^ +17> ^ +18> ^ +19> ^ 1-> > 2 >objc8 3 > . 4 > t11 5 > = -1->Emitted(122, 1) Source(135, 1) + SourceIndex(0) -2 >Emitted(122, 6) Source(135, 6) + SourceIndex(0) -3 >Emitted(122, 7) Source(135, 7) + SourceIndex(0) -4 >Emitted(122, 10) Source(135, 10) + SourceIndex(0) -5 >Emitted(122, 13) Source(135, 13) + SourceIndex(0) ---- ->>> function (n, s) { -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^ -4 > ^^ -5 > ^ -1->[ -2 > function( -3 > n -4 > , -5 > s -1->Emitted(123, 5) Source(135, 14) + SourceIndex(0) -2 >Emitted(123, 15) Source(135, 23) + SourceIndex(0) -3 >Emitted(123, 16) Source(135, 24) + SourceIndex(0) -4 >Emitted(123, 18) Source(135, 26) + SourceIndex(0) -5 >Emitted(123, 19) Source(135, 27) + SourceIndex(0) ---- ->>> return s; -1 >^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^ -1 >) { -2 > return -3 > -4 > s -5 > ; -1 >Emitted(124, 9) Source(135, 31) + SourceIndex(0) -2 >Emitted(124, 15) Source(135, 37) + SourceIndex(0) -3 >Emitted(124, 16) Source(135, 38) + SourceIndex(0) -4 >Emitted(124, 17) Source(135, 39) + SourceIndex(0) -5 >Emitted(124, 18) Source(135, 40) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -1 > -2 > } -1 >Emitted(125, 5) Source(135, 41) + SourceIndex(0) -2 >Emitted(125, 6) Source(135, 42) + SourceIndex(0) ---- ->>>]; -1 >^ -2 > ^ -3 > ^^^^^^^^^^^^-> -1 >] -2 > ; -1 >Emitted(126, 2) Source(135, 43) + SourceIndex(0) -2 >Emitted(126, 3) Source(135, 44) + SourceIndex(0) +6 > [ +7 > function( +8 > n +9 > , +10> s +11> ) { +12> return +13> +14> s +15> ; +16> +17> } +18> ] +19> ; +1->Emitted(76, 1) Source(135, 1) + SourceIndex(0) +2 >Emitted(76, 6) Source(135, 6) + SourceIndex(0) +3 >Emitted(76, 7) Source(135, 7) + SourceIndex(0) +4 >Emitted(76, 10) Source(135, 10) + SourceIndex(0) +5 >Emitted(76, 13) Source(135, 13) + SourceIndex(0) +6 >Emitted(76, 14) Source(135, 14) + SourceIndex(0) +7 >Emitted(76, 24) Source(135, 23) + SourceIndex(0) +8 >Emitted(76, 25) Source(135, 24) + SourceIndex(0) +9 >Emitted(76, 27) Source(135, 26) + SourceIndex(0) +10>Emitted(76, 28) Source(135, 27) + SourceIndex(0) +11>Emitted(76, 32) Source(135, 31) + SourceIndex(0) +12>Emitted(76, 38) Source(135, 37) + SourceIndex(0) +13>Emitted(76, 39) Source(135, 38) + SourceIndex(0) +14>Emitted(76, 40) Source(135, 39) + SourceIndex(0) +15>Emitted(76, 41) Source(135, 40) + SourceIndex(0) +16>Emitted(76, 42) Source(135, 41) + SourceIndex(0) +17>Emitted(76, 43) Source(135, 42) + SourceIndex(0) +18>Emitted(76, 44) Source(135, 43) + SourceIndex(0) +19>Emitted(76, 45) Source(135, 44) + SourceIndex(0) --- >>>objc8.t12 = { -1-> +1 > 2 >^^^^^ 3 > ^ 4 > ^^^ 5 > ^^^ 6 > ^^-> -1-> +1 > > 2 >objc8 3 > . 4 > t12 5 > = -1->Emitted(127, 1) Source(136, 1) + SourceIndex(0) -2 >Emitted(127, 6) Source(136, 6) + SourceIndex(0) -3 >Emitted(127, 7) Source(136, 7) + SourceIndex(0) -4 >Emitted(127, 10) Source(136, 10) + SourceIndex(0) -5 >Emitted(127, 13) Source(136, 13) + SourceIndex(0) +1 >Emitted(77, 1) Source(136, 1) + SourceIndex(0) +2 >Emitted(77, 6) Source(136, 6) + SourceIndex(0) +3 >Emitted(77, 7) Source(136, 7) + SourceIndex(0) +4 >Emitted(77, 10) Source(136, 10) + SourceIndex(0) +5 >Emitted(77, 13) Source(136, 13) + SourceIndex(0) --- >>> foo: ({}) 1->^^^^ @@ -2120,12 +2003,12 @@ sourceFile:contextualTyping.ts 4 > ( 5 > {} 6 > ) -1->Emitted(128, 5) Source(137, 5) + SourceIndex(0) -2 >Emitted(128, 8) Source(137, 8) + SourceIndex(0) -3 >Emitted(128, 10) Source(137, 16) + SourceIndex(0) -4 >Emitted(128, 11) Source(137, 17) + SourceIndex(0) -5 >Emitted(128, 13) Source(137, 19) + SourceIndex(0) -6 >Emitted(128, 14) Source(137, 20) + SourceIndex(0) +1->Emitted(78, 5) Source(137, 5) + SourceIndex(0) +2 >Emitted(78, 8) Source(137, 8) + SourceIndex(0) +3 >Emitted(78, 10) Source(137, 16) + SourceIndex(0) +4 >Emitted(78, 11) Source(137, 17) + SourceIndex(0) +5 >Emitted(78, 13) Source(137, 19) + SourceIndex(0) +6 >Emitted(78, 14) Source(137, 20) + SourceIndex(0) --- >>>}; 1 >^ @@ -2134,8 +2017,8 @@ sourceFile:contextualTyping.ts 1 > >} 2 > -1 >Emitted(129, 2) Source(138, 2) + SourceIndex(0) -2 >Emitted(129, 3) Source(138, 2) + SourceIndex(0) +1 >Emitted(79, 2) Source(138, 2) + SourceIndex(0) +2 >Emitted(79, 3) Source(138, 2) + SourceIndex(0) --- >>>objc8.t13 = ({ 1-> @@ -2144,7 +2027,7 @@ sourceFile:contextualTyping.ts 4 > ^^^ 5 > ^^^ 6 > ^ -7 > ^^^^^^^^^^^^-> +7 > ^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > 2 >objc8 @@ -2152,14 +2035,14 @@ sourceFile:contextualTyping.ts 4 > t13 5 > = 6 > ( -1->Emitted(130, 1) Source(139, 1) + SourceIndex(0) -2 >Emitted(130, 6) Source(139, 6) + SourceIndex(0) -3 >Emitted(130, 7) Source(139, 7) + SourceIndex(0) -4 >Emitted(130, 10) Source(139, 10) + SourceIndex(0) -5 >Emitted(130, 13) Source(139, 19) + SourceIndex(0) -6 >Emitted(130, 14) Source(139, 20) + SourceIndex(0) +1->Emitted(80, 1) Source(139, 1) + SourceIndex(0) +2 >Emitted(80, 6) Source(139, 6) + SourceIndex(0) +3 >Emitted(80, 7) Source(139, 7) + SourceIndex(0) +4 >Emitted(80, 10) Source(139, 10) + SourceIndex(0) +5 >Emitted(80, 13) Source(139, 19) + SourceIndex(0) +6 >Emitted(80, 14) Source(139, 20) + SourceIndex(0) --- ->>> f: function (i, s) { +>>> f: function (i, s) { return s; } 1->^^^^ 2 > ^ 3 > ^^ @@ -2167,6 +2050,13 @@ sourceFile:contextualTyping.ts 5 > ^ 6 > ^^ 7 > ^ +8 > ^^^^ +9 > ^^^^^^ +10> ^ +11> ^ +12> ^ +13> ^ +14> ^ 1->{ > 2 > f @@ -2175,38 +2065,27 @@ sourceFile:contextualTyping.ts 5 > i 6 > , 7 > s -1->Emitted(131, 5) Source(140, 5) + SourceIndex(0) -2 >Emitted(131, 6) Source(140, 6) + SourceIndex(0) -3 >Emitted(131, 8) Source(140, 8) + SourceIndex(0) -4 >Emitted(131, 18) Source(140, 17) + SourceIndex(0) -5 >Emitted(131, 19) Source(140, 18) + SourceIndex(0) -6 >Emitted(131, 21) Source(140, 20) + SourceIndex(0) -7 >Emitted(131, 22) Source(140, 21) + SourceIndex(0) ---- ->>> return s; -1 >^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^ -1 >) { -2 > return -3 > -4 > s -5 > ; -1 >Emitted(132, 9) Source(140, 25) + SourceIndex(0) -2 >Emitted(132, 15) Source(140, 31) + SourceIndex(0) -3 >Emitted(132, 16) Source(140, 32) + SourceIndex(0) -4 >Emitted(132, 17) Source(140, 33) + SourceIndex(0) -5 >Emitted(132, 18) Source(140, 34) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -1 > -2 > } -1 >Emitted(133, 5) Source(140, 35) + SourceIndex(0) -2 >Emitted(133, 6) Source(140, 36) + SourceIndex(0) +8 > ) { +9 > return +10> +11> s +12> ; +13> +14> } +1->Emitted(81, 5) Source(140, 5) + SourceIndex(0) +2 >Emitted(81, 6) Source(140, 6) + SourceIndex(0) +3 >Emitted(81, 8) Source(140, 8) + SourceIndex(0) +4 >Emitted(81, 18) Source(140, 17) + SourceIndex(0) +5 >Emitted(81, 19) Source(140, 18) + SourceIndex(0) +6 >Emitted(81, 21) Source(140, 20) + SourceIndex(0) +7 >Emitted(81, 22) Source(140, 21) + SourceIndex(0) +8 >Emitted(81, 26) Source(140, 25) + SourceIndex(0) +9 >Emitted(81, 32) Source(140, 31) + SourceIndex(0) +10>Emitted(81, 33) Source(140, 32) + SourceIndex(0) +11>Emitted(81, 34) Source(140, 33) + SourceIndex(0) +12>Emitted(81, 35) Source(140, 34) + SourceIndex(0) +13>Emitted(81, 36) Source(140, 35) + SourceIndex(0) +14>Emitted(81, 37) Source(140, 36) + SourceIndex(0) --- >>>}); 1 >^ @@ -2217,9 +2096,9 @@ sourceFile:contextualTyping.ts >} 2 > ) 3 > -1 >Emitted(134, 2) Source(141, 2) + SourceIndex(0) -2 >Emitted(134, 3) Source(141, 3) + SourceIndex(0) -3 >Emitted(134, 4) Source(141, 3) + SourceIndex(0) +1 >Emitted(82, 2) Source(141, 2) + SourceIndex(0) +2 >Emitted(82, 3) Source(141, 3) + SourceIndex(0) +3 >Emitted(82, 4) Source(141, 3) + SourceIndex(0) --- >>>objc8.t14 = ({ 1-> @@ -2235,12 +2114,12 @@ sourceFile:contextualTyping.ts 4 > t14 5 > = 6 > ( -1->Emitted(135, 1) Source(142, 1) + SourceIndex(0) -2 >Emitted(135, 6) Source(142, 6) + SourceIndex(0) -3 >Emitted(135, 7) Source(142, 7) + SourceIndex(0) -4 >Emitted(135, 10) Source(142, 10) + SourceIndex(0) -5 >Emitted(135, 13) Source(142, 19) + SourceIndex(0) -6 >Emitted(135, 14) Source(142, 20) + SourceIndex(0) +1->Emitted(83, 1) Source(142, 1) + SourceIndex(0) +2 >Emitted(83, 6) Source(142, 6) + SourceIndex(0) +3 >Emitted(83, 7) Source(142, 7) + SourceIndex(0) +4 >Emitted(83, 10) Source(142, 10) + SourceIndex(0) +5 >Emitted(83, 13) Source(142, 19) + SourceIndex(0) +6 >Emitted(83, 14) Source(142, 20) + SourceIndex(0) --- >>> a: [] 1 >^^^^ @@ -2252,10 +2131,10 @@ sourceFile:contextualTyping.ts 2 > a 3 > : 4 > [] -1 >Emitted(136, 5) Source(143, 5) + SourceIndex(0) -2 >Emitted(136, 6) Source(143, 6) + SourceIndex(0) -3 >Emitted(136, 8) Source(143, 8) + SourceIndex(0) -4 >Emitted(136, 10) Source(143, 10) + SourceIndex(0) +1 >Emitted(84, 5) Source(143, 5) + SourceIndex(0) +2 >Emitted(84, 6) Source(143, 6) + SourceIndex(0) +3 >Emitted(84, 8) Source(143, 8) + SourceIndex(0) +4 >Emitted(84, 10) Source(143, 10) + SourceIndex(0) --- >>>}); 1 >^ @@ -2266,9 +2145,9 @@ sourceFile:contextualTyping.ts >} 2 > ) 3 > -1 >Emitted(137, 2) Source(144, 2) + SourceIndex(0) -2 >Emitted(137, 3) Source(144, 3) + SourceIndex(0) -3 >Emitted(137, 4) Source(144, 3) + SourceIndex(0) +1 >Emitted(85, 2) Source(144, 2) + SourceIndex(0) +2 >Emitted(85, 3) Source(144, 3) + SourceIndex(0) +3 >Emitted(85, 4) Source(144, 3) + SourceIndex(0) --- >>>// CONTEXT: Function call 1-> @@ -2279,36 +2158,33 @@ sourceFile:contextualTyping.ts > 2 > 3 >// CONTEXT: Function call -1->Emitted(138, 1) Source(146, 1) + SourceIndex(0) -2 >Emitted(138, 1) Source(145, 1) + SourceIndex(0) -3 >Emitted(138, 26) Source(145, 26) + SourceIndex(0) +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) { +>>>function c9t5(f) { } 1 >^^^^^^^^^^^^^^ 2 > ^ +3 > ^^^^ +4 > ^ 1 > >function c9t5( 2 > f: (n: number) => IFoo -1 >Emitted(139, 15) Source(146, 15) + SourceIndex(0) -2 >Emitted(139, 16) Source(146, 37) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^-> -1 >) { -2 >} -1 >Emitted(140, 1) Source(146, 40) + SourceIndex(0) name (c9t5) -2 >Emitted(140, 2) Source(146, 41) + SourceIndex(0) name (c9t5) +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-> +1 > 2 >^ 3 > ^^^^^^^^^^^^^^^^^^^-> -1-> +1 > 2 >; -1->Emitted(141, 1) Source(146, 41) + SourceIndex(0) -2 >Emitted(141, 2) Source(146, 42) + SourceIndex(0) +1 >Emitted(88, 1) Source(146, 41) + SourceIndex(0) +2 >Emitted(88, 2) Source(146, 42) + SourceIndex(0) --- >>>c9t5(function (n) { 1-> @@ -2323,11 +2199,11 @@ sourceFile:contextualTyping.ts 3 > ( 4 > function( 5 > n -1->Emitted(142, 1) Source(147, 1) + SourceIndex(0) -2 >Emitted(142, 5) Source(147, 5) + SourceIndex(0) -3 >Emitted(142, 6) Source(147, 6) + SourceIndex(0) -4 >Emitted(142, 16) Source(147, 15) + SourceIndex(0) -5 >Emitted(142, 17) Source(147, 16) + SourceIndex(0) +1->Emitted(89, 1) Source(147, 1) + SourceIndex(0) +2 >Emitted(89, 5) Source(147, 5) + SourceIndex(0) +3 >Emitted(89, 6) Source(147, 6) + SourceIndex(0) +4 >Emitted(89, 16) Source(147, 15) + SourceIndex(0) +5 >Emitted(89, 17) Source(147, 16) + SourceIndex(0) --- >>> return ({}); 1->^^^^ @@ -2345,13 +2221,13 @@ sourceFile:contextualTyping.ts 5 > {} 6 > ) 7 > ; -1->Emitted(143, 5) Source(148, 5) + SourceIndex(0) -2 >Emitted(143, 11) Source(148, 11) + SourceIndex(0) -3 >Emitted(143, 12) Source(148, 18) + SourceIndex(0) -4 >Emitted(143, 13) Source(148, 19) + SourceIndex(0) -5 >Emitted(143, 15) Source(148, 21) + SourceIndex(0) -6 >Emitted(143, 16) Source(148, 22) + SourceIndex(0) -7 >Emitted(143, 17) Source(148, 23) + SourceIndex(0) +1->Emitted(90, 5) Source(148, 5) + SourceIndex(0) +2 >Emitted(90, 11) Source(148, 11) + SourceIndex(0) +3 >Emitted(90, 12) Source(148, 18) + SourceIndex(0) +4 >Emitted(90, 13) Source(148, 19) + SourceIndex(0) +5 >Emitted(90, 15) Source(148, 21) + SourceIndex(0) +6 >Emitted(90, 16) Source(148, 22) + SourceIndex(0) +7 >Emitted(90, 17) Source(148, 23) + SourceIndex(0) --- >>>}); 1 > @@ -2364,115 +2240,106 @@ sourceFile:contextualTyping.ts 2 >} 3 > ) 4 > ; -1 >Emitted(144, 1) Source(149, 1) + SourceIndex(0) -2 >Emitted(144, 2) Source(149, 2) + SourceIndex(0) -3 >Emitted(144, 3) Source(149, 3) + SourceIndex(0) -4 >Emitted(144, 4) Source(149, 4) + SourceIndex(0) +1 >Emitted(91, 1) Source(149, 1) + SourceIndex(0) +2 >Emitted(91, 2) Source(149, 2) + SourceIndex(0) +3 >Emitted(91, 3) Source(149, 3) + SourceIndex(0) +4 >Emitted(91, 4) Source(149, 4) + SourceIndex(0) --- >>>// CONTEXT: Return statement 1-> 2 > 3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > >// CONTEXT: Return statement > 2 > 3 >// CONTEXT: Return statement -1->Emitted(145, 1) Source(152, 1) + SourceIndex(0) -2 >Emitted(145, 1) Source(151, 1) + SourceIndex(0) -3 >Emitted(145, 29) Source(151, 29) + SourceIndex(0) +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 () { -1 >^^^^ +>>>var c10t5 = function () { return function (n) { return ({}); }; }; +1->^^^^ 2 > ^^^^^ 3 > ^^^ -4 > ^^^^^^^^^^^^^^-> -1 > +4 > ^^^^^^^^^^^^^^ +5 > ^^^^^^ +6 > ^ +7 > ^^^^^^^^^^ +8 > ^ +9 > ^^^^ +10> ^^^^^^ +11> ^ +12> ^ +13> ^^ +14> ^ +15> ^ +16> ^ +17> ^ +18> ^ +19> ^ +20> ^ +21> ^ +1-> >var 2 > c10t5 3 > : () => (n: number) => IFoo = -1 >Emitted(146, 5) Source(152, 5) + SourceIndex(0) -2 >Emitted(146, 10) Source(152, 10) + SourceIndex(0) -3 >Emitted(146, 13) Source(152, 40) + SourceIndex(0) ---- ->>> return function (n) { -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^ -5 > ^ -1->function() { -2 > return -3 > -4 > function( -5 > n -1->Emitted(147, 5) Source(152, 53) + SourceIndex(0) -2 >Emitted(147, 11) Source(152, 59) + SourceIndex(0) -3 >Emitted(147, 12) Source(152, 60) + SourceIndex(0) -4 >Emitted(147, 22) Source(152, 69) + SourceIndex(0) -5 >Emitted(147, 23) Source(152, 70) + SourceIndex(0) ---- ->>> return ({}); -1 >^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^^ -6 > ^ -7 > ^ -1 >) { -2 > return -3 > -4 > ( -5 > {} -6 > ) -7 > -1 >Emitted(148, 9) Source(152, 74) + SourceIndex(0) -2 >Emitted(148, 15) Source(152, 80) + SourceIndex(0) -3 >Emitted(148, 16) Source(152, 87) + SourceIndex(0) -4 >Emitted(148, 17) Source(152, 88) + SourceIndex(0) -5 >Emitted(148, 19) Source(152, 90) + SourceIndex(0) -6 >Emitted(148, 20) Source(152, 91) + SourceIndex(0) -7 >Emitted(148, 21) Source(152, 91) + SourceIndex(0) ---- ->>> }; -1 >^^^^ -2 > ^ -3 > ^ -1 > -2 > } -3 > -1 >Emitted(149, 5) Source(152, 92) + SourceIndex(0) -2 >Emitted(149, 6) Source(152, 93) + SourceIndex(0) -3 >Emitted(149, 7) Source(152, 93) + SourceIndex(0) ---- ->>>}; -1 > -2 >^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > ; -1 >Emitted(150, 1) Source(152, 94) + SourceIndex(0) -2 >Emitted(150, 2) Source(152, 95) + SourceIndex(0) -3 >Emitted(150, 3) Source(152, 96) + SourceIndex(0) +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-> +1 > 2 > 3 >^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 > ^-> -1-> +1 > > >// CONTEXT: Newing a class > 2 > 3 >// CONTEXT: Newing a class -1->Emitted(151, 1) Source(155, 1) + SourceIndex(0) -2 >Emitted(151, 1) Source(154, 1) + SourceIndex(0) -3 >Emitted(151, 27) Source(154, 27) + SourceIndex(0) +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 () { >>> function C11t5(f) { @@ -2483,9 +2350,9 @@ sourceFile:contextualTyping.ts >class C11t5 { 2 > constructor( 3 > f: (n: number) => IFoo -1->Emitted(153, 5) Source(155, 15) + SourceIndex(0) name (C11t5) -2 >Emitted(153, 20) Source(155, 27) + SourceIndex(0) name (C11t5) -3 >Emitted(153, 21) Source(155, 49) + SourceIndex(0) name (C11t5) +1->Emitted(96, 5) Source(155, 15) + SourceIndex(0) name (C11t5) +2 >Emitted(96, 20) Source(155, 27) + SourceIndex(0) name (C11t5) +3 >Emitted(96, 21) Source(155, 49) + SourceIndex(0) name (C11t5) --- >>> } 1 >^^^^ @@ -2493,16 +2360,16 @@ sourceFile:contextualTyping.ts 3 > ^^^^^^^^^^^^^-> 1 >) { 2 > } -1 >Emitted(154, 5) Source(155, 53) + SourceIndex(0) name (C11t5.constructor) -2 >Emitted(154, 6) Source(155, 54) + SourceIndex(0) name (C11t5.constructor) +1 >Emitted(97, 5) Source(155, 53) + SourceIndex(0) name (C11t5.constructor) +2 >Emitted(97, 6) Source(155, 54) + SourceIndex(0) name (C11t5.constructor) --- >>> return C11t5; 1->^^^^ 2 > ^^^^^^^^^^^^ 1-> 2 > } -1->Emitted(155, 5) Source(155, 55) + SourceIndex(0) name (C11t5) -2 >Emitted(155, 17) Source(155, 56) + SourceIndex(0) name (C11t5) +1->Emitted(98, 5) Source(155, 55) + SourceIndex(0) name (C11t5) +2 >Emitted(98, 17) Source(155, 56) + SourceIndex(0) name (C11t5) --- >>>})(); 1 > @@ -2513,21 +2380,21 @@ sourceFile:contextualTyping.ts 2 >} 3 > 4 > class C11t5 { constructor(f: (n: number) => IFoo) { } } -1 >Emitted(156, 1) Source(155, 55) + SourceIndex(0) name (C11t5) -2 >Emitted(156, 2) Source(155, 56) + SourceIndex(0) name (C11t5) -3 >Emitted(156, 2) Source(155, 1) + SourceIndex(0) -4 >Emitted(156, 6) Source(155, 56) + SourceIndex(0) +1 >Emitted(99, 1) Source(155, 55) + SourceIndex(0) name (C11t5) +2 >Emitted(99, 2) Source(155, 56) + SourceIndex(0) name (C11t5) +3 >Emitted(99, 2) Source(155, 1) + SourceIndex(0) +4 >Emitted(99, 6) Source(155, 56) + SourceIndex(0) --- >>>; 1 > 2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > 2 >; -1 >Emitted(157, 1) Source(155, 56) + SourceIndex(0) -2 >Emitted(157, 2) Source(155, 57) + SourceIndex(0) +1 >Emitted(100, 1) Source(155, 56) + SourceIndex(0) +2 >Emitted(100, 2) Source(155, 57) + SourceIndex(0) --- ->>>var i = new C11t5(function (n) { +>>>var i = new C11t5(function (n) { return ({}); }); 1-> 2 >^^^^ 3 > ^ @@ -2537,6 +2404,17 @@ sourceFile:contextualTyping.ts 7 > ^ 8 > ^^^^^^^^^^ 9 > ^ +10> ^^^^ +11> ^^^^^^ +12> ^ +13> ^ +14> ^^ +15> ^ +16> ^ +17> ^ +18> ^ +19> ^ +20> ^ 1-> > 2 >var @@ -2547,138 +2425,118 @@ sourceFile:contextualTyping.ts 7 > ( 8 > function( 9 > n -1->Emitted(158, 1) Source(156, 1) + SourceIndex(0) -2 >Emitted(158, 5) Source(156, 5) + SourceIndex(0) -3 >Emitted(158, 6) Source(156, 6) + SourceIndex(0) -4 >Emitted(158, 9) Source(156, 9) + SourceIndex(0) -5 >Emitted(158, 13) Source(156, 13) + SourceIndex(0) -6 >Emitted(158, 18) Source(156, 18) + SourceIndex(0) -7 >Emitted(158, 19) Source(156, 19) + SourceIndex(0) -8 >Emitted(158, 29) Source(156, 28) + SourceIndex(0) -9 >Emitted(158, 30) Source(156, 29) + SourceIndex(0) ---- ->>> return ({}); -1 >^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^^ -6 > ^ -7 > ^ -1 >) { -2 > return -3 > -4 > ( -5 > {} -6 > ) -7 > -1 >Emitted(159, 5) Source(156, 33) + SourceIndex(0) -2 >Emitted(159, 11) Source(156, 39) + SourceIndex(0) -3 >Emitted(159, 12) Source(156, 46) + SourceIndex(0) -4 >Emitted(159, 13) Source(156, 47) + SourceIndex(0) -5 >Emitted(159, 15) Source(156, 49) + SourceIndex(0) -6 >Emitted(159, 16) Source(156, 50) + SourceIndex(0) -7 >Emitted(159, 17) Source(156, 50) + SourceIndex(0) ---- ->>>}); -1 > -2 >^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > ) -4 > ; -1 >Emitted(160, 1) Source(156, 51) + SourceIndex(0) -2 >Emitted(160, 2) Source(156, 52) + SourceIndex(0) -3 >Emitted(160, 3) Source(156, 53) + SourceIndex(0) -4 >Emitted(160, 4) Source(156, 54) + SourceIndex(0) +10> ) { +11> return +12> +13> ( +14> {} +15> ) +16> +17> +18> } +19> ) +20> ; +1->Emitted(101, 1) Source(156, 1) + SourceIndex(0) +2 >Emitted(101, 5) Source(156, 5) + SourceIndex(0) +3 >Emitted(101, 6) Source(156, 6) + SourceIndex(0) +4 >Emitted(101, 9) Source(156, 9) + SourceIndex(0) +5 >Emitted(101, 13) Source(156, 13) + SourceIndex(0) +6 >Emitted(101, 18) Source(156, 18) + SourceIndex(0) +7 >Emitted(101, 19) Source(156, 19) + SourceIndex(0) +8 >Emitted(101, 29) Source(156, 28) + SourceIndex(0) +9 >Emitted(101, 30) Source(156, 29) + SourceIndex(0) +10>Emitted(101, 34) Source(156, 33) + SourceIndex(0) +11>Emitted(101, 40) Source(156, 39) + SourceIndex(0) +12>Emitted(101, 41) Source(156, 46) + SourceIndex(0) +13>Emitted(101, 42) Source(156, 47) + SourceIndex(0) +14>Emitted(101, 44) Source(156, 49) + SourceIndex(0) +15>Emitted(101, 45) Source(156, 50) + SourceIndex(0) +16>Emitted(101, 46) Source(156, 50) + SourceIndex(0) +17>Emitted(101, 47) Source(156, 51) + SourceIndex(0) +18>Emitted(101, 48) Source(156, 52) + SourceIndex(0) +19>Emitted(101, 49) Source(156, 53) + SourceIndex(0) +20>Emitted(101, 50) Source(156, 54) + SourceIndex(0) --- >>>// CONTEXT: Type annotated expression -1-> +1 > 2 > 3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> +4 > ^^^^^-> +1 > > >// CONTEXT: Type annotated expression > 2 > 3 >// CONTEXT: Type annotated expression -1->Emitted(161, 1) Source(159, 1) + SourceIndex(0) -2 >Emitted(161, 1) Source(158, 1) + SourceIndex(0) -3 >Emitted(161, 38) Source(158, 38) + SourceIndex(0) +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) { -1 >^^^^ +>>>var c12t1 = (function (s) { return s; }); +1->^^^^ 2 > ^^^^^ 3 > ^^^ 4 > ^ 5 > ^^^^^^^^^^ 6 > ^ -1 > +7 > ^^^^ +8 > ^^^^^^ +9 > ^ +10> ^ +11> ^ +12> ^ +13> ^ +14> ^ +15> ^ +1-> >var 2 > c12t1 3 > = <(s: string) => string> 4 > ( 5 > function( 6 > s -1 >Emitted(162, 5) Source(159, 5) + SourceIndex(0) -2 >Emitted(162, 10) Source(159, 10) + SourceIndex(0) -3 >Emitted(162, 13) Source(159, 37) + SourceIndex(0) -4 >Emitted(162, 14) Source(159, 38) + SourceIndex(0) -5 >Emitted(162, 24) Source(159, 47) + SourceIndex(0) -6 >Emitted(162, 25) Source(159, 48) + SourceIndex(0) ---- ->>> return s; -1 >^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^ -1 >) { -2 > return -3 > -4 > s -5 > -1 >Emitted(163, 5) Source(159, 52) + SourceIndex(0) -2 >Emitted(163, 11) Source(159, 58) + SourceIndex(0) -3 >Emitted(163, 12) Source(159, 59) + SourceIndex(0) -4 >Emitted(163, 13) Source(159, 60) + SourceIndex(0) -5 >Emitted(163, 14) Source(159, 60) + SourceIndex(0) ---- ->>>}); -1 > -2 >^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > ) -4 > ; -1 >Emitted(164, 1) Source(159, 61) + SourceIndex(0) -2 >Emitted(164, 2) Source(159, 62) + SourceIndex(0) -3 >Emitted(164, 3) Source(159, 63) + SourceIndex(0) -4 >Emitted(164, 4) Source(159, 64) + SourceIndex(0) +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-> +1 > 2 >^^^^ 3 > ^^^^^ 4 > ^^^ 5 > ^ -1-> +1 > > 2 >var 3 > c12t2 4 > = 5 > ( -1->Emitted(165, 1) Source(160, 1) + SourceIndex(0) -2 >Emitted(165, 5) Source(160, 5) + SourceIndex(0) -3 >Emitted(165, 10) Source(160, 10) + SourceIndex(0) -4 >Emitted(165, 13) Source(160, 20) + SourceIndex(0) -5 >Emitted(165, 14) Source(160, 21) + SourceIndex(0) +1 >Emitted(104, 1) Source(160, 1) + SourceIndex(0) +2 >Emitted(104, 5) Source(160, 5) + SourceIndex(0) +3 >Emitted(104, 10) Source(160, 10) + SourceIndex(0) +4 >Emitted(104, 13) Source(160, 20) + SourceIndex(0) +5 >Emitted(104, 14) Source(160, 21) + SourceIndex(0) --- >>> n: 1 1 >^^^^ @@ -2690,10 +2548,10 @@ sourceFile:contextualTyping.ts 2 > n 3 > : 4 > 1 -1 >Emitted(166, 5) Source(161, 5) + SourceIndex(0) -2 >Emitted(166, 6) Source(161, 6) + SourceIndex(0) -3 >Emitted(166, 8) Source(161, 8) + SourceIndex(0) -4 >Emitted(166, 9) Source(161, 9) + SourceIndex(0) +1 >Emitted(105, 5) Source(161, 5) + SourceIndex(0) +2 >Emitted(105, 6) Source(161, 6) + SourceIndex(0) +3 >Emitted(105, 8) Source(161, 8) + SourceIndex(0) +4 >Emitted(105, 9) Source(161, 9) + SourceIndex(0) --- >>>}); 1 >^ @@ -2704,9 +2562,9 @@ sourceFile:contextualTyping.ts >} 2 > ) 3 > ; -1 >Emitted(167, 2) Source(162, 2) + SourceIndex(0) -2 >Emitted(167, 3) Source(162, 3) + SourceIndex(0) -3 >Emitted(167, 4) Source(162, 4) + SourceIndex(0) +1 >Emitted(106, 2) Source(162, 2) + SourceIndex(0) +2 >Emitted(106, 3) Source(162, 3) + SourceIndex(0) +3 >Emitted(106, 4) Source(162, 4) + SourceIndex(0) --- >>>var c12t3 = []; 1-> @@ -2715,7 +2573,7 @@ sourceFile:contextualTyping.ts 4 > ^^^ 5 > ^^ 6 > ^ -7 > ^^^^^^^^^^^-> +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > 2 >var @@ -2723,71 +2581,77 @@ sourceFile:contextualTyping.ts 4 > = 5 > [] 6 > ; -1->Emitted(168, 1) Source(163, 1) + SourceIndex(0) -2 >Emitted(168, 5) Source(163, 5) + SourceIndex(0) -3 >Emitted(168, 10) Source(163, 10) + SourceIndex(0) -4 >Emitted(168, 13) Source(163, 24) + SourceIndex(0) -5 >Emitted(168, 15) Source(163, 26) + SourceIndex(0) -6 >Emitted(168, 16) Source(163, 27) + SourceIndex(0) +1->Emitted(107, 1) Source(163, 1) + SourceIndex(0) +2 >Emitted(107, 5) Source(163, 5) + SourceIndex(0) +3 >Emitted(107, 10) Source(163, 10) + SourceIndex(0) +4 >Emitted(107, 13) Source(163, 24) + SourceIndex(0) +5 >Emitted(107, 15) Source(163, 26) + SourceIndex(0) +6 >Emitted(107, 16) Source(163, 27) + SourceIndex(0) --- ->>>var c12t4 = function () { +>>>var c12t4 = function () { return ({}); }; 1-> 2 >^^^^ 3 > ^^^^^ 4 > ^^^ -5 > ^^^^^-> +5 > ^^^^^^^^^^^^^^ +6 > ^^^^^^ +7 > ^ +8 > ^ +9 > ^^ +10> ^ +11> ^ +12> ^ +13> ^ +14> ^ +15> ^^-> 1-> > 2 >var 3 > c12t4 4 > = <() => IFoo> -1->Emitted(169, 1) Source(164, 1) + SourceIndex(0) -2 >Emitted(169, 5) Source(164, 5) + SourceIndex(0) -3 >Emitted(169, 10) Source(164, 10) + SourceIndex(0) -4 >Emitted(169, 13) Source(164, 26) + SourceIndex(0) +5 > function() { +6 > return +7 > +8 > ( +9 > {} +10> ) +11> +12> +13> } +14> ; +1->Emitted(108, 1) Source(164, 1) + SourceIndex(0) +2 >Emitted(108, 5) Source(164, 5) + SourceIndex(0) +3 >Emitted(108, 10) Source(164, 10) + SourceIndex(0) +4 >Emitted(108, 13) Source(164, 26) + SourceIndex(0) +5 >Emitted(108, 27) Source(164, 39) + SourceIndex(0) +6 >Emitted(108, 33) Source(164, 45) + SourceIndex(0) +7 >Emitted(108, 34) Source(164, 52) + SourceIndex(0) +8 >Emitted(108, 35) Source(164, 53) + SourceIndex(0) +9 >Emitted(108, 37) Source(164, 55) + SourceIndex(0) +10>Emitted(108, 38) Source(164, 56) + SourceIndex(0) +11>Emitted(108, 39) Source(164, 56) + SourceIndex(0) +12>Emitted(108, 40) Source(164, 57) + SourceIndex(0) +13>Emitted(108, 41) Source(164, 58) + SourceIndex(0) +14>Emitted(108, 42) Source(164, 59) + SourceIndex(0) --- ->>> return ({}); -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^^ -6 > ^ -7 > ^ -1->function() { -2 > return -3 > -4 > ( -5 > {} -6 > ) -7 > -1->Emitted(170, 5) Source(164, 39) + SourceIndex(0) -2 >Emitted(170, 11) Source(164, 45) + SourceIndex(0) -3 >Emitted(170, 12) Source(164, 52) + SourceIndex(0) -4 >Emitted(170, 13) Source(164, 53) + SourceIndex(0) -5 >Emitted(170, 15) Source(164, 55) + SourceIndex(0) -6 >Emitted(170, 16) Source(164, 56) + SourceIndex(0) -7 >Emitted(170, 17) Source(164, 56) + SourceIndex(0) ---- ->>>}; -1 > -2 >^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > ; -1 >Emitted(171, 1) Source(164, 57) + SourceIndex(0) -2 >Emitted(171, 2) Source(164, 58) + SourceIndex(0) -3 >Emitted(171, 3) Source(164, 59) + SourceIndex(0) ---- ->>>var c12t5 = function (n) { +>>>var c12t5 = function (n) { return ({}); }; 1-> 2 >^^^^ 3 > ^^^^^ 4 > ^^^ 5 > ^^^^^^^^^^ 6 > ^ +7 > ^^^^ +8 > ^^^^^^ +9 > ^ +10> ^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^ +16> ^ +17> ^^^^-> 1-> > 2 >var @@ -2795,49 +2659,34 @@ sourceFile:contextualTyping.ts 4 > = <(n: number) => IFoo> 5 > function( 6 > n -1->Emitted(172, 1) Source(165, 1) + SourceIndex(0) -2 >Emitted(172, 5) Source(165, 5) + SourceIndex(0) -3 >Emitted(172, 10) Source(165, 10) + SourceIndex(0) -4 >Emitted(172, 13) Source(165, 35) + SourceIndex(0) -5 >Emitted(172, 23) Source(165, 44) + SourceIndex(0) -6 >Emitted(172, 24) Source(165, 45) + SourceIndex(0) +7 > ) { +8 > return +9 > +10> ( +11> {} +12> ) +13> +14> +15> } +16> ; +1->Emitted(109, 1) Source(165, 1) + SourceIndex(0) +2 >Emitted(109, 5) Source(165, 5) + SourceIndex(0) +3 >Emitted(109, 10) Source(165, 10) + SourceIndex(0) +4 >Emitted(109, 13) Source(165, 35) + SourceIndex(0) +5 >Emitted(109, 23) Source(165, 44) + SourceIndex(0) +6 >Emitted(109, 24) Source(165, 45) + SourceIndex(0) +7 >Emitted(109, 28) Source(165, 49) + SourceIndex(0) +8 >Emitted(109, 34) Source(165, 55) + SourceIndex(0) +9 >Emitted(109, 35) Source(165, 62) + SourceIndex(0) +10>Emitted(109, 36) Source(165, 63) + SourceIndex(0) +11>Emitted(109, 38) Source(165, 65) + SourceIndex(0) +12>Emitted(109, 39) Source(165, 66) + SourceIndex(0) +13>Emitted(109, 40) Source(165, 66) + SourceIndex(0) +14>Emitted(109, 41) Source(165, 67) + SourceIndex(0) +15>Emitted(109, 42) Source(165, 68) + SourceIndex(0) +16>Emitted(109, 43) Source(165, 69) + SourceIndex(0) --- ->>> return ({}); -1 >^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^^ -6 > ^ -7 > ^ -1 >) { -2 > return -3 > -4 > ( -5 > {} -6 > ) -7 > -1 >Emitted(173, 5) Source(165, 49) + SourceIndex(0) -2 >Emitted(173, 11) Source(165, 55) + SourceIndex(0) -3 >Emitted(173, 12) Source(165, 62) + SourceIndex(0) -4 >Emitted(173, 13) Source(165, 63) + SourceIndex(0) -5 >Emitted(173, 15) Source(165, 65) + SourceIndex(0) -6 >Emitted(173, 16) Source(165, 66) + SourceIndex(0) -7 >Emitted(173, 17) Source(165, 66) + SourceIndex(0) ---- ->>>}; -1 > -2 >^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > ; -1 >Emitted(174, 1) Source(165, 67) + SourceIndex(0) -2 >Emitted(174, 2) Source(165, 68) + SourceIndex(0) -3 >Emitted(174, 3) Source(165, 69) + SourceIndex(0) ---- ->>>var c12t6 = function (n, s) { +>>>var c12t6 = function (n, s) { return ({}); }; 1-> 2 >^^^^ 3 > ^^^^^ @@ -2846,6 +2695,16 @@ sourceFile:contextualTyping.ts 6 > ^ 7 > ^^ 8 > ^ +9 > ^^^^ +10> ^^^^^^ +11> ^ +12> ^ +13> ^^ +14> ^ +15> ^ +16> ^ +17> ^ +18> ^ 1-> > 2 >var @@ -2855,58 +2714,52 @@ sourceFile:contextualTyping.ts 6 > n 7 > , 8 > s -1->Emitted(175, 1) Source(166, 1) + SourceIndex(0) -2 >Emitted(175, 5) Source(166, 5) + SourceIndex(0) -3 >Emitted(175, 10) Source(166, 10) + SourceIndex(0) -4 >Emitted(175, 13) Source(166, 46) + SourceIndex(0) -5 >Emitted(175, 23) Source(166, 55) + SourceIndex(0) -6 >Emitted(175, 24) Source(166, 56) + SourceIndex(0) -7 >Emitted(175, 26) Source(166, 58) + SourceIndex(0) -8 >Emitted(175, 27) Source(166, 59) + SourceIndex(0) +9 > ) { +10> return +11> +12> ( +13> {} +14> ) +15> +16> +17> } +18> ; +1->Emitted(110, 1) Source(166, 1) + SourceIndex(0) +2 >Emitted(110, 5) Source(166, 5) + SourceIndex(0) +3 >Emitted(110, 10) Source(166, 10) + SourceIndex(0) +4 >Emitted(110, 13) Source(166, 46) + SourceIndex(0) +5 >Emitted(110, 23) Source(166, 55) + SourceIndex(0) +6 >Emitted(110, 24) Source(166, 56) + SourceIndex(0) +7 >Emitted(110, 26) Source(166, 58) + SourceIndex(0) +8 >Emitted(110, 27) Source(166, 59) + SourceIndex(0) +9 >Emitted(110, 31) Source(166, 63) + SourceIndex(0) +10>Emitted(110, 37) Source(166, 69) + SourceIndex(0) +11>Emitted(110, 38) Source(166, 76) + SourceIndex(0) +12>Emitted(110, 39) Source(166, 77) + SourceIndex(0) +13>Emitted(110, 41) Source(166, 79) + SourceIndex(0) +14>Emitted(110, 42) Source(166, 80) + SourceIndex(0) +15>Emitted(110, 43) Source(166, 80) + SourceIndex(0) +16>Emitted(110, 44) Source(166, 81) + SourceIndex(0) +17>Emitted(110, 45) Source(166, 82) + SourceIndex(0) +18>Emitted(110, 46) Source(166, 83) + SourceIndex(0) --- ->>> return ({}); -1 >^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^^ -6 > ^ -7 > ^ -1 >) { -2 > return -3 > -4 > ( -5 > {} -6 > ) -7 > -1 >Emitted(176, 5) Source(166, 63) + SourceIndex(0) -2 >Emitted(176, 11) Source(166, 69) + SourceIndex(0) -3 >Emitted(176, 12) Source(166, 76) + SourceIndex(0) -4 >Emitted(176, 13) Source(166, 77) + SourceIndex(0) -5 >Emitted(176, 15) Source(166, 79) + SourceIndex(0) -6 >Emitted(176, 16) Source(166, 80) + SourceIndex(0) -7 >Emitted(176, 17) Source(166, 80) + SourceIndex(0) ---- ->>>}; +>>>var c12t7 = function (n) { return n; }; 1 > -2 >^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > ; -1 >Emitted(177, 1) Source(166, 81) + SourceIndex(0) -2 >Emitted(177, 2) Source(166, 82) + SourceIndex(0) -3 >Emitted(177, 3) Source(166, 83) + SourceIndex(0) ---- ->>>var c12t7 = function (n) { -1-> 2 >^^^^ 3 > ^^^^^ 4 > ^^^ 5 > ^^^^^^^^^^ 6 > ^ -1-> +7 > ^^^^ +8 > ^^^^^^ +9 > ^ +10> ^ +11> ^ +12> ^ +13> ^ +14> ^ +15> ^-> +1 > > 2 >var 3 > c12t7 @@ -2916,49 +2769,44 @@ sourceFile:contextualTyping.ts > }> 5 > function( 6 > n:number -1->Emitted(178, 1) Source(167, 1) + SourceIndex(0) -2 >Emitted(178, 5) Source(167, 5) + SourceIndex(0) -3 >Emitted(178, 10) Source(167, 10) + SourceIndex(0) -4 >Emitted(178, 13) Source(170, 4) + SourceIndex(0) -5 >Emitted(178, 23) Source(170, 13) + SourceIndex(0) -6 >Emitted(178, 24) Source(170, 21) + SourceIndex(0) +7 > ) { +8 > return +9 > +10> n +11> +12> +13> } +14> ; +1 >Emitted(111, 1) Source(167, 1) + SourceIndex(0) +2 >Emitted(111, 5) Source(167, 5) + SourceIndex(0) +3 >Emitted(111, 10) Source(167, 10) + SourceIndex(0) +4 >Emitted(111, 13) Source(170, 4) + SourceIndex(0) +5 >Emitted(111, 23) Source(170, 13) + SourceIndex(0) +6 >Emitted(111, 24) Source(170, 21) + SourceIndex(0) +7 >Emitted(111, 28) Source(170, 25) + SourceIndex(0) +8 >Emitted(111, 34) Source(170, 31) + SourceIndex(0) +9 >Emitted(111, 35) Source(170, 32) + SourceIndex(0) +10>Emitted(111, 36) Source(170, 33) + SourceIndex(0) +11>Emitted(111, 37) Source(170, 33) + SourceIndex(0) +12>Emitted(111, 38) Source(170, 34) + SourceIndex(0) +13>Emitted(111, 39) Source(170, 35) + SourceIndex(0) +14>Emitted(111, 40) Source(170, 36) + SourceIndex(0) --- ->>> return n; -1 >^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^ -1 >) { -2 > return -3 > -4 > n -5 > -1 >Emitted(179, 5) Source(170, 25) + SourceIndex(0) -2 >Emitted(179, 11) Source(170, 31) + SourceIndex(0) -3 >Emitted(179, 12) Source(170, 32) + SourceIndex(0) -4 >Emitted(179, 13) Source(170, 33) + SourceIndex(0) -5 >Emitted(179, 14) Source(170, 33) + SourceIndex(0) ---- ->>>}; -1 > -2 >^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > ; -1 >Emitted(180, 1) Source(170, 34) + SourceIndex(0) -2 >Emitted(180, 2) Source(170, 35) + SourceIndex(0) -3 >Emitted(180, 3) Source(170, 36) + SourceIndex(0) ---- ->>>var c12t8 = function (n) { +>>>var c12t8 = function (n) { return n; }; 1-> 2 >^^^^ 3 > ^^^^^ 4 > ^^^ 5 > ^^^^^^^^^^ 6 > ^ +7 > ^^^^ +8 > ^^^^^^ +9 > ^ +10> ^ +11> ^ +12> ^ +13> ^ +14> ^ 1-> > > @@ -2967,218 +2815,181 @@ sourceFile:contextualTyping.ts 4 > = <(n: number, s: string) => number> 5 > function( 6 > n -1->Emitted(181, 1) Source(172, 1) + SourceIndex(0) -2 >Emitted(181, 5) Source(172, 5) + SourceIndex(0) -3 >Emitted(181, 10) Source(172, 10) + SourceIndex(0) -4 >Emitted(181, 13) Source(172, 48) + SourceIndex(0) -5 >Emitted(181, 23) Source(172, 57) + SourceIndex(0) -6 >Emitted(181, 24) Source(172, 58) + SourceIndex(0) +7 > ) { +8 > return +9 > +10> n +11> ; +12> +13> } +14> ; +1->Emitted(112, 1) Source(172, 1) + SourceIndex(0) +2 >Emitted(112, 5) Source(172, 5) + SourceIndex(0) +3 >Emitted(112, 10) Source(172, 10) + SourceIndex(0) +4 >Emitted(112, 13) Source(172, 48) + SourceIndex(0) +5 >Emitted(112, 23) Source(172, 57) + SourceIndex(0) +6 >Emitted(112, 24) Source(172, 58) + SourceIndex(0) +7 >Emitted(112, 28) Source(172, 62) + SourceIndex(0) +8 >Emitted(112, 34) Source(172, 68) + SourceIndex(0) +9 >Emitted(112, 35) Source(172, 69) + SourceIndex(0) +10>Emitted(112, 36) Source(172, 70) + SourceIndex(0) +11>Emitted(112, 37) Source(172, 71) + SourceIndex(0) +12>Emitted(112, 38) Source(172, 72) + SourceIndex(0) +13>Emitted(112, 39) Source(172, 73) + SourceIndex(0) +14>Emitted(112, 40) Source(172, 74) + SourceIndex(0) --- ->>> return n; -1 >^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^ -1 >) { -2 > return -3 > -4 > n -5 > ; -1 >Emitted(182, 5) Source(172, 62) + SourceIndex(0) -2 >Emitted(182, 11) Source(172, 68) + SourceIndex(0) -3 >Emitted(182, 12) Source(172, 69) + SourceIndex(0) -4 >Emitted(182, 13) Source(172, 70) + SourceIndex(0) -5 >Emitted(182, 14) Source(172, 71) + SourceIndex(0) ---- ->>>}; +>>>var c12t9 = [[], []]; 1 > -2 >^ -3 > ^ -4 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > ; -1 >Emitted(183, 1) Source(172, 72) + SourceIndex(0) -2 >Emitted(183, 2) Source(172, 73) + SourceIndex(0) -3 >Emitted(183, 3) Source(172, 74) + SourceIndex(0) ---- ->>>var c12t9 = [ -1-> 2 >^^^^ 3 > ^^^^^ 4 > ^^^ -1-> +5 > ^ +6 > ^^ +7 > ^^ +8 > ^^ +9 > ^ +10> ^ +11> ^^^^^^-> +1 > > 2 >var 3 > c12t9 4 > = -1->Emitted(184, 1) Source(173, 1) + SourceIndex(0) -2 >Emitted(184, 5) Source(173, 5) + SourceIndex(0) -3 >Emitted(184, 10) Source(173, 10) + SourceIndex(0) -4 >Emitted(184, 13) Source(173, 26) + SourceIndex(0) +5 > [ +6 > [] +7 > , +8 > [] +9 > ] +10> ; +1 >Emitted(113, 1) Source(173, 1) + SourceIndex(0) +2 >Emitted(113, 5) Source(173, 5) + SourceIndex(0) +3 >Emitted(113, 10) Source(173, 10) + SourceIndex(0) +4 >Emitted(113, 13) Source(173, 26) + SourceIndex(0) +5 >Emitted(113, 14) Source(173, 27) + SourceIndex(0) +6 >Emitted(113, 16) Source(173, 29) + SourceIndex(0) +7 >Emitted(113, 18) Source(173, 30) + SourceIndex(0) +8 >Emitted(113, 20) Source(173, 32) + SourceIndex(0) +9 >Emitted(113, 21) Source(173, 33) + SourceIndex(0) +10>Emitted(113, 22) Source(173, 34) + SourceIndex(0) --- ->>> [], -1 >^^^^ -2 > ^^ -3 > ^-> -1 >[ -2 > [] -1 >Emitted(185, 5) Source(173, 27) + SourceIndex(0) -2 >Emitted(185, 7) Source(173, 29) + SourceIndex(0) ---- ->>> [] -1->^^^^ -2 > ^^ -1->, -2 > [] -1->Emitted(186, 5) Source(173, 30) + SourceIndex(0) -2 >Emitted(186, 7) Source(173, 32) + SourceIndex(0) ---- ->>>]; -1 >^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1 >] -2 > ; -1 >Emitted(187, 2) Source(173, 33) + SourceIndex(0) -2 >Emitted(187, 3) Source(173, 34) + SourceIndex(0) ---- ->>>var c12t10 = [ +>>>var c12t10 = [({}), ({})]; 1-> 2 >^^^^ 3 > ^^^^^^ 4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^-> 1-> > 2 >var 3 > c12t10 4 > = -1->Emitted(188, 1) Source(174, 1) + SourceIndex(0) -2 >Emitted(188, 5) Source(174, 5) + SourceIndex(0) -3 >Emitted(188, 11) Source(174, 11) + SourceIndex(0) -4 >Emitted(188, 14) Source(174, 23) + SourceIndex(0) +5 > [ +6 > ( +7 > {} +8 > ) +9 > , +10> ( +11> {} +12> ) +13> ] +14> ; +1->Emitted(114, 1) Source(174, 1) + SourceIndex(0) +2 >Emitted(114, 5) Source(174, 5) + SourceIndex(0) +3 >Emitted(114, 11) Source(174, 11) + SourceIndex(0) +4 >Emitted(114, 14) Source(174, 23) + SourceIndex(0) +5 >Emitted(114, 15) Source(174, 30) + SourceIndex(0) +6 >Emitted(114, 16) Source(174, 31) + SourceIndex(0) +7 >Emitted(114, 18) Source(174, 33) + SourceIndex(0) +8 >Emitted(114, 19) Source(174, 34) + SourceIndex(0) +9 >Emitted(114, 21) Source(174, 41) + SourceIndex(0) +10>Emitted(114, 22) Source(174, 42) + SourceIndex(0) +11>Emitted(114, 24) Source(174, 44) + SourceIndex(0) +12>Emitted(114, 25) Source(174, 45) + SourceIndex(0) +13>Emitted(114, 26) Source(174, 46) + SourceIndex(0) +14>Emitted(114, 27) Source(174, 47) + SourceIndex(0) --- ->>> ({}), -1 >^^^^ -2 > ^ -3 > ^^ -4 > ^ -5 > ^-> -1 >[ -2 > ( -3 > {} -4 > ) -1 >Emitted(189, 5) Source(174, 30) + SourceIndex(0) -2 >Emitted(189, 6) Source(174, 31) + SourceIndex(0) -3 >Emitted(189, 8) Source(174, 33) + SourceIndex(0) -4 >Emitted(189, 9) Source(174, 34) + SourceIndex(0) ---- ->>> ({}) -1->^^^^ -2 > ^ -3 > ^^ -4 > ^ -1->, -2 > ( -3 > {} -4 > ) -1->Emitted(190, 5) Source(174, 41) + SourceIndex(0) -2 >Emitted(190, 6) Source(174, 42) + SourceIndex(0) -3 >Emitted(190, 8) Source(174, 44) + SourceIndex(0) -4 >Emitted(190, 9) Source(174, 45) + SourceIndex(0) ---- ->>>]; -1 >^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1 >] -2 > ; -1 >Emitted(191, 2) Source(174, 46) + SourceIndex(0) -2 >Emitted(191, 3) Source(174, 47) + SourceIndex(0) ---- ->>>var c12t11 = [ +>>>var c12t11 = [function (n, s) { return s; }]; 1-> 2 >^^^^ 3 > ^^^^^^ 4 > ^^^ -5 > ^^^^^^^^^-> +5 > ^ +6 > ^^^^^^^^^^ +7 > ^ +8 > ^^ +9 > ^ +10> ^^^^ +11> ^^^^^^ +12> ^ +13> ^ +14> ^ +15> ^ +16> ^ +17> ^ +18> ^ 1-> > 2 >var 3 > c12t11 4 > = <{(n: number, s: string): string;}[]> -1->Emitted(192, 1) Source(175, 1) + SourceIndex(0) -2 >Emitted(192, 5) Source(175, 5) + SourceIndex(0) -3 >Emitted(192, 11) Source(175, 11) + SourceIndex(0) -4 >Emitted(192, 14) Source(175, 52) + SourceIndex(0) ---- ->>> function (n, s) { -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^ -4 > ^^ -5 > ^ -1->[ -2 > function( -3 > n -4 > , -5 > s -1->Emitted(193, 5) Source(175, 53) + SourceIndex(0) -2 >Emitted(193, 15) Source(175, 62) + SourceIndex(0) -3 >Emitted(193, 16) Source(175, 63) + SourceIndex(0) -4 >Emitted(193, 18) Source(175, 65) + SourceIndex(0) -5 >Emitted(193, 19) Source(175, 66) + SourceIndex(0) ---- ->>> return s; -1 >^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^ -1 >) { -2 > return -3 > -4 > s -5 > ; -1 >Emitted(194, 9) Source(175, 70) + SourceIndex(0) -2 >Emitted(194, 15) Source(175, 76) + SourceIndex(0) -3 >Emitted(194, 16) Source(175, 77) + SourceIndex(0) -4 >Emitted(194, 17) Source(175, 78) + SourceIndex(0) -5 >Emitted(194, 18) Source(175, 79) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -1 > -2 > } -1 >Emitted(195, 5) Source(175, 80) + SourceIndex(0) -2 >Emitted(195, 6) Source(175, 81) + SourceIndex(0) ---- ->>>]; -1 >^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1 >] -2 > ; -1 >Emitted(196, 2) Source(175, 82) + SourceIndex(0) -2 >Emitted(196, 3) Source(175, 83) + SourceIndex(0) +5 > [ +6 > function( +7 > n +8 > , +9 > s +10> ) { +11> return +12> +13> s +14> ; +15> +16> } +17> ] +18> ; +1->Emitted(115, 1) Source(175, 1) + SourceIndex(0) +2 >Emitted(115, 5) Source(175, 5) + SourceIndex(0) +3 >Emitted(115, 11) Source(175, 11) + SourceIndex(0) +4 >Emitted(115, 14) Source(175, 52) + SourceIndex(0) +5 >Emitted(115, 15) Source(175, 53) + SourceIndex(0) +6 >Emitted(115, 25) Source(175, 62) + SourceIndex(0) +7 >Emitted(115, 26) Source(175, 63) + SourceIndex(0) +8 >Emitted(115, 28) Source(175, 65) + SourceIndex(0) +9 >Emitted(115, 29) Source(175, 66) + SourceIndex(0) +10>Emitted(115, 33) Source(175, 70) + SourceIndex(0) +11>Emitted(115, 39) Source(175, 76) + SourceIndex(0) +12>Emitted(115, 40) Source(175, 77) + SourceIndex(0) +13>Emitted(115, 41) Source(175, 78) + SourceIndex(0) +14>Emitted(115, 42) Source(175, 79) + SourceIndex(0) +15>Emitted(115, 43) Source(175, 80) + SourceIndex(0) +16>Emitted(115, 44) Source(175, 81) + SourceIndex(0) +17>Emitted(115, 45) Source(175, 82) + SourceIndex(0) +18>Emitted(115, 46) Source(175, 83) + SourceIndex(0) --- >>>var c12t12 = { -1-> +1 > 2 >^^^^ 3 > ^^^^^^ 4 > ^^^ 5 > ^-> -1-> +1 > > 2 >var 3 > c12t12 4 > = -1->Emitted(197, 1) Source(176, 1) + SourceIndex(0) -2 >Emitted(197, 5) Source(176, 5) + SourceIndex(0) -3 >Emitted(197, 11) Source(176, 11) + SourceIndex(0) -4 >Emitted(197, 14) Source(176, 21) + SourceIndex(0) +1 >Emitted(116, 1) Source(176, 1) + SourceIndex(0) +2 >Emitted(116, 5) Source(176, 5) + SourceIndex(0) +3 >Emitted(116, 11) Source(176, 11) + SourceIndex(0) +4 >Emitted(116, 14) Source(176, 21) + SourceIndex(0) --- >>> foo: ({}) 1->^^^^ @@ -3194,12 +3005,12 @@ sourceFile:contextualTyping.ts 4 > ( 5 > {} 6 > ) -1->Emitted(198, 5) Source(177, 5) + SourceIndex(0) -2 >Emitted(198, 8) Source(177, 8) + SourceIndex(0) -3 >Emitted(198, 10) Source(177, 16) + SourceIndex(0) -4 >Emitted(198, 11) Source(177, 17) + SourceIndex(0) -5 >Emitted(198, 13) Source(177, 19) + SourceIndex(0) -6 >Emitted(198, 14) Source(177, 20) + SourceIndex(0) +1->Emitted(117, 5) Source(177, 5) + SourceIndex(0) +2 >Emitted(117, 8) Source(177, 8) + SourceIndex(0) +3 >Emitted(117, 10) Source(177, 16) + SourceIndex(0) +4 >Emitted(117, 11) Source(177, 17) + SourceIndex(0) +5 >Emitted(117, 13) Source(177, 19) + SourceIndex(0) +6 >Emitted(117, 14) Source(177, 20) + SourceIndex(0) --- >>>}; 1 >^ @@ -3208,8 +3019,8 @@ sourceFile:contextualTyping.ts 1 > >} 2 > -1 >Emitted(199, 2) Source(178, 2) + SourceIndex(0) -2 >Emitted(199, 3) Source(178, 2) + SourceIndex(0) +1 >Emitted(118, 2) Source(178, 2) + SourceIndex(0) +2 >Emitted(118, 3) Source(178, 2) + SourceIndex(0) --- >>>var c12t13 = ({ 1-> @@ -3217,20 +3028,20 @@ sourceFile:contextualTyping.ts 3 > ^^^^^^ 4 > ^^^ 5 > ^ -6 > ^^^^^^^^^^^-> +6 > ^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > 2 >var 3 > c12t13 4 > = 5 > ( -1->Emitted(200, 1) Source(179, 1) + SourceIndex(0) -2 >Emitted(200, 5) Source(179, 5) + SourceIndex(0) -3 >Emitted(200, 11) Source(179, 11) + SourceIndex(0) -4 >Emitted(200, 14) Source(179, 21) + SourceIndex(0) -5 >Emitted(200, 15) Source(179, 22) + SourceIndex(0) +1->Emitted(119, 1) Source(179, 1) + SourceIndex(0) +2 >Emitted(119, 5) Source(179, 5) + SourceIndex(0) +3 >Emitted(119, 11) Source(179, 11) + SourceIndex(0) +4 >Emitted(119, 14) Source(179, 21) + SourceIndex(0) +5 >Emitted(119, 15) Source(179, 22) + SourceIndex(0) --- ->>> f: function (i, s) { +>>> f: function (i, s) { return s; } 1->^^^^ 2 > ^ 3 > ^^ @@ -3238,6 +3049,13 @@ sourceFile:contextualTyping.ts 5 > ^ 6 > ^^ 7 > ^ +8 > ^^^^ +9 > ^^^^^^ +10> ^ +11> ^ +12> ^ +13> ^ +14> ^ 1->{ > 2 > f @@ -3246,38 +3064,27 @@ sourceFile:contextualTyping.ts 5 > i 6 > , 7 > s -1->Emitted(201, 5) Source(180, 5) + SourceIndex(0) -2 >Emitted(201, 6) Source(180, 6) + SourceIndex(0) -3 >Emitted(201, 8) Source(180, 8) + SourceIndex(0) -4 >Emitted(201, 18) Source(180, 17) + SourceIndex(0) -5 >Emitted(201, 19) Source(180, 18) + SourceIndex(0) -6 >Emitted(201, 21) Source(180, 20) + SourceIndex(0) -7 >Emitted(201, 22) Source(180, 21) + SourceIndex(0) ---- ->>> return s; -1 >^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^ -1 >) { -2 > return -3 > -4 > s -5 > ; -1 >Emitted(202, 9) Source(180, 25) + SourceIndex(0) -2 >Emitted(202, 15) Source(180, 31) + SourceIndex(0) -3 >Emitted(202, 16) Source(180, 32) + SourceIndex(0) -4 >Emitted(202, 17) Source(180, 33) + SourceIndex(0) -5 >Emitted(202, 18) Source(180, 34) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -1 > -2 > } -1 >Emitted(203, 5) Source(180, 35) + SourceIndex(0) -2 >Emitted(203, 6) Source(180, 36) + SourceIndex(0) +8 > ) { +9 > return +10> +11> s +12> ; +13> +14> } +1->Emitted(120, 5) Source(180, 5) + SourceIndex(0) +2 >Emitted(120, 6) Source(180, 6) + SourceIndex(0) +3 >Emitted(120, 8) Source(180, 8) + SourceIndex(0) +4 >Emitted(120, 18) Source(180, 17) + SourceIndex(0) +5 >Emitted(120, 19) Source(180, 18) + SourceIndex(0) +6 >Emitted(120, 21) Source(180, 20) + SourceIndex(0) +7 >Emitted(120, 22) Source(180, 21) + SourceIndex(0) +8 >Emitted(120, 26) Source(180, 25) + SourceIndex(0) +9 >Emitted(120, 32) Source(180, 31) + SourceIndex(0) +10>Emitted(120, 33) Source(180, 32) + SourceIndex(0) +11>Emitted(120, 34) Source(180, 33) + SourceIndex(0) +12>Emitted(120, 35) Source(180, 34) + SourceIndex(0) +13>Emitted(120, 36) Source(180, 35) + SourceIndex(0) +14>Emitted(120, 37) Source(180, 36) + SourceIndex(0) --- >>>}); 1 >^ @@ -3288,9 +3095,9 @@ sourceFile:contextualTyping.ts >} 2 > ) 3 > -1 >Emitted(204, 2) Source(181, 2) + SourceIndex(0) -2 >Emitted(204, 3) Source(181, 3) + SourceIndex(0) -3 >Emitted(204, 4) Source(181, 3) + SourceIndex(0) +1 >Emitted(121, 2) Source(181, 2) + SourceIndex(0) +2 >Emitted(121, 3) Source(181, 3) + SourceIndex(0) +3 >Emitted(121, 4) Source(181, 3) + SourceIndex(0) --- >>>var c12t14 = ({ 1-> @@ -3304,11 +3111,11 @@ sourceFile:contextualTyping.ts 3 > c12t14 4 > = 5 > ( -1->Emitted(205, 1) Source(182, 1) + SourceIndex(0) -2 >Emitted(205, 5) Source(182, 5) + SourceIndex(0) -3 >Emitted(205, 11) Source(182, 11) + SourceIndex(0) -4 >Emitted(205, 14) Source(182, 21) + SourceIndex(0) -5 >Emitted(205, 15) Source(182, 22) + SourceIndex(0) +1->Emitted(122, 1) Source(182, 1) + SourceIndex(0) +2 >Emitted(122, 5) Source(182, 5) + SourceIndex(0) +3 >Emitted(122, 11) Source(182, 11) + SourceIndex(0) +4 >Emitted(122, 14) Source(182, 21) + SourceIndex(0) +5 >Emitted(122, 15) Source(182, 22) + SourceIndex(0) --- >>> a: [] 1 >^^^^ @@ -3320,31 +3127,39 @@ sourceFile:contextualTyping.ts 2 > a 3 > : 4 > [] -1 >Emitted(206, 5) Source(183, 5) + SourceIndex(0) -2 >Emitted(206, 6) Source(183, 6) + SourceIndex(0) -3 >Emitted(206, 8) Source(183, 8) + SourceIndex(0) -4 >Emitted(206, 10) Source(183, 10) + SourceIndex(0) +1 >Emitted(123, 5) Source(183, 5) + SourceIndex(0) +2 >Emitted(123, 6) Source(183, 6) + SourceIndex(0) +3 >Emitted(123, 8) Source(183, 8) + SourceIndex(0) +4 >Emitted(123, 10) Source(183, 10) + SourceIndex(0) --- >>>}); 1 >^ 2 > ^ 3 > ^ -4 > ^^^^^^^^^^^^^^^^^^-> +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > >} 2 > ) 3 > -1 >Emitted(207, 2) Source(184, 2) + SourceIndex(0) -2 >Emitted(207, 3) Source(184, 3) + SourceIndex(0) -3 >Emitted(207, 4) Source(184, 3) + SourceIndex(0) +1 >Emitted(124, 2) Source(184, 2) + SourceIndex(0) +2 >Emitted(124, 3) Source(184, 3) + SourceIndex(0) +3 >Emitted(124, 4) Source(184, 3) + SourceIndex(0) --- ->>>function EF1(a, b) { +>>>function EF1(a, b) { return a + b; } 1-> 2 >^^^^^^^^^^^^^ 3 > ^ 4 > ^^ 5 > ^ -6 > ^-> +6 > ^^^^ +7 > ^^^^^^ +8 > ^ +9 > ^ +10> ^^^ +11> ^ +12> ^ +13> ^ +14> ^ 1-> > >// CONTEXT: Contextual typing declarations @@ -3357,46 +3172,32 @@ sourceFile:contextualTyping.ts 3 > a 4 > , 5 > b -1->Emitted(208, 1) Source(191, 1) + SourceIndex(0) -2 >Emitted(208, 14) Source(191, 14) + SourceIndex(0) -3 >Emitted(208, 15) Source(191, 15) + SourceIndex(0) -4 >Emitted(208, 17) Source(191, 16) + SourceIndex(0) -5 >Emitted(208, 18) Source(191, 17) + SourceIndex(0) ---- ->>> return a + b; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^^^ -6 > ^ -7 > ^ -1->) { -2 > return -3 > -4 > a -5 > + -6 > b -7 > ; -1->Emitted(209, 5) Source(191, 21) + SourceIndex(0) name (EF1) -2 >Emitted(209, 11) Source(191, 27) + SourceIndex(0) name (EF1) -3 >Emitted(209, 12) Source(191, 28) + SourceIndex(0) name (EF1) -4 >Emitted(209, 13) Source(191, 29) + SourceIndex(0) name (EF1) -5 >Emitted(209, 16) Source(191, 30) + SourceIndex(0) name (EF1) -6 >Emitted(209, 17) Source(191, 31) + SourceIndex(0) name (EF1) -7 >Emitted(209, 18) Source(191, 32) + SourceIndex(0) name (EF1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -1 >Emitted(210, 1) Source(191, 33) + SourceIndex(0) name (EF1) -2 >Emitted(210, 2) Source(191, 34) + SourceIndex(0) name (EF1) +6 > ) { +7 > return +8 > +9 > a +10> + +11> b +12> ; +13> +14> } +1->Emitted(125, 1) Source(191, 1) + SourceIndex(0) +2 >Emitted(125, 14) Source(191, 14) + SourceIndex(0) +3 >Emitted(125, 15) Source(191, 15) + SourceIndex(0) +4 >Emitted(125, 17) Source(191, 16) + SourceIndex(0) +5 >Emitted(125, 18) Source(191, 17) + SourceIndex(0) +6 >Emitted(125, 22) Source(191, 21) + SourceIndex(0) name (EF1) +7 >Emitted(125, 28) Source(191, 27) + SourceIndex(0) name (EF1) +8 >Emitted(125, 29) Source(191, 28) + SourceIndex(0) name (EF1) +9 >Emitted(125, 30) Source(191, 29) + SourceIndex(0) name (EF1) +10>Emitted(125, 33) Source(191, 30) + SourceIndex(0) name (EF1) +11>Emitted(125, 34) Source(191, 31) + SourceIndex(0) name (EF1) +12>Emitted(125, 35) Source(191, 32) + SourceIndex(0) name (EF1) +13>Emitted(125, 36) Source(191, 33) + SourceIndex(0) name (EF1) +14>Emitted(125, 37) Source(191, 34) + SourceIndex(0) name (EF1) --- >>>var efv = EF1(1, 2); -1-> +1 > 2 >^^^^ 3 > ^^^ 4 > ^^^ @@ -3408,7 +3209,7 @@ sourceFile:contextualTyping.ts 10> ^ 11> ^ 12> ^^^-> -1-> +1 > > > 2 >var @@ -3421,17 +3222,17 @@ sourceFile:contextualTyping.ts 9 > 2 10> ) 11> ; -1->Emitted(211, 1) Source(193, 1) + SourceIndex(0) -2 >Emitted(211, 5) Source(193, 5) + SourceIndex(0) -3 >Emitted(211, 8) Source(193, 8) + SourceIndex(0) -4 >Emitted(211, 11) Source(193, 11) + SourceIndex(0) -5 >Emitted(211, 14) Source(193, 14) + SourceIndex(0) -6 >Emitted(211, 15) Source(193, 15) + SourceIndex(0) -7 >Emitted(211, 16) Source(193, 16) + SourceIndex(0) -8 >Emitted(211, 18) Source(193, 17) + SourceIndex(0) -9 >Emitted(211, 19) Source(193, 18) + SourceIndex(0) -10>Emitted(211, 20) Source(193, 19) + SourceIndex(0) -11>Emitted(211, 21) Source(193, 20) + SourceIndex(0) +1 >Emitted(126, 1) Source(193, 1) + SourceIndex(0) +2 >Emitted(126, 5) Source(193, 5) + SourceIndex(0) +3 >Emitted(126, 8) Source(193, 8) + SourceIndex(0) +4 >Emitted(126, 11) Source(193, 11) + SourceIndex(0) +5 >Emitted(126, 14) Source(193, 14) + SourceIndex(0) +6 >Emitted(126, 15) Source(193, 15) + SourceIndex(0) +7 >Emitted(126, 16) Source(193, 16) + SourceIndex(0) +8 >Emitted(126, 18) Source(193, 17) + SourceIndex(0) +9 >Emitted(126, 19) Source(193, 18) + SourceIndex(0) +10>Emitted(126, 20) Source(193, 19) + SourceIndex(0) +11>Emitted(126, 21) Source(193, 20) + SourceIndex(0) --- >>>function Point(x, y) { 1-> @@ -3458,11 +3259,11 @@ sourceFile:contextualTyping.ts 3 > x 4 > , 5 > y -1->Emitted(212, 1) Source(207, 1) + SourceIndex(0) -2 >Emitted(212, 16) Source(207, 16) + SourceIndex(0) -3 >Emitted(212, 17) Source(207, 17) + SourceIndex(0) -4 >Emitted(212, 19) Source(207, 19) + SourceIndex(0) -5 >Emitted(212, 20) Source(207, 20) + SourceIndex(0) +1->Emitted(127, 1) Source(207, 1) + SourceIndex(0) +2 >Emitted(127, 16) Source(207, 16) + SourceIndex(0) +3 >Emitted(127, 17) Source(207, 17) + SourceIndex(0) +4 >Emitted(127, 19) Source(207, 19) + SourceIndex(0) +5 >Emitted(127, 20) Source(207, 20) + SourceIndex(0) --- >>> this.x = x; 1 >^^^^ @@ -3481,13 +3282,13 @@ sourceFile:contextualTyping.ts 5 > = 6 > x 7 > ; -1 >Emitted(213, 5) Source(208, 5) + SourceIndex(0) name (Point) -2 >Emitted(213, 9) Source(208, 9) + SourceIndex(0) name (Point) -3 >Emitted(213, 10) Source(208, 10) + SourceIndex(0) name (Point) -4 >Emitted(213, 11) Source(208, 11) + SourceIndex(0) name (Point) -5 >Emitted(213, 14) Source(208, 14) + SourceIndex(0) name (Point) -6 >Emitted(213, 15) Source(208, 15) + SourceIndex(0) name (Point) -7 >Emitted(213, 16) Source(208, 16) + SourceIndex(0) name (Point) +1 >Emitted(128, 5) Source(208, 5) + SourceIndex(0) name (Point) +2 >Emitted(128, 9) Source(208, 9) + SourceIndex(0) name (Point) +3 >Emitted(128, 10) Source(208, 10) + SourceIndex(0) name (Point) +4 >Emitted(128, 11) Source(208, 11) + SourceIndex(0) name (Point) +5 >Emitted(128, 14) Source(208, 14) + SourceIndex(0) name (Point) +6 >Emitted(128, 15) Source(208, 15) + SourceIndex(0) name (Point) +7 >Emitted(128, 16) Source(208, 16) + SourceIndex(0) name (Point) --- >>> this.y = y; 1->^^^^ @@ -3506,13 +3307,13 @@ sourceFile:contextualTyping.ts 5 > = 6 > y 7 > ; -1->Emitted(214, 5) Source(209, 5) + SourceIndex(0) name (Point) -2 >Emitted(214, 9) Source(209, 9) + SourceIndex(0) name (Point) -3 >Emitted(214, 10) Source(209, 10) + SourceIndex(0) name (Point) -4 >Emitted(214, 11) Source(209, 11) + SourceIndex(0) name (Point) -5 >Emitted(214, 14) Source(209, 14) + SourceIndex(0) name (Point) -6 >Emitted(214, 15) Source(209, 15) + SourceIndex(0) name (Point) -7 >Emitted(214, 16) Source(209, 16) + SourceIndex(0) name (Point) +1->Emitted(129, 5) Source(209, 5) + SourceIndex(0) name (Point) +2 >Emitted(129, 9) Source(209, 9) + SourceIndex(0) name (Point) +3 >Emitted(129, 10) Source(209, 10) + SourceIndex(0) name (Point) +4 >Emitted(129, 11) Source(209, 11) + SourceIndex(0) name (Point) +5 >Emitted(129, 14) Source(209, 14) + SourceIndex(0) name (Point) +6 >Emitted(129, 15) Source(209, 15) + SourceIndex(0) name (Point) +7 >Emitted(129, 16) Source(209, 16) + SourceIndex(0) name (Point) --- >>> return this; 1->^^^^ @@ -3527,11 +3328,11 @@ sourceFile:contextualTyping.ts 3 > 4 > this 5 > ; -1->Emitted(215, 5) Source(211, 5) + SourceIndex(0) name (Point) -2 >Emitted(215, 11) Source(211, 11) + SourceIndex(0) name (Point) -3 >Emitted(215, 12) Source(211, 12) + SourceIndex(0) name (Point) -4 >Emitted(215, 16) Source(211, 16) + SourceIndex(0) name (Point) -5 >Emitted(215, 17) Source(211, 17) + SourceIndex(0) name (Point) +1->Emitted(130, 5) Source(211, 5) + SourceIndex(0) name (Point) +2 >Emitted(130, 11) Source(211, 11) + SourceIndex(0) name (Point) +3 >Emitted(130, 12) Source(211, 12) + SourceIndex(0) name (Point) +4 >Emitted(130, 16) Source(211, 16) + SourceIndex(0) name (Point) +5 >Emitted(130, 17) Source(211, 17) + SourceIndex(0) name (Point) --- >>>} 1 > @@ -3540,8 +3341,8 @@ sourceFile:contextualTyping.ts 1 > > 2 >} -1 >Emitted(216, 1) Source(212, 1) + SourceIndex(0) name (Point) -2 >Emitted(216, 2) Source(212, 2) + SourceIndex(0) name (Point) +1 >Emitted(131, 1) Source(212, 1) + SourceIndex(0) name (Point) +2 >Emitted(131, 2) Source(212, 2) + SourceIndex(0) name (Point) --- >>>Point.origin = new Point(0, 0); 1-> @@ -3573,19 +3374,19 @@ sourceFile:contextualTyping.ts 11> 0 12> ) 13> ; -1->Emitted(217, 1) Source(214, 1) + SourceIndex(0) -2 >Emitted(217, 6) Source(214, 6) + SourceIndex(0) -3 >Emitted(217, 7) Source(214, 7) + SourceIndex(0) -4 >Emitted(217, 13) Source(214, 13) + SourceIndex(0) -5 >Emitted(217, 16) Source(214, 16) + SourceIndex(0) -6 >Emitted(217, 20) Source(214, 20) + SourceIndex(0) -7 >Emitted(217, 25) Source(214, 25) + SourceIndex(0) -8 >Emitted(217, 26) Source(214, 26) + SourceIndex(0) -9 >Emitted(217, 27) Source(214, 27) + SourceIndex(0) -10>Emitted(217, 29) Source(214, 29) + SourceIndex(0) -11>Emitted(217, 30) Source(214, 30) + SourceIndex(0) -12>Emitted(217, 31) Source(214, 31) + SourceIndex(0) -13>Emitted(217, 32) Source(214, 32) + SourceIndex(0) +1->Emitted(132, 1) Source(214, 1) + SourceIndex(0) +2 >Emitted(132, 6) Source(214, 6) + SourceIndex(0) +3 >Emitted(132, 7) Source(214, 7) + SourceIndex(0) +4 >Emitted(132, 13) Source(214, 13) + SourceIndex(0) +5 >Emitted(132, 16) Source(214, 16) + SourceIndex(0) +6 >Emitted(132, 20) Source(214, 20) + SourceIndex(0) +7 >Emitted(132, 25) Source(214, 25) + SourceIndex(0) +8 >Emitted(132, 26) Source(214, 26) + SourceIndex(0) +9 >Emitted(132, 27) Source(214, 27) + SourceIndex(0) +10>Emitted(132, 29) Source(214, 29) + SourceIndex(0) +11>Emitted(132, 30) Source(214, 30) + SourceIndex(0) +12>Emitted(132, 31) Source(214, 31) + SourceIndex(0) +13>Emitted(132, 32) Source(214, 32) + SourceIndex(0) --- >>>Point.prototype.add = function (dx, dy) { 1-> @@ -3613,17 +3414,17 @@ sourceFile:contextualTyping.ts 9 > dx 10> , 11> dy -1->Emitted(218, 1) Source(216, 1) + SourceIndex(0) -2 >Emitted(218, 6) Source(216, 6) + SourceIndex(0) -3 >Emitted(218, 7) Source(216, 7) + SourceIndex(0) -4 >Emitted(218, 16) Source(216, 16) + SourceIndex(0) -5 >Emitted(218, 17) Source(216, 17) + SourceIndex(0) -6 >Emitted(218, 20) Source(216, 20) + SourceIndex(0) -7 >Emitted(218, 23) Source(216, 23) + SourceIndex(0) -8 >Emitted(218, 33) Source(216, 32) + SourceIndex(0) -9 >Emitted(218, 35) Source(216, 34) + SourceIndex(0) -10>Emitted(218, 37) Source(216, 36) + SourceIndex(0) -11>Emitted(218, 39) Source(216, 38) + SourceIndex(0) +1->Emitted(133, 1) Source(216, 1) + SourceIndex(0) +2 >Emitted(133, 6) Source(216, 6) + SourceIndex(0) +3 >Emitted(133, 7) Source(216, 7) + SourceIndex(0) +4 >Emitted(133, 16) Source(216, 16) + SourceIndex(0) +5 >Emitted(133, 17) Source(216, 17) + SourceIndex(0) +6 >Emitted(133, 20) Source(216, 20) + SourceIndex(0) +7 >Emitted(133, 23) Source(216, 23) + SourceIndex(0) +8 >Emitted(133, 33) Source(216, 32) + SourceIndex(0) +9 >Emitted(133, 35) Source(216, 34) + SourceIndex(0) +10>Emitted(133, 37) Source(216, 36) + SourceIndex(0) +11>Emitted(133, 39) Source(216, 38) + SourceIndex(0) --- >>> return new Point(this.x + dx, this.y + dy); 1->^^^^ @@ -3665,25 +3466,25 @@ sourceFile:contextualTyping.ts 17> dy 18> ) 19> ; -1->Emitted(219, 5) Source(217, 5) + SourceIndex(0) -2 >Emitted(219, 11) Source(217, 11) + SourceIndex(0) -3 >Emitted(219, 12) Source(217, 12) + SourceIndex(0) -4 >Emitted(219, 16) Source(217, 16) + SourceIndex(0) -5 >Emitted(219, 21) Source(217, 21) + SourceIndex(0) -6 >Emitted(219, 22) Source(217, 22) + SourceIndex(0) -7 >Emitted(219, 26) Source(217, 26) + SourceIndex(0) -8 >Emitted(219, 27) Source(217, 27) + SourceIndex(0) -9 >Emitted(219, 28) Source(217, 28) + SourceIndex(0) -10>Emitted(219, 31) Source(217, 31) + SourceIndex(0) -11>Emitted(219, 33) Source(217, 33) + SourceIndex(0) -12>Emitted(219, 35) Source(217, 35) + SourceIndex(0) -13>Emitted(219, 39) Source(217, 39) + SourceIndex(0) -14>Emitted(219, 40) Source(217, 40) + SourceIndex(0) -15>Emitted(219, 41) Source(217, 41) + SourceIndex(0) -16>Emitted(219, 44) Source(217, 44) + SourceIndex(0) -17>Emitted(219, 46) Source(217, 46) + SourceIndex(0) -18>Emitted(219, 47) Source(217, 47) + SourceIndex(0) -19>Emitted(219, 48) Source(217, 48) + SourceIndex(0) +1->Emitted(134, 5) Source(217, 5) + SourceIndex(0) +2 >Emitted(134, 11) Source(217, 11) + SourceIndex(0) +3 >Emitted(134, 12) Source(217, 12) + SourceIndex(0) +4 >Emitted(134, 16) Source(217, 16) + SourceIndex(0) +5 >Emitted(134, 21) Source(217, 21) + SourceIndex(0) +6 >Emitted(134, 22) Source(217, 22) + SourceIndex(0) +7 >Emitted(134, 26) Source(217, 26) + SourceIndex(0) +8 >Emitted(134, 27) Source(217, 27) + SourceIndex(0) +9 >Emitted(134, 28) Source(217, 28) + SourceIndex(0) +10>Emitted(134, 31) Source(217, 31) + SourceIndex(0) +11>Emitted(134, 33) Source(217, 33) + SourceIndex(0) +12>Emitted(134, 35) Source(217, 35) + SourceIndex(0) +13>Emitted(134, 39) Source(217, 39) + SourceIndex(0) +14>Emitted(134, 40) Source(217, 40) + SourceIndex(0) +15>Emitted(134, 41) Source(217, 41) + SourceIndex(0) +16>Emitted(134, 44) Source(217, 44) + SourceIndex(0) +17>Emitted(134, 46) Source(217, 46) + SourceIndex(0) +18>Emitted(134, 47) Source(217, 47) + SourceIndex(0) +19>Emitted(134, 48) Source(217, 48) + SourceIndex(0) --- >>>}; 1 > @@ -3694,9 +3495,9 @@ sourceFile:contextualTyping.ts > 2 >} 3 > ; -1 >Emitted(220, 1) Source(218, 1) + SourceIndex(0) -2 >Emitted(220, 2) Source(218, 2) + SourceIndex(0) -3 >Emitted(220, 3) Source(218, 3) + SourceIndex(0) +1 >Emitted(135, 1) Source(218, 1) + SourceIndex(0) +2 >Emitted(135, 2) Source(218, 2) + SourceIndex(0) +3 >Emitted(135, 3) Source(218, 3) + SourceIndex(0) --- >>>Point.prototype = { 1-> @@ -3711,11 +3512,11 @@ sourceFile:contextualTyping.ts 3 > . 4 > prototype 5 > = -1->Emitted(221, 1) Source(220, 1) + SourceIndex(0) -2 >Emitted(221, 6) Source(220, 6) + SourceIndex(0) -3 >Emitted(221, 7) Source(220, 7) + SourceIndex(0) -4 >Emitted(221, 16) Source(220, 16) + SourceIndex(0) -5 >Emitted(221, 19) Source(220, 19) + SourceIndex(0) +1->Emitted(136, 1) Source(220, 1) + SourceIndex(0) +2 >Emitted(136, 6) Source(220, 6) + SourceIndex(0) +3 >Emitted(136, 7) Source(220, 7) + SourceIndex(0) +4 >Emitted(136, 16) Source(220, 16) + SourceIndex(0) +5 >Emitted(136, 19) Source(220, 19) + SourceIndex(0) --- >>> x: 0, 1 >^^^^ @@ -3728,10 +3529,10 @@ sourceFile:contextualTyping.ts 2 > x 3 > : 4 > 0 -1 >Emitted(222, 5) Source(221, 5) + SourceIndex(0) -2 >Emitted(222, 6) Source(221, 6) + SourceIndex(0) -3 >Emitted(222, 8) Source(221, 8) + SourceIndex(0) -4 >Emitted(222, 9) Source(221, 9) + SourceIndex(0) +1 >Emitted(137, 5) Source(221, 5) + SourceIndex(0) +2 >Emitted(137, 6) Source(221, 6) + SourceIndex(0) +3 >Emitted(137, 8) Source(221, 8) + SourceIndex(0) +4 >Emitted(137, 9) Source(221, 9) + SourceIndex(0) --- >>> y: 0, 1->^^^^ @@ -3744,10 +3545,10 @@ sourceFile:contextualTyping.ts 2 > y 3 > : 4 > 0 -1->Emitted(223, 5) Source(222, 5) + SourceIndex(0) -2 >Emitted(223, 6) Source(222, 6) + SourceIndex(0) -3 >Emitted(223, 8) Source(222, 8) + SourceIndex(0) -4 >Emitted(223, 9) Source(222, 9) + SourceIndex(0) +1->Emitted(138, 5) Source(222, 5) + SourceIndex(0) +2 >Emitted(138, 6) Source(222, 6) + SourceIndex(0) +3 >Emitted(138, 8) Source(222, 8) + SourceIndex(0) +4 >Emitted(138, 9) Source(222, 9) + SourceIndex(0) --- >>> add: function (dx, dy) { 1->^^^^ @@ -3766,13 +3567,13 @@ sourceFile:contextualTyping.ts 5 > dx 6 > , 7 > dy -1->Emitted(224, 5) Source(223, 5) + SourceIndex(0) -2 >Emitted(224, 8) Source(223, 8) + SourceIndex(0) -3 >Emitted(224, 10) Source(223, 10) + SourceIndex(0) -4 >Emitted(224, 20) Source(223, 19) + SourceIndex(0) -5 >Emitted(224, 22) Source(223, 21) + SourceIndex(0) -6 >Emitted(224, 24) Source(223, 23) + SourceIndex(0) -7 >Emitted(224, 26) Source(223, 25) + SourceIndex(0) +1->Emitted(139, 5) Source(223, 5) + SourceIndex(0) +2 >Emitted(139, 8) Source(223, 8) + SourceIndex(0) +3 >Emitted(139, 10) Source(223, 10) + SourceIndex(0) +4 >Emitted(139, 20) Source(223, 19) + SourceIndex(0) +5 >Emitted(139, 22) Source(223, 21) + SourceIndex(0) +6 >Emitted(139, 24) Source(223, 23) + SourceIndex(0) +7 >Emitted(139, 26) Source(223, 25) + SourceIndex(0) --- >>> return new Point(this.x + dx, this.y + dy); 1->^^^^^^^^ @@ -3814,25 +3615,25 @@ sourceFile:contextualTyping.ts 17> dy 18> ) 19> ; -1->Emitted(225, 9) Source(224, 9) + SourceIndex(0) -2 >Emitted(225, 15) Source(224, 15) + SourceIndex(0) -3 >Emitted(225, 16) Source(224, 16) + SourceIndex(0) -4 >Emitted(225, 20) Source(224, 20) + SourceIndex(0) -5 >Emitted(225, 25) Source(224, 25) + SourceIndex(0) -6 >Emitted(225, 26) Source(224, 26) + SourceIndex(0) -7 >Emitted(225, 30) Source(224, 30) + SourceIndex(0) -8 >Emitted(225, 31) Source(224, 31) + SourceIndex(0) -9 >Emitted(225, 32) Source(224, 32) + SourceIndex(0) -10>Emitted(225, 35) Source(224, 35) + SourceIndex(0) -11>Emitted(225, 37) Source(224, 37) + SourceIndex(0) -12>Emitted(225, 39) Source(224, 39) + SourceIndex(0) -13>Emitted(225, 43) Source(224, 43) + SourceIndex(0) -14>Emitted(225, 44) Source(224, 44) + SourceIndex(0) -15>Emitted(225, 45) Source(224, 45) + SourceIndex(0) -16>Emitted(225, 48) Source(224, 48) + SourceIndex(0) -17>Emitted(225, 50) Source(224, 50) + SourceIndex(0) -18>Emitted(225, 51) Source(224, 51) + SourceIndex(0) -19>Emitted(225, 52) Source(224, 52) + SourceIndex(0) +1->Emitted(140, 9) Source(224, 9) + SourceIndex(0) +2 >Emitted(140, 15) Source(224, 15) + SourceIndex(0) +3 >Emitted(140, 16) Source(224, 16) + SourceIndex(0) +4 >Emitted(140, 20) Source(224, 20) + SourceIndex(0) +5 >Emitted(140, 25) Source(224, 25) + SourceIndex(0) +6 >Emitted(140, 26) Source(224, 26) + SourceIndex(0) +7 >Emitted(140, 30) Source(224, 30) + SourceIndex(0) +8 >Emitted(140, 31) Source(224, 31) + SourceIndex(0) +9 >Emitted(140, 32) Source(224, 32) + SourceIndex(0) +10>Emitted(140, 35) Source(224, 35) + SourceIndex(0) +11>Emitted(140, 37) Source(224, 37) + SourceIndex(0) +12>Emitted(140, 39) Source(224, 39) + SourceIndex(0) +13>Emitted(140, 43) Source(224, 43) + SourceIndex(0) +14>Emitted(140, 44) Source(224, 44) + SourceIndex(0) +15>Emitted(140, 45) Source(224, 45) + SourceIndex(0) +16>Emitted(140, 48) Source(224, 48) + SourceIndex(0) +17>Emitted(140, 50) Source(224, 50) + SourceIndex(0) +18>Emitted(140, 51) Source(224, 51) + SourceIndex(0) +19>Emitted(140, 52) Source(224, 52) + SourceIndex(0) --- >>> } 1 >^^^^ @@ -3840,8 +3641,8 @@ sourceFile:contextualTyping.ts 1 > > 2 > } -1 >Emitted(226, 5) Source(225, 5) + SourceIndex(0) -2 >Emitted(226, 6) Source(225, 6) + SourceIndex(0) +1 >Emitted(141, 5) Source(225, 5) + SourceIndex(0) +2 >Emitted(141, 6) Source(225, 6) + SourceIndex(0) --- >>>}; 1 >^ @@ -3850,8 +3651,8 @@ sourceFile:contextualTyping.ts 1 > >} 2 > ; -1 >Emitted(227, 2) Source(226, 2) + SourceIndex(0) -2 >Emitted(227, 3) Source(226, 3) + SourceIndex(0) +1 >Emitted(142, 2) Source(226, 2) + SourceIndex(0) +2 >Emitted(142, 3) Source(226, 3) + SourceIndex(0) --- >>>var x = {}; 1-> @@ -3871,11 +3672,11 @@ sourceFile:contextualTyping.ts 4 > : B = 5 > { } 6 > ; -1->Emitted(228, 1) Source(230, 1) + SourceIndex(0) -2 >Emitted(228, 5) Source(230, 5) + SourceIndex(0) -3 >Emitted(228, 6) Source(230, 6) + SourceIndex(0) -4 >Emitted(228, 9) Source(230, 12) + SourceIndex(0) -5 >Emitted(228, 11) Source(230, 15) + SourceIndex(0) -6 >Emitted(228, 12) Source(230, 16) + SourceIndex(0) +1->Emitted(143, 1) Source(230, 1) + SourceIndex(0) +2 >Emitted(143, 5) Source(230, 5) + SourceIndex(0) +3 >Emitted(143, 6) Source(230, 6) + SourceIndex(0) +4 >Emitted(143, 9) Source(230, 12) + SourceIndex(0) +5 >Emitted(143, 11) Source(230, 15) + SourceIndex(0) +6 >Emitted(143, 12) Source(230, 16) + SourceIndex(0) --- >>>//# sourceMappingURL=contextualTyping.js.map \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping1.js b/tests/baselines/reference/contextualTyping1.js index 6b1b88c36ff..7f1e12c744b 100644 --- a/tests/baselines/reference/contextualTyping1.js +++ b/tests/baselines/reference/contextualTyping1.js @@ -2,4 +2,4 @@ var foo: {id:number;} = {id:4}; //// [contextualTyping1.js] -var foo = {\n id: 4\n};\n \ No newline at end of file +var foo = { id: 4 };\n \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping10.js b/tests/baselines/reference/contextualTyping10.js index e6afd72e817..08a2172b69a 100644 --- a/tests/baselines/reference/contextualTyping10.js +++ b/tests/baselines/reference/contextualTyping10.js @@ -4,14 +4,7 @@ class foo { public bar:{id:number;}[] = [{id:1}, {id:2}]; } //// [contextualTyping10.js] var foo = (function () { function foo() { - this.bar = [ - { - id: 1 - }, - { - id: 2 - } - ]; + this.bar = [{ id: 1 }, { id: 2 }]; } return foo; })(); diff --git a/tests/baselines/reference/contextualTyping11.js b/tests/baselines/reference/contextualTyping11.js index 123295d5387..a7ec3815fae 100644 --- a/tests/baselines/reference/contextualTyping11.js +++ b/tests/baselines/reference/contextualTyping11.js @@ -4,9 +4,7 @@ class foo { public bar:{id:number;}[] = [({})]; } //// [contextualTyping11.js] var foo = (function () { function foo() { - this.bar = [ - ({}) - ]; + this.bar = [({})]; } return foo; })(); diff --git a/tests/baselines/reference/contextualTyping12.js b/tests/baselines/reference/contextualTyping12.js index 60f3965f95a..c41ccbed990 100644 --- a/tests/baselines/reference/contextualTyping12.js +++ b/tests/baselines/reference/contextualTyping12.js @@ -4,15 +4,7 @@ class foo { public bar:{id:number;}[] = [{id:1}, {id:2, name:"foo"}]; } //// [contextualTyping12.js] var foo = (function () { function foo() { - this.bar = [ - { - id: 1 - }, - { - id: 2, - name: "foo" - } - ]; + this.bar = [{ id: 1 }, { id: 2, name: "foo" }]; } return foo; })(); diff --git a/tests/baselines/reference/contextualTyping13.js b/tests/baselines/reference/contextualTyping13.js index c035434342e..7965745b943 100644 --- a/tests/baselines/reference/contextualTyping13.js +++ b/tests/baselines/reference/contextualTyping13.js @@ -2,6 +2,4 @@ var foo:(a:number)=>number = function(a){return a}; //// [contextualTyping13.js] -var foo = function (a) { - return a; -}; +var foo = function (a) { return a; }; diff --git a/tests/baselines/reference/contextualTyping14.js b/tests/baselines/reference/contextualTyping14.js index ea9539ef41e..5bae8c948a2 100644 --- a/tests/baselines/reference/contextualTyping14.js +++ b/tests/baselines/reference/contextualTyping14.js @@ -4,9 +4,7 @@ class foo { public bar:(a:number)=>number = function(a){return a}; } //// [contextualTyping14.js] var foo = (function () { function foo() { - this.bar = function (a) { - return a; - }; + this.bar = function (a) { return a; }; } return foo; })(); diff --git a/tests/baselines/reference/contextualTyping15.js b/tests/baselines/reference/contextualTyping15.js index 99855681571..250076ec4d5 100644 --- a/tests/baselines/reference/contextualTyping15.js +++ b/tests/baselines/reference/contextualTyping15.js @@ -4,9 +4,7 @@ class foo { public bar: { (): number; (i: number): number; } = function() { retu //// [contextualTyping15.js] var foo = (function () { function foo() { - this.bar = function () { - return 1; - }; + this.bar = function () { return 1; }; } return foo; })(); diff --git a/tests/baselines/reference/contextualTyping16.js b/tests/baselines/reference/contextualTyping16.js index bccf047ad13..1a4c28ba745 100644 --- a/tests/baselines/reference/contextualTyping16.js +++ b/tests/baselines/reference/contextualTyping16.js @@ -2,9 +2,5 @@ var foo: {id:number;} = {id:4}; foo = {id:5}; //// [contextualTyping16.js] -var foo = { - id: 4 -}; -foo = { - id: 5 -}; +var foo = { id: 4 }; +foo = { id: 5 }; diff --git a/tests/baselines/reference/contextualTyping17.js b/tests/baselines/reference/contextualTyping17.js index 2e433cd4dfd..0ae2605dbd6 100644 --- a/tests/baselines/reference/contextualTyping17.js +++ b/tests/baselines/reference/contextualTyping17.js @@ -2,10 +2,5 @@ var foo: {id:number;} = {id:4}; foo = {id: 5, name:"foo"}; //// [contextualTyping17.js] -var foo = { - id: 4 -}; -foo = { - id: 5, - name: "foo" -}; +var foo = { id: 4 }; +foo = { id: 5, name: "foo" }; diff --git a/tests/baselines/reference/contextualTyping18.js b/tests/baselines/reference/contextualTyping18.js index 7289d73ba18..fb058032ed2 100644 --- a/tests/baselines/reference/contextualTyping18.js +++ b/tests/baselines/reference/contextualTyping18.js @@ -3,6 +3,4 @@ var foo: {id:number;} = <{id:number;}>({ }); foo = {id: 5}; //// [contextualTyping18.js] var foo = ({}); -foo = { - id: 5 -}; +foo = { id: 5 }; diff --git a/tests/baselines/reference/contextualTyping19.js b/tests/baselines/reference/contextualTyping19.js index 2b70fc19767..e4e51372858 100644 --- a/tests/baselines/reference/contextualTyping19.js +++ b/tests/baselines/reference/contextualTyping19.js @@ -2,16 +2,5 @@ var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, {id:2}]; //// [contextualTyping19.js] -var foo = [ - { - id: 1 - } -]; -foo = [ - { - id: 1 - }, - { - id: 2 - } -]; +var foo = [{ id: 1 }]; +foo = [{ id: 1 }, { id: 2 }]; diff --git a/tests/baselines/reference/contextualTyping2.js b/tests/baselines/reference/contextualTyping2.js index 4240ce23a1f..4dc3f71e9b0 100644 --- a/tests/baselines/reference/contextualTyping2.js +++ b/tests/baselines/reference/contextualTyping2.js @@ -2,7 +2,4 @@ var foo: {id:number;} = {id:4, name:"foo"}; //// [contextualTyping2.js] -var foo = { - id: 4, - name: "foo" -}; +var foo = { id: 4, name: "foo" }; diff --git a/tests/baselines/reference/contextualTyping20.js b/tests/baselines/reference/contextualTyping20.js index e2afa7a21ff..f53a7f7554b 100644 --- a/tests/baselines/reference/contextualTyping20.js +++ b/tests/baselines/reference/contextualTyping20.js @@ -2,17 +2,5 @@ var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, {id:2, name:"foo"}]; //// [contextualTyping20.js] -var foo = [ - { - id: 1 - } -]; -foo = [ - { - id: 1 - }, - { - id: 2, - name: "foo" - } -]; +var foo = [{ id: 1 }]; +foo = [{ id: 1 }, { id: 2, name: "foo" }]; diff --git a/tests/baselines/reference/contextualTyping21.js b/tests/baselines/reference/contextualTyping21.js index 6c3aa6e885f..3d87d9e4245 100644 --- a/tests/baselines/reference/contextualTyping21.js +++ b/tests/baselines/reference/contextualTyping21.js @@ -2,14 +2,5 @@ var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, 1]; //// [contextualTyping21.js] -var foo = [ - { - id: 1 - } -]; -foo = [ - { - id: 1 - }, - 1 -]; +var foo = [{ id: 1 }]; +foo = [{ id: 1 }, 1]; diff --git a/tests/baselines/reference/contextualTyping22.js b/tests/baselines/reference/contextualTyping22.js index b8ebfd3ecb7..3c9a5cb4d3e 100644 --- a/tests/baselines/reference/contextualTyping22.js +++ b/tests/baselines/reference/contextualTyping22.js @@ -2,9 +2,5 @@ var foo:(a:number)=>number = function(a){return a}; foo = function(b){return b}; //// [contextualTyping22.js] -var foo = function (a) { - return a; -}; -foo = function (b) { - return b; -}; +var foo = function (a) { return a; }; +foo = function (b) { return b; }; diff --git a/tests/baselines/reference/contextualTyping23.js b/tests/baselines/reference/contextualTyping23.js index 187fd3f86d3..0207f6af15d 100644 --- a/tests/baselines/reference/contextualTyping23.js +++ b/tests/baselines/reference/contextualTyping23.js @@ -3,6 +3,4 @@ var foo:(a:{():number; (i:number):number; })=>number; foo = function(a){return 5 //// [contextualTyping23.js] var foo; -foo = function (a) { - return 5; -}; +foo = function (a) { return 5; }; diff --git a/tests/baselines/reference/contextualTyping24.js b/tests/baselines/reference/contextualTyping24.js index 170a6983b9f..04c4ecba21b 100644 --- a/tests/baselines/reference/contextualTyping24.js +++ b/tests/baselines/reference/contextualTyping24.js @@ -3,6 +3,4 @@ var foo:(a:{():number; (i:number):number; })=>number; foo = function(a:string){r //// [contextualTyping24.js] var foo; -foo = function (a) { - return 5; -}; +foo = function (a) { return 5; }; diff --git a/tests/baselines/reference/contextualTyping25.js b/tests/baselines/reference/contextualTyping25.js index 808ee2202ec..f90a70098d7 100644 --- a/tests/baselines/reference/contextualTyping25.js +++ b/tests/baselines/reference/contextualTyping25.js @@ -2,7 +2,6 @@ function foo(param:{id:number;}){}; foo(<{id:number;}>({})); //// [contextualTyping25.js] -function foo(param) { -} +function foo(param) { } ; foo(({})); diff --git a/tests/baselines/reference/contextualTyping26.js b/tests/baselines/reference/contextualTyping26.js index fabd810c8f5..feacf3da328 100644 --- a/tests/baselines/reference/contextualTyping26.js +++ b/tests/baselines/reference/contextualTyping26.js @@ -2,7 +2,6 @@ function foo(param:{id:number;}){}; foo(<{id:number;}>({})); //// [contextualTyping26.js] -function foo(param) { -} +function foo(param) { } ; foo(({})); diff --git a/tests/baselines/reference/contextualTyping27.js b/tests/baselines/reference/contextualTyping27.js index 11b8c251416..ce35e606196 100644 --- a/tests/baselines/reference/contextualTyping27.js +++ b/tests/baselines/reference/contextualTyping27.js @@ -2,7 +2,6 @@ function foo(param:{id:number;}){}; foo(<{id:number;}>({})); //// [contextualTyping27.js] -function foo(param) { -} +function foo(param) { } ; foo(({})); diff --git a/tests/baselines/reference/contextualTyping28.js b/tests/baselines/reference/contextualTyping28.js index a9dd848a2c0..095e3812400 100644 --- a/tests/baselines/reference/contextualTyping28.js +++ b/tests/baselines/reference/contextualTyping28.js @@ -2,9 +2,6 @@ function foo(param:number[]){}; foo([1]); //// [contextualTyping28.js] -function foo(param) { -} +function foo(param) { } ; -foo([ - 1 -]); +foo([1]); diff --git a/tests/baselines/reference/contextualTyping29.js b/tests/baselines/reference/contextualTyping29.js index cf3a8e340a1..1d5b32c208d 100644 --- a/tests/baselines/reference/contextualTyping29.js +++ b/tests/baselines/reference/contextualTyping29.js @@ -2,10 +2,6 @@ function foo(param:number[]){}; foo([1, 3]); //// [contextualTyping29.js] -function foo(param) { -} +function foo(param) { } ; -foo([ - 1, - 3 -]); +foo([1, 3]); diff --git a/tests/baselines/reference/contextualTyping3.js b/tests/baselines/reference/contextualTyping3.js index 8ea5481037d..19d71f4ca71 100644 --- a/tests/baselines/reference/contextualTyping3.js +++ b/tests/baselines/reference/contextualTyping3.js @@ -4,9 +4,7 @@ class foo { public bar:{id:number;} = {id:5}; } //// [contextualTyping3.js] var foo = (function () { function foo() { - this.bar = { - id: 5 - }; + this.bar = { id: 5 }; } return foo; })(); diff --git a/tests/baselines/reference/contextualTyping30.js b/tests/baselines/reference/contextualTyping30.js index 25b8d9c6f55..94547a387d7 100644 --- a/tests/baselines/reference/contextualTyping30.js +++ b/tests/baselines/reference/contextualTyping30.js @@ -2,10 +2,6 @@ function foo(param:number[]){}; foo([1, "a"]); //// [contextualTyping30.js] -function foo(param) { -} +function foo(param) { } ; -foo([ - 1, - "a" -]); +foo([1, "a"]); diff --git a/tests/baselines/reference/contextualTyping31.js b/tests/baselines/reference/contextualTyping31.js index 0e29d9f68c0..1eb4d5660fc 100644 --- a/tests/baselines/reference/contextualTyping31.js +++ b/tests/baselines/reference/contextualTyping31.js @@ -2,9 +2,6 @@ function foo(param:number[]){}; foo([1]); //// [contextualTyping31.js] -function foo(param) { -} +function foo(param) { } ; -foo([ - 1 -]); +foo([1]); diff --git a/tests/baselines/reference/contextualTyping32.js b/tests/baselines/reference/contextualTyping32.js index 8a47a109aec..bbbafa70796 100644 --- a/tests/baselines/reference/contextualTyping32.js +++ b/tests/baselines/reference/contextualTyping32.js @@ -2,14 +2,6 @@ function foo(param: {():number; (i:number):number; }[]) { }; foo([function(){return 1;}, function(){return 4}]); //// [contextualTyping32.js] -function foo(param) { -} +function foo(param) { } ; -foo([ - function () { - return 1; - }, - function () { - return 4; - } -]); +foo([function () { return 1; }, function () { return 4; }]); diff --git a/tests/baselines/reference/contextualTyping33.js b/tests/baselines/reference/contextualTyping33.js index 9ee3245416f..1d800b1d113 100644 --- a/tests/baselines/reference/contextualTyping33.js +++ b/tests/baselines/reference/contextualTyping33.js @@ -2,14 +2,6 @@ function foo(param: {():number; (i:number):number; }[]) { }; foo([function(){return 1;}, function(){return "foo"}]); //// [contextualTyping33.js] -function foo(param) { -} +function foo(param) { } ; -foo([ - function () { - return 1; - }, - function () { - return "foo"; - } -]); +foo([function () { return 1; }, function () { return "foo"; }]); diff --git a/tests/baselines/reference/contextualTyping34.js b/tests/baselines/reference/contextualTyping34.js index fc801d3cd7e..5e12ba602ae 100644 --- a/tests/baselines/reference/contextualTyping34.js +++ b/tests/baselines/reference/contextualTyping34.js @@ -2,6 +2,4 @@ var foo = <{ id: number;}> ({id:4}); //// [contextualTyping34.js] -var foo = ({ - id: 4 -}); +var foo = ({ id: 4 }); diff --git a/tests/baselines/reference/contextualTyping35.js b/tests/baselines/reference/contextualTyping35.js index bf9e02dd903..34d9e6b39a8 100644 --- a/tests/baselines/reference/contextualTyping35.js +++ b/tests/baselines/reference/contextualTyping35.js @@ -2,7 +2,4 @@ var foo = <{ id: number;}> {id:4, name: "as"}; //// [contextualTyping35.js] -var foo = { - id: 4, - name: "as" -}; +var foo = { id: 4, name: "as" }; diff --git a/tests/baselines/reference/contextualTyping36.js b/tests/baselines/reference/contextualTyping36.js index 623a1e92ad2..3bdaf5a8d05 100644 --- a/tests/baselines/reference/contextualTyping36.js +++ b/tests/baselines/reference/contextualTyping36.js @@ -2,9 +2,4 @@ var foo = <{ id: number; }[]>[{ id: 4 }, <{ id: number; }>({ })]; //// [contextualTyping36.js] -var foo = [ - { - id: 4 - }, - ({}) -]; +var foo = [{ id: 4 }, ({})]; diff --git a/tests/baselines/reference/contextualTyping37.js b/tests/baselines/reference/contextualTyping37.js index 2f2636579bf..4bb6e7b350f 100644 --- a/tests/baselines/reference/contextualTyping37.js +++ b/tests/baselines/reference/contextualTyping37.js @@ -2,9 +2,4 @@ var foo = <{ id: number; }[]>[{ foo: "s" }, { }]; //// [contextualTyping37.js] -var foo = [ - { - foo: "s" - }, - {} -]; +var foo = [{ foo: "s" }, {}]; diff --git a/tests/baselines/reference/contextualTyping38.js b/tests/baselines/reference/contextualTyping38.js index 71ed8ece57d..9bed543ff7f 100644 --- a/tests/baselines/reference/contextualTyping38.js +++ b/tests/baselines/reference/contextualTyping38.js @@ -2,6 +2,4 @@ var foo = <{ (): number; }> function(a) { return a }; //// [contextualTyping38.js] -var foo = function (a) { - return a; -}; +var foo = function (a) { return a; }; diff --git a/tests/baselines/reference/contextualTyping39.js b/tests/baselines/reference/contextualTyping39.js index 9a97b7eb3cc..89d045830a3 100644 --- a/tests/baselines/reference/contextualTyping39.js +++ b/tests/baselines/reference/contextualTyping39.js @@ -2,6 +2,4 @@ var foo = <{ (): number; }> function() { return "err"; }; //// [contextualTyping39.js] -var foo = function () { - return "err"; -}; +var foo = function () { return "err"; }; diff --git a/tests/baselines/reference/contextualTyping4.js b/tests/baselines/reference/contextualTyping4.js index 902791adcbc..af79e3732f2 100644 --- a/tests/baselines/reference/contextualTyping4.js +++ b/tests/baselines/reference/contextualTyping4.js @@ -4,10 +4,7 @@ class foo { public bar:{id:number;} = {id:5, name:"foo"}; } //// [contextualTyping4.js] var foo = (function () { function foo() { - this.bar = { - id: 5, - name: "foo" - }; + this.bar = { id: 5, name: "foo" }; } return foo; })(); diff --git a/tests/baselines/reference/contextualTyping40.js b/tests/baselines/reference/contextualTyping40.js index ba2c447b10f..0b98f8e45c6 100644 --- a/tests/baselines/reference/contextualTyping40.js +++ b/tests/baselines/reference/contextualTyping40.js @@ -2,6 +2,4 @@ var foo = <{():number; (i:number):number; }> function(){return 1;}; //// [contextualTyping40.js] -var foo = function () { - return 1; -}; +var foo = function () { return 1; }; diff --git a/tests/baselines/reference/contextualTyping41.js b/tests/baselines/reference/contextualTyping41.js index 720f1d178f6..8bce7918dd2 100644 --- a/tests/baselines/reference/contextualTyping41.js +++ b/tests/baselines/reference/contextualTyping41.js @@ -2,6 +2,4 @@ var foo = <{():number; (i:number):number; }> (function(){return "err";}); //// [contextualTyping41.js] -var foo = (function () { - return "err"; -}); +var foo = (function () { return "err"; }); diff --git a/tests/baselines/reference/contextualTyping6.js b/tests/baselines/reference/contextualTyping6.js index c1fb58d4d2d..df2d2ac15cb 100644 --- a/tests/baselines/reference/contextualTyping6.js +++ b/tests/baselines/reference/contextualTyping6.js @@ -2,11 +2,4 @@ var foo:{id:number;}[] = [{id:1}, {id:2}]; //// [contextualTyping6.js] -var foo = [ - { - id: 1 - }, - { - id: 2 - } -]; +var foo = [{ id: 1 }, { id: 2 }]; diff --git a/tests/baselines/reference/contextualTyping7.js b/tests/baselines/reference/contextualTyping7.js index 6b93e7308d5..2cd2494c3bf 100644 --- a/tests/baselines/reference/contextualTyping7.js +++ b/tests/baselines/reference/contextualTyping7.js @@ -2,6 +2,4 @@ var foo:{id:number;}[] = [<{id:number;}>({})]; //// [contextualTyping7.js] -var foo = [ - ({}) -]; +var foo = [({})]; diff --git a/tests/baselines/reference/contextualTyping8.js b/tests/baselines/reference/contextualTyping8.js index 276b32bed68..a0e3b5b9ef5 100644 --- a/tests/baselines/reference/contextualTyping8.js +++ b/tests/baselines/reference/contextualTyping8.js @@ -2,6 +2,4 @@ var foo:{id:number;}[] = [<{id:number;}>({})]; //// [contextualTyping8.js] -var foo = [ - ({}) -]; +var foo = [({})]; diff --git a/tests/baselines/reference/contextualTyping9.js b/tests/baselines/reference/contextualTyping9.js index 19d0f0fba79..71384cf8b04 100644 --- a/tests/baselines/reference/contextualTyping9.js +++ b/tests/baselines/reference/contextualTyping9.js @@ -2,12 +2,4 @@ var foo:{id:number;}[] = [{id:1}, {id:2, name:"foo"}]; //// [contextualTyping9.js] -var foo = [ - { - id: 1 - }, - { - id: 2, - name: "foo" - } -]; +var foo = [{ id: 1 }, { id: 2, name: "foo" }]; diff --git a/tests/baselines/reference/contextualTypingArrayOfLambdas.js b/tests/baselines/reference/contextualTypingArrayOfLambdas.js index b9ea5beaa77..844a50428e2 100644 --- a/tests/baselines/reference/contextualTypingArrayOfLambdas.js +++ b/tests/baselines/reference/contextualTypingArrayOfLambdas.js @@ -40,11 +40,4 @@ var C = (function (_super) { } return C; })(A); -var xs = [ - function (x) { - }, - function (x) { - }, - function (x) { - } -]; +var xs = [function (x) { }, function (x) { }, function (x) { }]; diff --git a/tests/baselines/reference/contextualTypingOfAccessors.js b/tests/baselines/reference/contextualTypingOfAccessors.js index 0f45574be99..f785d19636c 100644 --- a/tests/baselines/reference/contextualTypingOfAccessors.js +++ b/tests/baselines/reference/contextualTypingOfAccessors.js @@ -18,10 +18,7 @@ x = { var x; x = { get foo() { - return function (n) { - return n; - }; + return function (n) { return n; }; }, - set foo(x) { - } + set foo(x) { } }; diff --git a/tests/baselines/reference/contextualTypingOfArrayLiterals1.js b/tests/baselines/reference/contextualTypingOfArrayLiterals1.js index e2edcb3d5df..e7513093402 100644 --- a/tests/baselines/reference/contextualTypingOfArrayLiterals1.js +++ b/tests/baselines/reference/contextualTypingOfArrayLiterals1.js @@ -9,9 +9,6 @@ r2.getDate(); //// [contextualTypingOfArrayLiterals1.js] -var x3 = [ - new Date(), - 1 -]; +var x3 = [new Date(), 1]; var r2 = x3[1]; r2.getDate(); diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression.js b/tests/baselines/reference/contextualTypingOfConditionalExpression.js index 805ffca7508..b1100ba80a9 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression.js +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression.js @@ -21,11 +21,7 @@ var __extends = this.__extends || function (d, b) { __.prototype = b.prototype; d.prototype = new __(); }; -var x = true ? function (a) { - return a.toExponential(); -} : function (b) { - return b.toFixed(); -}; +var x = true ? function (a) { return a.toExponential(); } : function (b) { return b.toFixed(); }; var A = (function () { function A() { } @@ -45,8 +41,4 @@ var C = (function (_super) { } return C; })(A); -var x2 = true ? function (a) { - return a.foo; -} : function (b) { - return b.foo; -}; +var x2 = true ? function (a) { return a.foo; } : function (b) { return b.foo; }; diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression2.js b/tests/baselines/reference/contextualTypingOfConditionalExpression2.js index c84fa87e817..f832d2766ee 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression2.js +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression2.js @@ -38,7 +38,4 @@ var C = (function (_super) { } return C; })(A); -var x2 = true ? function (a) { - return a.foo; -} : function (b) { -}; +var x2 = true ? function (a) { return a.foo; } : function (b) { }; diff --git a/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.js b/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.js index b2a8bf0dba1..8142b51dcdd 100644 --- a/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.js +++ b/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.js @@ -22,10 +22,6 @@ var r6 = _.forEach(c2, (x) => { return x.toFixed() }); var c2; var _; // errors on all 3 lines, bug was that r5 was the only line with errors -var f = function (x) { - return x.toFixed(); -}; +var f = function (x) { return x.toFixed(); }; var r5 = _.forEach(c2, f); -var r6 = _.forEach(c2, function (x) { - return x.toFixed(); -}); +var r6 = _.forEach(c2, function (x) { return x.toFixed(); }); diff --git a/tests/baselines/reference/contextualTypingOfLambdaReturnExpression.js b/tests/baselines/reference/contextualTypingOfLambdaReturnExpression.js index ecc6a0ecd16..67670bf872e 100644 --- a/tests/baselines/reference/contextualTypingOfLambdaReturnExpression.js +++ b/tests/baselines/reference/contextualTypingOfLambdaReturnExpression.js @@ -7,11 +7,6 @@ callb((a) => a.length); // Ok, we choose the second overload because the first o callb((a) => { a.length; }); // Error, we picked the first overload and errored when type checking the lambda body //// [contextualTypingOfLambdaReturnExpression.js] -function callb(a) { -} -callb(function (a) { - return a.length; -}); // Ok, we choose the second overload because the first one gave us an error when trying to resolve the lambda return type -callb(function (a) { - a.length; -}); // Error, we picked the first overload and errored when type checking the lambda body +function callb(a) { } +callb(function (a) { return a.length; }); // Ok, we choose the second overload because the first one gave us an error when trying to resolve the lambda return type +callb(function (a) { a.length; }); // Error, we picked the first overload and errored when type checking the lambda body diff --git a/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures.js b/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures.js index 400a052a7bb..f21bc852af8 100644 --- a/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures.js +++ b/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures.js @@ -9,5 +9,4 @@ foo.getFoo = bar => { }; //// [contextualTypingOfLambdaWithMultipleSignatures.js] var foo; -foo.getFoo = function (bar) { -}; +foo.getFoo = function (bar) { }; diff --git a/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures2.js b/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures2.js index 415fc3acd2e..442ded4ba75 100644 --- a/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures2.js +++ b/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures2.js @@ -8,6 +8,4 @@ f = (a) => { return a.asdf } //// [contextualTypingOfLambdaWithMultipleSignatures2.js] var f; -f = function (a) { - return a.asdf; -}; +f = function (a) { return a.asdf; }; diff --git a/tests/baselines/reference/contextualTypingOfObjectLiterals.js b/tests/baselines/reference/contextualTypingOfObjectLiterals.js index d965ef5828c..e267ce6269e 100644 --- a/tests/baselines/reference/contextualTypingOfObjectLiterals.js +++ b/tests/baselines/reference/contextualTypingOfObjectLiterals.js @@ -12,13 +12,10 @@ f(obj2); // Error - indexer doesn't match //// [contextualTypingOfObjectLiterals.js] var obj1; -var obj2 = { - x: "" -}; +var obj2 = { x: "" }; obj1 = {}; // Ok obj1 = obj2; // Error - indexer doesn't match -function f(x) { -} +function f(x) { } f({}); // Ok f(obj1); // Ok f(obj2); // Error - indexer doesn't match diff --git a/tests/baselines/reference/contextualTypingOfObjectLiterals2.js b/tests/baselines/reference/contextualTypingOfObjectLiterals2.js index f709890c550..4c450d31152 100644 --- a/tests/baselines/reference/contextualTypingOfObjectLiterals2.js +++ b/tests/baselines/reference/contextualTypingOfObjectLiterals2.js @@ -6,10 +6,5 @@ function f2(args: Foo) { } f2({ foo: s => s.hmm }) // 's' should be 'string', so this should be an error //// [contextualTypingOfObjectLiterals2.js] -function f2(args) { -} -f2({ - foo: function (s) { - return s.hmm; - } -}); // 's' should be 'string', so this should be an error +function f2(args) { } +f2({ foo: function (s) { return s.hmm; } }); // 's' should be 'string', so this should be an error diff --git a/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.js b/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.js index 96e8f860358..4b392bac80a 100644 --- a/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.js +++ b/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.js @@ -8,8 +8,4 @@ f6(x => f6(y => x = y)); function f6(x) { return null; } -f6(function (x) { - return f6(function (y) { - return x = y; - }); -}); +f6(function (x) { return f6(function (y) { return x = y; }); }); diff --git a/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.js b/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.js index f8804547d46..55f7580b3f8 100644 --- a/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.js +++ b/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.js @@ -5,13 +5,5 @@ var r9 = f10('', () => (a => a.foo), 1); // error //// [contextualTypingWithFixedTypeParameters1.js] var f10; -f10('', function () { - return function (a) { - return a.foo; - }; -}, ''); // a is string -var r9 = f10('', function () { - return (function (a) { - return a.foo; - }); -}, 1); // error +f10('', function () { return function (a) { return a.foo; }; }, ''); // a is string +var r9 = f10('', function () { return (function (a) { return a.foo; }); }, 1); // error diff --git a/tests/baselines/reference/contextualTypingWithGenericAndNonGenericSignature.js b/tests/baselines/reference/contextualTypingWithGenericAndNonGenericSignature.js index f548b6daaad..5ee0c758022 100644 --- a/tests/baselines/reference/contextualTypingWithGenericAndNonGenericSignature.js +++ b/tests/baselines/reference/contextualTypingWithGenericAndNonGenericSignature.js @@ -19,10 +19,6 @@ f3 = (x, y) => { return x } //// [contextualTypingWithGenericAndNonGenericSignature.js] //• If e is a FunctionExpression or ArrowFunctionExpression with no type parameters and no parameter or return type annotations, and T is a function type with EXACTLY ONE non - generic call signature, then any inferences made for type parameters referenced by the parameters of T’s call signature are fixed(section 4.12.2) and e is processed with the contextual type T, as described in section 4.9.3. var f2; -f2 = function (x, y) { - return x; -}; +f2 = function (x, y) { return x; }; var f3; -f3 = function (x, y) { - return x; -}; +f3 = function (x, y) { return x; }; diff --git a/tests/baselines/reference/contextualTypingWithGenericSignature.js b/tests/baselines/reference/contextualTypingWithGenericSignature.js index a1417e90b43..611a35f38ac 100644 --- a/tests/baselines/reference/contextualTypingWithGenericSignature.js +++ b/tests/baselines/reference/contextualTypingWithGenericSignature.js @@ -10,6 +10,4 @@ f2 = (x, y) => { return x } //// [contextualTypingWithGenericSignature.js] // If e is a FunctionExpression or ArrowFunctionExpression with no type parameters and no parameter or return type annotations, and T is a function type with EXACTLY ONE non - generic call signature, then any inferences made for type parameters referenced by the parameters of T’s call signature are fixed(section 4.12.2) and e is processed with the contextual type T, as described in section 4.9.3. var f2; -f2 = function (x, y) { - return x; -}; +f2 = function (x, y) { return x; }; diff --git a/tests/baselines/reference/contextuallyTypingOrOperator.js b/tests/baselines/reference/contextuallyTypingOrOperator.js index 6ffd81b1e03..6dc3e09bf89 100644 --- a/tests/baselines/reference/contextuallyTypingOrOperator.js +++ b/tests/baselines/reference/contextuallyTypingOrOperator.js @@ -7,27 +7,7 @@ var v3 = (s: string) => s.length || function (s: number) { return 1 }; var v4 = (s: number) => 1 || function (s: string) { return s.length }; //// [contextuallyTypingOrOperator.js] -var v = { - a: function (s) { - return s.length; - } -} || { - a: function (s) { - return 1; - } -}; -var v2 = function (s) { - return s.length || function (s) { - s.length; - }; -}; -var v3 = function (s) { - return s.length || function (s) { - return 1; - }; -}; -var v4 = function (s) { - return 1 || function (s) { - return s.length; - }; -}; +var v = { a: function (s) { return s.length; } } || { a: function (s) { return 1; } }; +var v2 = function (s) { return s.length || function (s) { s.length; }; }; +var v3 = function (s) { return s.length || function (s) { return 1; }; }; +var v4 = function (s) { return 1 || function (s) { return s.length; }; }; diff --git a/tests/baselines/reference/contextuallyTypingOrOperator2.js b/tests/baselines/reference/contextuallyTypingOrOperator2.js index 0b4dfa46bc4..fa850929b3e 100644 --- a/tests/baselines/reference/contextuallyTypingOrOperator2.js +++ b/tests/baselines/reference/contextuallyTypingOrOperator2.js @@ -4,17 +4,5 @@ var v: { a: (_: string) => number } = { a: s => s.length } || { a: s => 1 }; var v2 = (s: string) => s.length || function (s) { s.aaa }; //// [contextuallyTypingOrOperator2.js] -var v = { - a: function (s) { - return s.length; - } -} || { - a: function (s) { - return 1; - } -}; -var v2 = function (s) { - return s.length || function (s) { - s.aaa; - }; -}; +var v = { a: function (s) { return s.length; } } || { a: function (s) { return 1; } }; +var v2 = function (s) { return s.length || function (s) { s.aaa; }; }; diff --git a/tests/baselines/reference/convertKeywordsYes.errors.txt b/tests/baselines/reference/convertKeywordsYes.errors.txt new file mode 100644 index 00000000000..932fda09be8 --- /dev/null +++ b/tests/baselines/reference/convertKeywordsYes.errors.txt @@ -0,0 +1,353 @@ +tests/cases/compiler/convertKeywordsYes.ts(293,11): error TS1005: '{' expected. +tests/cases/compiler/convertKeywordsYes.ts(293,21): error TS1005: ';' expected. +tests/cases/compiler/convertKeywordsYes.ts(294,11): error TS1005: '{' expected. +tests/cases/compiler/convertKeywordsYes.ts(296,11): error TS1005: '{' expected. +tests/cases/compiler/convertKeywordsYes.ts(296,19): error TS1005: ';' expected. +tests/cases/compiler/convertKeywordsYes.ts(297,11): error TS1005: '{' expected. +tests/cases/compiler/convertKeywordsYes.ts(297,19): error TS1005: ';' expected. +tests/cases/compiler/convertKeywordsYes.ts(298,11): error TS1005: '{' expected. +tests/cases/compiler/convertKeywordsYes.ts(298,21): error TS1005: ';' expected. +tests/cases/compiler/convertKeywordsYes.ts(299,11): error TS1005: '{' expected. +tests/cases/compiler/convertKeywordsYes.ts(299,18): error TS1005: ';' expected. +tests/cases/compiler/convertKeywordsYes.ts(301,11): error TS1005: '{' expected. +tests/cases/compiler/convertKeywordsYes.ts(301,18): error TS1005: ';' expected. +tests/cases/compiler/convertKeywordsYes.ts(303,11): error TS1005: '{' expected. +tests/cases/compiler/convertKeywordsYes.ts(303,17): error TS1005: ';' expected. + + +==== tests/cases/compiler/convertKeywordsYes.ts (15 errors) ==== + // reserved ES5 future in strict mode + + var constructor = 0; + var any = 0; + var boolean = 0; + var implements = 0; + var interface = 0; + var let = 0; + var module = 0; + var number = 0; + var package = 0; + var private = 0; + var protected = 0; + var public = 0; + var set = 0; + var static = 0; + var string = 0; + var get = 0; + var yield = 0; + var declare = 0; + + function bigGeneric< + constructor, + implements , + interface , + let, + module , + package, + private , + protected, + public , + set , + static , + get , + yield, + declare + >(c: constructor, + a: any, + b2: boolean, + i: implements , + i2: interface , + l: let, + m: module , + n: number, + p: package, + p2: private , + p3: protected, + p4: public , + s: set , + s2: static , + s3: string, + g: get , + y: yield, + d: declare ) { } + + var bigObject = { + constructor: 0, + any: 0, + boolean: 0, + implements: 0, + interface: 0, + let: 0, + module: 0, + number: 0, + package: 0, + private: 0, + protected: 0, + public: 0, + set: 0, + static: 0, + string: 0, + get: 0, + yield: 0, + break: 0, + case: 0, + catch: 0, + class: 0, + continue: 0, + const: 0, + + debugger: 0, + declare: 0, + default: 0, + delete: 0, + do: 0, + else: 0, + enum: 0, + export: 0, + extends: 0, + false: 0, + finally: 0, + for: 0, + function: 0, + if: 0, + + import: 0, + in: 0, + instanceof: 0, + new: 0, + null: 0, + return: 0, + super: 0, + switch: 0, + this: 0, + throw: 0, + true: 0, + try: 0, + typeof: 0, + var: 0, + void: 0, + while: 0, + with: 0, + }; + + interface bigInterface { + constructor; + any; + boolean; + implements; + interface; + let; + module; + number; + package; + private; + protected; + public; + set; + static; + string; + get; + yield; + break; + case; + catch; + class; + continue; + const; + + debugger; + declare; + default; + delete; + do; + else; + enum; + export; + extends; + false; + finally; + for; + function; + if; + + import; + in; + instanceof; + new; + null; + return; + super; + switch; + this; + throw; + true; + try; + typeof; + var; + void; + while; + with; + } + + class bigClass { + public "constructor" = 0; + public any = 0; + public boolean = 0; + public implements = 0; + public interface = 0; + public let = 0; + public module = 0; + public number = 0; + public package = 0; + public private = 0; + public protected = 0; + public public = 0; + public set = 0; + public static = 0; + public string = 0; + public get = 0; + public yield = 0; + public break = 0; + public case = 0; + public catch = 0; + public class = 0; + public continue = 0; + public const = 0; + public debugger = 0; + public declare = 0; + public default = 0; + public delete = 0; + public do = 0; + public else = 0; + public enum = 0; + public export = 0; + public extends = 0; + public false = 0; + public finally = 0; + public for = 0; + public function = 0; + public if = 0; + public import = 0; + public in = 0; + public instanceof = 0; + public new = 0; + public null = 0; + public return = 0; + public super = 0; + public switch = 0; + public this = 0; + public throw = 0; + public true = 0; + public try = 0; + public typeof = 0; + public var = 0; + public void = 0; + public while = 0; + public with = 0; + } + + enum bigEnum { + constructor, + any, + boolean, + implements, + interface, + let, + module, + number, + package, + private, + protected, + public, + set, + static, + string, + get, + yield, + break, + case, + catch, + class, + continue, + const, + + debugger, + declare, + default, + delete, + do, + else, + enum, + export, + extends, + false, + finally, + for, + function, + if, + + import, + in, + instanceof, + new, + null, + return, + super, + switch, + this, + throw, + true, + try, + typeof, + var, + void, + while, + with, + } + + module bigModule { + class constructor { } + class implements { } + class interface { } + ~~~~~~~~~ +!!! error TS1005: '{' expected. + ~ +!!! error TS1005: ';' expected. + class let { } + ~~~ +!!! error TS1005: '{' expected. + class module { } + class package { } + ~~~~~~~ +!!! error TS1005: '{' expected. + ~ +!!! error TS1005: ';' expected. + class private { } + ~~~~~~~ +!!! error TS1005: '{' expected. + ~ +!!! error TS1005: ';' expected. + class protected { } + ~~~~~~~~~ +!!! error TS1005: '{' expected. + ~ +!!! error TS1005: ';' expected. + class public { } + ~~~~~~ +!!! error TS1005: '{' expected. + ~ +!!! error TS1005: ';' expected. + class set { } + class static { } + ~~~~~~ +!!! error TS1005: '{' expected. + ~ +!!! error TS1005: ';' expected. + class get { } + class yield { } + ~~~~~ +!!! error TS1005: '{' expected. + ~ +!!! error TS1005: ';' expected. + class declare { } + } \ No newline at end of file diff --git a/tests/baselines/reference/convertKeywordsYes.js b/tests/baselines/reference/convertKeywordsYes.js index deae65b54c9..2b17e744b66 100644 --- a/tests/baselines/reference/convertKeywordsYes.js +++ b/tests/baselines/reference/convertKeywordsYes.js @@ -325,8 +325,7 @@ var string = 0; var get = 0; var yield = 0; var declare = 0; -function bigGeneric(c, a, b2, i, i2, l, m, n, p, p2, p3, p4, s, s2, s3, g, y, d) { -} +function bigGeneric(c, a, b2, i, i2, l, m, n, p, p2, p3, p4, s, s2, s3, g, y, d) { } var bigObject = { constructor: 0, any: 0, @@ -506,66 +505,81 @@ var bigModule; } return constructor; })(); - var implements = (function () { - function implements() { + var default_1 = (function () { + function default_1() { } - return implements; + return default_1; })(); - var interface = (function () { - function interface() { + var default_2 = (function () { + function default_2() { } - return interface; + return default_2; })(); - var let = (function () { - function let() { + interface; + { } + var default_3 = (function () { + function default_3() { } - return let; + return default_3; })(); + var _a = void 0; var module = (function () { function module() { } return module; })(); - var package = (function () { - function package() { + var default_4 = (function () { + function default_4() { } - return package; + return default_4; })(); - var private = (function () { - function private() { + package; + { } + var default_5 = (function () { + function default_5() { } - return private; + return default_5; })(); - var protected = (function () { - function protected() { + private; + { } + var default_6 = (function () { + function default_6() { } - return protected; + return default_6; })(); - var public = (function () { - function public() { + protected; + { } + var default_7 = (function () { + function default_7() { } - return public; + return default_7; })(); + public; + { } var set = (function () { function set() { } return set; })(); - var static = (function () { - function static() { + var default_8 = (function () { + function default_8() { } - return static; + return default_8; })(); + static; + { } var get = (function () { function get() { } return get; })(); - var yield = (function () { - function yield() { + var default_9 = (function () { + function default_9() { } - return yield; + return default_9; })(); + yield; + { } var declare = (function () { function declare() { } diff --git a/tests/baselines/reference/convertKeywordsYes.types b/tests/baselines/reference/convertKeywordsYes.types deleted file mode 100644 index af2e0766181..00000000000 --- a/tests/baselines/reference/convertKeywordsYes.types +++ /dev/null @@ -1,879 +0,0 @@ -=== tests/cases/compiler/convertKeywordsYes.ts === -// reserved ES5 future in strict mode - -var constructor = 0; ->constructor : number - -var any = 0; ->any : number - -var boolean = 0; ->boolean : number - -var implements = 0; ->implements : number - -var interface = 0; ->interface : number - -var let = 0; ->let : number - -var module = 0; ->module : number - -var number = 0; ->number : number - -var package = 0; ->package : number - -var private = 0; ->private : number - -var protected = 0; ->protected : number - -var public = 0; ->public : number - -var set = 0; ->set : number - -var static = 0; ->static : number - -var string = 0; ->string : number - -var get = 0; ->get : number - -var yield = 0; ->yield : number - -var declare = 0; ->declare : number - -function bigGeneric< ->bigGeneric : (c: constructor, a: any, b2: boolean, i: implements, i2: interface, l: let, m: module, n: number, p: package, p2: private, p3: protected, p4: public, s: set, s2: static, s3: string, g: get, y: yield, d: declare) => void - - constructor, ->constructor : constructor - - implements , ->implements : implements - - interface , ->interface : interface - - let, ->let : let - - module , ->module : module - - package, ->package : package - - private , ->private : private - - protected, ->protected : protected - - public , ->public : public - - set , ->set : set - - static , ->static : static - - get , ->get : get - - yield, ->yield : yield - - declare ->declare : declare - - >(c: constructor, ->c : constructor ->constructor : constructor - - a: any, ->a : any - - b2: boolean, ->b2 : boolean - - i: implements , ->i : implements ->implements : implements - - i2: interface , ->i2 : interface ->interface : interface - - l: let, ->l : let ->let : let - - m: module , ->m : module ->module : module - - n: number, ->n : number - - p: package, ->p : package ->package : package - - p2: private , ->p2 : private ->private : private - - p3: protected, ->p3 : protected ->protected : protected - - p4: public , ->p4 : public ->public : public - - s: set , ->s : set ->set : set - - s2: static , ->s2 : static ->static : static - - s3: string, ->s3 : string - - g: get , ->g : get ->get : get - - y: yield, ->y : yield ->yield : yield - - d: declare ) { } ->d : declare ->declare : declare - -var bigObject = { ->bigObject : { constructor: number; any: number; boolean: number; implements: number; interface: number; let: number; module: number; number: number; package: number; private: number; protected: number; public: number; set: number; static: number; string: number; get: number; yield: number; break: number; case: number; catch: number; class: number; continue: number; const: number; debugger: number; declare: number; default: number; delete: number; do: number; else: number; enum: number; export: number; extends: number; false: number; finally: number; for: number; function: number; if: number; import: number; in: number; instanceof: number; new: number; null: number; return: number; super: number; switch: number; this: number; throw: number; true: number; try: number; typeof: number; var: number; void: number; while: number; with: number; } ->{ constructor: 0, any: 0, boolean: 0, implements: 0, interface: 0, let: 0, module: 0, number: 0, package: 0, private: 0, protected: 0, public: 0, set: 0, static: 0, string: 0, get: 0, yield: 0, break: 0, case: 0, catch: 0, class: 0, continue: 0, const: 0, debugger: 0, declare: 0, default: 0, delete: 0, do: 0, else: 0, enum: 0, export: 0, extends: 0, false: 0, finally: 0, for: 0, function: 0, if: 0, import: 0, in: 0, instanceof: 0, new: 0, null: 0, return: 0, super: 0, switch: 0, this: 0, throw: 0, true: 0, try: 0, typeof: 0, var: 0, void: 0, while: 0, with: 0,} : { constructor: number; any: number; boolean: number; implements: number; interface: number; let: number; module: number; number: number; package: number; private: number; protected: number; public: number; set: number; static: number; string: number; get: number; yield: number; break: number; case: number; catch: number; class: number; continue: number; const: number; debugger: number; declare: number; default: number; delete: number; do: number; else: number; enum: number; export: number; extends: number; false: number; finally: number; for: number; function: number; if: number; import: number; in: number; instanceof: number; new: number; null: number; return: number; super: number; switch: number; this: number; throw: number; true: number; try: number; typeof: number; var: number; void: number; while: number; with: number; } - - constructor: 0, ->constructor : number - - any: 0, ->any : number - - boolean: 0, ->boolean : number - - implements: 0, ->implements : number - - interface: 0, ->interface : number - - let: 0, ->let : number - - module: 0, ->module : number - - number: 0, ->number : number - - package: 0, ->package : number - - private: 0, ->private : number - - protected: 0, ->protected : number - - public: 0, ->public : number - - set: 0, ->set : number - - static: 0, ->static : number - - string: 0, ->string : number - - get: 0, ->get : number - - yield: 0, ->yield : number - - break: 0, ->break : number - - case: 0, ->case : number - - catch: 0, ->catch : number - - class: 0, ->class : number - - continue: 0, ->continue : number - - const: 0, ->const : number - - debugger: 0, ->debugger : number - - declare: 0, ->declare : number - - default: 0, ->default : number - - delete: 0, ->delete : number - - do: 0, ->do : number - - else: 0, ->else : number - - enum: 0, ->enum : number - - export: 0, ->export : number - - extends: 0, ->extends : number - - false: 0, ->false : number - - finally: 0, ->finally : number - - for: 0, ->for : number - - function: 0, ->function : number - - if: 0, ->if : number - - import: 0, ->import : number - - in: 0, ->in : number - - instanceof: 0, ->instanceof : number - - new: 0, ->new : number - - null: 0, ->null : number - - return: 0, ->return : number - - super: 0, ->super : number - - switch: 0, ->switch : number - - this: 0, ->this : number - - throw: 0, ->throw : number - - true: 0, ->true : number - - try: 0, ->try : number - - typeof: 0, ->typeof : number - - var: 0, ->var : number - - void: 0, ->void : number - - while: 0, ->while : number - - with: 0, ->with : number - -}; - -interface bigInterface { ->bigInterface : bigInterface - - constructor; ->constructor : any - - any; ->any : any - - boolean; ->boolean : any - - implements; ->implements : any - - interface; ->interface : any - - let; ->let : any - - module; ->module : any - - number; ->number : any - - package; ->package : any - - private; ->private : any - - protected; ->protected : any - - public; ->public : any - - set; ->set : any - - static; ->static : any - - string; ->string : any - - get; ->get : any - - yield; ->yield : any - - break; ->break : any - - case; ->case : any - - catch; ->catch : any - - class; ->class : any - - continue; ->continue : any - - const; ->const : any - - debugger; ->debugger : any - - declare; ->declare : any - - default; ->default : any - - delete; ->delete : any - - do; ->do : any - - else; ->else : any - - enum; ->enum : any - - export; ->export : any - - extends; ->extends : any - - false; ->false : any - - finally; ->finally : any - - for; ->for : any - - function; ->function : any - - if; ->if : any - - import; ->import : any - - in; ->in : any - - instanceof; ->instanceof : any - - new; ->new : any - - null; ->null : any - - return; ->return : any - - super; ->super : any - - switch; ->switch : any - - this; ->this : any - - throw; ->throw : any - - true; ->true : any - - try; ->try : any - - typeof; ->typeof : any - - var; ->var : any - - void; ->void : any - - while; ->while : any - - with; ->with : any -} - -class bigClass { ->bigClass : bigClass - - public "constructor" = 0; - public any = 0; ->any : number - - public boolean = 0; ->boolean : number - - public implements = 0; ->implements : number - - public interface = 0; ->interface : number - - public let = 0; ->let : number - - public module = 0; ->module : number - - public number = 0; ->number : number - - public package = 0; ->package : number - - public private = 0; ->private : number - - public protected = 0; ->protected : number - - public public = 0; ->public : number - - public set = 0; ->set : number - - public static = 0; ->static : number - - public string = 0; ->string : number - - public get = 0; ->get : number - - public yield = 0; ->yield : number - - public break = 0; ->break : number - - public case = 0; ->case : number - - public catch = 0; ->catch : number - - public class = 0; ->class : number - - public continue = 0; ->continue : number - - public const = 0; ->const : number - - public debugger = 0; ->debugger : number - - public declare = 0; ->declare : number - - public default = 0; ->default : number - - public delete = 0; ->delete : number - - public do = 0; ->do : number - - public else = 0; ->else : number - - public enum = 0; ->enum : number - - public export = 0; ->export : number - - public extends = 0; ->extends : number - - public false = 0; ->false : number - - public finally = 0; ->finally : number - - public for = 0; ->for : number - - public function = 0; ->function : number - - public if = 0; ->if : number - - public import = 0; ->import : number - - public in = 0; ->in : number - - public instanceof = 0; ->instanceof : number - - public new = 0; ->new : number - - public null = 0; ->null : number - - public return = 0; ->return : number - - public super = 0; ->super : number - - public switch = 0; ->switch : number - - public this = 0; ->this : number - - public throw = 0; ->throw : number - - public true = 0; ->true : number - - public try = 0; ->try : number - - public typeof = 0; ->typeof : number - - public var = 0; ->var : number - - public void = 0; ->void : number - - public while = 0; ->while : number - - public with = 0; ->with : number -} - -enum bigEnum { ->bigEnum : bigEnum - - constructor, ->constructor : bigEnum - - any, ->any : bigEnum - - boolean, ->boolean : bigEnum - - implements, ->implements : bigEnum - - interface, ->interface : bigEnum - - let, ->let : bigEnum - - module, ->module : bigEnum - - number, ->number : bigEnum - - package, ->package : bigEnum - - private, ->private : bigEnum - - protected, ->protected : bigEnum - - public, ->public : bigEnum - - set, ->set : bigEnum - - static, ->static : bigEnum - - string, ->string : bigEnum - - get, ->get : bigEnum - - yield, ->yield : bigEnum - - break, ->break : bigEnum - - case, ->case : bigEnum - - catch, ->catch : bigEnum - - class, ->class : bigEnum - - continue, ->continue : bigEnum - - const, ->const : bigEnum - - debugger, ->debugger : bigEnum - - declare, ->declare : bigEnum - - default, ->default : bigEnum - - delete, ->delete : bigEnum - - do, ->do : bigEnum - - else, ->else : bigEnum - - enum, ->enum : bigEnum - - export, ->export : bigEnum - - extends, ->extends : bigEnum - - false, ->false : bigEnum - - finally, ->finally : bigEnum - - for, ->for : bigEnum - - function, ->function : bigEnum - - if, ->if : bigEnum - - import, ->import : bigEnum - - in, ->in : bigEnum - - instanceof, ->instanceof : bigEnum - - new, ->new : bigEnum - - null, ->null : bigEnum - - return, ->return : bigEnum - - super, ->super : bigEnum - - switch, ->switch : bigEnum - - this, ->this : bigEnum - - throw, ->throw : bigEnum - - true, ->true : bigEnum - - try, ->try : bigEnum - - typeof, ->typeof : bigEnum - - var, ->var : bigEnum - - void, ->void : bigEnum - - while, ->while : bigEnum - - with, ->with : bigEnum -} - -module bigModule { ->bigModule : typeof bigModule - - class constructor { } ->constructor : constructor - - class implements { } ->implements : implements - - class interface { } ->interface : interface - - class let { } ->let : let - - class module { } ->module : module - - class package { } ->package : package - - class private { } ->private : private - - class protected { } ->protected : protected - - class public { } ->public : public - - class set { } ->set : set - - class static { } ->static : static - - class get { } ->get : get - - class yield { } ->yield : yield - - class declare { } ->declare : declare -} diff --git a/tests/baselines/reference/couldNotSelectGenericOverload.js b/tests/baselines/reference/couldNotSelectGenericOverload.js index 44bd87ace5d..996ebde8448 100644 --- a/tests/baselines/reference/couldNotSelectGenericOverload.js +++ b/tests/baselines/reference/couldNotSelectGenericOverload.js @@ -9,16 +9,9 @@ var b3G = makeArray2(1, ""); // error //// [couldNotSelectGenericOverload.js] -function makeArray(items) { - return items; -} -var b = [ - 1, - "" -]; +function makeArray(items) { return items; } +var b = [1, ""]; var b1G = makeArray(1, ""); // any, no error var b2G = makeArray(b); // any[] -function makeArray2(items) { - return items; -} +function makeArray2(items) { return items; } var b3G = makeArray2(1, ""); // error diff --git a/tests/baselines/reference/covariance1.js b/tests/baselines/reference/covariance1.js index 9c012ca85c8..bed31338cbe 100644 --- a/tests/baselines/reference/covariance1.js +++ b/tests/baselines/reference/covariance1.js @@ -27,15 +27,10 @@ var M; return XX; })(); M.XX = XX; - function f(y) { - } + function f(y) { } M.f = f; var a; - f({ - x: a - }); // ok + f({ x: a }); // ok var b; - f({ - x: b - }); // ok covariant subtype + f({ x: b }); // ok covariant subtype })(M || (M = {})); diff --git a/tests/baselines/reference/crashInResolveInterface.js b/tests/baselines/reference/crashInResolveInterface.js index 94c60a7cc85..85b6217726a 100644 --- a/tests/baselines/reference/crashInResolveInterface.js +++ b/tests/baselines/reference/crashInResolveInterface.js @@ -20,8 +20,6 @@ interface C { //// [file1.js] var q1; -var x = q1.each(function (x) { - return c.log(x); -}); +var x = q1.each(function (x) { return c.log(x); }); //// [file2.js] /// diff --git a/tests/baselines/reference/customEventDetail.js b/tests/baselines/reference/customEventDetail.js index c88c6e677bf..7207ecf0628 100644 --- a/tests/baselines/reference/customEventDetail.js +++ b/tests/baselines/reference/customEventDetail.js @@ -8,8 +8,5 @@ var y = x.detail.name; //// [customEventDetail.js] var x; // valid since detail is any -x.initCustomEvent('hello', true, true, { - id: 12, - name: 'hello' -}); +x.initCustomEvent('hello', true, true, { id: 12, name: 'hello' }); var y = x.detail.name; diff --git a/tests/baselines/reference/debuggerEmit.js b/tests/baselines/reference/debuggerEmit.js index c2f730271be..8cf5dc69cd0 100644 --- a/tests/baselines/reference/debuggerEmit.js +++ b/tests/baselines/reference/debuggerEmit.js @@ -3,7 +3,5 @@ var x = function () { debugger; } x(); //// [debuggerEmit.js] -var x = function () { - debugger; -}; +var x = function () { debugger; }; x(); diff --git a/tests/baselines/reference/declFileAliasUseBeforeDeclaration.js b/tests/baselines/reference/declFileAliasUseBeforeDeclaration.js index 30ba24ed405..7814e9641ba 100644 --- a/tests/baselines/reference/declFileAliasUseBeforeDeclaration.js +++ b/tests/baselines/reference/declFileAliasUseBeforeDeclaration.js @@ -16,8 +16,7 @@ var Foo = (function () { })(); exports.Foo = Foo; //// [declFileAliasUseBeforeDeclaration_test.js] -function bar(a) { -} +function bar(a) { } exports.bar = bar; diff --git a/tests/baselines/reference/declFileForClassWithMultipleBaseClasses.js b/tests/baselines/reference/declFileForClassWithMultipleBaseClasses.js index 52d11836b11..5d7273098f1 100644 --- a/tests/baselines/reference/declFileForClassWithMultipleBaseClasses.js +++ b/tests/baselines/reference/declFileForClassWithMultipleBaseClasses.js @@ -31,28 +31,22 @@ interface I extends A, B { var A = (function () { function A() { } - A.prototype.foo = function () { - }; + A.prototype.foo = function () { }; return A; })(); var B = (function () { function B() { } - B.prototype.bar = function () { - }; + B.prototype.bar = function () { }; return B; })(); var D = (function () { function D() { } - D.prototype.baz = function () { - }; - D.prototype.bat = function () { - }; - D.prototype.foo = function () { - }; - D.prototype.bar = function () { - }; + D.prototype.baz = function () { }; + D.prototype.bat = function () { }; + D.prototype.foo = function () { }; + D.prototype.bar = function () { }; return D; })(); diff --git a/tests/baselines/reference/declFileForClassWithPrivateOverloadedFunction.js b/tests/baselines/reference/declFileForClassWithPrivateOverloadedFunction.js index 545b70f743a..ee2dc8e83bd 100644 --- a/tests/baselines/reference/declFileForClassWithPrivateOverloadedFunction.js +++ b/tests/baselines/reference/declFileForClassWithPrivateOverloadedFunction.js @@ -10,8 +10,7 @@ class C { var C = (function () { function C() { } - C.prototype.foo = function (x) { - }; + C.prototype.foo = function (x) { }; return C; })(); diff --git a/tests/baselines/reference/declFileGenericType.js b/tests/baselines/reference/declFileGenericType.js index 3c8120e8db9..e01626a7ead 100644 --- a/tests/baselines/reference/declFileGenericType.js +++ b/tests/baselines/reference/declFileGenericType.js @@ -60,29 +60,17 @@ var C; return B; })(); C.B = B; - function F(x) { - return null; - } + function F(x) { return null; } C.F = F; - function F2(x) { - return null; - } + function F2(x) { return null; } C.F2 = F2; - function F3(x) { - return null; - } + function F3(x) { return null; } C.F3 = F3; - function F4(x) { - return null; - } + function F4(x) { return null; } C.F4 = F4; - function F5() { - return null; - } + function F5() { return null; } C.F5 = F5; - function F6(x) { - return null; - } + function F6(x) { return null; } C.F6 = F6; var D = (function () { function D(val) { @@ -98,8 +86,7 @@ exports.c = C.F2; exports.d = C.F3; exports.e = C.F4; exports.x = (new C.D(new C.A())).val; -function f() { -} +function f() { } exports.f = f; exports.g = C.F5(); var h = (function (_super) { diff --git a/tests/baselines/reference/declFileGenericType.types b/tests/baselines/reference/declFileGenericType.types index 284ce8f475b..50026cc3aeb 100644 --- a/tests/baselines/reference/declFileGenericType.types +++ b/tests/baselines/reference/declFileGenericType.types @@ -147,14 +147,14 @@ export var g = C.F5>(); export class h extends C.A{ } >h : h ->C : unknown +>C : typeof C >A : C.A >C : unknown >B : C.B export interface i extends C.A { } >i : i ->C : unknown +>C : typeof C >A : C.A >C : unknown >B : C.B diff --git a/tests/baselines/reference/declFileGenericType2.types b/tests/baselines/reference/declFileGenericType2.types index f9345b5ff11..fed2caca7ac 100644 --- a/tests/baselines/reference/declFileGenericType2.types +++ b/tests/baselines/reference/declFileGenericType2.types @@ -30,7 +30,7 @@ declare module templa.mvc { >templa : unknown >mvc : unknown >IModel : IModel ->mvc : unknown +>mvc : typeof mvc >IController : IController >ModelType : ModelType } @@ -42,7 +42,7 @@ declare module templa.mvc.composite { interface ICompositeControllerModel extends mvc.IModel { >ICompositeControllerModel : ICompositeControllerModel ->mvc : unknown +>mvc : typeof mvc >IModel : IModel getControllers(): mvc.IController[]; @@ -64,8 +64,8 @@ module templa.dom.mvc { >templa : unknown >mvc : unknown >IModel : templa.mvc.IModel ->templa : unknown ->mvc : unknown +>templa : typeof templa +>mvc : typeof templa.mvc >IController : templa.mvc.IController >ModelType : ModelType } @@ -82,8 +82,8 @@ module templa.dom.mvc { >templa : unknown >mvc : unknown >IModel : templa.mvc.IModel ->templa : unknown ->mvc : unknown +>templa : typeof templa +>mvc : typeof templa.mvc >AbstractController : templa.mvc.AbstractController >ModelType : ModelType >IElementController : IElementController @@ -110,9 +110,9 @@ module templa.dom.mvc.composite { >mvc : unknown >composite : unknown >ICompositeControllerModel : templa.mvc.composite.ICompositeControllerModel ->templa : unknown ->dom : unknown ->mvc : unknown +>templa : typeof templa +>dom : typeof dom +>mvc : typeof mvc >AbstractElementController : AbstractElementController >ModelType : ModelType diff --git a/tests/baselines/reference/declFileImportModuleWithExportAssignment.types b/tests/baselines/reference/declFileImportModuleWithExportAssignment.types index a2ae5c07687..15201baa487 100644 --- a/tests/baselines/reference/declFileImportModuleWithExportAssignment.types +++ b/tests/baselines/reference/declFileImportModuleWithExportAssignment.types @@ -42,23 +42,23 @@ module m2 { } var m2: { ->m2 : { (): export=.connectExport; test1: export=.connectModule; test2(): export=.connectModule; } +>m2 : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; } (): m2.connectExport; >m2 : unknown ->connectExport : export=.connectExport +>connectExport : m2.connectExport test1: m2.connectModule; ->test1 : export=.connectModule +>test1 : m2.connectModule >m2 : unknown ->connectModule : export=.connectModule +>connectModule : m2.connectModule test2(): m2.connectModule; ->test2 : () => export=.connectModule +>test2 : () => m2.connectModule >m2 : unknown ->connectModule : export=.connectModule +>connectModule : m2.connectModule }; export = m2; ->m2 : { (): export=.connectExport; test1: export=.connectModule; test2(): export=.connectModule; } +>m2 : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; } diff --git a/tests/baselines/reference/declFileModuleAssignmentInObjectLiteralProperty.js b/tests/baselines/reference/declFileModuleAssignmentInObjectLiteralProperty.js index 400c53a171a..443933069da 100644 --- a/tests/baselines/reference/declFileModuleAssignmentInObjectLiteralProperty.js +++ b/tests/baselines/reference/declFileModuleAssignmentInObjectLiteralProperty.js @@ -20,12 +20,8 @@ var m1; m1.c = c; })(m1 || (m1 = {})); var d = { - m1: { - m: m1 - }, - m2: { - c: m1.c - } + m1: { m: m1 }, + m2: { c: m1.c } }; diff --git a/tests/baselines/reference/declFileModuleContinuation.types b/tests/baselines/reference/declFileModuleContinuation.types index 671d9e6923c..0080d7cbbf3 100644 --- a/tests/baselines/reference/declFileModuleContinuation.types +++ b/tests/baselines/reference/declFileModuleContinuation.types @@ -15,7 +15,7 @@ module A.B.C { export class W implements A.C.Z { >W : W ->A : unknown +>A : typeof A >C : unknown >Z : A.C.Z } diff --git a/tests/baselines/reference/declFileObjectLiteralWithAccessors.js b/tests/baselines/reference/declFileObjectLiteralWithAccessors.js index 7d7c6ee73d3..85897bc2c9d 100644 --- a/tests/baselines/reference/declFileObjectLiteralWithAccessors.js +++ b/tests/baselines/reference/declFileObjectLiteralWithAccessors.js @@ -15,12 +15,8 @@ point./*3*/x = 30; function makePoint(x) { return { b: 10, - get x() { - return x; - }, - set x(a) { - this.b = a; - } + get x() { return x; }, + set x(a) { this.b = a; } }; } ; diff --git a/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.js b/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.js index b3d41829637..dd39a30f7a2 100644 --- a/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.js +++ b/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.js @@ -12,9 +12,7 @@ var /*2*/x = point./*3*/x; //// [declFileObjectLiteralWithOnlyGetter.js] function makePoint(x) { return { - get x() { - return x; - } + get x() { return x; } }; } ; diff --git a/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.js b/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.js index dae362caf36..e219e885053 100644 --- a/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.js +++ b/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.js @@ -13,9 +13,7 @@ point./*2*/x = 30; function makePoint(x) { return { b: 10, - set x(a) { - this.b = a; - } + set x(a) { this.b = a; } }; } ; diff --git a/tests/baselines/reference/declFilePrivateStatic.js b/tests/baselines/reference/declFilePrivateStatic.js index 5bec38e4dee..326ce62171d 100644 --- a/tests/baselines/reference/declFilePrivateStatic.js +++ b/tests/baselines/reference/declFilePrivateStatic.js @@ -18,33 +18,25 @@ class C { var C = (function () { function C() { } - C.a = function () { - }; - C.b = function () { - }; + C.a = function () { }; + C.b = function () { }; Object.defineProperty(C, "c", { - get: function () { - return 1; - }, + get: function () { return 1; }, enumerable: true, configurable: true }); Object.defineProperty(C, "d", { - get: function () { - return 1; - }, + get: function () { return 1; }, enumerable: true, configurable: true }); Object.defineProperty(C, "e", { - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); Object.defineProperty(C, "f", { - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/declFileRegressionTests.js b/tests/baselines/reference/declFileRegressionTests.js index 6178398ef31..a8bf23a8ea8 100644 --- a/tests/baselines/reference/declFileRegressionTests.js +++ b/tests/baselines/reference/declFileRegressionTests.js @@ -8,13 +8,7 @@ var n = { w: null, x: '', y: () => { }, z: 32 }; //// [declFileRegressionTests.js] // 'null' not converted to 'any' in d.ts // function types not piped through correctly -var n = { - w: null, - x: '', - y: function () { - }, - z: 32 -}; +var n = { w: null, x: '', y: function () { }, z: 32 }; //// [declFileRegressionTests.d.ts] diff --git a/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.js b/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.js index 7c6122fc17d..563551d67a8 100644 --- a/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.js +++ b/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.js @@ -17,19 +17,11 @@ function f1() { args[_i - 0] = arguments[_i]; } } -function f2(x) { -} -function f3(x) { -} -function f4() { -} -function f5() { -} -var f6 = function () { - return [ - 10 - ]; -}; +function f2(x) { } +function f3(x) { } +function f4() { } +function f5() { } +var f6 = function () { return [10]; }; //// [declFileRestParametersOfFunctionAndFunctionType.d.ts] diff --git a/tests/baselines/reference/declFileTypeAnnotationArrayType.js b/tests/baselines/reference/declFileTypeAnnotationArrayType.js index 34c150cb992..0a9d04d6bc7 100644 --- a/tests/baselines/reference/declFileTypeAnnotationArrayType.js +++ b/tests/baselines/reference/declFileTypeAnnotationArrayType.js @@ -79,60 +79,38 @@ var g = (function () { })(); // Just the name function foo() { - return [ - new c() - ]; + return [new c()]; } function foo2() { - return [ - new c() - ]; + return [new c()]; } // Qualified name function foo3() { - return [ - new m.c() - ]; + return [new m.c()]; } function foo4() { return m.c; } // Just the name with type arguments function foo5() { - return [ - new g() - ]; + return [new g()]; } function foo6() { - return [ - new g() - ]; + return [new g()]; } // Qualified name with type arguments function foo7() { - return [ - new m.g() - ]; + return [new m.g()]; } function foo8() { - return [ - new m.g() - ]; + return [new m.g()]; } // Array of function types function foo9() { - return [ - function () { - return new c(); - } - ]; + return [function () { return new c(); }]; } function foo10() { - return [ - function () { - return new c(); - } - ]; + return [function () { return new c(); }]; } diff --git a/tests/baselines/reference/declFileTypeAnnotationParenType.js b/tests/baselines/reference/declFileTypeAnnotationParenType.js index 7b8498ac2cc..c61517c7339 100644 --- a/tests/baselines/reference/declFileTypeAnnotationParenType.js +++ b/tests/baselines/reference/declFileTypeAnnotationParenType.js @@ -16,22 +16,10 @@ var c = (function () { } return c; })(); -var x = [ - function () { - return new c(); - } -]; -var y = [ - function () { - return new c(); - } -]; -var k = (function () { - return new c(); -}) || ""; -var l = (function () { - return new c(); -}) || ""; +var x = [function () { return new c(); }]; +var y = [function () { return new c(); }]; +var k = (function () { return new c(); }) || ""; +var l = (function () { return new c(); }) || ""; //// [declFileTypeAnnotationParenType.d.ts] diff --git a/tests/baselines/reference/declFileTypeAnnotationTupleType.js b/tests/baselines/reference/declFileTypeAnnotationTupleType.js index 3c610bb9d04..91d44c2b07f 100644 --- a/tests/baselines/reference/declFileTypeAnnotationTupleType.js +++ b/tests/baselines/reference/declFileTypeAnnotationTupleType.js @@ -45,18 +45,9 @@ var g = (function () { return g; })(); // Just the name -var k = [ - new c(), - new m.c() -]; +var k = [new c(), new m.c()]; var l = k; -var x = [ - new g(), - new m.g(), - function () { - return new c(); - } -]; +var x = [new g(), new m.g(), function () { return new c(); }]; var y = x; diff --git a/tests/baselines/reference/declFileTypeAnnotationUnionType.js b/tests/baselines/reference/declFileTypeAnnotationUnionType.js index 40edf72d361..0a8e256ef28 100644 --- a/tests/baselines/reference/declFileTypeAnnotationUnionType.js +++ b/tests/baselines/reference/declFileTypeAnnotationUnionType.js @@ -51,12 +51,8 @@ var g = (function () { // Just the name var k = new c() || new m.c(); var l = new c() || new m.c(); -var x = new g() || new m.g() || (function () { - return new c(); -}); -var y = new g() || new m.g() || (function () { - return new c(); -}); +var x = new g() || new m.g() || (function () { return new c(); }); +var y = new g() || new m.g() || (function () { return new c(); }); //// [declFileTypeAnnotationUnionType.d.ts] diff --git a/tests/baselines/reference/declFileTypeofFunction.js b/tests/baselines/reference/declFileTypeofFunction.js index 2af519f411d..656e02b8ddd 100644 --- a/tests/baselines/reference/declFileTypeofFunction.js +++ b/tests/baselines/reference/declFileTypeofFunction.js @@ -34,12 +34,8 @@ function foo5(x: number) { } //// [declFileTypeofFunction.js] -function f() { - return undefined; -} -function g() { - return undefined; -} +function f() { return undefined; } +function g() { return undefined; } var b; function b1() { return b1; diff --git a/tests/baselines/reference/declFileTypeofInAnonymousType.js b/tests/baselines/reference/declFileTypeofInAnonymousType.js index 1a5071fd219..01025ed1806 100644 --- a/tests/baselines/reference/declFileTypeofInAnonymousType.js +++ b/tests/baselines/reference/declFileTypeofInAnonymousType.js @@ -43,19 +43,11 @@ var b = { c: m1.c, m1: m1 }; -var c = { - m1: m1 -}; +var c = { m1: m1 }; var d = { - m: { - mod: m1 - }, - mc: { - cl: m1.c - }, - me: { - en: m1.e - }, + m: { mod: m1 }, + mc: { cl: m1.c }, + me: { en: m1.e }, mh: m1.e.holiday }; diff --git a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.types b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.types index 34d263ef6bb..818a31b26d5 100644 --- a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.types +++ b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.types @@ -19,9 +19,9 @@ module X.Y.base { export class W extends A.B.Base.W { >W : W ->A : unknown ->B : unknown ->Base : unknown +>A : typeof A +>B : typeof A.B +>Base : typeof A.B.Base >W : A.B.Base.W name: string; @@ -38,9 +38,9 @@ module X.Y.base.Z { export class W extends X.Y.base.W { >W : W >TValue : TValue ->X : unknown ->Y : unknown ->base : unknown +>X : typeof X +>Y : typeof Y +>base : typeof base >W : base.W value: boolean; diff --git a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.types b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.types index 8c5c4169cb4..b2a1c154412 100644 --- a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.types +++ b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.types @@ -20,8 +20,8 @@ module X.A.B.C { } export class W implements X.A.C.Z { // This needs to be refered as X.A.C.Z as A has conflict >W : W ->X : unknown ->A : unknown +>X : typeof X +>A : typeof A >C : unknown >Z : X.A.C.Z } diff --git a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.types b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.types index 11afd69d94c..e43d0b78f57 100644 --- a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.types +++ b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.types @@ -17,7 +17,7 @@ module X.A.B.C { export class W implements A.C.Z { // This can refer to it as A.C.Z >W : W ->A : unknown +>A : typeof A >C : unknown >Z : A.C.Z } diff --git a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.types b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.types index 0b17b2ce78a..d45c2cf0523 100644 --- a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.types +++ b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.types @@ -17,8 +17,8 @@ module X.A.B.C { export class W implements X.A.C.Z { // This needs to be refered as X.A.C.Z as A has conflict >W : W ->X : unknown ->A : unknown +>X : typeof X +>A : typeof A >C : unknown >Z : X.A.C.Z } diff --git a/tests/baselines/reference/declInput-2.js b/tests/baselines/reference/declInput-2.js index 3ba5ae11bf6..dcd37454ef0 100644 --- a/tests/baselines/reference/declInput-2.js +++ b/tests/baselines/reference/declInput-2.js @@ -38,22 +38,12 @@ var M; var D = (function () { function D() { } - D.prototype.m232 = function () { - return null; - }; - D.prototype.m242 = function () { - return null; - }; - D.prototype.m252 = function () { - return null; - }; // don't generate - D.prototype.m26 = function (i) { - }; - D.prototype.m262 = function (i) { - }; - D.prototype.m3 = function () { - return new C(); - }; + D.prototype.m232 = function () { return null; }; + D.prototype.m242 = function () { return null; }; + D.prototype.m252 = function () { return null; }; // don't generate + D.prototype.m26 = function (i) { }; + D.prototype.m262 = function (i) { }; + D.prototype.m3 = function () { return new C(); }; return D; })(); M.D = D; diff --git a/tests/baselines/reference/declInput.js b/tests/baselines/reference/declInput.js index 538770668c1..cd558c93403 100644 --- a/tests/baselines/reference/declInput.js +++ b/tests/baselines/reference/declInput.js @@ -14,16 +14,8 @@ class bar { var bar = (function () { function bar() { } - bar.prototype.f = function () { - return ''; - }; - bar.prototype.g = function () { - return { - a: null, - b: undefined, - c: void 4 - }; - }; + bar.prototype.f = function () { return ''; }; + bar.prototype.g = function () { return { a: null, b: undefined, c: void 4 }; }; bar.prototype.h = function (x, y, z) { if (x === void 0) { x = 4; } if (y === void 0) { y = null; } diff --git a/tests/baselines/reference/declInput3.js b/tests/baselines/reference/declInput3.js index 52328b01d6d..3be31de3de0 100644 --- a/tests/baselines/reference/declInput3.js +++ b/tests/baselines/reference/declInput3.js @@ -14,16 +14,8 @@ class bar { var bar = (function () { function bar() { } - bar.prototype.f = function () { - return ''; - }; - bar.prototype.g = function () { - return { - a: null, - b: undefined, - c: void 4 - }; - }; + bar.prototype.f = function () { return ''; }; + bar.prototype.g = function () { return { a: null, b: undefined, c: void 4 }; }; bar.prototype.h = function (x, y, z) { if (x === void 0) { x = 4; } if (y === void 0) { y = null; } diff --git a/tests/baselines/reference/declInput4.js b/tests/baselines/reference/declInput4.js index 18025c808fa..07b6f091a14 100644 --- a/tests/baselines/reference/declInput4.js +++ b/tests/baselines/reference/declInput4.js @@ -32,14 +32,9 @@ var M; var D = (function () { function D() { } - D.prototype.m232 = function () { - return null; - }; - D.prototype.m242 = function () { - return null; - }; - D.prototype.m26 = function (i) { - }; + D.prototype.m232 = function () { return null; }; + D.prototype.m242 = function () { return null; }; + D.prototype.m26 = function (i) { }; return D; })(); M.D = D; diff --git a/tests/baselines/reference/declarationEmitDestructuring1.js b/tests/baselines/reference/declarationEmitDestructuring1.js new file mode 100644 index 00000000000..9ac08032a0d --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuring1.js @@ -0,0 +1,37 @@ +//// [declarationEmitDestructuring1.ts] +function foo([a, b, c]: [string, string, string]): void { } +function far([a, [b], [[c]]]: [number, boolean[], string[][]]): void { } +function bar({a1, b1, c1}: { a1: number, b1: boolean, c1: string }): void { } +function baz({a2, b2: {b1, c1}}: { a2: number, b2: { b1: boolean, c1: string } }): void { } + + +//// [declarationEmitDestructuring1.js] +function foo(_a) { + var a = _a[0], b = _a[1], c = _a[2]; +} +function far(_a) { + var a = _a[0], b = _a[1][0], c = _a[2][0][0]; +} +function bar(_a) { + var a1 = _a.a1, b1 = _a.b1, c1 = _a.c1; +} +function baz(_a) { + var a2 = _a.a2, _b = _a.b2, b1 = _b.b1, c1 = _b.c1; +} + + +//// [declarationEmitDestructuring1.d.ts] +declare function foo([a, b, c]: [string, string, string]): void; +declare function far([a, [b], [[c]]]: [number, boolean[], string[][]]): void; +declare function bar({a1, b1, c1}: { + a1: number; + b1: boolean; + c1: string; +}): void; +declare function baz({a2, b2: {b1, c1}}: { + a2: number; + b2: { + b1: boolean; + c1: string; + }; +}): void; diff --git a/tests/baselines/reference/declarationEmitDestructuring1.types b/tests/baselines/reference/declarationEmitDestructuring1.types new file mode 100644 index 00000000000..6b22f25b54b --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuring1.types @@ -0,0 +1,33 @@ +=== tests/cases/compiler/declarationEmitDestructuring1.ts === +function foo([a, b, c]: [string, string, string]): void { } +>foo : ([a, b, c]: [string, string, string]) => void +>a : string +>b : string +>c : string + +function far([a, [b], [[c]]]: [number, boolean[], string[][]]): void { } +>far : ([a, [b], [[c]]]: [number, boolean[], string[][]]) => void +>a : number +>b : boolean +>c : string + +function bar({a1, b1, c1}: { a1: number, b1: boolean, c1: string }): void { } +>bar : ({a1, b1, c1}: { a1: number; b1: boolean; c1: string; }) => void +>a1 : number +>b1 : boolean +>c1 : string +>a1 : number +>b1 : boolean +>c1 : string + +function baz({a2, b2: {b1, c1}}: { a2: number, b2: { b1: boolean, c1: string } }): void { } +>baz : ({a2, b2: {b1, c1}}: { a2: number; b2: { b1: boolean; c1: string; }; }) => void +>a2 : number +>b2 : unknown +>b1 : boolean +>c1 : string +>a2 : number +>b2 : { b1: boolean; c1: string; } +>b1 : boolean +>c1 : string + diff --git a/tests/baselines/reference/declarationEmitDestructuring2.js b/tests/baselines/reference/declarationEmitDestructuring2.js new file mode 100644 index 00000000000..eeabbf1ff37 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuring2.js @@ -0,0 +1,43 @@ +//// [declarationEmitDestructuring2.ts] +function f({x = 10, y: [a, b, c, d] = [1, 2, 3, 4]} = { x: 10, y: [2, 4, 6, 8] }) { } +function g([a, b, c, d] = [1, 2, 3, 4]) { } +function h([a, [b], [[c]], {x = 10, y: [a, b, c], z: {a1, b1}}]){ } +function h1([a, [b], [[c]], {x = 10, y = [1, 2, 3], z: {a1, b1}}]){ } + +//// [declarationEmitDestructuring2.js] +function f(_a) { + var _b = _a === void 0 ? { x: 10, y: [2, 4, 6, 8] } : _a, _c = _b.x, x = _c === void 0 ? 10 : _c, _d = _b.y, _e = _d === void 0 ? [1, 2, 3, 4] : _d, a = _e[0], b = _e[1], c = _e[2], d = _e[3]; +} +function g(_a) { + var _b = _a === void 0 ? [1, 2, 3, 4] : _a, a = _b[0], b = _b[1], c = _b[2], d = _b[3]; +} +function h(_a) { + var a = _a[0], b = _a[1][0], c = _a[2][0][0], _b = _a[3], _c = _b.x, x = _c === void 0 ? 10 : _c, _d = _b.y, a = _d[0], b = _d[1], c = _d[2], _e = _b.z, a1 = _e.a1, b1 = _e.b1; +} +function h1(_a) { + var a = _a[0], b = _a[1][0], c = _a[2][0][0], _b = _a[3], _c = _b.x, x = _c === void 0 ? 10 : _c, _d = _b.y, y = _d === void 0 ? [1, 2, 3] : _d, _e = _b.z, a1 = _e.a1, b1 = _e.b1; +} + + +//// [declarationEmitDestructuring2.d.ts] +declare function f({x, y: [a, b, c, d]}?: { + x: number; + y: [number, number, number, number]; +}): void; +declare function g([a, b, c, d]?: [number, number, number, number]): void; +declare function h([a, [b], [[c]], {x, y: [a, b, c], z: {a1, b1}}]: [any, [any], [[any]], { + x?: number; + y: [any, any, any]; + z: { + a1: any; + b1: any; + }; +}]): void; +declare function h1([a, [b], [[c]], {x, y, z: {a1, b1}}]: [any, [any], [[any]], { + x?: number; + y?: number[]; + z: { + a1: any; + b1: any; + }; +}]): void; diff --git a/tests/baselines/reference/declarationEmitDestructuring2.types b/tests/baselines/reference/declarationEmitDestructuring2.types new file mode 100644 index 00000000000..3368d4e72fd --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuring2.types @@ -0,0 +1,49 @@ +=== tests/cases/compiler/declarationEmitDestructuring2.ts === +function f({x = 10, y: [a, b, c, d] = [1, 2, 3, 4]} = { x: 10, y: [2, 4, 6, 8] }) { } +>f : ({x = 10, y: [a, b, c, d] = [1, 2, 3, 4]}?: { x: number; y: [number, number, number, number]; }) => void +>x : number +>y : unknown +>a : number +>b : number +>c : number +>d : number +>[1, 2, 3, 4] : [number, number, number, number] +>{ x: 10, y: [2, 4, 6, 8] } : { x: number; y: [number, number, number, number]; } +>x : number +>y : [number, number, number, number] +>[2, 4, 6, 8] : [number, number, number, number] + +function g([a, b, c, d] = [1, 2, 3, 4]) { } +>g : ([a, b, c, d]?: [number, number, number, number]) => void +>a : number +>b : number +>c : number +>d : number +>[1, 2, 3, 4] : [number, number, number, number] + +function h([a, [b], [[c]], {x = 10, y: [a, b, c], z: {a1, b1}}]){ } +>h : ([a, [b], [[c]], {x = 10, y: [a, b, c], z: {a1, b1}}]: [any, [any], [[any]], { x?: number; y: [any, any, any]; z: { a1: any; b1: any; }; }]) => void +>a : any +>b : any +>c : any +>x : number +>y : unknown +>a : any +>b : any +>c : any +>z : unknown +>a1 : any +>b1 : any + +function h1([a, [b], [[c]], {x = 10, y = [1, 2, 3], z: {a1, b1}}]){ } +>h1 : ([a, [b], [[c]], {x = 10, y = [1, 2, 3], z: {a1, b1}}]: [any, [any], [[any]], { x?: number; y?: number[]; z: { a1: any; b1: any; }; }]) => void +>a : any +>b : any +>c : any +>x : number +>y : number[] +>[1, 2, 3] : number[] +>z : unknown +>a1 : any +>b1 : any + diff --git a/tests/baselines/reference/declarationEmitDestructuring3.js b/tests/baselines/reference/declarationEmitDestructuring3.js new file mode 100644 index 00000000000..b21c63203c8 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuring3.js @@ -0,0 +1,18 @@ +//// [declarationEmitDestructuring3.ts] +function bar([x, z, ...w]) { } +function foo([x, ...y] = [1, "string", true]) { } + + + +//// [declarationEmitDestructuring3.js] +function bar(_a) { + var x = _a[0], z = _a[1], w = _a.slice(2); +} +function foo(_a) { + var _b = _a === void 0 ? [1, "string", true] : _a, x = _b[0], y = _b.slice(1); +} + + +//// [declarationEmitDestructuring3.d.ts] +declare function bar([x, z, ...w]: any[]): void; +declare function foo([x, ...y]?: (string | number | boolean)[]): void; diff --git a/tests/baselines/reference/declarationEmitDestructuring3.types b/tests/baselines/reference/declarationEmitDestructuring3.types new file mode 100644 index 00000000000..57764f53eee --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuring3.types @@ -0,0 +1,14 @@ +=== tests/cases/compiler/declarationEmitDestructuring3.ts === +function bar([x, z, ...w]) { } +>bar : ([x, z, ...w]: any[]) => void +>x : any +>z : any +>w : any[] + +function foo([x, ...y] = [1, "string", true]) { } +>foo : ([x, ...y]?: (string | number | boolean)[]) => void +>x : string | number | boolean +>y : (string | number | boolean)[] +>[1, "string", true] : (string | number | boolean)[] + + diff --git a/tests/baselines/reference/declarationEmitDestructuring4.js b/tests/baselines/reference/declarationEmitDestructuring4.js new file mode 100644 index 00000000000..f5d9df09175 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuring4.js @@ -0,0 +1,42 @@ +//// [declarationEmitDestructuring4.ts] +// For an array binding pattern with empty elements, +// we will not make any modification and will emit +// the similar binding pattern users' have written +function baz([]) { } +function baz1([] = [1,2,3]) { } +function baz2([[]] = [[1,2,3]]) { } + +function baz3({}) { } +function baz4({} = { x: 10 }) { } + + + +//// [declarationEmitDestructuring4.js] +// For an array binding pattern with empty elements, +// we will not make any modification and will emit +// the similar binding pattern users' have written +function baz(_a) { + var ; +} +function baz1(_a) { + var _b = _a === void 0 ? [1, 2, 3] : _a; +} +function baz2(_a) { + var _b = (_a === void 0 ? [[1, 2, 3]] : _a)[0]; +} +function baz3(_a) { + var ; +} +function baz4(_a) { + var _b = _a === void 0 ? { x: 10 } : _a; +} + + +//// [declarationEmitDestructuring4.d.ts] +declare function baz([]: any[]): void; +declare function baz1([]?: number[]): void; +declare function baz2([[]]?: [number[]]): void; +declare function baz3({}: {}): void; +declare function baz4({}?: { + x: number; +}): void; diff --git a/tests/baselines/reference/declarationEmitDestructuring4.types b/tests/baselines/reference/declarationEmitDestructuring4.types new file mode 100644 index 00000000000..6a90eda1702 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuring4.types @@ -0,0 +1,25 @@ +=== tests/cases/compiler/declarationEmitDestructuring4.ts === +// For an array binding pattern with empty elements, +// we will not make any modification and will emit +// the similar binding pattern users' have written +function baz([]) { } +>baz : ([]: any[]) => void + +function baz1([] = [1,2,3]) { } +>baz1 : ([]?: number[]) => void +>[1,2,3] : number[] + +function baz2([[]] = [[1,2,3]]) { } +>baz2 : ([[]]?: [number[]]) => void +>[[1,2,3]] : [number[]] +>[1,2,3] : number[] + +function baz3({}) { } +>baz3 : ({}: {}) => void + +function baz4({} = { x: 10 }) { } +>baz4 : ({}?: { x: number; }) => void +>{ x: 10 } : { x: number; } +>x : number + + diff --git a/tests/baselines/reference/declarationEmitDestructuring5.js b/tests/baselines/reference/declarationEmitDestructuring5.js new file mode 100644 index 00000000000..32c9b5667d1 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuring5.js @@ -0,0 +1,31 @@ +//// [declarationEmitDestructuring5.ts] +function baz([, z, , ]) { } +function foo([, b, ]: [any, any]): void { } +function bar([z, , , ]) { } +function bar1([z, , , ] = [1, 3, 4, 6, 7]) { } +function bar2([,,z, , , ]) { } + +//// [declarationEmitDestructuring5.js] +function baz(_a) { + var z = _a[1]; +} +function foo(_a) { + var b = _a[1]; +} +function bar(_a) { + var z = _a[0]; +} +function bar1(_a) { + var _b = _a === void 0 ? [1, 3, 4, 6, 7] : _a, z = _b[0]; +} +function bar2(_a) { + var z = _a[2]; +} + + +//// [declarationEmitDestructuring5.d.ts] +declare function baz([ , z, , ]: [any, any, any]): void; +declare function foo([ , b, ]: [any, any]): void; +declare function bar([z, , , ]: [any, any, any]): void; +declare function bar1([z, , , ]?: [number, number, number, number, number]): void; +declare function bar2([ , , z, , , ]: [any, any, any, any, any]): void; diff --git a/tests/baselines/reference/declarationEmitDestructuring5.types b/tests/baselines/reference/declarationEmitDestructuring5.types new file mode 100644 index 00000000000..375440bea0b --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuring5.types @@ -0,0 +1,22 @@ +=== tests/cases/compiler/declarationEmitDestructuring5.ts === +function baz([, z, , ]) { } +>baz : ([, z, , ]: [any, any, any]) => void +>z : any + +function foo([, b, ]: [any, any]): void { } +>foo : ([, b, ]: [any, any]) => void +>b : any + +function bar([z, , , ]) { } +>bar : ([z, , , ]: [any, any, any]) => void +>z : any + +function bar1([z, , , ] = [1, 3, 4, 6, 7]) { } +>bar1 : ([z, , , ]?: [number, number, number, number, number]) => void +>z : number +>[1, 3, 4, 6, 7] : [number, number, number, number, number] + +function bar2([,,z, , , ]) { } +>bar2 : ([,,z, , , ]: [any, any, any, any, any]) => void +>z : any + diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.js b/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.js index 7ee32cab16c..088bb4e849f 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.js +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.js @@ -10,27 +10,11 @@ var [x2] = a; // emit x2: number | string var [x3, y3, z3] = a; // emit x3, y3, z3 //// [declarationEmitDestructuringArrayPattern1.js] -var _a = [ - 1, - "hello" -]; // Dont emit anything -var x = ([ - 1, - "hello" -])[0]; // emit x: number -var _b = [ - 1, - "hello" -], x1 = _b[0], y1 = _b[1]; // emit x1: number, y1: string -var _c = [ - 0, - 1, - 2 -], z1 = _c[2]; // emit z1: number -var a = [ - 1, - "hello" -]; +var _a = [1, "hello"]; // Dont emit anything +var x = ([1, "hello"])[0]; // emit x: number +var _b = [1, "hello"], x1 = _b[0], y1 = _b[1]; // emit x1: number, y1: string +var _c = [0, 1, 2], z1 = _c[2]; // emit z1: number +var a = [1, "hello"]; var x2 = a[0]; // emit x2: number | string var x3 = a[0], y3 = a[1], z3 = a[2]; // emit x3, y3, z3 diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.js b/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.js index 5734b9bc6f9..818b3a6f7a9 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.js +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.js @@ -11,50 +11,12 @@ var [a3, b3] = [[x13, y13], { x: x13, y: y13 }]; //// [declarationEmitDestructuringArrayPattern2.js] -var _a = [ - 1, - [ - "hello", - [ - true - ] - ] -], x10 = _a[0], _b = _a[1], y10 = _b[0], z10 = _b[1][0]; -var _c = [ - 1, - "hello" -], _d = _c[0], x11 = _d === void 0 ? 0 : _d, _e = _c[1], y11 = _e === void 0 ? "" : _e; +var _a = [1, ["hello", [true]]], x10 = _a[0], _b = _a[1], y10 = _b[0], z10 = _b[1][0]; +var _c = [1, "hello"], _d = _c[0], x11 = _d === void 0 ? 0 : _d, _e = _c[1], y11 = _e === void 0 ? "" : _e; var _f = [], a11 = _f[0], b11 = _f[1], c11 = _f[2]; -var _g = [ - 1, - [ - "hello", - { - x12: 5, - y12: true - } - ] -], a2 = _g[0], _h = _g[1], _j = _h === void 0 ? [ - "abc", - { - x12: 10, - y12: false - } -] : _h, b2 = _j[0], _k = _j[1], x12 = _k.x12, c2 = _k.y12; -var _l = [ - 1, - "hello" -], x13 = _l[0], y13 = _l[1]; -var _m = [ - [ - x13, - y13 - ], - { - x: x13, - y: y13 - } -], a3 = _m[0], b3 = _m[1]; +var _g = [1, ["hello", { x12: 5, y12: true }]], a2 = _g[0], _h = _g[1], _j = _h === void 0 ? ["abc", { x12: 10, y12: false }] : _h, b2 = _j[0], _k = _j[1], x12 = _k.x12, c2 = _k.y12; +var _l = [1, "hello"], x13 = _l[0], y13 = _l[1]; +var _m = [[x13, y13], { x: x13, y: y13 }], a3 = _m[0], b3 = _m[1]; //// [declarationEmitDestructuringArrayPattern2.d.ts] diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.js b/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.js index 258fa17d7ff..84ab9f242e9 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.js +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.js @@ -6,10 +6,7 @@ module M { //// [declarationEmitDestructuringArrayPattern3.js] var M; (function (M) { - _a = [ - 1, - 2 - ], M.a = _a[0], M.b = _a[1]; + _a = [1, 2], M.a = _a[0], M.b = _a[1]; var _a; })(M || (M = {})); diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.js b/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.js index 97a8c20b73b..f19a4a840bf 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.js +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.js @@ -10,46 +10,14 @@ var [x18, y18, ...a12] = [1, "hello", true]; var [x19, y19, z19, ...a13] = [1, "hello", true]; //// [declarationEmitDestructuringArrayPattern4.js] -var _a = [ - 1, - 2, - 3 -], a5 = _a.slice(0); -var _b = [ - 1, - 2, - 3 -], x14 = _b[0], a6 = _b.slice(1); -var _c = [ - 1, - 2, - 3 -], x15 = _c[0], y15 = _c[1], a7 = _c.slice(2); -var _d = [ - 1, - 2, - 3 -], x16 = _d[0], y16 = _d[1], z16 = _d[2], a8 = _d.slice(3); -var _e = [ - 1, - "hello", - true -], a9 = _e.slice(0); -var _f = [ - 1, - "hello", - true -], x17 = _f[0], a10 = _f.slice(1); -var _g = [ - 1, - "hello", - true -], x18 = _g[0], y18 = _g[1], a12 = _g.slice(2); -var _h = [ - 1, - "hello", - true -], x19 = _h[0], y19 = _h[1], z19 = _h[2], a13 = _h.slice(3); +var _a = [1, 2, 3], a5 = _a.slice(0); +var _b = [1, 2, 3], x14 = _b[0], a6 = _b.slice(1); +var _c = [1, 2, 3], x15 = _c[0], y15 = _c[1], a7 = _c.slice(2); +var _d = [1, 2, 3], x16 = _d[0], y16 = _d[1], z16 = _d[2], a8 = _d.slice(3); +var _e = [1, "hello", true], a9 = _e.slice(0); +var _f = [1, "hello", true], x17 = _f[0], a10 = _f.slice(1); +var _g = [1, "hello", true], x18 = _g[0], y18 = _g[1], a12 = _g.slice(2); +var _h = [1, "hello", true], x19 = _h[0], y19 = _h[1], z19 = _h[2], a13 = _h.slice(3); //// [declarationEmitDestructuringArrayPattern4.d.ts] diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.js b/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.js new file mode 100644 index 00000000000..820864cc25a --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.js @@ -0,0 +1,15 @@ +//// [declarationEmitDestructuringArrayPattern5.ts] +var [, , z] = [1, 2, 4]; +var [, a, , ] = [3, 4, 5]; +var [, , [, b, ]] = [3,5,[0, 1]]; + +//// [declarationEmitDestructuringArrayPattern5.js] +var _a = [1, 2, 4], z = _a[2]; +var _b = [3, 4, 5], a = _b[1]; +var _c = [3, 5, [0, 1]], _d = _c[2], b = _d[1]; + + +//// [declarationEmitDestructuringArrayPattern5.d.ts] +declare var z: number; +declare var a: number; +declare var b: number; diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types b/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types new file mode 100644 index 00000000000..6352917682e --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types @@ -0,0 +1,14 @@ +=== tests/cases/compiler/declarationEmitDestructuringArrayPattern5.ts === +var [, , z] = [1, 2, 4]; +>z : number +>[1, 2, 4] : [number, number, number] + +var [, a, , ] = [3, 4, 5]; +>a : number +>[3, 4, 5] : [number, number, number] + +var [, , [, b, ]] = [3,5,[0, 1]]; +>b : number +>[3,5,[0, 1]] : [number, number, [number, number]] +>[0, 1] : [number, number] + diff --git a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.js b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.js index 9b48f418f5a..d94da79ad9a 100644 --- a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.js +++ b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.js @@ -23,52 +23,19 @@ module m { } //// [declarationEmitDestructuringObjectLiteralPattern.js] -var _a = { - x: 5, - y: "hello" -}; -var x4 = ({ - x4: 5, - y4: "hello" -}).x4; -var y5 = ({ - x5: 5, - y5: "hello" -}).y5; -var _b = { - x6: 5, - y6: "hello" -}, x6 = _b.x6, y6 = _b.y6; -var a1 = ({ - x7: 5, - y7: "hello" -}).x7; -var b1 = ({ - x8: 5, - y8: "hello" -}).y8; -var _c = { - x9: 5, - y9: "hello" -}, a2 = _c.x9, b2 = _c.y9; -var _d = { - a: 1, - b: { - a: "hello", - b: { - a: true - } - } -}, x11 = _d.a, _e = _d.b, y11 = _e.a, z11 = _e.b.a; +var _a = { x: 5, y: "hello" }; +var x4 = ({ x4: 5, y4: "hello" }).x4; +var y5 = ({ x5: 5, y5: "hello" }).y5; +var _b = { x6: 5, y6: "hello" }, x6 = _b.x6, y6 = _b.y6; +var a1 = ({ x7: 5, y7: "hello" }).x7; +var b1 = ({ x8: 5, y8: "hello" }).y8; +var _c = { x9: 5, y9: "hello" }, a2 = _c.x9, b2 = _c.y9; +var _d = { a: 1, b: { a: "hello", b: { a: true } } }, x11 = _d.a, _e = _d.b, y11 = _e.a, z11 = _e.b.a; function f15() { var a4 = "hello"; var b4 = 1; var c4 = true; - return { - a4: a4, - b4: b4, - c4: c4 - }; + return { a4: a4, b4: b4, c4: c4 }; } var _f = f15(), a4 = _f.a4, b4 = _f.b4, c4 = _f.c4; var m; diff --git a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.js b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.js index 889047185e7..2c14e743039 100644 --- a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.js +++ b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.js @@ -9,34 +9,13 @@ var { y8: b1 } = { x8: 5, y8: "hello" }; var { x9: a2, y9: b2 } = { x9: 5, y9: "hello" }; //// [declarationEmitDestructuringObjectLiteralPattern1.js] -var _a = { - x: 5, - y: "hello" -}; -var x4 = ({ - x4: 5, - y4: "hello" -}).x4; -var y5 = ({ - x5: 5, - y5: "hello" -}).y5; -var _b = { - x6: 5, - y6: "hello" -}, x6 = _b.x6, y6 = _b.y6; -var a1 = ({ - x7: 5, - y7: "hello" -}).x7; -var b1 = ({ - x8: 5, - y8: "hello" -}).y8; -var _c = { - x9: 5, - y9: "hello" -}, a2 = _c.x9, b2 = _c.y9; +var _a = { x: 5, y: "hello" }; +var x4 = ({ x4: 5, y4: "hello" }).x4; +var y5 = ({ x5: 5, y5: "hello" }).y5; +var _b = { x6: 5, y6: "hello" }, x6 = _b.x6, y6 = _b.y6; +var a1 = ({ x7: 5, y7: "hello" }).x7; +var b1 = ({ x8: 5, y8: "hello" }).y8; +var _c = { x9: 5, y9: "hello" }, a2 = _c.x9, b2 = _c.y9; //// [declarationEmitDestructuringObjectLiteralPattern1.d.ts] diff --git a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.js b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.js index 140fc03780a..7e5a3d9d2fa 100644 --- a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.js +++ b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.js @@ -15,24 +15,12 @@ module m { } //// [declarationEmitDestructuringObjectLiteralPattern2.js] -var _a = { - a: 1, - b: { - a: "hello", - b: { - a: true - } - } -}, x11 = _a.a, _b = _a.b, y11 = _b.a, z11 = _b.b.a; +var _a = { a: 1, b: { a: "hello", b: { a: true } } }, x11 = _a.a, _b = _a.b, y11 = _b.a, z11 = _b.b.a; function f15() { var a4 = "hello"; var b4 = 1; var c4 = true; - return { - a4: a4, - b4: b4, - c4: c4 - }; + return { a4: a4, b4: b4, c4: c4 }; } var _c = f15(), a4 = _c.a4, b4 = _c.b4, c4 = _c.c4; var m; diff --git a/tests/baselines/reference/declarationEmitDestructuringOptionalBindingParametersInOverloads.js b/tests/baselines/reference/declarationEmitDestructuringOptionalBindingParametersInOverloads.js index c907add11f7..a3cdee31222 100644 --- a/tests/baselines/reference/declarationEmitDestructuringOptionalBindingParametersInOverloads.js +++ b/tests/baselines/reference/declarationEmitDestructuringOptionalBindingParametersInOverloads.js @@ -25,8 +25,8 @@ function foo2() { //// [declarationEmitDestructuringOptionalBindingParametersInOverloads.d.ts] -declare function foo(_0?: [string, number, boolean]): any; -declare function foo2(_0?: { +declare function foo([x, y, z]?: [string, number, boolean]): any; +declare function foo2({x, y, z}?: { x: string; y: number; z: boolean; diff --git a/tests/baselines/reference/declarationEmitDestructuringParameterProperties.js b/tests/baselines/reference/declarationEmitDestructuringParameterProperties.js index cfe4acc1733..a98620c8529 100644 --- a/tests/baselines/reference/declarationEmitDestructuringParameterProperties.js +++ b/tests/baselines/reference/declarationEmitDestructuringParameterProperties.js @@ -43,12 +43,12 @@ var C3 = (function () { //// [declarationEmitDestructuringParameterProperties.d.ts] declare class C1 { x: string, y: string, z: string; - constructor(_0: string[]); + constructor([x, y, z]: string[]); } declare type TupleType1 = [string, number, boolean]; declare class C2 { x: string, y: number, z: boolean; - constructor(_0: TupleType1); + constructor([x, y, z]: TupleType1); } declare type ObjType1 = { x: number; @@ -57,5 +57,5 @@ declare type ObjType1 = { }; declare class C3 { x: number, y: string, z: boolean; - constructor(_0: ObjType1); + constructor({x, y, z}: ObjType1); } diff --git a/tests/baselines/reference/declarationEmitDestructuringPrivacyError.js b/tests/baselines/reference/declarationEmitDestructuringPrivacyError.js index c076dca665a..fa3cae9478b 100644 --- a/tests/baselines/reference/declarationEmitDestructuringPrivacyError.js +++ b/tests/baselines/reference/declarationEmitDestructuringPrivacyError.js @@ -13,10 +13,6 @@ var m; } return c; })(); - _a = [ - 10, - new c(), - 30 - ], m.x = _a[0], m.y = _a[1], m.z = _a[2]; + _a = [10, new c(), 30], m.x = _a[0], m.y = _a[1], m.z = _a[2]; var _a; })(m || (m = {})); diff --git a/tests/baselines/reference/declarationEmitDestructuringWithOptionalBindingParameters.js b/tests/baselines/reference/declarationEmitDestructuringWithOptionalBindingParameters.js index 284cf107782..5c7f4d2cec5 100644 --- a/tests/baselines/reference/declarationEmitDestructuringWithOptionalBindingParameters.js +++ b/tests/baselines/reference/declarationEmitDestructuringWithOptionalBindingParameters.js @@ -14,8 +14,8 @@ function foo1(_a) { //// [declarationEmitDestructuringWithOptionalBindingParameters.d.ts] -declare function foo(_0?: [string, number, boolean]): void; -declare function foo1(_0?: { +declare function foo([x, y, z]?: [string, number, boolean]): void; +declare function foo1({x, y, z}?: { x: string; y: number; z: boolean; diff --git a/tests/baselines/reference/declarationEmit_nameConflicts.js b/tests/baselines/reference/declarationEmit_nameConflicts.js index 161224659f1..ae517bb7460 100644 --- a/tests/baselines/reference/declarationEmit_nameConflicts.js +++ b/tests/baselines/reference/declarationEmit_nameConflicts.js @@ -64,8 +64,7 @@ module.exports = f; var im = require('declarationEmit_nameConflicts_1'); var M; (function (M) { - function f() { - } + function f() { } M.f = f; var C = (function () { function C() { @@ -75,8 +74,7 @@ var M; M.C = C; var N; (function (N) { - function g() { - } + function g() { } N.g = g; ; })(N = M.N || (M.N = {})); @@ -89,8 +87,7 @@ var M; (function (M) { var P; (function (P) { - function f() { - } + function f() { } P.f = f; var C = (function () { function C() { @@ -100,8 +97,7 @@ var M; P.C = C; var N; (function (N) { - function g() { - } + function g() { } N.g = g; ; })(N = P.N || (P.N = {})); @@ -117,8 +113,7 @@ var M; (function (M) { var Q; (function (Q) { - function f() { - } + function f() { } Q.f = f; var C = (function () { function C() { @@ -128,8 +123,7 @@ var M; Q.C = C; var N; (function (N) { - function g() { - } + function g() { } N.g = g; ; })(N = Q.N || (Q.N = {})); diff --git a/tests/baselines/reference/declarationEmit_nameConflicts.types b/tests/baselines/reference/declarationEmit_nameConflicts.types index f07a7fbb2ab..e38c831493d 100644 --- a/tests/baselines/reference/declarationEmit_nameConflicts.types +++ b/tests/baselines/reference/declarationEmit_nameConflicts.types @@ -119,13 +119,13 @@ export module M.Q { } export interface b extends M.b { } // ok >b : b ->M : unknown +>M : typeof M >b : M.C export interface I extends M.c.I { } // ok >I : I ->M : unknown ->c : unknown +>M : typeof M +>c : typeof M.N >I : M.c.I export module c { @@ -133,8 +133,8 @@ export module M.Q { export interface I extends M.c.I { } // ok >I : I ->M : unknown ->c : unknown +>M : typeof M +>c : typeof M.N >I : M.c.I } } diff --git a/tests/baselines/reference/declarationEmit_nameConflicts2.js b/tests/baselines/reference/declarationEmit_nameConflicts2.js index 43167f531d7..2a228080c68 100644 --- a/tests/baselines/reference/declarationEmit_nameConflicts2.js +++ b/tests/baselines/reference/declarationEmit_nameConflicts2.js @@ -22,8 +22,7 @@ var X; (function (Y) { var base; (function (base) { - function f() { - } + function f() { } base.f = f; var C = (function () { function C() { diff --git a/tests/baselines/reference/declarationEmit_nameConflicts3.js b/tests/baselines/reference/declarationEmit_nameConflicts3.js index 848343362bc..0d68c38cfda 100644 --- a/tests/baselines/reference/declarationEmit_nameConflicts3.js +++ b/tests/baselines/reference/declarationEmit_nameConflicts3.js @@ -37,20 +37,17 @@ var M; (function (M) { var D; (function (D) { - function f() { - } + function f() { } D.f = f; })(D = M.D || (M.D = {})); var C; (function (C) { - function f() { - } + function f() { } C.f = f; })(C = M.C || (M.C = {})); var E; (function (E) { - function f() { - } + function f() { } E.f = f; })(E = M.E || (M.E = {})); })(M || (M = {})); @@ -61,8 +58,7 @@ var M; var C = (function () { function C() { } - C.f = function () { - }; + C.f = function () { }; return C; })(); P.C = C; diff --git a/tests/baselines/reference/declarationEmit_protectedMembers.js b/tests/baselines/reference/declarationEmit_protectedMembers.js index dc8506b220b..61a4ebdfcab 100644 --- a/tests/baselines/reference/declarationEmit_protectedMembers.js +++ b/tests/baselines/reference/declarationEmit_protectedMembers.js @@ -65,11 +65,8 @@ var C1 = (function () { return this.x; }; Object.defineProperty(C1.prototype, "accessor", { - get: function () { - return 0; - }, - set: function (a) { - }, + get: function () { return 0; }, + set: function (a) { }, enumerable: true, configurable: true }); @@ -77,15 +74,12 @@ var C1 = (function () { return this.sx; }; Object.defineProperty(C1, "staticSetter", { - set: function (a) { - }, + set: function (a) { }, enumerable: true, configurable: true }); Object.defineProperty(C1, "staticGetter", { - get: function () { - return 0; - }, + get: function () { return 0; }, enumerable: true, configurable: true }); @@ -118,9 +112,7 @@ var C3 = (function (_super) { return _super.sf.call(this); }; Object.defineProperty(C3, "staticGetter", { - get: function () { - return 1; - }, + get: function () { return 1; }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/declarationInAmbientContext.errors.txt b/tests/baselines/reference/declarationInAmbientContext.errors.txt deleted file mode 100644 index 338da990a0b..00000000000 --- a/tests/baselines/reference/declarationInAmbientContext.errors.txt +++ /dev/null @@ -1,12 +0,0 @@ -tests/cases/conformance/es6/destructuring/declarationInAmbientContext.ts(1,13): error TS1183: Destructuring declarations are not allowed in ambient contexts. -tests/cases/conformance/es6/destructuring/declarationInAmbientContext.ts(2,13): error TS1183: Destructuring declarations are not allowed in ambient contexts. - - -==== tests/cases/conformance/es6/destructuring/declarationInAmbientContext.ts (2 errors) ==== - declare var [a, b]; // Error, destructuring declaration not allowed in ambient context - ~~~~~~ -!!! error TS1183: Destructuring declarations are not allowed in ambient contexts. - declare var {c, d}; // Error, destructuring declaration not allowed in ambient context - ~~~~~~ -!!! error TS1183: Destructuring declarations are not allowed in ambient contexts. - \ No newline at end of file diff --git a/tests/baselines/reference/declarationInAmbientContext.types b/tests/baselines/reference/declarationInAmbientContext.types new file mode 100644 index 00000000000..ecdd3b7c7eb --- /dev/null +++ b/tests/baselines/reference/declarationInAmbientContext.types @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/destructuring/declarationInAmbientContext.ts === +declare var [a, b]; // Error, destructuring declaration not allowed in ambient context +>a : any +>b : any + +declare var {c, d}; // Error, destructuring declaration not allowed in ambient context +>c : any +>d : any + diff --git a/tests/baselines/reference/declarationsAndAssignments.js b/tests/baselines/reference/declarationsAndAssignments.js index 6772a842a49..032f4cb0e63 100644 --- a/tests/baselines/reference/declarationsAndAssignments.js +++ b/tests/baselines/reference/declarationsAndAssignments.js @@ -182,35 +182,16 @@ function f21() { //// [declarationsAndAssignments.js] function f0() { - var _a = [ - 1, - "hello" - ]; - var x = ([ - 1, - "hello" - ])[0]; - var _b = [ - 1, - "hello" - ], x = _b[0], y = _b[1]; - var _c = [ - 1, - "hello" - ], x = _c[0], y = _c[1], z = _c[2]; // Error - var _d = [ - 0, - 1, - 2 - ], z = _d[2]; + var _a = [1, "hello"]; + var x = ([1, "hello"])[0]; + var _b = [1, "hello"], x = _b[0], y = _b[1]; + var _c = [1, "hello"], x = _c[0], y = _c[1], z = _c[2]; // Error + var _d = [0, 1, 2], z = _d[2]; var x; var y; } function f1() { - var a = [ - 1, - "hello" - ]; + var a = [1, "hello"]; var x = a[0]; var x = a[0], y = a[1]; var x = a[0], y = a[1], z = a[2]; @@ -219,161 +200,71 @@ function f1() { var z; } function f2() { - var _a = { - x: 5, - y: "hello" - }; - var x = ({ - x: 5, - y: "hello" - }).x; - var y = ({ - x: 5, - y: "hello" - }).y; - var _b = { - x: 5, - y: "hello" - }, x = _b.x, y = _b.y; + var _a = { x: 5, y: "hello" }; + var x = ({ x: 5, y: "hello" }).x; + var y = ({ x: 5, y: "hello" }).y; + var _b = { x: 5, y: "hello" }, x = _b.x, y = _b.y; var x; var y; - var a = ({ - x: 5, - y: "hello" - }).x; - var b = ({ - x: 5, - y: "hello" - }).y; - var _c = { - x: 5, - y: "hello" - }, a = _c.x, b = _c.y; + var a = ({ x: 5, y: "hello" }).x; + var b = ({ x: 5, y: "hello" }).y; + var _c = { x: 5, y: "hello" }, a = _c.x, b = _c.y; var a; var b; } function f3() { - var _a = [ - 1, - [ - "hello", - [ - true - ] - ] - ], x = _a[0], _b = _a[1], y = _b[0], z = _b[1][0]; + var _a = [1, ["hello", [true]]], x = _a[0], _b = _a[1], y = _b[0], z = _b[1][0]; var x; var y; var z; } function f4() { - var _a = { - a: 1, - b: { - a: "hello", - b: { - a: true - } - } - }, x = _a.a, _b = _a.b, y = _b.a, z = _b.b.a; + var _a = { a: 1, b: { a: "hello", b: { a: true } } }, x = _a.a, _b = _a.b, y = _b.a, z = _b.b.a; var x; var y; var z; } function f6() { - var _a = [ - 1, - "hello" - ], _b = _a[0], x = _b === void 0 ? 0 : _b, _c = _a[1], y = _c === void 0 ? "" : _c; + var _a = [1, "hello"], _b = _a[0], x = _b === void 0 ? 0 : _b, _c = _a[1], y = _c === void 0 ? "" : _c; var x; var y; } function f7() { - var _a = [ - 1, - "hello" - ], _b = _a[0], x = _b === void 0 ? 0 : _b, _c = _a[1], y = _c === void 0 ? 1 : _c; // Error, initializer for y must be string + var _a = [1, "hello"], _b = _a[0], x = _b === void 0 ? 0 : _b, _c = _a[1], y = _c === void 0 ? 1 : _c; // Error, initializer for y must be string var x; var y; } function f8() { var _a = [], a = _a[0], b = _a[1], c = _a[2]; // Ok, [] is an array - var _b = [ - 1 - ], d = _b[0], e = _b[1], f = _b[2]; // Error, [1] is a tuple + var _b = [1], d = _b[0], e = _b[1], f = _b[2]; // Error, [1] is a tuple } function f9() { var _a = {}, a = _a[0], b = _a[1]; // Error, not array type - var _b = { - 0: 10, - 1: 20 - }, c = _b[0], d = _b[1]; // Error, not array type - var _c = [ - 10, - 20 - ], e = _c[0], f = _c[1]; + var _b = { 0: 10, 1: 20 }, c = _b[0], d = _b[1]; // Error, not array type + var _c = [10, 20], e = _c[0], f = _c[1]; } function f10() { var _a = {}, a = _a.a, b = _a.b; // Error var _b = [], a = _b.a, b = _b.b; // Error } function f11() { - var _a = { - x: 10, - y: "hello" - }, a = _a.x, b = _a.y; - var _b = { - 0: 10, - 1: "hello" - }, a = _b[0], b = _b[1]; - var _c = { - "<": 10, - ">": "hello" - }, a = _c["<"], b = _c[">"]; - var _d = [ - 10, - "hello" - ], a = _d[0], b = _d[1]; + var _a = { x: 10, y: "hello" }, a = _a.x, b = _a.y; + var _b = { 0: 10, 1: "hello" }, a = _b[0], b = _b[1]; + var _c = { "<": 10, ">": "hello" }, a = _c["<"], b = _c[">"]; + var _d = [10, "hello"], a = _d[0], b = _d[1]; var a; var b; } function f12() { - var _a = [ - 1, - [ - "hello", - { - x: 5, - y: true - } - ] - ], a = _a[0], _b = _a[1], _c = _b === void 0 ? [ - "abc", - { - x: 10, - y: false - } - ] : _b, b = _c[0], _d = _c[1], x = _d.x, c = _d.y; + var _a = [1, ["hello", { x: 5, y: true }]], a = _a[0], _b = _a[1], _c = _b === void 0 ? ["abc", { x: 10, y: false }] : _b, b = _c[0], _d = _c[1], x = _d.x, c = _d.y; var a; var b; var x; var c; } function f13() { - var _a = [ - 1, - "hello" - ], x = _a[0], y = _a[1]; - var _b = [ - [ - x, - y - ], - { - x: x, - y: y - } - ], a = _b[0], b = _b[1]; + var _a = [1, "hello"], x = _a[0], y = _a[1]; + var _b = [[x, y], { x: x, y: y }], a = _b[0], b = _b[1]; } function f14(_a) { var _b = _a[0], a = _b === void 0 ? 1 : _b, _c = _a[1], _d = _c[0], b = _d === void 0 ? "hello" : _d, _e = _c[1], x = _e.x, _f = _e.y, c = _f === void 0 ? false : _f; @@ -381,51 +272,19 @@ function f14(_a) { var b; var c; } -f14([ - 2, - [ - "abc", - { - x: 0, - y: true - } - ] -]); -f14([ - 2, - [ - "abc", - { - x: 0 - } - ] -]); -f14([ - 2, - [ - "abc", - { - y: false - } - ] -]); // Error, no x +f14([2, ["abc", { x: 0, y: true }]]); +f14([2, ["abc", { x: 0 }]]); +f14([2, ["abc", { y: false }]]); // Error, no x var M; (function (M) { - _a = [ - 1, - 2 - ], M.a = _a[0], M.b = _a[1]; + _a = [1, 2], M.a = _a[0], M.b = _a[1]; var _a; })(M || (M = {})); function f15() { var a = "hello"; var b = 1; var c = true; - return { - a: a, - b: b, - c: c - }; + return { a: a, b: b, c: c }; } function f16() { var _a = f15(), a = _a.a, b = _a.b, c = _a.c; @@ -434,66 +293,27 @@ function f17(_a) { var _b = _a.a, a = _b === void 0 ? "" : _b, _c = _a.b, b = _c === void 0 ? 0 : _c, _d = _a.c, c = _d === void 0 ? false : _d; } f17({}); -f17({ - a: "hello" -}); -f17({ - c: true -}); +f17({ a: "hello" }); +f17({ c: true }); f17(f15()); function f18() { var a; var b; var aa; - (_a = { - a: a, - b: b - }, a = _a.a, b = _a.b, _a); - (_b = { - b: b, - a: a - }, a = _b.a, b = _b.b, _b); - _c = [ - a, - b - ], aa[0] = _c[0], b = _c[1]; - _d = [ - b, - a - ], a = _d[0], b = _d[1]; // Error - _e = [ - 2, - "def" - ], _f = _e[0], a = _f === void 0 ? 1 : _f, _g = _e[1], b = _g === void 0 ? "abc" : _g; + (_a = { a: a, b: b }, a = _a.a, b = _a.b, _a); + (_b = { b: b, a: a }, a = _b.a, b = _b.b, _b); + _c = [a, b], aa[0] = _c[0], b = _c[1]; + _d = [b, a], a = _d[0], b = _d[1]; // Error + _e = [2, "def"], _f = _e[0], a = _f === void 0 ? 1 : _f, _g = _e[1], b = _g === void 0 ? "abc" : _g; var _a, _b, _c, _d, _e, _f, _g; } function f19() { var a, b; - _a = [ - 1, - 2 - ], a = _a[0], b = _a[1]; - _b = [ - b, - a - ], a = _b[0], b = _b[1]; - (_c = { - b: b, - a: a - }, a = _c.a, b = _c.b, _c); - _d = ([ - [ - 2, - 3 - ] - ])[0], _e = _d === void 0 ? [ - 1, - 2 - ] : _d, a = _e[0], b = _e[1]; - var x = (_f = [ - 1, - 2 - ], a = _f[0], b = _f[1], _f); + _a = [1, 2], a = _a[0], b = _a[1]; + _b = [b, a], a = _b[0], b = _b[1]; + (_c = { b: b, a: a }, a = _c.a, b = _c.b, _c); + _d = ([[2, 3]])[0], _e = _d === void 0 ? [1, 2] : _d, a = _e[0], b = _e[1]; + var x = (_f = [1, 2], a = _f[0], b = _f[1], _f); var _a, _b, _c, _d, _e, _f; } function f20() { @@ -501,46 +321,14 @@ function f20() { var x; var y; var z; - var _a = [ - 1, - 2, - 3 - ], a = _a.slice(0); - var _b = [ - 1, - 2, - 3 - ], x = _b[0], a = _b.slice(1); - var _c = [ - 1, - 2, - 3 - ], x = _c[0], y = _c[1], a = _c.slice(2); - var _d = [ - 1, - 2, - 3 - ], x = _d[0], y = _d[1], z = _d[2], a = _d.slice(3); - _e = [ - 1, - 2, - 3 - ], a = _e.slice(0); - _f = [ - 1, - 2, - 3 - ], x = _f[0], a = _f.slice(1); - _g = [ - 1, - 2, - 3 - ], x = _g[0], y = _g[1], a = _g.slice(2); - _h = [ - 1, - 2, - 3 - ], x = _h[0], y = _h[1], z = _h[2], a = _h.slice(3); + var _a = [1, 2, 3], a = _a.slice(0); + var _b = [1, 2, 3], x = _b[0], a = _b.slice(1); + var _c = [1, 2, 3], x = _c[0], y = _c[1], a = _c.slice(2); + var _d = [1, 2, 3], x = _d[0], y = _d[1], z = _d[2], a = _d.slice(3); + _e = [1, 2, 3], a = _e.slice(0); + _f = [1, 2, 3], x = _f[0], a = _f.slice(1); + _g = [1, 2, 3], x = _g[0], y = _g[1], a = _g.slice(2); + _h = [1, 2, 3], x = _h[0], y = _h[1], z = _h[2], a = _h.slice(3); var _e, _f, _g, _h; } function f21() { @@ -548,45 +336,13 @@ function f21() { var x; var y; var z; - var _a = [ - 1, - "hello", - true - ], a = _a.slice(0); - var _b = [ - 1, - "hello", - true - ], x = _b[0], a = _b.slice(1); - var _c = [ - 1, - "hello", - true - ], x = _c[0], y = _c[1], a = _c.slice(2); - var _d = [ - 1, - "hello", - true - ], x = _d[0], y = _d[1], z = _d[2], a = _d.slice(3); - _e = [ - 1, - "hello", - true - ], a = _e.slice(0); - _f = [ - 1, - "hello", - true - ], x = _f[0], a = _f.slice(1); - _g = [ - 1, - "hello", - true - ], x = _g[0], y = _g[1], a = _g.slice(2); - _h = [ - 1, - "hello", - true - ], x = _h[0], y = _h[1], z = _h[2], a = _h.slice(3); + var _a = [1, "hello", true], a = _a.slice(0); + var _b = [1, "hello", true], x = _b[0], a = _b.slice(1); + var _c = [1, "hello", true], x = _c[0], y = _c[1], a = _c.slice(2); + var _d = [1, "hello", true], x = _d[0], y = _d[1], z = _d[2], a = _d.slice(3); + _e = [1, "hello", true], a = _e.slice(0); + _f = [1, "hello", true], x = _f[0], a = _f.slice(1); + _g = [1, "hello", true], x = _g[0], y = _g[1], a = _g.slice(2); + _h = [1, "hello", true], x = _h[0], y = _h[1], z = _h[2], a = _h.slice(3); var _e, _f, _g, _h; } diff --git a/tests/baselines/reference/declareDottedExtend.types b/tests/baselines/reference/declareDottedExtend.types index 5efcea51b26..6b529b5e00d 100644 --- a/tests/baselines/reference/declareDottedExtend.types +++ b/tests/baselines/reference/declareDottedExtend.types @@ -14,12 +14,12 @@ import ab = A.B; class D extends ab.C{ } >D : D ->ab : unknown +>ab : typeof ab >C : ab.C class E extends A.B.C{ } >E : E ->A : unknown ->B : unknown +>A : typeof A +>B : typeof ab >C : ab.C diff --git a/tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.types b/tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.types index e861059af75..70718471d50 100644 --- a/tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.types +++ b/tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.types @@ -7,7 +7,7 @@ declare module "express" { function express(): express.ExpressServer; >express : typeof express >express : unknown ->ExpressServer : export=.ExpressServer +>ExpressServer : express.ExpressServer module express { >express : typeof express diff --git a/tests/baselines/reference/declareFileExportAssignment.types b/tests/baselines/reference/declareFileExportAssignment.types index 80cfbf82387..f30586b07e3 100644 --- a/tests/baselines/reference/declareFileExportAssignment.types +++ b/tests/baselines/reference/declareFileExportAssignment.types @@ -27,24 +27,24 @@ module m2 { } var m2: { ->m2 : { (): export=.connectExport; test1: export=.connectModule; test2(): export=.connectModule; } +>m2 : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; } (): m2.connectExport; >m2 : unknown ->connectExport : export=.connectExport +>connectExport : m2.connectExport test1: m2.connectModule; ->test1 : export=.connectModule +>test1 : m2.connectModule >m2 : unknown ->connectModule : export=.connectModule +>connectModule : m2.connectModule test2(): m2.connectModule; ->test2 : () => export=.connectModule +>test2 : () => m2.connectModule >m2 : unknown ->connectModule : export=.connectModule +>connectModule : m2.connectModule }; export = m2; ->m2 : { (): export=.connectExport; test1: export=.connectModule; test2(): export=.connectModule; } +>m2 : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; } diff --git a/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types b/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types index 376a9d7ba6f..675dc38c869 100644 --- a/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types +++ b/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types @@ -28,24 +28,24 @@ module m2 { var x = 10, m2: { >x : number ->m2 : { (): export=.connectExport; test1: export=.connectModule; test2(): export=.connectModule; } +>m2 : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; } (): m2.connectExport; >m2 : unknown ->connectExport : export=.connectExport +>connectExport : m2.connectExport test1: m2.connectModule; ->test1 : export=.connectModule +>test1 : m2.connectModule >m2 : unknown ->connectModule : export=.connectModule +>connectModule : m2.connectModule test2(): m2.connectModule; ->test2 : () => export=.connectModule +>test2 : () => m2.connectModule >m2 : unknown ->connectModule : export=.connectModule +>connectModule : m2.connectModule }; export = m2; ->m2 : { (): export=.connectExport; test1: export=.connectModule; test2(): export=.connectModule; } +>m2 : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; } diff --git a/tests/baselines/reference/decoratorOnClass1.js b/tests/baselines/reference/decoratorOnClass1.js index 24be2517469..cd5c51e7a93 100644 --- a/tests/baselines/reference/decoratorOnClass1.js +++ b/tests/baselines/reference/decoratorOnClass1.js @@ -6,22 +6,18 @@ class C { } //// [decoratorOnClass1.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } - C = __decorate([dec], C); + C = __decorate([ + dec + ], C); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClass2.js b/tests/baselines/reference/decoratorOnClass2.js index 92741819e94..fbd9a106ddf 100644 --- a/tests/baselines/reference/decoratorOnClass2.js +++ b/tests/baselines/reference/decoratorOnClass2.js @@ -6,23 +6,19 @@ export class C { } //// [decoratorOnClass2.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } - C = __decorate([dec], C); + C = __decorate([ + dec + ], C); return C; })(); exports.C = C; diff --git a/tests/baselines/reference/decoratorOnClass3.js b/tests/baselines/reference/decoratorOnClass3.js index 766acc42072..21536028091 100644 --- a/tests/baselines/reference/decoratorOnClass3.js +++ b/tests/baselines/reference/decoratorOnClass3.js @@ -7,22 +7,18 @@ class C { } //// [decoratorOnClass3.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } - C = __decorate([dec], C); + C = __decorate([ + dec + ], C); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClass4.js b/tests/baselines/reference/decoratorOnClass4.js index 95bde549379..5099d16b5b4 100644 --- a/tests/baselines/reference/decoratorOnClass4.js +++ b/tests/baselines/reference/decoratorOnClass4.js @@ -6,22 +6,18 @@ class C { } //// [decoratorOnClass4.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } - C = __decorate([dec()], C); + C = __decorate([ + dec() + ], C); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClass5.js b/tests/baselines/reference/decoratorOnClass5.js index a93d625f491..0555f618e7e 100644 --- a/tests/baselines/reference/decoratorOnClass5.js +++ b/tests/baselines/reference/decoratorOnClass5.js @@ -6,22 +6,18 @@ class C { } //// [decoratorOnClass5.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } - C = __decorate([dec()], C); + C = __decorate([ + dec() + ], C); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClass8.js b/tests/baselines/reference/decoratorOnClass8.js index 0e782d45e11..fad73c0c8fc 100644 --- a/tests/baselines/reference/decoratorOnClass8.js +++ b/tests/baselines/reference/decoratorOnClass8.js @@ -6,22 +6,18 @@ class C { } //// [decoratorOnClass8.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } - C = __decorate([dec()], C); + C = __decorate([ + dec() + ], C); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassAccessor1.js b/tests/baselines/reference/decoratorOnClassAccessor1.js index d78e776cb96..68fa7ccec0a 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor1.js +++ b/tests/baselines/reference/decoratorOnClassAccessor1.js @@ -6,29 +6,24 @@ class C { } //// [decoratorOnClassAccessor1.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } Object.defineProperty(C.prototype, "accessor", { - get: function () { - return 1; - }, + get: function () { return 1; }, enumerable: true, configurable: true }); - Object.defineProperty(C.prototype, "accessor", __decorate([dec], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor"))); + Object.defineProperty(C.prototype, "accessor", + __decorate([ + dec + ], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor"))); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassAccessor2.js b/tests/baselines/reference/decoratorOnClassAccessor2.js index f1bfce9ea6d..17d3e2e422d 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor2.js +++ b/tests/baselines/reference/decoratorOnClassAccessor2.js @@ -6,29 +6,24 @@ class C { } //// [decoratorOnClassAccessor2.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } Object.defineProperty(C.prototype, "accessor", { - get: function () { - return 1; - }, + get: function () { return 1; }, enumerable: true, configurable: true }); - Object.defineProperty(C.prototype, "accessor", __decorate([dec], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor"))); + Object.defineProperty(C.prototype, "accessor", + __decorate([ + dec + ], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor"))); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassAccessor3.errors.txt b/tests/baselines/reference/decoratorOnClassAccessor3.errors.txt index b75b7e0d8b6..1a1e6503355 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor3.errors.txt +++ b/tests/baselines/reference/decoratorOnClassAccessor3.errors.txt @@ -1,35 +1,11 @@ tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts(4,5): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts(4,5): error TS2304: Cannot find name 'public'. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts(4,12): error TS1005: ';' expected. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts(4,16): error TS1146: Declaration expected. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts(4,17): error TS2304: Cannot find name 'get'. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts(4,21): error TS1005: ';' expected. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts(4,21): error TS2304: Cannot find name 'accessor'. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts(4,32): error TS1005: ';' expected. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts(5,1): error TS1128: Declaration or statement expected. -==== tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts (9 errors) ==== +==== tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts (1 errors) ==== declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; class C { public @dec get accessor() { return 1; } ~~~~~~ !!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. - ~~~~~~ -!!! error TS2304: Cannot find name 'public'. - ~ -!!! error TS1005: ';' expected. - -!!! error TS1146: Declaration expected. - ~~~ -!!! error TS2304: Cannot find name 'get'. - ~~~~~~~~ -!!! error TS1005: ';' expected. - ~~~~~~~~ -!!! error TS2304: Cannot find name 'accessor'. - ~ -!!! error TS1005: ';' expected. - } - ~ -!!! error TS1128: Declaration or statement expected. \ No newline at end of file + } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassAccessor3.js b/tests/baselines/reference/decoratorOnClassAccessor3.js index f48a755953f..23e689f3114 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor3.js +++ b/tests/baselines/reference/decoratorOnClassAccessor3.js @@ -6,14 +6,24 @@ class C { } //// [decoratorOnClassAccessor3.js] +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; var C = (function () { function C() { } + Object.defineProperty(C.prototype, "accessor", { + get: function () { return 1; }, + enumerable: true, + configurable: true + }); + Object.defineProperty(C.prototype, "accessor", + __decorate([ + dec + ], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor"))); return C; })(); -public; -get; -accessor(); -{ - return 1; -} diff --git a/tests/baselines/reference/decoratorOnClassAccessor4.js b/tests/baselines/reference/decoratorOnClassAccessor4.js index 77dbc569e5a..77bcb568fe1 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor4.js +++ b/tests/baselines/reference/decoratorOnClassAccessor4.js @@ -6,28 +6,24 @@ class C { } //// [decoratorOnClassAccessor4.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } Object.defineProperty(C.prototype, "accessor", { - set: function (value) { - }, + set: function (value) { }, enumerable: true, configurable: true }); - Object.defineProperty(C.prototype, "accessor", __decorate([dec], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor"))); + Object.defineProperty(C.prototype, "accessor", + __decorate([ + dec + ], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor"))); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassAccessor5.js b/tests/baselines/reference/decoratorOnClassAccessor5.js index bfd6518c59b..37fc33abefd 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor5.js +++ b/tests/baselines/reference/decoratorOnClassAccessor5.js @@ -6,28 +6,24 @@ class C { } //// [decoratorOnClassAccessor5.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } Object.defineProperty(C.prototype, "accessor", { - set: function (value) { - }, + set: function (value) { }, enumerable: true, configurable: true }); - Object.defineProperty(C.prototype, "accessor", __decorate([dec], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor"))); + Object.defineProperty(C.prototype, "accessor", + __decorate([ + dec + ], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor"))); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassAccessor6.errors.txt b/tests/baselines/reference/decoratorOnClassAccessor6.errors.txt index ec22ae0b3e1..f43827c0e4b 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor6.errors.txt +++ b/tests/baselines/reference/decoratorOnClassAccessor6.errors.txt @@ -1,44 +1,11 @@ tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(4,5): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(4,5): error TS2304: Cannot find name 'public'. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(4,12): error TS1005: ';' expected. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(4,16): error TS1146: Declaration expected. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(4,17): error TS2304: Cannot find name 'set'. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(4,21): error TS1005: ';' expected. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(4,21): error TS2304: Cannot find name 'accessor'. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(4,30): error TS2304: Cannot find name 'value'. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(4,35): error TS1005: ',' expected. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(4,37): error TS2304: Cannot find name 'number'. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(4,45): error TS1005: ';' expected. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(5,1): error TS1128: Declaration or statement expected. -==== tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts (12 errors) ==== +==== tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts (1 errors) ==== declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; class C { public @dec set accessor(value: number) { } ~~~~~~ !!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. - ~~~~~~ -!!! error TS2304: Cannot find name 'public'. - ~ -!!! error TS1005: ';' expected. - -!!! error TS1146: Declaration expected. - ~~~ -!!! error TS2304: Cannot find name 'set'. - ~~~~~~~~ -!!! error TS1005: ';' expected. - ~~~~~~~~ -!!! error TS2304: Cannot find name 'accessor'. - ~~~~~ -!!! error TS2304: Cannot find name 'value'. - ~ -!!! error TS1005: ',' expected. - ~~~~~~ -!!! error TS2304: Cannot find name 'number'. - ~ -!!! error TS1005: ';' expected. - } - ~ -!!! error TS1128: Declaration or statement expected. \ No newline at end of file + } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassAccessor6.js b/tests/baselines/reference/decoratorOnClassAccessor6.js index 905e3d3b2db..465e13ebb1d 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor6.js +++ b/tests/baselines/reference/decoratorOnClassAccessor6.js @@ -6,13 +6,24 @@ class C { } //// [decoratorOnClassAccessor6.js] +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; var C = (function () { function C() { } + Object.defineProperty(C.prototype, "accessor", { + set: function (value) { }, + enumerable: true, + configurable: true + }); + Object.defineProperty(C.prototype, "accessor", + __decorate([ + dec + ], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor"))); return C; })(); -public; -set; -accessor(value, number); -{ -} diff --git a/tests/baselines/reference/decoratorOnClassConstructor1.errors.txt b/tests/baselines/reference/decoratorOnClassConstructor1.errors.txt index 14a164eccb4..279cf38894f 100644 --- a/tests/baselines/reference/decoratorOnClassConstructor1.errors.txt +++ b/tests/baselines/reference/decoratorOnClassConstructor1.errors.txt @@ -6,6 +6,6 @@ tests/cases/conformance/decorators/class/constructor/decoratorOnClassConstructor class C { @dec constructor() {} - ~~~~~~~~~~~~~~~~~~~~~ + ~ !!! error TS1206: Decorators are not valid here. } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassConstructorParameter1.js b/tests/baselines/reference/decoratorOnClassConstructorParameter1.js index 0c86a1ccf7a..a1748a725ba 100644 --- a/tests/baselines/reference/decoratorOnClassConstructorParameter1.js +++ b/tests/baselines/reference/decoratorOnClassConstructorParameter1.js @@ -6,22 +6,19 @@ class C { } //// [decoratorOnClassConstructorParameter1.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; +var __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } }; var C = (function () { function C(p) { } - __decorate([dec], C, void 0, 0); + C = __decorate([ + __param(0, dec) + ], C); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassConstructorParameter4.errors.txt b/tests/baselines/reference/decoratorOnClassConstructorParameter4.errors.txt index 5969cfca069..61ff1433662 100644 --- a/tests/baselines/reference/decoratorOnClassConstructorParameter4.errors.txt +++ b/tests/baselines/reference/decoratorOnClassConstructorParameter4.errors.txt @@ -1,11 +1,14 @@ +tests/cases/conformance/decorators/class/constructor/parameter/decoratorOnClassConstructorParameter4.ts(4,17): error TS1003: Identifier expected. tests/cases/conformance/decorators/class/constructor/parameter/decoratorOnClassConstructorParameter4.ts(4,24): error TS1005: ',' expected. -==== tests/cases/conformance/decorators/class/constructor/parameter/decoratorOnClassConstructorParameter4.ts (1 errors) ==== +==== tests/cases/conformance/decorators/class/constructor/parameter/decoratorOnClassConstructorParameter4.ts (2 errors) ==== declare function dec(target: Function, propertyKey: string | symbol, parameterIndex: number): void; class C { constructor(public @dec p: number) {} + ~~~~~~ +!!! error TS1003: Identifier expected. ~ !!! error TS1005: ',' expected. } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassConstructorParameter4.js b/tests/baselines/reference/decoratorOnClassConstructorParameter4.js index 07dc7cae075..638cb1cda7e 100644 --- a/tests/baselines/reference/decoratorOnClassConstructorParameter4.js +++ b/tests/baselines/reference/decoratorOnClassConstructorParameter4.js @@ -6,22 +6,19 @@ class C { } //// [decoratorOnClassConstructorParameter4.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; +var __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } }; var C = (function () { - function C(public, p) { + function C(, p) { } - __decorate([dec], C, void 0, 1); + C = __decorate([ + __param(1, dec) + ], C); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassMethod1.js b/tests/baselines/reference/decoratorOnClassMethod1.js index be9c00290fb..23be1094305 100644 --- a/tests/baselines/reference/decoratorOnClassMethod1.js +++ b/tests/baselines/reference/decoratorOnClassMethod1.js @@ -6,24 +6,20 @@ class C { } //// [decoratorOnClassMethod1.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } - C.prototype.method = function () { - }; - Object.defineProperty(C.prototype, "method", __decorate([dec], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); + C.prototype.method = function () { }; + Object.defineProperty(C.prototype, "method", + __decorate([ + dec + ], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassMethod10.js b/tests/baselines/reference/decoratorOnClassMethod10.js index 3dd38f806bd..f87e3137777 100644 --- a/tests/baselines/reference/decoratorOnClassMethod10.js +++ b/tests/baselines/reference/decoratorOnClassMethod10.js @@ -6,24 +6,20 @@ class C { } //// [decoratorOnClassMethod10.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } - C.prototype.method = function () { - }; - Object.defineProperty(C.prototype, "method", __decorate([dec], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); + C.prototype.method = function () { }; + Object.defineProperty(C.prototype, "method", + __decorate([ + dec + ], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassMethod11.errors.txt b/tests/baselines/reference/decoratorOnClassMethod11.errors.txt new file mode 100644 index 00000000000..5e56c0b62a8 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethod11.errors.txt @@ -0,0 +1,14 @@ +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 (1 errors) ==== + module M { + class C { + decorator(target: Object, key: string): void { } + + @this.decorator + ~~~~ +!!! error TS2331: 'this' cannot be referenced in a module body. + method() { } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassMethod11.js b/tests/baselines/reference/decoratorOnClassMethod11.js new file mode 100644 index 00000000000..71d4298f02c --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethod11.js @@ -0,0 +1,32 @@ +//// [decoratorOnClassMethod11.ts] +module M { + class C { + decorator(target: Object, key: string): void { } + + @this.decorator + method() { } + } +} + +//// [decoratorOnClassMethod11.js] +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +var M; +(function (M) { + var C = (function () { + function C() { + } + C.prototype.decorator = function (target, key) { }; + C.prototype.method = function () { }; + Object.defineProperty(C.prototype, "method", + __decorate([ + this.decorator + ], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); + return C; + })(); +})(M || (M = {})); diff --git a/tests/baselines/reference/decoratorOnClassMethod12.errors.txt b/tests/baselines/reference/decoratorOnClassMethod12.errors.txt new file mode 100644 index 00000000000..14845839089 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethod12.errors.txt @@ -0,0 +1,15 @@ +tests/cases/conformance/decorators/class/method/decoratorOnClassMethod12.ts(6,10): error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class + + +==== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod12.ts (1 errors) ==== + module M { + class S { + decorator(target: Object, key: string): void { } + } + class C extends S { + @super.decorator + ~~~~~ +!!! error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class + method() { } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassMethod12.js b/tests/baselines/reference/decoratorOnClassMethod12.js new file mode 100644 index 00000000000..7f23947929c --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethod12.js @@ -0,0 +1,46 @@ +//// [decoratorOnClassMethod12.ts] +module M { + class S { + decorator(target: Object, key: string): void { } + } + class C extends S { + @super.decorator + method() { } + } +} + +//// [decoratorOnClassMethod12.js] +var __extends = this.__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 __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +var M; +(function (M) { + var S = (function () { + function S() { + } + S.prototype.decorator = function (target, key) { }; + return S; + })(); + var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + C.prototype.method = function () { }; + Object.defineProperty(C.prototype, "method", + __decorate([ + _super.decorator + ], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); + return C; + })(S); +})(M || (M = {})); diff --git a/tests/baselines/reference/decoratorOnClassMethod13.js b/tests/baselines/reference/decoratorOnClassMethod13.js new file mode 100644 index 00000000000..4321bbb0156 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethod13.js @@ -0,0 +1,29 @@ +//// [decoratorOnClassMethod13.ts] +declare function dec(): (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor; + +class C { + @dec ["1"]() { } + @dec ["b"]() { } +} + +//// [decoratorOnClassMethod13.js] +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +class C { + [_a = "1"]() { } + [_b = "b"]() { } +} +Object.defineProperty(C.prototype, _a, + __decorate([ + dec + ], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a))); +Object.defineProperty(C.prototype, _b, + __decorate([ + dec + ], C.prototype, _b, Object.getOwnPropertyDescriptor(C.prototype, _b))); +var _a, _b; diff --git a/tests/baselines/reference/decoratorOnClassMethod13.types b/tests/baselines/reference/decoratorOnClassMethod13.types new file mode 100644 index 00000000000..8c34805792f --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethod13.types @@ -0,0 +1,21 @@ +=== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod13.ts === +declare function dec(): (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor; +>dec : () => (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor +>T : T +>target : any +>propertyKey : string +>descriptor : TypedPropertyDescriptor +>TypedPropertyDescriptor : TypedPropertyDescriptor +>T : T +>TypedPropertyDescriptor : TypedPropertyDescriptor +>T : T + +class C { +>C : C + + @dec ["1"]() { } +>dec : unknown + + @dec ["b"]() { } +>dec : unknown +} diff --git a/tests/baselines/reference/decoratorOnClassMethod2.js b/tests/baselines/reference/decoratorOnClassMethod2.js index b7df7b9ba9c..33a22f419d4 100644 --- a/tests/baselines/reference/decoratorOnClassMethod2.js +++ b/tests/baselines/reference/decoratorOnClassMethod2.js @@ -6,24 +6,20 @@ class C { } //// [decoratorOnClassMethod2.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } - C.prototype.method = function () { - }; - Object.defineProperty(C.prototype, "method", __decorate([dec], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); + C.prototype.method = function () { }; + Object.defineProperty(C.prototype, "method", + __decorate([ + dec + ], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassMethod3.errors.txt b/tests/baselines/reference/decoratorOnClassMethod3.errors.txt index b2173dedf9e..2775ab9f144 100644 --- a/tests/baselines/reference/decoratorOnClassMethod3.errors.txt +++ b/tests/baselines/reference/decoratorOnClassMethod3.errors.txt @@ -1,29 +1,11 @@ tests/cases/conformance/decorators/class/method/decoratorOnClassMethod3.ts(4,5): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/conformance/decorators/class/method/decoratorOnClassMethod3.ts(4,5): error TS2304: Cannot find name 'public'. -tests/cases/conformance/decorators/class/method/decoratorOnClassMethod3.ts(4,12): error TS1005: ';' expected. -tests/cases/conformance/decorators/class/method/decoratorOnClassMethod3.ts(4,16): error TS1146: Declaration expected. -tests/cases/conformance/decorators/class/method/decoratorOnClassMethod3.ts(4,17): error TS2304: Cannot find name 'method'. -tests/cases/conformance/decorators/class/method/decoratorOnClassMethod3.ts(4,26): error TS1005: ';' expected. -tests/cases/conformance/decorators/class/method/decoratorOnClassMethod3.ts(5,1): error TS1128: Declaration or statement expected. -==== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod3.ts (7 errors) ==== +==== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod3.ts (1 errors) ==== declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; class C { public @dec method() {} ~~~~~~ !!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. - ~~~~~~ -!!! error TS2304: Cannot find name 'public'. - ~ -!!! error TS1005: ';' expected. - -!!! error TS1146: Declaration expected. - ~~~~~~ -!!! error TS2304: Cannot find name 'method'. - ~ -!!! error TS1005: ';' expected. - } - ~ -!!! error TS1128: Declaration or statement expected. \ No newline at end of file + } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassMethod3.js b/tests/baselines/reference/decoratorOnClassMethod3.js index 3a011845275..f93b7d7a6b2 100644 --- a/tests/baselines/reference/decoratorOnClassMethod3.js +++ b/tests/baselines/reference/decoratorOnClassMethod3.js @@ -6,12 +6,20 @@ class C { } //// [decoratorOnClassMethod3.js] +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; var C = (function () { function C() { } + C.prototype.method = function () { }; + Object.defineProperty(C.prototype, "method", + __decorate([ + dec + ], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); return C; })(); -public; -method(); -{ -} diff --git a/tests/baselines/reference/decoratorOnClassMethod4.js b/tests/baselines/reference/decoratorOnClassMethod4.js index 7021e5af328..038432f2cf0 100644 --- a/tests/baselines/reference/decoratorOnClassMethod4.js +++ b/tests/baselines/reference/decoratorOnClassMethod4.js @@ -6,22 +6,18 @@ class C { } //// [decoratorOnClassMethod4.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; class C { - [_a = "method"]() { - } + [_a = "method"]() { } } -Object.defineProperty(C.prototype, _a, __decorate([dec], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a))); +Object.defineProperty(C.prototype, _a, + __decorate([ + dec + ], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a))); var _a; diff --git a/tests/baselines/reference/decoratorOnClassMethod5.js b/tests/baselines/reference/decoratorOnClassMethod5.js index 3bde0968eab..460c11f145b 100644 --- a/tests/baselines/reference/decoratorOnClassMethod5.js +++ b/tests/baselines/reference/decoratorOnClassMethod5.js @@ -6,22 +6,18 @@ class C { } //// [decoratorOnClassMethod5.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; class C { - [_a = "method"]() { - } + [_a = "method"]() { } } -Object.defineProperty(C.prototype, _a, __decorate([dec()], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a))); +Object.defineProperty(C.prototype, _a, + __decorate([ + dec() + ], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a))); var _a; diff --git a/tests/baselines/reference/decoratorOnClassMethod6.js b/tests/baselines/reference/decoratorOnClassMethod6.js index 126dc47ad2f..9f120599183 100644 --- a/tests/baselines/reference/decoratorOnClassMethod6.js +++ b/tests/baselines/reference/decoratorOnClassMethod6.js @@ -6,22 +6,18 @@ class C { } //// [decoratorOnClassMethod6.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; class C { - [_a = "method"]() { - } + [_a = "method"]() { } } -Object.defineProperty(C.prototype, _a, __decorate([dec], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a))); +Object.defineProperty(C.prototype, _a, + __decorate([ + dec + ], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a))); var _a; diff --git a/tests/baselines/reference/decoratorOnClassMethod7.js b/tests/baselines/reference/decoratorOnClassMethod7.js index 34fbdb53ca5..6ab01e68bba 100644 --- a/tests/baselines/reference/decoratorOnClassMethod7.js +++ b/tests/baselines/reference/decoratorOnClassMethod7.js @@ -6,22 +6,18 @@ class C { } //// [decoratorOnClassMethod7.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; class C { - [_a = "method"]() { - } + [_a = "method"]() { } } -Object.defineProperty(C.prototype, _a, __decorate([dec], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a))); +Object.defineProperty(C.prototype, _a, + __decorate([ + dec + ], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a))); var _a; diff --git a/tests/baselines/reference/decoratorOnClassMethod8.js b/tests/baselines/reference/decoratorOnClassMethod8.js index 629ff4e253b..3e88f8c2793 100644 --- a/tests/baselines/reference/decoratorOnClassMethod8.js +++ b/tests/baselines/reference/decoratorOnClassMethod8.js @@ -6,24 +6,20 @@ class C { } //// [decoratorOnClassMethod8.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } - C.prototype.method = function () { - }; - Object.defineProperty(C.prototype, "method", __decorate([dec], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); + C.prototype.method = function () { }; + Object.defineProperty(C.prototype, "method", + __decorate([ + dec + ], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassMethodParameter1.js b/tests/baselines/reference/decoratorOnClassMethodParameter1.js index 1dcb057e530..d228ed9302b 100644 --- a/tests/baselines/reference/decoratorOnClassMethodParameter1.js +++ b/tests/baselines/reference/decoratorOnClassMethodParameter1.js @@ -6,24 +6,21 @@ class C { } //// [decoratorOnClassMethodParameter1.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; +var __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } }; var C = (function () { function C() { } - C.prototype.method = function (p) { - }; - __decorate([dec], C.prototype, "method", 0); + C.prototype.method = function (p) { }; + Object.defineProperty(C.prototype, "method", + __decorate([ + __param(0, dec) + ], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassProperty1.js b/tests/baselines/reference/decoratorOnClassProperty1.js index efc6a2c04db..aa38252b995 100644 --- a/tests/baselines/reference/decoratorOnClassProperty1.js +++ b/tests/baselines/reference/decoratorOnClassProperty1.js @@ -6,22 +6,18 @@ class C { } //// [decoratorOnClassProperty1.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } - __decorate([dec], C.prototype, "prop"); + __decorate([ + dec + ], C.prototype, "prop"); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassProperty10.js b/tests/baselines/reference/decoratorOnClassProperty10.js index d55eb71e3c6..bccbc0bb737 100644 --- a/tests/baselines/reference/decoratorOnClassProperty10.js +++ b/tests/baselines/reference/decoratorOnClassProperty10.js @@ -6,22 +6,18 @@ class C { } //// [decoratorOnClassProperty10.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } - __decorate([dec()], C.prototype, "prop"); + __decorate([ + dec() + ], C.prototype, "prop"); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassProperty11.js b/tests/baselines/reference/decoratorOnClassProperty11.js index 63e5f8d02e9..f31e40d3c40 100644 --- a/tests/baselines/reference/decoratorOnClassProperty11.js +++ b/tests/baselines/reference/decoratorOnClassProperty11.js @@ -6,22 +6,18 @@ class C { } //// [decoratorOnClassProperty11.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } - __decorate([dec], C.prototype, "prop"); + __decorate([ + dec + ], C.prototype, "prop"); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassProperty2.js b/tests/baselines/reference/decoratorOnClassProperty2.js index d52baa79202..477320b40fa 100644 --- a/tests/baselines/reference/decoratorOnClassProperty2.js +++ b/tests/baselines/reference/decoratorOnClassProperty2.js @@ -6,22 +6,18 @@ class C { } //// [decoratorOnClassProperty2.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } - __decorate([dec], C.prototype, "prop"); + __decorate([ + dec + ], C.prototype, "prop"); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassProperty3.errors.txt b/tests/baselines/reference/decoratorOnClassProperty3.errors.txt index 29438bd67a9..a6321c55426 100644 --- a/tests/baselines/reference/decoratorOnClassProperty3.errors.txt +++ b/tests/baselines/reference/decoratorOnClassProperty3.errors.txt @@ -1,26 +1,11 @@ tests/cases/conformance/decorators/class/property/decoratorOnClassProperty3.ts(4,5): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/conformance/decorators/class/property/decoratorOnClassProperty3.ts(4,5): error TS2304: Cannot find name 'public'. -tests/cases/conformance/decorators/class/property/decoratorOnClassProperty3.ts(4,12): error TS1005: ';' expected. -tests/cases/conformance/decorators/class/property/decoratorOnClassProperty3.ts(4,16): error TS1146: Declaration expected. -tests/cases/conformance/decorators/class/property/decoratorOnClassProperty3.ts(4,17): error TS2304: Cannot find name 'prop'. -tests/cases/conformance/decorators/class/property/decoratorOnClassProperty3.ts(5,1): error TS1128: Declaration or statement expected. -==== tests/cases/conformance/decorators/class/property/decoratorOnClassProperty3.ts (6 errors) ==== +==== tests/cases/conformance/decorators/class/property/decoratorOnClassProperty3.ts (1 errors) ==== declare function dec(target: any, propertyKey: string): void; class C { public @dec prop; ~~~~~~ !!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. - ~~~~~~ -!!! error TS2304: Cannot find name 'public'. - ~ -!!! error TS1005: ';' expected. - -!!! error TS1146: Declaration expected. - ~~~~ -!!! error TS2304: Cannot find name 'prop'. - } - ~ -!!! error TS1128: Declaration or statement expected. \ No newline at end of file + } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassProperty3.js b/tests/baselines/reference/decoratorOnClassProperty3.js index 6c9945677ca..05476c66e7d 100644 --- a/tests/baselines/reference/decoratorOnClassProperty3.js +++ b/tests/baselines/reference/decoratorOnClassProperty3.js @@ -6,10 +6,18 @@ class C { } //// [decoratorOnClassProperty3.js] +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; var C = (function () { function C() { } + __decorate([ + dec + ], C.prototype, "prop"); return C; })(); -public; -prop; diff --git a/tests/baselines/reference/decoratorOnClassProperty6.js b/tests/baselines/reference/decoratorOnClassProperty6.js index 7f087156bc7..46e2d5fc069 100644 --- a/tests/baselines/reference/decoratorOnClassProperty6.js +++ b/tests/baselines/reference/decoratorOnClassProperty6.js @@ -6,22 +6,18 @@ class C { } //// [decoratorOnClassProperty6.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } - __decorate([dec], C.prototype, "prop"); + __decorate([ + dec + ], C.prototype, "prop"); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassProperty7.js b/tests/baselines/reference/decoratorOnClassProperty7.js index ba2c8383a2c..14ca0612cb1 100644 --- a/tests/baselines/reference/decoratorOnClassProperty7.js +++ b/tests/baselines/reference/decoratorOnClassProperty7.js @@ -6,22 +6,18 @@ class C { } //// [decoratorOnClassProperty7.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } - __decorate([dec], C.prototype, "prop"); + __decorate([ + dec + ], C.prototype, "prop"); return C; })(); diff --git a/tests/baselines/reference/decoratorOnEnum.errors.txt b/tests/baselines/reference/decoratorOnEnum.errors.txt index 21a6d39aab5..8adf03e548c 100644 --- a/tests/baselines/reference/decoratorOnEnum.errors.txt +++ b/tests/baselines/reference/decoratorOnEnum.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/decorators/invalid/decoratorOnEnum.ts(4,6): error TS1206: Decorators are not valid here. +tests/cases/conformance/decorators/invalid/decoratorOnEnum.ts(3,1): error TS1206: Decorators are not valid here. ==== tests/cases/conformance/decorators/invalid/decoratorOnEnum.ts (1 errors) ==== declare function dec(target: T): T; @dec - enum E { - ~ + ~ !!! error TS1206: Decorators are not valid here. + enum E { } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnFunctionDeclaration.errors.txt b/tests/baselines/reference/decoratorOnFunctionDeclaration.errors.txt index bda00f1a85f..24d5eb35092 100644 --- a/tests/baselines/reference/decoratorOnFunctionDeclaration.errors.txt +++ b/tests/baselines/reference/decoratorOnFunctionDeclaration.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/decorators/invalid/decoratorOnFunctionDeclaration.ts(4,10): error TS1206: Decorators are not valid here. +tests/cases/conformance/decorators/invalid/decoratorOnFunctionDeclaration.ts(3,1): error TS1206: Decorators are not valid here. ==== tests/cases/conformance/decorators/invalid/decoratorOnFunctionDeclaration.ts (1 errors) ==== declare function dec(target: T): T; @dec - function F() { - ~ + ~ !!! error TS1206: Decorators are not valid here. + function F() { } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnImportEquals1.errors.txt b/tests/baselines/reference/decoratorOnImportEquals1.errors.txt index a09a0b01427..cc75018ca49 100644 --- a/tests/baselines/reference/decoratorOnImportEquals1.errors.txt +++ b/tests/baselines/reference/decoratorOnImportEquals1.errors.txt @@ -10,8 +10,7 @@ tests/cases/conformance/decorators/invalid/decoratorOnImportEquals1.ts(8,5): err module M2 { @dec - ~~~~ - import X = M1.X; - ~~~~~~~~~~~~~~~~~~~~ + ~ !!! error TS1206: Decorators are not valid here. + import X = M1.X; } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnImportEquals2.errors.txt b/tests/baselines/reference/decoratorOnImportEquals2.errors.txt index 5701afe569b..0c64db354e8 100644 --- a/tests/baselines/reference/decoratorOnImportEquals2.errors.txt +++ b/tests/baselines/reference/decoratorOnImportEquals2.errors.txt @@ -3,10 +3,9 @@ tests/cases/conformance/decorators/invalid/decoratorOnImportEquals2_1.ts(1,1): e ==== tests/cases/conformance/decorators/invalid/decoratorOnImportEquals2_1.ts (1 errors) ==== @dec - ~~~~ - import lib = require('./decoratorOnImportEquals2_0'); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~ !!! error TS1206: Decorators are not valid here. + import lib = require('./decoratorOnImportEquals2_0'); declare function dec(target: T): T; ==== tests/cases/conformance/decorators/invalid/decoratorOnImportEquals2_0.ts (0 errors) ==== diff --git a/tests/baselines/reference/decoratorOnInterface.errors.txt b/tests/baselines/reference/decoratorOnInterface.errors.txt index 055b43fa877..65aec166d70 100644 --- a/tests/baselines/reference/decoratorOnInterface.errors.txt +++ b/tests/baselines/reference/decoratorOnInterface.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/decorators/invalid/decoratorOnInterface.ts(4,11): error TS1206: Decorators are not valid here. +tests/cases/conformance/decorators/invalid/decoratorOnInterface.ts(3,1): error TS1206: Decorators are not valid here. ==== tests/cases/conformance/decorators/invalid/decoratorOnInterface.ts (1 errors) ==== declare function dec(target: T): T; @dec - interface I { - ~ + ~ !!! error TS1206: Decorators are not valid here. + interface I { } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnInternalModule.errors.txt b/tests/baselines/reference/decoratorOnInternalModule.errors.txt index 2fd92dfb250..e34e381d9e5 100644 --- a/tests/baselines/reference/decoratorOnInternalModule.errors.txt +++ b/tests/baselines/reference/decoratorOnInternalModule.errors.txt @@ -1,12 +1,12 @@ -tests/cases/conformance/decorators/invalid/decoratorOnInternalModule.ts(4,8): error TS1206: Decorators are not valid here. +tests/cases/conformance/decorators/invalid/decoratorOnInternalModule.ts(3,1): error TS1206: Decorators are not valid here. ==== tests/cases/conformance/decorators/invalid/decoratorOnInternalModule.ts (1 errors) ==== declare function dec(target: T): T; @dec - module M { - ~ + ~ !!! error TS1206: Decorators are not valid here. + module M { } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnTypeAlias.errors.txt b/tests/baselines/reference/decoratorOnTypeAlias.errors.txt index 0d3109fe463..6d76a0b30d6 100644 --- a/tests/baselines/reference/decoratorOnTypeAlias.errors.txt +++ b/tests/baselines/reference/decoratorOnTypeAlias.errors.txt @@ -5,7 +5,6 @@ tests/cases/conformance/decorators/invalid/decoratorOnTypeAlias.ts(3,1): error T declare function dec(target: T): T; @dec - ~~~~ - type T = number; - ~~~~~~~~~~~~~~~~ -!!! error TS1206: Decorators are not valid here. \ No newline at end of file + ~ +!!! error TS1206: Decorators are not valid here. + type T = number; \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnVar.errors.txt b/tests/baselines/reference/decoratorOnVar.errors.txt index bd87357edad..a2262adf748 100644 --- a/tests/baselines/reference/decoratorOnVar.errors.txt +++ b/tests/baselines/reference/decoratorOnVar.errors.txt @@ -5,7 +5,6 @@ tests/cases/conformance/decorators/invalid/decoratorOnVar.ts(3,1): error TS1206: declare function dec(target: T): T; @dec - ~~~~ - var x: number; - ~~~~~~~~~~~~~~ -!!! error TS1206: Decorators are not valid here. \ No newline at end of file + ~ +!!! error TS1206: Decorators are not valid here. + var x: number; \ No newline at end of file diff --git a/tests/baselines/reference/decrementOperatorWithAnyOtherType.js b/tests/baselines/reference/decrementOperatorWithAnyOtherType.js index 12632572918..34ea154daa6 100644 --- a/tests/baselines/reference/decrementOperatorWithAnyOtherType.js +++ b/tests/baselines/reference/decrementOperatorWithAnyOtherType.js @@ -52,14 +52,8 @@ M.n--; // -- operator on any type var ANY; var ANY1; -var ANY2 = [ - "", - "" -]; -var obj = { - x: 1, - y: null -}; +var ANY2 = ["", ""]; +var obj = { x: 1, y: null }; var A = (function () { function A() { } diff --git a/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.js b/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.js index e5a73aea37d..8e4f927a920 100644 --- a/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.js +++ b/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.js @@ -75,16 +75,9 @@ ANY2--; //// [decrementOperatorWithAnyOtherTypeInvalidOperations.js] // -- operator on any type var ANY1; -var ANY2 = [ - "", - "" -]; +var ANY2 = ["", ""]; var obj; -var obj1 = { - x: "", - y: function () { - } -}; +var obj1 = { x: "", y: function () { } }; function foo() { var a; return a; diff --git a/tests/baselines/reference/decrementOperatorWithNumberType.js b/tests/baselines/reference/decrementOperatorWithNumberType.js index faef864184b..85ed9ca548a 100644 --- a/tests/baselines/reference/decrementOperatorWithNumberType.js +++ b/tests/baselines/reference/decrementOperatorWithNumberType.js @@ -42,10 +42,7 @@ objA.a--, M.n--; //// [decrementOperatorWithNumberType.js] // -- operator on number type var NUMBER; -var NUMBER1 = [ - 1, - 2 -]; +var NUMBER1 = [1, 2]; var A = (function () { function A() { } diff --git a/tests/baselines/reference/decrementOperatorWithNumberTypeInvalidOperations.js b/tests/baselines/reference/decrementOperatorWithNumberTypeInvalidOperations.js index ccc5b6eaa1c..34e862063ce 100644 --- a/tests/baselines/reference/decrementOperatorWithNumberTypeInvalidOperations.js +++ b/tests/baselines/reference/decrementOperatorWithNumberTypeInvalidOperations.js @@ -49,19 +49,12 @@ foo()--; //// [decrementOperatorWithNumberTypeInvalidOperations.js] // -- operator on number type var NUMBER; -var NUMBER1 = [ - 1, - 2 -]; -function foo() { - return 1; -} +var NUMBER1 = [1, 2]; +function foo() { return 1; } var A = (function () { function A() { } - A.foo = function () { - return 1; - }; + A.foo = function () { return 1; }; return A; })(); var M; @@ -74,27 +67,11 @@ var ResultIsNumber1 = --NUMBER1; var ResultIsNumber2 = NUMBER1--; // number type literal var ResultIsNumber3 = --1; -var ResultIsNumber4 = --{ - x: 1, - y: 2 -}; -var ResultIsNumber5 = --{ - x: 1, - y: function (n) { - return n; - } -}; +var ResultIsNumber4 = --{ x: 1, y: 2 }; +var ResultIsNumber5 = --{ x: 1, y: function (n) { return n; } }; var ResultIsNumber6 = 1--; -var ResultIsNumber7 = { - x: 1, - y: 2 -}--; -var ResultIsNumber8 = { - x: 1, - y: function (n) { - return n; - } -}--; +var ResultIsNumber7 = { x: 1, y: 2 }--; +var ResultIsNumber8 = { x: 1, y: function (n) { return n; } }--; // number type expressions var ResultIsNumber9 = --foo(); var ResultIsNumber10 = --A.foo(); diff --git a/tests/baselines/reference/decrementOperatorWithUnsupportedBooleanType.js b/tests/baselines/reference/decrementOperatorWithUnsupportedBooleanType.js index 93737ea87cd..2be74a64d8f 100644 --- a/tests/baselines/reference/decrementOperatorWithUnsupportedBooleanType.js +++ b/tests/baselines/reference/decrementOperatorWithUnsupportedBooleanType.js @@ -57,15 +57,11 @@ objA.a--, M.n--; //// [decrementOperatorWithUnsupportedBooleanType.js] // -- operator on boolean type var BOOLEAN; -function foo() { - return true; -} +function foo() { return true; } var A = (function () { function A() { } - A.foo = function () { - return true; - }; + A.foo = function () { return true; }; return A; })(); var M; @@ -78,27 +74,11 @@ var ResultIsNumber1 = --BOOLEAN; var ResultIsNumber2 = BOOLEAN--; // boolean type literal var ResultIsNumber3 = --true; -var ResultIsNumber4 = --{ - x: true, - y: false -}; -var ResultIsNumber5 = --{ - x: true, - y: function (n) { - return n; - } -}; +var ResultIsNumber4 = --{ x: true, y: false }; +var ResultIsNumber5 = --{ x: true, y: function (n) { return n; } }; var ResultIsNumber6 = true--; -var ResultIsNumber7 = { - x: true, - y: false -}--; -var ResultIsNumber8 = { - x: true, - y: function (n) { - return n; - } -}--; +var ResultIsNumber7 = { x: true, y: false }--; +var ResultIsNumber8 = { x: true, y: function (n) { return n; } }--; // boolean type expressions var ResultIsNumber9 = --objA.a; var ResultIsNumber10 = --M.n; diff --git a/tests/baselines/reference/decrementOperatorWithUnsupportedStringType.js b/tests/baselines/reference/decrementOperatorWithUnsupportedStringType.js index e033acf3e1e..430f9af963f 100644 --- a/tests/baselines/reference/decrementOperatorWithUnsupportedStringType.js +++ b/tests/baselines/reference/decrementOperatorWithUnsupportedStringType.js @@ -68,19 +68,12 @@ objA.a--, M.n--; //// [decrementOperatorWithUnsupportedStringType.js] // -- operator on string type var STRING; -var STRING1 = [ - "", - "" -]; -function foo() { - return ""; -} +var STRING1 = ["", ""]; +function foo() { return ""; } var A = (function () { function A() { } - A.foo = function () { - return ""; - }; + A.foo = function () { return ""; }; return A; })(); var M; @@ -95,27 +88,11 @@ var ResultIsNumber3 = STRING--; var ResultIsNumber4 = STRING1--; // string type literal var ResultIsNumber5 = --""; -var ResultIsNumber6 = --{ - x: "", - y: "" -}; -var ResultIsNumber7 = --{ - x: "", - y: function (s) { - return s; - } -}; +var ResultIsNumber6 = --{ x: "", y: "" }; +var ResultIsNumber7 = --{ x: "", y: function (s) { return s; } }; var ResultIsNumber8 = ""--; -var ResultIsNumber9 = { - x: "", - y: "" -}--; -var ResultIsNumber10 = { - x: "", - y: function (s) { - return s; - } -}--; +var ResultIsNumber9 = { x: "", y: "" }--; +var ResultIsNumber10 = { x: "", y: function (s) { return s; } }--; // string type expressions var ResultIsNumber11 = --objA.a; var ResultIsNumber12 = --M.n; diff --git a/tests/baselines/reference/defaultArgsInFunctionExpressions.js b/tests/baselines/reference/defaultArgsInFunctionExpressions.js index a58905dd816..3f77c4430e8 100644 --- a/tests/baselines/reference/defaultArgsInFunctionExpressions.js +++ b/tests/baselines/reference/defaultArgsInFunctionExpressions.js @@ -50,9 +50,7 @@ s = f2(); n = f2(); // Contextually type the default arg with the type annotation var f3 = function (a) { - if (a === void 0) { a = function (s) { - return s; - }; } + if (a === void 0) { a = function (s) { return s; }; } }; // Type check using the function's contextual type var f4 = function (a) { @@ -60,9 +58,7 @@ var f4 = function (a) { }; // Contextually type the default arg using the function's contextual type var f5 = function (a) { - if (a === void 0) { a = function (s) { - return s; - }; } + if (a === void 0) { a = function (s) { return s; }; } }; var U; (function (U) { diff --git a/tests/baselines/reference/defaultBestCommonTypesHaveDecls.js b/tests/baselines/reference/defaultBestCommonTypesHaveDecls.js index 98e135cc712..ad6181ba7c5 100644 --- a/tests/baselines/reference/defaultBestCommonTypesHaveDecls.js +++ b/tests/baselines/reference/defaultBestCommonTypesHaveDecls.js @@ -20,13 +20,9 @@ var obj1; obj1.length; var obj2; obj2.length; -function concat(x, y) { - return null; -} +function concat(x, y) { return null; } var result = concat(1, ""); // error var elementCount = result.length; -function concat2(x, y) { - return null; -} +function concat2(x, y) { return null; } var result2 = concat2(1, ""); // result2 will be number|string var elementCount2 = result.length; diff --git a/tests/baselines/reference/defaultIndexProps1.js b/tests/baselines/reference/defaultIndexProps1.js index 63d8c70c9d0..fc8fe52b9fc 100644 --- a/tests/baselines/reference/defaultIndexProps1.js +++ b/tests/baselines/reference/defaultIndexProps1.js @@ -21,7 +21,5 @@ var Foo = (function () { })(); var f = new Foo(); var q = f["v"]; -var o = { - v: "Yo2" -}; +var o = { v: "Yo2" }; var q2 = o["v"]; diff --git a/tests/baselines/reference/defaultIndexProps2.js b/tests/baselines/reference/defaultIndexProps2.js index 6a175f0f560..7652e591cc9 100644 --- a/tests/baselines/reference/defaultIndexProps2.js +++ b/tests/baselines/reference/defaultIndexProps2.js @@ -24,9 +24,7 @@ var Foo = (function () { })(); var f = new Foo(); // WScript.Echo(f[0]); -var o = { - v: "Yo2" -}; +var o = { v: "Yo2" }; // WScript.Echo(o[0]); 1[0]; var q = "s"[0]; diff --git a/tests/baselines/reference/deleteOperatorWithAnyOtherType.js b/tests/baselines/reference/deleteOperatorWithAnyOtherType.js index b4f9870c7e3..e2a2be4d9aa 100644 --- a/tests/baselines/reference/deleteOperatorWithAnyOtherType.js +++ b/tests/baselines/reference/deleteOperatorWithAnyOtherType.js @@ -65,16 +65,9 @@ delete M.n; // delete operator on any type var ANY; var ANY1; -var ANY2 = [ - "", - "" -]; +var ANY2 = ["", ""]; var obj; -var obj1 = { - x: "", - y: function () { - } -}; +var obj1 = { x: "", y: function () { } }; function foo() { var a; return a; diff --git a/tests/baselines/reference/deleteOperatorWithBooleanType.js b/tests/baselines/reference/deleteOperatorWithBooleanType.js index 2c913251c79..b0a60a23744 100644 --- a/tests/baselines/reference/deleteOperatorWithBooleanType.js +++ b/tests/baselines/reference/deleteOperatorWithBooleanType.js @@ -41,15 +41,11 @@ delete M.n; //// [deleteOperatorWithBooleanType.js] // delete operator on boolean type var BOOLEAN; -function foo() { - return true; -} +function foo() { return true; } var A = (function () { function A() { } - A.foo = function () { - return false; - }; + A.foo = function () { return false; }; return A; })(); var M; @@ -61,10 +57,7 @@ var objA = new A(); var ResultIsBoolean1 = delete BOOLEAN; // boolean type literal var ResultIsBoolean2 = delete true; -var ResultIsBoolean3 = delete { - x: true, - y: false -}; +var ResultIsBoolean3 = delete { x: true, y: false }; // boolean type expressions var ResultIsBoolean4 = delete objA.a; var ResultIsBoolean5 = delete M.n; diff --git a/tests/baselines/reference/deleteOperatorWithNumberType.js b/tests/baselines/reference/deleteOperatorWithNumberType.js index 50513247f64..bb70c55024d 100644 --- a/tests/baselines/reference/deleteOperatorWithNumberType.js +++ b/tests/baselines/reference/deleteOperatorWithNumberType.js @@ -48,19 +48,12 @@ delete objA.a, M.n; //// [deleteOperatorWithNumberType.js] // delete operator on number type var NUMBER; -var NUMBER1 = [ - 1, - 2 -]; -function foo() { - return 1; -} +var NUMBER1 = [1, 2]; +function foo() { return 1; } var A = (function () { function A() { } - A.foo = function () { - return 1; - }; + A.foo = function () { return 1; }; return A; })(); var M; @@ -73,16 +66,8 @@ var ResultIsBoolean1 = delete NUMBER; var ResultIsBoolean2 = delete NUMBER1; // number type literal var ResultIsBoolean3 = delete 1; -var ResultIsBoolean4 = delete { - x: 1, - y: 2 -}; -var ResultIsBoolean5 = delete { - x: 1, - y: function (n) { - return n; - } -}; +var ResultIsBoolean4 = delete { x: 1, y: 2 }; +var ResultIsBoolean5 = delete { x: 1, y: function (n) { return n; } }; // number type expressions var ResultIsBoolean6 = delete objA.a; var ResultIsBoolean7 = delete M.n; diff --git a/tests/baselines/reference/deleteOperatorWithStringType.js b/tests/baselines/reference/deleteOperatorWithStringType.js index ddf4b827779..79246e27725 100644 --- a/tests/baselines/reference/deleteOperatorWithStringType.js +++ b/tests/baselines/reference/deleteOperatorWithStringType.js @@ -47,19 +47,12 @@ delete objA.a,M.n; //// [deleteOperatorWithStringType.js] // delete operator on string type var STRING; -var STRING1 = [ - "", - "abc" -]; -function foo() { - return "abc"; -} +var STRING1 = ["", "abc"]; +function foo() { return "abc"; } var A = (function () { function A() { } - A.foo = function () { - return ""; - }; + A.foo = function () { return ""; }; return A; })(); var M; @@ -72,16 +65,8 @@ var ResultIsBoolean1 = delete STRING; var ResultIsBoolean2 = delete STRING1; // string type literal var ResultIsBoolean3 = delete ""; -var ResultIsBoolean4 = delete { - x: "", - y: "" -}; -var ResultIsBoolean5 = delete { - x: "", - y: function (s) { - return s; - } -}; +var ResultIsBoolean4 = delete { x: "", y: "" }; +var ResultIsBoolean5 = delete { x: "", y: function (s) { return s; } }; // string type expressions var ResultIsBoolean6 = delete objA.a; var ResultIsBoolean7 = delete M.n; diff --git a/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js b/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js index e4ff8dd9775..32e8cf4199e 100644 --- a/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js +++ b/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js @@ -59,18 +59,14 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var r2 = function () { - return _super.call(this); - }; // error for misplaced super call (nested function) + var r2 = function () { return _super.call(this); }; // error for misplaced super call (nested function) } return Derived2; })(Base2); var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3() { - var r = function () { - _super.call(this); - }; // error + var r = function () { _super.call(this); }; // error } return Derived3; })(Base2); diff --git a/tests/baselines/reference/derivedClassIncludesInheritedMembers.js b/tests/baselines/reference/derivedClassIncludesInheritedMembers.js index db54affa6d9..f2e816604d2 100644 --- a/tests/baselines/reference/derivedClassIncludesInheritedMembers.js +++ b/tests/baselines/reference/derivedClassIncludesInheritedMembers.js @@ -50,25 +50,17 @@ var __extends = this.__extends || function (d, b) { var Base = (function () { function Base(x) { } - Base.prototype.b = function () { - }; + Base.prototype.b = function () { }; Object.defineProperty(Base.prototype, "c", { - get: function () { - return ''; - }, - set: function (v) { - }, + get: function () { return ''; }, + set: function (v) { }, enumerable: true, configurable: true }); - Base.s = function () { - }; + Base.s = function () { }; Object.defineProperty(Base, "t", { - get: function () { - return ''; - }, - set: function (v) { - }, + get: function () { return ''; }, + set: function (v) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers.js index 8c8b6a13c7e..b66d356a73e 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers.js @@ -48,25 +48,17 @@ var y; var Base = (function () { function Base(a) { } - Base.prototype.b = function (a) { - }; + Base.prototype.b = function (a) { }; Object.defineProperty(Base.prototype, "c", { - get: function () { - return x; - }, - set: function (v) { - }, + get: function () { return x; }, + set: function (v) { }, enumerable: true, configurable: true }); - Base.s = function (a) { - }; + Base.s = function (a) { }; Object.defineProperty(Base, "t", { - get: function () { - return x; - }, - set: function (v) { - }, + get: function () { return x; }, + set: function (v) { }, enumerable: true, configurable: true }); @@ -77,25 +69,17 @@ var Derived = (function (_super) { function Derived(a) { _super.call(this, x); } - Derived.prototype.b = function (a) { - }; + Derived.prototype.b = function (a) { }; Object.defineProperty(Derived.prototype, "c", { - get: function () { - return y; - }, - set: function (v) { - }, + get: function () { return y; }, + set: function (v) { }, enumerable: true, configurable: true }); - Derived.s = function (a) { - }; + Derived.s = function (a) { }; Object.defineProperty(Derived, "t", { - get: function () { - return y; - }, - set: function (a) { - }, + get: function () { return y; }, + set: function (a) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js index 55bfd0e924d..80f7456ab9a 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js @@ -75,25 +75,17 @@ var y; var Base = (function () { function Base(a) { } - Base.prototype.b = function (a) { - }; + Base.prototype.b = function (a) { }; Object.defineProperty(Base.prototype, "c", { - get: function () { - return x; - }, - set: function (v) { - }, + get: function () { return x; }, + set: function (v) { }, enumerable: true, configurable: true }); - Base.s = function (a) { - }; + Base.s = function (a) { }; Object.defineProperty(Base, "t", { - get: function () { - return x; - }, - set: function (v) { - }, + get: function () { return x; }, + set: function (v) { }, enumerable: true, configurable: true }); @@ -105,25 +97,17 @@ var Derived = (function (_super) { function Derived(a) { _super.call(this, a); } - Derived.prototype.b = function (a) { - }; + Derived.prototype.b = function (a) { }; Object.defineProperty(Derived.prototype, "c", { - get: function () { - return y; - }, - set: function (v) { - }, + get: function () { return y; }, + set: function (v) { }, enumerable: true, configurable: true }); - Derived.s = function (a) { - }; + Derived.s = function (a) { }; Object.defineProperty(Derived, "t", { - get: function () { - return y; - }, - set: function (a) { - }, + get: function () { return y; }, + set: function (a) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js index 0a228a04f71..cfb6116ee85 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js @@ -83,25 +83,17 @@ var y; var Base = (function () { function Base(a) { } - Base.prototype.b = function (a) { - }; + Base.prototype.b = function (a) { }; Object.defineProperty(Base.prototype, "c", { - get: function () { - return x; - }, - set: function (v) { - }, + get: function () { return x; }, + set: function (v) { }, enumerable: true, configurable: true }); - Base.s = function (a) { - }; + Base.s = function (a) { }; Object.defineProperty(Base, "t", { - get: function () { - return x; - }, - set: function (v) { - }, + get: function () { return x; }, + set: function (v) { }, enumerable: true, configurable: true }); @@ -121,8 +113,7 @@ var Derived2 = (function (_super) { function Derived2(a) { _super.call(this, a); } - Derived2.prototype.b = function (a) { - }; + Derived2.prototype.b = function (a) { }; return Derived2; })(Base); var Derived3 = (function (_super) { @@ -131,9 +122,7 @@ var Derived3 = (function (_super) { _super.call(this, a); } Object.defineProperty(Derived3.prototype, "c", { - get: function () { - return x; - }, + get: function () { return x; }, enumerable: true, configurable: true }); @@ -145,8 +134,7 @@ var Derived4 = (function (_super) { _super.call(this, a); } Object.defineProperty(Derived4.prototype, "c", { - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); @@ -171,8 +159,7 @@ var Derived7 = (function (_super) { function Derived7(a) { _super.call(this, a); } - Derived7.s = function (a) { - }; + Derived7.s = function (a) { }; return Derived7; })(Base); var Derived8 = (function (_super) { @@ -181,9 +168,7 @@ var Derived8 = (function (_super) { _super.call(this, a); } Object.defineProperty(Derived8, "t", { - get: function () { - return x; - }, + get: function () { return x; }, enumerable: true, configurable: true }); @@ -195,8 +180,7 @@ var Derived9 = (function (_super) { _super.call(this, a); } Object.defineProperty(Derived9, "t", { - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/derivedClassOverridesPublicMembers.js b/tests/baselines/reference/derivedClassOverridesPublicMembers.js index f673d9ab856..9d7df0eee40 100644 --- a/tests/baselines/reference/derivedClassOverridesPublicMembers.js +++ b/tests/baselines/reference/derivedClassOverridesPublicMembers.js @@ -74,25 +74,17 @@ var y; var Base = (function () { function Base(a) { } - Base.prototype.b = function (a) { - }; + Base.prototype.b = function (a) { }; Object.defineProperty(Base.prototype, "c", { - get: function () { - return x; - }, - set: function (v) { - }, + get: function () { return x; }, + set: function (v) { }, enumerable: true, configurable: true }); - Base.s = function (a) { - }; + Base.s = function (a) { }; Object.defineProperty(Base, "t", { - get: function () { - return x; - }, - set: function (v) { - }, + get: function () { return x; }, + set: function (v) { }, enumerable: true, configurable: true }); @@ -103,25 +95,17 @@ var Derived = (function (_super) { function Derived(a) { _super.call(this, x); } - Derived.prototype.b = function (a) { - }; + Derived.prototype.b = function (a) { }; Object.defineProperty(Derived.prototype, "c", { - get: function () { - return y; - }, - set: function (v) { - }, + get: function () { return y; }, + set: function (v) { }, enumerable: true, configurable: true }); - Derived.s = function (a) { - }; + Derived.s = function (a) { }; Object.defineProperty(Derived, "t", { - get: function () { - return y; - }, - set: function (a) { - }, + get: function () { return y; }, + set: function (a) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js b/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js index fb979ba6032..1902b6f4068 100644 --- a/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js +++ b/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js @@ -59,9 +59,7 @@ var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3(a) { var _this = this; - _super.call(this, function () { - return _this; - }); // error + _super.call(this, function () { return _this; }); // error this.a = a; } return Derived3; @@ -69,9 +67,7 @@ var Derived3 = (function (_super) { var Derived4 = (function (_super) { __extends(Derived4, _super); function Derived4(a) { - _super.call(this, function () { - return this; - }); // ok + _super.call(this, function () { return this; }); // ok this.a = a; } return Derived4; diff --git a/tests/baselines/reference/derivedClassTransitivity.js b/tests/baselines/reference/derivedClassTransitivity.js index 53749861549..2088fc1122b 100644 --- a/tests/baselines/reference/derivedClassTransitivity.js +++ b/tests/baselines/reference/derivedClassTransitivity.js @@ -31,8 +31,7 @@ var __extends = this.__extends || function (d, b) { var C = (function () { function C() { } - C.prototype.foo = function (x) { - }; + C.prototype.foo = function (x) { }; return C; })(); var D = (function (_super) { @@ -40,8 +39,7 @@ var D = (function (_super) { function D() { _super.apply(this, arguments); } - D.prototype.foo = function () { - }; // ok to drop parameters + D.prototype.foo = function () { }; // ok to drop parameters return D; })(C); var E = (function (_super) { @@ -49,8 +47,7 @@ var E = (function (_super) { function E() { _super.apply(this, arguments); } - E.prototype.foo = function (x) { - }; // ok to add optional parameters + E.prototype.foo = function (x) { }; // ok to add optional parameters return E; })(D); var c; diff --git a/tests/baselines/reference/derivedClassTransitivity2.js b/tests/baselines/reference/derivedClassTransitivity2.js index 1b4bd58923c..458aede164c 100644 --- a/tests/baselines/reference/derivedClassTransitivity2.js +++ b/tests/baselines/reference/derivedClassTransitivity2.js @@ -31,8 +31,7 @@ var __extends = this.__extends || function (d, b) { var C = (function () { function C() { } - C.prototype.foo = function (x, y) { - }; + C.prototype.foo = function (x, y) { }; return C; })(); var D = (function (_super) { @@ -40,8 +39,7 @@ var D = (function (_super) { function D() { _super.apply(this, arguments); } - D.prototype.foo = function (x) { - }; // ok to drop parameters + D.prototype.foo = function (x) { }; // ok to drop parameters return D; })(C); var E = (function (_super) { @@ -49,8 +47,7 @@ var E = (function (_super) { function E() { _super.apply(this, arguments); } - E.prototype.foo = function (x, y) { - }; // ok to add optional parameters + E.prototype.foo = function (x, y) { }; // ok to add optional parameters return E; })(D); var c; diff --git a/tests/baselines/reference/derivedClassTransitivity3.js b/tests/baselines/reference/derivedClassTransitivity3.js index 3e548f5276e..9768a8f5fa3 100644 --- a/tests/baselines/reference/derivedClassTransitivity3.js +++ b/tests/baselines/reference/derivedClassTransitivity3.js @@ -31,8 +31,7 @@ var __extends = this.__extends || function (d, b) { var C = (function () { function C() { } - C.prototype.foo = function (x, y) { - }; + C.prototype.foo = function (x, y) { }; return C; })(); var D = (function (_super) { @@ -40,8 +39,7 @@ var D = (function (_super) { function D() { _super.apply(this, arguments); } - D.prototype.foo = function (x) { - }; // ok to drop parameters + D.prototype.foo = function (x) { }; // ok to drop parameters return D; })(C); var E = (function (_super) { @@ -49,8 +47,7 @@ var E = (function (_super) { function E() { _super.apply(this, arguments); } - E.prototype.foo = function (x, y) { - }; // ok to add optional parameters + E.prototype.foo = function (x, y) { }; // ok to add optional parameters return E; })(D); var c; diff --git a/tests/baselines/reference/derivedClassTransitivity4.js b/tests/baselines/reference/derivedClassTransitivity4.js index 5249c6aad2e..abf1a3b5bd0 100644 --- a/tests/baselines/reference/derivedClassTransitivity4.js +++ b/tests/baselines/reference/derivedClassTransitivity4.js @@ -31,8 +31,7 @@ var __extends = this.__extends || function (d, b) { var C = (function () { function C() { } - C.prototype.foo = function (x) { - }; + C.prototype.foo = function (x) { }; return C; })(); var D = (function (_super) { @@ -40,8 +39,7 @@ var D = (function (_super) { function D() { _super.apply(this, arguments); } - D.prototype.foo = function () { - }; // ok to drop parameters + D.prototype.foo = function () { }; // ok to drop parameters return D; })(C); var E = (function (_super) { @@ -49,8 +47,7 @@ var E = (function (_super) { function E() { _super.apply(this, arguments); } - E.prototype.foo = function (x) { - }; // ok to add optional parameters + E.prototype.foo = function (x) { }; // ok to add optional parameters return E; })(D); var c; diff --git a/tests/baselines/reference/derivedClassWithAny.js b/tests/baselines/reference/derivedClassWithAny.js index 0b568eaec9b..8070e689bd0 100644 --- a/tests/baselines/reference/derivedClassWithAny.js +++ b/tests/baselines/reference/derivedClassWithAny.js @@ -70,9 +70,7 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "X", { - get: function () { - return 1; - }, + get: function () { return 1; }, enumerable: true, configurable: true }); @@ -125,9 +123,7 @@ var E = (function (_super) { _super.apply(this, arguments); } Object.defineProperty(E.prototype, "X", { - get: function () { - return ''; - }, + get: function () { return ''; }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js index f802a225088..8b00c632058 100644 --- a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js +++ b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js @@ -36,11 +36,8 @@ var Base = (function () { return ''; }; Object.defineProperty(Base.prototype, "a", { - get: function () { - return 1; - }, - set: function (v) { - }, + get: function () { return 1; }, + set: function (v) { }, enumerable: true, configurable: true }); @@ -56,11 +53,8 @@ var Derived = (function (_super) { return ''; }; Object.defineProperty(Derived.prototype, "a", { - get: function () { - return 1; - }, - set: function (v) { - }, + get: function () { return 1; }, + set: function (v) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js index fb0dee3e57b..4ac57d159e6 100644 --- a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js +++ b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js @@ -46,11 +46,8 @@ var Base = (function () { return ''; }; Object.defineProperty(Base.prototype, "a", { - get: function () { - return 1; - }, - set: function (v) { - }, + get: function () { return 1; }, + set: function (v) { }, enumerable: true, configurable: true }); @@ -66,11 +63,8 @@ var Derived = (function (_super) { return ''; }; Object.defineProperty(Derived.prototype, "a", { - get: function () { - return 1; - }, - set: function (v) { - }, + get: function () { return 1; }, + set: function (v) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js index 558e2309757..1037d3faaae 100644 --- a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js +++ b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js @@ -35,11 +35,8 @@ var Base = (function () { return ''; }; Object.defineProperty(Base, "a", { - get: function () { - return 1; - }, - set: function (v) { - }, + get: function () { return 1; }, + set: function (v) { }, enumerable: true, configurable: true }); @@ -55,11 +52,8 @@ var Derived = (function (_super) { return ''; }; Object.defineProperty(Derived, "a", { - get: function () { - return 1; - }, - set: function (v) { - }, + get: function () { return 1; }, + set: function (v) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js index b2468f62d81..c5bfea288bd 100644 --- a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js +++ b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js @@ -47,11 +47,8 @@ var Base = (function () { return ''; }; Object.defineProperty(Base, "a", { - get: function () { - return 1; - }, - set: function (v) { - }, + get: function () { return 1; }, + set: function (v) { }, enumerable: true, configurable: true }); @@ -68,11 +65,8 @@ var Derived = (function (_super) { return ''; }; Object.defineProperty(Derived, "a", { - get: function () { - return 1; - }, - set: function (v) { - }, + get: function () { return 1; }, + set: function (v) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/derivedClasses.js b/tests/baselines/reference/derivedClasses.js index a0d6de6a819..e256313d27b 100644 --- a/tests/baselines/reference/derivedClasses.js +++ b/tests/baselines/reference/derivedClasses.js @@ -44,9 +44,7 @@ var Red = (function (_super) { } Red.prototype.shade = function () { var _this = this; - var getHue = function () { - return _this.hue(); - }; + var getHue = function () { return _this.hue(); }; return getHue() + " red"; }; return Red; @@ -54,12 +52,8 @@ var Red = (function (_super) { var Color = (function () { function Color() { } - Color.prototype.shade = function () { - return "some shade"; - }; - Color.prototype.hue = function () { - return "some hue"; - }; + Color.prototype.shade = function () { return "some shade"; }; + Color.prototype.hue = function () { return "some hue"; }; return Color; })(); var Blue = (function (_super) { @@ -69,9 +63,7 @@ var Blue = (function (_super) { } Blue.prototype.shade = function () { var _this = this; - var getHue = function () { - return _this.hue(); - }; + var getHue = function () { return _this.hue(); }; return getHue() + " blue"; }; return Blue; diff --git a/tests/baselines/reference/derivedGenericClassWithAny.js b/tests/baselines/reference/derivedGenericClassWithAny.js index 677fadf3876..4d1f0452be4 100644 --- a/tests/baselines/reference/derivedGenericClassWithAny.js +++ b/tests/baselines/reference/derivedGenericClassWithAny.js @@ -53,9 +53,7 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "X", { - get: function () { - return null; - }, + get: function () { return null; }, enumerable: true, configurable: true }); @@ -98,9 +96,7 @@ var E = (function (_super) { _super.apply(this, arguments); } Object.defineProperty(E.prototype, "X", { - get: function () { - return ''; - } // error + get: function () { return ''; } // error , enumerable: true, configurable: true diff --git a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js index 1ca6ce59450..39e87b620d6 100644 --- a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js +++ b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js @@ -41,17 +41,9 @@ var Derived = (function (_super) { return null; }; Derived.prototype.bar = function () { - var r = _super.prototype.foo.call(this, { - a: 1 - }); // { a: number } - var r2 = _super.prototype.foo.call(this, { - a: 1, - b: 2 - }); // { a: number } - var r3 = this.foo({ - a: 1, - b: 2 - }); // { a: number; b: number; } + var r = _super.prototype.foo.call(this, { a: 1 }); // { a: number } + var r2 = _super.prototype.foo.call(this, { a: 1, b: 2 }); // { a: number } + var r3 = this.foo({ a: 1, b: 2 }); // { a: number; b: number; } }; return Derived; })(Base); diff --git a/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js b/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js index c70e3ff2aee..50c8aba1ef8 100644 --- a/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js +++ b/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js @@ -49,7 +49,4 @@ var d1; var d2; b = d1; b = d2; -var r = [ - d1, - d2 -]; +var r = [d1, d2]; diff --git a/tests/baselines/reference/destructuringParameterProperties1.js b/tests/baselines/reference/destructuringParameterProperties1.js index 6d39d41cc1b..cc16cc78de5 100644 --- a/tests/baselines/reference/destructuringParameterProperties1.js +++ b/tests/baselines/reference/destructuringParameterProperties1.js @@ -52,34 +52,10 @@ var C3 = (function () { return C3; })(); var c1 = new C1([]); -c1 = new C1([ - "larry", - "{curly}", - "moe" -]); +c1 = new C1(["larry", "{curly}", "moe"]); var useC1Properties = c1.x === c1.y && c1.y === c1.z; -var c2 = new C2([ - "10", - 10, - !!10 -]); -var _a = [ - c2.x, - c2.y, - c2.z -], c2_x = _a[0], c2_y = _a[1], c2_z = _a[2]; -var c3 = new C3({ - x: 0, - y: "", - z: false -}); -c3 = new C3({ - x: 0, - "y": "y", - z: true -}); -var _b = [ - c3.x, - c3.y, - c3.z -], c3_x = _b[0], c3_y = _b[1], c3_z = _b[2]; +var c2 = new C2(["10", 10, !!10]); +var _a = [c2.x, c2.y, c2.z], c2_x = _a[0], c2_y = _a[1], c2_z = _a[2]; +var c3 = new C3({ x: 0, y: "", z: false }); +c3 = new C3({ x: 0, "y": "y", z: true }); +var _b = [c3.x, c3.y, c3.z], c3_x = _b[0], c3_y = _b[1], c3_z = _b[2]; diff --git a/tests/baselines/reference/destructuringParameterProperties2.js b/tests/baselines/reference/destructuringParameterProperties2.js index 7d7a89380a7..27e190af62f 100644 --- a/tests/baselines/reference/destructuringParameterProperties2.js +++ b/tests/baselines/reference/destructuringParameterProperties2.js @@ -50,33 +50,9 @@ var C1 = (function () { }; return C1; })(); -var x = new C1(undefined, [ - 0, - undefined, - "" -]); -var _a = [ - x.getA(), - x.getB(), - x.getC() -], x_a = _a[0], x_b = _a[1], x_c = _a[2]; -var y = new C1(10, [ - 0, - "", - true -]); -var _b = [ - y.getA(), - y.getB(), - y.getC() -], y_a = _b[0], y_b = _b[1], y_c = _b[2]; -var z = new C1(10, [ - undefined, - "", - null -]); -var _c = [ - z.getA(), - z.getB(), - z.getC() -], z_a = _c[0], z_b = _c[1], z_c = _c[2]; +var x = new C1(undefined, [0, undefined, ""]); +var _a = [x.getA(), x.getB(), x.getC()], x_a = _a[0], x_b = _a[1], x_c = _a[2]; +var y = new C1(10, [0, "", true]); +var _b = [y.getA(), y.getB(), y.getC()], y_a = _b[0], y_b = _b[1], y_c = _b[2]; +var z = new C1(10, [undefined, "", null]); +var _c = [z.getA(), z.getB(), z.getC()], z_a = _c[0], z_b = _c[1], z_c = _c[2]; diff --git a/tests/baselines/reference/destructuringParameterProperties3.js b/tests/baselines/reference/destructuringParameterProperties3.js index f9b89046ae1..fe9e69d7e5b 100644 --- a/tests/baselines/reference/destructuringParameterProperties3.js +++ b/tests/baselines/reference/destructuringParameterProperties3.js @@ -53,43 +53,11 @@ var C1 = (function () { }; return C1; })(); -var x = new C1(undefined, [ - 0, - true, - "" -]); -var _a = [ - x.getA(), - x.getB(), - x.getC() -], x_a = _a[0], x_b = _a[1], x_c = _a[2]; -var y = new C1(10, [ - 0, - true, - true -]); -var _b = [ - y.getA(), - y.getB(), - y.getC() -], y_a = _b[0], y_b = _b[1], y_c = _b[2]; -var z = new C1(10, [ - undefined, - "", - "" -]); -var _c = [ - z.getA(), - z.getB(), - z.getC() -], z_a = _c[0], z_b = _c[1], z_c = _c[2]; -var w = new C1(10, [ - undefined, - undefined, - undefined -]); -var _d = [ - z.getA(), - z.getB(), - z.getC() -], z_a = _d[0], z_b = _d[1], z_c = _d[2]; +var x = new C1(undefined, [0, true, ""]); +var _a = [x.getA(), x.getB(), x.getC()], x_a = _a[0], x_b = _a[1], x_c = _a[2]; +var y = new C1(10, [0, true, true]); +var _b = [y.getA(), y.getB(), y.getC()], y_a = _b[0], y_b = _b[1], y_c = _b[2]; +var z = new C1(10, [undefined, "", ""]); +var _c = [z.getA(), z.getB(), z.getC()], z_a = _c[0], z_b = _c[1], z_c = _c[2]; +var w = new C1(10, [undefined, undefined, undefined]); +var _d = [z.getA(), z.getB(), z.getC()], z_a = _d[0], z_b = _d[1], z_c = _d[2]; diff --git a/tests/baselines/reference/destructuringParameterProperties5.js b/tests/baselines/reference/destructuringParameterProperties5.js index 7575ebb3af7..d9b1710ae89 100644 --- a/tests/baselines/reference/destructuringParameterProperties5.js +++ b/tests/baselines/reference/destructuringParameterProperties5.js @@ -22,19 +22,5 @@ var C1 = (function () { } return C1; })(); -var a = new C1([ - { - x1: 10, - x2: "", - x3: true - }, - "", - false -]); -var _a = [ - a.x1, - a.x2, - a.x3, - a.y, - a.z -], a_x1 = _a[0], a_x2 = _a[1], a_x3 = _a[2], a_y = _a[3], a_z = _a[4]; +var a = new C1([{ x1: 10, x2: "", x3: true }, "", false]); +var _a = [a.x1, a.x2, a.x3, a.y, a.z], a_x1 = _a[0], a_x2 = _a[1], a_x3 = _a[2], a_y = _a[3], a_z = _a[4]; diff --git a/tests/baselines/reference/detachedCommentAtStartOfConstructor1.js b/tests/baselines/reference/detachedCommentAtStartOfConstructor1.js index c0fe33d086e..13312aea362 100644 --- a/tests/baselines/reference/detachedCommentAtStartOfConstructor1.js +++ b/tests/baselines/reference/detachedCommentAtStartOfConstructor1.js @@ -16,9 +16,7 @@ var TestFile = (function () { var _this = this; /// Test summary /// - var getMessage = function () { - return message + _this.name; - }; + var getMessage = function () { return message + _this.name; }; this.message = getMessage(); } return TestFile; diff --git a/tests/baselines/reference/detachedCommentAtStartOfConstructor2.js b/tests/baselines/reference/detachedCommentAtStartOfConstructor2.js index 97d8e2f3a3d..754b432c7c5 100644 --- a/tests/baselines/reference/detachedCommentAtStartOfConstructor2.js +++ b/tests/baselines/reference/detachedCommentAtStartOfConstructor2.js @@ -17,9 +17,7 @@ var TestFile = (function () { /// Test summary /// var _this = this; - var getMessage = function () { - return message + _this.name; - }; + var getMessage = function () { return message + _this.name; }; this.message = getMessage(); } return TestFile; diff --git a/tests/baselines/reference/detachedCommentAtStartOfFunctionBody1.js b/tests/baselines/reference/detachedCommentAtStartOfFunctionBody1.js index a37fdefe816..3bbea65541f 100644 --- a/tests/baselines/reference/detachedCommentAtStartOfFunctionBody1.js +++ b/tests/baselines/reference/detachedCommentAtStartOfFunctionBody1.js @@ -17,9 +17,7 @@ var TestFile = (function () { /// Test summary /// /// - return function () { - return message + _this.name; - }; + return function () { return message + _this.name; }; }; return TestFile; })(); diff --git a/tests/baselines/reference/detachedCommentAtStartOfFunctionBody2.js b/tests/baselines/reference/detachedCommentAtStartOfFunctionBody2.js index e96bfa93471..2a0ac0a4f0a 100644 --- a/tests/baselines/reference/detachedCommentAtStartOfFunctionBody2.js +++ b/tests/baselines/reference/detachedCommentAtStartOfFunctionBody2.js @@ -18,9 +18,7 @@ var TestFile = (function () { /// /// var _this = this; - return function () { - return message + _this.name; - }; + return function () { return message + _this.name; }; }; return TestFile; })(); diff --git a/tests/baselines/reference/disallowLineTerminatorBeforeArrow.js b/tests/baselines/reference/disallowLineTerminatorBeforeArrow.js index 610cbe62c1b..7e292614d43 100644 --- a/tests/baselines/reference/disallowLineTerminatorBeforeArrow.js +++ b/tests/baselines/reference/disallowLineTerminatorBeforeArrow.js @@ -75,10 +75,8 @@ module m { //// [disallowLineTerminatorBeforeArrow.js] -var f1 = function () { -}; -var f2 = function (x, y) { -}; +var f1 = function () { }; +var f2 = function (x, y) { }; var f3 = function (x, y) { var rest = []; for (var _i = 2; _i < arguments.length; _i++) { @@ -134,25 +132,19 @@ var f13 = function (a) { return a; }; // Should be valid. -var f14 = function () { -}; +var f14 = function () { }; // Should be valid. -var f15 = function (a) { - return a; -}; +var f15 = function (a) { return a; }; // Should be valid. var f16 = function (a, b) { if (b === void 0) { b = 10; } return a + b; }; -function foo(func) { -} +function foo(func) { } foo(function () { return true; }); -foo(function () { - return false; -}); +foo(function () { return false; }); var m; (function (m) { var City = (function () { diff --git a/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.js b/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.js index b424436b99a..b259f321f14 100644 --- a/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.js +++ b/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.js @@ -12,11 +12,4 @@ var test: IIntervalTreeNode[] = [{ interval: { begin: 0 }, children: null }]; // //// [doNotWidenAtObjectLiteralPropertyAssignment.js] -var test = [ - { - interval: { - begin: 0 - }, - children: null - } -]; // was error here because best common type is {} +var test = [{ interval: { begin: 0 }, children: null }]; // was error here because best common type is {} diff --git a/tests/baselines/reference/doWhileBreakStatements.js b/tests/baselines/reference/doWhileBreakStatements.js index 9162c629898..a2bc0d3c549 100644 --- a/tests/baselines/reference/doWhileBreakStatements.js +++ b/tests/baselines/reference/doWhileBreakStatements.js @@ -66,7 +66,6 @@ SEVEN: do while (true); while (true); EIGHT: do { - var fn = function () { - }; + var fn = function () { }; break EIGHT; } while (true); diff --git a/tests/baselines/reference/doWhileContinueStatements.js b/tests/baselines/reference/doWhileContinueStatements.js index a39495e162e..7f73157fd99 100644 --- a/tests/baselines/reference/doWhileContinueStatements.js +++ b/tests/baselines/reference/doWhileContinueStatements.js @@ -66,7 +66,6 @@ SEVEN: do while (true); while (true); EIGHT: do { - var fn = function () { - }; + var fn = function () { }; continue EIGHT; } while (true); diff --git a/tests/baselines/reference/doWhileLoop.js b/tests/baselines/reference/doWhileLoop.js index 0c1abd7aed9..6581bba09e1 100644 --- a/tests/baselines/reference/doWhileLoop.js +++ b/tests/baselines/reference/doWhileLoop.js @@ -3,6 +3,5 @@ do { } while (false); var n; //// [doWhileLoop.js] -do { -} while (false); +do { } while (false); var n; diff --git a/tests/baselines/reference/dottedSymbolResolution1.js b/tests/baselines/reference/dottedSymbolResolution1.js index d5bdb6006d5..a0ac7a38b88 100644 --- a/tests/baselines/reference/dottedSymbolResolution1.js +++ b/tests/baselines/reference/dottedSymbolResolution1.js @@ -29,8 +29,7 @@ function _setBarAndText(): void { var Base = (function () { function Base() { } - Base.prototype.foo = function () { - }; + Base.prototype.foo = function () { }; return Base; })(); function each(collection, callback) { diff --git a/tests/baselines/reference/downlevelLetConst12.js b/tests/baselines/reference/downlevelLetConst12.js index 9dc69826256..6437d17accb 100644 --- a/tests/baselines/reference/downlevelLetConst12.js +++ b/tests/baselines/reference/downlevelLetConst12.js @@ -17,10 +17,6 @@ const {a: baz4} = { a: 1 }; var foo; var bar = 1; var baz = ([])[0]; -var baz2 = ({ - a: 1 -}).a; +var baz2 = ({ a: 1 }).a; var baz3 = ([])[0]; -var baz4 = ({ - a: 1 -}).a; +var baz4 = ({ a: 1 }).a; diff --git a/tests/baselines/reference/downlevelLetConst13.js b/tests/baselines/reference/downlevelLetConst13.js index 95e89d5245c..8324d697e95 100644 --- a/tests/baselines/reference/downlevelLetConst13.js +++ b/tests/baselines/reference/downlevelLetConst13.js @@ -24,32 +24,16 @@ export module M { // exported let\const bindings should not be renamed exports.foo = 10; exports.bar = "123"; -exports.bar1 = ([ - 1 -])[0]; -exports.bar2 = ([ - 2 -])[0]; -exports.bar3 = ({ - a: 1 -}).a; -exports.bar4 = ({ - a: 1 -}).a; +exports.bar1 = ([1])[0]; +exports.bar2 = ([2])[0]; +exports.bar3 = ({ a: 1 }).a; +exports.bar4 = ({ a: 1 }).a; var M; (function (M) { M.baz = 100; M.baz2 = true; - M.bar5 = ([ - 1 - ])[0]; - M.bar6 = ([ - 2 - ])[0]; - M.bar7 = ({ - a: 1 - }).a; - M.bar8 = ({ - a: 1 - }).a; + M.bar5 = ([1])[0]; + M.bar6 = ([2])[0]; + M.bar7 = ({ a: 1 }).a; + M.bar8 = ({ a: 1 }).a; })(M = exports.M || (exports.M = {})); diff --git a/tests/baselines/reference/downlevelLetConst14.js b/tests/baselines/reference/downlevelLetConst14.js index ac9444f9fac..d45cf10d3a7 100644 --- a/tests/baselines/reference/downlevelLetConst14.js +++ b/tests/baselines/reference/downlevelLetConst14.js @@ -61,21 +61,13 @@ var z0, z1, z2, z3; { var x_1 = 20; use(x_1); - var z0_1 = ([ - 1 - ])[0]; + var z0_1 = ([1])[0]; use(z0_1); - var z1_1 = ([ - 1 - ])[0]; + var z1_1 = ([1])[0]; use(z1_1); - var z2_1 = ({ - a: 1 - }).a; + var z2_1 = ({ a: 1 }).a; use(z2_1); - var z3_1 = ({ - a: 1 - }).a; + var z3_1 = ({ a: 1 }).a; use(z3_1); } use(x); @@ -87,14 +79,10 @@ var z6; var y = true; { var y_1 = ""; - var z6_1 = ([ - true - ])[0]; + var z6_1 = ([true])[0]; { var y_2 = 1; - var z6_2 = ({ - a: 1 - }).a; + var z6_2 = ({ a: 1 }).a; use(y_2); use(z6_2); } @@ -107,14 +95,10 @@ var z = false; var z5 = 1; { var z_1 = ""; - var z5_1 = ([ - 5 - ])[0]; + var z5_1 = ([5])[0]; { var _z = 1; - var _z5 = ({ - a: 1 - }).a; + var _z5 = ({ a: 1 }).a; // try to step on generated name use(_z); } diff --git a/tests/baselines/reference/downlevelLetConst15.js b/tests/baselines/reference/downlevelLetConst15.js index f1b476c0176..99522542d38 100644 --- a/tests/baselines/reference/downlevelLetConst15.js +++ b/tests/baselines/reference/downlevelLetConst15.js @@ -61,25 +61,13 @@ var z0, z1, z2, z3; { var x_1 = 20; use(x_1); - var z0_1 = ([ - 1 - ])[0]; + var z0_1 = ([1])[0]; use(z0_1); - var z1_1 = ([ - { - a: 1 - } - ])[0].a; + var z1_1 = ([{ a: 1 }])[0].a; use(z1_1); - var z2_1 = ({ - a: 1 - }).a; + var z2_1 = ({ a: 1 }).a; use(z2_1); - var z3_1 = ({ - a: { - b: 1 - } - }).a.b; + var z3_1 = ({ a: { b: 1 } }).a.b; use(z3_1); } use(x); @@ -91,14 +79,10 @@ var z6; var y = true; { var y_1 = ""; - var z6_1 = ([ - true - ])[0]; + var z6_1 = ([true])[0]; { var y_2 = 1; - var z6_2 = ({ - a: 1 - }).a; + var z6_2 = ({ a: 1 }).a; use(y_2); use(z6_2); } @@ -111,14 +95,10 @@ var z = false; var z5 = 1; { var z_1 = ""; - var z5_1 = ([ - 5 - ])[0]; + var z5_1 = ([5])[0]; { var _z = 1; - var _z5 = ({ - a: 1 - }).a; + var _z5 = ({ a: 1 }).a; // try to step on generated name use(_z); } diff --git a/tests/baselines/reference/downlevelLetConst16.js b/tests/baselines/reference/downlevelLetConst16.js index aefe2830adc..4765b50e0a1 100644 --- a/tests/baselines/reference/downlevelLetConst16.js +++ b/tests/baselines/reference/downlevelLetConst16.js @@ -238,26 +238,18 @@ use(z); function foo1() { var x = 1; use(x); - var y = ([ - 1 - ])[0]; + var y = ([1])[0]; use(y); - var z = ({ - a: 1 - }).a; + var z = ({ a: 1 }).a; use(z); } function foo2() { { var x_1 = 1; use(x_1); - var y_1 = ([ - 1 - ])[0]; + var y_1 = ([1])[0]; use(y_1); - var z_1 = ({ - a: 1 - }).a; + var z_1 = ({ a: 1 }).a; use(z_1); } use(x); @@ -268,26 +260,18 @@ var A = (function () { A.prototype.m1 = function () { var x = 1; use(x); - var y = ([ - 1 - ])[0]; + var y = ([1])[0]; use(y); - var z = ({ - a: 1 - }).a; + var z = ({ a: 1 }).a; use(z); }; A.prototype.m2 = function () { { var x_2 = 1; use(x_2); - var y_2 = ([ - 1 - ])[0]; + var y_2 = ([1])[0]; use(y_2); - var z_2 = ({ - a: 1 - }).a; + var z_2 = ({ a: 1 }).a; use(z_2); } use(x); @@ -300,26 +284,18 @@ var B = (function () { B.prototype.m1 = function () { var x = 1; use(x); - var y = ([ - 1 - ])[0]; + var y = ([1])[0]; use(y); - var z = ({ - a: 1 - }).a; + var z = ({ a: 1 }).a; use(z); }; B.prototype.m2 = function () { { var x_3 = 1; use(x_3); - var y_3 = ([ - 1 - ])[0]; + var y_3 = ([1])[0]; use(y_3); - var z_3 = ({ - a: 1 - }).a; + var z_3 = ({ a: 1 }).a; use(z_3); } use(x); @@ -329,26 +305,18 @@ var B = (function () { function bar1() { var x = 1; use(x); - var y = ([ - 1 - ])[0]; + var y = ([1])[0]; use(y); - var z = ({ - a: 1 - }).a; + var z = ({ a: 1 }).a; use(z); } function bar2() { { var x_4 = 1; use(x_4); - var y_4 = ([ - 1 - ])[0]; + var y_4 = ([1])[0]; use(y_4); - var z_4 = ({ - a: 1 - }).a; + var z_4 = ({ a: 1 }).a; use(z_4); } use(x); @@ -357,13 +325,9 @@ var M1; (function (M1) { var x = 1; use(x); - var y = ([ - 1 - ])[0]; + var y = ([1])[0]; use(y); - var z = ({ - a: 1 - }).a; + var z = ({ a: 1 }).a; use(z); })(M1 || (M1 = {})); var M2; @@ -371,13 +335,9 @@ var M2; { var x_5 = 1; use(x_5); - var y_5 = ([ - 1 - ])[0]; + var y_5 = ([1])[0]; use(y_5); - var z_5 = ({ - a: 1 - }).a; + var z_5 = ({ a: 1 }).a; use(z_5); } use(x); @@ -386,13 +346,9 @@ var M3; (function (M3) { var x = 1; use(x); - var y = ([ - 1 - ])[0]; + var y = ([1])[0]; use(y); - var z = ({ - a: 1 - }).a; + var z = ({ a: 1 }).a; use(z); })(M3 || (M3 = {})); var M4; @@ -400,13 +356,9 @@ var M4; { var x_6 = 1; use(x_6); - var y_6 = ([ - 1 - ])[0]; + var y_6 = ([1])[0]; use(y_6); - var z_6 = ({ - a: 1 - }).a; + var z_6 = ({ a: 1 }).a; use(z_6); } use(x); @@ -420,9 +372,7 @@ function foo3() { for (var y_7 = ([])[0];;) { use(y_7); } - for (var z_7 = ({ - a: 1 - }).a;;) { + for (var z_7 = ({ a: 1 }).a;;) { use(z_7); } use(x); @@ -434,9 +384,7 @@ function foo4() { for (var y_8 = ([])[0];;) { use(y_8); } - for (var z_8 = ({ - a: 1 - }).a;;) { + for (var z_8 = ({ a: 1 }).a;;) { use(z_8); } use(x); diff --git a/tests/baselines/reference/downlevelLetConst18.js b/tests/baselines/reference/downlevelLetConst18.js index f3b2306d62b..70b8cb9e346 100644 --- a/tests/baselines/reference/downlevelLetConst18.js +++ b/tests/baselines/reference/downlevelLetConst18.js @@ -33,45 +33,25 @@ for (let x; ;) { //// [downlevelLetConst18.js] 'use strict'; for (var x = void 0;;) { - function foo() { - x; - } + function foo() { x; } ; } for (var x = void 0;;) { - function foo() { - x; - } + function foo() { x; } ; } for (var x = void 0;;) { - (function () { - x; - })(); + (function () { x; })(); } for (var x = 1;;) { - (function () { - x; - })(); + (function () { x; })(); } for (var x = void 0;;) { - ({ - foo: function () { - x; - } - }); + ({ foo: function () { x; } }); } for (var x = void 0;;) { - ({ - get foo() { - return x; - } - }); + ({ get foo() { return x; } }); } for (var x = void 0;;) { - ({ - set foo(v) { - x; - } - }); + ({ set foo(v) { x; } }); } diff --git a/tests/baselines/reference/duplicateIdentifierInCatchBlock.js b/tests/baselines/reference/duplicateIdentifierInCatchBlock.js index 6d43b888f48..e440c06073a 100644 --- a/tests/baselines/reference/duplicateIdentifierInCatchBlock.js +++ b/tests/baselines/reference/duplicateIdentifierInCatchBlock.js @@ -19,27 +19,20 @@ try { } catch (e) { //// [duplicateIdentifierInCatchBlock.js] var v; -try { -} +try { } catch (e) { - function v() { - } -} -function w() { -} -try { + function v() { } } +function w() { } +try { } catch (e) { var w; } -try { -} +try { } catch (e) { var x; - function x() { - } // error - function e() { - } // error + function x() { } // error + function e() { } // error var p; var p; // error } diff --git a/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.js b/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.js index 018d148f9c3..6a567018d1f 100644 --- a/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.js +++ b/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.js @@ -64,8 +64,7 @@ var M; })(M || (M = {})); var M; (function (M) { - function f() { - } + function f() { } M.f = f; })(M || (M = {})); var M; @@ -79,8 +78,7 @@ var M; })(M || (M = {})); var M; (function (M) { - function g() { - } + function g() { } })(M || (M = {})); var M; (function (M) { @@ -102,8 +100,7 @@ var M; })(M || (M = {})); var M; (function (M) { - function C() { - } // no error + function C() { } // no error })(M || (M = {})); var M; (function (M) { diff --git a/tests/baselines/reference/duplicateLocalVariable1.js b/tests/baselines/reference/duplicateLocalVariable1.js index d9ba04ae39a..62e291f28c0 100644 --- a/tests/baselines/reference/duplicateLocalVariable1.js +++ b/tests/baselines/reference/duplicateLocalVariable1.js @@ -361,9 +361,7 @@ var TestRunner = (function () { this.tests = []; } TestRunner.arrayCompare = function (arg1, arg2) { - return (arg1.every(function (val, index) { - return val === arg2[index]; - })); + return (arg1.every(function (val, index) { return val === arg2[index]; })); }; TestRunner.prototype.addTest = function (test) { this.tests.push(test); @@ -410,39 +408,11 @@ exports.TestRunner = TestRunner; exports.tests = (function () { var testRunner = new TestRunner(); // First 3 are for simple harness validation - testRunner.addTest(new TestCase("Basic test", function () { - return true; - })); - testRunner.addTest(new TestCase("Test for any error", function () { - throw new Error(); - return false; - }, "")); - testRunner.addTest(new TestCase("Test RegEx error message match", function () { - throw new Error("Should also pass"); - return false; - }, "Should [also]+ pass")); - testRunner.addTest(new TestCase("Test array compare true", function () { - return TestRunner.arrayCompare([ - 1, - 2, - 3 - ], [ - 1, - 2, - 3 - ]); - })); - testRunner.addTest(new TestCase("Test array compare false", function () { - return !TestRunner.arrayCompare([ - 3, - 2, - 3 - ], [ - 1, - 2, - 3 - ]); - })); + testRunner.addTest(new TestCase("Basic test", function () { return true; })); + testRunner.addTest(new TestCase("Test for any error", function () { throw new Error(); return false; }, "")); + testRunner.addTest(new TestCase("Test RegEx error message match", function () { throw new Error("Should also pass"); return false; }, "Should [also]+ pass")); + testRunner.addTest(new TestCase("Test array compare true", function () { return TestRunner.arrayCompare([1, 2, 3], [1, 2, 3]); })); + testRunner.addTest(new TestCase("Test array compare false", function () { return !TestRunner.arrayCompare([3, 2, 3], [1, 2, 3]); })); // File detection tests testRunner.addTest(new TestCase("Check file exists", function () { return FileManager.DirectoryManager.fileExists(TestFileDir + "\\Test.txt"); @@ -452,28 +422,38 @@ exports.tests = (function () { })); // File pattern matching tests testRunner.addTest(new TestCase("Check text file match", function () { - return (FileManager.FileBuffer.isTextFile("C:\\somedir\\readme.txt") && FileManager.FileBuffer.isTextFile("C:\\spaces path\\myapp.str") && FileManager.FileBuffer.isTextFile("C:\\somedir\\code.js")); + return (FileManager.FileBuffer.isTextFile("C:\\somedir\\readme.txt") && + FileManager.FileBuffer.isTextFile("C:\\spaces path\\myapp.str") && + FileManager.FileBuffer.isTextFile("C:\\somedir\\code.js")); })); testRunner.addTest(new TestCase("Check makefile match", function () { return FileManager.FileBuffer.isTextFile("C:\\some dir\\makefile"); })); testRunner.addTest(new TestCase("Check binary file doesn't match", function () { - return (!FileManager.FileBuffer.isTextFile("C:\\somedir\\app.exe") && !FileManager.FileBuffer.isTextFile("C:\\somedir\\my lib.dll")); + return (!FileManager.FileBuffer.isTextFile("C:\\somedir\\app.exe") && + !FileManager.FileBuffer.isTextFile("C:\\somedir\\my lib.dll")); })); // Command-line parameter tests testRunner.addTest(new TestCase("Check App defaults", function () { var app = new App.App([]); - return (app.fixLines === false && app.recurse === true && app.lineEndings === "CRLF" && app.matchPattern === undefined && app.rootDirectory === ".\\" && app.encodings[0] === "ascii" && app.encodings[1] === "utf8nobom"); + return (app.fixLines === false && + app.recurse === true && + app.lineEndings === "CRLF" && + app.matchPattern === undefined && + app.rootDirectory === ".\\" && + app.encodings[0] === "ascii" && + app.encodings[1] === "utf8nobom"); })); testRunner.addTest(new TestCase("Check App params", function () { - var app = new App.App([ - "-dir=C:\\test dir", - "-lineEndings=LF", - "-encodings=utf16be,ascii", - "-recurse=false", - "-fixlines" - ]); - return (app.fixLines === true && app.lineEndings === "LF" && app.recurse === false && app.matchPattern === undefined && app.rootDirectory === "C:\\test dir" && app.encodings[0] === "utf16be" && app.encodings[1] === "ascii" && app.encodings.length === 2); + var app = new App.App(["-dir=C:\\test dir", "-lineEndings=LF", "-encodings=utf16be,ascii", "-recurse=false", "-fixlines"]); + return (app.fixLines === true && + app.lineEndings === "LF" && + app.recurse === false && + app.matchPattern === undefined && + app.rootDirectory === "C:\\test dir" && + app.encodings[0] === "utf16be" && + app.encodings[1] === "ascii" && + app.encodings.length === 2); })); // File BOM detection tests testRunner.addTest(new TestCase("Check encoding detection no BOM", function () { @@ -507,19 +487,7 @@ exports.tests = (function () { for (var i = 0; i < 11; i++) { chars.push(fb.readByte()); } - return TestRunner.arrayCompare(chars, [ - 0x54, - 0xC3, - 0xA8, - 0xE1, - 0xB4, - 0xA3, - 0xE2, - 0x80, - 0xA0, - 0x0D, - 0x0A - ]); + return TestRunner.arrayCompare(chars, [0x54, 0xC3, 0xA8, 0xE1, 0xB4, 0xA3, 0xE2, 0x80, 0xA0, 0x0D, 0x0A]); })); testRunner.addTest(new TestCase("Check UTF8 decoding", function () { var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); @@ -527,26 +495,12 @@ exports.tests = (function () { for (var i = 0; i < 6; i++) { chars.push(fb.readUtf8CodePoint()); } - return TestRunner.arrayCompare(chars, [ - 0x0054, - 0x00E8, - 0x1D23, - 0x2020, - 0x000D, - 0x000A - ]); + return TestRunner.arrayCompare(chars, [0x0054, 0x00E8, 0x1D23, 0x2020, 0x000D, 0x000A]); })); testRunner.addTest(new TestCase("Check UTF8 encoding", function () { var fb = new FileManager.FileBuffer(20); fb.writeUtf8Bom(); - var chars = [ - 0x0054, - 0x00E8, - 0x1D23, - 0x2020, - 0x000D, - 0x000A - ]; + var chars = [0x0054, 0x00E8, 0x1D23, 0x2020, 0x000D, 0x000A]; for (var i in chars) { fb.writeUtf8CodePoint(chars[i]); } @@ -555,22 +509,7 @@ exports.tests = (function () { for (var i = 0; i < 14; i++) { bytes.push(fb.readByte()); } - var expected = [ - 0xEF, - 0xBB, - 0xBF, - 0x54, - 0xC3, - 0xA8, - 0xE1, - 0xB4, - 0xA3, - 0xE2, - 0x80, - 0xA0, - 0x0D, - 0x0A - ]; + var expected = [0xEF, 0xBB, 0xBF, 0x54, 0xC3, 0xA8, 0xE1, 0xB4, 0xA3, 0xE2, 0x80, 0xA0, 0x0D, 0x0A]; return TestRunner.arrayCompare(bytes, expected); })); // Test reading and writing files @@ -578,38 +517,14 @@ exports.tests = (function () { var filename = TestFileDir + "\\tmpUTF16LE.txt"; var fb = new FileManager.FileBuffer(14); fb.writeUtf16leBom(); - var chars = [ - 0x0054, - 0x00E8, - 0x1D23, - 0x2020, - 0x000D, - 0x000A - ]; - chars.forEach(function (val) { - fb.writeUtf16CodePoint(val, false); - }); + var chars = [0x0054, 0x00E8, 0x1D23, 0x2020, 0x000D, 0x000A]; + chars.forEach(function (val) { fb.writeUtf16CodePoint(val, false); }); fb.save(filename); var savedFile = new FileManager.FileBuffer(filename); if (savedFile.encoding !== 'utf16le') { throw Error("Incorrect encoding"); } - var expectedBytes = [ - 0xFF, - 0xFE, - 0x54, - 0x00, - 0xE8, - 0x00, - 0x23, - 0x1D, - 0x20, - 0x20, - 0x0D, - 0x00, - 0x0A, - 0x00 - ]; + var expectedBytes = [0xFF, 0xFE, 0x54, 0x00, 0xE8, 0x00, 0x23, 0x1D, 0x20, 0x20, 0x0D, 0x00, 0x0A, 0x00]; savedFile.index = 0; expectedBytes.forEach(function (val) { var byteVal = savedFile.readByte(); @@ -639,14 +554,7 @@ exports.tests = (function () { for (var i = 0; i < 6; i++) { codePoints.push(savedFile.readUtf16CodePoint(false)); } - var expectedCodePoints = [ - 0x10480, - 0x10481, - 0x10482, - 0x54, - 0x68, - 0x69 - ]; + var expectedCodePoints = [0x10480, 0x10481, 0x10482, 0x54, 0x68, 0x69]; return TestRunner.arrayCompare(codePoints, expectedCodePoints); })); testRunner.addTest(new TestCase("Read non-BMP utf8 chars", function () { @@ -658,52 +566,20 @@ exports.tests = (function () { for (var i = 0; i < 6; i++) { codePoints.push(savedFile.readUtf8CodePoint()); } - var expectedCodePoints = [ - 0x10480, - 0x10481, - 0x10482, - 0x54, - 0x68, - 0x69 - ]; + var expectedCodePoints = [0x10480, 0x10481, 0x10482, 0x54, 0x68, 0x69]; return TestRunner.arrayCompare(codePoints, expectedCodePoints); })); testRunner.addTest(new TestCase("Write non-BMP utf8 chars", function () { var filename = TestFileDir + "\\tmpUTF8nonBmp.txt"; var fb = new FileManager.FileBuffer(15); - var chars = [ - 0x10480, - 0x10481, - 0x10482, - 0x54, - 0x68, - 0x69 - ]; - chars.forEach(function (val) { - fb.writeUtf8CodePoint(val); - }); + var chars = [0x10480, 0x10481, 0x10482, 0x54, 0x68, 0x69]; + chars.forEach(function (val) { fb.writeUtf8CodePoint(val); }); fb.save(filename); var savedFile = new FileManager.FileBuffer(filename); if (savedFile.encoding !== 'utf8') { throw Error("Incorrect encoding"); } - var expectedBytes = [ - 0xF0, - 0x90, - 0x92, - 0x80, - 0xF0, - 0x90, - 0x92, - 0x81, - 0xF0, - 0x90, - 0x92, - 0x82, - 0x54, - 0x68, - 0x69 - ]; + var expectedBytes = [0xF0, 0x90, 0x92, 0x80, 0xF0, 0x90, 0x92, 0x81, 0xF0, 0x90, 0x92, 0x82, 0x54, 0x68, 0x69]; expectedBytes.forEach(function (val) { var byteVal = savedFile.readByte(); if (byteVal !== val) { diff --git a/tests/baselines/reference/duplicateLocalVariable2.js b/tests/baselines/reference/duplicateLocalVariable2.js index fdb6f5463cd..a8370f31709 100644 --- a/tests/baselines/reference/duplicateLocalVariable2.js +++ b/tests/baselines/reference/duplicateLocalVariable2.js @@ -62,9 +62,7 @@ define(["require", "exports"], function (require, exports) { testRunner.addTest(new TestCase("Check UTF8 encoding", function () { var fb; fb.writeUtf8Bom(); - var chars = [ - 0x0054 - ]; + var chars = [0x0054]; for (var i in chars) { fb.writeUtf8CodePoint(chars[i]); } @@ -73,9 +71,7 @@ define(["require", "exports"], function (require, exports) { for (var i = 0; i < 14; i++) { bytes.push(fb.readByte()); } - var expected = [ - 0xEF - ]; + var expected = [0xEF]; return TestRunner.arrayCompare(bytes, expected); })); return testRunner; diff --git a/tests/baselines/reference/duplicateObjectLiteralProperty.js b/tests/baselines/reference/duplicateObjectLiteralProperty.js index 5bbeb433a0c..9c629b211cf 100644 --- a/tests/baselines/reference/duplicateObjectLiteralProperty.js +++ b/tests/baselines/reference/duplicateObjectLiteralProperty.js @@ -30,12 +30,7 @@ var x = { } }; var y = { - get a() { - return 0; - }, - set a(v) { - }, - get a() { - return 0; - } + get a() { return 0; }, + set a(v) { }, + get a() { return 0; } }; diff --git a/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.js b/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.js index ceaeac0d025..5f55a8b1d22 100644 --- a/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.js +++ b/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.js @@ -10,6 +10,4 @@ var r5 = a.reduce((x, y) => x + y); //// [duplicateOverloadInTypeAugmentation1.js] var a; -var r5 = a.reduce(function (x, y) { - return x + y; -}); +var r5 = a.reduce(function (x, y) { return x + y; }); diff --git a/tests/baselines/reference/duplicatePropertyNames.js b/tests/baselines/reference/duplicatePropertyNames.js index c5da2a1f39f..c3cde82e2cc 100644 --- a/tests/baselines/reference/duplicatePropertyNames.js +++ b/tests/baselines/reference/duplicatePropertyNames.js @@ -52,23 +52,17 @@ var b = { // duplicate property names are an error in all types var C = (function () { function C() { - this.baz = function () { - }; - this.baz = function () { - }; + this.baz = function () { }; + this.baz = function () { }; } - C.prototype.bar = function (x) { - }; - C.prototype.bar = function (x) { - }; + C.prototype.bar = function (x) { }; + C.prototype.bar = function (x) { }; return C; })(); var a; var b = { foo: '', foo: '', - bar: function () { - }, - bar: function () { - } + bar: function () { }, + bar: function () { } }; diff --git a/tests/baselines/reference/duplicateSymbolsExportMatching.js b/tests/baselines/reference/duplicateSymbolsExportMatching.js index e34ed7c8d02..89b5a210ec4 100644 --- a/tests/baselines/reference/duplicateSymbolsExportMatching.js +++ b/tests/baselines/reference/duplicateSymbolsExportMatching.js @@ -93,8 +93,7 @@ define(["require", "exports"], function (require, exports) { (function (F) { var t; })(F || (F = {})); - function F() { - } + function F() { } M.F = F; // Only one error for duplicate identifier (don't consider visibility) })(M || (M = {})); var M; diff --git a/tests/baselines/reference/duplicateTypeParameters1.js b/tests/baselines/reference/duplicateTypeParameters1.js index 167688719ab..990048a25d7 100644 --- a/tests/baselines/reference/duplicateTypeParameters1.js +++ b/tests/baselines/reference/duplicateTypeParameters1.js @@ -3,5 +3,4 @@ function A() { } //// [duplicateTypeParameters1.js] -function A() { -} +function A() { } diff --git a/tests/baselines/reference/duplicateTypeParameters2.js b/tests/baselines/reference/duplicateTypeParameters2.js index c89f0d15fe3..65dce28ad3f 100644 --- a/tests/baselines/reference/duplicateTypeParameters2.js +++ b/tests/baselines/reference/duplicateTypeParameters2.js @@ -8,14 +8,12 @@ interface I {} var A = (function () { function A() { } - A.prototype.foo = function () { - }; + A.prototype.foo = function () { }; return A; })(); var B = (function () { function B() { } - B.prototype.bar = function () { - }; + B.prototype.bar = function () { }; return B; })(); diff --git a/tests/baselines/reference/elaboratedErrors.js b/tests/baselines/reference/elaboratedErrors.js index c245c1a8562..ae5877b2dd6 100644 --- a/tests/baselines/reference/elaboratedErrors.js +++ b/tests/baselines/reference/elaboratedErrors.js @@ -27,8 +27,7 @@ y = x; //// [elaboratedErrors.js] -function fn(s) { -} +function fn(s) { } // This should issue a large error, not a small one var WorkerFS = (function () { function WorkerFS() { diff --git a/tests/baselines/reference/emitArrowFunction.js b/tests/baselines/reference/emitArrowFunction.js index 074febfa096..7e2617045a8 100644 --- a/tests/baselines/reference/emitArrowFunction.js +++ b/tests/baselines/reference/emitArrowFunction.js @@ -8,10 +8,8 @@ foo(() => true); foo(() => { return false; }); //// [emitArrowFunction.js] -var f1 = function () { -}; -var f2 = function (x, y) { -}; +var f1 = function () { }; +var f2 = function (x, y) { }; var f3 = function (x, y) { var rest = []; for (var _i = 2; _i < arguments.length; _i++) { @@ -21,11 +19,6 @@ var f3 = function (x, y) { var f4 = function (x, y, z) { if (z === void 0) { z = 10; } }; -function foo(func) { -} -foo(function () { - return true; -}); -foo(function () { - return false; -}); +function foo(func) { } +foo(function () { return true; }); +foo(function () { return false; }); diff --git a/tests/baselines/reference/emitArrowFunctionAsIs.js b/tests/baselines/reference/emitArrowFunctionAsIs.js index 11df7903ad8..c6586ee95a1 100644 --- a/tests/baselines/reference/emitArrowFunctionAsIs.js +++ b/tests/baselines/reference/emitArrowFunctionAsIs.js @@ -5,9 +5,6 @@ var arrow2 = (a) => { }; var arrow3 = (a, b) => { }; //// [emitArrowFunctionAsIs.js] -var arrow1 = function (a) { -}; -var arrow2 = function (a) { -}; -var arrow3 = function (a, b) { -}; +var arrow1 = function (a) { }; +var arrow2 = function (a) { }; +var arrow3 = function (a, b) { }; diff --git a/tests/baselines/reference/emitArrowFunctionAsIsES6.js b/tests/baselines/reference/emitArrowFunctionAsIsES6.js index 9941434ae10..9876abdafcd 100644 --- a/tests/baselines/reference/emitArrowFunctionAsIsES6.js +++ b/tests/baselines/reference/emitArrowFunctionAsIsES6.js @@ -5,9 +5,6 @@ var arrow2 = (a) => { }; var arrow3 = (a, b) => { }; //// [emitArrowFunctionAsIsES6.js] -var arrow1 = a => { -}; -var arrow2 = (a) => { -}; -var arrow3 = (a, b) => { -}; +var arrow1 = a => { }; +var arrow2 = (a) => { }; +var arrow3 = (a, b) => { }; diff --git a/tests/baselines/reference/emitArrowFunctionES6.js b/tests/baselines/reference/emitArrowFunctionES6.js index 6409fc9464c..603b2737fc5 100644 --- a/tests/baselines/reference/emitArrowFunctionES6.js +++ b/tests/baselines/reference/emitArrowFunctionES6.js @@ -9,17 +9,10 @@ foo(() => { return false; }); //// [emitArrowFunctionES6.js] -var f1 = () => { -}; -var f2 = (x, y) => { -}; -var f3 = (x, y, ...rest) => { -}; -var f4 = (x, y, z = 10) => { -}; -function foo(func) { -} +var f1 = () => { }; +var f2 = (x, y) => { }; +var f3 = (x, y, ...rest) => { }; +var f4 = (x, y, z = 10) => { }; +function foo(func) { } foo(() => true); -foo(() => { - return false; -}); +foo(() => { return false; }); diff --git a/tests/baselines/reference/emitArrowFunctionThisCapturing.js b/tests/baselines/reference/emitArrowFunctionThisCapturing.js index 25d9f7f100b..ac4326ea508 100644 --- a/tests/baselines/reference/emitArrowFunctionThisCapturing.js +++ b/tests/baselines/reference/emitArrowFunctionThisCapturing.js @@ -22,8 +22,7 @@ var f1 = function () { var f2 = function (x) { _this.name = x; }; -function foo(func) { -} +function foo(func) { } foo(function () { _this.age = 100; return true; diff --git a/tests/baselines/reference/emitArrowFunctionThisCapturingES6.js b/tests/baselines/reference/emitArrowFunctionThisCapturingES6.js index bf235bc0eef..2a82ef9c800 100644 --- a/tests/baselines/reference/emitArrowFunctionThisCapturingES6.js +++ b/tests/baselines/reference/emitArrowFunctionThisCapturingES6.js @@ -21,8 +21,7 @@ var f1 = () => { var f2 = (x) => { this.name = x; }; -function foo(func) { -} +function foo(func) { } foo(() => { this.age = 100; return true; diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.js index 00a4c7aa051..589449fad62 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.js +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.js @@ -45,8 +45,7 @@ function baz() { var arg = arguments[0]; }); } -function foo(inputFunc) { -} +function foo(inputFunc) { } foo(() => { var arg = arguments[0]; // error }); diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.js index 0deacd409df..2f84d0843de 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.js +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.js @@ -45,8 +45,7 @@ function baz() { var arg = arguments[0]; }); } -function foo(inputFunc) { -} +function foo(inputFunc) { } foo(() => { var arg = arguments[0]; // error }); diff --git a/tests/baselines/reference/emitArrowFunctionsAsIs.js b/tests/baselines/reference/emitArrowFunctionsAsIs.js index ee8347dda3e..cf773efb8b7 100644 --- a/tests/baselines/reference/emitArrowFunctionsAsIs.js +++ b/tests/baselines/reference/emitArrowFunctionsAsIs.js @@ -5,9 +5,6 @@ var arrow2 = (a) => { }; var arrow3 = (a, b) => { }; //// [emitArrowFunctionsAsIs.js] -var arrow1 = function (a) { -}; -var arrow2 = function (a) { -}; -var arrow3 = function (a, b) { -}; +var arrow1 = function (a) { }; +var arrow2 = function (a) { }; +var arrow3 = function (a, b) { }; diff --git a/tests/baselines/reference/emitArrowFunctionsAsIsES6.js b/tests/baselines/reference/emitArrowFunctionsAsIsES6.js index 021e048ed88..32323a6597b 100644 --- a/tests/baselines/reference/emitArrowFunctionsAsIsES6.js +++ b/tests/baselines/reference/emitArrowFunctionsAsIsES6.js @@ -5,9 +5,6 @@ var arrow2 = (a) => { }; var arrow3 = (a, b) => { }; //// [emitArrowFunctionsAsIsES6.js] -var arrow1 = a => { -}; -var arrow2 = (a) => { -}; -var arrow3 = (a, b) => { -}; +var arrow1 = a => { }; +var arrow2 = (a) => { }; +var arrow3 = (a, b) => { }; diff --git a/tests/baselines/reference/emitClassDeclarationWithConstructorInES6.js b/tests/baselines/reference/emitClassDeclarationWithConstructorInES6.js index 8c115b17e9c..f74442e9fd9 100644 --- a/tests/baselines/reference/emitClassDeclarationWithConstructorInES6.js +++ b/tests/baselines/reference/emitClassDeclarationWithConstructorInES6.js @@ -28,8 +28,7 @@ class B { class A { constructor(x) { } - foo() { - } + foo() { } } class B { constructor(x, z = "hello", ...args) { diff --git a/tests/baselines/reference/emitClassDeclarationWithExtensionInES6.js b/tests/baselines/reference/emitClassDeclarationWithExtensionInES6.js index 5c64aebd16a..f31b5df0cb8 100644 --- a/tests/baselines/reference/emitClassDeclarationWithExtensionInES6.js +++ b/tests/baselines/reference/emitClassDeclarationWithExtensionInES6.js @@ -25,12 +25,10 @@ class D extends C { //// [emitClassDeclarationWithExtensionInES6.js] class B { - baz(a, y = 10) { - } + baz(a, y = 10) { } } class C extends B { - foo() { - } + foo() { } baz(a, y) { super.baz(a, y); } diff --git a/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.js b/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.js index 68ccd1568ed..ece24d691da 100644 --- a/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.js +++ b/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.js @@ -48,10 +48,7 @@ class C { } set ["computedname"](y) { } - set foo(a) { - } - static set bar(b) { - } - static set ["computedname"](b) { - } + set foo(a) { } + static set bar(b) { } + static set ["computedname"](b) { } } diff --git a/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.js b/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.js index d82750f276f..961bd4041cd 100644 --- a/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.js +++ b/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.js @@ -22,14 +22,10 @@ class B { this[0o23534] = "WORLD"; this[20] = "twenty"; } - "foo"() { - } - 0b1110() { - } - 11() { - } - interface() { - } + "foo"() { } + 0b1110() { } + 11() { } + interface() { } } B["hi"] = 10000; B[22] = "twenty-two"; diff --git a/tests/baselines/reference/emitClassDeclarationWithMethodInES6.js b/tests/baselines/reference/emitClassDeclarationWithMethodInES6.js index 20f58b4274e..fc0a510461b 100644 --- a/tests/baselines/reference/emitClassDeclarationWithMethodInES6.js +++ b/tests/baselines/reference/emitClassDeclarationWithMethodInES6.js @@ -24,35 +24,23 @@ class D { //// [emitClassDeclarationWithMethodInES6.js] class D { - foo() { - } - ["computedName"]() { - } - ["computedName"](a) { - } - ["computedName"](a) { - return 1; - } + foo() { } + ["computedName"]() { } + ["computedName"](a) { } + ["computedName"](a) { return 1; } bar() { return this._bar; } baz(a, x) { return "HELLO"; } - static ["computedname"]() { - } - static ["computedname"](a) { - } - static ["computedname"](a) { - return true; - } + static ["computedname"]() { } + static ["computedname"](a) { } + static ["computedname"](a) { return true; } static staticMethod() { var x = 1 + 2; return x; } - static foo(a) { - } - static bar(a) { - return 1; - } + static foo(a) { } + static bar(a) { return 1; } } diff --git a/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.js b/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.js index 14f74682c00..0098cddb1fe 100644 --- a/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.js +++ b/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.js @@ -24,8 +24,7 @@ class B { this.x = 10; this.x = 10; } - static log(a) { - } + static log(a) { } foo() { B.log(this.x); } diff --git a/tests/baselines/reference/emitDefaultParametersFunctionES6.js b/tests/baselines/reference/emitDefaultParametersFunctionES6.js index f4084a16f6f..0d1c9460fed 100644 --- a/tests/baselines/reference/emitDefaultParametersFunctionES6.js +++ b/tests/baselines/reference/emitDefaultParametersFunctionES6.js @@ -5,11 +5,7 @@ function bar(y = 10) { } function bar1(y = 10, ...rest) { } //// [emitDefaultParametersFunctionES6.js] -function foo(x, y = 10) { -} -function baz(x, y = 5, ...rest) { -} -function bar(y = 10) { -} -function bar1(y = 10, ...rest) { -} +function foo(x, y = 10) { } +function baz(x, y = 5, ...rest) { } +function bar(y = 10) { } +function bar1(y = 10, ...rest) { } diff --git a/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.js b/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.js index 5a49a200c6b..f72c245b175 100644 --- a/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.js +++ b/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.js @@ -9,17 +9,10 @@ var y = (function (num = 10, boo = false, ...rest) { })() var z = (function (num: number, boo = false, ...rest) { })(10) //// [emitDefaultParametersFunctionExpressionES6.js] -var lambda1 = (y = "hello") => { -}; -var lambda2 = (x, y = "hello") => { -}; -var lambda3 = (x, y = "hello", ...rest) => { -}; -var lambda4 = (y = "hello", ...rest) => { -}; -var x = function (str = "hello", ...rest) { -}; -var y = (function (num = 10, boo = false, ...rest) { -})(); -var z = (function (num, boo = false, ...rest) { -})(10); +var lambda1 = (y = "hello") => { }; +var lambda2 = (x, y = "hello") => { }; +var lambda3 = (x, y = "hello", ...rest) => { }; +var lambda4 = (y = "hello", ...rest) => { }; +var x = function (str = "hello", ...rest) { }; +var y = (function (num = 10, boo = false, ...rest) { })(); +var z = (function (num, boo = false, ...rest) { })(10); diff --git a/tests/baselines/reference/emitDefaultParametersFunctionPropertyES6.js b/tests/baselines/reference/emitDefaultParametersFunctionPropertyES6.js index fce694a453a..4a85f4a34b0 100644 --- a/tests/baselines/reference/emitDefaultParametersFunctionPropertyES6.js +++ b/tests/baselines/reference/emitDefaultParametersFunctionPropertyES6.js @@ -8,12 +8,8 @@ var obj2 = { //// [emitDefaultParametersFunctionPropertyES6.js] var obj2 = { - func1(y = 10, ...rest) { - }, - func2(x = "hello") { - }, - func3(x, z, y = "hello") { - }, - func4(x, z, y = "hello", ...rest) { - }, + func1(y = 10, ...rest) { }, + func2(x = "hello") { }, + func3(x, z, y = "hello") { }, + func4(x, z, y = "hello", ...rest) { }, }; diff --git a/tests/baselines/reference/emitDefaultParametersMethodES6.js b/tests/baselines/reference/emitDefaultParametersMethodES6.js index 3981ddcba3c..2b97e3e1632 100644 --- a/tests/baselines/reference/emitDefaultParametersMethodES6.js +++ b/tests/baselines/reference/emitDefaultParametersMethodES6.js @@ -20,14 +20,10 @@ class E { class C { constructor(t, z, x, y = "hello") { } - foo(x, t = false) { - } - foo1(x, t = false, ...rest) { - } - bar(t = false) { - } - boo(t = false, ...rest) { - } + foo(x, t = false) { } + foo1(x, t = false, ...rest) { } + bar(t = false) { } + boo(t = false, ...rest) { } } class D { constructor(y = "hello") { diff --git a/tests/baselines/reference/emitRestParametersFunctionES6.js b/tests/baselines/reference/emitRestParametersFunctionES6.js index 242c40f252d..a07b3a13174 100644 --- a/tests/baselines/reference/emitRestParametersFunctionES6.js +++ b/tests/baselines/reference/emitRestParametersFunctionES6.js @@ -3,7 +3,5 @@ function bar(...rest) { } function foo(x: number, y: string, ...rest) { } //// [emitRestParametersFunctionES6.js] -function bar(...rest) { -} -function foo(x, y, ...rest) { -} +function bar(...rest) { } +function foo(x, y, ...rest) { } diff --git a/tests/baselines/reference/emitRestParametersFunctionExpressionES6.js b/tests/baselines/reference/emitRestParametersFunctionExpressionES6.js index c7851db5e78..aa52a29b138 100644 --- a/tests/baselines/reference/emitRestParametersFunctionExpressionES6.js +++ b/tests/baselines/reference/emitRestParametersFunctionExpressionES6.js @@ -5,11 +5,7 @@ var funcExp2 = function (...rest) { } var funcExp3 = (function (...rest) { })() //// [emitRestParametersFunctionExpressionES6.js] -var funcExp = (...rest) => { -}; -var funcExp1 = (X, ...rest) => { -}; -var funcExp2 = function (...rest) { -}; -var funcExp3 = (function (...rest) { -})(); +var funcExp = (...rest) => { }; +var funcExp1 = (X, ...rest) => { }; +var funcExp2 = function (...rest) { }; +var funcExp3 = (function (...rest) { })(); diff --git a/tests/baselines/reference/emitRestParametersFunctionPropertyES6.js b/tests/baselines/reference/emitRestParametersFunctionPropertyES6.js index 87aa489ecf3..122a1f6ed52 100644 --- a/tests/baselines/reference/emitRestParametersFunctionPropertyES6.js +++ b/tests/baselines/reference/emitRestParametersFunctionPropertyES6.js @@ -10,6 +10,5 @@ var obj2 = { //// [emitRestParametersFunctionPropertyES6.js] var obj; var obj2 = { - func(...rest) { - } + func(...rest) { } }; diff --git a/tests/baselines/reference/emitRestParametersMethodES6.js b/tests/baselines/reference/emitRestParametersMethodES6.js index fba6ed01e67..930cd109b6e 100644 --- a/tests/baselines/reference/emitRestParametersMethodES6.js +++ b/tests/baselines/reference/emitRestParametersMethodES6.js @@ -18,16 +18,12 @@ class D { class C { constructor(name, ...rest) { } - bar(...rest) { - } - foo(x, ...rest) { - } + bar(...rest) { } + foo(x, ...rest) { } } class D { constructor(...rest) { } - bar(...rest) { - } - foo(x, ...rest) { - } + bar(...rest) { } + foo(x, ...rest) { } } diff --git a/tests/baselines/reference/emptyExpr.js b/tests/baselines/reference/emptyExpr.js index 4bda58e3244..de3bddeba1e 100644 --- a/tests/baselines/reference/emptyExpr.js +++ b/tests/baselines/reference/emptyExpr.js @@ -2,6 +2,4 @@ [{},] //// [emptyExpr.js] -[ - {}, -]; +[{},]; diff --git a/tests/baselines/reference/emptyTypeArgumentList.js b/tests/baselines/reference/emptyTypeArgumentList.js index 91fce396289..30093113be4 100644 --- a/tests/baselines/reference/emptyTypeArgumentList.js +++ b/tests/baselines/reference/emptyTypeArgumentList.js @@ -3,6 +3,5 @@ function foo() { } foo<>(); //// [emptyTypeArgumentList.js] -function foo() { -} +function foo() { } foo(); diff --git a/tests/baselines/reference/enumAssignabilityInInheritance.js b/tests/baselines/reference/enumAssignabilityInInheritance.js index 065c561d9eb..01439854259 100644 --- a/tests/baselines/reference/enumAssignabilityInInheritance.js +++ b/tests/baselines/reference/enumAssignabilityInInheritance.js @@ -144,8 +144,7 @@ var E2; E2[E2["A"] = 0] = "A"; })(E2 || (E2 = {})); var r4 = foo13(E.A); -function f() { -} +function f() { } var f; (function (f) { f.bar = 1; diff --git a/tests/baselines/reference/enumBasics.js b/tests/baselines/reference/enumBasics.js index f6548f99b95..25aec5a72d8 100644 --- a/tests/baselines/reference/enumBasics.js +++ b/tests/baselines/reference/enumBasics.js @@ -150,21 +150,9 @@ var E9; // (refer to .js to validate) // Enum constant members are propagated var doNotPropagate = [ - E8.B, - E7.A, - E4.Z, - E3.X, - E3.Y, - E3.Z + E8.B, E7.A, E4.Z, E3.X, E3.Y, E3.Z ]; // Enum computed members are not propagated var doPropagate = [ - E9.A, - E9.B, - E6.B, - E6.C, - E6.A, - E5.A, - E5.B, - E5.C + E9.A, E9.B, E6.B, E6.C, E6.A, E5.A, E5.B, E5.C ]; diff --git a/tests/baselines/reference/enumConflictsWithGlobalIdentifier.js b/tests/baselines/reference/enumConflictsWithGlobalIdentifier.js index d463073bb81..5c32fe5a16b 100644 --- a/tests/baselines/reference/enumConflictsWithGlobalIdentifier.js +++ b/tests/baselines/reference/enumConflictsWithGlobalIdentifier.js @@ -11,5 +11,6 @@ var Position; (function (Position) { Position[Position["IgnoreRulesSpecific"] = 0] = "IgnoreRulesSpecific"; })(Position || (Position = {})); -var x = IgnoreRulesSpecific.; +var x = IgnoreRulesSpecific. +; var y = Position.IgnoreRulesSpecific; diff --git a/tests/baselines/reference/enumIndexer.js b/tests/baselines/reference/enumIndexer.js index 9862d787d23..561461229c7 100644 --- a/tests/baselines/reference/enumIndexer.js +++ b/tests/baselines/reference/enumIndexer.js @@ -13,15 +13,6 @@ var MyEnumType; MyEnumType[MyEnumType["foo"] = 0] = "foo"; MyEnumType[MyEnumType["bar"] = 1] = "bar"; })(MyEnumType || (MyEnumType = {})); -var _arr = [ - { - key: 'foo' - }, - { - key: 'bar' - } -]; +var _arr = [{ key: 'foo' }, { key: 'bar' }]; var enumValue = MyEnumType.foo; -var x = _arr.map(function (o) { - return MyEnumType[o.key] === enumValue; -}); // these are not same type +var x = _arr.map(function (o) { return MyEnumType[o.key] === enumValue; }); // these are not same type diff --git a/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.js b/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.js index f9ac7661e3d..d932985ad7d 100644 --- a/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.js +++ b/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.js @@ -150,8 +150,7 @@ var E2; (function (E2) { E2[E2["A"] = 0] = "A"; })(E2 || (E2 = {})); -function f() { -} +function f() { } var f; (function (f) { f.bar = 1; diff --git a/tests/baselines/reference/enumMemberResolution.js b/tests/baselines/reference/enumMemberResolution.js index c021eb8d47a..ec27342471d 100644 --- a/tests/baselines/reference/enumMemberResolution.js +++ b/tests/baselines/reference/enumMemberResolution.js @@ -12,6 +12,7 @@ var Position2; (function (Position2) { Position2[Position2["IgnoreRulesSpecific"] = 0] = "IgnoreRulesSpecific"; })(Position2 || (Position2 = {})); -var x = IgnoreRulesSpecific.; // error +var x = IgnoreRulesSpecific. +; // error var y = 1; var z = Position2.IgnoreRulesSpecific; // no error diff --git a/tests/baselines/reference/enumMerging.js b/tests/baselines/reference/enumMerging.js index d8d9373d3ff..5dc5a475b40 100644 --- a/tests/baselines/reference/enumMerging.js +++ b/tests/baselines/reference/enumMerging.js @@ -95,14 +95,7 @@ var M1; EConst1[EConst1["F"] = 8] = "F"; })(M1.EConst1 || (M1.EConst1 = {})); var EConst1 = M1.EConst1; - var x = [ - EConst1.A, - EConst1.B, - EConst1.C, - EConst1.D, - EConst1.E, - EConst1.F - ]; + var x = [EConst1.A, EConst1.B, EConst1.C, EConst1.D, EConst1.E, EConst1.F]; })(M1 || (M1 = {})); // Enum with only computed members across 2 declarations with the same root module var M2; @@ -119,14 +112,7 @@ var M2; EComp2[EComp2["F"] = 'foo'.length] = "F"; })(M2.EComp2 || (M2.EComp2 = {})); var EComp2 = M2.EComp2; - var x = [ - EComp2.A, - EComp2.B, - EComp2.C, - EComp2.D, - EComp2.E, - EComp2.F - ]; + var x = [EComp2.A, EComp2.B, EComp2.C, EComp2.D, EComp2.E, EComp2.F]; })(M2 || (M2 = {})); // Enum with initializer in only one of two declarations with constant members with the same root module var M3; diff --git a/tests/baselines/reference/errorOnContextuallyTypedReturnType.js b/tests/baselines/reference/errorOnContextuallyTypedReturnType.js index 2a49ccd2b67..9e0c26b6be7 100644 --- a/tests/baselines/reference/errorOnContextuallyTypedReturnType.js +++ b/tests/baselines/reference/errorOnContextuallyTypedReturnType.js @@ -4,7 +4,5 @@ var n2: () => boolean = function ():boolean { }; // expect an error here //// [errorOnContextuallyTypedReturnType.js] -var n1 = function () { -}; // expect an error here -var n2 = function () { -}; // expect an error here +var n1 = function () { }; // expect an error here +var n2 = function () { }; // expect an error here diff --git a/tests/baselines/reference/errorSuperPropertyAccess.js b/tests/baselines/reference/errorSuperPropertyAccess.js index 4ddcca530f1..26ef99f269d 100644 --- a/tests/baselines/reference/errorSuperPropertyAccess.js +++ b/tests/baselines/reference/errorSuperPropertyAccess.js @@ -172,14 +172,10 @@ var SomeBase = (function () { this.privateMember = 0; this.publicMember = 0; } - SomeBase.prototype.privateFunc = function () { - }; - SomeBase.prototype.publicFunc = function () { - }; - SomeBase.privateStaticFunc = function () { - }; - SomeBase.publicStaticFunc = function () { - }; + SomeBase.prototype.privateFunc = function () { }; + SomeBase.prototype.publicFunc = function () { }; + SomeBase.privateStaticFunc = function () { }; + SomeBase.publicStaticFunc = function () { }; SomeBase.privateStaticMember = 0; SomeBase.publicStaticMember = 0; return SomeBase; @@ -213,9 +209,7 @@ var SomeDerived1 = (function (_super) { _super.publicFunc.call(this); } var x = { - test: function () { - return _super.publicFunc.call(this); - } + test: function () { return _super.publicFunc.call(this); } }; }; return SomeDerived1; @@ -277,7 +271,4 @@ var SomeDerived3 = (function (_super) { return SomeDerived3; })(SomeBase); // In object literal -var obj = { - n: _super.wat, - p: _super.foo.call(this) -}; +var obj = { n: _super.wat, p: _super.foo.call(this) }; diff --git a/tests/baselines/reference/errorSupression1.js b/tests/baselines/reference/errorSupression1.js index 059530be452..53e40e585f0 100644 --- a/tests/baselines/reference/errorSupression1.js +++ b/tests/baselines/reference/errorSupression1.js @@ -12,9 +12,7 @@ baz.concat("y"); var Foo = (function () { function Foo() { } - Foo.bar = function () { - return "x"; - }; + Foo.bar = function () { return "x"; }; return Foo; })(); var baz = Foo.b; diff --git a/tests/baselines/reference/errorsInGenericTypeReference.js b/tests/baselines/reference/errorsInGenericTypeReference.js index 6a9f62c5e49..03bf31a6a6b 100644 --- a/tests/baselines/reference/errorsInGenericTypeReference.js +++ b/tests/baselines/reference/errorsInGenericTypeReference.js @@ -88,8 +88,7 @@ var Foo = (function () { var testClass1 = (function () { function testClass1() { } - testClass1.prototype.method = function () { - }; + testClass1.prototype.method = function () { }; return testClass1; })(); var tc1 = new testClass1(); @@ -105,15 +104,10 @@ var tc2 = new testClass2(); // error: could not find symbol V var testClass3 = (function () { function testClass3() { } - testClass3.prototype.testMethod1 = function () { - return null; - }; // error: could not find symbol V - testClass3.testMethod2 = function () { - return null; - }; // error: could not find symbol V + testClass3.prototype.testMethod1 = function () { return null; }; // error: could not find symbol V + testClass3.testMethod2 = function () { return null; }; // error: could not find symbol V Object.defineProperty(testClass3.prototype, "a", { - set: function (value) { - } // error: could not find symbol V + set: function (value) { } // error: could not find symbol V , enumerable: true, configurable: true @@ -121,12 +115,9 @@ var testClass3 = (function () { return testClass3; })(); // in function return type annotation -function testFunction1() { - return null; -} // error: could not find symbol V +function testFunction1() { return null; } // error: could not find symbol V // in paramter types -function testFunction2(p) { -} // error: could not find symbol V +function testFunction2(p) { } // error: could not find symbol V // in var type annotation var f; // error: could not find symbol V // in constraints @@ -138,8 +129,7 @@ var testClass4 = (function () { var testClass6 = (function () { function testClass6() { } - testClass6.prototype.method = function () { - }; // error: could not find symbol V + testClass6.prototype.method = function () { }; // error: could not find symbol V return testClass6; })(); // in extends clause diff --git a/tests/baselines/reference/es5ExportDefaultClassDeclaration.js b/tests/baselines/reference/es5ExportDefaultClassDeclaration.js index 9cf50988247..b5cfdb02f78 100644 --- a/tests/baselines/reference/es5ExportDefaultClassDeclaration.js +++ b/tests/baselines/reference/es5ExportDefaultClassDeclaration.js @@ -9,11 +9,10 @@ export default class C { var C = (function () { function C() { } - C.prototype.method = function () { - }; + C.prototype.method = function () { }; return C; })(); -exports.C = C; +exports.default = C; //// [es5ExportDefaultClassDeclaration.d.ts] diff --git a/tests/baselines/reference/es5ExportDefaultClassDeclaration2.js b/tests/baselines/reference/es5ExportDefaultClassDeclaration2.js index 4d29fce3c10..de0d109dadf 100644 --- a/tests/baselines/reference/es5ExportDefaultClassDeclaration2.js +++ b/tests/baselines/reference/es5ExportDefaultClassDeclaration2.js @@ -9,8 +9,7 @@ export default class { var default_1 = (function () { function default_1() { } - default_1.prototype.method = function () { - }; + default_1.prototype.method = function () { }; return default_1; })(); exports.default = default_1; diff --git a/tests/baselines/reference/es5ExportDefaultClassDeclaration3.js b/tests/baselines/reference/es5ExportDefaultClassDeclaration3.js new file mode 100644 index 00000000000..bff80940a02 --- /dev/null +++ b/tests/baselines/reference/es5ExportDefaultClassDeclaration3.js @@ -0,0 +1,35 @@ +//// [es5ExportDefaultClassDeclaration3.ts] + +var before: C = new C(); + +export default class C { + method(): C { + return new C(); + } +} + +var after: C = new C(); + +var t: typeof C = C; + + + +//// [es5ExportDefaultClassDeclaration3.js] +var before = new C(); +var C = (function () { + function C() { + } + C.prototype.method = function () { + return new C(); + }; + return C; +})(); +exports.default = C; +var after = new C(); +var t = C; + + +//// [es5ExportDefaultClassDeclaration3.d.ts] +export default class C { + method(): C; +} diff --git a/tests/baselines/reference/es5ExportDefaultClassDeclaration3.types b/tests/baselines/reference/es5ExportDefaultClassDeclaration3.types new file mode 100644 index 00000000000..1ed302ac45e --- /dev/null +++ b/tests/baselines/reference/es5ExportDefaultClassDeclaration3.types @@ -0,0 +1,33 @@ +=== tests/cases/compiler/es5ExportDefaultClassDeclaration3.ts === + +var before: C = new C(); +>before : C +>C : C +>new C() : C +>C : typeof C + +export default class C { +>C : C + + method(): C { +>method : () => C +>C : C + + return new C(); +>new C() : C +>C : typeof C + } +} + +var after: C = new C(); +>after : C +>C : C +>new C() : C +>C : typeof C + +var t: typeof C = C; +>t : typeof C +>C : typeof C +>C : typeof C + + diff --git a/tests/baselines/reference/es5ExportDefaultFunctionDeclaration.js b/tests/baselines/reference/es5ExportDefaultFunctionDeclaration.js index 980a5ccab0f..673cc3cb453 100644 --- a/tests/baselines/reference/es5ExportDefaultFunctionDeclaration.js +++ b/tests/baselines/reference/es5ExportDefaultFunctionDeclaration.js @@ -4,9 +4,8 @@ export default function f() { } //// [es5ExportDefaultFunctionDeclaration.js] -function f() { -} -exports.f = f; +function f() { } +exports.default = f; //// [es5ExportDefaultFunctionDeclaration.d.ts] diff --git a/tests/baselines/reference/es5ExportDefaultFunctionDeclaration2.js b/tests/baselines/reference/es5ExportDefaultFunctionDeclaration2.js index 61f167619eb..ad1334e810b 100644 --- a/tests/baselines/reference/es5ExportDefaultFunctionDeclaration2.js +++ b/tests/baselines/reference/es5ExportDefaultFunctionDeclaration2.js @@ -4,8 +4,7 @@ export default function () { } //// [es5ExportDefaultFunctionDeclaration2.js] -function () { -} +function default_1() { } exports.default = default_1; diff --git a/tests/baselines/reference/es5ExportDefaultFunctionDeclaration3.js b/tests/baselines/reference/es5ExportDefaultFunctionDeclaration3.js new file mode 100644 index 00000000000..1fc57976439 --- /dev/null +++ b/tests/baselines/reference/es5ExportDefaultFunctionDeclaration3.js @@ -0,0 +1,21 @@ +//// [es5ExportDefaultFunctionDeclaration3.ts] + +var before: typeof func = func(); + +export default function func(): typeof func { + return func; +} + +var after: typeof func = func(); + +//// [es5ExportDefaultFunctionDeclaration3.js] +var before = func(); +function func() { + return func; +} +exports.default = func; +var after = func(); + + +//// [es5ExportDefaultFunctionDeclaration3.d.ts] +export default function func(): typeof func; diff --git a/tests/baselines/reference/es5ExportDefaultFunctionDeclaration3.types b/tests/baselines/reference/es5ExportDefaultFunctionDeclaration3.types new file mode 100644 index 00000000000..d3a8ff92b2f --- /dev/null +++ b/tests/baselines/reference/es5ExportDefaultFunctionDeclaration3.types @@ -0,0 +1,22 @@ +=== tests/cases/compiler/es5ExportDefaultFunctionDeclaration3.ts === + +var before: typeof func = func(); +>before : () => typeof func +>func : () => typeof func +>func() : () => typeof func +>func : () => typeof func + +export default function func(): typeof func { +>func : () => typeof func +>func : () => typeof func + + return func; +>func : () => typeof func +} + +var after: typeof func = func(); +>after : () => typeof func +>func : () => typeof func +>func() : () => typeof func +>func : () => typeof func + diff --git a/tests/baselines/reference/es5ExportDefaultIdentifier.js b/tests/baselines/reference/es5ExportDefaultIdentifier.js index 81f2e9e0ace..739f3d6c109 100644 --- a/tests/baselines/reference/es5ExportDefaultIdentifier.js +++ b/tests/baselines/reference/es5ExportDefaultIdentifier.js @@ -6,8 +6,7 @@ export default f; //// [es5ExportDefaultIdentifier.js] -function f() { -} +function f() { } exports.f = f; exports.default = f; diff --git a/tests/baselines/reference/es5ExportEquals.js b/tests/baselines/reference/es5ExportEquals.js index 04a34b1e23b..88d1da4201d 100644 --- a/tests/baselines/reference/es5ExportEquals.js +++ b/tests/baselines/reference/es5ExportEquals.js @@ -6,8 +6,7 @@ export = f; //// [es5ExportEquals.js] -function f() { -} +function f() { } exports.f = f; module.exports = f; diff --git a/tests/baselines/reference/es5ExportEqualsDts.js b/tests/baselines/reference/es5ExportEqualsDts.js new file mode 100644 index 00000000000..922d012be0e --- /dev/null +++ b/tests/baselines/reference/es5ExportEqualsDts.js @@ -0,0 +1,37 @@ +//// [es5ExportEqualsDts.ts] + +class A { + foo() { + var aVal: A.B; + return aVal; + } +} + +module A { + export interface B { } +} + +export = A + +//// [es5ExportEqualsDts.js] +var A = (function () { + function A() { + } + A.prototype.foo = function () { + var aVal; + return aVal; + }; + return A; +})(); +module.exports = A; + + +//// [es5ExportEqualsDts.d.ts] +declare class A { + foo(): A.B; +} +declare module A { + interface B { + } +} +export = A; diff --git a/tests/baselines/reference/es5ExportEqualsDts.types b/tests/baselines/reference/es5ExportEqualsDts.types new file mode 100644 index 00000000000..58b35a0d7ce --- /dev/null +++ b/tests/baselines/reference/es5ExportEqualsDts.types @@ -0,0 +1,28 @@ +=== tests/cases/compiler/es5ExportEqualsDts.ts === + +class A { +>A : A + + foo() { +>foo : () => A.B + + var aVal: A.B; +>aVal : A.B +>A : unknown +>B : A.B + + return aVal; +>aVal : A.B + } +} + +module A { +>A : typeof A + + export interface B { } +>B : B +} + +export = A +>A : A + diff --git a/tests/baselines/reference/es5ModuleInternalNamedImports.js b/tests/baselines/reference/es5ModuleInternalNamedImports.js index 456ad30523b..d7d120e8af9 100644 --- a/tests/baselines/reference/es5ModuleInternalNamedImports.js +++ b/tests/baselines/reference/es5ModuleInternalNamedImports.js @@ -51,8 +51,7 @@ define(["require", "exports"], function (require, exports) { var x; })(M_M = M.M_M || (M.M_M = {})); // function - function M_F() { - } + function M_F() { } M.M_F = M_F; // enum (function (M_E) { diff --git a/tests/baselines/reference/es6ClassTest.js b/tests/baselines/reference/es6ClassTest.js index 5fd9f0e9b7f..08c184a0df2 100644 --- a/tests/baselines/reference/es6ClassTest.js +++ b/tests/baselines/reference/es6ClassTest.js @@ -112,12 +112,8 @@ var Foo = (function (_super) { this.x = x; this.gar = 5; } - Foo.prototype.bar = function () { - return 0; - }; - Foo.prototype.boo = function (x) { - return x; - }; + Foo.prototype.bar = function () { return 0; }; + Foo.prototype.boo = function (x) { return x; }; Foo.statVal = 0; return Foo; })(Bar); diff --git a/tests/baselines/reference/es6ClassTest2.js b/tests/baselines/reference/es6ClassTest2.js index 8ef7a2fa379..f23be04fd17 100644 --- a/tests/baselines/reference/es6ClassTest2.js +++ b/tests/baselines/reference/es6ClassTest2.js @@ -248,9 +248,7 @@ var SplatMonster = (function () { }; return SplatMonster; })(); -function foo() { - return true; -} +function foo() { return true; } var PrototypeMonster = (function () { function PrototypeMonster() { this.age = 1; @@ -302,10 +300,8 @@ var Visibility = (function () { this.x = 1; this.y = 2; } - Visibility.prototype.foo = function () { - }; - Visibility.prototype.bar = function () { - }; + Visibility.prototype.foo = function () { }; + Visibility.prototype.bar = function () { }; return Visibility; })(); var BaseClassWithConstructor = (function () { diff --git a/tests/baselines/reference/es6ClassTest3.errors.txt b/tests/baselines/reference/es6ClassTest3.errors.txt deleted file mode 100644 index 5eb310f338d..00000000000 --- a/tests/baselines/reference/es6ClassTest3.errors.txt +++ /dev/null @@ -1,23 +0,0 @@ -tests/cases/compiler/es6ClassTest3.ts(3,22): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/compiler/es6ClassTest3.ts(4,23): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. - - -==== tests/cases/compiler/es6ClassTest3.ts (2 errors) ==== - module M { - class Visibility { - public foo() { }; - ~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. - private bar() { }; - ~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. - private x: number; - public y: number; - public z: number; - - constructor() { - this.x = 1; - this.y = 2; - } - } - } \ No newline at end of file diff --git a/tests/baselines/reference/es6ClassTest3.js b/tests/baselines/reference/es6ClassTest3.js index 371a983d152..572bd079636 100644 --- a/tests/baselines/reference/es6ClassTest3.js +++ b/tests/baselines/reference/es6ClassTest3.js @@ -22,10 +22,10 @@ var M; this.x = 1; this.y = 2; } - Visibility.prototype.foo = function () { - }; - Visibility.prototype.bar = function () { - }; + Visibility.prototype.foo = function () { }; + ; + Visibility.prototype.bar = function () { }; + ; return Visibility; })(); })(M || (M = {})); diff --git a/tests/baselines/reference/es6ClassTest3.types b/tests/baselines/reference/es6ClassTest3.types new file mode 100644 index 00000000000..ba0f2036f0e --- /dev/null +++ b/tests/baselines/reference/es6ClassTest3.types @@ -0,0 +1,37 @@ +=== tests/cases/compiler/es6ClassTest3.ts === +module M { +>M : typeof M + + class Visibility { +>Visibility : Visibility + + public foo() { }; +>foo : () => void + + private bar() { }; +>bar : () => void + + private x: number; +>x : number + + public y: number; +>y : number + + public z: number; +>z : number + + constructor() { + this.x = 1; +>this.x = 1 : number +>this.x : number +>this : Visibility +>x : number + + this.y = 2; +>this.y = 2 : number +>this.y : number +>this : Visibility +>y : number + } + } +} diff --git a/tests/baselines/reference/es6ClassTest7.types b/tests/baselines/reference/es6ClassTest7.types index 9ac4a65b305..2ad5e88179c 100644 --- a/tests/baselines/reference/es6ClassTest7.types +++ b/tests/baselines/reference/es6ClassTest7.types @@ -9,7 +9,7 @@ declare module M { class Bar extends M.Foo { >Bar : Bar ->M : unknown +>M : typeof M >Foo : M.Foo } diff --git a/tests/baselines/reference/es6ClassTest8.js b/tests/baselines/reference/es6ClassTest8.js index 3c616e5e893..f96bbd16b0b 100644 --- a/tests/baselines/reference/es6ClassTest8.js +++ b/tests/baselines/reference/es6ClassTest8.js @@ -41,9 +41,7 @@ class Camera { //// [es6ClassTest8.js] -function f1(x) { - return x; -} +function f1(x) { return x; } var C = (function () { function C() { var bar = (function () { @@ -59,21 +57,11 @@ var Vector = (function () { this.y = y; this.z = z; } - Vector.norm = function (v) { - return null; - }; - Vector.minus = function (v1, v2) { - return null; - }; - Vector.times = function (v1, v2) { - return null; - }; - Vector.cross = function (v1, v2) { - return null; - }; - Vector.dot = function (v1, v2) { - return null; - }; + Vector.norm = function (v) { return null; }; + Vector.minus = function (v1, v2) { return null; }; + Vector.times = function (v1, v2) { return null; }; + Vector.cross = function (v1, v2) { return null; }; + Vector.dot = function (v1, v2) { return null; }; return Vector; })(); var Camera = (function () { diff --git a/tests/baselines/reference/es6ClassTest9.js b/tests/baselines/reference/es6ClassTest9.js index d45c99d3b04..538fec5a2ab 100644 --- a/tests/baselines/reference/es6ClassTest9.js +++ b/tests/baselines/reference/es6ClassTest9.js @@ -5,5 +5,4 @@ function foo() {} //// [es6ClassTest9.js] (); -function foo() { -} +function foo() { } diff --git a/tests/baselines/reference/es6ExportDefaultClassDeclaration.js b/tests/baselines/reference/es6ExportDefaultClassDeclaration.js index 2a25b5ac349..8162d6813b6 100644 --- a/tests/baselines/reference/es6ExportDefaultClassDeclaration.js +++ b/tests/baselines/reference/es6ExportDefaultClassDeclaration.js @@ -7,8 +7,7 @@ export default class C { //// [es6ExportDefaultClassDeclaration.js] export default class C { - method() { - } + method() { } } diff --git a/tests/baselines/reference/es6ExportDefaultClassDeclaration2.js b/tests/baselines/reference/es6ExportDefaultClassDeclaration2.js index ac5d92b6c12..e2f8524fb06 100644 --- a/tests/baselines/reference/es6ExportDefaultClassDeclaration2.js +++ b/tests/baselines/reference/es6ExportDefaultClassDeclaration2.js @@ -7,8 +7,7 @@ export default class { //// [es6ExportDefaultClassDeclaration2.js] export default class { - method() { - } + method() { } } diff --git a/tests/baselines/reference/es6ExportDefaultFunctionDeclaration.js b/tests/baselines/reference/es6ExportDefaultFunctionDeclaration.js index ec5789203d0..a30c8d71039 100644 --- a/tests/baselines/reference/es6ExportDefaultFunctionDeclaration.js +++ b/tests/baselines/reference/es6ExportDefaultFunctionDeclaration.js @@ -4,8 +4,7 @@ export default function f() { } //// [es6ExportDefaultFunctionDeclaration.js] -export default function f() { -} +export default function f() { } //// [es6ExportDefaultFunctionDeclaration.d.ts] diff --git a/tests/baselines/reference/es6ExportDefaultFunctionDeclaration2.js b/tests/baselines/reference/es6ExportDefaultFunctionDeclaration2.js index 80e37f18d21..46ed72dd236 100644 --- a/tests/baselines/reference/es6ExportDefaultFunctionDeclaration2.js +++ b/tests/baselines/reference/es6ExportDefaultFunctionDeclaration2.js @@ -4,8 +4,7 @@ export default function () { } //// [es6ExportDefaultFunctionDeclaration2.js] -export default function () { -} +export default function () { } //// [es6ExportDefaultFunctionDeclaration2.d.ts] diff --git a/tests/baselines/reference/es6ExportDefaultIdentifier.js b/tests/baselines/reference/es6ExportDefaultIdentifier.js index 5785220dfee..1fd3a38ff8d 100644 --- a/tests/baselines/reference/es6ExportDefaultIdentifier.js +++ b/tests/baselines/reference/es6ExportDefaultIdentifier.js @@ -6,8 +6,7 @@ export default f; //// [es6ExportDefaultIdentifier.js] -export function f() { -} +export function f() { } export default f; diff --git a/tests/baselines/reference/es6ExportEquals.js b/tests/baselines/reference/es6ExportEquals.js index 68c5788c89b..e4cf13758ff 100644 --- a/tests/baselines/reference/es6ExportEquals.js +++ b/tests/baselines/reference/es6ExportEquals.js @@ -6,8 +6,7 @@ export = f; //// [es6ExportEquals.js] -export function f() { -} +export function f() { } //// [es6ExportEquals.d.ts] diff --git a/tests/baselines/reference/es6MemberScoping.js b/tests/baselines/reference/es6MemberScoping.js index 85f76a93934..7e70045ceb3 100644 --- a/tests/baselines/reference/es6MemberScoping.js +++ b/tests/baselines/reference/es6MemberScoping.js @@ -30,8 +30,6 @@ var Foo = (function () { var Foo2 = (function () { function Foo2() { } - Foo2.Foo2 = function () { - return 0; - }; // should not be an error + Foo2.Foo2 = function () { return 0; }; // should not be an error return Foo2; })(); diff --git a/tests/baselines/reference/es6ModuleInternalNamedImports.js b/tests/baselines/reference/es6ModuleInternalNamedImports.js index db7c771eaba..98504601d02 100644 --- a/tests/baselines/reference/es6ModuleInternalNamedImports.js +++ b/tests/baselines/reference/es6ModuleInternalNamedImports.js @@ -47,8 +47,7 @@ export var M; var x; })(M_M = M.M_M || (M.M_M = {})); // function - function M_F() { - } + function M_F() { } M.M_F = M_F; // enum (function (M_E) { diff --git a/tests/baselines/reference/es6ModuleInternalNamedImports2.js b/tests/baselines/reference/es6ModuleInternalNamedImports2.js index b0800643060..9dee8153e56 100644 --- a/tests/baselines/reference/es6ModuleInternalNamedImports2.js +++ b/tests/baselines/reference/es6ModuleInternalNamedImports2.js @@ -49,8 +49,7 @@ export var M; var x; })(M_M = M.M_M || (M.M_M = {})); // function - function M_F() { - } + function M_F() { } M.M_F = M_F; // enum (function (M_E) { diff --git a/tests/baselines/reference/escapedIdentifiers.js b/tests/baselines/reference/escapedIdentifiers.js index dd06f3bbc86..7051d8d2433 100644 --- a/tests/baselines/reference/escapedIdentifiers.js +++ b/tests/baselines/reference/escapedIdentifiers.js @@ -169,21 +169,13 @@ var classType2Object1 = new classType2(); classType2Object1.foo2 = 2; var classType2Object2 = new classType\u0032(); classType2Object2.foo2 = 2; -var interfaceType1Object1 = { - bar1: 0 -}; +var interfaceType1Object1 = { bar1: 0 }; interfaceType1Object1.bar1 = 2; -var interfaceType1Object2 = { - bar1: 0 -}; +var interfaceType1Object2 = { bar1: 0 }; interfaceType1Object2.bar1 = 2; -var interfaceType2Object1 = { - bar2: 0 -}; +var interfaceType2Object1 = { bar2: 0 }; interfaceType2Object1.bar2 = 2; -var interfaceType2Object2 = { - bar2: 0 -}; +var interfaceType2Object2 = { bar2: 0 }; interfaceType2Object2.bar2 = 2; // arguments var testClass = (function () { diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.js b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.js index ee447619bfe..707801dc4ee 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.js +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.js @@ -59,9 +59,7 @@ var D = (function () { } return D; })(); -function F(x) { - return 42; -} +function F(x) { return 42; } var M; (function (M) { var A = (function () { @@ -70,9 +68,7 @@ var M; return A; })(); M.A = A; - function F2(x) { - return x.toString(); - } + function F2(x) { return x.toString(); } M.F2 = F2; })(M || (M = {})); var aNumber = 9.9; @@ -85,17 +81,11 @@ var aVoid = undefined; var anInterface = new C(); var aClass = new C(); var aGenericClass = new D(); -var anObjectLiteral = { - id: 12 -}; +var anObjectLiteral = { id: 12 }; var anOtherObjectLiteral = new C(); var aFunction = F; var anOtherFunction = F; -var aLambda = function (x) { - return 2; -}; +var aLambda = function (x) { return 2; }; var aModule = M; var aClassInModule = new M.A(); -var aFunctionInModule = function (x) { - return 'this is a string'; -}; +var aFunctionInModule = function (x) { return 'this is a string'; }; diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.js b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.js index 10f3fd9bf11..40e45bf7ec0 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.js +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.js @@ -65,12 +65,8 @@ var D = (function () { } return D; })(); -function F(x) { - return 42; -} -function F2(x) { - return x < 42; -} +function F(x) { return 42; } +function F2(x) { return x < 42; } var M; (function (M) { var A = (function () { @@ -79,9 +75,7 @@ var M; return A; })(); M.A = A; - function F2(x) { - return x.toString(); - } + function F2(x) { return x.toString(); } M.F2 = F2; })(M || (M = {})); var N; @@ -92,9 +86,7 @@ var N; return A; })(); N.A = A; - function F2(x) { - return x.toString(); - } + function F2(x) { return x.toString(); } N.F2 = F2; })(N || (N = {})); var aNumber = 'this is a string'; @@ -104,15 +96,11 @@ var aVoid = 9.9; var anInterface = new D(); var aClass = new D(); var aGenericClass = new C(); -var anObjectLiteral = { - id: 'a string' -}; +var anObjectLiteral = { id: 'a string' }; var anOtherObjectLiteral = new C(); var aFunction = F2; var anOtherFunction = F2; -var aLambda = function (x) { - return 'a string'; -}; +var aLambda = function (x) { return 'a string'; }; var aModule = N; var aClassInModule = new N.A(); var aFunctionInModule = F2; diff --git a/tests/baselines/reference/everyTypeWithInitializer.js b/tests/baselines/reference/everyTypeWithInitializer.js index aafefcc5777..aae0a9fe291 100644 --- a/tests/baselines/reference/everyTypeWithInitializer.js +++ b/tests/baselines/reference/everyTypeWithInitializer.js @@ -60,9 +60,7 @@ var D = (function () { } return D; })(); -function F(x) { - return 42; -} +function F(x) { return 42; } var M; (function (M) { var A = (function () { @@ -71,9 +69,7 @@ var M; return A; })(); M.A = A; - function F2(x) { - return x.toString(); - } + function F2(x) { return x.toString(); } M.F2 = F2; })(M || (M = {})); var aNumber = 9.9; @@ -85,13 +81,9 @@ var anOtherAny = new C(); var anUndefined = undefined; var aClass = new C(); var aGenericClass = new D(); -var anObjectLiteral = { - id: 12 -}; +var anObjectLiteral = { id: 12 }; var aFunction = F; -var aLambda = function (x) { - return 2; -}; +var aLambda = function (x) { return 2; }; var aModule = M; var aClassInModule = new M.A(); var aFunctionInModule = M.F2; diff --git a/tests/baselines/reference/exportAlreadySeen.js b/tests/baselines/reference/exportAlreadySeen.js index e18c0bbf7f6..68d30a697fd 100644 --- a/tests/baselines/reference/exportAlreadySeen.js +++ b/tests/baselines/reference/exportAlreadySeen.js @@ -23,8 +23,7 @@ declare module A { var M; (function (M) { M.x = 1; - function f() { - } + function f() { } M.f = f; var N; (function (N) { diff --git a/tests/baselines/reference/exportAssignClassAndModule.types b/tests/baselines/reference/exportAssignClassAndModule.types index 05a5cbf07ae..dc4a19f345c 100644 --- a/tests/baselines/reference/exportAssignClassAndModule.types +++ b/tests/baselines/reference/exportAssignClassAndModule.types @@ -22,9 +22,9 @@ class Foo { >Foo : Foo x: Foo.Bar; ->x : export=.Bar +>x : Foo.Bar >Foo : unknown ->Bar : export=.Bar +>Bar : Foo.Bar } module Foo { >Foo : typeof Foo diff --git a/tests/baselines/reference/exportAssignNonIdentifier.errors.txt b/tests/baselines/reference/exportAssignNonIdentifier.errors.txt index 9c9f1aa6874..2935308909b 100644 --- a/tests/baselines/reference/exportAssignNonIdentifier.errors.txt +++ b/tests/baselines/reference/exportAssignNonIdentifier.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/externalModules/foo1.ts(2,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. -tests/cases/conformance/externalModules/foo3.ts(1,10): error TS1109: Expression expected. +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. @@ -14,8 +14,8 @@ tests/cases/conformance/externalModules/foo6.ts(1,14): error TS1109: Expression ==== tests/cases/conformance/externalModules/foo3.ts (1 errors) ==== export = class Foo3 {}; // Error, not an expression - ~~~~~ -!!! error TS1109: Expression expected. + ~~~~ +!!! error TS9003: 'class' expressions are not currently supported. ==== tests/cases/conformance/externalModules/foo4.ts (0 errors) ==== export = true; // Ok diff --git a/tests/baselines/reference/exportAssignNonIdentifier.js b/tests/baselines/reference/exportAssignNonIdentifier.js index ffa2fb9ba58..343405c8624 100644 --- a/tests/baselines/reference/exportAssignNonIdentifier.js +++ b/tests/baselines/reference/exportAssignNonIdentifier.js @@ -33,12 +33,11 @@ module.exports = typeof x; //// [foo2.js] module.exports = "sausages"; //// [foo3.js] -var Foo3 = (function () { +module.exports = (function () { function Foo3() { } return Foo3; })(); -; // Error, not an expression //// [foo4.js] module.exports = true; //// [foo5.js] diff --git a/tests/baselines/reference/exportAssignTypes.js b/tests/baselines/reference/exportAssignTypes.js index d4b74659dcc..e898f798a7c 100644 --- a/tests/baselines/reference/exportAssignTypes.js +++ b/tests/baselines/reference/exportAssignTypes.js @@ -63,16 +63,10 @@ module.exports = x; var x = true; module.exports = x; //// [expArray.js] -var x = [ - 1, - 2 -]; +var x = [1, 2]; module.exports = x; //// [expObject.js] -var x = { - answer: 42, - when: 1776 -}; +var x = { answer: 42, when: 1776 }; module.exports = x; //// [expAny.js] var x; diff --git a/tests/baselines/reference/exportAssignmentConstrainedGenericType.js b/tests/baselines/reference/exportAssignmentConstrainedGenericType.js index e9742812469..b62cc8251be 100644 --- a/tests/baselines/reference/exportAssignmentConstrainedGenericType.js +++ b/tests/baselines/reference/exportAssignmentConstrainedGenericType.js @@ -24,8 +24,5 @@ module.exports = Foo; //// [foo_1.js] var foo = require("./foo_0"); var x = new foo(true); // Should error -var y = new foo({ - a: "test", - b: 42 -}); // Should be OK +var y = new foo({ a: "test", b: 42 }); // Should be OK var z = y.test.b; diff --git a/tests/baselines/reference/exportAssignmentFunction.js b/tests/baselines/reference/exportAssignmentFunction.js index 6d4336bd4bd..825d0f983ea 100644 --- a/tests/baselines/reference/exportAssignmentFunction.js +++ b/tests/baselines/reference/exportAssignmentFunction.js @@ -12,9 +12,7 @@ var n: number = fooFunc(); //// [exportAssignmentFunction_A.js] define(["require", "exports"], function (require, exports) { - function foo() { - return 0; - } + function foo() { return 0; } return foo; }); //// [exportAssignmentFunction_B.js] diff --git a/tests/baselines/reference/exportAssignmentMergedInterface.js b/tests/baselines/reference/exportAssignmentMergedInterface.js index fbcb99bc642..f99d7f3a465 100644 --- a/tests/baselines/reference/exportAssignmentMergedInterface.js +++ b/tests/baselines/reference/exportAssignmentMergedInterface.js @@ -31,11 +31,7 @@ define(["require", "exports"], function (require, exports) { x("test"); x(42); var y = x.b; - if (!!x.c) { - } - var z = { - x: 1, - y: 2 - }; + if (!!x.c) { } + var z = { x: 1, y: 2 }; z = x.d; }); diff --git a/tests/baselines/reference/exportCodeGen.js b/tests/baselines/reference/exportCodeGen.js index 1b1f934b2f9..30ed0b07ae9 100644 --- a/tests/baselines/reference/exportCodeGen.js +++ b/tests/baselines/reference/exportCodeGen.js @@ -94,8 +94,7 @@ var E; Color[Color["Red"] = 0] = "Red"; })(E.Color || (E.Color = {})); var Color = E.Color; - function fn() { - } + function fn() { } E.fn = fn; var C = (function () { function C() { @@ -116,8 +115,7 @@ var F; (function (Color) { Color[Color["Red"] = 0] = "Red"; })(Color || (Color = {})); - function fn() { - } + function fn() { } var C = (function () { function C() { } diff --git a/tests/baselines/reference/exportDeclarationInInternalModule.errors.txt b/tests/baselines/reference/exportDeclarationInInternalModule.errors.txt new file mode 100644 index 00000000000..58973f2a096 --- /dev/null +++ b/tests/baselines/reference/exportDeclarationInInternalModule.errors.txt @@ -0,0 +1,24 @@ +tests/cases/compiler/exportDeclarationInInternalModule.ts(14,19): error TS1141: String literal expected. + + +==== tests/cases/compiler/exportDeclarationInInternalModule.ts (1 errors) ==== + + class Bbb { + } + + class Aaa extends Bbb { } + + module Aaa { + export class SomeType { } + } + + module Bbb { + export class SomeType { } + + export * from Aaa; // this line causes the nullref + ~~~ +!!! error TS1141: String literal expected. + } + + var a: Bbb.SomeType; + \ No newline at end of file diff --git a/tests/baselines/reference/exportDeclarationInInternalModule.js b/tests/baselines/reference/exportDeclarationInInternalModule.js new file mode 100644 index 00000000000..97011f2425f --- /dev/null +++ b/tests/baselines/reference/exportDeclarationInInternalModule.js @@ -0,0 +1,76 @@ +//// [exportDeclarationInInternalModule.ts] + +class Bbb { +} + +class Aaa extends Bbb { } + +module Aaa { + export class SomeType { } +} + +module Bbb { + export class SomeType { } + + export * from Aaa; // this line causes the nullref +} + +var a: Bbb.SomeType; + + +//// [exportDeclarationInInternalModule.js] +var __extends = this.__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 Bbb = (function () { + function Bbb() { + } + return Bbb; +})(); +var Aaa = (function (_super) { + __extends(Aaa, _super); + function Aaa() { + _super.apply(this, arguments); + } + return Aaa; +})(Bbb); +var Aaa; +(function (Aaa) { + var SomeType = (function () { + function SomeType() { + } + return SomeType; + })(); + Aaa.SomeType = SomeType; +})(Aaa || (Aaa = {})); +var Bbb; +(function (Bbb) { + var SomeType = (function () { + function SomeType() { + } + return SomeType; + })(); + Bbb.SomeType = SomeType; + __export(require()); // this line causes the nullref +})(Bbb || (Bbb = {})); +var a; + + +//// [exportDeclarationInInternalModule.d.ts] +declare class Bbb { +} +declare class Aaa extends Bbb { +} +declare module Aaa { + class SomeType { + } +} +declare module Bbb { + class SomeType { + } + export * from Aaa; +} +declare var a: Bbb.SomeType; diff --git a/tests/baselines/reference/exportDeclareClass1.errors.txt b/tests/baselines/reference/exportDeclareClass1.errors.txt index c93dc5d0b01..247b0511ed1 100644 --- a/tests/baselines/reference/exportDeclareClass1.errors.txt +++ b/tests/baselines/reference/exportDeclareClass1.errors.txt @@ -1,15 +1,15 @@ -tests/cases/compiler/exportDeclareClass1.ts(2,24): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/compiler/exportDeclareClass1.ts(3,34): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. +tests/cases/compiler/exportDeclareClass1.ts(2,21): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/exportDeclareClass1.ts(3,31): error TS1184: An implementation cannot be declared in ambient contexts. ==== tests/cases/compiler/exportDeclareClass1.ts (2 errors) ==== export declare class eaC { static tF() { }; - ~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. + ~ +!!! error TS1184: An implementation cannot be declared in ambient contexts. static tsF(param:any) { }; - ~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. + ~ +!!! error TS1184: An implementation cannot be declared in ambient contexts. }; export declare class eaC2 { diff --git a/tests/baselines/reference/exportEqualNamespaces.types b/tests/baselines/reference/exportEqualNamespaces.types index b94770837a4..0f3091c1b8a 100644 --- a/tests/baselines/reference/exportEqualNamespaces.types +++ b/tests/baselines/reference/exportEqualNamespaces.types @@ -12,7 +12,7 @@ interface server { (): server.Server; >server : unknown ->Server : export=.Server +>Server : server.Server startTime: Date; >startTime : Date diff --git a/tests/baselines/reference/exportImportMultipleFiles.js b/tests/baselines/reference/exportImportMultipleFiles.js index 225b605f689..10909808ffc 100644 --- a/tests/baselines/reference/exportImportMultipleFiles.js +++ b/tests/baselines/reference/exportImportMultipleFiles.js @@ -14,9 +14,7 @@ lib.math.add(3, 4); // Shouldnt be error //// [exportImportMultipleFiles_math.js] define(["require", "exports"], function (require, exports) { - function add(a, b) { - return a + b; - } + function add(a, b) { return a + b; } exports.add = add; }); //// [exportImportMultipleFiles_library.js] diff --git a/tests/baselines/reference/exportImportNonInstantiatedModule.js b/tests/baselines/reference/exportImportNonInstantiatedModule.js index 720fbfafc61..d9081efcd36 100644 --- a/tests/baselines/reference/exportImportNonInstantiatedModule.js +++ b/tests/baselines/reference/exportImportNonInstantiatedModule.js @@ -14,6 +14,4 @@ var x: B.A1.I = { x: 1 }; var B; (function (B) { })(B || (B = {})); -var x = { - x: 1 -}; +var x = { x: 1 }; diff --git a/tests/baselines/reference/exportImportNonInstantiatedModule2.js b/tests/baselines/reference/exportImportNonInstantiatedModule2.js index 575271dba30..2782a6f6f67 100644 --- a/tests/baselines/reference/exportImportNonInstantiatedModule2.js +++ b/tests/baselines/reference/exportImportNonInstantiatedModule2.js @@ -24,9 +24,7 @@ define(["require", "exports"], function (require, exports) { //// [consumer.js] define(["require", "exports"], function (require, exports) { function w() { - return { - name: 'value' - }; + return { name: 'value' }; } exports.w = w; }); diff --git a/tests/baselines/reference/exportNonVisibleType.js b/tests/baselines/reference/exportNonVisibleType.js index edd0e6988d4..101c356d582 100644 --- a/tests/baselines/reference/exportNonVisibleType.js +++ b/tests/baselines/reference/exportNonVisibleType.js @@ -36,10 +36,7 @@ export = C1; // Should work, private type I1 of visible class C1 only used in pr //// [foo1.js] -var x = { - a: "test", - b: 42 -}; +var x = { a: "test", b: 42 }; module.exports = x; //// [foo2.js] var C1 = (function () { diff --git a/tests/baselines/reference/exportPrivateType.js b/tests/baselines/reference/exportPrivateType.js index 96acc83edb5..11ccc037ef6 100644 --- a/tests/baselines/reference/exportPrivateType.js +++ b/tests/baselines/reference/exportPrivateType.js @@ -41,9 +41,7 @@ var foo; var C2 = (function () { function C2() { } - C2.prototype.test = function () { - return true; - }; + C2.prototype.test = function () { return true; }; return C2; })(); // None of the types are exported, so per section 10.3, should all be errors diff --git a/tests/baselines/reference/exportStar-amd.js b/tests/baselines/reference/exportStar-amd.js index fb04aa208b2..dcd2d126a35 100644 --- a/tests/baselines/reference/exportStar-amd.js +++ b/tests/baselines/reference/exportStar-amd.js @@ -37,8 +37,7 @@ define(["require", "exports"], function (require, exports) { //// [t2.js] define(["require", "exports"], function (require, exports) { exports.default = "hello"; - function foo() { - } + function foo() { } exports.foo = foo; }); //// [t3.js] diff --git a/tests/baselines/reference/exportStar.js b/tests/baselines/reference/exportStar.js index 9fca12af8b1..d219a3650e7 100644 --- a/tests/baselines/reference/exportStar.js +++ b/tests/baselines/reference/exportStar.js @@ -34,8 +34,7 @@ exports.x = 1; exports.y = 2; //// [t2.js] exports.default = "hello"; -function foo() { -} +function foo() { } exports.foo = foo; //// [t3.js] var x = "x"; diff --git a/tests/baselines/reference/exportStarFromEmptyModule.errors.txt b/tests/baselines/reference/exportStarFromEmptyModule.errors.txt new file mode 100644 index 00000000000..598eb8bc029 --- /dev/null +++ b/tests/baselines/reference/exportStarFromEmptyModule.errors.txt @@ -0,0 +1,30 @@ +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_module4.ts(4,5): error TS2339: Property 'r' does not exist on type 'typeof A'. + + +==== tests/cases/compiler/exportStarFromEmptyModule_module1.ts (0 errors) ==== + + export class A { + static r; + } + +==== tests/cases/compiler/exportStarFromEmptyModule_module2.ts (0 errors) ==== + // empty + +==== tests/cases/compiler/exportStarFromEmptyModule_module3.ts (1 errors) ==== + export * from "exportStarFromEmptyModule_module2"; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2306: File 'exportStarFromEmptyModule_module2.ts' is not an external module. + export * from "exportStarFromEmptyModule_module1"; + + export class A { + static q; + } + +==== tests/cases/compiler/exportStarFromEmptyModule_module4.ts (1 errors) ==== + import * as X from "exportStarFromEmptyModule_module3"; + var s: X.A; + X.A.q; + X.A.r; // Error + ~ +!!! error TS2339: Property 'r' does not exist on type 'typeof A'. \ No newline at end of file diff --git a/tests/baselines/reference/exportStarFromEmptyModule.js b/tests/baselines/reference/exportStarFromEmptyModule.js new file mode 100644 index 00000000000..9b486af4eae --- /dev/null +++ b/tests/baselines/reference/exportStarFromEmptyModule.js @@ -0,0 +1,65 @@ +//// [tests/cases/compiler/exportStarFromEmptyModule.ts] //// + +//// [exportStarFromEmptyModule_module1.ts] + +export class A { + static r; +} + +//// [exportStarFromEmptyModule_module2.ts] +// empty + +//// [exportStarFromEmptyModule_module3.ts] +export * from "exportStarFromEmptyModule_module2"; +export * from "exportStarFromEmptyModule_module1"; + +export class A { + static q; +} + +//// [exportStarFromEmptyModule_module4.ts] +import * as X from "exportStarFromEmptyModule_module3"; +var s: X.A; +X.A.q; +X.A.r; // Error + +//// [exportStarFromEmptyModule_module1.js] +var A = (function () { + function A() { + } + return A; +})(); +exports.A = A; +//// [exportStarFromEmptyModule_module2.js] +// empty +//// [exportStarFromEmptyModule_module3.js] +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +__export(require("exportStarFromEmptyModule_module2")); +__export(require("exportStarFromEmptyModule_module1")); +var A = (function () { + function A() { + } + return A; +})(); +exports.A = A; +//// [exportStarFromEmptyModule_module4.js] +var X = require("exportStarFromEmptyModule_module3"); +var s; +X.A.q; +X.A.r; // Error + + +//// [exportStarFromEmptyModule_module1.d.ts] +export declare class A { + static r: any; +} +//// [exportStarFromEmptyModule_module2.d.ts] +//// [exportStarFromEmptyModule_module3.d.ts] +export * from "exportStarFromEmptyModule_module2"; +export * from "exportStarFromEmptyModule_module1"; +export declare class A { + static q: any; +} +//// [exportStarFromEmptyModule_module4.d.ts] diff --git a/tests/baselines/reference/exportedVariable1.js b/tests/baselines/reference/exportedVariable1.js index d1039e0db43..39eea8d34b5 100644 --- a/tests/baselines/reference/exportedVariable1.js +++ b/tests/baselines/reference/exportedVariable1.js @@ -5,8 +5,6 @@ var upper = foo.name.toUpperCase(); //// [exportedVariable1.js] define(["require", "exports"], function (require, exports) { - exports.foo = { - name: "Bill" - }; + exports.foo = { name: "Bill" }; var upper = exports.foo.name.toUpperCase(); }); diff --git a/tests/baselines/reference/exportsAndImports1-amd.js b/tests/baselines/reference/exportsAndImports1-amd.js index 99c6fe8d43f..fdc6d396bad 100644 --- a/tests/baselines/reference/exportsAndImports1-amd.js +++ b/tests/baselines/reference/exportsAndImports1-amd.js @@ -38,8 +38,7 @@ export { v, f, C, I, E, D, M, N, T, a }; define(["require", "exports"], function (require, exports) { var v = 1; exports.v = v; - function f() { - } + function f() { } exports.f = f; var C = (function () { function C() { diff --git a/tests/baselines/reference/exportsAndImports1.js b/tests/baselines/reference/exportsAndImports1.js index f381e6b7242..87cb9e0fe13 100644 --- a/tests/baselines/reference/exportsAndImports1.js +++ b/tests/baselines/reference/exportsAndImports1.js @@ -37,8 +37,7 @@ export { v, f, C, I, E, D, M, N, T, a }; //// [t1.js] var v = 1; exports.v = v; -function f() { -} +function f() { } exports.f = f; var C = (function () { function C() { diff --git a/tests/baselines/reference/exportsAndImports3-amd.js b/tests/baselines/reference/exportsAndImports3-amd.js index 613598cc0ee..f72d063e099 100644 --- a/tests/baselines/reference/exportsAndImports3-amd.js +++ b/tests/baselines/reference/exportsAndImports3-amd.js @@ -38,8 +38,7 @@ export { v, f, C, I, E, D, M, N, T, a }; define(["require", "exports"], function (require, exports) { exports.v = 1; exports.v1 = exports.v; - function f() { - } + function f() { } exports.f = f; exports.f1 = exports.f; var C = (function () { diff --git a/tests/baselines/reference/exportsAndImports3.js b/tests/baselines/reference/exportsAndImports3.js index f06a6f684d0..56baead64cc 100644 --- a/tests/baselines/reference/exportsAndImports3.js +++ b/tests/baselines/reference/exportsAndImports3.js @@ -37,8 +37,7 @@ export { v, f, C, I, E, D, M, N, T, a }; //// [t1.js] exports.v = 1; exports.v1 = exports.v; -function f() { -} +function f() { } exports.f = f; exports.f1 = exports.f; var C = (function () { diff --git a/tests/baselines/reference/extBaseClass1.types b/tests/baselines/reference/extBaseClass1.types index 16f89ab5a20..d160db9a06e 100644 --- a/tests/baselines/reference/extBaseClass1.types +++ b/tests/baselines/reference/extBaseClass1.types @@ -29,7 +29,7 @@ module N { export class C3 extends M.B { >C3 : C3 ->M : unknown +>M : typeof M >B : M.B } } diff --git a/tests/baselines/reference/extendAndImplementTheSameBaseType.js b/tests/baselines/reference/extendAndImplementTheSameBaseType.js index 836db4dc362..23c9127175e 100644 --- a/tests/baselines/reference/extendAndImplementTheSameBaseType.js +++ b/tests/baselines/reference/extendAndImplementTheSameBaseType.js @@ -23,8 +23,7 @@ var __extends = this.__extends || function (d, b) { var C = (function () { function C() { } - C.prototype.bar = function () { - }; + C.prototype.bar = function () { }; return C; })(); var D = (function (_super) { @@ -32,8 +31,7 @@ var D = (function (_super) { function D() { _super.apply(this, arguments); } - D.prototype.baz = function () { - }; + D.prototype.baz = function () { }; return D; })(C); var c; diff --git a/tests/baselines/reference/extendAndImplementTheSameBaseType2.js b/tests/baselines/reference/extendAndImplementTheSameBaseType2.js index 8311f4d6ce6..234cc59ff70 100644 --- a/tests/baselines/reference/extendAndImplementTheSameBaseType2.js +++ b/tests/baselines/reference/extendAndImplementTheSameBaseType2.js @@ -36,8 +36,7 @@ var D = (function (_super) { function D() { _super.apply(this, arguments); } - D.prototype.baz = function () { - }; + D.prototype.baz = function () { }; return D; })(C); var d = new D(); diff --git a/tests/baselines/reference/extendArray.js b/tests/baselines/reference/extendArray.js index 7809aa6bb25..6d5c0262209 100644 --- a/tests/baselines/reference/extendArray.js +++ b/tests/baselines/reference/extendArray.js @@ -24,12 +24,8 @@ arr.collect = function (fn) { //// [extendArray.js] -var a = [ - 1, - 2 -]; -a.forEach(function (v, i, a) { -}); +var a = [1, 2]; +a.forEach(function (v, i, a) { }); var arr = Array.prototype; arr.collect = function (fn) { var res = []; diff --git a/tests/baselines/reference/extendNonClassSymbol1.js b/tests/baselines/reference/extendNonClassSymbol1.js index 47a602aefaf..26f0c776dd8 100644 --- a/tests/baselines/reference/extendNonClassSymbol1.js +++ b/tests/baselines/reference/extendNonClassSymbol1.js @@ -13,8 +13,7 @@ var __extends = this.__extends || function (d, b) { var A = (function () { function A() { } - A.prototype.foo = function () { - }; + A.prototype.foo = function () { }; return A; })(); var x = A; diff --git a/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.types b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.types index 6525f201f5b..769f6f5a602 100644 --- a/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.types +++ b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.types @@ -60,7 +60,7 @@ import Backbone = require("extendingClassFromAliasAndUsageInIndexer_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel ->Backbone : unknown +>Backbone : typeof Backbone >Model : Backbone.Model // interesting stuff here @@ -72,7 +72,7 @@ import Backbone = require("extendingClassFromAliasAndUsageInIndexer_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel ->Backbone : unknown +>Backbone : typeof Backbone >Model : Backbone.Model // different interesting stuff here diff --git a/tests/baselines/reference/extendsClauseAlreadySeen.js b/tests/baselines/reference/extendsClauseAlreadySeen.js index 5c328e39131..820a6910962 100644 --- a/tests/baselines/reference/extendsClauseAlreadySeen.js +++ b/tests/baselines/reference/extendsClauseAlreadySeen.js @@ -23,7 +23,6 @@ var D = (function (_super) { function D() { _super.apply(this, arguments); } - D.prototype.baz = function () { - }; + D.prototype.baz = function () { }; return D; })(C); diff --git a/tests/baselines/reference/extendsClauseAlreadySeen2.js b/tests/baselines/reference/extendsClauseAlreadySeen2.js index 3f3b7049311..ad88446c4c4 100644 --- a/tests/baselines/reference/extendsClauseAlreadySeen2.js +++ b/tests/baselines/reference/extendsClauseAlreadySeen2.js @@ -23,7 +23,6 @@ var D = (function (_super) { function D() { _super.apply(this, arguments); } - D.prototype.baz = function () { - }; + D.prototype.baz = function () { }; return D; })(C); diff --git a/tests/baselines/reference/externModule.errors.txt b/tests/baselines/reference/externModule.errors.txt index eff17eb8586..8d4126350c1 100644 --- a/tests/baselines/reference/externModule.errors.txt +++ b/tests/baselines/reference/externModule.errors.txt @@ -2,18 +2,19 @@ tests/cases/compiler/externModule.ts(1,1): error TS2304: Cannot find name 'decla tests/cases/compiler/externModule.ts(1,9): error TS1005: ';' expected. tests/cases/compiler/externModule.ts(1,9): error TS2304: Cannot find name 'module'. tests/cases/compiler/externModule.ts(1,16): error TS1005: ';' expected. -tests/cases/compiler/externModule.ts(2,5): error TS1129: Statement expected. -tests/cases/compiler/externModule.ts(2,18): error TS1148: Cannot compile external modules unless the '--module' flag is provided. tests/cases/compiler/externModule.ts(3,10): error TS2391: Function implementation is missing or not immediately following the declaration. tests/cases/compiler/externModule.ts(4,10): error TS2391: Function implementation is missing or not immediately following the declaration. tests/cases/compiler/externModule.ts(18,6): error TS2390: Constructor implementation is missing. tests/cases/compiler/externModule.ts(20,13): error TS2391: Function implementation is missing or not immediately following the declaration. tests/cases/compiler/externModule.ts(26,13): error TS2391: Function implementation is missing or not immediately following the declaration. tests/cases/compiler/externModule.ts(28,13): error TS2391: Function implementation is missing or not immediately following the declaration. -tests/cases/compiler/externModule.ts(30,1): error TS1128: Declaration or statement expected. +tests/cases/compiler/externModule.ts(32,11): error TS2304: Cannot find name 'XDate'. +tests/cases/compiler/externModule.ts(34,7): error TS2304: Cannot find name 'XDate'. +tests/cases/compiler/externModule.ts(36,7): error TS2304: Cannot find name 'XDate'. +tests/cases/compiler/externModule.ts(37,3): error TS2304: Cannot find name 'XDate'. -==== tests/cases/compiler/externModule.ts (13 errors) ==== +==== tests/cases/compiler/externModule.ts (14 errors) ==== declare module { ~~~~~~~ !!! error TS2304: Cannot find name 'declare'. @@ -24,10 +25,6 @@ tests/cases/compiler/externModule.ts(30,1): error TS1128: Declaration or stateme ~ !!! error TS1005: ';' expected. export class XDate { - ~~~~~~ -!!! error TS1129: Statement expected. - ~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. public getDay():number; ~~~~~~ !!! error TS2391: Function implementation is missing or not immediately following the declaration. @@ -68,14 +65,20 @@ tests/cases/compiler/externModule.ts(30,1): error TS1128: Declaration or stateme !!! error TS2391: Function implementation is missing or not immediately following the declaration. } } - ~ -!!! error TS1128: Declaration or statement expected. var d=new XDate(); + ~~~~~ +!!! error TS2304: Cannot find name 'XDate'. d.getDay(); d=new XDate(1978,2); + ~~~~~ +!!! error TS2304: Cannot find name 'XDate'. d.getXDate(); var n=XDate.parse("3/2/2004"); + ~~~~~ +!!! error TS2304: Cannot find name 'XDate'. n=XDate.UTC(1964,2,1); + ~~~~~ +!!! error TS2304: Cannot find name 'XDate'. \ No newline at end of file diff --git a/tests/baselines/reference/externModule.js b/tests/baselines/reference/externModule.js index 0dc3d8e84cd..bf175f0eeff 100644 --- a/tests/baselines/reference/externModule.js +++ b/tests/baselines/reference/externModule.js @@ -43,13 +43,13 @@ n=XDate.UTC(1964,2,1); declare; module; { + var XDate = (function () { + function XDate() { + } + return XDate; + })(); + exports.XDate = XDate; } -var XDate = (function () { - function XDate() { - } - return XDate; -})(); -exports.XDate = XDate; var d = new XDate(); d.getDay(); d = new XDate(1978, 2); diff --git a/tests/baselines/reference/externalModuleImmutableBindings.errors.txt b/tests/baselines/reference/externalModuleImmutableBindings.errors.txt index 09cc7b33295..8ab07c26851 100644 --- a/tests/baselines/reference/externalModuleImmutableBindings.errors.txt +++ b/tests/baselines/reference/externalModuleImmutableBindings.errors.txt @@ -1,164 +1,82 @@ -tests/cases/compiler/f2.ts(5,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/compiler/f2.ts(6,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/compiler/f2.ts(7,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/compiler/f2.ts(7,7): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. -tests/cases/compiler/f2.ts(8,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/compiler/f2.ts(10,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/compiler/f2.ts(11,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/compiler/f2.ts(12,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/compiler/f2.ts(13,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/compiler/f2.ts(15,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/compiler/f2.ts(16,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/compiler/f2.ts(17,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/compiler/f2.ts(17,8): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. -tests/cases/compiler/f2.ts(18,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/compiler/f2.ts(20,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/compiler/f2.ts(21,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/compiler/f2.ts(22,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/compiler/f2.ts(23,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/compiler/f2.ts(25,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. -tests/cases/compiler/f2.ts(26,6): error TS2487: Invalid left-hand side in 'for...of' statement. +tests/cases/compiler/f2.ts(9,7): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. +tests/cases/compiler/f2.ts(19,8): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. tests/cases/compiler/f2.ts(27,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. -tests/cases/compiler/f2.ts(28,6): error TS2487: Invalid left-hand side in 'for...of' statement. -tests/cases/compiler/f2.ts(29,6): error TS2406: Invalid left-hand side in 'for...in' statement. -tests/cases/compiler/f2.ts(29,12): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. -tests/cases/compiler/f2.ts(30,6): error TS2487: Invalid left-hand side in 'for...of' statement. -tests/cases/compiler/f2.ts(30,12): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. -tests/cases/compiler/f2.ts(31,6): error TS2406: Invalid left-hand side in 'for...in' statement. -tests/cases/compiler/f2.ts(32,6): error TS2487: Invalid left-hand side in 'for...of' statement. -tests/cases/compiler/f2.ts(34,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. -tests/cases/compiler/f2.ts(35,6): error TS2487: Invalid left-hand side in 'for...of' statement. +tests/cases/compiler/f2.ts(29,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. +tests/cases/compiler/f2.ts(31,12): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. +tests/cases/compiler/f2.ts(32,12): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. tests/cases/compiler/f2.ts(36,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. -tests/cases/compiler/f2.ts(37,6): error TS2487: Invalid left-hand side in 'for...of' statement. -tests/cases/compiler/f2.ts(38,6): error TS2406: Invalid left-hand side in 'for...in' statement. -tests/cases/compiler/f2.ts(38,13): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. -tests/cases/compiler/f2.ts(39,6): error TS2487: Invalid left-hand side in 'for...of' statement. -tests/cases/compiler/f2.ts(39,13): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. -tests/cases/compiler/f2.ts(40,6): error TS2406: Invalid left-hand side in 'for...in' statement. -tests/cases/compiler/f2.ts(41,6): error TS2487: Invalid left-hand side in 'for...of' statement. +tests/cases/compiler/f2.ts(38,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. +tests/cases/compiler/f2.ts(40,13): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. +tests/cases/compiler/f2.ts(41,13): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. ==== tests/cases/compiler/f1.ts (0 errors) ==== export var x = 1; -==== tests/cases/compiler/f2.ts (38 errors) ==== +==== tests/cases/compiler/f2.ts (10 errors) ==== + + // all mutations below are illegal and should be fixed import * as stuff from 'f1'; var n = 'baz'; stuff.x = 0; - ~~~~~~~ -!!! error TS2364: Invalid left-hand side of assignment expression. stuff['x'] = 1; - ~~~~~~~~~~ -!!! error TS2364: Invalid left-hand side of assignment expression. stuff.blah = 2; - ~~~~~~~~~~ -!!! error TS2364: Invalid left-hand side of assignment expression. ~~~~ !!! error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. stuff[n] = 3; - ~~~~~~~~ -!!! error TS2364: Invalid left-hand side of assignment expression. stuff.x++; - ~~~~~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. stuff['x']++; - ~~~~~~~~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. stuff['blah']++; - ~~~~~~~~~~~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. stuff[n]++; - ~~~~~~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. (stuff.x) = 0; - ~~~~~~~~~ -!!! error TS2364: Invalid left-hand side of assignment expression. (stuff['x']) = 1; - ~~~~~~~~~~~~ -!!! error TS2364: Invalid left-hand side of assignment expression. (stuff.blah) = 2; - ~~~~~~~~~~~~ -!!! error TS2364: Invalid left-hand side of assignment expression. ~~~~ !!! error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. (stuff[n]) = 3; - ~~~~~~~~~~ -!!! error TS2364: Invalid left-hand side of assignment expression. (stuff.x)++; - ~~~~~~~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. (stuff['x'])++; - ~~~~~~~~~~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. (stuff['blah'])++; - ~~~~~~~~~~~~~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. (stuff[n])++; - ~~~~~~~~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. for (stuff.x in []) {} ~~~~~~~ !!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. for (stuff.x of []) {} - ~~~~~~~ -!!! error TS2487: Invalid left-hand side in 'for...of' statement. for (stuff['x'] in []) {} ~~~~~~~~~~ !!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. for (stuff['x'] of []) {} - ~~~~~~~~~~ -!!! error TS2487: Invalid left-hand side in 'for...of' statement. for (stuff.blah in []) {} - ~~~~~~~~~~ -!!! error TS2406: Invalid left-hand side in 'for...in' statement. ~~~~ !!! error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. for (stuff.blah of []) {} - ~~~~~~~~~~ -!!! error TS2487: Invalid left-hand side in 'for...of' statement. ~~~~ !!! error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. for (stuff[n] in []) {} - ~~~~~~~~ -!!! error TS2406: Invalid left-hand side in 'for...in' statement. for (stuff[n] of []) {} - ~~~~~~~~ -!!! error TS2487: Invalid left-hand side in 'for...of' statement. for ((stuff.x) in []) {} ~~~~~~~~~ !!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. for ((stuff.x) of []) {} - ~~~~~~~~~ -!!! error TS2487: Invalid left-hand side in 'for...of' statement. for ((stuff['x']) in []) {} ~~~~~~~~~~~~ !!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. for ((stuff['x']) of []) {} - ~~~~~~~~~~~~ -!!! error TS2487: Invalid left-hand side in 'for...of' statement. for ((stuff.blah) in []) {} - ~~~~~~~~~~~~ -!!! error TS2406: Invalid left-hand side in 'for...in' statement. ~~~~ !!! error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. for ((stuff.blah) of []) {} - ~~~~~~~~~~~~ -!!! error TS2487: Invalid left-hand side in 'for...of' statement. ~~~~ !!! error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. for ((stuff[n]) in []) {} - ~~~~~~~~~~ -!!! error TS2406: Invalid left-hand side in 'for...in' statement. for ((stuff[n]) of []) {} - ~~~~~~~~~~ -!!! error TS2487: Invalid left-hand side in 'for...of' statement. \ No newline at end of file diff --git a/tests/baselines/reference/externalModuleImmutableBindings.js b/tests/baselines/reference/externalModuleImmutableBindings.js index 546b593fa77..5e5ba6c2294 100644 --- a/tests/baselines/reference/externalModuleImmutableBindings.js +++ b/tests/baselines/reference/externalModuleImmutableBindings.js @@ -4,6 +4,8 @@ export var x = 1; //// [f2.ts] + +// all mutations below are illegal and should be fixed import * as stuff from 'f1'; var n = 'baz'; @@ -52,6 +54,7 @@ for ((stuff[n]) of []) {} //// [f1.js] exports.x = 1; //// [f2.js] +// all mutations below are illegal and should be fixed var stuff = require('f1'); var n = 'baz'; stuff.x = 0; @@ -70,43 +73,35 @@ stuff[n]++; (stuff['x'])++; (stuff['blah'])++; (stuff[n])++; -for (stuff.x in []) { -} +for (stuff.x in []) { } for (var _i = 0, _a = []; _i < _a.length; _i++) { stuff.x = _a[_i]; } -for (stuff['x'] in []) { -} +for (stuff['x'] in []) { } for (var _b = 0, _c = []; _b < _c.length; _b++) { stuff['x'] = _c[_b]; } -for (stuff.blah in []) { -} +for (stuff.blah in []) { } for (var _d = 0, _e = []; _d < _e.length; _d++) { stuff.blah = _e[_d]; } -for (stuff[n] in []) { -} +for (stuff[n] in []) { } for (var _f = 0, _g = []; _f < _g.length; _f++) { stuff[n] = _g[_f]; } -for ((stuff.x) in []) { -} +for ((stuff.x) in []) { } for (var _h = 0, _j = []; _h < _j.length; _h++) { (stuff.x) = _j[_h]; } -for ((stuff['x']) in []) { -} +for ((stuff['x']) in []) { } for (var _k = 0, _l = []; _k < _l.length; _k++) { (stuff['x']) = _l[_k]; } -for ((stuff.blah) in []) { -} +for ((stuff.blah) in []) { } for (var _m = 0, _o = []; _m < _o.length; _m++) { (stuff.blah) = _o[_m]; } -for ((stuff[n]) in []) { -} +for ((stuff[n]) in []) { } for (var _p = 0, _q = []; _p < _q.length; _p++) { (stuff[n]) = _q[_p]; } diff --git a/tests/baselines/reference/externalModuleReferenceOfImportDeclarationWithExportModifier.js b/tests/baselines/reference/externalModuleReferenceOfImportDeclarationWithExportModifier.js index 73ef9b6b296..f9c83c83cf0 100644 --- a/tests/baselines/reference/externalModuleReferenceOfImportDeclarationWithExportModifier.js +++ b/tests/baselines/reference/externalModuleReferenceOfImportDeclarationWithExportModifier.js @@ -10,8 +10,7 @@ file1.foo(); //// [externalModuleReferenceOfImportDeclarationWithExportModifier_0.js] define(["require", "exports"], function (require, exports) { - function foo() { - } + function foo() { } exports.foo = foo; ; }); diff --git a/tests/baselines/reference/externalModuleRefernceResolutionOrderInImportDeclaration.js b/tests/baselines/reference/externalModuleRefernceResolutionOrderInImportDeclaration.js index edbdf6b90a5..f1d1d9fb561 100644 --- a/tests/baselines/reference/externalModuleRefernceResolutionOrderInImportDeclaration.js +++ b/tests/baselines/reference/externalModuleRefernceResolutionOrderInImportDeclaration.js @@ -19,8 +19,7 @@ file1.bar(); //// [externalModuleRefernceResolutionOrderInImportDeclaration_file2.js] //// [externalModuleRefernceResolutionOrderInImportDeclaration_file1.js] -function foo() { -} +function foo() { } exports.foo = foo; ; //// [externalModuleRefernceResolutionOrderInImportDeclaration_file3.js] diff --git a/tests/baselines/reference/fatArrowfunctionAsType.js b/tests/baselines/reference/fatArrowfunctionAsType.js index bd2dc4310d9..894267580c6 100644 --- a/tests/baselines/reference/fatArrowfunctionAsType.js +++ b/tests/baselines/reference/fatArrowfunctionAsType.js @@ -7,7 +7,5 @@ b = c; //// [fatArrowfunctionAsType.js] -var c = function (x) { - return 42; -}; +var c = function (x) { return 42; }; b = c; diff --git a/tests/baselines/reference/fatarrowfunctions.js b/tests/baselines/reference/fatarrowfunctions.js index 1c74f39bed5..eb57d1a9817 100644 --- a/tests/baselines/reference/fatarrowfunctions.js +++ b/tests/baselines/reference/fatarrowfunctions.js @@ -49,70 +49,30 @@ var messenger = { function foo(x) { return x(); } -foo(function (x, y, z) { - return x + y + z; -}); -foo(function (x, y, z) { - return x + y + z; -}); -foo(function (x, y, z) { - return x + y + z; -}); -foo(function (x, y, z) { - return x + y + z; -}); -foo(function (x, y, z) { - return x + y + z; -}); -foo(function () { - return 0; -}); -foo(function (x, y, z) { - return x + y + z; -}); -foo(function (x, y, z) { - return x + y + z; -}); -foo(function (x, y, z) { - return x + y + z; -}); -foo(function (x, y, z) { - return x + y + z; -}); -foo(function (x, y, z) { - return x + y + z; -}); -foo(function () { - return 0; -}); -foo((function (x) { - return x; -})); -foo(function (x) { - return x * x; -}); -var y = function (x) { - return x * x; -}; -var z = function (x) { - return x * x; -}; -var w = function () { - return 3; -}; +foo(function (x, y, z) { return x + y + z; }); +foo(function (x, y, z) { return x + y + z; }); +foo(function (x, y, z) { return x + y + z; }); +foo(function (x, y, z) { return x + y + z; }); +foo(function (x, y, z) { return x + y + z; }); +foo(function () { return 0; }); +foo(function (x, y, z) { return x + y + z; }); +foo(function (x, y, z) { return x + y + z; }); +foo(function (x, y, z) { return x + y + z; }); +foo(function (x, y, z) { return x + y + z; }); +foo(function (x, y, z) { return x + y + z; }); +foo(function () { return 0; }); +foo((function (x) { return x; })); +foo(function (x) { return x * x; }); +var y = function (x) { return x * x; }; +var z = function (x) { return x * x; }; +var w = function () { return 3; }; function ternaryTest(isWhile) { - var f = isWhile ? function (n) { - return n > 0; - } : function (n) { - return n === 0; - }; + var f = isWhile ? function (n) { return n > 0; } : function (n) { return n === 0; }; } var messenger = { message: "Hello World", start: function () { var _this = this; - setTimeout(function () { - _this.message.toString(); - }, 3000); + setTimeout(function () { _this.message.toString(); }, 3000); } }; diff --git a/tests/baselines/reference/fatarrowfunctionsErrors.js b/tests/baselines/reference/fatarrowfunctionsErrors.js index 56fd91f3d1c..2ac20f1966a 100644 --- a/tests/baselines/reference/fatarrowfunctionsErrors.js +++ b/tests/baselines/reference/fatarrowfunctionsErrors.js @@ -20,28 +20,19 @@ foo(function () { } return 0; }); -foo((1), { - return: 0 -}); -foo(function (x) { - return x; -}); +foo((1), { return: 0 }); +foo(function (x) { return x; }); foo(function (x) { if (x === void 0) { x = 0; } return x; }); var y = x, number; x * x; -false ? (function () { - return null; -}) : null; +false ? (function () { return null; }) : null; // missing fatarrow -var x1 = function () { -}; -var x2 = function (a) { -}; -var x3 = function (a) { -}; +var x1 = function () { }; +var x2 = function (a) { }; +var x3 = function (a) { }; var x4 = function () { var a = []; for (var _i = 0; _i < arguments.length; _i++) { diff --git a/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.js b/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.js index e5c8134a4bb..d73eec12bcd 100644 --- a/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.js +++ b/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.js @@ -12,9 +12,7 @@ fn.call(4); // Should be 4 //// [fatarrowfunctionsInFunctionParameterDefaults.js] function fn(x, y) { var _this = this; - if (x === void 0) { x = function () { - return _this; - }; } + if (x === void 0) { x = function () { return _this; }; } if (y === void 0) { y = x(); } // should be 4 return y; diff --git a/tests/baselines/reference/fatarrowfunctionsOptionalArgs.js b/tests/baselines/reference/fatarrowfunctionsOptionalArgs.js index bdd80477162..e6e43f8bbf4 100644 --- a/tests/baselines/reference/fatarrowfunctionsOptionalArgs.js +++ b/tests/baselines/reference/fatarrowfunctionsOptionalArgs.js @@ -134,39 +134,27 @@ foo( //// [fatarrowfunctionsOptionalArgs.js] // valid // no params -(function () { - return 1; -}); +(function () { return 1; }); // one param, no type -(function (arg) { - return 2; -}); +(function (arg) { return 2; }); // one param, no type -(function (arg) { - return 2; -}); +(function (arg) { return 2; }); // one param, no type with default value (function (arg) { if (arg === void 0) { arg = 1; } return 3; }); // one param, no type, optional -(function (arg) { - return 4; -}); +(function (arg) { return 4; }); // typed param -(function (arg) { - return 5; -}); +(function (arg) { return 5; }); // typed param with default value (function (arg) { if (arg === void 0) { arg = 0; } return 6; }); // optional param -(function (arg) { - return 7; -}); +(function (arg) { return 7; }); // var arg param (function () { var arg = []; @@ -176,28 +164,20 @@ foo( return 8; }); // multiple arguments -(function (arg1, arg2) { - return 12; -}); +(function (arg1, arg2) { return 12; }); (function (arg1, arg2) { if (arg1 === void 0) { arg1 = 1; } if (arg2 === void 0) { arg2 = 3; } return 13; }); -(function (arg1, arg2) { - return 14; -}); -(function (arg1, arg2) { - return 15; -}); +(function (arg1, arg2) { return 14; }); +(function (arg1, arg2) { return 15; }); (function (arg1, arg2) { if (arg1 === void 0) { arg1 = 0; } if (arg2 === void 0) { arg2 = 1; } return 16; }); -(function (arg1, arg2) { - return 17; -}); +(function (arg1, arg2) { return 17; }); (function (arg1) { var arg2 = []; for (var _i = 1; _i < arguments.length; _i++) { @@ -205,33 +185,21 @@ foo( } return 18; }); -(function (arg1, arg2) { - return 19; -}); +(function (arg1, arg2) { return 19; }); // in paren -(function () { - return 21; -}); -(function (arg) { - return 22; -}); +(function () { return 21; }); +(function (arg) { return 22; }); (function (arg) { if (arg === void 0) { arg = 1; } return 23; }); -(function (arg) { - return 24; -}); -(function (arg) { - return 25; -}); +(function (arg) { return 24; }); +(function (arg) { return 25; }); (function (arg) { if (arg === void 0) { arg = 0; } return 26; }); -(function (arg) { - return 27; -}); +(function (arg) { return 27; }); (function () { var arg = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -240,29 +208,17 @@ foo( return 28; }); // in multiple paren -((((function (arg) { - return 32; -})))); +((((function (arg) { return 32; })))); // in ternary exression -false ? function () { - return 41; -} : null; -false ? function (arg) { - return 42; -} : null; +false ? function () { return 41; } : null; +false ? function (arg) { return 42; } : null; false ? function (arg) { if (arg === void 0) { arg = 1; } return 43; } : null; -false ? function (arg) { - return 44; -} : null; -false ? function (arg) { - return 45; -} : null; -false ? function (arg) { - return 46; -} : null; +false ? function (arg) { return 44; } : null; +false ? function (arg) { return 45; } : null; +false ? function (arg) { return 46; } : null; false ? function (arg) { if (arg === void 0) { arg = 0; } return 47; @@ -275,25 +231,15 @@ false ? function () { return 48; } : null; // in ternary exression within paren -false ? (function () { - return 51; -}) : null; -false ? (function (arg) { - return 52; -}) : null; +false ? (function () { return 51; }) : null; +false ? (function (arg) { return 52; }) : null; false ? (function (arg) { if (arg === void 0) { arg = 1; } return 53; }) : null; -false ? (function (arg) { - return 54; -}) : null; -false ? (function (arg) { - return 55; -}) : null; -false ? (function (arg) { - return 56; -}) : null; +false ? (function (arg) { return 54; }) : null; +false ? (function (arg) { return 55; }) : null; +false ? (function (arg) { return 56; }) : null; false ? (function (arg) { if (arg === void 0) { arg = 0; } return 57; @@ -306,25 +252,15 @@ false ? (function () { return 58; }) : null; // ternary exression's else clause -false ? null : function () { - return 61; -}; -false ? null : function (arg) { - return 62; -}; +false ? null : function () { return 61; }; +false ? null : function (arg) { return 62; }; false ? null : function (arg) { if (arg === void 0) { arg = 1; } return 63; }; -false ? null : function (arg) { - return 64; -}; -false ? null : function (arg) { - return 65; -}; -false ? null : function (arg) { - return 66; -}; +false ? null : function (arg) { return 64; }; +false ? null : function (arg) { return 65; }; +false ? null : function (arg) { return 66; }; false ? null : function (arg) { if (arg === void 0) { arg = 0; } return 67; @@ -337,48 +273,24 @@ false ? null : function () { return 68; }; // nested ternary expressions -(function (a) { - return a; -}) ? function (b) { - return b; -} : function (c) { - return c; -}; +(function (a) { return a; }) ? function (b) { return b; } : function (c) { return c; }; //multiple levels -(function (a) { - return a; -}); -(function (b) { - return function (c) { - return 81; - }; -}); -(function (c) { - return function (d) { - return 82; - }; -}); +(function (a) { return a; }); +(function (b) { return function (c) { return 81; }; }); +(function (c) { return function (d) { return 82; }; }); // In Expressions -(function (arg) { - return 90; -}) instanceof Function; +(function (arg) { return 90; }) instanceof Function; (function (arg) { if (arg === void 0) { arg = 1; } return 91; }) instanceof Function; -(function (arg) { - return 92; -}) instanceof Function; -(function (arg) { - return 93; -}) instanceof Function; +(function (arg) { return 92; }) instanceof Function; +(function (arg) { return 93; }) instanceof Function; (function (arg) { if (arg === void 0) { arg = 1; } return 94; }) instanceof Function; -(function (arg) { - return 95; -}) instanceof Function; +(function (arg) { return 95; }) instanceof Function; (function () { var arg = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -386,14 +298,8 @@ false ? null : function () { } return 96; }) instanceof Function; -'' + (function (arg) { - return 100; -}); -(function (arg) { - return 0; -}) + '' + (function (arg) { - return 101; -}); +'' + (function (arg) { return 100; }); +(function (arg) { return 0; }) + '' + (function (arg) { return 101; }); (function (arg) { if (arg === void 0) { arg = 1; } return 0; @@ -401,16 +307,8 @@ false ? null : function () { if (arg === void 0) { arg = 2; } return 102; }); -(function (arg) { - return 0; -}) + '' + (function (arg) { - return 103; -}); -(function (arg) { - return 0; -}) + '' + (function (arg) { - return 104; -}); +(function (arg) { return 0; }) + '' + (function (arg) { return 103; }); +(function (arg) { return 0; }) + '' + (function (arg) { return 104; }); (function (arg) { if (arg === void 0) { arg = 1; } return 0; @@ -438,11 +336,7 @@ false ? null : function () { } return 107; }); -(function (arg1, arg2) { - return 0; -}) + '' + (function (arg1, arg2) { - return 108; -}); +(function (arg1, arg2) { return 0; }) + '' + (function (arg1, arg2) { return 108; }); (function (arg1) { var arg2 = []; for (var _i = 1; _i < arguments.length; _i++) { @@ -463,19 +357,9 @@ function foo() { arg[_i - 0] = arguments[_i]; } } -foo(function (a) { - return 110; -}, (function (a) { - return 111; -}), function (a) { +foo(function (a) { return 110; }, (function (a) { return 111; }), function (a) { return 112; -}, function (a) { - return 113; -}, function (a, b) { - return 114; -}, function (a) { - return 115; -}, function (a) { +}, function (a) { return 113; }, function (a, b) { return 114; }, function (a) { return 115; }, function (a) { if (a === void 0) { a = 0; } return 116; }, function (a) { @@ -497,14 +381,4 @@ foo(function (a) { c[_i - 2] = arguments[_i]; } return 120; -}, function (a) { - return function (b) { - return function (c) { - return 121; - }; - }; -}, false ? function (a) { - return 0; -} : function (b) { - return 122; -}); +}, function (a) { return function (b) { return function (c) { return 121; }; }; }, false ? function (a) { return 0; } : function (b) { return 122; }); diff --git a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors1.js b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors1.js index 0ee54452a9b..428a085ca56 100644 --- a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors1.js +++ b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors1.js @@ -8,9 +8,7 @@ (arg1 = 1, arg2) => 1; //// [fatarrowfunctionsOptionalArgsErrors1.js] -(function (arg1, arg2) { - return 101; -}); +(function (arg1, arg2) { return 101; }); (function () { var arg = []; for (var _i = 0; _i < arguments.length; _i++) { diff --git a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors4.js b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors4.js index e6628081064..dfd7e9f74dc 100644 --- a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors4.js +++ b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors4.js @@ -42,19 +42,9 @@ false ? null : function (arg) { if (arg === void 0) { arg = 2; } return 106; }); -foo(function (a) { - return 110; -}, (function (a) { - return 111; -}), function (a) { +foo(function (a) { return 110; }, (function (a) { return 111; }), function (a) { return 112; -}, function (a) { - return 113; -}, function (a, b) { - return 114; -}, function (a) { - return 115; -}, function (a) { +}, function (a) { return 113; }, function (a, b) { return 114; }, function (a) { return 115; }, function (a) { if (a === void 0) { a = 0; } return 116; }, function (a) { @@ -76,14 +66,4 @@ foo(function (a) { c[_i - 2] = arguments[_i]; } return 120; -}, function (a) { - return function (b) { - return function (c) { - return 121; - }; - }; -}, false ? function (a) { - return 0; -} : function (b) { - return 122; -}); +}, function (a) { return function (b) { return function (c) { return 121; }; }; }, false ? function (a) { return 0; } : function (b) { return 122; }); diff --git a/tests/baselines/reference/fieldAndGetterWithSameName.js b/tests/baselines/reference/fieldAndGetterWithSameName.js index 64129ff9365..ddd95b9e8f2 100644 --- a/tests/baselines/reference/fieldAndGetterWithSameName.js +++ b/tests/baselines/reference/fieldAndGetterWithSameName.js @@ -10,9 +10,7 @@ define(["require", "exports"], function (require, exports) { function C() { } Object.defineProperty(C.prototype, "x", { - get: function () { - return 1; - }, + get: function () { return 1; }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.js b/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.js index d8521e56a14..dea003057c4 100644 --- a/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.js +++ b/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.js @@ -3,6 +3,5 @@ function bar(item1: T, item2: T) { } bar(1, ""); // Should be ok //// [fixTypeParameterInSignatureWithRestParameters.js] -function bar(item1, item2) { -} +function bar(item1, item2) { } bar(1, ""); // Should be ok diff --git a/tests/baselines/reference/for-inStatements.js b/tests/baselines/reference/for-inStatements.js index 3787887923c..3db07d878bf 100644 --- a/tests/baselines/reference/for-inStatements.js +++ b/tests/baselines/reference/for-inStatements.js @@ -88,71 +88,38 @@ var __extends = this.__extends || function (d, b) { d.prototype = new __(); }; var aString; -for (aString in {}) { -} +for (aString in {}) { } var anAny; -for (anAny in {}) { -} -for (var x in {}) { -} -for (var x in []) { -} -for (var x in [ - 1, - 2, - 3, - 4, - 5 -]) { -} -function fn() { -} -for (var x in fn()) { -} -for (var x in /[a-z]/) { -} -for (var x in new Date()) { -} +for (anAny in {}) { } +for (var x in {}) { } +for (var x in []) { } +for (var x in [1, 2, 3, 4, 5]) { } +function fn() { } +for (var x in fn()) { } +for (var x in /[a-z]/) { } +for (var x in new Date()) { } var c, d, e; -for (var x in c || d) { -} -for (var x in e ? c : d) { -} -for (var x in 42 ? c : d) { -} -for (var x in '' ? c : d) { -} -for (var x in 42 ? d[x] : c[x]) { -} -for (var x in c[d]) { -} -for (var x in (function (x) { - return x; -})) { -} -for (var x in function (x, y) { - return x + y; -}) { -} +for (var x in c || d) { } +for (var x in e ? c : d) { } +for (var x in 42 ? c : d) { } +for (var x in '' ? c : d) { } +for (var x in 42 ? d[x] : c[x]) { } +for (var x in c[d]) { } +for (var x in (function (x) { return x; })) { } +for (var x in function (x, y) { return x + y; }) { } var A = (function () { function A() { } A.prototype.biz = function () { - for (var x in this.biz()) { - } - for (var x in this.biz) { - } - for (var x in this) { - } + for (var x in this.biz()) { } + for (var x in this.biz) { } + for (var x in this) { } return null; }; A.baz = function () { - for (var x in this) { - } - for (var x in this.baz) { - } - for (var x in this.baz()) { - } + for (var x in this) { } + for (var x in this.baz) { } + for (var x in this.baz()) { } return null; }; return A; @@ -163,23 +130,17 @@ var B = (function (_super) { _super.apply(this, arguments); } B.prototype.boz = function () { - for (var x in this.biz()) { - } - for (var x in this.biz) { - } - for (var x in this) { - } - for (var x in _super.prototype.biz) { - } - for (var x in _super.prototype.biz.call(this)) { - } + for (var x in this.biz()) { } + for (var x in this.biz) { } + for (var x in this) { } + for (var x in _super.prototype.biz) { } + for (var x in _super.prototype.biz.call(this)) { } return null; }; return B; })(A); var i; -for (var x in i[42]) { -} +for (var x in i[42]) { } var M; (function (M) { var X = (function () { @@ -189,16 +150,12 @@ var M; })(); M.X = X; })(M || (M = {})); -for (var x in M) { -} -for (var x in M.X) { -} +for (var x in M) { } +for (var x in M.X) { } var Color; (function (Color) { Color[Color["Red"] = 0] = "Red"; Color[Color["Blue"] = 1] = "Blue"; })(Color || (Color = {})); -for (var x in Color) { -} -for (var x in Color.Blue) { -} +for (var x in Color) { } +for (var x in Color.Blue) { } diff --git a/tests/baselines/reference/for-inStatementsDestructuring.js b/tests/baselines/reference/for-inStatementsDestructuring.js index 25a696f9fc5..e5e00d5b3ab 100644 --- a/tests/baselines/reference/for-inStatementsDestructuring.js +++ b/tests/baselines/reference/for-inStatementsDestructuring.js @@ -2,5 +2,4 @@ for (var [a, b] in []) {} //// [for-inStatementsDestructuring.js] -for (var _a = void 0, a = _a[0], b = _a[1] in []) { -} +for (var _a = void 0, a = _a[0], b = _a[1] in []) { } diff --git a/tests/baselines/reference/for-inStatementsDestructuring2.js b/tests/baselines/reference/for-inStatementsDestructuring2.js index 7051a5a058a..41a6d30919f 100644 --- a/tests/baselines/reference/for-inStatementsDestructuring2.js +++ b/tests/baselines/reference/for-inStatementsDestructuring2.js @@ -2,5 +2,4 @@ for (var {a, b} in []) {} //// [for-inStatementsDestructuring2.js] -for (var _a = void 0, a = _a.a, b = _a.b in []) { -} +for (var _a = void 0, a = _a.a, b = _a.b in []) { } diff --git a/tests/baselines/reference/for-inStatementsDestructuring3.js b/tests/baselines/reference/for-inStatementsDestructuring3.js index 2784e48708b..0970740acab 100644 --- a/tests/baselines/reference/for-inStatementsDestructuring3.js +++ b/tests/baselines/reference/for-inStatementsDestructuring3.js @@ -4,8 +4,4 @@ for ([a, b] in []) { } //// [for-inStatementsDestructuring3.js] var a, b; -for ([ - a, - b -] in []) { -} +for ([a, b] in []) { } diff --git a/tests/baselines/reference/for-inStatementsDestructuring4.js b/tests/baselines/reference/for-inStatementsDestructuring4.js index 6eb56960240..0cce61ac96d 100644 --- a/tests/baselines/reference/for-inStatementsDestructuring4.js +++ b/tests/baselines/reference/for-inStatementsDestructuring4.js @@ -4,8 +4,4 @@ for ({a, b} in []) { } //// [for-inStatementsDestructuring4.js] var a, b; -for ({ - a: a, - b: b -} in []) { -} +for ({ a: a, b: b } in []) { } diff --git a/tests/baselines/reference/for-inStatementsInvalid.js b/tests/baselines/reference/for-inStatementsInvalid.js index a485c8ba7ce..6d42a550a01 100644 --- a/tests/baselines/reference/for-inStatementsInvalid.js +++ b/tests/baselines/reference/for-inStatementsInvalid.js @@ -71,60 +71,36 @@ var __extends = this.__extends || function (d, b) { d.prototype = new __(); }; var aNumber; -for (aNumber in {}) { -} +for (aNumber in {}) { } var aBoolean; -for (aBoolean in {}) { -} +for (aBoolean in {}) { } var aRegExp; -for (aRegExp in {}) { -} -for (var idx in {}) { -} -function fn() { -} -for (var x in fn()) { -} +for (aRegExp in {}) { } +for (var idx in {}) { } +function fn() { } +for (var x in fn()) { } var c, d, e; -for (var x in c || d) { -} -for (var x in e ? c : d) { -} -for (var x in 42 ? c : d) { -} -for (var x in '' ? c : d) { -} -for (var x in 42 ? d[x] : c[x]) { -} -for (var x in c[23]) { -} -for (var x in (function (x) { - return x; -})) { -} -for (var x in function (x, y) { - return x + y; -}) { -} +for (var x in c || d) { } +for (var x in e ? c : d) { } +for (var x in 42 ? c : d) { } +for (var x in '' ? c : d) { } +for (var x in 42 ? d[x] : c[x]) { } +for (var x in c[23]) { } +for (var x in (function (x) { return x; })) { } +for (var x in function (x, y) { return x + y; }) { } var A = (function () { function A() { } A.prototype.biz = function () { - for (var x in this.biz()) { - } - for (var x in this.biz) { - } - for (var x in this) { - } + for (var x in this.biz()) { } + for (var x in this.biz) { } + for (var x in this) { } return null; }; A.baz = function () { - for (var x in this) { - } - for (var x in this.baz) { - } - for (var x in this.baz()) { - } + for (var x in this) { } + for (var x in this.baz) { } + for (var x in this.baz()) { } return null; }; return A; @@ -135,20 +111,14 @@ var B = (function (_super) { _super.apply(this, arguments); } B.prototype.boz = function () { - for (var x in this.biz()) { - } - for (var x in this.biz) { - } - for (var x in this) { - } - for (var x in _super.prototype.biz) { - } - for (var x in _super.prototype.biz.call(this)) { - } + for (var x in this.biz()) { } + for (var x in this.biz) { } + for (var x in this) { } + for (var x in _super.prototype.biz) { } + for (var x in _super.prototype.biz.call(this)) { } return null; }; return B; })(A); var i; -for (var x in i[42]) { -} +for (var x in i[42]) { } diff --git a/tests/baselines/reference/for-of1.js b/tests/baselines/reference/for-of1.js index fb74d6ecede..9df6a96d78f 100644 --- a/tests/baselines/reference/for-of1.js +++ b/tests/baselines/reference/for-of1.js @@ -4,5 +4,4 @@ for (v of []) { } //// [for-of1.js] var v; -for (v of []) { -} +for (v of []) { } diff --git a/tests/baselines/reference/for-of10.js b/tests/baselines/reference/for-of10.js index 3b01719417f..7fd05f5479b 100644 --- a/tests/baselines/reference/for-of10.js +++ b/tests/baselines/reference/for-of10.js @@ -4,7 +4,4 @@ for (v of [0]) { } //// [for-of10.js] var v; -for (v of [ - 0 -]) { -} +for (v of [0]) { } diff --git a/tests/baselines/reference/for-of11.js b/tests/baselines/reference/for-of11.js index 58486c477e7..055ed0039dc 100644 --- a/tests/baselines/reference/for-of11.js +++ b/tests/baselines/reference/for-of11.js @@ -4,8 +4,4 @@ for (v of [0, ""]) { } //// [for-of11.js] var v; -for (v of [ - 0, - "" -]) { -} +for (v of [0, ""]) { } diff --git a/tests/baselines/reference/for-of12.js b/tests/baselines/reference/for-of12.js index f489eaa40f9..6185ca8e331 100644 --- a/tests/baselines/reference/for-of12.js +++ b/tests/baselines/reference/for-of12.js @@ -4,8 +4,4 @@ for (v of [0, ""].values()) { } //// [for-of12.js] var v; -for (v of [ - 0, - "" -].values()) { -} +for (v of [0, ""].values()) { } diff --git a/tests/baselines/reference/for-of13.js b/tests/baselines/reference/for-of13.js index 87d908b42b8..e66668f1736 100644 --- a/tests/baselines/reference/for-of13.js +++ b/tests/baselines/reference/for-of13.js @@ -4,7 +4,4 @@ for (v of [""].values()) { } //// [for-of13.js] var v; -for (v of [ - "" -].values()) { -} +for (v of [""].values()) { } diff --git a/tests/baselines/reference/for-of14.js b/tests/baselines/reference/for-of14.js index 958e621c8aa..42832f8e58e 100644 --- a/tests/baselines/reference/for-of14.js +++ b/tests/baselines/reference/for-of14.js @@ -10,8 +10,7 @@ class StringIterator { //// [for-of14.js] var v; -for (v of new StringIterator) { -} // Should fail because the iterator is not iterable +for (v of new StringIterator) { } // Should fail because the iterator is not iterable class StringIterator { next() { return ""; diff --git a/tests/baselines/reference/for-of15.js b/tests/baselines/reference/for-of15.js index 2b4846ec8be..62232745c8c 100644 --- a/tests/baselines/reference/for-of15.js +++ b/tests/baselines/reference/for-of15.js @@ -13,8 +13,7 @@ class StringIterator { //// [for-of15.js] var v; -for (v of new StringIterator) { -} // Should fail +for (v of new StringIterator) { } // Should fail class StringIterator { next() { return ""; diff --git a/tests/baselines/reference/for-of16.js b/tests/baselines/reference/for-of16.js index 1cdf72c26ac..974be239fd7 100644 --- a/tests/baselines/reference/for-of16.js +++ b/tests/baselines/reference/for-of16.js @@ -10,8 +10,7 @@ class StringIterator { //// [for-of16.js] var v; -for (v of new StringIterator) { -} // Should fail +for (v of new StringIterator) { } // Should fail class StringIterator { [Symbol.iterator]() { return this; diff --git a/tests/baselines/reference/for-of17.js b/tests/baselines/reference/for-of17.js index 3fb4fac91d6..a3927647005 100644 --- a/tests/baselines/reference/for-of17.js +++ b/tests/baselines/reference/for-of17.js @@ -16,8 +16,7 @@ class NumberIterator { //// [for-of17.js] var v; -for (v of new NumberIterator) { -} // Should succeed +for (v of new NumberIterator) { } // Should succeed class NumberIterator { next() { return { diff --git a/tests/baselines/reference/for-of18.js b/tests/baselines/reference/for-of18.js index ae3a9e130f0..c31e6b6e8ca 100644 --- a/tests/baselines/reference/for-of18.js +++ b/tests/baselines/reference/for-of18.js @@ -16,8 +16,7 @@ class StringIterator { //// [for-of18.js] var v; -for (v of new StringIterator) { -} // Should succeed +for (v of new StringIterator) { } // Should succeed class StringIterator { next() { return { diff --git a/tests/baselines/reference/for-of2.js b/tests/baselines/reference/for-of2.js index 49d3f76746a..d7eceb7c49e 100644 --- a/tests/baselines/reference/for-of2.js +++ b/tests/baselines/reference/for-of2.js @@ -4,5 +4,4 @@ for (v of []) { } //// [for-of2.js] const v; -for (v of []) { -} +for (v of []) { } diff --git a/tests/baselines/reference/for-of24.js b/tests/baselines/reference/for-of24.js index bb605011ef6..b4918519603 100644 --- a/tests/baselines/reference/for-of24.js +++ b/tests/baselines/reference/for-of24.js @@ -5,5 +5,4 @@ for (var v of x) { } //// [for-of24.js] var x; -for (var v of x) { -} +for (var v of x) { } diff --git a/tests/baselines/reference/for-of25.js b/tests/baselines/reference/for-of25.js index 2c85a4dc2fd..5715f6e8a3a 100644 --- a/tests/baselines/reference/for-of25.js +++ b/tests/baselines/reference/for-of25.js @@ -10,8 +10,7 @@ class StringIterator { //// [for-of25.js] var x; -for (var v of new StringIterator) { -} +for (var v of new StringIterator) { } class StringIterator { [Symbol.iterator]() { return x; diff --git a/tests/baselines/reference/for-of26.js b/tests/baselines/reference/for-of26.js index e048caf1006..33319f50efa 100644 --- a/tests/baselines/reference/for-of26.js +++ b/tests/baselines/reference/for-of26.js @@ -13,8 +13,7 @@ class StringIterator { //// [for-of26.js] var x; -for (var v of new StringIterator) { -} +for (var v of new StringIterator) { } class StringIterator { next() { return x; diff --git a/tests/baselines/reference/for-of27.js b/tests/baselines/reference/for-of27.js index 8b44ca03ef4..1ac3a1dfc42 100644 --- a/tests/baselines/reference/for-of27.js +++ b/tests/baselines/reference/for-of27.js @@ -6,7 +6,6 @@ class StringIterator { } //// [for-of27.js] -for (var v of new StringIterator) { -} +for (var v of new StringIterator) { } class StringIterator { } diff --git a/tests/baselines/reference/for-of28.js b/tests/baselines/reference/for-of28.js index 69c8ccab727..78e86774813 100644 --- a/tests/baselines/reference/for-of28.js +++ b/tests/baselines/reference/for-of28.js @@ -9,8 +9,7 @@ class StringIterator { } //// [for-of28.js] -for (var v of new StringIterator) { -} +for (var v of new StringIterator) { } class StringIterator { [Symbol.iterator]() { return this; diff --git a/tests/baselines/reference/for-of29.js b/tests/baselines/reference/for-of29.js index c369731bee0..450cafbde85 100644 --- a/tests/baselines/reference/for-of29.js +++ b/tests/baselines/reference/for-of29.js @@ -8,5 +8,4 @@ for (var v of iterableWithOptionalIterator) { } //// [for-of29.js] var iterableWithOptionalIterator; -for (var v of iterableWithOptionalIterator) { -} +for (var v of iterableWithOptionalIterator) { } diff --git a/tests/baselines/reference/for-of3.js b/tests/baselines/reference/for-of3.js index f47802dac6b..7ef27187702 100644 --- a/tests/baselines/reference/for-of3.js +++ b/tests/baselines/reference/for-of3.js @@ -4,5 +4,4 @@ for (v++ of []) { } //// [for-of3.js] var v; -for (v++ of []) { -} +for (v++ of []) { } diff --git a/tests/baselines/reference/for-of30.js b/tests/baselines/reference/for-of30.js index 0ed6caaf81e..37316774c95 100644 --- a/tests/baselines/reference/for-of30.js +++ b/tests/baselines/reference/for-of30.js @@ -17,8 +17,7 @@ class StringIterator { } //// [for-of30.js] -for (var v of new StringIterator) { -} +for (var v of new StringIterator) { } class StringIterator { constructor() { this.return = 0; diff --git a/tests/baselines/reference/for-of31.js b/tests/baselines/reference/for-of31.js index d38c1fa017d..a92e827b91e 100644 --- a/tests/baselines/reference/for-of31.js +++ b/tests/baselines/reference/for-of31.js @@ -15,8 +15,7 @@ class StringIterator { } //// [for-of31.js] -for (var v of new StringIterator) { -} +for (var v of new StringIterator) { } class StringIterator { next() { return { diff --git a/tests/baselines/reference/for-of32.js b/tests/baselines/reference/for-of32.js index bce2097e3ca..d25d16fbebe 100644 --- a/tests/baselines/reference/for-of32.js +++ b/tests/baselines/reference/for-of32.js @@ -2,5 +2,4 @@ for (var v of v) { } //// [for-of32.js] -for (var v of v) { -} +for (var v of v) { } diff --git a/tests/baselines/reference/for-of33.js b/tests/baselines/reference/for-of33.js index 66097f777c8..b63aeedf774 100644 --- a/tests/baselines/reference/for-of33.js +++ b/tests/baselines/reference/for-of33.js @@ -8,8 +8,7 @@ class StringIterator { } //// [for-of33.js] -for (var v of new StringIterator) { -} +for (var v of new StringIterator) { } class StringIterator { [Symbol.iterator]() { return v; diff --git a/tests/baselines/reference/for-of34.js b/tests/baselines/reference/for-of34.js index 568a9f73535..f61f04ea955 100644 --- a/tests/baselines/reference/for-of34.js +++ b/tests/baselines/reference/for-of34.js @@ -12,8 +12,7 @@ class StringIterator { } //// [for-of34.js] -for (var v of new StringIterator) { -} +for (var v of new StringIterator) { } class StringIterator { next() { return v; diff --git a/tests/baselines/reference/for-of35.js b/tests/baselines/reference/for-of35.js index a157d5e2e8e..c7d7c5890dd 100644 --- a/tests/baselines/reference/for-of35.js +++ b/tests/baselines/reference/for-of35.js @@ -15,8 +15,7 @@ class StringIterator { } //// [for-of35.js] -for (var v of new StringIterator) { -} +for (var v of new StringIterator) { } class StringIterator { next() { return { diff --git a/tests/baselines/reference/for-of36.js b/tests/baselines/reference/for-of36.js index fb70b1d60cc..14523695151 100644 --- a/tests/baselines/reference/for-of36.js +++ b/tests/baselines/reference/for-of36.js @@ -5,10 +5,7 @@ for (var v of tuple) { } //// [for-of36.js] -var tuple = [ - "", - true -]; +var tuple = ["", true]; for (var v of tuple) { v; } diff --git a/tests/baselines/reference/for-of37.js b/tests/baselines/reference/for-of37.js index cada43a6326..472193e6cb5 100644 --- a/tests/baselines/reference/for-of37.js +++ b/tests/baselines/reference/for-of37.js @@ -5,12 +5,7 @@ for (var v of map) { } //// [for-of37.js] -var map = new Map([ - [ - "", - true - ] -]); +var map = new Map([["", true]]); for (var v of map) { v; } diff --git a/tests/baselines/reference/for-of38.js b/tests/baselines/reference/for-of38.js index 48b697f906e..1f0ac09682e 100644 --- a/tests/baselines/reference/for-of38.js +++ b/tests/baselines/reference/for-of38.js @@ -6,12 +6,7 @@ for (var [k, v] of map) { } //// [for-of38.js] -var map = new Map([ - [ - "", - true - ] -]); +var map = new Map([["", true]]); for (var [k, v] of map) { k; v; diff --git a/tests/baselines/reference/for-of39.js b/tests/baselines/reference/for-of39.js index 3b7d8d9a56a..91dbc56c0ab 100644 --- a/tests/baselines/reference/for-of39.js +++ b/tests/baselines/reference/for-of39.js @@ -6,16 +6,7 @@ for (var [k, v] of map) { } //// [for-of39.js] -var map = new Map([ - [ - "", - true - ], - [ - "", - 0 - ] -]); +var map = new Map([["", true], ["", 0]]); for (var [k, v] of map) { k; v; diff --git a/tests/baselines/reference/for-of4.js b/tests/baselines/reference/for-of4.js index 03cef92c1f5..147619d2fe2 100644 --- a/tests/baselines/reference/for-of4.js +++ b/tests/baselines/reference/for-of4.js @@ -4,8 +4,6 @@ for (var v of [0]) { } //// [for-of4.js] -for (var v of [ - 0 -]) { +for (var v of [0]) { v; } diff --git a/tests/baselines/reference/for-of40.js b/tests/baselines/reference/for-of40.js index 06fc45adfa7..243f81097db 100644 --- a/tests/baselines/reference/for-of40.js +++ b/tests/baselines/reference/for-of40.js @@ -6,12 +6,7 @@ for (var [k = "", v = false] of map) { } //// [for-of40.js] -var map = new Map([ - [ - "", - true - ] -]); +var map = new Map([["", true]]); for (var [k = "", v = false] of map) { k; v; diff --git a/tests/baselines/reference/for-of41.js b/tests/baselines/reference/for-of41.js index f3ae215c5b8..0fa380c53c4 100644 --- a/tests/baselines/reference/for-of41.js +++ b/tests/baselines/reference/for-of41.js @@ -6,16 +6,7 @@ for (var {x: [a], y: {p}} of array) { } //// [for-of41.js] -var array = [ - { - x: [ - 0 - ], - y: { - p: "" - } - } -]; +var array = [{ x: [0], y: { p: "" } }]; for (var { x: [a], y: { p } } of array) { a; p; diff --git a/tests/baselines/reference/for-of42.js b/tests/baselines/reference/for-of42.js index 774ce512e9f..1fa9219df47 100644 --- a/tests/baselines/reference/for-of42.js +++ b/tests/baselines/reference/for-of42.js @@ -6,12 +6,7 @@ for (var {x: a, y: b} of array) { } //// [for-of42.js] -var array = [ - { - x: "", - y: 0 - } -]; +var array = [{ x: "", y: 0 }]; for (var { x: a, y: b } of array) { a; b; diff --git a/tests/baselines/reference/for-of43.js b/tests/baselines/reference/for-of43.js index dc8c9c885d8..de3b4fcd9b0 100644 --- a/tests/baselines/reference/for-of43.js +++ b/tests/baselines/reference/for-of43.js @@ -6,12 +6,7 @@ for (var {x: a = "", y: b = true} of array) { } //// [for-of43.js] -var array = [ - { - x: "", - y: 0 - } -]; +var array = [{ x: "", y: 0 }]; for (var { x: a = "", y: b = true } of array) { a; b; diff --git a/tests/baselines/reference/for-of44.js b/tests/baselines/reference/for-of44.js index 9d4745d1366..087485ed73f 100644 --- a/tests/baselines/reference/for-of44.js +++ b/tests/baselines/reference/for-of44.js @@ -6,20 +6,7 @@ for (var [num, strBoolSym] of array) { } //// [for-of44.js] -var array = [ - [ - 0, - "" - ], - [ - 0, - true - ], - [ - 1, - Symbol() - ] -]; +var array = [[0, ""], [0, true], [1, Symbol()]]; for (var [num, strBoolSym] of array) { num; strBoolSym; diff --git a/tests/baselines/reference/for-of45.js b/tests/baselines/reference/for-of45.js index 3394c50c215..1222b2dcdd5 100644 --- a/tests/baselines/reference/for-of45.js +++ b/tests/baselines/reference/for-of45.js @@ -8,16 +8,8 @@ for ([k = "", v = false] of map) { //// [for-of45.js] var k, v; -var map = new Map([ - [ - "", - true - ] -]); -for ([ - k = "", - v = false -] of map) { +var map = new Map([["", true]]); +for ([k = "", v = false] of map) { k; v; } diff --git a/tests/baselines/reference/for-of46.js b/tests/baselines/reference/for-of46.js index 7146993513c..2ea15936c54 100644 --- a/tests/baselines/reference/for-of46.js +++ b/tests/baselines/reference/for-of46.js @@ -8,16 +8,8 @@ for ([k = false, v = ""] of map) { //// [for-of46.js] var k, v; -var map = new Map([ - [ - "", - true - ] -]); -for ([ - k = false, - v = "" -] of map) { +var map = new Map([["", true]]); +for ([k = false, v = ""] of map) { k; v; } diff --git a/tests/baselines/reference/for-of47.js b/tests/baselines/reference/for-of47.js index f1e9295c367..d7e596d2edc 100644 --- a/tests/baselines/reference/for-of47.js +++ b/tests/baselines/reference/for-of47.js @@ -9,20 +9,12 @@ for ({x, y: y = E.x} of array) { //// [for-of47.js] var x, y; -var array = [ - { - x: "", - y: true - } -]; +var array = [{ x: "", y: true }]; var E; (function (E) { E[E["x"] = 0] = "x"; })(E || (E = {})); -for ({ - x, - y: y = E.x -} of array) { +for ({ x, y: y = E.x } of array) { x; y; } diff --git a/tests/baselines/reference/for-of48.js b/tests/baselines/reference/for-of48.js index 3030f07e605..2a5e4e32b94 100644 --- a/tests/baselines/reference/for-of48.js +++ b/tests/baselines/reference/for-of48.js @@ -9,20 +9,12 @@ for ({x, y = E.x} of array) { //// [for-of48.js] var x, y; -var array = [ - { - x: "", - y: true - } -]; +var array = [{ x: "", y: true }]; var E; (function (E) { E[E["x"] = 0] = "x"; })(E || (E = {})); -for ({ - x, - y: = E.x -} of array) { +for ({ x, y: = E.x } of array) { x; y; } diff --git a/tests/baselines/reference/for-of49.js b/tests/baselines/reference/for-of49.js index ad3bc415d1d..ac7f99f3607 100644 --- a/tests/baselines/reference/for-of49.js +++ b/tests/baselines/reference/for-of49.js @@ -8,18 +8,8 @@ for ([k, ...[v]] of map) { //// [for-of49.js] var k, v; -var map = new Map([ - [ - "", - true - ] -]); -for ([ - k, - ...[ - v - ] -] of map) { +var map = new Map([["", true]]); +for ([k, ...[v]] of map) { k; v; } diff --git a/tests/baselines/reference/for-of5.js b/tests/baselines/reference/for-of5.js index 374e1aa79a0..4d93b0bd483 100644 --- a/tests/baselines/reference/for-of5.js +++ b/tests/baselines/reference/for-of5.js @@ -4,8 +4,6 @@ for (let v of [0]) { } //// [for-of5.js] -for (let v of [ - 0 -]) { +for (let v of [0]) { v; } diff --git a/tests/baselines/reference/for-of50.js b/tests/baselines/reference/for-of50.js index 21e6f1e7325..a300812e6a9 100644 --- a/tests/baselines/reference/for-of50.js +++ b/tests/baselines/reference/for-of50.js @@ -6,12 +6,7 @@ for (const [k, v] of map) { } //// [for-of50.js] -var map = new Map([ - [ - "", - true - ] -]); +var map = new Map([["", true]]); for (const [k, v] of map) { k; v; diff --git a/tests/baselines/reference/for-of51.js b/tests/baselines/reference/for-of51.js index 29b907b0f80..cae8c8b38fe 100644 --- a/tests/baselines/reference/for-of51.js +++ b/tests/baselines/reference/for-of51.js @@ -2,5 +2,4 @@ for (let let of []) {} //// [for-of51.js] -for (let let of []) { -} +for (let let of []) { } diff --git a/tests/baselines/reference/for-of52.js b/tests/baselines/reference/for-of52.js index 066dd4f81ac..48e1dca936c 100644 --- a/tests/baselines/reference/for-of52.js +++ b/tests/baselines/reference/for-of52.js @@ -2,7 +2,4 @@ for (let [v, v] of [[]]) {} //// [for-of52.js] -for (let [v, v] of [ - [] -]) { -} +for (let [v, v] of [[]]) { } diff --git a/tests/baselines/reference/for-of55.js b/tests/baselines/reference/for-of55.js index 30baacc8b13..a0f949c6ce5 100644 --- a/tests/baselines/reference/for-of55.js +++ b/tests/baselines/reference/for-of55.js @@ -5,9 +5,7 @@ for (let v of v) { } //// [for-of55.js] -let v = [ - 1 -]; +let v = [1]; for (let v of v) { v; } diff --git a/tests/baselines/reference/for-of56.js b/tests/baselines/reference/for-of56.js index 5d540151c12..0992b9c0bb9 100644 --- a/tests/baselines/reference/for-of56.js +++ b/tests/baselines/reference/for-of56.js @@ -2,5 +2,4 @@ for (var let of []) {} //// [for-of56.js] -for (var let of []) { -} +for (var let of []) { } diff --git a/tests/baselines/reference/for-of6.js b/tests/baselines/reference/for-of6.js index f176488595a..24e93e2a9fd 100644 --- a/tests/baselines/reference/for-of6.js +++ b/tests/baselines/reference/for-of6.js @@ -4,8 +4,6 @@ for (v of [0]) { } //// [for-of6.js] -for (v of [ - 0 -]) { +for (v of [0]) { let v; } diff --git a/tests/baselines/reference/for-of7.js b/tests/baselines/reference/for-of7.js index 9bc205676d7..04aadd9736a 100644 --- a/tests/baselines/reference/for-of7.js +++ b/tests/baselines/reference/for-of7.js @@ -4,7 +4,4 @@ for (let v of [0]) { } //// [for-of7.js] v; -for (let v of [ - 0 -]) { -} +for (let v of [0]) { } diff --git a/tests/baselines/reference/for-of8.js b/tests/baselines/reference/for-of8.js index d5219780446..f33d69166dc 100644 --- a/tests/baselines/reference/for-of8.js +++ b/tests/baselines/reference/for-of8.js @@ -4,7 +4,4 @@ for (var v of [0]) { } //// [for-of8.js] v; -for (var v of [ - 0 -]) { -} +for (var v of [0]) { } diff --git a/tests/baselines/reference/for-of9.js b/tests/baselines/reference/for-of9.js index b53092414ad..f96d353bd7a 100644 --- a/tests/baselines/reference/for-of9.js +++ b/tests/baselines/reference/for-of9.js @@ -5,9 +5,5 @@ for (v of "hello") { } //// [for-of9.js] var v; -for (v of [ - "hello" -]) { -} -for (v of "hello") { -} +for (v of ["hello"]) { } +for (v of "hello") { } diff --git a/tests/baselines/reference/forBreakStatements.js b/tests/baselines/reference/forBreakStatements.js index 017837cded4..9ed65627c9c 100644 --- a/tests/baselines/reference/forBreakStatements.js +++ b/tests/baselines/reference/forBreakStatements.js @@ -61,7 +61,6 @@ SEVEN: for (;;) for (;;) break SEVEN; EIGHT: for (;;) { - var fn = function () { - }; + var fn = function () { }; break EIGHT; } diff --git a/tests/baselines/reference/forContinueStatements.js b/tests/baselines/reference/forContinueStatements.js index b1ace24f4b1..34f70bb1fc1 100644 --- a/tests/baselines/reference/forContinueStatements.js +++ b/tests/baselines/reference/forContinueStatements.js @@ -61,7 +61,6 @@ SEVEN: for (;;) for (;;) continue SEVEN; EIGHT: for (;;) { - var fn = function () { - }; + var fn = function () { }; continue EIGHT; } diff --git a/tests/baselines/reference/forInBreakStatements.js b/tests/baselines/reference/forInBreakStatements.js index 09f0071d4bf..24b7cc57b8d 100644 --- a/tests/baselines/reference/forInBreakStatements.js +++ b/tests/baselines/reference/forInBreakStatements.js @@ -61,7 +61,6 @@ SEVEN: for (var x in {}) for (var x in {}) break SEVEN; EIGHT: for (var x in {}) { - var fn = function () { - }; + var fn = function () { }; break EIGHT; } diff --git a/tests/baselines/reference/forInContinueStatements.js b/tests/baselines/reference/forInContinueStatements.js index 68cac5221ae..8b036c59721 100644 --- a/tests/baselines/reference/forInContinueStatements.js +++ b/tests/baselines/reference/forInContinueStatements.js @@ -61,7 +61,6 @@ SEVEN: for (var x in {}) for (var x in {}) continue SEVEN; EIGHT: for (var x in {}) { - var fn = function () { - }; + var fn = function () { }; continue EIGHT; } diff --git a/tests/baselines/reference/forStatements.js b/tests/baselines/reference/forStatements.js index 12f1c691cc5..39fdb6c8871 100644 --- a/tests/baselines/reference/forStatements.js +++ b/tests/baselines/reference/forStatements.js @@ -57,9 +57,7 @@ var D = (function () { } return D; })(); -function F(x) { - return 42; -} +function F(x) { return 42; } var M; (function (M) { var A = (function () { @@ -68,50 +66,24 @@ var M; return A; })(); M.A = A; - function F2(x) { - return x.toString(); - } + function F2(x) { return x.toString(); } M.F2 = F2; })(M || (M = {})); -for (var aNumber = 9.9;;) { -} -for (var aString = 'this is a string';;) { -} -for (var aDate = new Date(12);;) { -} -for (var anObject = new Object();;) { -} -for (var anAny = null;;) { -} -for (var aSecondAny = undefined;;) { -} -for (var aVoid = undefined;;) { -} -for (var anInterface = new C();;) { -} -for (var aClass = new C();;) { -} -for (var aGenericClass = new D();;) { -} -for (var anObjectLiteral = { - id: 12 -};;) { -} -for (var anOtherObjectLiteral = new C();;) { -} -for (var aFunction = F;;) { -} -for (var anOtherFunction = F;;) { -} -for (var aLambda = function (x) { - return 2; -};;) { -} -for (var aModule = M;;) { -} -for (var aClassInModule = new M.A();;) { -} -for (var aFunctionInModule = function (x) { - return 'this is a string'; -};;) { -} +for (var aNumber = 9.9;;) { } +for (var aString = 'this is a string';;) { } +for (var aDate = new Date(12);;) { } +for (var anObject = new Object();;) { } +for (var anAny = null;;) { } +for (var aSecondAny = undefined;;) { } +for (var aVoid = undefined;;) { } +for (var anInterface = new C();;) { } +for (var aClass = new C();;) { } +for (var aGenericClass = new D();;) { } +for (var anObjectLiteral = { id: 12 };;) { } +for (var anOtherObjectLiteral = new C();;) { } +for (var aFunction = F;;) { } +for (var anOtherFunction = F;;) { } +for (var aLambda = function (x) { return 2; };;) { } +for (var aModule = M;;) { } +for (var aClassInModule = new M.A();;) { } +for (var aFunctionInModule = function (x) { return 'this is a string'; };;) { } diff --git a/tests/baselines/reference/forStatementsMultipleInvalidDecl.js b/tests/baselines/reference/forStatementsMultipleInvalidDecl.js index 40888c7ce8b..2282136be3a 100644 --- a/tests/baselines/reference/forStatementsMultipleInvalidDecl.js +++ b/tests/baselines/reference/forStatementsMultipleInvalidDecl.js @@ -77,9 +77,7 @@ var D = (function () { } return D; })(); -function F(x) { - return 42; -} +function F(x) { return 42; } var M; (function (M) { var A = (function () { @@ -88,58 +86,25 @@ var M; return A; })(); M.A = A; - function F2(x) { - return x.toString(); - } + function F2(x) { return x.toString(); } M.F2 = F2; })(M || (M = {})); // all of these are errors -for (var a;;) { -} -for (var a = 1;;) { -} -for (var a = 'a string';;) { -} -for (var a = new C();;) { -} -for (var a = new D();;) { -} -for (var a = M;;) { -} -for (var b;;) { -} -for (var b = new C();;) { -} -for (var b = new C2();;) { -} -for (var f = F;;) { -} -for (var f = function (x) { - return ''; -};;) { -} -for (var arr;;) { -} -for (var arr = [ - 1, - 2, - 3, - 4 -];;) { -} -for (var arr = [ - new C(), - new C2(), - new D() -];;) { -} -for (var arr2 = [ - new D() -];;) { -} -for (var arr2 = new Array();;) { -} -for (var m;;) { -} -for (var m = M.A;;) { -} +for (var a;;) { } +for (var a = 1;;) { } +for (var a = 'a string';;) { } +for (var a = new C();;) { } +for (var a = new D();;) { } +for (var a = M;;) { } +for (var b;;) { } +for (var b = new C();;) { } +for (var b = new C2();;) { } +for (var f = F;;) { } +for (var f = function (x) { return ''; };;) { } +for (var arr;;) { } +for (var arr = [1, 2, 3, 4];;) { } +for (var arr = [new C(), new C2(), new D()];;) { } +for (var arr2 = [new D()];;) { } +for (var arr2 = new Array();;) { } +for (var m;;) { } +for (var m = M.A;;) { } diff --git a/tests/baselines/reference/forStatementsMultipleValidDecl.js b/tests/baselines/reference/forStatementsMultipleValidDecl.js index aaf88edfe8b..e95e37d63ac 100644 --- a/tests/baselines/reference/forStatementsMultipleValidDecl.js +++ b/tests/baselines/reference/forStatementsMultipleValidDecl.js @@ -35,74 +35,29 @@ for (var a: typeof a; ;) { } //// [forStatementsMultipleValidDecl.js] // all expected to be valid -for (var x;;) { -} -for (var x = 2;;) { -} -for (var x = undefined;;) { -} +for (var x;;) { } +for (var x = 2;;) { } +for (var x = undefined;;) { } // new declaration space, making redeclaring x as a string valid function declSpace() { - for (var x = 'this is a string';;) { - } -} -for (var p;;) { -} -for (var p = { - x: 1, - y: 2 -};;) { -} -for (var p = { - x: 0, - y: undefined -};;) { -} -for (var p = { - x: 1, - y: undefined -};;) { -} -for (var p = { - x: 1, - y: 2 -};;) { -} -for (var p = { - x: 0, - y: undefined -};;) { -} -for (var p;;) { -} -for (var fn = function (s) { - return 42; -};;) { -} -for (var fn = function (s) { - return 3; -};;) { -} -for (var fn;;) { -} -for (var fn;;) { -} -for (var fn = null;;) { -} -for (var fn;;) { -} -for (var a;;) { -} -for (var a = [ - 'a', - 'b' -];;) { -} -for (var a = [];;) { -} -for (var a = [];;) { -} -for (var a = new Array();;) { -} -for (var a;;) { + for (var x = 'this is a string';;) { } } +for (var p;;) { } +for (var p = { x: 1, y: 2 };;) { } +for (var p = { x: 0, y: undefined };;) { } +for (var p = { x: 1, y: undefined };;) { } +for (var p = { x: 1, y: 2 };;) { } +for (var p = { x: 0, y: undefined };;) { } +for (var p;;) { } +for (var fn = function (s) { return 42; };;) { } +for (var fn = function (s) { return 3; };;) { } +for (var fn;;) { } +for (var fn;;) { } +for (var fn = null;;) { } +for (var fn;;) { } +for (var a;;) { } +for (var a = ['a', 'b'];;) { } +for (var a = [];;) { } +for (var a = [];;) { } +for (var a = new Array();;) { } +for (var a;;) { } diff --git a/tests/baselines/reference/funClodule.js b/tests/baselines/reference/funClodule.js index 8629ed63055..cc7dba7e476 100644 --- a/tests/baselines/reference/funClodule.js +++ b/tests/baselines/reference/funClodule.js @@ -20,12 +20,10 @@ module foo3 { class foo3 { } // Should error //// [funClodule.js] -function foo3() { -} +function foo3() { } var foo3; (function (foo3) { - function x() { - } + function x() { } foo3.x = x; })(foo3 || (foo3 = {})); var foo3 = (function () { diff --git a/tests/baselines/reference/funcdecl.js b/tests/baselines/reference/funcdecl.js index de080873b9f..348d25bd670 100644 --- a/tests/baselines/reference/funcdecl.js +++ b/tests/baselines/reference/funcdecl.js @@ -115,8 +115,7 @@ function overload1(ns) { return ns.toString(); } var withOverloadSignature = overload1; -function f(n) { -} +function f(n) { } var m2; (function (m2) { function foo(n) { diff --git a/tests/baselines/reference/functionAndInterfaceWithSeparateErrors.js b/tests/baselines/reference/functionAndInterfaceWithSeparateErrors.js index 004e65d92af..d59cff501ed 100644 --- a/tests/baselines/reference/functionAndInterfaceWithSeparateErrors.js +++ b/tests/baselines/reference/functionAndInterfaceWithSeparateErrors.js @@ -8,5 +8,4 @@ interface Foo { } //// [functionAndInterfaceWithSeparateErrors.js] -function Foo(n) { -} +function Foo(n) { } diff --git a/tests/baselines/reference/functionAndPropertyNameConflict.js b/tests/baselines/reference/functionAndPropertyNameConflict.js index 1368f8241d5..28a2cd54c9e 100644 --- a/tests/baselines/reference/functionAndPropertyNameConflict.js +++ b/tests/baselines/reference/functionAndPropertyNameConflict.js @@ -10,8 +10,7 @@ class C65 { var C65 = (function () { function C65() { } - C65.prototype.aaaaa = function () { - }; + C65.prototype.aaaaa = function () { }; Object.defineProperty(C65.prototype, "aaaaa", { get: function () { return 1; diff --git a/tests/baselines/reference/functionArgShadowing.js b/tests/baselines/reference/functionArgShadowing.js index c74570902ed..451e46536e0 100644 --- a/tests/baselines/reference/functionArgShadowing.js +++ b/tests/baselines/reference/functionArgShadowing.js @@ -18,15 +18,13 @@ class C { var A = (function () { function A() { } - A.prototype.foo = function () { - }; + A.prototype.foo = function () { }; return A; })(); var B = (function () { function B() { } - B.prototype.bar = function () { - }; + B.prototype.bar = function () { }; return B; })(); function foo(x) { diff --git a/tests/baselines/reference/functionAssignment.js b/tests/baselines/reference/functionAssignment.js index 52b66946500..3237f53bf9a 100644 --- a/tests/baselines/reference/functionAssignment.js +++ b/tests/baselines/reference/functionAssignment.js @@ -38,30 +38,19 @@ callb((a) =>{ a.length; }); //// [functionAssignment.js] -function f(n) { -} -f(function () { -}); +function f(n) { } +f(function () { }); var barbaz; var test; test.get(function (param) { - var x = barbaz.get(function () { - }); + var x = barbaz.get(function () { }); }); -function f2(n) { -} +function f2(n) { } f2(function () { var n = ''; n = 4; }); -function f3(a) { -} -f3({ - a: 0, - b: 0 -}); -function callb(a) { -} -callb(function (a) { - a.length; -}); +function f3(a) { } +f3({ a: 0, b: 0 }); +function callb(a) { } +callb(function (a) { a.length; }); diff --git a/tests/baselines/reference/functionAssignmentError.js b/tests/baselines/reference/functionAssignmentError.js index e19547096b8..dd35ccb271a 100644 --- a/tests/baselines/reference/functionAssignmentError.js +++ b/tests/baselines/reference/functionAssignmentError.js @@ -3,9 +3,5 @@ var func = function (){return "ONE";}; func = function (){return "ONE";}; //// [functionAssignmentError.js] -var func = function () { - return "ONE"; -}; -func = function () { - return "ONE"; -}; +var func = function () { return "ONE"; }; +func = function () { return "ONE"; }; diff --git a/tests/baselines/reference/functionCall1.js b/tests/baselines/reference/functionCall1.js index 8025ad5a6f5..cb8c1a46a23 100644 --- a/tests/baselines/reference/functionCall1.js +++ b/tests/baselines/reference/functionCall1.js @@ -3,8 +3,6 @@ function foo():any{return ""}; var x = foo(); //// [functionCall1.js] -function foo() { - return ""; -} +function foo() { return ""; } ; var x = foo(); diff --git a/tests/baselines/reference/functionCall11.js b/tests/baselines/reference/functionCall11.js index 9c36dedba36..019ea213dbc 100644 --- a/tests/baselines/reference/functionCall11.js +++ b/tests/baselines/reference/functionCall11.js @@ -8,8 +8,7 @@ foo('foo', 1, 'bar'); //// [functionCall11.js] -function foo(a, b) { -} +function foo(a, b) { } foo('foo', 1); foo('foo'); foo(); diff --git a/tests/baselines/reference/functionCall12.js b/tests/baselines/reference/functionCall12.js index ca71c25a172..2c3396c209a 100644 --- a/tests/baselines/reference/functionCall12.js +++ b/tests/baselines/reference/functionCall12.js @@ -9,8 +9,7 @@ foo('foo', 1, 3); //// [functionCall12.js] -function foo(a, b, c) { -} +function foo(a, b, c) { } foo('foo', 1); foo('foo'); foo(); diff --git a/tests/baselines/reference/functionCall2.js b/tests/baselines/reference/functionCall2.js index 5b6da378103..5351dc116ff 100644 --- a/tests/baselines/reference/functionCall2.js +++ b/tests/baselines/reference/functionCall2.js @@ -3,8 +3,6 @@ function foo():number{return 1}; var x = foo(); //// [functionCall2.js] -function foo() { - return 1; -} +function foo() { return 1; } ; var x = foo(); diff --git a/tests/baselines/reference/functionCall3.js b/tests/baselines/reference/functionCall3.js index 0e229ccddbf..74540c2ccf6 100644 --- a/tests/baselines/reference/functionCall3.js +++ b/tests/baselines/reference/functionCall3.js @@ -3,9 +3,5 @@ function foo():any[]{return [1];} var x = foo(); //// [functionCall3.js] -function foo() { - return [ - 1 - ]; -} +function foo() { return [1]; } var x = foo(); diff --git a/tests/baselines/reference/functionCall4.js b/tests/baselines/reference/functionCall4.js index 05021c33563..0f937337d49 100644 --- a/tests/baselines/reference/functionCall4.js +++ b/tests/baselines/reference/functionCall4.js @@ -4,12 +4,8 @@ function bar():()=>any{return foo}; var x = bar(); //// [functionCall4.js] -function foo() { - return ""; -} +function foo() { return ""; } ; -function bar() { - return foo; -} +function bar() { return foo; } ; var x = bar(); diff --git a/tests/baselines/reference/functionCall5.js b/tests/baselines/reference/functionCall5.js index e6b0e049ef6..dc7db4a9959 100644 --- a/tests/baselines/reference/functionCall5.js +++ b/tests/baselines/reference/functionCall5.js @@ -13,8 +13,6 @@ var m1; })(); m1.c1 = c1; })(m1 || (m1 = {})); -function foo() { - return new m1.c1(); -} +function foo() { return new m1.c1(); } ; var x = foo(); diff --git a/tests/baselines/reference/functionCall6.js b/tests/baselines/reference/functionCall6.js index 21582666b94..01197a5fd8d 100644 --- a/tests/baselines/reference/functionCall6.js +++ b/tests/baselines/reference/functionCall6.js @@ -7,8 +7,7 @@ foo(); //// [functionCall6.js] -function foo(a) { -} +function foo(a) { } ; foo('bar'); foo(2); diff --git a/tests/baselines/reference/functionCall7.js b/tests/baselines/reference/functionCall7.js index b32c21b5892..cb30e5d8b24 100644 --- a/tests/baselines/reference/functionCall7.js +++ b/tests/baselines/reference/functionCall7.js @@ -18,9 +18,7 @@ var m1; })(); m1.c1 = c1; })(m1 || (m1 = {})); -function foo(a) { - a.a = 1; -} +function foo(a) { a.a = 1; } ; var myC = new m1.c1(); foo(myC); diff --git a/tests/baselines/reference/functionCall8.js b/tests/baselines/reference/functionCall8.js index 7eb5a9f60d9..5859fdfb375 100644 --- a/tests/baselines/reference/functionCall8.js +++ b/tests/baselines/reference/functionCall8.js @@ -7,8 +7,7 @@ foo(); //// [functionCall8.js] -function foo(a) { -} +function foo(a) { } foo('foo'); foo('foo', 'bar'); foo(4); diff --git a/tests/baselines/reference/functionCall9.js b/tests/baselines/reference/functionCall9.js index d2d81a3ca04..bc7e112f0c8 100644 --- a/tests/baselines/reference/functionCall9.js +++ b/tests/baselines/reference/functionCall9.js @@ -7,8 +7,7 @@ foo('foo', 1, 'bar'); foo(); //// [functionCall9.js] -function foo(a, b) { -} +function foo(a, b) { } ; foo('foo', 1); foo('foo'); diff --git a/tests/baselines/reference/functionConstraintSatisfaction.js b/tests/baselines/reference/functionConstraintSatisfaction.js index 20c5df00987..b8741456178 100644 --- a/tests/baselines/reference/functionConstraintSatisfaction.js +++ b/tests/baselines/reference/functionConstraintSatisfaction.js @@ -63,9 +63,7 @@ function foo2(x: T, y: U) { //// [functionConstraintSatisfaction.js] // satisfaction of a constraint to Function, no errors expected -function foo(x) { - return x; -} +function foo(x) { return x; } var i; var C = (function () { function C() { @@ -76,18 +74,10 @@ var a; var b; var c; var r = foo(new Function()); -var r1 = foo(function (x) { - return x; -}); -var r2 = foo(function (x) { - return x; -}); -var r3 = foo(function (x) { - return x; -}); -var r4 = foo(function (x) { - return x; -}); +var r1 = foo(function (x) { return x; }); +var r2 = foo(function (x) { return x; }); +var r3 = foo(function (x) { return x; }); +var r4 = foo(function (x) { return x; }); var r5 = foo(i); var r6 = foo(C); var r7 = foo(b); @@ -101,18 +91,10 @@ var C2 = (function () { var a2; var b2; var c2; -var r9 = foo(function (x) { - return x; -}); -var r10 = foo(function (x) { - return x; -}); -var r11 = foo(function (x) { - return x; -}); -var r12 = foo(function (x, y) { - return x; -}); +var r9 = foo(function (x) { return x; }); +var r10 = foo(function (x) { return x; }); +var r11 = foo(function (x) { return x; }); +var r12 = foo(function (x, y) { return x; }); var r13 = foo(i2); var r14 = foo(C2); var r15 = foo(b2); diff --git a/tests/baselines/reference/functionConstraintSatisfaction2.js b/tests/baselines/reference/functionConstraintSatisfaction2.js index 45757759536..9e70a508ccd 100644 --- a/tests/baselines/reference/functionConstraintSatisfaction2.js +++ b/tests/baselines/reference/functionConstraintSatisfaction2.js @@ -42,17 +42,11 @@ function fff(x: T, y: U) { //// [functionConstraintSatisfaction2.js] // satisfaction of a constraint to Function, all of these invocations are errors unless otherwise noted -function foo(x) { - return x; -} +function foo(x) { return x; } foo(1); -foo(function () { -}, 1); -foo(1, function () { -}); -function foo2(x) { - return x; -} +foo(function () { }, 1); +foo(1, function () { }); +function foo2(x) { return x; } var C = (function () { function C() { } @@ -66,17 +60,11 @@ var C2 = (function () { })(); var b2; var r = foo2(new Function()); -var r2 = foo2(function (x) { - return x; -}); +var r2 = foo2(function (x) { return x; }); var r6 = foo2(C); var r7 = foo2(b); -var r8 = foo2(function (x) { - return x; -}); // no error expected -var r11 = foo2(function (x, y) { - return x; -}); +var r8 = foo2(function (x) { return x; }); // no error expected +var r11 = foo2(function (x, y) { return x; }); var r13 = foo2(C2); var r14 = foo2(b2); var f2; diff --git a/tests/baselines/reference/functionConstraintSatisfaction3.js b/tests/baselines/reference/functionConstraintSatisfaction3.js index a33c2c6408d..2c1bfa4d399 100644 --- a/tests/baselines/reference/functionConstraintSatisfaction3.js +++ b/tests/baselines/reference/functionConstraintSatisfaction3.js @@ -43,9 +43,7 @@ var r15 = foo(c2); //// [functionConstraintSatisfaction3.js] // satisfaction of a constraint to Function, no errors expected -function foo(x) { - return x; -} +function foo(x) { return x; } var i; var C = (function () { function C() { @@ -55,18 +53,10 @@ var C = (function () { var a; var b; var c; -var r1 = foo(function (x) { - return x; -}); -var r2 = foo(function (x) { - return x; -}); -var r3 = foo(function (x) { - return x; -}); -var r4 = foo(function (x) { - return x; -}); +var r1 = foo(function (x) { return x; }); +var r2 = foo(function (x) { return x; }); +var r3 = foo(function (x) { return x; }); +var r4 = foo(function (x) { return x; }); var r5 = foo(i); var r8 = foo(c); var i2; @@ -78,11 +68,7 @@ var C2 = (function () { var a2; var b2; var c2; -var r9 = foo(function (x) { - return x; -}); -var r10 = foo(function (x) { - return x; -}); +var r9 = foo(function (x) { return x; }); +var r10 = foo(function (x) { return x; }); var r12 = foo(i2); var r15 = foo(c2); diff --git a/tests/baselines/reference/functionExpressionAndLambdaMatchesFunction.js b/tests/baselines/reference/functionExpressionAndLambdaMatchesFunction.js index 2c882b82857..fe10f96f7bb 100644 --- a/tests/baselines/reference/functionExpressionAndLambdaMatchesFunction.js +++ b/tests/baselines/reference/functionExpressionAndLambdaMatchesFunction.js @@ -14,11 +14,8 @@ var CDoc = (function () { function CDoc() { function doSomething(a) { } - doSomething(function () { - return undefined; - }); - doSomething(function () { - }); + doSomething(function () { return undefined; }); + doSomething(function () { }); } return CDoc; })(); diff --git a/tests/baselines/reference/functionExpressionInWithBlock.js b/tests/baselines/reference/functionExpressionInWithBlock.js index 5e06ad8169a..f2353412d5c 100644 --- a/tests/baselines/reference/functionExpressionInWithBlock.js +++ b/tests/baselines/reference/functionExpressionInWithBlock.js @@ -11,9 +11,7 @@ function x() { function x() { with ({}) { function f() { - (function () { - return this; - }); + (function () { return this; }); } } } diff --git a/tests/baselines/reference/functionExpressionReturningItself.js b/tests/baselines/reference/functionExpressionReturningItself.js index 8553d2da867..9485100164e 100644 --- a/tests/baselines/reference/functionExpressionReturningItself.js +++ b/tests/baselines/reference/functionExpressionReturningItself.js @@ -2,9 +2,7 @@ var x = function somefn() { return somefn; }; //// [functionExpressionReturningItself.js] -var x = function somefn() { - return somefn; -}; +var x = function somefn() { return somefn; }; //// [functionExpressionReturningItself.d.ts] diff --git a/tests/baselines/reference/functionImplementationErrors.js b/tests/baselines/reference/functionImplementationErrors.js index 95b0d9e700b..5eaf9027335 100644 --- a/tests/baselines/reference/functionImplementationErrors.js +++ b/tests/baselines/reference/functionImplementationErrors.js @@ -96,14 +96,10 @@ var f3 = function () { // FunctionExpression with no return type annotation with return branch of number[] and other of string[] var f4 = function () { if (true) { - return [ - '' - ]; + return ['']; } else { - return [ - 1 - ]; + return [1]; } }; // Function implemetnation with non -void return type annotation with no return diff --git a/tests/baselines/reference/functionImplementations.js b/tests/baselines/reference/functionImplementations.js index e3a498dbeb2..c478f892fd5 100644 --- a/tests/baselines/reference/functionImplementations.js +++ b/tests/baselines/reference/functionImplementations.js @@ -164,8 +164,7 @@ var __extends = this.__extends || function (d, b) { d.prototype = new __(); }; // FunctionExpression with no return type annotation and no return statement returns void -var v = function () { -}(); +var v = function () { }(); // FunctionExpression f with no return type annotation and directly references f in its body returns any var a = function f() { return f; @@ -269,10 +268,7 @@ function opt1(n) { } // Function signature with optional parameter, no type annotation and initializer has initializer's widened type function opt2(n) { - if (n === void 0) { n = { - x: null, - y: undefined - }; } + if (n === void 0) { n = { x: null, y: undefined }; } var m = n; var m; } diff --git a/tests/baselines/reference/functionLiteral.js b/tests/baselines/reference/functionLiteral.js index bf42f9e859a..8ee515e8f8c 100644 --- a/tests/baselines/reference/functionLiteral.js +++ b/tests/baselines/reference/functionLiteral.js @@ -15,14 +15,10 @@ var z: new (x: number) => number; //// [functionLiteral.js] // basic valid forms of function literals -var x = function () { - return 1; -}; +var x = function () { return 1; }; var x; var y; var y; -var y2 = function (x) { - return x; -}; +var y2 = function (x) { return x; }; var z; var z; diff --git a/tests/baselines/reference/functionLiteralForOverloads.js b/tests/baselines/reference/functionLiteralForOverloads.js index 06631101e0f..1a0bc874c48 100644 --- a/tests/baselines/reference/functionLiteralForOverloads.js +++ b/tests/baselines/reference/functionLiteralForOverloads.js @@ -23,15 +23,7 @@ var f4: { //// [functionLiteralForOverloads.js] // basic uses of function literals with overloads -var f = function (x) { - return x; -}; -var f2 = function (x) { - return x; -}; -var f3 = function (x) { - return x; -}; -var f4 = function (x) { - return x; -}; +var f = function (x) { return x; }; +var f2 = function (x) { return x; }; +var f3 = function (x) { return x; }; +var f4 = function (x) { return x; }; diff --git a/tests/baselines/reference/functionNameConflicts.js b/tests/baselines/reference/functionNameConflicts.js index 99ede14dfde..87b61e3733d 100644 --- a/tests/baselines/reference/functionNameConflicts.js +++ b/tests/baselines/reference/functionNameConflicts.js @@ -32,22 +32,17 @@ function overrr() { //Function overload with different name from implementation signature var M; (function (M) { - function fn1() { - } + function fn1() { } var fn1; var fn2; - function fn2() { - } + function fn2() { } })(M || (M = {})); -function fn3() { -} +function fn3() { } var fn3; function func() { var fn4; - function fn4() { - } - function fn5() { - } + function fn4() { } + function fn5() { } var fn5; } function overrr() { diff --git a/tests/baselines/reference/functionOverloadAmbiguity1.js b/tests/baselines/reference/functionOverloadAmbiguity1.js index d53ec68c9d9..2833ccbcdc3 100644 --- a/tests/baselines/reference/functionOverloadAmbiguity1.js +++ b/tests/baselines/reference/functionOverloadAmbiguity1.js @@ -11,13 +11,7 @@ callb2((a) => { a.length; } ); // ok, chose first overload //// [functionOverloadAmbiguity1.js] -function callb(a) { -} -callb(function (a) { - a.length; -}); // error, chose first overload -function callb2(a) { -} -callb2(function (a) { - a.length; -}); // ok, chose first overload +function callb(a) { } +callb(function (a) { a.length; }); // error, chose first overload +function callb2(a) { } +callb2(function (a) { a.length; }); // ok, chose first overload diff --git a/tests/baselines/reference/functionOverloadErrors.js b/tests/baselines/reference/functionOverloadErrors.js index 623b0e6f4dc..b0c0f449456 100644 --- a/tests/baselines/reference/functionOverloadErrors.js +++ b/tests/baselines/reference/functionOverloadErrors.js @@ -119,8 +119,7 @@ function initExpr() { } //// [functionOverloadErrors.js] -function fn1() { -} +function fn1() { } function fn2a() { } function fn2b() { @@ -128,52 +127,37 @@ function fn2b() { function fn3() { return null; } -function fn6() { -} -function fn7() { -} -function fn8() { -} -function fn9() { -} -function fn10() { -} -function fn11() { -} -function fn12() { -} +function fn6() { } +function fn7() { } +function fn8() { } +function fn9() { } +function fn10() { } +function fn11() { } +function fn12() { } //Function overloads that differ by accessibility var cls = (function () { function cls() { } - cls.prototype.f = function () { - }; - cls.prototype.g = function () { - }; + cls.prototype.f = function () { }; + cls.prototype.g = function () { }; return cls; })(); //Function overloads with differing export var M; (function (M) { - function fn1() { - } - function fn2() { - } + function fn1() { } + function fn2() { } M.fn2 = fn2; })(M || (M = {})); -function dfn1() { -} -function dfn2() { -} +function dfn1() { } +function dfn2() { } function fewerParams(n) { } -function fn13(n) { -} +function fn13(n) { } function fn14() { return 3; } function fn15() { return undefined; } -function initExpr() { -} +function initExpr() { } diff --git a/tests/baselines/reference/functionOverloadErrorsSyntax.js b/tests/baselines/reference/functionOverloadErrorsSyntax.js index 3706f4da744..1a5537d2de2 100644 --- a/tests/baselines/reference/functionOverloadErrorsSyntax.js +++ b/tests/baselines/reference/functionOverloadErrorsSyntax.js @@ -12,9 +12,6 @@ function fn5() { } //// [functionOverloadErrorsSyntax.js] -function fn4a() { -} -function fn4b() { -} -function fn5() { -} +function fn4a() { } +function fn4b() { } +function fn5() { } diff --git a/tests/baselines/reference/functionOverloadImplementationOfWrongName.js b/tests/baselines/reference/functionOverloadImplementationOfWrongName.js index 6b66bc89ffa..465753f1040 100644 --- a/tests/baselines/reference/functionOverloadImplementationOfWrongName.js +++ b/tests/baselines/reference/functionOverloadImplementationOfWrongName.js @@ -4,5 +4,4 @@ function foo(x, y); function bar() { } //// [functionOverloadImplementationOfWrongName.js] -function bar() { -} +function bar() { } diff --git a/tests/baselines/reference/functionOverloadImplementationOfWrongName2.js b/tests/baselines/reference/functionOverloadImplementationOfWrongName2.js index c3008e7a6c2..34cf73d3239 100644 --- a/tests/baselines/reference/functionOverloadImplementationOfWrongName2.js +++ b/tests/baselines/reference/functionOverloadImplementationOfWrongName2.js @@ -4,5 +4,4 @@ function bar() { } function foo(x, y); //// [functionOverloadImplementationOfWrongName2.js] -function bar() { -} +function bar() { } diff --git a/tests/baselines/reference/functionOverloads.js b/tests/baselines/reference/functionOverloads.js index 5504b286628..7e38b8fe993 100644 --- a/tests/baselines/reference/functionOverloads.js +++ b/tests/baselines/reference/functionOverloads.js @@ -5,8 +5,6 @@ function foo(bar?: string): any { return "" }; var x = foo(5); //// [functionOverloads.js] -function foo(bar) { - return ""; -} +function foo(bar) { return ""; } ; var x = foo(5); diff --git a/tests/baselines/reference/functionOverloads1.js b/tests/baselines/reference/functionOverloads1.js index 695a9c37808..5b4acabd02c 100644 --- a/tests/baselines/reference/functionOverloads1.js +++ b/tests/baselines/reference/functionOverloads1.js @@ -5,6 +5,4 @@ function foo():string { return "a" } //// [functionOverloads1.js] 1 + 1; -function foo() { - return "a"; -} +function foo() { return "a"; } diff --git a/tests/baselines/reference/functionOverloads10.js b/tests/baselines/reference/functionOverloads10.js index 2cd24bcd1cb..08b71698dce 100644 --- a/tests/baselines/reference/functionOverloads10.js +++ b/tests/baselines/reference/functionOverloads10.js @@ -5,5 +5,4 @@ function foo(foo:any){ } //// [functionOverloads10.js] -function foo(foo) { -} +function foo(foo) { } diff --git a/tests/baselines/reference/functionOverloads11.js b/tests/baselines/reference/functionOverloads11.js index efc9c793125..8d85b0ffb7b 100644 --- a/tests/baselines/reference/functionOverloads11.js +++ b/tests/baselines/reference/functionOverloads11.js @@ -4,6 +4,4 @@ function foo():string { return "" } //// [functionOverloads11.js] -function foo() { - return ""; -} +function foo() { return ""; } diff --git a/tests/baselines/reference/functionOverloads12.js b/tests/baselines/reference/functionOverloads12.js index ff789083eeb..4681e43ee5b 100644 --- a/tests/baselines/reference/functionOverloads12.js +++ b/tests/baselines/reference/functionOverloads12.js @@ -5,9 +5,7 @@ function foo():any { if (true) return ""; else return 0;} //// [functionOverloads12.js] -function foo() { - if (true) - return ""; - else - return 0; -} +function foo() { if (true) + return ""; +else + return 0; } diff --git a/tests/baselines/reference/functionOverloads13.js b/tests/baselines/reference/functionOverloads13.js index f9eb4d59e47..ff43c85e3df 100644 --- a/tests/baselines/reference/functionOverloads13.js +++ b/tests/baselines/reference/functionOverloads13.js @@ -5,6 +5,4 @@ function foo(bar?:number):any { return "" } //// [functionOverloads13.js] -function foo(bar) { - return ""; -} +function foo(bar) { return ""; } diff --git a/tests/baselines/reference/functionOverloads14.js b/tests/baselines/reference/functionOverloads14.js index e580c4e2283..826b096290a 100644 --- a/tests/baselines/reference/functionOverloads14.js +++ b/tests/baselines/reference/functionOverloads14.js @@ -5,8 +5,4 @@ function foo():{a:any;} { return {a:1} } //// [functionOverloads14.js] -function foo() { - return { - a: 1 - }; -} +function foo() { return { a: 1 }; } diff --git a/tests/baselines/reference/functionOverloads15.js b/tests/baselines/reference/functionOverloads15.js index 2b80df6630c..fe0c90f82af 100644 --- a/tests/baselines/reference/functionOverloads15.js +++ b/tests/baselines/reference/functionOverloads15.js @@ -5,6 +5,4 @@ function foo(foo:{a:string; b?:number;}):any { return "" } //// [functionOverloads15.js] -function foo(foo) { - return ""; -} +function foo(foo) { return ""; } diff --git a/tests/baselines/reference/functionOverloads16.js b/tests/baselines/reference/functionOverloads16.js index ebf82febd16..a0fdaa88894 100644 --- a/tests/baselines/reference/functionOverloads16.js +++ b/tests/baselines/reference/functionOverloads16.js @@ -5,6 +5,4 @@ function foo(foo:{a:string; b?:number;}):any { return "" } //// [functionOverloads16.js] -function foo(foo) { - return ""; -} +function foo(foo) { return ""; } diff --git a/tests/baselines/reference/functionOverloads17.js b/tests/baselines/reference/functionOverloads17.js index ef1a9e765fc..3a5dcd81914 100644 --- a/tests/baselines/reference/functionOverloads17.js +++ b/tests/baselines/reference/functionOverloads17.js @@ -4,8 +4,4 @@ function foo():{a:string;} { return {a:""} } //// [functionOverloads17.js] -function foo() { - return { - a: "" - }; -} +function foo() { return { a: "" }; } diff --git a/tests/baselines/reference/functionOverloads18.js b/tests/baselines/reference/functionOverloads18.js index 65a16c2896a..8c196831e48 100644 --- a/tests/baselines/reference/functionOverloads18.js +++ b/tests/baselines/reference/functionOverloads18.js @@ -4,8 +4,4 @@ function foo(bar:{a:string;}) { return {a:""} } //// [functionOverloads18.js] -function foo(bar) { - return { - a: "" - }; -} +function foo(bar) { return { a: "" }; } diff --git a/tests/baselines/reference/functionOverloads19.js b/tests/baselines/reference/functionOverloads19.js index d5749d3eef2..4183f6a48b8 100644 --- a/tests/baselines/reference/functionOverloads19.js +++ b/tests/baselines/reference/functionOverloads19.js @@ -5,8 +5,4 @@ function foo(bar:{a:any;}) { return {a:""} } //// [functionOverloads19.js] -function foo(bar) { - return { - a: "" - }; -} +function foo(bar) { return { a: "" }; } diff --git a/tests/baselines/reference/functionOverloads2.js b/tests/baselines/reference/functionOverloads2.js index 7e9eb45d236..39a58663cf4 100644 --- a/tests/baselines/reference/functionOverloads2.js +++ b/tests/baselines/reference/functionOverloads2.js @@ -5,8 +5,6 @@ function foo(bar: any): any { return bar }; var x = foo(true); //// [functionOverloads2.js] -function foo(bar) { - return bar; -} +function foo(bar) { return bar; } ; var x = foo(true); diff --git a/tests/baselines/reference/functionOverloads20.js b/tests/baselines/reference/functionOverloads20.js index 012f2ce09cd..4f259a88538 100644 --- a/tests/baselines/reference/functionOverloads20.js +++ b/tests/baselines/reference/functionOverloads20.js @@ -5,6 +5,4 @@ function foo(bar:{a:any;}): string {return ""} //// [functionOverloads20.js] -function foo(bar) { - return ""; -} +function foo(bar) { return ""; } diff --git a/tests/baselines/reference/functionOverloads21.js b/tests/baselines/reference/functionOverloads21.js index 78fb1fe011f..6e69169efbf 100644 --- a/tests/baselines/reference/functionOverloads21.js +++ b/tests/baselines/reference/functionOverloads21.js @@ -5,6 +5,4 @@ function foo(bar:{a:any; b?:string;}[]) { return 0 } //// [functionOverloads21.js] -function foo(bar) { - return 0; -} +function foo(bar) { return 0; } diff --git a/tests/baselines/reference/functionOverloads22.js b/tests/baselines/reference/functionOverloads22.js index d682b441822..54b745d96dd 100644 --- a/tests/baselines/reference/functionOverloads22.js +++ b/tests/baselines/reference/functionOverloads22.js @@ -5,10 +5,4 @@ function foo(bar:any):{a:any;b?:any;}[] { return [{a:""}] } //// [functionOverloads22.js] -function foo(bar) { - return [ - { - a: "" - } - ]; -} +function foo(bar) { return [{ a: "" }]; } diff --git a/tests/baselines/reference/functionOverloads23.js b/tests/baselines/reference/functionOverloads23.js index d8cac7eb8ee..aa3a7172ada 100644 --- a/tests/baselines/reference/functionOverloads23.js +++ b/tests/baselines/reference/functionOverloads23.js @@ -5,6 +5,4 @@ function foo(bar:(a?)=>void) { return 0 } //// [functionOverloads23.js] -function foo(bar) { - return 0; -} +function foo(bar) { return 0; } diff --git a/tests/baselines/reference/functionOverloads24.js b/tests/baselines/reference/functionOverloads24.js index 5ff4e248c0a..8fcc3c81902 100644 --- a/tests/baselines/reference/functionOverloads24.js +++ b/tests/baselines/reference/functionOverloads24.js @@ -5,7 +5,4 @@ function foo(bar:any):(a)=>void { return function(){} } //// [functionOverloads24.js] -function foo(bar) { - return function () { - }; -} +function foo(bar) { return function () { }; } diff --git a/tests/baselines/reference/functionOverloads25.js b/tests/baselines/reference/functionOverloads25.js index bbaef498926..d466aa82d21 100644 --- a/tests/baselines/reference/functionOverloads25.js +++ b/tests/baselines/reference/functionOverloads25.js @@ -6,8 +6,6 @@ var x = foo(); //// [functionOverloads25.js] -function foo(bar) { - return ''; -} +function foo(bar) { return ''; } ; var x = foo(); diff --git a/tests/baselines/reference/functionOverloads26.js b/tests/baselines/reference/functionOverloads26.js index 088c06147ba..bc4d017b9bb 100644 --- a/tests/baselines/reference/functionOverloads26.js +++ b/tests/baselines/reference/functionOverloads26.js @@ -6,7 +6,5 @@ var x = foo('baz'); //// [functionOverloads26.js] -function foo(bar) { - return ''; -} +function foo(bar) { return ''; } var x = foo('baz'); diff --git a/tests/baselines/reference/functionOverloads27.js b/tests/baselines/reference/functionOverloads27.js index 2b11b1f6c4e..199905d8219 100644 --- a/tests/baselines/reference/functionOverloads27.js +++ b/tests/baselines/reference/functionOverloads27.js @@ -6,7 +6,5 @@ var x = foo(5); //// [functionOverloads27.js] -function foo(bar) { - return ''; -} +function foo(bar) { return ''; } var x = foo(5); diff --git a/tests/baselines/reference/functionOverloads28.js b/tests/baselines/reference/functionOverloads28.js index 566972ee25d..d10ef52e2b2 100644 --- a/tests/baselines/reference/functionOverloads28.js +++ b/tests/baselines/reference/functionOverloads28.js @@ -6,8 +6,6 @@ var t:any; var x = foo(t); //// [functionOverloads28.js] -function foo(bar) { - return ''; -} +function foo(bar) { return ''; } var t; var x = foo(t); diff --git a/tests/baselines/reference/functionOverloads29.js b/tests/baselines/reference/functionOverloads29.js index c828bb95917..edc1ea178bc 100644 --- a/tests/baselines/reference/functionOverloads29.js +++ b/tests/baselines/reference/functionOverloads29.js @@ -6,7 +6,5 @@ var x = foo(); //// [functionOverloads29.js] -function foo(bar) { - return bar; -} +function foo(bar) { return bar; } var x = foo(); diff --git a/tests/baselines/reference/functionOverloads30.js b/tests/baselines/reference/functionOverloads30.js index 27b1436b6fb..bc7593a0771 100644 --- a/tests/baselines/reference/functionOverloads30.js +++ b/tests/baselines/reference/functionOverloads30.js @@ -6,7 +6,5 @@ var x = foo('bar'); //// [functionOverloads30.js] -function foo(bar) { - return bar; -} +function foo(bar) { return bar; } var x = foo('bar'); diff --git a/tests/baselines/reference/functionOverloads31.js b/tests/baselines/reference/functionOverloads31.js index 01cee2c342b..2c2a15821a7 100644 --- a/tests/baselines/reference/functionOverloads31.js +++ b/tests/baselines/reference/functionOverloads31.js @@ -6,7 +6,5 @@ var x = foo(5); //// [functionOverloads31.js] -function foo(bar) { - return bar; -} +function foo(bar) { return bar; } var x = foo(5); diff --git a/tests/baselines/reference/functionOverloads32.js b/tests/baselines/reference/functionOverloads32.js index 4e0efa98b09..a5557042dfb 100644 --- a/tests/baselines/reference/functionOverloads32.js +++ b/tests/baselines/reference/functionOverloads32.js @@ -6,8 +6,6 @@ var baz:number; var x = foo(baz); //// [functionOverloads32.js] -function foo(bar) { - return bar; -} +function foo(bar) { return bar; } var baz; var x = foo(baz); diff --git a/tests/baselines/reference/functionOverloads33.js b/tests/baselines/reference/functionOverloads33.js index 0c01cd54d1e..98bcc09b8b4 100644 --- a/tests/baselines/reference/functionOverloads33.js +++ b/tests/baselines/reference/functionOverloads33.js @@ -6,7 +6,5 @@ var x = foo(5); //// [functionOverloads33.js] -function foo(bar) { - return bar; -} +function foo(bar) { return bar; } var x = foo(5); diff --git a/tests/baselines/reference/functionOverloads34.js b/tests/baselines/reference/functionOverloads34.js index 48ac2b5fc59..3d4311e4193 100644 --- a/tests/baselines/reference/functionOverloads34.js +++ b/tests/baselines/reference/functionOverloads34.js @@ -6,7 +6,5 @@ var x = foo(); //// [functionOverloads34.js] -function foo(bar) { - return bar; -} +function foo(bar) { return bar; } var x = foo(); diff --git a/tests/baselines/reference/functionOverloads35.js b/tests/baselines/reference/functionOverloads35.js index 64ff527dee9..b25ac6c3c5f 100644 --- a/tests/baselines/reference/functionOverloads35.js +++ b/tests/baselines/reference/functionOverloads35.js @@ -6,9 +6,5 @@ var x = foo({a:1}); //// [functionOverloads35.js] -function foo(bar) { - return bar; -} -var x = foo({ - a: 1 -}); +function foo(bar) { return bar; } +var x = foo({ a: 1 }); diff --git a/tests/baselines/reference/functionOverloads36.js b/tests/baselines/reference/functionOverloads36.js index 3872aa3191f..4e790917d93 100644 --- a/tests/baselines/reference/functionOverloads36.js +++ b/tests/baselines/reference/functionOverloads36.js @@ -6,9 +6,5 @@ var x = foo({a:'foo'}); //// [functionOverloads36.js] -function foo(bar) { - return bar; -} -var x = foo({ - a: 'foo' -}); +function foo(bar) { return bar; } +var x = foo({ a: 'foo' }); diff --git a/tests/baselines/reference/functionOverloads37.js b/tests/baselines/reference/functionOverloads37.js index f9e6130dbd9..c4e0d4fd18b 100644 --- a/tests/baselines/reference/functionOverloads37.js +++ b/tests/baselines/reference/functionOverloads37.js @@ -6,7 +6,5 @@ var x = foo(); //// [functionOverloads37.js] -function foo(bar) { - return bar; -} +function foo(bar) { return bar; } var x = foo(); diff --git a/tests/baselines/reference/functionOverloads38.js b/tests/baselines/reference/functionOverloads38.js index fa8aa4693b3..c973cbe7b67 100644 --- a/tests/baselines/reference/functionOverloads38.js +++ b/tests/baselines/reference/functionOverloads38.js @@ -6,11 +6,5 @@ var x = foo([{a:1}]); //// [functionOverloads38.js] -function foo(bar) { - return bar; -} -var x = foo([ - { - a: 1 - } -]); +function foo(bar) { return bar; } +var x = foo([{ a: 1 }]); diff --git a/tests/baselines/reference/functionOverloads39.js b/tests/baselines/reference/functionOverloads39.js index 218c3e9f698..ad4ded394d8 100644 --- a/tests/baselines/reference/functionOverloads39.js +++ b/tests/baselines/reference/functionOverloads39.js @@ -6,11 +6,5 @@ var x = foo([{a:true}]); //// [functionOverloads39.js] -function foo(bar) { - return bar; -} -var x = foo([ - { - a: true - } -]); +function foo(bar) { return bar; } +var x = foo([{ a: true }]); diff --git a/tests/baselines/reference/functionOverloads4.js b/tests/baselines/reference/functionOverloads4.js index b428f6938b4..3a1ff2ced33 100644 --- a/tests/baselines/reference/functionOverloads4.js +++ b/tests/baselines/reference/functionOverloads4.js @@ -3,6 +3,4 @@ function foo():number; function foo():string { return "a" } //// [functionOverloads4.js] -function foo() { - return "a"; -} +function foo() { return "a"; } diff --git a/tests/baselines/reference/functionOverloads40.js b/tests/baselines/reference/functionOverloads40.js index 3ad42e1b91d..11edff26a4b 100644 --- a/tests/baselines/reference/functionOverloads40.js +++ b/tests/baselines/reference/functionOverloads40.js @@ -6,11 +6,5 @@ var x = foo([{a:'bar'}]); //// [functionOverloads40.js] -function foo(bar) { - return bar; -} -var x = foo([ - { - a: 'bar' - } -]); +function foo(bar) { return bar; } +var x = foo([{ a: 'bar' }]); diff --git a/tests/baselines/reference/functionOverloads41.js b/tests/baselines/reference/functionOverloads41.js index 449250dd1cd..dd730e25b31 100644 --- a/tests/baselines/reference/functionOverloads41.js +++ b/tests/baselines/reference/functionOverloads41.js @@ -6,9 +6,5 @@ var x = foo([{}]); //// [functionOverloads41.js] -function foo(bar) { - return bar; -} -var x = foo([ - {} -]); +function foo(bar) { return bar; } +var x = foo([{}]); diff --git a/tests/baselines/reference/functionOverloads42.js b/tests/baselines/reference/functionOverloads42.js index 0f87b5139d2..979bfa86d62 100644 --- a/tests/baselines/reference/functionOverloads42.js +++ b/tests/baselines/reference/functionOverloads42.js @@ -6,11 +6,5 @@ var x = foo([{a:'s'}]); //// [functionOverloads42.js] -function foo(bar) { - return bar; -} -var x = foo([ - { - a: 's' - } -]); +function foo(bar) { return bar; } +var x = foo([{ a: 's' }]); diff --git a/tests/baselines/reference/functionOverloads5.js b/tests/baselines/reference/functionOverloads5.js index 15507a9fb61..b59154d2417 100644 --- a/tests/baselines/reference/functionOverloads5.js +++ b/tests/baselines/reference/functionOverloads5.js @@ -9,7 +9,6 @@ class baz { var baz = (function () { function baz() { } - baz.prototype.foo = function (bar) { - }; + baz.prototype.foo = function (bar) { }; return baz; })(); diff --git a/tests/baselines/reference/functionOverloads6.js b/tests/baselines/reference/functionOverloads6.js index b7f9fd8c1f2..2c19b376dc8 100644 --- a/tests/baselines/reference/functionOverloads6.js +++ b/tests/baselines/reference/functionOverloads6.js @@ -10,7 +10,6 @@ class foo { var foo = (function () { function foo() { } - foo.fnOverload = function (foo) { - }; + foo.fnOverload = function (foo) { }; return foo; })(); diff --git a/tests/baselines/reference/functionOverloads7.js b/tests/baselines/reference/functionOverloads7.js index 52cac83af72..540abf9eb8c 100644 --- a/tests/baselines/reference/functionOverloads7.js +++ b/tests/baselines/reference/functionOverloads7.js @@ -14,9 +14,7 @@ class foo { var foo = (function () { function foo() { } - foo.prototype.bar = function (foo) { - return "foo"; - }; + foo.prototype.bar = function (foo) { return "foo"; }; foo.prototype.n = function () { var foo = this.bar(); foo = this.bar("test"); diff --git a/tests/baselines/reference/functionOverloads8.js b/tests/baselines/reference/functionOverloads8.js index 08c2c0b65a1..55539a61659 100644 --- a/tests/baselines/reference/functionOverloads8.js +++ b/tests/baselines/reference/functionOverloads8.js @@ -5,6 +5,4 @@ function foo(foo?:any){ return '' } //// [functionOverloads8.js] -function foo(foo) { - return ''; -} +function foo(foo) { return ''; } diff --git a/tests/baselines/reference/functionOverloads9.js b/tests/baselines/reference/functionOverloads9.js index 53cc0385a59..9d2ae21f4fa 100644 --- a/tests/baselines/reference/functionOverloads9.js +++ b/tests/baselines/reference/functionOverloads9.js @@ -5,8 +5,6 @@ var x = foo('foo'); //// [functionOverloads9.js] -function foo(foo) { - return ''; -} +function foo(foo) { return ''; } ; var x = foo('foo'); diff --git a/tests/baselines/reference/functionReturn.js b/tests/baselines/reference/functionReturn.js index bfcd12e2b95..c433eec190d 100644 --- a/tests/baselines/reference/functionReturn.js +++ b/tests/baselines/reference/functionReturn.js @@ -15,16 +15,12 @@ function f5(): string { } //// [functionReturn.js] -function f0() { -} +function f0() { } function f1() { var n = f0(); } -function f2() { -} -function f3() { - return; -} +function f2() { } +function f3() { return; } function f4() { return ''; return; diff --git a/tests/baselines/reference/functionType.js b/tests/baselines/reference/functionType.js index c2d6eea784c..6e3edc7347e 100644 --- a/tests/baselines/reference/functionType.js +++ b/tests/baselines/reference/functionType.js @@ -7,7 +7,6 @@ salt.apply("hello", []); //// [functionType.js] -function salt() { -} +function salt() { } salt.apply("hello", []); (new Function("return 5"))(); diff --git a/tests/baselines/reference/functionTypeArgumentAssignmentCompat.js b/tests/baselines/reference/functionTypeArgumentAssignmentCompat.js index b4ed20e9ed0..15080e99d73 100644 --- a/tests/baselines/reference/functionTypeArgumentAssignmentCompat.js +++ b/tests/baselines/reference/functionTypeArgumentAssignmentCompat.js @@ -15,9 +15,7 @@ console.log(s); //// [functionTypeArgumentAssignmentCompat.js] var f; -var g = function () { - return []; -}; +var g = function () { return []; }; f = g; var s = f("str").toUpperCase(); console.log(s); diff --git a/tests/baselines/reference/functionWithAnyReturnTypeAndNoReturnExpression.js b/tests/baselines/reference/functionWithAnyReturnTypeAndNoReturnExpression.js index 6bca14b063b..dae960bad68 100644 --- a/tests/baselines/reference/functionWithAnyReturnTypeAndNoReturnExpression.js +++ b/tests/baselines/reference/functionWithAnyReturnTypeAndNoReturnExpression.js @@ -6,9 +6,6 @@ var f3 = (): any => { }; //// [functionWithAnyReturnTypeAndNoReturnExpression.js] // All should be allowed -function f() { -} -var f2 = function () { -}; -var f3 = function () { -}; +function f() { } +var f2 = function () { }; +var f3 = function () { }; diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements10.js b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements10.js index a72b15a1b9c..f312966ea4f 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements10.js +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements10.js @@ -6,12 +6,8 @@ function bar(a = [0]) { //// [functionWithDefaultParameterWithNoStatements10.js] function foo(a) { - if (a === void 0) { a = [ - 0 - ]; } + if (a === void 0) { a = [0]; } } function bar(a) { - if (a === void 0) { a = [ - 0 - ]; } + if (a === void 0) { a = [0]; } } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements13.js b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements13.js index db98c6353cc..7fcbae72541 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements13.js +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements13.js @@ -9,12 +9,8 @@ function bar(a = [1 + 1]) { //// [functionWithDefaultParameterWithNoStatements13.js] var v; function foo(a) { - if (a === void 0) { a = [ - 1 + 1 - ]; } + if (a === void 0) { a = [1 + 1]; } } function bar(a) { - if (a === void 0) { a = [ - 1 + 1 - ]; } + if (a === void 0) { a = [1 + 1]; } } diff --git a/tests/baselines/reference/functionWithMultipleReturnStatements2.js b/tests/baselines/reference/functionWithMultipleReturnStatements2.js index 396c4a8d9c0..4674c6db953 100644 --- a/tests/baselines/reference/functionWithMultipleReturnStatements2.js +++ b/tests/baselines/reference/functionWithMultipleReturnStatements2.js @@ -166,22 +166,18 @@ function f10() { // returns number => void function f11() { if (true) { - return function (x) { - }; + return function (x) { }; } else { - return function (x) { - }; + return function (x) { }; } } // returns Object => void function f12() { if (true) { - return function (x) { - }; + return function (x) { }; } else { - return function (x) { - }; + return function (x) { }; } } diff --git a/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.js b/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.js index ae8e7d9c918..592a03d7158 100644 --- a/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.js +++ b/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.js @@ -228,7 +228,8 @@ var C = (function () { // Not fine, since we can *only* consist of a single throw statement // if no return statements are present but we are a get accessor. throw null; - throw undefined.; + throw undefined. + ; }, enumerable: true, configurable: true diff --git a/tests/baselines/reference/functionsWithModifiersInBlocks1.js b/tests/baselines/reference/functionsWithModifiersInBlocks1.js index 1d381bccfe1..757fe509747 100644 --- a/tests/baselines/reference/functionsWithModifiersInBlocks1.js +++ b/tests/baselines/reference/functionsWithModifiersInBlocks1.js @@ -7,7 +7,6 @@ //// [functionsWithModifiersInBlocks1.js] { - function f() { - } + function f() { } exports.f = f; } diff --git a/tests/baselines/reference/funduleSplitAcrossFiles.js b/tests/baselines/reference/funduleSplitAcrossFiles.js index 330fbcdec74..bb59338a630 100644 --- a/tests/baselines/reference/funduleSplitAcrossFiles.js +++ b/tests/baselines/reference/funduleSplitAcrossFiles.js @@ -10,8 +10,7 @@ module D { D.y; //// [funduleSplitAcrossFiles_function.js] -function D() { -} +function D() { } //// [funduleSplitAcrossFiles_module.js] var D; (function (D) { diff --git a/tests/baselines/reference/fuzzy.js b/tests/baselines/reference/fuzzy.js index 4729b59e2c3..b98a9ced107 100644 --- a/tests/baselines/reference/fuzzy.js +++ b/tests/baselines/reference/fuzzy.js @@ -38,20 +38,13 @@ var M; this.x = x; } C.prototype.works = function () { - return ({ - anything: 1 - }); + return ({ anything: 1 }); }; C.prototype.doesntWork = function () { - return { - anything: 1, - oneI: this - }; + return { anything: 1, oneI: this }; }; C.prototype.worksToo = function () { - return ({ - oneI: this - }); + return ({ oneI: this }); }; return C; })(); diff --git a/tests/baselines/reference/generatedContextualTyping.js b/tests/baselines/reference/generatedContextualTyping.js index ec79d3a7522..a88929669fd 100644 --- a/tests/baselines/reference/generatedContextualTyping.js +++ b/tests/baselines/reference/generatedContextualTyping.js @@ -381,2973 +381,1072 @@ var Derived2 = (function (_super) { return Derived2; })(Base); var b = new Base(), d1 = new Derived1(), d2 = new Derived2(); -var x1 = function () { - return [ - d1, - d2 - ]; -}; -var x2 = function () { - return [ - d1, - d2 - ]; -}; -var x3 = function named() { - return [ - d1, - d2 - ]; -}; -var x4 = function () { - return [ - d1, - d2 - ]; -}; -var x5 = function () { - return [ - d1, - d2 - ]; -}; -var x6 = function named() { - return [ - d1, - d2 - ]; -}; -var x7 = [ - d1, - d2 -]; -var x8 = [ - d1, - d2 -]; -var x9 = [ - d1, - d2 -]; -var x10 = { - n: [ - d1, - d2 - ] -}; -var x11 = function (n) { - var n; - return null; -}; -var x12 = { - func: function (n) { - return [ - d1, - d2 - ]; - } -}; +var x1 = function () { return [d1, d2]; }; +var x2 = function () { return [d1, d2]; }; +var x3 = function named() { return [d1, d2]; }; +var x4 = function () { return [d1, d2]; }; +var x5 = function () { return [d1, d2]; }; +var x6 = function named() { return [d1, d2]; }; +var x7 = [d1, d2]; +var x8 = [d1, d2]; +var x9 = [d1, d2]; +var x10 = { n: [d1, d2] }; +var x11 = function (n) { var n; return null; }; +var x12 = { func: function (n) { return [d1, d2]; } }; var x13 = (function () { function x13() { - this.member = function () { - return [ - d1, - d2 - ]; - }; + this.member = function () { return [d1, d2]; }; } return x13; })(); var x14 = (function () { function x14() { - this.member = function () { - return [ - d1, - d2 - ]; - }; + this.member = function () { return [d1, d2]; }; } return x14; })(); var x15 = (function () { function x15() { - this.member = function named() { - return [ - d1, - d2 - ]; - }; + this.member = function named() { return [d1, d2]; }; } return x15; })(); var x16 = (function () { function x16() { - this.member = function () { - return [ - d1, - d2 - ]; - }; + this.member = function () { return [d1, d2]; }; } return x16; })(); var x17 = (function () { function x17() { - this.member = function () { - return [ - d1, - d2 - ]; - }; + this.member = function () { return [d1, d2]; }; } return x17; })(); var x18 = (function () { function x18() { - this.member = function named() { - return [ - d1, - d2 - ]; - }; + this.member = function named() { return [d1, d2]; }; } return x18; })(); var x19 = (function () { function x19() { - this.member = [ - d1, - d2 - ]; + this.member = [d1, d2]; } return x19; })(); var x20 = (function () { function x20() { - this.member = [ - d1, - d2 - ]; + this.member = [d1, d2]; } return x20; })(); var x21 = (function () { function x21() { - this.member = [ - d1, - d2 - ]; + this.member = [d1, d2]; } return x21; })(); var x22 = (function () { function x22() { - this.member = { - n: [ - d1, - d2 - ] - }; + this.member = { n: [d1, d2] }; } return x22; })(); var x23 = (function () { function x23() { - this.member = function (n) { - var n; - return null; - }; + this.member = function (n) { var n; return null; }; } return x23; })(); var x24 = (function () { function x24() { - this.member = { - func: function (n) { - return [ - d1, - d2 - ]; - } - }; + this.member = { func: function (n) { return [d1, d2]; } }; } return x24; })(); var x25 = (function () { function x25() { - this.member = function () { - return [ - d1, - d2 - ]; - }; + this.member = function () { return [d1, d2]; }; } return x25; })(); var x26 = (function () { function x26() { - this.member = function () { - return [ - d1, - d2 - ]; - }; + this.member = function () { return [d1, d2]; }; } return x26; })(); var x27 = (function () { function x27() { - this.member = function named() { - return [ - d1, - d2 - ]; - }; + this.member = function named() { return [d1, d2]; }; } return x27; })(); var x28 = (function () { function x28() { - this.member = function () { - return [ - d1, - d2 - ]; - }; + this.member = function () { return [d1, d2]; }; } return x28; })(); var x29 = (function () { function x29() { - this.member = function () { - return [ - d1, - d2 - ]; - }; + this.member = function () { return [d1, d2]; }; } return x29; })(); var x30 = (function () { function x30() { - this.member = function named() { - return [ - d1, - d2 - ]; - }; + this.member = function named() { return [d1, d2]; }; } return x30; })(); var x31 = (function () { function x31() { - this.member = [ - d1, - d2 - ]; + this.member = [d1, d2]; } return x31; })(); var x32 = (function () { function x32() { - this.member = [ - d1, - d2 - ]; + this.member = [d1, d2]; } return x32; })(); var x33 = (function () { function x33() { - this.member = [ - d1, - d2 - ]; + this.member = [d1, d2]; } return x33; })(); var x34 = (function () { function x34() { - this.member = { - n: [ - d1, - d2 - ] - }; + this.member = { n: [d1, d2] }; } return x34; })(); var x35 = (function () { function x35() { - this.member = function (n) { - var n; - return null; - }; + this.member = function (n) { var n; return null; }; } return x35; })(); var x36 = (function () { function x36() { - this.member = { - func: function (n) { - return [ - d1, - d2 - ]; - } - }; + this.member = { func: function (n) { return [d1, d2]; } }; } return x36; })(); var x37 = (function () { function x37() { - this.member = function () { - return [ - d1, - d2 - ]; - }; + this.member = function () { return [d1, d2]; }; } return x37; })(); var x38 = (function () { function x38() { - this.member = function () { - return [ - d1, - d2 - ]; - }; + this.member = function () { return [d1, d2]; }; } return x38; })(); var x39 = (function () { function x39() { - this.member = function named() { - return [ - d1, - d2 - ]; - }; + this.member = function named() { return [d1, d2]; }; } return x39; })(); var x40 = (function () { function x40() { - this.member = function () { - return [ - d1, - d2 - ]; - }; + this.member = function () { return [d1, d2]; }; } return x40; })(); var x41 = (function () { function x41() { - this.member = function () { - return [ - d1, - d2 - ]; - }; + this.member = function () { return [d1, d2]; }; } return x41; })(); var x42 = (function () { function x42() { - this.member = function named() { - return [ - d1, - d2 - ]; - }; + this.member = function named() { return [d1, d2]; }; } return x42; })(); var x43 = (function () { function x43() { - this.member = [ - d1, - d2 - ]; + this.member = [d1, d2]; } return x43; })(); var x44 = (function () { function x44() { - this.member = [ - d1, - d2 - ]; + this.member = [d1, d2]; } return x44; })(); var x45 = (function () { function x45() { - this.member = [ - d1, - d2 - ]; + this.member = [d1, d2]; } return x45; })(); var x46 = (function () { function x46() { - this.member = { - n: [ - d1, - d2 - ] - }; + this.member = { n: [d1, d2] }; } return x46; })(); var x47 = (function () { function x47() { - this.member = function (n) { - var n; - return null; - }; + this.member = function (n) { var n; return null; }; } return x47; })(); var x48 = (function () { function x48() { - this.member = { - func: function (n) { - return [ - d1, - d2 - ]; - } - }; + this.member = { func: function (n) { return [d1, d2]; } }; } return x48; })(); var x49 = (function () { function x49() { } - x49.member = function () { - return [ - d1, - d2 - ]; - }; + x49.member = function () { return [d1, d2]; }; return x49; })(); var x50 = (function () { function x50() { } - x50.member = function () { - return [ - d1, - d2 - ]; - }; + x50.member = function () { return [d1, d2]; }; return x50; })(); var x51 = (function () { function x51() { } - x51.member = function named() { - return [ - d1, - d2 - ]; - }; + x51.member = function named() { return [d1, d2]; }; return x51; })(); var x52 = (function () { function x52() { } - x52.member = function () { - return [ - d1, - d2 - ]; - }; + x52.member = function () { return [d1, d2]; }; return x52; })(); var x53 = (function () { function x53() { } - x53.member = function () { - return [ - d1, - d2 - ]; - }; + x53.member = function () { return [d1, d2]; }; return x53; })(); var x54 = (function () { function x54() { } - x54.member = function named() { - return [ - d1, - d2 - ]; - }; + x54.member = function named() { return [d1, d2]; }; return x54; })(); var x55 = (function () { function x55() { } - x55.member = [ - d1, - d2 - ]; + x55.member = [d1, d2]; return x55; })(); var x56 = (function () { function x56() { } - x56.member = [ - d1, - d2 - ]; + x56.member = [d1, d2]; return x56; })(); var x57 = (function () { function x57() { } - x57.member = [ - d1, - d2 - ]; + x57.member = [d1, d2]; return x57; })(); var x58 = (function () { function x58() { } - x58.member = { - n: [ - d1, - d2 - ] - }; + x58.member = { n: [d1, d2] }; return x58; })(); var x59 = (function () { function x59() { } - x59.member = function (n) { - var n; - return null; - }; + x59.member = function (n) { var n; return null; }; return x59; })(); var x60 = (function () { function x60() { } - x60.member = { - func: function (n) { - return [ - d1, - d2 - ]; - } - }; + x60.member = { func: function (n) { return [d1, d2]; } }; return x60; })(); var x61 = (function () { function x61() { } - x61.member = function () { - return [ - d1, - d2 - ]; - }; + x61.member = function () { return [d1, d2]; }; return x61; })(); var x62 = (function () { function x62() { } - x62.member = function () { - return [ - d1, - d2 - ]; - }; + x62.member = function () { return [d1, d2]; }; return x62; })(); var x63 = (function () { function x63() { } - x63.member = function named() { - return [ - d1, - d2 - ]; - }; + x63.member = function named() { return [d1, d2]; }; return x63; })(); var x64 = (function () { function x64() { } - x64.member = function () { - return [ - d1, - d2 - ]; - }; + x64.member = function () { return [d1, d2]; }; return x64; })(); var x65 = (function () { function x65() { } - x65.member = function () { - return [ - d1, - d2 - ]; - }; + x65.member = function () { return [d1, d2]; }; return x65; })(); var x66 = (function () { function x66() { } - x66.member = function named() { - return [ - d1, - d2 - ]; - }; + x66.member = function named() { return [d1, d2]; }; return x66; })(); var x67 = (function () { function x67() { } - x67.member = [ - d1, - d2 - ]; + x67.member = [d1, d2]; return x67; })(); var x68 = (function () { function x68() { } - x68.member = [ - d1, - d2 - ]; + x68.member = [d1, d2]; return x68; })(); var x69 = (function () { function x69() { } - x69.member = [ - d1, - d2 - ]; + x69.member = [d1, d2]; return x69; })(); var x70 = (function () { function x70() { } - x70.member = { - n: [ - d1, - d2 - ] - }; + x70.member = { n: [d1, d2] }; return x70; })(); var x71 = (function () { function x71() { } - x71.member = function (n) { - var n; - return null; - }; + x71.member = function (n) { var n; return null; }; return x71; })(); var x72 = (function () { function x72() { } - x72.member = { - func: function (n) { - return [ - d1, - d2 - ]; - } - }; + x72.member = { func: function (n) { return [d1, d2]; } }; return x72; })(); var x73 = (function () { function x73() { } - x73.member = function () { - return [ - d1, - d2 - ]; - }; + x73.member = function () { return [d1, d2]; }; return x73; })(); var x74 = (function () { function x74() { } - x74.member = function () { - return [ - d1, - d2 - ]; - }; + x74.member = function () { return [d1, d2]; }; return x74; })(); var x75 = (function () { function x75() { } - x75.member = function named() { - return [ - d1, - d2 - ]; - }; + x75.member = function named() { return [d1, d2]; }; return x75; })(); var x76 = (function () { function x76() { } - x76.member = function () { - return [ - d1, - d2 - ]; - }; + x76.member = function () { return [d1, d2]; }; return x76; })(); var x77 = (function () { function x77() { } - x77.member = function () { - return [ - d1, - d2 - ]; - }; + x77.member = function () { return [d1, d2]; }; return x77; })(); var x78 = (function () { function x78() { } - x78.member = function named() { - return [ - d1, - d2 - ]; - }; + x78.member = function named() { return [d1, d2]; }; return x78; })(); var x79 = (function () { function x79() { } - x79.member = [ - d1, - d2 - ]; + x79.member = [d1, d2]; return x79; })(); var x80 = (function () { function x80() { } - x80.member = [ - d1, - d2 - ]; + x80.member = [d1, d2]; return x80; })(); var x81 = (function () { function x81() { } - x81.member = [ - d1, - d2 - ]; + x81.member = [d1, d2]; return x81; })(); var x82 = (function () { function x82() { } - x82.member = { - n: [ - d1, - d2 - ] - }; + x82.member = { n: [d1, d2] }; return x82; })(); var x83 = (function () { function x83() { } - x83.member = function (n) { - var n; - return null; - }; + x83.member = function (n) { var n; return null; }; return x83; })(); var x84 = (function () { function x84() { } - x84.member = { - func: function (n) { - return [ - d1, - d2 - ]; - } - }; + x84.member = { func: function (n) { return [d1, d2]; } }; return x84; })(); var x85 = (function () { function x85(parm) { - if (parm === void 0) { parm = function () { - return [ - d1, - d2 - ]; - }; } + if (parm === void 0) { parm = function () { return [d1, d2]; }; } } return x85; })(); var x86 = (function () { function x86(parm) { - if (parm === void 0) { parm = function () { - return [ - d1, - d2 - ]; - }; } + if (parm === void 0) { parm = function () { return [d1, d2]; }; } } return x86; })(); var x87 = (function () { function x87(parm) { - if (parm === void 0) { parm = function named() { - return [ - d1, - d2 - ]; - }; } + if (parm === void 0) { parm = function named() { return [d1, d2]; }; } } return x87; })(); var x88 = (function () { function x88(parm) { - if (parm === void 0) { parm = function () { - return [ - d1, - d2 - ]; - }; } + if (parm === void 0) { parm = function () { return [d1, d2]; }; } } return x88; })(); var x89 = (function () { function x89(parm) { - if (parm === void 0) { parm = function () { - return [ - d1, - d2 - ]; - }; } + if (parm === void 0) { parm = function () { return [d1, d2]; }; } } return x89; })(); var x90 = (function () { function x90(parm) { - if (parm === void 0) { parm = function named() { - return [ - d1, - d2 - ]; - }; } + if (parm === void 0) { parm = function named() { return [d1, d2]; }; } } return x90; })(); var x91 = (function () { function x91(parm) { - if (parm === void 0) { parm = [ - d1, - d2 - ]; } + if (parm === void 0) { parm = [d1, d2]; } } return x91; })(); var x92 = (function () { function x92(parm) { - if (parm === void 0) { parm = [ - d1, - d2 - ]; } + if (parm === void 0) { parm = [d1, d2]; } } return x92; })(); var x93 = (function () { function x93(parm) { - if (parm === void 0) { parm = [ - d1, - d2 - ]; } + if (parm === void 0) { parm = [d1, d2]; } } return x93; })(); var x94 = (function () { function x94(parm) { - if (parm === void 0) { parm = { - n: [ - d1, - d2 - ] - }; } + if (parm === void 0) { parm = { n: [d1, d2] }; } } return x94; })(); var x95 = (function () { function x95(parm) { - if (parm === void 0) { parm = function (n) { - var n; - return null; - }; } + if (parm === void 0) { parm = function (n) { var n; return null; }; } } return x95; })(); var x96 = (function () { function x96(parm) { - if (parm === void 0) { parm = { - func: function (n) { - return [ - d1, - d2 - ]; - } - }; } + if (parm === void 0) { parm = { func: function (n) { return [d1, d2]; } }; } } return x96; })(); var x97 = (function () { function x97(parm) { - if (parm === void 0) { parm = function () { - return [ - d1, - d2 - ]; - }; } + if (parm === void 0) { parm = function () { return [d1, d2]; }; } this.parm = parm; } return x97; })(); var x98 = (function () { function x98(parm) { - if (parm === void 0) { parm = function () { - return [ - d1, - d2 - ]; - }; } + if (parm === void 0) { parm = function () { return [d1, d2]; }; } this.parm = parm; } return x98; })(); var x99 = (function () { function x99(parm) { - if (parm === void 0) { parm = function named() { - return [ - d1, - d2 - ]; - }; } + if (parm === void 0) { parm = function named() { return [d1, d2]; }; } this.parm = parm; } return x99; })(); var x100 = (function () { function x100(parm) { - if (parm === void 0) { parm = function () { - return [ - d1, - d2 - ]; - }; } + if (parm === void 0) { parm = function () { return [d1, d2]; }; } this.parm = parm; } return x100; })(); var x101 = (function () { function x101(parm) { - if (parm === void 0) { parm = function () { - return [ - d1, - d2 - ]; - }; } + if (parm === void 0) { parm = function () { return [d1, d2]; }; } this.parm = parm; } return x101; })(); var x102 = (function () { function x102(parm) { - if (parm === void 0) { parm = function named() { - return [ - d1, - d2 - ]; - }; } + if (parm === void 0) { parm = function named() { return [d1, d2]; }; } this.parm = parm; } return x102; })(); var x103 = (function () { function x103(parm) { - if (parm === void 0) { parm = [ - d1, - d2 - ]; } + if (parm === void 0) { parm = [d1, d2]; } this.parm = parm; } return x103; })(); var x104 = (function () { function x104(parm) { - if (parm === void 0) { parm = [ - d1, - d2 - ]; } + if (parm === void 0) { parm = [d1, d2]; } this.parm = parm; } return x104; })(); var x105 = (function () { function x105(parm) { - if (parm === void 0) { parm = [ - d1, - d2 - ]; } + if (parm === void 0) { parm = [d1, d2]; } this.parm = parm; } return x105; })(); var x106 = (function () { function x106(parm) { - if (parm === void 0) { parm = { - n: [ - d1, - d2 - ] - }; } + if (parm === void 0) { parm = { n: [d1, d2] }; } this.parm = parm; } return x106; })(); var x107 = (function () { function x107(parm) { - if (parm === void 0) { parm = function (n) { - var n; - return null; - }; } + if (parm === void 0) { parm = function (n) { var n; return null; }; } this.parm = parm; } return x107; })(); var x108 = (function () { function x108(parm) { - if (parm === void 0) { parm = { - func: function (n) { - return [ - d1, - d2 - ]; - } - }; } + if (parm === void 0) { parm = { func: function (n) { return [d1, d2]; } }; } this.parm = parm; } return x108; })(); var x109 = (function () { function x109(parm) { - if (parm === void 0) { parm = function () { - return [ - d1, - d2 - ]; - }; } + if (parm === void 0) { parm = function () { return [d1, d2]; }; } this.parm = parm; } return x109; })(); var x110 = (function () { function x110(parm) { - if (parm === void 0) { parm = function () { - return [ - d1, - d2 - ]; - }; } + if (parm === void 0) { parm = function () { return [d1, d2]; }; } this.parm = parm; } return x110; })(); var x111 = (function () { function x111(parm) { - if (parm === void 0) { parm = function named() { - return [ - d1, - d2 - ]; - }; } + if (parm === void 0) { parm = function named() { return [d1, d2]; }; } this.parm = parm; } return x111; })(); var x112 = (function () { function x112(parm) { - if (parm === void 0) { parm = function () { - return [ - d1, - d2 - ]; - }; } + if (parm === void 0) { parm = function () { return [d1, d2]; }; } this.parm = parm; } return x112; })(); var x113 = (function () { function x113(parm) { - if (parm === void 0) { parm = function () { - return [ - d1, - d2 - ]; - }; } + if (parm === void 0) { parm = function () { return [d1, d2]; }; } this.parm = parm; } return x113; })(); var x114 = (function () { function x114(parm) { - if (parm === void 0) { parm = function named() { - return [ - d1, - d2 - ]; - }; } + if (parm === void 0) { parm = function named() { return [d1, d2]; }; } this.parm = parm; } return x114; })(); var x115 = (function () { function x115(parm) { - if (parm === void 0) { parm = [ - d1, - d2 - ]; } + if (parm === void 0) { parm = [d1, d2]; } this.parm = parm; } return x115; })(); var x116 = (function () { function x116(parm) { - if (parm === void 0) { parm = [ - d1, - d2 - ]; } + if (parm === void 0) { parm = [d1, d2]; } this.parm = parm; } return x116; })(); var x117 = (function () { function x117(parm) { - if (parm === void 0) { parm = [ - d1, - d2 - ]; } + if (parm === void 0) { parm = [d1, d2]; } this.parm = parm; } return x117; })(); var x118 = (function () { function x118(parm) { - if (parm === void 0) { parm = { - n: [ - d1, - d2 - ] - }; } + if (parm === void 0) { parm = { n: [d1, d2] }; } this.parm = parm; } return x118; })(); var x119 = (function () { function x119(parm) { - if (parm === void 0) { parm = function (n) { - var n; - return null; - }; } + if (parm === void 0) { parm = function (n) { var n; return null; }; } this.parm = parm; } return x119; })(); var x120 = (function () { function x120(parm) { - if (parm === void 0) { parm = { - func: function (n) { - return [ - d1, - d2 - ]; - } - }; } + if (parm === void 0) { parm = { func: function (n) { return [d1, d2]; } }; } this.parm = parm; } return x120; })(); function x121(parm) { - if (parm === void 0) { parm = function () { - return [ - d1, - d2 - ]; - }; } + if (parm === void 0) { parm = function () { return [d1, d2]; }; } } function x122(parm) { - if (parm === void 0) { parm = function () { - return [ - d1, - d2 - ]; - }; } + if (parm === void 0) { parm = function () { return [d1, d2]; }; } } function x123(parm) { - if (parm === void 0) { parm = function named() { - return [ - d1, - d2 - ]; - }; } + if (parm === void 0) { parm = function named() { return [d1, d2]; }; } } function x124(parm) { - if (parm === void 0) { parm = function () { - return [ - d1, - d2 - ]; - }; } + if (parm === void 0) { parm = function () { return [d1, d2]; }; } } function x125(parm) { - if (parm === void 0) { parm = function () { - return [ - d1, - d2 - ]; - }; } + if (parm === void 0) { parm = function () { return [d1, d2]; }; } } function x126(parm) { - if (parm === void 0) { parm = function named() { - return [ - d1, - d2 - ]; - }; } + if (parm === void 0) { parm = function named() { return [d1, d2]; }; } } function x127(parm) { - if (parm === void 0) { parm = [ - d1, - d2 - ]; } + if (parm === void 0) { parm = [d1, d2]; } } function x128(parm) { - if (parm === void 0) { parm = [ - d1, - d2 - ]; } + if (parm === void 0) { parm = [d1, d2]; } } function x129(parm) { - if (parm === void 0) { parm = [ - d1, - d2 - ]; } + if (parm === void 0) { parm = [d1, d2]; } } function x130(parm) { - if (parm === void 0) { parm = { - n: [ - d1, - d2 - ] - }; } + if (parm === void 0) { parm = { n: [d1, d2] }; } } function x131(parm) { - if (parm === void 0) { parm = function (n) { - var n; - return null; - }; } + if (parm === void 0) { parm = function (n) { var n; return null; }; } } function x132(parm) { - if (parm === void 0) { parm = { - func: function (n) { - return [ - d1, - d2 - ]; - } - }; } + if (parm === void 0) { parm = { func: function (n) { return [d1, d2]; } }; } } -function x133() { - return function () { - return [ - d1, - d2 - ]; - }; -} -function x134() { - return function () { - return [ - d1, - d2 - ]; - }; -} -function x135() { - return function named() { - return [ - d1, - d2 - ]; - }; -} -function x136() { - return function () { - return [ - d1, - d2 - ]; - }; -} -function x137() { - return function () { - return [ - d1, - d2 - ]; - }; -} -function x138() { - return function named() { - return [ - d1, - d2 - ]; - }; -} -function x139() { - return [ - d1, - d2 - ]; -} -function x140() { - return [ - d1, - d2 - ]; -} -function x141() { - return [ - d1, - d2 - ]; -} -function x142() { - return { - n: [ - d1, - d2 - ] - }; -} -function x143() { - return function (n) { - var n; - return null; - }; -} -function x144() { - return { - func: function (n) { - return [ - d1, - d2 - ]; - } - }; -} -function x145() { - return function () { - return [ - d1, - d2 - ]; - }; - return function () { - return [ - d1, - d2 - ]; - }; -} -function x146() { - return function () { - return [ - d1, - d2 - ]; - }; - return function () { - return [ - d1, - d2 - ]; - }; -} -function x147() { - return function named() { - return [ - d1, - d2 - ]; - }; - return function named() { - return [ - d1, - d2 - ]; - }; -} -function x148() { - return function () { - return [ - d1, - d2 - ]; - }; - return function () { - return [ - d1, - d2 - ]; - }; -} -function x149() { - return function () { - return [ - d1, - d2 - ]; - }; - return function () { - return [ - d1, - d2 - ]; - }; -} -function x150() { - return function named() { - return [ - d1, - d2 - ]; - }; - return function named() { - return [ - d1, - d2 - ]; - }; -} -function x151() { - return [ - d1, - d2 - ]; - return [ - d1, - d2 - ]; -} -function x152() { - return [ - d1, - d2 - ]; - return [ - d1, - d2 - ]; -} -function x153() { - return [ - d1, - d2 - ]; - return [ - d1, - d2 - ]; -} -function x154() { - return { - n: [ - d1, - d2 - ] - }; - return { - n: [ - d1, - d2 - ] - }; -} -function x155() { - return function (n) { - var n; - return null; - }; - return function (n) { - var n; - return null; - }; -} -function x156() { - return { - func: function (n) { - return [ - d1, - d2 - ]; - } - }; - return { - func: function (n) { - return [ - d1, - d2 - ]; - } - }; -} -var x157 = function () { - return function () { - return [ - d1, - d2 - ]; - }; -}; -var x158 = function () { - return function () { - return [ - d1, - d2 - ]; - }; -}; -var x159 = function () { - return function named() { - return [ - d1, - d2 - ]; - }; -}; -var x160 = function () { - return function () { - return [ - d1, - d2 - ]; - }; -}; -var x161 = function () { - return function () { - return [ - d1, - d2 - ]; - }; -}; -var x162 = function () { - return function named() { - return [ - d1, - d2 - ]; - }; -}; -var x163 = function () { - return [ - d1, - d2 - ]; -}; -var x164 = function () { - return [ - d1, - d2 - ]; -}; -var x165 = function () { - return [ - d1, - d2 - ]; -}; -var x166 = function () { - return { - n: [ - d1, - d2 - ] - }; -}; -var x167 = function () { - return function (n) { - var n; - return null; - }; -}; -var x168 = function () { - return { - func: function (n) { - return [ - d1, - d2 - ]; - } - }; -}; -var x169 = function () { - return function () { - return [ - d1, - d2 - ]; - }; -}; -var x170 = function () { - return function () { - return [ - d1, - d2 - ]; - }; -}; -var x171 = function () { - return function named() { - return [ - d1, - d2 - ]; - }; -}; -var x172 = function () { - return function () { - return [ - d1, - d2 - ]; - }; -}; -var x173 = function () { - return function () { - return [ - d1, - d2 - ]; - }; -}; -var x174 = function () { - return function named() { - return [ - d1, - d2 - ]; - }; -}; -var x175 = function () { - return [ - d1, - d2 - ]; -}; -var x176 = function () { - return [ - d1, - d2 - ]; -}; -var x177 = function () { - return [ - d1, - d2 - ]; -}; -var x178 = function () { - return { - n: [ - d1, - d2 - ] - }; -}; -var x179 = function () { - return function (n) { - var n; - return null; - }; -}; -var x180 = function () { - return { - func: function (n) { - return [ - d1, - d2 - ]; - } - }; -}; +function x133() { return function () { return [d1, d2]; }; } +function x134() { return function () { return [d1, d2]; }; } +function x135() { return function named() { return [d1, d2]; }; } +function x136() { return function () { return [d1, d2]; }; } +function x137() { return function () { return [d1, d2]; }; } +function x138() { return function named() { return [d1, d2]; }; } +function x139() { return [d1, d2]; } +function x140() { return [d1, d2]; } +function x141() { return [d1, d2]; } +function x142() { return { n: [d1, d2] }; } +function x143() { return function (n) { var n; return null; }; } +function x144() { return { func: function (n) { return [d1, d2]; } }; } +function x145() { return function () { return [d1, d2]; }; return function () { return [d1, d2]; }; } +function x146() { return function () { return [d1, d2]; }; return function () { return [d1, d2]; }; } +function x147() { return function named() { return [d1, d2]; }; return function named() { return [d1, d2]; }; } +function x148() { return function () { return [d1, d2]; }; return function () { return [d1, d2]; }; } +function x149() { return function () { return [d1, d2]; }; return function () { return [d1, d2]; }; } +function x150() { return function named() { return [d1, d2]; }; return function named() { return [d1, d2]; }; } +function x151() { return [d1, d2]; return [d1, d2]; } +function x152() { return [d1, d2]; return [d1, d2]; } +function x153() { return [d1, d2]; return [d1, d2]; } +function x154() { return { n: [d1, d2] }; return { n: [d1, d2] }; } +function x155() { return function (n) { var n; return null; }; return function (n) { var n; return null; }; } +function x156() { return { func: function (n) { return [d1, d2]; } }; return { func: function (n) { return [d1, d2]; } }; } +var x157 = function () { return function () { return [d1, d2]; }; }; +var x158 = function () { return function () { return [d1, d2]; }; }; +var x159 = function () { return function named() { return [d1, d2]; }; }; +var x160 = function () { return function () { return [d1, d2]; }; }; +var x161 = function () { return function () { return [d1, d2]; }; }; +var x162 = function () { return function named() { return [d1, d2]; }; }; +var x163 = function () { return [d1, d2]; }; +var x164 = function () { return [d1, d2]; }; +var x165 = function () { return [d1, d2]; }; +var x166 = function () { return { n: [d1, d2] }; }; +var x167 = function () { return function (n) { var n; return null; }; }; +var x168 = function () { return { func: function (n) { return [d1, d2]; } }; }; +var x169 = function () { return function () { return [d1, d2]; }; }; +var x170 = function () { return function () { return [d1, d2]; }; }; +var x171 = function () { return function named() { return [d1, d2]; }; }; +var x172 = function () { return function () { return [d1, d2]; }; }; +var x173 = function () { return function () { return [d1, d2]; }; }; +var x174 = function () { return function named() { return [d1, d2]; }; }; +var x175 = function () { return [d1, d2]; }; +var x176 = function () { return [d1, d2]; }; +var x177 = function () { return [d1, d2]; }; +var x178 = function () { return { n: [d1, d2] }; }; +var x179 = function () { return function (n) { var n; return null; }; }; +var x180 = function () { return { func: function (n) { return [d1, d2]; } }; }; var x181; (function (x181) { - var t = function () { - return [ - d1, - d2 - ]; - }; + var t = function () { return [d1, d2]; }; })(x181 || (x181 = {})); var x182; (function (x182) { - var t = function () { - return [ - d1, - d2 - ]; - }; + var t = function () { return [d1, d2]; }; })(x182 || (x182 = {})); var x183; (function (x183) { - var t = function named() { - return [ - d1, - d2 - ]; - }; + var t = function named() { return [d1, d2]; }; })(x183 || (x183 = {})); var x184; (function (x184) { - var t = function () { - return [ - d1, - d2 - ]; - }; + var t = function () { return [d1, d2]; }; })(x184 || (x184 = {})); var x185; (function (x185) { - var t = function () { - return [ - d1, - d2 - ]; - }; + var t = function () { return [d1, d2]; }; })(x185 || (x185 = {})); var x186; (function (x186) { - var t = function named() { - return [ - d1, - d2 - ]; - }; + var t = function named() { return [d1, d2]; }; })(x186 || (x186 = {})); var x187; (function (x187) { - var t = [ - d1, - d2 - ]; + var t = [d1, d2]; })(x187 || (x187 = {})); var x188; (function (x188) { - var t = [ - d1, - d2 - ]; + var t = [d1, d2]; })(x188 || (x188 = {})); var x189; (function (x189) { - var t = [ - d1, - d2 - ]; + var t = [d1, d2]; })(x189 || (x189 = {})); var x190; (function (x190) { - var t = { - n: [ - d1, - d2 - ] - }; + var t = { n: [d1, d2] }; })(x190 || (x190 = {})); var x191; (function (x191) { - var t = function (n) { - var n; - return null; - }; + var t = function (n) { var n; return null; }; })(x191 || (x191 = {})); var x192; (function (x192) { - var t = { - func: function (n) { - return [ - d1, - d2 - ]; - } - }; + var t = { func: function (n) { return [d1, d2]; } }; })(x192 || (x192 = {})); var x193; (function (x193) { - x193.t = function () { - return [ - d1, - d2 - ]; - }; + x193.t = function () { return [d1, d2]; }; })(x193 || (x193 = {})); var x194; (function (x194) { - x194.t = function () { - return [ - d1, - d2 - ]; - }; + x194.t = function () { return [d1, d2]; }; })(x194 || (x194 = {})); var x195; (function (x195) { - x195.t = function named() { - return [ - d1, - d2 - ]; - }; + x195.t = function named() { return [d1, d2]; }; })(x195 || (x195 = {})); var x196; (function (x196) { - x196.t = function () { - return [ - d1, - d2 - ]; - }; + x196.t = function () { return [d1, d2]; }; })(x196 || (x196 = {})); var x197; (function (x197) { - x197.t = function () { - return [ - d1, - d2 - ]; - }; + x197.t = function () { return [d1, d2]; }; })(x197 || (x197 = {})); var x198; (function (x198) { - x198.t = function named() { - return [ - d1, - d2 - ]; - }; + x198.t = function named() { return [d1, d2]; }; })(x198 || (x198 = {})); var x199; (function (x199) { - x199.t = [ - d1, - d2 - ]; + x199.t = [d1, d2]; })(x199 || (x199 = {})); var x200; (function (x200) { - x200.t = [ - d1, - d2 - ]; + x200.t = [d1, d2]; })(x200 || (x200 = {})); var x201; (function (x201) { - x201.t = [ - d1, - d2 - ]; + x201.t = [d1, d2]; })(x201 || (x201 = {})); var x202; (function (x202) { - x202.t = { - n: [ - d1, - d2 - ] - }; + x202.t = { n: [d1, d2] }; })(x202 || (x202 = {})); var x203; (function (x203) { - x203.t = function (n) { - var n; - return null; - }; + x203.t = function (n) { var n; return null; }; })(x203 || (x203 = {})); var x204; (function (x204) { - x204.t = { - func: function (n) { - return [ - d1, - d2 - ]; - } - }; + x204.t = { func: function (n) { return [d1, d2]; } }; })(x204 || (x204 = {})); -var x206 = function () { - return [ - d1, - d2 - ]; -}; -var x207 = function named() { - return [ - d1, - d2 - ]; -}; -var x209 = function () { - return [ - d1, - d2 - ]; -}; -var x210 = function named() { - return [ - d1, - d2 - ]; -}; -var x211 = [ - d1, - d2 -]; -var x212 = [ - d1, - d2 -]; -var x213 = [ - d1, - d2 -]; -var x214 = { - n: [ - d1, - d2 - ] -}; -var x216 = { - func: function (n) { - return [ - d1, - d2 - ]; - } -}; -var x217 = undefined || function () { - return [ - d1, - d2 - ]; -}; -var x218 = undefined || function named() { - return [ - d1, - d2 - ]; -}; -var x219 = undefined || function () { - return [ - d1, - d2 - ]; -}; -var x220 = undefined || function named() { - return [ - d1, - d2 - ]; -}; -var x221 = undefined || [ - d1, - d2 -]; -var x222 = undefined || [ - d1, - d2 -]; -var x223 = undefined || [ - d1, - d2 -]; -var x224 = undefined || { - n: [ - d1, - d2 - ] -}; +var x206 = function () { return [d1, d2]; }; +var x207 = function named() { return [d1, d2]; }; +var x209 = function () { return [d1, d2]; }; +var x210 = function named() { return [d1, d2]; }; +var x211 = [d1, d2]; +var x212 = [d1, d2]; +var x213 = [d1, d2]; +var x214 = { n: [d1, d2] }; +var x216 = { func: function (n) { return [d1, d2]; } }; +var x217 = undefined || function () { return [d1, d2]; }; +var x218 = undefined || function named() { return [d1, d2]; }; +var x219 = undefined || function () { return [d1, d2]; }; +var x220 = undefined || function named() { return [d1, d2]; }; +var x221 = undefined || [d1, d2]; +var x222 = undefined || [d1, d2]; +var x223 = undefined || [d1, d2]; +var x224 = undefined || { n: [d1, d2] }; var x225; -x225 = function () { - return [ - d1, - d2 - ]; -}; +x225 = function () { return [d1, d2]; }; var x226; -x226 = function () { - return [ - d1, - d2 - ]; -}; +x226 = function () { return [d1, d2]; }; var x227; -x227 = function named() { - return [ - d1, - d2 - ]; -}; +x227 = function named() { return [d1, d2]; }; var x228; -x228 = function () { - return [ - d1, - d2 - ]; -}; +x228 = function () { return [d1, d2]; }; var x229; -x229 = function () { - return [ - d1, - d2 - ]; -}; +x229 = function () { return [d1, d2]; }; var x230; -x230 = function named() { - return [ - d1, - d2 - ]; -}; +x230 = function named() { return [d1, d2]; }; var x231; -x231 = [ - d1, - d2 -]; +x231 = [d1, d2]; var x232; -x232 = [ - d1, - d2 -]; +x232 = [d1, d2]; var x233; -x233 = [ - d1, - d2 -]; +x233 = [d1, d2]; var x234; -x234 = { - n: [ - d1, - d2 - ] -}; +x234 = { n: [d1, d2] }; var x235; -x235 = function (n) { - var n; - return null; -}; +x235 = function (n) { var n; return null; }; var x236; -x236 = { - func: function (n) { - return [ - d1, - d2 - ]; - } -}; -var x237 = { - n: function () { - return [ - d1, - d2 - ]; - } -}; -var x238 = { - n: function () { - return [ - d1, - d2 - ]; - } -}; -var x239 = { - n: function named() { - return [ - d1, - d2 - ]; - } -}; -var x240 = { - n: function () { - return [ - d1, - d2 - ]; - } -}; -var x241 = { - n: function () { - return [ - d1, - d2 - ]; - } -}; -var x242 = { - n: function named() { - return [ - d1, - d2 - ]; - } -}; -var x243 = { - n: [ - d1, - d2 - ] -}; -var x244 = { - n: [ - d1, - d2 - ] -}; -var x245 = { - n: [ - d1, - d2 - ] -}; -var x246 = { - n: { - n: [ - d1, - d2 - ] - } -}; -var x247 = { - n: function (n) { - var n; - return null; - } -}; -var x248 = { - n: { - func: function (n) { - return [ - d1, - d2 - ]; - } - } -}; -var x252 = [ - function () { - return [ - d1, - d2 - ]; - } -]; -var x253 = [ - function () { - return [ - d1, - d2 - ]; - } -]; -var x254 = [ - function named() { - return [ - d1, - d2 - ]; - } -]; -var x255 = [ - [ - d1, - d2 - ] -]; -var x256 = [ - [ - d1, - d2 - ] -]; -var x257 = [ - [ - d1, - d2 - ] -]; -var x258 = [ - { - n: [ - d1, - d2 - ] - } -]; -var x260 = [ - { - func: function (n) { - return [ - d1, - d2 - ]; - } - } -]; -var x261 = function () { - return [ - d1, - d2 - ]; -} || undefined; -var x262 = function named() { - return [ - d1, - d2 - ]; -} || undefined; -var x263 = function () { - return [ - d1, - d2 - ]; -} || undefined; -var x264 = function named() { - return [ - d1, - d2 - ]; -} || undefined; -var x265 = [ - d1, - d2 -] || undefined; -var x266 = [ - d1, - d2 -] || undefined; -var x267 = [ - d1, - d2 -] || undefined; -var x268 = { - n: [ - d1, - d2 - ] -} || undefined; -var x269 = undefined || function () { - return [ - d1, - d2 - ]; -}; -var x270 = undefined || function named() { - return [ - d1, - d2 - ]; -}; -var x271 = undefined || function () { - return [ - d1, - d2 - ]; -}; -var x272 = undefined || function named() { - return [ - d1, - d2 - ]; -}; -var x273 = undefined || [ - d1, - d2 -]; -var x274 = undefined || [ - d1, - d2 -]; -var x275 = undefined || [ - d1, - d2 -]; -var x276 = undefined || { - n: [ - d1, - d2 - ] -}; -var x277 = function () { - return [ - d1, - d2 - ]; -} || function () { - return [ - d1, - d2 - ]; -}; -var x278 = function named() { - return [ - d1, - d2 - ]; -} || function named() { - return [ - d1, - d2 - ]; -}; -var x279 = function () { - return [ - d1, - d2 - ]; -} || function () { - return [ - d1, - d2 - ]; -}; -var x280 = function named() { - return [ - d1, - d2 - ]; -} || function named() { - return [ - d1, - d2 - ]; -}; -var x281 = [ - d1, - d2 -] || [ - d1, - d2 -]; -var x282 = [ - d1, - d2 -] || [ - d1, - d2 -]; -var x283 = [ - d1, - d2 -] || [ - d1, - d2 -]; -var x284 = { - n: [ - d1, - d2 - ] -} || { - n: [ - d1, - d2 - ] -}; -var x285 = true ? function () { - return [ - d1, - d2 - ]; -} : function () { - return [ - d1, - d2 - ]; -}; -var x286 = true ? function () { - return [ - d1, - d2 - ]; -} : function () { - return [ - d1, - d2 - ]; -}; -var x287 = true ? function named() { - return [ - d1, - d2 - ]; -} : function named() { - return [ - d1, - d2 - ]; -}; -var x288 = true ? function () { - return [ - d1, - d2 - ]; -} : function () { - return [ - d1, - d2 - ]; -}; -var x289 = true ? function () { - return [ - d1, - d2 - ]; -} : function () { - return [ - d1, - d2 - ]; -}; -var x290 = true ? function named() { - return [ - d1, - d2 - ]; -} : function named() { - return [ - d1, - d2 - ]; -}; -var x291 = true ? [ - d1, - d2 -] : [ - d1, - d2 -]; -var x292 = true ? [ - d1, - d2 -] : [ - d1, - d2 -]; -var x293 = true ? [ - d1, - d2 -] : [ - d1, - d2 -]; -var x294 = true ? { - n: [ - d1, - d2 - ] -} : { - n: [ - d1, - d2 - ] -}; -var x295 = true ? function (n) { - var n; - return null; -} : function (n) { - var n; - return null; -}; -var x296 = true ? { - func: function (n) { - return [ - d1, - d2 - ]; - } -} : { - func: function (n) { - return [ - d1, - d2 - ]; - } -}; -var x297 = true ? undefined : function () { - return [ - d1, - d2 - ]; -}; -var x298 = true ? undefined : function () { - return [ - d1, - d2 - ]; -}; -var x299 = true ? undefined : function named() { - return [ - d1, - d2 - ]; -}; -var x300 = true ? undefined : function () { - return [ - d1, - d2 - ]; -}; -var x301 = true ? undefined : function () { - return [ - d1, - d2 - ]; -}; -var x302 = true ? undefined : function named() { - return [ - d1, - d2 - ]; -}; -var x303 = true ? undefined : [ - d1, - d2 -]; -var x304 = true ? undefined : [ - d1, - d2 -]; -var x305 = true ? undefined : [ - d1, - d2 -]; -var x306 = true ? undefined : { - n: [ - d1, - d2 - ] -}; -var x307 = true ? undefined : function (n) { - var n; - return null; -}; -var x308 = true ? undefined : { - func: function (n) { - return [ - d1, - d2 - ]; - } -}; -var x309 = true ? function () { - return [ - d1, - d2 - ]; -} : undefined; -var x310 = true ? function () { - return [ - d1, - d2 - ]; -} : undefined; -var x311 = true ? function named() { - return [ - d1, - d2 - ]; -} : undefined; -var x312 = true ? function () { - return [ - d1, - d2 - ]; -} : undefined; -var x313 = true ? function () { - return [ - d1, - d2 - ]; -} : undefined; -var x314 = true ? function named() { - return [ - d1, - d2 - ]; -} : undefined; -var x315 = true ? [ - d1, - d2 -] : undefined; -var x316 = true ? [ - d1, - d2 -] : undefined; -var x317 = true ? [ - d1, - d2 -] : undefined; -var x318 = true ? { - n: [ - d1, - d2 - ] -} : undefined; -var x319 = true ? function (n) { - var n; - return null; -} : undefined; -var x320 = true ? { - func: function (n) { - return [ - d1, - d2 - ]; - } -} : undefined; -function x321(n) { -} +x236 = { func: function (n) { return [d1, d2]; } }; +var x237 = { n: function () { return [d1, d2]; } }; +var x238 = { n: function () { return [d1, d2]; } }; +var x239 = { n: function named() { return [d1, d2]; } }; +var x240 = { n: function () { return [d1, d2]; } }; +var x241 = { n: function () { return [d1, d2]; } }; +var x242 = { n: function named() { return [d1, d2]; } }; +var x243 = { n: [d1, d2] }; +var x244 = { n: [d1, d2] }; +var x245 = { n: [d1, d2] }; +var x246 = { n: { n: [d1, d2] } }; +var x247 = { n: function (n) { var n; return null; } }; +var x248 = { n: { func: function (n) { return [d1, d2]; } } }; +var x252 = [function () { return [d1, d2]; }]; +var x253 = [function () { return [d1, d2]; }]; +var x254 = [function named() { return [d1, d2]; }]; +var x255 = [[d1, d2]]; +var x256 = [[d1, d2]]; +var x257 = [[d1, d2]]; +var x258 = [{ n: [d1, d2] }]; +var x260 = [{ func: function (n) { return [d1, d2]; } }]; +var x261 = function () { return [d1, d2]; } || undefined; +var x262 = function named() { return [d1, d2]; } || undefined; +var x263 = function () { return [d1, d2]; } || undefined; +var x264 = function named() { return [d1, d2]; } || undefined; +var x265 = [d1, d2] || undefined; +var x266 = [d1, d2] || undefined; +var x267 = [d1, d2] || undefined; +var x268 = { n: [d1, d2] } || undefined; +var x269 = undefined || function () { return [d1, d2]; }; +var x270 = undefined || function named() { return [d1, d2]; }; +var x271 = undefined || function () { return [d1, d2]; }; +var x272 = undefined || function named() { return [d1, d2]; }; +var x273 = undefined || [d1, d2]; +var x274 = undefined || [d1, d2]; +var x275 = undefined || [d1, d2]; +var x276 = undefined || { n: [d1, d2] }; +var x277 = function () { return [d1, d2]; } || function () { return [d1, d2]; }; +var x278 = function named() { return [d1, d2]; } || function named() { return [d1, d2]; }; +var x279 = function () { return [d1, d2]; } || function () { return [d1, d2]; }; +var x280 = function named() { return [d1, d2]; } || function named() { return [d1, d2]; }; +var x281 = [d1, d2] || [d1, d2]; +var x282 = [d1, d2] || [d1, d2]; +var x283 = [d1, d2] || [d1, d2]; +var x284 = { n: [d1, d2] } || { n: [d1, d2] }; +var x285 = true ? function () { return [d1, d2]; } : function () { return [d1, d2]; }; +var x286 = true ? function () { return [d1, d2]; } : function () { return [d1, d2]; }; +var x287 = true ? function named() { return [d1, d2]; } : function named() { return [d1, d2]; }; +var x288 = true ? function () { return [d1, d2]; } : function () { return [d1, d2]; }; +var x289 = true ? function () { return [d1, d2]; } : function () { return [d1, d2]; }; +var x290 = true ? function named() { return [d1, d2]; } : function named() { return [d1, d2]; }; +var x291 = true ? [d1, d2] : [d1, d2]; +var x292 = true ? [d1, d2] : [d1, d2]; +var x293 = true ? [d1, d2] : [d1, d2]; +var x294 = true ? { n: [d1, d2] } : { n: [d1, d2] }; +var x295 = true ? function (n) { var n; return null; } : function (n) { var n; return null; }; +var x296 = true ? { func: function (n) { return [d1, d2]; } } : { func: function (n) { return [d1, d2]; } }; +var x297 = true ? undefined : function () { return [d1, d2]; }; +var x298 = true ? undefined : function () { return [d1, d2]; }; +var x299 = true ? undefined : function named() { return [d1, d2]; }; +var x300 = true ? undefined : function () { return [d1, d2]; }; +var x301 = true ? undefined : function () { return [d1, d2]; }; +var x302 = true ? undefined : function named() { return [d1, d2]; }; +var x303 = true ? undefined : [d1, d2]; +var x304 = true ? undefined : [d1, d2]; +var x305 = true ? undefined : [d1, d2]; +var x306 = true ? undefined : { n: [d1, d2] }; +var x307 = true ? undefined : function (n) { var n; return null; }; +var x308 = true ? undefined : { func: function (n) { return [d1, d2]; } }; +var x309 = true ? function () { return [d1, d2]; } : undefined; +var x310 = true ? function () { return [d1, d2]; } : undefined; +var x311 = true ? function named() { return [d1, d2]; } : undefined; +var x312 = true ? function () { return [d1, d2]; } : undefined; +var x313 = true ? function () { return [d1, d2]; } : undefined; +var x314 = true ? function named() { return [d1, d2]; } : undefined; +var x315 = true ? [d1, d2] : undefined; +var x316 = true ? [d1, d2] : undefined; +var x317 = true ? [d1, d2] : undefined; +var x318 = true ? { n: [d1, d2] } : undefined; +var x319 = true ? function (n) { var n; return null; } : undefined; +var x320 = true ? { func: function (n) { return [d1, d2]; } } : undefined; +function x321(n) { } ; -x321(function () { - return [ - d1, - d2 - ]; -}); -function x322(n) { -} +x321(function () { return [d1, d2]; }); +function x322(n) { } ; -x322(function () { - return [ - d1, - d2 - ]; -}); -function x323(n) { -} +x322(function () { return [d1, d2]; }); +function x323(n) { } ; -x323(function named() { - return [ - d1, - d2 - ]; -}); -function x324(n) { -} +x323(function named() { return [d1, d2]; }); +function x324(n) { } ; -x324(function () { - return [ - d1, - d2 - ]; -}); -function x325(n) { -} +x324(function () { return [d1, d2]; }); +function x325(n) { } ; -x325(function () { - return [ - d1, - d2 - ]; -}); -function x326(n) { -} +x325(function () { return [d1, d2]; }); +function x326(n) { } ; -x326(function named() { - return [ - d1, - d2 - ]; -}); -function x327(n) { -} +x326(function named() { return [d1, d2]; }); +function x327(n) { } ; -x327([ - d1, - d2 -]); -function x328(n) { -} +x327([d1, d2]); +function x328(n) { } ; -x328([ - d1, - d2 -]); -function x329(n) { -} +x328([d1, d2]); +function x329(n) { } ; -x329([ - d1, - d2 -]); -function x330(n) { -} +x329([d1, d2]); +function x330(n) { } ; -x330({ - n: [ - d1, - d2 - ] -}); -function x331(n) { -} +x330({ n: [d1, d2] }); +function x331(n) { } ; -x331(function (n) { - var n; - return null; -}); -function x332(n) { -} +x331(function (n) { var n; return null; }); +function x332(n) { } ; -x332({ - func: function (n) { - return [ - d1, - d2 - ]; - } -}); -var x333 = function (n) { - return n; -}; -x333(function () { - return [ - d1, - d2 - ]; -}); -var x334 = function (n) { - return n; -}; -x334(function () { - return [ - d1, - d2 - ]; -}); -var x335 = function (n) { - return n; -}; -x335(function named() { - return [ - d1, - d2 - ]; -}); -var x336 = function (n) { - return n; -}; -x336(function () { - return [ - d1, - d2 - ]; -}); -var x337 = function (n) { - return n; -}; -x337(function () { - return [ - d1, - d2 - ]; -}); -var x338 = function (n) { - return n; -}; -x338(function named() { - return [ - d1, - d2 - ]; -}); -var x339 = function (n) { - return n; -}; -x339([ - d1, - d2 -]); -var x340 = function (n) { - return n; -}; -x340([ - d1, - d2 -]); -var x341 = function (n) { - return n; -}; -x341([ - d1, - d2 -]); -var x342 = function (n) { - return n; -}; -x342({ - n: [ - d1, - d2 - ] -}); -var x343 = function (n) { - return n; -}; -x343(function (n) { - var n; - return null; -}); -var x344 = function (n) { - return n; -}; -x344({ - func: function (n) { - return [ - d1, - d2 - ]; - } -}); -var x345 = function (n) { -}; -x345(function () { - return [ - d1, - d2 - ]; -}); -var x346 = function (n) { -}; -x346(function () { - return [ - d1, - d2 - ]; -}); -var x347 = function (n) { -}; -x347(function named() { - return [ - d1, - d2 - ]; -}); -var x348 = function (n) { -}; -x348(function () { - return [ - d1, - d2 - ]; -}); -var x349 = function (n) { -}; -x349(function () { - return [ - d1, - d2 - ]; -}); -var x350 = function (n) { -}; -x350(function named() { - return [ - d1, - d2 - ]; -}); -var x351 = function (n) { -}; -x351([ - d1, - d2 -]); -var x352 = function (n) { -}; -x352([ - d1, - d2 -]); -var x353 = function (n) { -}; -x353([ - d1, - d2 -]); -var x354 = function (n) { -}; -x354({ - n: [ - d1, - d2 - ] -}); -var x355 = function (n) { -}; -x355(function (n) { - var n; - return null; -}); -var x356 = function (n) { -}; -x356({ - func: function (n) { - return [ - d1, - d2 - ]; - } -}); +x332({ func: function (n) { return [d1, d2]; } }); +var x333 = function (n) { return n; }; +x333(function () { return [d1, d2]; }); +var x334 = function (n) { return n; }; +x334(function () { return [d1, d2]; }); +var x335 = function (n) { return n; }; +x335(function named() { return [d1, d2]; }); +var x336 = function (n) { return n; }; +x336(function () { return [d1, d2]; }); +var x337 = function (n) { return n; }; +x337(function () { return [d1, d2]; }); +var x338 = function (n) { return n; }; +x338(function named() { return [d1, d2]; }); +var x339 = function (n) { return n; }; +x339([d1, d2]); +var x340 = function (n) { return n; }; +x340([d1, d2]); +var x341 = function (n) { return n; }; +x341([d1, d2]); +var x342 = function (n) { return n; }; +x342({ n: [d1, d2] }); +var x343 = function (n) { return n; }; +x343(function (n) { var n; return null; }); +var x344 = function (n) { return n; }; +x344({ func: function (n) { return [d1, d2]; } }); +var x345 = function (n) { }; +x345(function () { return [d1, d2]; }); +var x346 = function (n) { }; +x346(function () { return [d1, d2]; }); +var x347 = function (n) { }; +x347(function named() { return [d1, d2]; }); +var x348 = function (n) { }; +x348(function () { return [d1, d2]; }); +var x349 = function (n) { }; +x349(function () { return [d1, d2]; }); +var x350 = function (n) { }; +x350(function named() { return [d1, d2]; }); +var x351 = function (n) { }; +x351([d1, d2]); +var x352 = function (n) { }; +x352([d1, d2]); +var x353 = function (n) { }; +x353([d1, d2]); +var x354 = function (n) { }; +x354({ n: [d1, d2] }); +var x355 = function (n) { }; +x355(function (n) { var n; return null; }); +var x356 = function (n) { }; +x356({ func: function (n) { return [d1, d2]; } }); diff --git a/tests/baselines/reference/generativeRecursionWithTypeOf.js b/tests/baselines/reference/generativeRecursionWithTypeOf.js index 599751ebde7..2b7eebfd11c 100644 --- a/tests/baselines/reference/generativeRecursionWithTypeOf.js +++ b/tests/baselines/reference/generativeRecursionWithTypeOf.js @@ -14,8 +14,7 @@ module M { var C = (function () { function C() { } - C.foo = function (x) { - }; + C.foo = function (x) { }; return C; })(); var M; diff --git a/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.js b/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.js index 321400fc24d..dd06b855b68 100644 --- a/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.js +++ b/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.js @@ -23,13 +23,6 @@ _.all([true], _.identity); //// [genericArgumentCallSigAssignmentCompat.js] // No error, Call signatures of types '(value: T) => T' and 'Underscore.Iterator<{}, boolean>' are compatible when instantiated with any. // Ideally, we would not have a generic signature here, because it should be instantiated with {} during inferential typing -_.all([ - true, - 1, - null, - 'yes' -], _.identity); +_.all([true, 1, null, 'yes'], _.identity); // Ok, because fixing makes us infer boolean for T -_.all([ - true -], _.identity); +_.all([true], _.identity); diff --git a/tests/baselines/reference/genericArray1.js b/tests/baselines/reference/genericArray1.js index e698d339073..b0bfcd2201a 100644 --- a/tests/baselines/reference/genericArray1.js +++ b/tests/baselines/reference/genericArray1.js @@ -26,13 +26,7 @@ interface String{ length: number; } */ -var lengths = [ - "a", - "b", - "c" -].map(function (x) { - return x.length; -}); +var lengths = ["a", "b", "c"].map(function (x) { return x.length; }); //// [genericArray1.d.ts] diff --git a/tests/baselines/reference/genericArrayMethods1.js b/tests/baselines/reference/genericArrayMethods1.js index e6cebcb220e..c7fca1ee6b7 100644 --- a/tests/baselines/reference/genericArrayMethods1.js +++ b/tests/baselines/reference/genericArrayMethods1.js @@ -3,7 +3,4 @@ var x:string[] = [0,1].slice(0); // this should be an error //// [genericArrayMethods1.js] -var x = [ - 0, - 1 -].slice(0); // this should be an error +var x = [0, 1].slice(0); // this should be an error diff --git a/tests/baselines/reference/genericAssignmentCompatOfFunctionSignatures1.js b/tests/baselines/reference/genericAssignmentCompatOfFunctionSignatures1.js index 6f1928a2601..9b7d5b713e9 100644 --- a/tests/baselines/reference/genericAssignmentCompatOfFunctionSignatures1.js +++ b/tests/baselines/reference/genericAssignmentCompatOfFunctionSignatures1.js @@ -6,9 +6,7 @@ x1 = x2; x2 = x1; //// [genericAssignmentCompatOfFunctionSignatures1.js] -var x1 = function foo3(x, z) { -}; -var x2 = function foo3(x, z) { -}; +var x1 = function foo3(x, z) { }; +var x2 = function foo3(x, z) { }; x1 = x2; x2 = x1; diff --git a/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.js b/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.js index 7f82cc6afb3..70f70ae07ba 100644 --- a/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.js +++ b/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.js @@ -23,21 +23,13 @@ var a4: I = >z; var A = (function () { function A() { } - A.prototype.compareTo = function (other) { - return 1; - }; + A.prototype.compareTo = function (other) { return 1; }; return A; })(); -var z = { - x: new A() -}; -var a1 = { - x: new A() -}; +var z = { x: new A() }; +var a1 = { x: new A() }; var a2 = function () { - var z = { - x: new A() - }; + var z = { x: new A() }; return z; }(); var a3 = z; diff --git a/tests/baselines/reference/genericCallWithArrayLiteralArgs.js b/tests/baselines/reference/genericCallWithArrayLiteralArgs.js index ebc49f37c0d..ba8c2884fff 100644 --- a/tests/baselines/reference/genericCallWithArrayLiteralArgs.js +++ b/tests/baselines/reference/genericCallWithArrayLiteralArgs.js @@ -17,29 +17,11 @@ var r6 = foo([1, '']); // Object[] function foo(t) { return t; } -var r = foo([ - 1, - 2 -]); // number[] -var r = foo([ - 1, - 2 -]); // number[] -var ra = foo([ - 1, - 2 -]); // any[] +var r = foo([1, 2]); // number[] +var r = foo([1, 2]); // number[] +var ra = foo([1, 2]); // any[] var r2 = foo([]); // any[] var r3 = foo([]); // number[] -var r4 = foo([ - 1, - '' -]); // {}[] -var r5 = foo([ - 1, - '' -]); // any[] -var r6 = foo([ - 1, - '' -]); // Object[] +var r4 = foo([1, '']); // {}[] +var r5 = foo([1, '']); // any[] +var r6 = foo([1, '']); // Object[] diff --git a/tests/baselines/reference/genericCallWithFixedArguments.js b/tests/baselines/reference/genericCallWithFixedArguments.js index 10c0e2b496b..e588c0d113d 100644 --- a/tests/baselines/reference/genericCallWithFixedArguments.js +++ b/tests/baselines/reference/genericCallWithFixedArguments.js @@ -11,17 +11,14 @@ g(7) // the parameter list is fixed, so this should not error var A = (function () { function A() { } - A.prototype.foo = function () { - }; + A.prototype.foo = function () { }; return A; })(); var B = (function () { function B() { } - B.prototype.bar = function () { - }; + B.prototype.bar = function () { }; return B; })(); -function g(x) { -} +function g(x) { } g(7); // the parameter list is fixed, so this should not error diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments.js b/tests/baselines/reference/genericCallWithFunctionTypedArguments.js index b6f2839bae1..30d4ed353ff 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments.js +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments.js @@ -42,53 +42,25 @@ function other(t: T, u: U) { function foo(x) { return x(null); } -var r = foo(function (x) { - return ''; -}); // {} -var r2 = foo(function (x) { - return ''; -}); // string -var r3 = foo(function (x) { - return ''; -}); // {} +var r = foo(function (x) { return ''; }); // {} +var r2 = foo(function (x) { return ''; }); // string +var r3 = foo(function (x) { return ''; }); // {} function foo2(x, cb) { return cb(x); } -var r4 = foo2(1, function (a) { - return ''; -}); // string, contextual signature instantiation is applied to generic functions -var r5 = foo2(1, function (a) { - return ''; -}); // string -var r6 = foo2('', function (a) { - return 1; -}); +var r4 = foo2(1, function (a) { return ''; }); // string, contextual signature instantiation is applied to generic functions +var r5 = foo2(1, function (a) { return ''; }); // string +var r6 = foo2('', function (a) { return 1; }); function foo3(x, cb, y) { return cb(x); } -var r7 = foo3(1, function (a) { - return ''; -}, ''); // string -var r8 = foo3(1, function (a) { - return ''; -}, 1); // error -var r9 = foo3(1, function (a) { - return ''; -}, ''); // string +var r7 = foo3(1, function (a) { return ''; }, ''); // string +var r8 = foo3(1, function (a) { return ''; }, 1); // error +var r9 = foo3(1, function (a) { return ''; }, ''); // string function other(t, u) { - var r10 = foo2(1, function (x) { - return ''; - }); // error - var r10 = foo2(1, function (x) { - return ''; - }); // string - var r11 = foo3(1, function (x) { - return ''; - }, ''); // error - var r11b = foo3(1, function (x) { - return ''; - }, 1); // error - var r12 = foo3(1, function (a) { - return ''; - }, 1); // error + var r10 = foo2(1, function (x) { return ''; }); // error + var r10 = foo2(1, function (x) { return ''; }); // string + var r11 = foo3(1, function (x) { return ''; }, ''); // error + var r11b = foo3(1, function (x) { return ''; }, 1); // error + var r12 = foo3(1, function (a) { return ''; }, 1); // error } diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments5.js b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.js index 1675b582d49..4e3e20071b2 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments5.js +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.js @@ -27,40 +27,16 @@ var r7 = foo({ cb: () => '' }); // string function foo(arg) { return arg.cb(null); } -var arg = { - cb: function (x) { - return ''; - } -}; +var arg = { cb: function (x) { return ''; } }; var r = foo(arg); // {} // more args not allowed -var r2 = foo({ - cb: function (x, y) { - return ''; - } -}); // error -var r3 = foo({ - cb: function (x, y) { - return ''; - } -}); // error +var r2 = foo({ cb: function (x, y) { return ''; } }); // error +var r3 = foo({ cb: function (x, y) { return ''; } }); // error function foo2(arg) { return arg.cb(null, null); } // fewer args ok var r4 = foo(arg); // {} -var r5 = foo({ - cb: function (x) { - return ''; - } -}); // {} -var r6 = foo({ - cb: function (x) { - return ''; - } -}); // string -var r7 = foo({ - cb: function () { - return ''; - } -}); // string +var r5 = foo({ cb: function (x) { return ''; } }); // {} +var r6 = foo({ cb: function (x) { return ''; } }); // string +var r7 = foo({ cb: function () { return ''; } }); // string diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments.js b/tests/baselines/reference/genericCallWithGenericSignatureArguments.js index 0f39ae16dee..17094dae69c 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments.js +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments.js @@ -50,61 +50,21 @@ function foo(a, b) { return r; } //var r1 = foo((x: number) => 1, (x: string) => ''); // error -var r1b = foo(function (x) { - return 1; -}, function (x) { - return ''; -}); // {} => {} -var r2 = foo(function (x) { - return null; -}, function (x) { - return ''; -}); // Object => Object -var r3 = foo(function (x) { - return 1; -}, function (x) { - return null; -}); // number => number -var r3ii = foo(function (x) { - return 1; -}, function (x) { - return 1; -}); // number => number +var r1b = foo(function (x) { return 1; }, function (x) { return ''; }); // {} => {} +var r2 = foo(function (x) { return null; }, function (x) { return ''; }); // Object => Object +var r3 = foo(function (x) { return 1; }, function (x) { return null; }); // number => number +var r3ii = foo(function (x) { return 1; }, function (x) { return 1; }); // number => number var a; var b; -var r4 = foo(function (x) { - return a; -}, function (x) { - return b; -}); // typeof a => typeof a -var r5 = foo(function (x) { - return b; -}, function (x) { - return a; -}); // typeof b => typeof b +var r4 = foo(function (x) { return a; }, function (x) { return b; }); // typeof a => typeof a +var r5 = foo(function (x) { return b; }, function (x) { return a; }); // typeof b => typeof b function other(x) { - var r6 = foo(function (a) { - return a; - }, function (b) { - return b; - }); // T => T - var r6b = foo(function (a) { - return a; - }, function (b) { - return b; - }); // {} => {} + var r6 = foo(function (a) { return a; }, function (b) { return b; }); // T => T + var r6b = foo(function (a) { return a; }, function (b) { return b; }); // {} => {} } function other2(x) { - var r7 = foo(function (a) { - return a; - }, function (b) { - return b; - }); // T => T - var r7b = foo(function (a) { - return a; - }, function (b) { - return b; - }); // {} => {} + var r7 = foo(function (a) { return a; }, function (b) { return b; }); // T => T + var r7b = foo(function (a) { return a; }, function (b) { return b; }); // {} => {} var r8 = r7(null); // BUG 835518 //var r9 = r7(new Date()); @@ -114,9 +74,5 @@ function foo2(a, b) { return r; } function other3(x) { - var r8 = foo2(function (a) { - return a; - }, function (b) { - return b; - }); // Date => Date + var r8 = foo2(function (a) { return a; }, function (b) { return b; }); // Date => Date } diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.js b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.js index 758852a918b..1aabe9cfa2b 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.js +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.js @@ -82,17 +82,9 @@ var onlyT; var r; return r; } - var r1 = foo(function (x) { - return 1; - }, function (x) { - return ''; - }); + var r1 = foo(function (x) { return 1; }, function (x) { return ''; }); function other2(x) { - var r7 = foo(function (a) { - return a; - }, function (b) { - return b; - }); // T => T + var r7 = foo(function (a) { return a; }, function (b) { return b; }); // T => T // BUG 835518 var r9 = r7(new Date()); // should be ok var r10 = r7(1); // error @@ -102,16 +94,8 @@ var onlyT; return r; } function other3(x) { - var r7 = foo2(function (a) { - return a; - }, function (b) { - return b; - }); // error - var r7b = foo2(function (a) { - return a; - }, function (b) { - return b; - }); // valid, T is inferred to be Date + var r7 = foo2(function (a) { return a; }, function (b) { return b; }); // error + var r7b = foo2(function (a) { return a; }, function (b) { return b; }); // valid, T is inferred to be Date } var E; (function (E) { @@ -125,11 +109,7 @@ var onlyT; var r; return r; } - var r7 = foo3(E.A, function (x) { - return E.A; - }, function (x) { - return F.A; - }); // error + var r7 = foo3(E.A, function (x) { return E.A; }, function (x) { return F.A; }); // error })(onlyT || (onlyT = {})); var TU; (function (TU) { @@ -137,17 +117,9 @@ var TU; var r; return r; } - var r1 = foo(function (x) { - return 1; - }, function (x) { - return ''; - }); + var r1 = foo(function (x) { return 1; }, function (x) { return ''; }); function other2(x) { - var r7 = foo(function (a) { - return a; - }, function (b) { - return b; - }); + var r7 = foo(function (a) { return a; }, function (b) { return b; }); var r9 = r7(new Date()); var r10 = r7(1); } @@ -156,16 +128,8 @@ var TU; return r; } function other3(x) { - var r7 = foo2(function (a) { - return a; - }, function (b) { - return b; - }); - var r7b = foo2(function (a) { - return a; - }, function (b) { - return b; - }); + var r7 = foo2(function (a) { return a; }, function (b) { return b; }); + var r7b = foo2(function (a) { return a; }, function (b) { return b; }); } var E; (function (E) { @@ -179,9 +143,5 @@ var TU; var r; return r; } - var r7 = foo3(E.A, function (x) { - return E.A; - }, function (x) { - return F.A; - }); + var r7 = foo3(E.A, function (x) { return E.A; }, function (x) { return F.A; }); })(TU || (TU = {})); diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments3.js b/tests/baselines/reference/genericCallWithGenericSignatureArguments3.js index b7cc833b9d9..36566033a48 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments3.js +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments3.js @@ -40,36 +40,12 @@ function foo(x, a, b) { var r; return r; } -var r1 = foo('', function (x) { - return ''; -}, function (x) { - return null; -}); // any => any -var r1ii = foo('', function (x) { - return ''; -}, function (x) { - return null; -}); // string => string -var r2 = foo('', function (x) { - return ''; -}, function (x) { - return ''; -}); // string => string -var r3 = foo(null, function (x) { - return ''; -}, function (x) { - return ''; -}); // Object => Object -var r4 = foo(null, function (x) { - return ''; -}, function (x) { - return ''; -}); // any => any -var r5 = foo(new Object(), function (x) { - return ''; -}, function (x) { - return ''; -}); // Object => Object +var r1 = foo('', function (x) { return ''; }, function (x) { return null; }); // any => any +var r1ii = foo('', function (x) { return ''; }, function (x) { return null; }); // string => string +var r2 = foo('', function (x) { return ''; }, function (x) { return ''; }); // string => string +var r3 = foo(null, function (x) { return ''; }, function (x) { return ''; }); // Object => Object +var r4 = foo(null, function (x) { return ''; }, function (x) { return ''; }); // any => any +var r5 = foo(new Object(), function (x) { return ''; }, function (x) { return ''; }); // Object => Object var E; (function (E) { E[E["A"] = 0] = "A"; @@ -78,42 +54,14 @@ var F; (function (F) { F[F["A"] = 0] = "A"; })(F || (F = {})); -var r6 = foo(E.A, function (x) { - return E.A; -}, function (x) { - return F.A; -}); // number => number +var r6 = foo(E.A, function (x) { return E.A; }, function (x) { return F.A; }); // number => number function foo2(x, a, b) { var r; return r; } -var r8 = foo2('', function (x) { - return ''; -}, function (x) { - return null; -}); // string => string -var r9 = foo2(null, function (x) { - return ''; -}, function (x) { - return ''; -}); // any => any -var r10 = foo2(null, function (x) { - return ''; -}, function (x) { - return ''; -}); // Object => Object +var r8 = foo2('', function (x) { return ''; }, function (x) { return null; }); // string => string +var r9 = foo2(null, function (x) { return ''; }, function (x) { return ''; }); // any => any +var r10 = foo2(null, function (x) { return ''; }, function (x) { return ''; }); // Object => Object var x; -var r11 = foo2(x, function (a1) { - return function (n) { - return 1; - }; -}, function (a2) { - return 2; -}); // error -var r12 = foo2(x, function (a1) { - return function (n) { - return 1; - }; -}, function (a2) { - return 2; -}); // error +var r11 = foo2(x, function (a1) { return function (n) { return 1; }; }, function (a2) { return 2; }); // error +var r12 = foo2(x, function (a1) { return function (n) { return 1; }; }, function (a2) { return 2; }); // error diff --git a/tests/baselines/reference/genericCallWithNonGenericArgs1.js b/tests/baselines/reference/genericCallWithNonGenericArgs1.js index 2282c64e851..4f5239630ae 100644 --- a/tests/baselines/reference/genericCallWithNonGenericArgs1.js +++ b/tests/baselines/reference/genericCallWithNonGenericArgs1.js @@ -4,6 +4,5 @@ f(null) //// [genericCallWithNonGenericArgs1.js] -function f(x) { -} +function f(x) { } f(null); diff --git a/tests/baselines/reference/genericCallWithObjectLiteralArgs.js b/tests/baselines/reference/genericCallWithObjectLiteralArgs.js index 17ca4ad937c..2515bbef293 100644 --- a/tests/baselines/reference/genericCallWithObjectLiteralArgs.js +++ b/tests/baselines/reference/genericCallWithObjectLiteralArgs.js @@ -12,19 +12,7 @@ var r4 = foo({ bar: 1, baz: '' }); // T = Object function foo(x) { return x; } -var r = foo({ - bar: 1, - baz: '' -}); // error -var r2 = foo({ - bar: 1, - baz: 1 -}); // T = number -var r3 = foo({ - bar: foo, - baz: foo -}); // T = typeof foo -var r4 = foo({ - bar: 1, - baz: '' -}); // T = Object +var r = foo({ bar: 1, baz: '' }); // error +var r2 = foo({ bar: 1, baz: 1 }); // T = number +var r3 = foo({ bar: foo, baz: foo }); // T = typeof foo +var r4 = foo({ bar: 1, baz: '' }); // T = Object diff --git a/tests/baselines/reference/genericCallWithObjectLiteralArguments1.js b/tests/baselines/reference/genericCallWithObjectLiteralArguments1.js index 92564c0a131..f140caaac61 100644 --- a/tests/baselines/reference/genericCallWithObjectLiteralArguments1.js +++ b/tests/baselines/reference/genericCallWithObjectLiteralArguments1.js @@ -8,27 +8,10 @@ var x4 = foo({ x: "", y: 4 }, ""); var x5 = foo({ x: "", y: 4 }, ""); //// [genericCallWithObjectLiteralArguments1.js] -function foo(n, m) { - return m; -} +function foo(n, m) { return m; } // these are all errors -var x = foo({ - x: 3, - y: "" -}, 4); -var x2 = foo({ - x: 3, - y: "" -}, 4); -var x3 = foo({ - x: 3, - y: "" -}, 4); -var x4 = foo({ - x: "", - y: 4 -}, ""); -var x5 = foo({ - x: "", - y: 4 -}, ""); +var x = foo({ x: 3, y: "" }, 4); +var x2 = foo({ x: 3, y: "" }, 4); +var x3 = foo({ x: 3, y: "" }, 4); +var x4 = foo({ x: "", y: 4 }, ""); +var x5 = foo({ x: "", y: 4 }, ""); diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgs2.js b/tests/baselines/reference/genericCallWithObjectTypeArgs2.js index aa478a7fbed..3a72feff979 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgs2.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgs2.js @@ -60,27 +60,13 @@ var Derived2 = (function (_super) { })(Base); // returns {}[] function f(a) { - return [ - a.x, - a.y - ]; + return [a.x, a.y]; } -var r = f({ - x: new Derived(), - y: new Derived2() -}); // {}[] -var r2 = f({ - x: new Base(), - y: new Derived2() -}); // {}[] +var r = f({ x: new Derived(), y: new Derived2() }); // {}[] +var r2 = f({ x: new Base(), y: new Derived2() }); // {}[] function f2(a) { - return function (x) { - return a.y; - }; + return function (x) { return a.y; }; } -var r3 = f2({ - x: new Derived(), - y: new Derived2() -}); // Derived => Derived2 +var r3 = f2({ x: new Derived(), y: new Derived2() }); // Derived => Derived2 var i; var r4 = f2(i); // Base => Derived diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js index e530187859f..c1f0945ba10 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js @@ -63,14 +63,8 @@ function f(x) { var r; return r; } -var r = f({ - foo: new Base(), - bar: new Derived() -}); -var r2 = f({ - foo: new Derived(), - bar: new Derived() -}); +var r = f({ foo: new Base(), bar: new Derived() }); +var r2 = f({ foo: new Derived(), bar: new Derived() }); function f2(x) { var r; return r; @@ -80,13 +74,7 @@ var r3 = f2(i); function f3(x, y) { return y(null); } -var r4 = f3(new Base(), function (x) { - return x; -}); -var r5 = f3(new Derived(), function (x) { - return x; -}); +var r4 = f3(new Base(), function (x) { return x; }); +var r5 = f3(new Derived(), function (x) { return x; }); var r6 = f3(null, null); // any -var r7 = f3(null, function (x) { - return x; -}); // any +var r7 = f3(null, function (x) { return x; }); // any diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js index 9dca38866c6..b9c722f80be 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js @@ -68,32 +68,17 @@ function f(a) { var r; return r; } -var r1 = f({ - x: new Derived(), - y: new Derived2() -}); // error because neither is supertype of the other +var r1 = f({ x: new Derived(), y: new Derived2() }); // error because neither is supertype of the other function f2(a) { var r; return r; } -var r2 = f2({ - x: new Derived(), - y: new Derived2() -}); // ok -var r3 = f2({ - x: new Derived(), - y: new Derived2() -}); // ok +var r2 = f2({ x: new Derived(), y: new Derived2() }); // ok +var r3 = f2({ x: new Derived(), y: new Derived2() }); // ok function f3(y, x) { return y(null); } // all ok - second argument is processed before x is fixed -var r4 = f3(function (x) { - return x; -}, new Base()); -var r5 = f3(function (x) { - return x; -}, new Derived()); -var r6 = f3(function (x) { - return x; -}, null); +var r4 = f3(function (x) { return x; }, new Base()); +var r5 = f3(function (x) { return x; }, new Derived()); +var r6 = f3(function (x) { return x; }, null); diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.js index 2872777d1bb..10d32ddeae7 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.js @@ -46,29 +46,19 @@ var D = (function () { return D; })(); function foo(t, t2) { - return function (x) { - return t2; - }; + return function (x) { return t2; }; } var c; var d; var r = foo(c, d); var r2 = foo(d, c); // error because C does not extend D -var r3 = foo(c, { - x: '', - foo: c -}); +var r3 = foo(c, { x: '', foo: c }); var r4 = foo(null, null); var r5 = foo({}, null); var r6 = foo(null, {}); var r7 = foo({}, {}); -var r8 = foo(function () { -}, function () { -}); -var r9 = foo(function () { -}, function () { - return 1; -}); +var r8 = foo(function () { }, function () { }); +var r9 = foo(function () { }, function () { return 1; }); function other() { var r4 = foo(c, d); var r5 = foo(c, d); // error diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.js index c0432cfcacf..95b98767a09 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.js @@ -37,17 +37,12 @@ var D = (function () { return D; })(); function foo(t, t2) { - return function (x) { - return t2; - }; + return function (x) { return t2; }; } var c; var d; var r2 = foo(d, c); // the constraints are self-referencing, no downstream error -var r9 = foo(function () { - return 1; -}, function () { -}); // the constraints are self-referencing, no downstream error +var r9 = foo(function () { return 1; }, function () { }); // the constraints are self-referencing, no downstream error function other() { var r5 = foo(c, d); // error } diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.js b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.js index b66c9ccf6c2..dea5948242b 100644 --- a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.js +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.js @@ -54,44 +54,28 @@ var NonGenericParameter; return cb; } var r = foo4(a); - var r2 = foo4(function (x) { - return x; - }); - var r4 = foo4(function (x) { - return x; - }); + var r2 = foo4(function (x) { return x; }); + var r4 = foo4(function (x) { return x; }); })(NonGenericParameter || (NonGenericParameter = {})); var GenericParameter; (function (GenericParameter) { function foo5(cb) { return cb; } - var r5 = foo5(function (x) { - return x; - }); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed]. T is any + var r5 = foo5(function (x) { return x; }); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed]. T is any var a; var r7 = foo5(a); // any => string (+1 overload) function foo6(cb) { return cb; } - var r8 = foo6(function (x) { - return x; - }); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed]. T is any - var r9 = foo6(function (x) { - return ''; - }); // any => string (+1 overload) - var r11 = foo6(function (x, y) { - return ''; - }); // any => string (+1 overload) + var r8 = foo6(function (x) { return x; }); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed]. T is any + var r9 = foo6(function (x) { return ''; }); // any => string (+1 overload) + var r11 = foo6(function (x, y) { return ''; }); // any => string (+1 overload) function foo7(x, cb) { return cb; } - var r12 = foo7(1, function (x) { - return x; - }); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] - var r13 = foo7(1, function (x) { - return ''; - }); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] + var r12 = foo7(1, function (x) { return x; }); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] + var r13 = foo7(1, function (x) { return ''; }); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] var a; var r14 = foo7(1, a); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] })(GenericParameter || (GenericParameter = {})); diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.js b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.js index e61e2b06b4e..b4f96f67942 100644 --- a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.js +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.js @@ -46,31 +46,22 @@ var NonGenericParameter; function foo4(cb) { return cb; } - var r3 = foo4(function (x) { - var r; - return r; - }); // ok + var r3 = foo4(function (x) { var r; return r; }); // ok })(NonGenericParameter || (NonGenericParameter = {})); var GenericParameter; (function (GenericParameter) { function foo5(cb) { return cb; } - var r6 = foo5(function (x) { - return x; - }); // ok + var r6 = foo5(function (x) { return x; }); // ok function foo6(cb) { return cb; } - var r10 = foo6(function (x, y) { - return ''; - }); // error + var r10 = foo6(function (x, y) { return ''; }); // error function foo7(x, cb) { return cb; } - var r13 = foo7(1, function (x) { - return x; - }); // ok + var r13 = foo7(1, function (x) { return x; }); // ok var a; var r14 = foo7(1, a); // ok })(GenericParameter || (GenericParameter = {})); diff --git a/tests/baselines/reference/genericCallWithTupleType.js b/tests/baselines/reference/genericCallWithTupleType.js index fa29f01384e..296a6dad63b 100644 --- a/tests/baselines/reference/genericCallWithTupleType.js +++ b/tests/baselines/reference/genericCallWithTupleType.js @@ -29,48 +29,18 @@ i2.tuple1 = [{}]; var i1; var i2; // no error -i1.tuple1 = [ - "foo", - 5 -]; +i1.tuple1 = ["foo", 5]; var e1 = i1.tuple1[0]; // string var e2 = i1.tuple1[1]; // number -i1.tuple1 = [ - "foo", - 5, - false, - true -]; +i1.tuple1 = ["foo", 5, false, true]; var e3 = i1.tuple1[2]; // {} -i1.tuple1[3] = { - a: "string" -}; +i1.tuple1[3] = { a: "string" }; var e4 = i1.tuple1[3]; // {} -i2.tuple1 = [ - "foo", - 5 -]; -i2.tuple1 = [ - "foo", - "bar" -]; -i2.tuple1 = [ - 5, - "bar" -]; -i2.tuple1 = [ - {}, - {} -]; +i2.tuple1 = ["foo", 5]; +i2.tuple1 = ["foo", "bar"]; +i2.tuple1 = [5, "bar"]; +i2.tuple1 = [{}, {}]; // error -i1.tuple1 = [ - 5, - "foo" -]; -i1.tuple1 = [ - {}, - {} -]; -i2.tuple1 = [ - {} -]; +i1.tuple1 = [5, "foo"]; +i1.tuple1 = [{}, {}]; +i2.tuple1 = [{}]; diff --git a/tests/baselines/reference/genericCallbacksAndClassHierarchy.js b/tests/baselines/reference/genericCallbacksAndClassHierarchy.js index 682cd6010f1..e63c7a98272 100644 --- a/tests/baselines/reference/genericCallbacksAndClassHierarchy.js +++ b/tests/baselines/reference/genericCallbacksAndClassHierarchy.js @@ -56,13 +56,11 @@ var M; function D() { } D.prototype._subscribe = function (viewModel) { - var f = function (newValue) { - }; + var f = function (newValue) { }; var v = viewModel.value; // both of these should work v.subscribe(f); - v.subscribe(function (newValue) { - }); + v.subscribe(function (newValue) { }); }; return D; })(); diff --git a/tests/baselines/reference/genericCallsWithoutParens.js b/tests/baselines/reference/genericCallsWithoutParens.js index e51ed55224c..a479fbab375 100644 --- a/tests/baselines/reference/genericCallsWithoutParens.js +++ b/tests/baselines/reference/genericCallsWithoutParens.js @@ -10,8 +10,7 @@ var c = new C; // parse error //// [genericCallsWithoutParens.js] -function f() { -} +function f() { } var r = f(); // parse error var C = (function () { function C() { diff --git a/tests/baselines/reference/genericChainedCalls.js b/tests/baselines/reference/genericChainedCalls.js index 48bc37101cd..a738e19023b 100644 --- a/tests/baselines/reference/genericChainedCalls.js +++ b/tests/baselines/reference/genericChainedCalls.js @@ -15,20 +15,9 @@ var s3 = s2.func(num => num.toString()) //// [genericChainedCalls.js] -var r1 = v1.func(function (num) { - return num.toString(); -}).func(function (str) { - return str.length; -}) // error, number doesn't have a length -.func(function (num) { - return num.toString(); -}); -var s1 = v1.func(function (num) { - return num.toString(); -}); -var s2 = s1.func(function (str) { - return str.length; -}); // should also error -var s3 = s2.func(function (num) { - return num.toString(); -}); +var r1 = v1.func(function (num) { return num.toString(); }) + .func(function (str) { return str.length; }) // error, number doesn't have a length + .func(function (num) { return num.toString(); }); +var s1 = v1.func(function (num) { return num.toString(); }); +var s2 = s1.func(function (str) { return str.length; }); // should also error +var s3 = s2.func(function (num) { return num.toString(); }); diff --git a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js index 8d1e87cb495..4f26e35d1b0 100644 --- a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js +++ b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js @@ -91,11 +91,8 @@ var Portal; var Validator = (function () { function Validator(message) { } - Validator.prototype.destroy = function () { - }; - Validator.prototype._validate = function (value) { - return 0; - }; + Validator.prototype.destroy = function () { }; + Validator.prototype._validate = function (value) { return 0; }; return Validator; })(); Validators.Validator = Validator; diff --git a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.types b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.types index 2d39c0a465b..1867d390703 100644 --- a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.types +++ b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.types @@ -191,9 +191,9 @@ module PortalFx.ViewModels.Controls.Validators { export class Validator extends Portal.Controls.Validators.Validator { >Validator : Validator >TValue : TValue ->Portal : unknown ->Controls : unknown ->Validators : unknown +>Portal : typeof Portal +>Controls : typeof Portal.Controls +>Validators : typeof Portal.Controls.Validators >Validator : Portal.Controls.Validators.Validator >TValue : TValue diff --git a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.js b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.js index 4aab45f5228..5156c4d6b12 100644 --- a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.js +++ b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.js @@ -78,15 +78,9 @@ var ImmediatelyFix; return C; })(); var c = new C(); - var r = c.foo(function (x) { - return ''; - }); // {} - var r2 = c.foo(function (x) { - return ''; - }); // string - var r3 = c.foo(function (x) { - return ''; - }); // {} + var r = c.foo(function (x) { return ''; }); // {} + var r2 = c.foo(function (x) { return ''; }); // string + var r3 = c.foo(function (x) { return ''; }); // {} var C2 = (function () { function C2() { } @@ -96,12 +90,8 @@ var ImmediatelyFix; return C2; })(); var c2 = new C2(); - var ra = c2.foo(function (x) { - return 1; - }); // number - var r3a = c2.foo(function (x) { - return 1; - }); // number + var ra = c2.foo(function (x) { return 1; }); // number + var r3a = c2.foo(function (x) { return 1; }); // number })(ImmediatelyFix || (ImmediatelyFix = {})); var WithCandidates; (function (WithCandidates) { @@ -114,15 +104,9 @@ var WithCandidates; return C; })(); var c; - var r4 = c.foo2(1, function (a) { - return ''; - }); // string, contextual signature instantiation is applied to generic functions - var r5 = c.foo2(1, function (a) { - return ''; - }); // string - var r6 = c.foo2('', function (a) { - return 1; - }); // number + var r4 = c.foo2(1, function (a) { return ''; }); // string, contextual signature instantiation is applied to generic functions + var r5 = c.foo2(1, function (a) { return ''; }); // string + var r6 = c.foo2('', function (a) { return 1; }); // number var C2 = (function () { function C2() { } @@ -132,12 +116,8 @@ var WithCandidates; return C2; })(); var c2; - var r7 = c2.foo3(1, function (a) { - return ''; - }, ''); // string - var r8 = c2.foo3(1, function (a) { - return ''; - }, ''); // string + var r7 = c2.foo3(1, function (a) { return ''; }, ''); // string + var r8 = c2.foo3(1, function (a) { return ''; }, ''); // string var C3 = (function () { function C3() { } @@ -148,20 +128,10 @@ var WithCandidates; })(); var c3; function other(t, u) { - var r10 = c.foo2(1, function (x) { - return ''; - }); // error - var r10 = c.foo2(1, function (x) { - return ''; - }); // string - var r11 = c3.foo3(1, function (x) { - return ''; - }, ''); // error - var r11b = c3.foo3(1, function (x) { - return ''; - }, 1); // error - var r12 = c3.foo3(1, function (a) { - return ''; - }, 1); // error + var r10 = c.foo2(1, function (x) { return ''; }); // error + var r10 = c.foo2(1, function (x) { return ''; }); // string + var r11 = c3.foo3(1, function (x) { return ''; }, ''); // error + var r11b = c3.foo3(1, function (x) { return ''; }, 1); // error + var r12 = c3.foo3(1, function (a) { return ''; }, 1); // error } })(WithCandidates || (WithCandidates = {})); diff --git a/tests/baselines/reference/genericClassWithStaticsUsingTypeArguments.js b/tests/baselines/reference/genericClassWithStaticsUsingTypeArguments.js index 4aca0e37520..4caeacd19e2 100644 --- a/tests/baselines/reference/genericClassWithStaticsUsingTypeArguments.js +++ b/tests/baselines/reference/genericClassWithStaticsUsingTypeArguments.js @@ -25,14 +25,9 @@ var Foo = (function () { Foo.f = function (xs) { return xs.reverse(); }; - Foo.a = function (n) { - }; + Foo.a = function (n) { }; Foo.c = []; - Foo.d = false || (function (x) { - return x || undefined; - })(null); - Foo.e = function (x) { - return null; - }; + Foo.d = false || (function (x) { return x || undefined; })(null); + Foo.e = function (x) { return null; }; return Foo; })(); diff --git a/tests/baselines/reference/genericCloduleInModule.js b/tests/baselines/reference/genericCloduleInModule.js index f3938735695..92c519aa012 100644 --- a/tests/baselines/reference/genericCloduleInModule.js +++ b/tests/baselines/reference/genericCloduleInModule.js @@ -18,10 +18,8 @@ var A; var B = (function () { function B() { } - B.prototype.foo = function () { - }; - B.bar = function () { - }; + B.prototype.foo = function () { }; + B.bar = function () { }; return B; })(); A.B = B; diff --git a/tests/baselines/reference/genericCloduleInModule2.js b/tests/baselines/reference/genericCloduleInModule2.js index 1cb3bd66403..bb8021ffe8c 100644 --- a/tests/baselines/reference/genericCloduleInModule2.js +++ b/tests/baselines/reference/genericCloduleInModule2.js @@ -21,10 +21,8 @@ var A; var B = (function () { function B() { } - B.prototype.foo = function () { - }; - B.bar = function () { - }; + B.prototype.foo = function () { }; + B.bar = function () { }; return B; })(); A.B = B; diff --git a/tests/baselines/reference/genericCombinators2.js b/tests/baselines/reference/genericCombinators2.js index af11f056197..a23f163a906 100644 --- a/tests/baselines/reference/genericCombinators2.js +++ b/tests/baselines/reference/genericCombinators2.js @@ -19,10 +19,6 @@ var r5b = _.map(c2, rf1); //// [genericCombinators2.js] var _; var c2; -var rf1 = function (x, y) { - return x.toFixed(); -}; -var r5a = _.map(c2, function (x, y) { - return x.toFixed(); -}); +var rf1 = function (x, y) { return x.toFixed(); }; +var r5a = _.map(c2, function (x, y) { return x.toFixed(); }); var r5b = _.map(c2, rf1); diff --git a/tests/baselines/reference/genericConstraintDeclaration.js b/tests/baselines/reference/genericConstraintDeclaration.js index cdf93d676d0..6e3f8d5ff8b 100644 --- a/tests/baselines/reference/genericConstraintDeclaration.js +++ b/tests/baselines/reference/genericConstraintDeclaration.js @@ -12,9 +12,7 @@ class List{ var List = (function () { function List() { } - List.empty = function () { - return null; - }; + List.empty = function () { return null; }; return List; })(); diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.types b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.types index 1e744ce25c2..eadf43d226a 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.types +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.types @@ -12,7 +12,7 @@ declare module EndGate { interface Number extends EndGate.ICloneable { } >Number : Number ->EndGate : unknown +>EndGate : typeof EndGate >ICloneable : EndGate.ICloneable module EndGate.Tweening { diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.types b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.types index ad3182f62e5..80e1a963d5f 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.types +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.types @@ -12,7 +12,7 @@ module EndGate { interface Number extends EndGate.ICloneable { } >Number : Number ->EndGate : unknown +>EndGate : typeof EndGate >ICloneable : EndGate.ICloneable module EndGate.Tweening { diff --git a/tests/baselines/reference/genericConstraintSatisfaction1.js b/tests/baselines/reference/genericConstraintSatisfaction1.js index b7438e6c456..9436e62b3ba 100644 --- a/tests/baselines/reference/genericConstraintSatisfaction1.js +++ b/tests/baselines/reference/genericConstraintSatisfaction1.js @@ -9,6 +9,4 @@ x.f({s: 1}) //// [genericConstraintSatisfaction1.js] var x; -x.f({ - s: 1 -}); +x.f({ s: 1 }); diff --git a/tests/baselines/reference/genericContextualTypingSpecialization.js b/tests/baselines/reference/genericContextualTypingSpecialization.js index a577db15d32..75d8b995fa3 100644 --- a/tests/baselines/reference/genericContextualTypingSpecialization.js +++ b/tests/baselines/reference/genericContextualTypingSpecialization.js @@ -4,6 +4,4 @@ b.reduce((c, d) => c + d, 0); // should not error on '+' //// [genericContextualTypingSpecialization.js] var b; -b.reduce(function (c, d) { - return c + d; -}, 0); // should not error on '+' +b.reduce(function (c, d) { return c + d; }, 0); // should not error on '+' diff --git a/tests/baselines/reference/genericFunctionHasFreshTypeArgs.js b/tests/baselines/reference/genericFunctionHasFreshTypeArgs.js index 77cad2cc87f..30d57403aec 100644 --- a/tests/baselines/reference/genericFunctionHasFreshTypeArgs.js +++ b/tests/baselines/reference/genericFunctionHasFreshTypeArgs.js @@ -3,11 +3,6 @@ function f(p: (x: T) => void) { }; f(x => f(y => x = y)); //// [genericFunctionHasFreshTypeArgs.js] -function f(p) { -} +function f(p) { } ; -f(function (x) { - return f(function (y) { - return x = y; - }); -}); +f(function (x) { return f(function (y) { return x = y; }); }); diff --git a/tests/baselines/reference/genericFunctionSpecializations1.js b/tests/baselines/reference/genericFunctionSpecializations1.js index 2935959b69e..c1043f792b6 100644 --- a/tests/baselines/reference/genericFunctionSpecializations1.js +++ b/tests/baselines/reference/genericFunctionSpecializations1.js @@ -6,7 +6,5 @@ function foo4(test: string); // valid function foo4(test: T) { } //// [genericFunctionSpecializations1.js] -function foo3(test) { -} -function foo4(test) { -} +function foo3(test) { } +function foo4(test) { } diff --git a/tests/baselines/reference/genericFunctionTypedArgumentsAreFixed.js b/tests/baselines/reference/genericFunctionTypedArgumentsAreFixed.js index c1a8daa6a1b..e9db28578f7 100644 --- a/tests/baselines/reference/genericFunctionTypedArgumentsAreFixed.js +++ b/tests/baselines/reference/genericFunctionTypedArgumentsAreFixed.js @@ -3,8 +3,4 @@ declare function map(f: (x: T) => U, xs: T[]): U[]; map((a) => a.length, [1]); //// [genericFunctionTypedArgumentsAreFixed.js] -map(function (a) { - return a.length; -}, [ - 1 -]); +map(function (a) { return a.length; }, [1]); diff --git a/tests/baselines/reference/genericFunctions0.js b/tests/baselines/reference/genericFunctions0.js index 408abdb9ce0..b52f0583524 100644 --- a/tests/baselines/reference/genericFunctions0.js +++ b/tests/baselines/reference/genericFunctions0.js @@ -4,9 +4,7 @@ function foo (x: T) { return x; } var x = foo(5); // 'x' should be number //// [genericFunctions0.js] -function foo(x) { - return x; -} +function foo(x) { return x; } var x = foo(5); // 'x' should be number diff --git a/tests/baselines/reference/genericFunctions1.js b/tests/baselines/reference/genericFunctions1.js index 25cc91820b8..d9bb3413890 100644 --- a/tests/baselines/reference/genericFunctions1.js +++ b/tests/baselines/reference/genericFunctions1.js @@ -4,9 +4,7 @@ function foo (x: T) { return x; } var x = foo(5); // 'x' should be number //// [genericFunctions1.js] -function foo(x) { - return x; -} +function foo(x) { return x; } var x = foo(5); // 'x' should be number diff --git a/tests/baselines/reference/genericFunctions2.js b/tests/baselines/reference/genericFunctions2.js index ec01cc885bd..f14c1be6dc9 100644 --- a/tests/baselines/reference/genericFunctions2.js +++ b/tests/baselines/reference/genericFunctions2.js @@ -8,9 +8,7 @@ var lengths = map(myItems, x => x.length); //// [genericFunctions2.js] var myItems; -var lengths = map(myItems, function (x) { - return x.length; -}); +var lengths = map(myItems, function (x) { return x.length; }); //// [genericFunctions2.d.ts] diff --git a/tests/baselines/reference/genericFunctionsWithOptionalParameters3.js b/tests/baselines/reference/genericFunctionsWithOptionalParameters3.js index 2a5ce0a333c..9ad885a899a 100644 --- a/tests/baselines/reference/genericFunctionsWithOptionalParameters3.js +++ b/tests/baselines/reference/genericFunctionsWithOptionalParameters3.js @@ -19,26 +19,13 @@ var r5 = utils.mapReduce(c, f1, f2); var Collection = (function () { function Collection() { } - Collection.prototype.add = function (x) { - }; + Collection.prototype.add = function (x) { }; return Collection; })(); var utils; var c = new Collection(); -var r3 = utils.mapReduce(c, function (x) { - return 1; -}, function (y) { - return new Date(); -}); -var r4 = utils.mapReduce(c, function (x) { - return 1; -}, function (y) { - return new Date(); -}); -var f1 = function (x) { - return 1; -}; -var f2 = function (y) { - return new Date(); -}; +var r3 = utils.mapReduce(c, function (x) { return 1; }, function (y) { return new Date(); }); +var r4 = utils.mapReduce(c, function (x) { return 1; }, function (y) { return new Date(); }); +var f1 = function (x) { return 1; }; +var f2 = function (y) { return new Date(); }; var r5 = utils.mapReduce(c, f1, f2); diff --git a/tests/baselines/reference/genericFunduleInModule.js b/tests/baselines/reference/genericFunduleInModule.js index 5a85a46a395..95700edecab 100644 --- a/tests/baselines/reference/genericFunduleInModule.js +++ b/tests/baselines/reference/genericFunduleInModule.js @@ -12,9 +12,7 @@ A.B(1); //// [genericFunduleInModule.js] var A; (function (A) { - function B(x) { - return x; - } + function B(x) { return x; } A.B = B; var B; (function (B) { diff --git a/tests/baselines/reference/genericFunduleInModule2.js b/tests/baselines/reference/genericFunduleInModule2.js index 6b5a0a74e23..956e9129ec7 100644 --- a/tests/baselines/reference/genericFunduleInModule2.js +++ b/tests/baselines/reference/genericFunduleInModule2.js @@ -15,9 +15,7 @@ A.B(1); //// [genericFunduleInModule2.js] var A; (function (A) { - function B(x) { - return x; - } + function B(x) { return x; } A.B = B; })(A || (A = {})); var A; diff --git a/tests/baselines/reference/genericImplements.js b/tests/baselines/reference/genericImplements.js index 17d3d2c0d20..b8d295153a4 100644 --- a/tests/baselines/reference/genericImplements.js +++ b/tests/baselines/reference/genericImplements.js @@ -37,26 +37,20 @@ var B = (function () { var X = (function () { function X() { } - X.prototype.f = function () { - return undefined; - }; + X.prototype.f = function () { return undefined; }; return X; })(); // { f: () => { b; } } // OK var Y = (function () { function Y() { } - Y.prototype.f = function () { - return undefined; - }; + Y.prototype.f = function () { return undefined; }; return Y; })(); // { f: () => { a; } } // OK var Z = (function () { function Z() { } - Z.prototype.f = function () { - return undefined; - }; + Z.prototype.f = function () { return undefined; }; return Z; })(); // { f: () => T } diff --git a/tests/baselines/reference/genericInference1.js b/tests/baselines/reference/genericInference1.js index 26a92970290..dc81b9a9556 100644 --- a/tests/baselines/reference/genericInference1.js +++ b/tests/baselines/reference/genericInference1.js @@ -2,10 +2,4 @@ ['a', 'b', 'c'].map(x => x.length); //// [genericInference1.js] -[ - 'a', - 'b', - 'c' -].map(function (x) { - return x.length; -}); +['a', 'b', 'c'].map(function (x) { return x.length; }); diff --git a/tests/baselines/reference/genericInterfaceTypeCall.js b/tests/baselines/reference/genericInterfaceTypeCall.js index f171fa6e36d..7f5f586ec12 100644 --- a/tests/baselines/reference/genericInterfaceTypeCall.js +++ b/tests/baselines/reference/genericInterfaceTypeCall.js @@ -17,9 +17,5 @@ test.fail2(arg => foo.reject(arg)); // Error: Supplied parameters do not match a //// [genericInterfaceTypeCall.js] var foo; var test; -test.fail(function (arg) { - return foo.reject(arg); -}); -test.fail2(function (arg) { - return foo.reject(arg); -}); // Error: Supplied parameters do not match any signature of call target +test.fail(function (arg) { return foo.reject(arg); }); +test.fail2(function (arg) { return foo.reject(arg); }); // Error: Supplied parameters do not match any signature of call target diff --git a/tests/baselines/reference/genericLambaArgWithoutTypeArguments.js b/tests/baselines/reference/genericLambaArgWithoutTypeArguments.js index f57f6713c9f..e1cc5cadbd5 100644 --- a/tests/baselines/reference/genericLambaArgWithoutTypeArguments.js +++ b/tests/baselines/reference/genericLambaArgWithoutTypeArguments.js @@ -12,6 +12,4 @@ foo((arg: Foo) => { return arg.x; }); function foo(a) { return null; } -foo(function (arg) { - return arg.x; -}); +foo(function (arg) { return arg.x; }); diff --git a/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter.js b/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter.js index 5d4ecdc0838..9b0fbf4bcad 100644 --- a/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter.js +++ b/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter.js @@ -7,9 +7,7 @@ module foo { //// [genericMergedDeclarationUsingTypeParameter.js] -function foo(y, z) { - return y; -} +function foo(y, z) { return y; } var foo; (function (foo) { foo.x; diff --git a/tests/baselines/reference/genericMethodOverspecialization.js b/tests/baselines/reference/genericMethodOverspecialization.js index 04d1466cfc4..6ec28922af0 100644 --- a/tests/baselines/reference/genericMethodOverspecialization.js +++ b/tests/baselines/reference/genericMethodOverspecialization.js @@ -27,13 +27,7 @@ var widths:number[] = elements.map(function (e) { // should not error //// [genericMethodOverspecialization.js] -var names = [ - "list", - "table1", - "table2", - "table3", - "summary" -]; +var names = ["list", "table1", "table2", "table3", "summary"]; var elements = names.map(function (name) { return document.getElementById(name); }); diff --git a/tests/baselines/reference/genericObjectLitReturnType.js b/tests/baselines/reference/genericObjectLitReturnType.js index 327da9ce0f5..826f5233b55 100644 --- a/tests/baselines/reference/genericObjectLitReturnType.js +++ b/tests/baselines/reference/genericObjectLitReturnType.js @@ -15,11 +15,7 @@ t1.a = 5; // Should not error: t1 should have type {a: number}, instead has type var X = (function () { function X() { } - X.prototype.f = function (t) { - return { - a: t - }; - }; + X.prototype.f = function (t) { return { a: t }; }; return X; })(); var x; diff --git a/tests/baselines/reference/genericOfACloduleType1.js b/tests/baselines/reference/genericOfACloduleType1.js index 435575b0152..1f115aa486a 100644 --- a/tests/baselines/reference/genericOfACloduleType1.js +++ b/tests/baselines/reference/genericOfACloduleType1.js @@ -16,9 +16,7 @@ var g2 = new G() // was: error Type reference cannot refer to container 'M. var G = (function () { function G() { } - G.prototype.bar = function (x) { - return x; - }; + G.prototype.bar = function (x) { return x; }; return G; })(); var M; @@ -26,8 +24,7 @@ var M; var C = (function () { function C() { } - C.prototype.foo = function () { - }; + C.prototype.foo = function () { }; return C; })(); M.C = C; diff --git a/tests/baselines/reference/genericOfACloduleType2.js b/tests/baselines/reference/genericOfACloduleType2.js index 4c73addcf72..1d671289cb2 100644 --- a/tests/baselines/reference/genericOfACloduleType2.js +++ b/tests/baselines/reference/genericOfACloduleType2.js @@ -19,9 +19,7 @@ module N { var G = (function () { function G() { } - G.prototype.bar = function (x) { - return x; - }; + G.prototype.bar = function (x) { return x; }; return G; })(); var M; @@ -29,8 +27,7 @@ var M; var C = (function () { function C() { } - C.prototype.foo = function () { - }; + C.prototype.foo = function () { }; return C; })(); M.C = C; diff --git a/tests/baselines/reference/genericOverloadSignatures.js b/tests/baselines/reference/genericOverloadSignatures.js index ec4c9ba74dc..45a21d5a334 100644 --- a/tests/baselines/reference/genericOverloadSignatures.js +++ b/tests/baselines/reference/genericOverloadSignatures.js @@ -31,8 +31,7 @@ interface D { } //// [genericOverloadSignatures.js] -function f(a) { -} +function f(a) { } var C2 = (function () { function C2() { } diff --git a/tests/baselines/reference/genericParameterAssignability1.js b/tests/baselines/reference/genericParameterAssignability1.js index ae8eb4348d3..a6a465b4089 100644 --- a/tests/baselines/reference/genericParameterAssignability1.js +++ b/tests/baselines/reference/genericParameterAssignability1.js @@ -4,10 +4,6 @@ var r = (x: T) => x; r = f; // should be allowed //// [genericParameterAssignability1.js] -function f(x) { - return null; -} -var r = function (x) { - return x; -}; +function f(x) { return null; } +var r = function (x) { return x; }; r = f; // should be allowed diff --git a/tests/baselines/reference/genericPrototypeProperty.js b/tests/baselines/reference/genericPrototypeProperty.js index c38cdb753a7..fb6f9b78848 100644 --- a/tests/baselines/reference/genericPrototypeProperty.js +++ b/tests/baselines/reference/genericPrototypeProperty.js @@ -13,9 +13,7 @@ var r3 = r.foo(null); var C = (function () { function C() { } - C.prototype.foo = function (x) { - return null; - }; + C.prototype.foo = function (x) { return null; }; return C; })(); var r = C.prototype; diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js index 11113b778d3..e01c9045345 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js @@ -69,7 +69,10 @@ var TypeScript; }; PullTypeSymbol.prototype.getScopedNameEx = function (scopeSymbol, useConstraintInName, getPrettyTypeName, getTypeParamMarkerInfo) { if (this.isArray()) { - var elementMemberName = this._elementType ? (this._elementType.isArray() || this._elementType.isNamedTypeSymbol() ? this._elementType.getScopedNameEx(scopeSymbol, false, getPrettyTypeName, getTypeParamMarkerInfo) : this._elementType.getMemberTypeNameEx(false, scopeSymbol, getPrettyTypeName)) : 1; + var elementMemberName = this._elementType ? + (this._elementType.isArray() || this._elementType.isNamedTypeSymbol() ? + this._elementType.getScopedNameEx(scopeSymbol, false, getPrettyTypeName, getTypeParamMarkerInfo) : + this._elementType.getMemberTypeNameEx(false, scopeSymbol, getPrettyTypeName)) : 1; return TypeScript.MemberName.create(elementMemberName, "", "[]"); } }; diff --git a/tests/baselines/reference/genericReduce.js b/tests/baselines/reference/genericReduce.js index c725df8d8e4..ac160e43868 100644 --- a/tests/baselines/reference/genericReduce.js +++ b/tests/baselines/reference/genericReduce.js @@ -14,27 +14,14 @@ n3.toExponential(2); // should error if 'n3' is correctly type 'string' n3.charAt(0); // should not error if 'n3' is correctly type 'string' //// [genericReduce.js] -var a = [ - "An", - "array", - "of", - "strings" -]; -var b = a.map(function (s) { - return s.length; -}); -var n1 = b.reduce(function (x, y) { - return x + y; -}); -var n2 = b.reduceRight(function (x, y) { - return x + y; -}); +var a = ["An", "array", "of", "strings"]; +var b = a.map(function (s) { return s.length; }); +var n1 = b.reduce(function (x, y) { return x + y; }); +var n2 = b.reduceRight(function (x, y) { return x + y; }); n1.x = "fail"; // should error, as 'n1' should be type 'number', not 'any'. n1.toExponential(2); // should not error if 'n1' is correctly number. n2.x = "fail"; // should error, as 'n2' should be type 'number', not 'any'. n2.toExponential(2); // should not error if 'n2' is correctly number. -var n3 = b.reduce(function (x, y) { - return x + y; -}, ""); // Initial value is of type string +var n3 = b.reduce(function (x, y) { return x + y; }, ""); // Initial value is of type string n3.toExponential(2); // should error if 'n3' is correctly type 'string' n3.charAt(0); // should not error if 'n3' is correctly type 'string' diff --git a/tests/baselines/reference/genericRestArgs.js b/tests/baselines/reference/genericRestArgs.js index 4c2ddcf0cd9..75c88d7cbf2 100644 --- a/tests/baselines/reference/genericRestArgs.js +++ b/tests/baselines/reference/genericRestArgs.js @@ -25,11 +25,7 @@ var a1Gb = makeArrayG(1, ""); var a1Gc = makeArrayG(1, ""); var a1Gd = makeArrayG(1, ""); // error function makeArrayGOpt(item1, item2, item3) { - return [ - item1, - item2, - item3 - ]; + return [item1, item2, item3]; } var a2Ga = makeArrayGOpt(1, ""); var a2Gb = makeArrayG(1, ""); diff --git a/tests/baselines/reference/genericReturnTypeFromGetter1.js b/tests/baselines/reference/genericReturnTypeFromGetter1.js index 208b12308e1..741c7218345 100644 --- a/tests/baselines/reference/genericReturnTypeFromGetter1.js +++ b/tests/baselines/reference/genericReturnTypeFromGetter1.js @@ -14,9 +14,7 @@ define(["require", "exports"], function (require, exports) { function DbSet() { } Object.defineProperty(DbSet.prototype, "entityType", { - get: function () { - return this._entityType; - } // used to ICE without return type annotation + get: function () { return this._entityType; } // used to ICE without return type annotation , enumerable: true, configurable: true diff --git a/tests/baselines/reference/genericReversingTypeParameters.js b/tests/baselines/reference/genericReversingTypeParameters.js index 0e51b0256ea..2a52c2e9ba6 100644 --- a/tests/baselines/reference/genericReversingTypeParameters.js +++ b/tests/baselines/reference/genericReversingTypeParameters.js @@ -14,12 +14,8 @@ var r2b = i.get(1); var BiMap = (function () { function BiMap() { } - BiMap.prototype.get = function (key) { - return null; - }; - BiMap.prototype.inverse = function () { - return null; - }; + BiMap.prototype.get = function (key) { return null; }; + BiMap.prototype.inverse = function () { return null; }; return BiMap; })(); var b = new BiMap(); diff --git a/tests/baselines/reference/genericReversingTypeParameters2.js b/tests/baselines/reference/genericReversingTypeParameters2.js index eb904f4a2ed..4f4bc564f89 100644 --- a/tests/baselines/reference/genericReversingTypeParameters2.js +++ b/tests/baselines/reference/genericReversingTypeParameters2.js @@ -13,12 +13,8 @@ var r2b = i.get(1); var BiMap = (function () { function BiMap() { } - BiMap.prototype.get = function (key) { - return null; - }; - BiMap.prototype.inverse = function () { - return null; - }; + BiMap.prototype.get = function (key) { return null; }; + BiMap.prototype.inverse = function () { return null; }; return BiMap; })(); var b = new BiMap(); diff --git a/tests/baselines/reference/genericSpecializations1.js b/tests/baselines/reference/genericSpecializations1.js index 3df2c5581b9..3e59fceff97 100644 --- a/tests/baselines/reference/genericSpecializations1.js +++ b/tests/baselines/reference/genericSpecializations1.js @@ -19,24 +19,18 @@ class StringFoo3 implements IFoo { var IntFooBad = (function () { function IntFooBad() { } - IntFooBad.prototype.foo = function (x) { - return null; - }; + IntFooBad.prototype.foo = function (x) { return null; }; return IntFooBad; })(); var StringFoo2 = (function () { function StringFoo2() { } - StringFoo2.prototype.foo = function (x) { - return null; - }; + StringFoo2.prototype.foo = function (x) { return null; }; return StringFoo2; })(); var StringFoo3 = (function () { function StringFoo3() { } - StringFoo3.prototype.foo = function (x) { - return null; - }; + StringFoo3.prototype.foo = function (x) { return null; }; return StringFoo3; })(); diff --git a/tests/baselines/reference/genericSpecializations2.js b/tests/baselines/reference/genericSpecializations2.js index 666ea43eeba..8497d2db8b4 100644 --- a/tests/baselines/reference/genericSpecializations2.js +++ b/tests/baselines/reference/genericSpecializations2.js @@ -31,24 +31,18 @@ var IFoo = (function () { var IntFooBad = (function () { function IntFooBad() { } - IntFooBad.prototype.foo = function (x) { - return null; - }; + IntFooBad.prototype.foo = function (x) { return null; }; return IntFooBad; })(); var StringFoo2 = (function () { function StringFoo2() { } - StringFoo2.prototype.foo = function (x) { - return null; - }; + StringFoo2.prototype.foo = function (x) { return null; }; return StringFoo2; })(); var StringFoo3 = (function () { function StringFoo3() { } - StringFoo3.prototype.foo = function (x) { - return null; - }; + StringFoo3.prototype.foo = function (x) { return null; }; return StringFoo3; })(); diff --git a/tests/baselines/reference/genericSpecializations3.js b/tests/baselines/reference/genericSpecializations3.js index 8d157761160..3c582ae31fd 100644 --- a/tests/baselines/reference/genericSpecializations3.js +++ b/tests/baselines/reference/genericSpecializations3.js @@ -41,27 +41,21 @@ iFoo.foo(1); var IntFooBad = (function () { function IntFooBad() { } - IntFooBad.prototype.foo = function (x) { - return null; - }; + IntFooBad.prototype.foo = function (x) { return null; }; return IntFooBad; })(); var intFooBad; var IntFoo = (function () { function IntFoo() { } - IntFoo.prototype.foo = function (x) { - return null; - }; + IntFoo.prototype.foo = function (x) { return null; }; return IntFoo; })(); var intFoo; var StringFoo2 = (function () { function StringFoo2() { } - StringFoo2.prototype.foo = function (x) { - return null; - }; + StringFoo2.prototype.foo = function (x) { return null; }; return StringFoo2; })(); var stringFoo2; @@ -71,9 +65,7 @@ stringFoo2 = intFoo; // error var StringFoo3 = (function () { function StringFoo3() { } - StringFoo3.prototype.foo = function (x) { - return null; - }; + StringFoo3.prototype.foo = function (x) { return null; }; return StringFoo3; })(); var stringFoo3; diff --git a/tests/baselines/reference/genericStaticAnyTypeFunction.js b/tests/baselines/reference/genericStaticAnyTypeFunction.js index 055e6b4f683..6816afec910 100644 --- a/tests/baselines/reference/genericStaticAnyTypeFunction.js +++ b/tests/baselines/reference/genericStaticAnyTypeFunction.js @@ -25,9 +25,7 @@ var A = (function () { A.one = function (source, value) { return source; }; - A.goo = function () { - return 0; - }; + A.goo = function () { return 0; }; A.two = function (source) { return this.one(source, 42); // should not error }; diff --git a/tests/baselines/reference/genericTypeArgumentInference1.js b/tests/baselines/reference/genericTypeArgumentInference1.js index 8bf6f35cb33..48c279f52c3 100644 --- a/tests/baselines/reference/genericTypeArgumentInference1.js +++ b/tests/baselines/reference/genericTypeArgumentInference1.js @@ -17,16 +17,7 @@ var r4 = _.all([true], _.identity); //// [genericTypeArgumentInference1.js] -var r = _.all([ - true, - 1, - null, - 'yes' -], _.identity); -var r2 = _.all([ - true -], _.identity); +var r = _.all([true, 1, null, 'yes'], _.identity); +var r2 = _.all([true], _.identity); var r3 = _.all([], _.identity); -var r4 = _.all([ - true -], _.identity); +var r4 = _.all([true], _.identity); diff --git a/tests/baselines/reference/genericTypeAssertions1.js b/tests/baselines/reference/genericTypeAssertions1.js index 02a22aa5c81..54637007d99 100644 --- a/tests/baselines/reference/genericTypeAssertions1.js +++ b/tests/baselines/reference/genericTypeAssertions1.js @@ -8,8 +8,7 @@ var r2: A = >>foo; // error var A = (function () { function A() { } - A.prototype.foo = function (x) { - }; + A.prototype.foo = function (x) { }; return A; })(); var foo = new A(); diff --git a/tests/baselines/reference/genericTypeAssertions2.js b/tests/baselines/reference/genericTypeAssertions2.js index c7acecb5e43..3c904c7a30e 100644 --- a/tests/baselines/reference/genericTypeAssertions2.js +++ b/tests/baselines/reference/genericTypeAssertions2.js @@ -23,8 +23,7 @@ var __extends = this.__extends || function (d, b) { var A = (function () { function A() { } - A.prototype.foo = function (x) { - }; + A.prototype.foo = function (x) { }; return A; })(); var B = (function (_super) { diff --git a/tests/baselines/reference/genericTypeAssertions3.js b/tests/baselines/reference/genericTypeAssertions3.js index 19a477c142c..b67a277654f 100644 --- a/tests/baselines/reference/genericTypeAssertions3.js +++ b/tests/baselines/reference/genericTypeAssertions3.js @@ -4,9 +4,5 @@ var s = < (x: T) => T > ((x: any) => { return null; }); // no error //// [genericTypeAssertions3.js] -var r = (function (x) { - return null; -}); // bug was 'could not find dotted symbol T' on x's annotation in the type assertion instead of no error -var s = (function (x) { - return null; -}); // no error +var r = (function (x) { return null; }); // bug was 'could not find dotted symbol T' on x's annotation in the type assertion instead of no error +var s = (function (x) { return null; }); // no error diff --git a/tests/baselines/reference/genericTypeAssertions4.js b/tests/baselines/reference/genericTypeAssertions4.js index d04b6cbe104..a607fb07428 100644 --- a/tests/baselines/reference/genericTypeAssertions4.js +++ b/tests/baselines/reference/genericTypeAssertions4.js @@ -35,9 +35,7 @@ var __extends = this.__extends || function (d, b) { var A = (function () { function A() { } - A.prototype.foo = function () { - return ""; - }; + A.prototype.foo = function () { return ""; }; return A; })(); var B = (function (_super) { @@ -45,9 +43,7 @@ var B = (function (_super) { function B() { _super.apply(this, arguments); } - B.prototype.bar = function () { - return 1; - }; + B.prototype.bar = function () { return 1; }; return B; })(A); var C = (function (_super) { @@ -55,9 +51,7 @@ var C = (function (_super) { function C() { _super.apply(this, arguments); } - C.prototype.baz = function () { - return 1; - }; + C.prototype.baz = function () { return 1; }; return C; })(A); var a; diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js index dbda6074830..4be1cce27a9 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js @@ -55,18 +55,9 @@ var c; var a; var b; var d; -var e = function (x) { - var y; - return y; -}; -function f(x) { - var y; - return y; -} -var g = function f(x) { - var y; - return y; -}; +var e = function (x) { var y; return y; }; +function f(x) { var y; return y; } +var g = function f(x) { var y; return y; }; var D = (function (_super) { __extends(D, _super); function D() { @@ -95,9 +86,7 @@ var D3 = (function () { } return D3; })(); -function h(x) { -} -function i(x) { -} +function h(x) { } +function i(x) { } var j = null; var k = null; diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js index f6a22073702..803d499705a 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js @@ -50,18 +50,9 @@ var c; var a; var b; var d; -var e = function (x) { - var y; - return y; -}; -function f(x) { - var y; - return y; -} -var g = function f(x) { - var y; - return y; -}; +var e = function (x) { var y; return y; }; +function f(x) { var y; return y; } +var g = function f(x) { var y; return y; }; var D = (function (_super) { __extends(D, _super); function D() { @@ -76,9 +67,7 @@ var D2 = (function (_super) { } return D2; })(M.C); -function h(x) { -} -function i(x) { -} +function h(x) { } +function i(x) { } var j = null; var k = null; diff --git a/tests/baselines/reference/genericTypeReferencesRequireTypeArgs.js b/tests/baselines/reference/genericTypeReferencesRequireTypeArgs.js index 69bc1c372b3..90ad9e1ff93 100644 --- a/tests/baselines/reference/genericTypeReferencesRequireTypeArgs.js +++ b/tests/baselines/reference/genericTypeReferencesRequireTypeArgs.js @@ -15,9 +15,7 @@ var i2: I; // should be an error var C = (function () { function C() { } - C.prototype.foo = function () { - return null; - }; + C.prototype.foo = function () { return null; }; return C; })(); var c1; // error diff --git a/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.js b/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.js index 4cd7eb4165b..1a57b866d99 100644 --- a/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.js +++ b/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.js @@ -13,8 +13,7 @@ var i: I = x; // Should not be allowed -- type of 'f' is incompatible with 'I' var X = (function () { function X() { } - X.prototype.f = function (a) { - }; + X.prototype.f = function (a) { }; return X; })(); var x = new X(); diff --git a/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js b/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js index f0a57430546..fdd2e470a55 100644 --- a/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js +++ b/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js @@ -33,8 +33,7 @@ define(["require", "exports"], function (require, exports) { function List() { _super.apply(this, arguments); } - List.prototype.Bar = function () { - }; + List.prototype.Bar = function () { }; return List; })(Collection); exports.List = List; diff --git a/tests/baselines/reference/genericWithOpenTypeParameters1.js b/tests/baselines/reference/genericWithOpenTypeParameters1.js index afdce73cb11..90202767012 100644 --- a/tests/baselines/reference/genericWithOpenTypeParameters1.js +++ b/tests/baselines/reference/genericWithOpenTypeParameters1.js @@ -15,22 +15,12 @@ var f4 = (x: B) => { return x.foo(1); } // no error var B = (function () { function B() { } - B.prototype.foo = function (x) { - return null; - }; + B.prototype.foo = function (x) { return null; }; return B; })(); var x; x.foo(1); // no error -var f = function (x) { - return x.foo(1); -}; // error -var f2 = function (x) { - return x.foo(1); -}; // error -var f3 = function (x) { - return x.foo(1); -}; // error -var f4 = function (x) { - return x.foo(1); -}; // no error +var f = function (x) { return x.foo(1); }; // error +var f2 = function (x) { return x.foo(1); }; // error +var f3 = function (x) { return x.foo(1); }; // error +var f4 = function (x) { return x.foo(1); }; // no error diff --git a/tests/baselines/reference/genericsAndHigherOrderFunctions.js b/tests/baselines/reference/genericsAndHigherOrderFunctions.js index ad03dccbca2..f2e6ef58f22 100644 --- a/tests/baselines/reference/genericsAndHigherOrderFunctions.js +++ b/tests/baselines/reference/genericsAndHigherOrderFunctions.js @@ -21,15 +21,11 @@ var foo: (g: (x: K) => N) => // no errors expected var combine = function (f) { return function (g) { - return function (x) { - return f(g(x)); - }; + return function (x) { return f(g(x)); }; }; }; var foo = function (g) { return function (h) { - return function (f) { - return h(combine(f)(g)); - }; + return function (f) { return h(combine(f)(g)); }; }; }; diff --git a/tests/baselines/reference/genericsManyTypeParameters.js b/tests/baselines/reference/genericsManyTypeParameters.js index 09cb7658c17..491f0c41168 100644 --- a/tests/baselines/reference/genericsManyTypeParameters.js +++ b/tests/baselines/reference/genericsManyTypeParameters.js @@ -61,114 +61,22 @@ function Foo< //// [genericsManyTypeParameters.js] function Foo(x1, y1, z1, a1, b1, c1, x2, y2, z2, a2, b2, c2, x3, y3, z3, a3, b3, c3, x4, y4, z4, a4, b4, c4, x5, y5, z5, a5, b5, c5, x6, y6, z6, a6, b6, c6, x7, y7, z7, a7, b7, c7, x8, y8, z8, a8, b8, c8, x9, y9, z9, a9, b9, c9, x10, y12, z10, a10, b10, c10, x11, y13, z11, a11, b11, c11, x12, y14, z12, a12, b12, c12, x13, y15, z13, a13, b13, c13, x14, y16, z14, a14, b14, c14, x15, y17, z15, a15, b15, c15, x16, y18, z16, a16, b16, c16, x17, y19, z17, a17, b17, c17, x18, y10, z18, a18, b18, c18) { - return [ - x1, - y1, - z1, - a1, - b1, - c1, - x2, - y2, - z2, - a2, - b2, - c2, - x3, - y3, - z3, - a3, - b3, - c3, - x4, - y4, - z4, - a4, - b4, - c4, - x5, - y5, - z5, - a5, - b5, - c5, - x6, - y6, - z6, - a6, - b6, - c6, - x7, - y7, - z7, - a7, - b7, - c7, - x8, - y8, - z8, - a8, - b8, - c8, - x9, - y9, - z9, - a9, - b9, - c9, - x10, - y12, - z10, - a10, - b10, - c10, - x11, - y13, - z11, - a11, - b11, - c11, - x12, - y14, - z12, - a12, - b12, - c12, - x13, - y15, - z13, - a13, - b13, - c13, - x14, - y16, - z14, - a14, - b14, - c14, - x15, - y17, - z15, - a15, - b15, - c15, - x16, - y18, - z16, - a16, - b16, - c16, - x17, - y19, - z17, - a17, - b17, - c17, - x18, - y10, - z18, - a18, - b18, - c18 - ]; + return [x1, y1, z1, a1, b1, c1, + x2, y2, z2, a2, b2, c2, + x3, y3, z3, a3, b3, c3, + x4, y4, z4, a4, b4, c4, + x5, y5, z5, a5, b5, c5, + x6, y6, z6, a6, b6, c6, + x7, y7, z7, a7, b7, c7, + x8, y8, z8, a8, b8, c8, + x9, y9, z9, a9, b9, c9, + x10, y12, z10, a10, b10, c10, + x11, y13, z11, a11, b11, c11, + x12, y14, z12, a12, b12, c12, + x13, y15, z13, a13, b13, c13, + x14, y16, z14, a14, b14, c14, + x15, y17, z15, a15, b15, c15, + x16, y18, z16, a16, b16, c16, + x17, y19, z17, a17, b17, c17, + x18, y10, z18, a18, b18, c18]; } diff --git a/tests/baselines/reference/genericsWithDuplicateTypeParameters1.js b/tests/baselines/reference/genericsWithDuplicateTypeParameters1.js index f7f638f10e0..72eeb1ab683 100644 --- a/tests/baselines/reference/genericsWithDuplicateTypeParameters1.js +++ b/tests/baselines/reference/genericsWithDuplicateTypeParameters1.js @@ -17,25 +17,16 @@ var m = { } //// [genericsWithDuplicateTypeParameters1.js] -function f() { -} -function f2(a, b) { - return null; -} +function f() { } +function f2(a, b) { return null; } var C = (function () { function C() { } - C.prototype.f = function () { - }; - C.prototype.f2 = function (a, b) { - return null; - }; + C.prototype.f = function () { }; + C.prototype.f2 = function (a, b) { return null; }; return C; })(); var m = { - a: function f() { - }, - b: function f2(a, b) { - return null; - } + a: function f() { }, + b: function f2(a, b) { return null; } }; diff --git a/tests/baselines/reference/genericsWithoutTypeParameters1.js b/tests/baselines/reference/genericsWithoutTypeParameters1.js index b4bc079cf80..41abffcb854 100644 --- a/tests/baselines/reference/genericsWithoutTypeParameters1.js +++ b/tests/baselines/reference/genericsWithoutTypeParameters1.js @@ -37,29 +37,17 @@ function f(x: T): A { var C = (function () { function C() { } - C.prototype.foo = function () { - return null; - }; + C.prototype.foo = function () { return null; }; return C; })(); var c1; var i1; var c2; var i2; -function foo(x, y) { -} -function foo2(x, y) { -} -var x = { - a: new C() -}; -var x2 = { - a: { - bar: function () { - return 1; - } - } -}; +function foo(x, y) { } +function foo2(x, y) { } +var x = { a: new C() }; +var x2 = { a: { bar: function () { return 1; } } }; var D = (function () { function D() { } diff --git a/tests/baselines/reference/getAndSetAsMemberNames.js b/tests/baselines/reference/getAndSetAsMemberNames.js index 22f99920fb1..8b036cd0f73 100644 --- a/tests/baselines/reference/getAndSetAsMemberNames.js +++ b/tests/baselines/reference/getAndSetAsMemberNames.js @@ -49,16 +49,11 @@ var C4 = (function () { })(); var C5 = (function () { function C5() { - this.set = function () { - return true; - }; + this.set = function () { return true; }; } - C5.prototype.get = function () { - return true; - }; + C5.prototype.get = function () { return true; }; Object.defineProperty(C5.prototype, "t", { - set: function (x) { - }, + set: function (x) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/getAndSetNotIdenticalType.js b/tests/baselines/reference/getAndSetNotIdenticalType.js index 7e77fc25d0b..e6eb7fecc86 100644 --- a/tests/baselines/reference/getAndSetNotIdenticalType.js +++ b/tests/baselines/reference/getAndSetNotIdenticalType.js @@ -14,8 +14,7 @@ var C = (function () { get: function () { return 1; }, - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/getsetReturnTypes.js b/tests/baselines/reference/getsetReturnTypes.js index 55d7e9285b0..27b6fc52fe5 100644 --- a/tests/baselines/reference/getsetReturnTypes.js +++ b/tests/baselines/reference/getsetReturnTypes.js @@ -10,9 +10,7 @@ var y: number = makePoint(2).x; //// [getsetReturnTypes.js] function makePoint(x) { return { - get x() { - return x; - } + get x() { return x; } }; } ; diff --git a/tests/baselines/reference/getterSetterNonAccessor.js b/tests/baselines/reference/getterSetterNonAccessor.js index e234574d734..c28337ff7b4 100644 --- a/tests/baselines/reference/getterSetterNonAccessor.js +++ b/tests/baselines/reference/getterSetterNonAccessor.js @@ -10,11 +10,8 @@ Object.defineProperty({}, "0", ({ //// [getterSetterNonAccessor.js] -function getFunc() { - return 0; -} -function setFunc(v) { -} +function getFunc() { return 0; } +function setFunc(v) { } Object.defineProperty({}, "0", ({ get: getFunc, set: setFunc, diff --git a/tests/baselines/reference/gettersAndSetters.js b/tests/baselines/reference/gettersAndSetters.js index ded54213401..92f959e5988 100644 --- a/tests/baselines/reference/gettersAndSetters.js +++ b/tests/baselines/reference/gettersAndSetters.js @@ -46,31 +46,21 @@ var C = (function () { function C() { this.fooBack = ""; this.bazBack = ""; - this.get = function () { - }; // ok - this.set = function () { - }; // ok + this.get = function () { }; // ok + this.set = function () { }; // ok } Object.defineProperty(C.prototype, "Foo", { - get: function () { - return this.fooBack; - } // ok + get: function () { return this.fooBack; } // ok , - set: function (foo) { - this.fooBack = foo; - } // ok + set: function (foo) { this.fooBack = foo; } // ok , enumerable: true, configurable: true }); Object.defineProperty(C, "Bar", { - get: function () { - return C.barBack; - } // ok + get: function () { return C.barBack; } // ok , - set: function (bar) { - C.barBack = bar; - } // ok + set: function (bar) { C.barBack = bar; } // ok , enumerable: true, configurable: true @@ -86,16 +76,7 @@ C.Bar = "barv"; var baz = c.Baz; c.Baz = "bazv"; // The Foo accessors' return and param types should be contextually typed to the Foo field -var o = { - get Foo() { - return 0; - }, - set Foo(val) { - val; - } -}; // o +var o = { get Foo() { return 0; }, set Foo(val) { val; } }; // o var ofg = o.Foo; o.Foo = 0; -var i = function (n) { - return n; -}; +var i = function (n) { return n; }; diff --git a/tests/baselines/reference/gettersAndSettersAccessibility.js b/tests/baselines/reference/gettersAndSettersAccessibility.js index 9a7564ec96d..e0cfa3d17c5 100644 --- a/tests/baselines/reference/gettersAndSettersAccessibility.js +++ b/tests/baselines/reference/gettersAndSettersAccessibility.js @@ -10,11 +10,8 @@ var C99 = (function () { function C99() { } Object.defineProperty(C99.prototype, "Baz", { - get: function () { - return 0; - }, - set: function (n) { - } // error - accessors do not agree in visibility + get: function () { return 0; }, + set: function (n) { } // error - accessors do not agree in visibility , enumerable: true, configurable: true diff --git a/tests/baselines/reference/gettersAndSettersErrors.js b/tests/baselines/reference/gettersAndSettersErrors.js index 514a69b2513..d92f0d833f5 100644 --- a/tests/baselines/reference/gettersAndSettersErrors.js +++ b/tests/baselines/reference/gettersAndSettersErrors.js @@ -22,23 +22,17 @@ var C = (function () { this.Foo = 0; // error - duplicate identifier Foo - confirmed } Object.defineProperty(C.prototype, "Foo", { - get: function () { - return "foo"; - } // ok + get: function () { return "foo"; } // ok , - set: function (foo) { - } // ok + set: function (foo) { } // ok , enumerable: true, configurable: true }); Object.defineProperty(C.prototype, "Goo", { - get: function (v) { - return null; - } // error - getters must not have a parameter + get: function (v) { return null; } // error - getters must not have a parameter , - set: function (v) { - } // error - setters must not specify a return type + set: function (v) { } // error - setters must not specify a return type , enumerable: true, configurable: true @@ -49,11 +43,8 @@ var E = (function () { function E() { } Object.defineProperty(E.prototype, "Baz", { - get: function () { - return 0; - }, - set: function (n) { - } // error - accessors do not agree in visibility + get: function () { return 0; }, + set: function (n) { } // error - accessors do not agree in visibility , enumerable: true, configurable: true diff --git a/tests/baselines/reference/gettersAndSettersTypesAgree.js b/tests/baselines/reference/gettersAndSettersTypesAgree.js index 695a77a001a..91d3d844981 100644 --- a/tests/baselines/reference/gettersAndSettersTypesAgree.js +++ b/tests/baselines/reference/gettersAndSettersTypesAgree.js @@ -15,40 +15,22 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { - get: function () { - return "foo"; - } // ok + get: function () { return "foo"; } // ok , - set: function (foo) { - } // ok - type inferred from getter return statement + set: function (foo) { } // ok - type inferred from getter return statement , enumerable: true, configurable: true }); Object.defineProperty(C.prototype, "Bar", { - get: function () { - return "foo"; - } // ok + get: function () { return "foo"; } // ok , - set: function (bar) { - } // ok - type must be declared + set: function (bar) { } // ok - type must be declared , enumerable: true, configurable: true }); return C; })(); -var o1 = { - get Foo() { - return 0; - }, - set Foo(val) { - } -}; // ok - types agree (inference) -var o2 = { - get Foo() { - return 0; - }, - set Foo(val) { - } -}; // ok - types agree +var o1 = { get Foo() { return 0; }, set Foo(val) { } }; // ok - types agree (inference) +var o2 = { get Foo() { return 0; }, set Foo(val) { } }; // ok - types agree diff --git a/tests/baselines/reference/giant.js b/tests/baselines/reference/giant.js index cc532ff43d9..4409933bb19 100644 --- a/tests/baselines/reference/giant.js +++ b/tests/baselines/reference/giant.js @@ -697,55 +697,45 @@ define(["require", "exports"], function (require, exports) { MAX DEPTH 3 LEVELS */ var V; - function F() { - } + function F() { } ; var C = (function () { function C() { } - C.prototype.pF = function () { - }; - C.prototype.rF = function () { - }; - C.prototype.pgF = function () { - }; + C.prototype.pF = function () { }; + C.prototype.rF = function () { }; + C.prototype.pgF = function () { }; Object.defineProperty(C.prototype, "pgF", { get: function () { }, enumerable: true, configurable: true }); - C.prototype.psF = function (param) { - }; + C.prototype.psF = function (param) { }; Object.defineProperty(C.prototype, "psF", { set: function (param) { }, enumerable: true, configurable: true }); - C.prototype.rgF = function () { - }; + C.prototype.rgF = function () { }; Object.defineProperty(C.prototype, "rgF", { get: function () { }, enumerable: true, configurable: true }); - C.prototype.rsF = function (param) { - }; + C.prototype.rsF = function (param) { }; Object.defineProperty(C.prototype, "rsF", { set: function (param) { }, enumerable: true, configurable: true }); - C.tF = function () { - }; - C.tsF = function (param) { - }; + C.tF = function () { }; + C.tsF = function (param) { }; Object.defineProperty(C, "tsF", { set: function (param) { }, enumerable: true, configurable: true }); - C.tgF = function () { - }; + C.tgF = function () { }; Object.defineProperty(C, "tgF", { get: function () { }, enumerable: true, @@ -756,55 +746,45 @@ define(["require", "exports"], function (require, exports) { var M; (function (M_1) { var V; - function F() { - } + function F() { } ; var C = (function () { function C() { } - C.prototype.pF = function () { - }; - C.prototype.rF = function () { - }; - C.prototype.pgF = function () { - }; + C.prototype.pF = function () { }; + C.prototype.rF = function () { }; + C.prototype.pgF = function () { }; Object.defineProperty(C.prototype, "pgF", { get: function () { }, enumerable: true, configurable: true }); - C.prototype.psF = function (param) { - }; + C.prototype.psF = function (param) { }; Object.defineProperty(C.prototype, "psF", { set: function (param) { }, enumerable: true, configurable: true }); - C.prototype.rgF = function () { - }; + C.prototype.rgF = function () { }; Object.defineProperty(C.prototype, "rgF", { get: function () { }, enumerable: true, configurable: true }); - C.prototype.rsF = function (param) { - }; + C.prototype.rsF = function (param) { }; Object.defineProperty(C.prototype, "rsF", { set: function (param) { }, enumerable: true, configurable: true }); - C.tF = function () { - }; - C.tsF = function (param) { - }; + C.tF = function () { }; + C.tsF = function (param) { }; Object.defineProperty(C, "tsF", { set: function (param) { }, enumerable: true, configurable: true }); - C.tgF = function () { - }; + C.tgF = function () { }; Object.defineProperty(C, "tgF", { get: function () { }, enumerable: true, @@ -815,8 +795,7 @@ define(["require", "exports"], function (require, exports) { var M; (function (M) { var V; - function F() { - } + function F() { } ; var C = (function () { function C() { @@ -827,8 +806,7 @@ define(["require", "exports"], function (require, exports) { ; ; M.eV; - function eF() { - } + function eF() { } M.eF = eF; ; var eC = (function () { @@ -845,56 +823,46 @@ define(["require", "exports"], function (require, exports) { ; })(M || (M = {})); M_1.eV; - function eF() { - } + function eF() { } M_1.eF = eF; ; var eC = (function () { function eC() { } - eC.prototype.pF = function () { - }; - eC.prototype.rF = function () { - }; - eC.prototype.pgF = function () { - }; + eC.prototype.pF = function () { }; + eC.prototype.rF = function () { }; + eC.prototype.pgF = function () { }; Object.defineProperty(eC.prototype, "pgF", { get: function () { }, enumerable: true, configurable: true }); - eC.prototype.psF = function (param) { - }; + eC.prototype.psF = function (param) { }; Object.defineProperty(eC.prototype, "psF", { set: function (param) { }, enumerable: true, configurable: true }); - eC.prototype.rgF = function () { - }; + eC.prototype.rgF = function () { }; Object.defineProperty(eC.prototype, "rgF", { get: function () { }, enumerable: true, configurable: true }); - eC.prototype.rsF = function (param) { - }; + eC.prototype.rsF = function (param) { }; Object.defineProperty(eC.prototype, "rsF", { set: function (param) { }, enumerable: true, configurable: true }); - eC.tF = function () { - }; - eC.tsF = function (param) { - }; + eC.tF = function () { }; + eC.tsF = function (param) { }; Object.defineProperty(eC, "tsF", { set: function (param) { }, enumerable: true, configurable: true }); - eC.tgF = function () { - }; + eC.tgF = function () { }; Object.defineProperty(eC, "tgF", { get: function () { }, enumerable: true, @@ -906,8 +874,7 @@ define(["require", "exports"], function (require, exports) { var eM; (function (eM) { var V; - function F() { - } + function F() { } ; var C = (function () { function C() { @@ -918,8 +885,7 @@ define(["require", "exports"], function (require, exports) { ; ; eM.eV; - function eF() { - } + function eF() { } eM.eF = eF; ; var eC = (function () { @@ -938,56 +904,46 @@ define(["require", "exports"], function (require, exports) { ; })(M || (M = {})); exports.eV; - function eF() { - } + function eF() { } exports.eF = eF; ; var eC = (function () { function eC() { } - eC.prototype.pF = function () { - }; - eC.prototype.rF = function () { - }; - eC.prototype.pgF = function () { - }; + eC.prototype.pF = function () { }; + eC.prototype.rF = function () { }; + eC.prototype.pgF = function () { }; Object.defineProperty(eC.prototype, "pgF", { get: function () { }, enumerable: true, configurable: true }); - eC.prototype.psF = function (param) { - }; + eC.prototype.psF = function (param) { }; Object.defineProperty(eC.prototype, "psF", { set: function (param) { }, enumerable: true, configurable: true }); - eC.prototype.rgF = function () { - }; + eC.prototype.rgF = function () { }; Object.defineProperty(eC.prototype, "rgF", { get: function () { }, enumerable: true, configurable: true }); - eC.prototype.rsF = function (param) { - }; + eC.prototype.rsF = function (param) { }; Object.defineProperty(eC.prototype, "rsF", { set: function (param) { }, enumerable: true, configurable: true }); - eC.tF = function () { - }; - eC.tsF = function (param) { - }; + eC.tF = function () { }; + eC.tsF = function (param) { }; Object.defineProperty(eC, "tsF", { set: function (param) { }, enumerable: true, configurable: true }); - eC.tgF = function () { - }; + eC.tgF = function () { }; Object.defineProperty(eC, "tgF", { get: function () { }, enumerable: true, @@ -999,55 +955,45 @@ define(["require", "exports"], function (require, exports) { var eM; (function (eM_1) { var V; - function F() { - } + function F() { } ; var C = (function () { function C() { } - C.prototype.pF = function () { - }; - C.prototype.rF = function () { - }; - C.prototype.pgF = function () { - }; + C.prototype.pF = function () { }; + C.prototype.rF = function () { }; + C.prototype.pgF = function () { }; Object.defineProperty(C.prototype, "pgF", { get: function () { }, enumerable: true, configurable: true }); - C.prototype.psF = function (param) { - }; + C.prototype.psF = function (param) { }; Object.defineProperty(C.prototype, "psF", { set: function (param) { }, enumerable: true, configurable: true }); - C.prototype.rgF = function () { - }; + C.prototype.rgF = function () { }; Object.defineProperty(C.prototype, "rgF", { get: function () { }, enumerable: true, configurable: true }); - C.prototype.rsF = function (param) { - }; + C.prototype.rsF = function (param) { }; Object.defineProperty(C.prototype, "rsF", { set: function (param) { }, enumerable: true, configurable: true }); - C.tF = function () { - }; - C.tsF = function (param) { - }; + C.tF = function () { }; + C.tsF = function (param) { }; Object.defineProperty(C, "tsF", { set: function (param) { }, enumerable: true, configurable: true }); - C.tgF = function () { - }; + C.tgF = function () { }; Object.defineProperty(C, "tgF", { get: function () { }, enumerable: true, @@ -1058,8 +1004,7 @@ define(["require", "exports"], function (require, exports) { var M; (function (M) { var V; - function F() { - } + function F() { } ; var C = (function () { function C() { @@ -1070,8 +1015,7 @@ define(["require", "exports"], function (require, exports) { ; ; M.eV; - function eF() { - } + function eF() { } M.eF = eF; ; var eC = (function () { @@ -1088,56 +1032,46 @@ define(["require", "exports"], function (require, exports) { ; })(M || (M = {})); eM_1.eV; - function eF() { - } + function eF() { } eM_1.eF = eF; ; var eC = (function () { function eC() { } - eC.prototype.pF = function () { - }; - eC.prototype.rF = function () { - }; - eC.prototype.pgF = function () { - }; + eC.prototype.pF = function () { }; + eC.prototype.rF = function () { }; + eC.prototype.pgF = function () { }; Object.defineProperty(eC.prototype, "pgF", { get: function () { }, enumerable: true, configurable: true }); - eC.prototype.psF = function (param) { - }; + eC.prototype.psF = function (param) { }; Object.defineProperty(eC.prototype, "psF", { set: function (param) { }, enumerable: true, configurable: true }); - eC.prototype.rgF = function () { - }; + eC.prototype.rgF = function () { }; Object.defineProperty(eC.prototype, "rgF", { get: function () { }, enumerable: true, configurable: true }); - eC.prototype.rsF = function (param) { - }; + eC.prototype.rsF = function (param) { }; Object.defineProperty(eC.prototype, "rsF", { set: function (param) { }, enumerable: true, configurable: true }); - eC.tF = function () { - }; - eC.tsF = function (param) { - }; + eC.tF = function () { }; + eC.tsF = function (param) { }; Object.defineProperty(eC, "tsF", { set: function (param) { }, enumerable: true, configurable: true }); - eC.tgF = function () { - }; + eC.tgF = function () { }; Object.defineProperty(eC, "tgF", { get: function () { }, enumerable: true, @@ -1149,8 +1083,7 @@ define(["require", "exports"], function (require, exports) { var eM; (function (eM) { var V; - function F() { - } + function F() { } ; var C = (function () { function C() { @@ -1161,8 +1094,7 @@ define(["require", "exports"], function (require, exports) { ; ; eM.eV; - function eF() { - } + function eF() { } eM.eF = eF; ; var eC = (function () { diff --git a/tests/baselines/reference/globalThisCapture.js b/tests/baselines/reference/globalThisCapture.js index 5e724d77e0f..b854e754a34 100644 --- a/tests/baselines/reference/globalThisCapture.js +++ b/tests/baselines/reference/globalThisCapture.js @@ -11,9 +11,7 @@ parts[0]; //// [globalThisCapture.js] var _this = this; // Add a lambda to ensure global 'this' capture is triggered -(function () { - return _this.window; -}); +(function () { return _this.window; }); var parts = []; // Ensure that the generated code is correct parts[0]; diff --git a/tests/baselines/reference/grammarAmbiguities.js b/tests/baselines/reference/grammarAmbiguities.js index ee81d947ff6..f603bd1023f 100644 --- a/tests/baselines/reference/grammarAmbiguities.js +++ b/tests/baselines/reference/grammarAmbiguities.js @@ -12,12 +12,8 @@ f(g < A, B > +(7)); // Should error //// [grammarAmbiguities.js] -function f(n) { - return null; -} -function g(x) { - return null; -} +function f(n) { return null; } +function g(x) { return null; } var A, B; f(g(7)); f(g < A, B > 7); // Should error diff --git a/tests/baselines/reference/grammarAmbiguities1.js b/tests/baselines/reference/grammarAmbiguities1.js index cb6e4b75473..1917acb7128 100644 --- a/tests/baselines/reference/grammarAmbiguities1.js +++ b/tests/baselines/reference/grammarAmbiguities1.js @@ -14,23 +14,17 @@ f(g < A, B > +(7)); var A = (function () { function A() { } - A.prototype.foo = function () { - }; + A.prototype.foo = function () { }; return A; })(); var B = (function () { function B() { } - B.prototype.bar = function () { - }; + B.prototype.bar = function () { }; return B; })(); -function f(x) { - return x; -} -function g(x) { - return f(x); -} +function f(x) { return x; } +function g(x) { return f(x); } g(7); f(g(7)); f(g < A, B > 7); diff --git a/tests/baselines/reference/heterogeneousArrayAndOverloads.js b/tests/baselines/reference/heterogeneousArrayAndOverloads.js index f18cef71307..b816b87e3d1 100644 --- a/tests/baselines/reference/heterogeneousArrayAndOverloads.js +++ b/tests/baselines/reference/heterogeneousArrayAndOverloads.js @@ -15,25 +15,12 @@ class arrTest { var arrTest = (function () { function arrTest() { } - arrTest.prototype.test = function (arg1) { - }; + arrTest.prototype.test = function (arg1) { }; arrTest.prototype.callTest = function () { - this.test([ - 1, - 2, - 3, - 5 - ]); - this.test([ - "hi" - ]); + this.test([1, 2, 3, 5]); + this.test(["hi"]); this.test([]); - this.test([ - 1, - 2, - "hi", - 5 - ]); // Error + this.test([1, 2, "hi", 5]); // Error }; return arrTest; })(); diff --git a/tests/baselines/reference/heterogeneousArrayLiterals.js b/tests/baselines/reference/heterogeneousArrayLiterals.js index 51d316a4f43..4ac929305c0 100644 --- a/tests/baselines/reference/heterogeneousArrayLiterals.js +++ b/tests/baselines/reference/heterogeneousArrayLiterals.js @@ -139,106 +139,20 @@ var __extends = this.__extends || function (d, b) { __.prototype = b.prototype; d.prototype = new __(); }; -var a = [ - 1, - '' -]; // {}[] -var b = [ - 1, - null -]; // number[] -var c = [ - 1, - '', - null -]; // {}[] -var d = [ - {}, - 1 -]; // {}[] -var e = [ - {}, - Object -]; // {}[] -var f = [ - [], - [ - 1 - ] -]; // number[][] -var g = [ - [ - 1 - ], - [ - '' - ] -]; // {}[] -var h = [ - { - foo: 1, - bar: '' - }, - { - foo: 2 - } -]; // {foo: number}[] -var i = [ - { - foo: 1, - bar: '' - }, - { - foo: '' - } -]; // {}[] -var j = [ - function () { - return 1; - }, - function () { - return ''; - } -]; // {}[] -var k = [ - function () { - return 1; - }, - function () { - return 1; - } -]; // { (): number }[] -var l = [ - function () { - return 1; - }, - function () { - return null; - } -]; // { (): any }[] -var m = [ - function () { - return 1; - }, - function () { - return ''; - }, - function () { - return null; - } -]; // { (): any }[] -var n = [ - [ - function () { - return 1; - } - ], - [ - function () { - return ''; - } - ] -]; // {}[] +var a = [1, '']; // {}[] +var b = [1, null]; // number[] +var c = [1, '', null]; // {}[] +var d = [{}, 1]; // {}[] +var e = [{}, Object]; // {}[] +var f = [[], [1]]; // number[][] +var g = [[1], ['']]; // {}[] +var h = [{ foo: 1, bar: '' }, { foo: 2 }]; // {foo: number}[] +var i = [{ foo: 1, bar: '' }, { foo: '' }]; // {}[] +var j = [function () { return 1; }, function () { return ''; }]; // {}[] +var k = [function () { return 1; }, function () { return 1; }]; // { (): number }[] +var l = [function () { return 1; }, function () { return null; }]; // { (): any }[] +var m = [function () { return 1; }, function () { return ''; }, function () { return null; }]; // { (): any }[] +var n = [[function () { return 1; }], [function () { return ''; }]]; // {}[] var Base = (function () { function Base() { } @@ -263,312 +177,69 @@ var derived; var derived2; var Derived; (function (Derived) { - var h = [ - { - foo: base, - basear: derived - }, - { - foo: base - } - ]; // {foo: Base}[] - var i = [ - { - foo: base, - basear: derived - }, - { - foo: derived - } - ]; // {foo: Derived}[] - var j = [ - function () { - return base; - }, - function () { - return derived; - } - ]; // { {}: Base } - var k = [ - function () { - return base; - }, - function () { - return 1; - } - ]; // {}[]~ - var l = [ - function () { - return base; - }, - function () { - return null; - } - ]; // { (): any }[] - var m = [ - function () { - return base; - }, - function () { - return derived; - }, - function () { - return null; - } - ]; // { (): any }[] - var n = [ - [ - function () { - return base; - } - ], - [ - function () { - return derived; - } - ] - ]; // { (): Base }[] - var o = [ - derived, - derived2 - ]; // {}[] - var p = [ - derived, - derived2, - base - ]; // Base[] - var q = [ - [ - function () { - return derived2; - } - ], - [ - function () { - return derived; - } - ] - ]; // {}[] + var h = [{ foo: base, basear: derived }, { foo: base }]; // {foo: Base}[] + var i = [{ foo: base, basear: derived }, { foo: derived }]; // {foo: Derived}[] + var j = [function () { return base; }, function () { return derived; }]; // { {}: Base } + var k = [function () { return base; }, function () { return 1; }]; // {}[]~ + var l = [function () { return base; }, function () { return null; }]; // { (): any }[] + var m = [function () { return base; }, function () { return derived; }, function () { return null; }]; // { (): any }[] + var n = [[function () { return base; }], [function () { return derived; }]]; // { (): Base }[] + var o = [derived, derived2]; // {}[] + var p = [derived, derived2, base]; // Base[] + var q = [[function () { return derived2; }], [function () { return derived; }]]; // {}[] })(Derived || (Derived = {})); var WithContextualType; (function (WithContextualType) { // no errors - var a = [ - derived, - derived2 - ]; - var b = [ - null - ]; + var a = [derived, derived2]; + var b = [null]; var c = []; - var d = [ - function () { - return derived; - }, - function () { - return derived2; - } - ]; + var d = [function () { return derived; }, function () { return derived2; }]; })(WithContextualType || (WithContextualType = {})); function foo(t, u) { - var a = [ - t, - t - ]; // T[] - var b = [ - t, - null - ]; // T[] - var c = [ - t, - u - ]; // {}[] - var d = [ - t, - 1 - ]; // {}[] - var e = [ - function () { - return t; - }, - function () { - return u; - } - ]; // {}[] - var f = [ - function () { - return t; - }, - function () { - return u; - }, - function () { - return null; - } - ]; // { (): any }[] + var a = [t, t]; // T[] + var b = [t, null]; // T[] + var c = [t, u]; // {}[] + var d = [t, 1]; // {}[] + var e = [function () { return t; }, function () { return u; }]; // {}[] + var f = [function () { return t; }, function () { return u; }, function () { return null; }]; // { (): any }[] } function foo2(t, u) { - var a = [ - t, - t - ]; // T[] - var b = [ - t, - null - ]; // T[] - var c = [ - t, - u - ]; // {}[] - var d = [ - t, - 1 - ]; // {}[] - var e = [ - function () { - return t; - }, - function () { - return u; - } - ]; // {}[] - var f = [ - function () { - return t; - }, - function () { - return u; - }, - function () { - return null; - } - ]; // { (): any }[] - var g = [ - t, - base - ]; // Base[] - var h = [ - t, - derived - ]; // Derived[] - var i = [ - u, - base - ]; // Base[] - var j = [ - u, - derived - ]; // Derived[] + var a = [t, t]; // T[] + var b = [t, null]; // T[] + var c = [t, u]; // {}[] + var d = [t, 1]; // {}[] + var e = [function () { return t; }, function () { return u; }]; // {}[] + var f = [function () { return t; }, function () { return u; }, function () { return null; }]; // { (): any }[] + var g = [t, base]; // Base[] + var h = [t, derived]; // Derived[] + var i = [u, base]; // Base[] + var j = [u, derived]; // Derived[] } function foo3(t, u) { - var a = [ - t, - t - ]; // T[] - var b = [ - t, - null - ]; // T[] - var c = [ - t, - u - ]; // {}[] - var d = [ - t, - 1 - ]; // {}[] - var e = [ - function () { - return t; - }, - function () { - return u; - } - ]; // {}[] - var f = [ - function () { - return t; - }, - function () { - return u; - }, - function () { - return null; - } - ]; // { (): any }[] - var g = [ - t, - base - ]; // Base[] - var h = [ - t, - derived - ]; // Derived[] - var i = [ - u, - base - ]; // Base[] - var j = [ - u, - derived - ]; // Derived[] + var a = [t, t]; // T[] + var b = [t, null]; // T[] + var c = [t, u]; // {}[] + var d = [t, 1]; // {}[] + var e = [function () { return t; }, function () { return u; }]; // {}[] + var f = [function () { return t; }, function () { return u; }, function () { return null; }]; // { (): any }[] + var g = [t, base]; // Base[] + var h = [t, derived]; // Derived[] + var i = [u, base]; // Base[] + var j = [u, derived]; // Derived[] } function foo4(t, u) { - var a = [ - t, - t - ]; // T[] - var b = [ - t, - null - ]; // T[] - var c = [ - t, - u - ]; // BUG 821629 - var d = [ - t, - 1 - ]; // {}[] - var e = [ - function () { - return t; - }, - function () { - return u; - } - ]; // {}[] - var f = [ - function () { - return t; - }, - function () { - return u; - }, - function () { - return null; - } - ]; // { (): any }[] - var g = [ - t, - base - ]; // Base[] - var h = [ - t, - derived - ]; // Derived[] - var i = [ - u, - base - ]; // Base[] - var j = [ - u, - derived - ]; // Derived[] - var k = [ - t, - u - ]; + var a = [t, t]; // T[] + var b = [t, null]; // T[] + var c = [t, u]; // BUG 821629 + var d = [t, 1]; // {}[] + var e = [function () { return t; }, function () { return u; }]; // {}[] + var f = [function () { return t; }, function () { return u; }, function () { return null; }]; // { (): any }[] + var g = [t, base]; // Base[] + var h = [t, derived]; // Derived[] + var i = [u, base]; // Base[] + var j = [u, derived]; // Derived[] + var k = [t, u]; } //function foo3(t: T, u: U) { // var a = [t, t]; // T[] diff --git a/tests/baselines/reference/ifDoWhileStatements.js b/tests/baselines/reference/ifDoWhileStatements.js index db23ea4681c..793094584bf 100644 --- a/tests/baselines/reference/ifDoWhileStatements.js +++ b/tests/baselines/reference/ifDoWhileStatements.js @@ -186,12 +186,8 @@ var D = (function () { } return D; })(); -function F(x) { - return 42; -} -function F2(x) { - return x < 42; -} +function F(x) { return 42; } +function F2(x) { return x < 42; } var M; (function (M) { var A = (function () { @@ -200,9 +196,7 @@ var M; return A; })(); M.A = A; - function F2(x) { - return x.toString(); - } + function F2(x) { return x.toString(); } M.F2 = F2; })(M || (M = {})); var N; @@ -213,216 +207,101 @@ var N; return A; })(); N.A = A; - function F2(x) { - return x.toString(); - } + function F2(x) { return x.toString(); } N.F2 = F2; })(N || (N = {})); // literals -if (true) { -} -while (true) { -} -do { -} while (true); -if (null) { -} -while (null) { -} -do { -} while (null); -if (undefined) { -} -while (undefined) { -} -do { -} while (undefined); -if (0.0) { -} -while (0.0) { -} -do { -} while (0.0); -if ('a string') { -} -while ('a string') { -} -do { -} while ('a string'); -if ('') { -} -while ('') { -} -do { -} while (''); -if (/[a-z]/) { -} -while (/[a-z]/) { -} -do { -} while (/[a-z]/); -if ([]) { -} -while ([]) { -} -do { -} while ([]); -if ([ - 1, - 2 -]) { -} -while ([ - 1, - 2 -]) { -} -do { -} while ([ - 1, - 2 -]); -if ({}) { -} -while ({}) { -} -do { -} while ({}); -if ({ - x: 1, - y: 'a' -}) { -} -while ({ - x: 1, - y: 'a' -}) { -} -do { -} while ({ - x: 1, - y: 'a' -}); -if (function () { - return 43; -}) { -} -while (function () { - return 43; -}) { -} -do { -} while (function () { - return 43; -}); -if (new C()) { -} -while (new C()) { -} -do { -} while (new C()); -if (new D()) { -} -while (new D()) { -} -do { -} while (new D()); +if (true) { } +while (true) { } +do { } while (true); +if (null) { } +while (null) { } +do { } while (null); +if (undefined) { } +while (undefined) { } +do { } while (undefined); +if (0.0) { } +while (0.0) { } +do { } while (0.0); +if ('a string') { } +while ('a string') { } +do { } while ('a string'); +if ('') { } +while ('') { } +do { } while (''); +if (/[a-z]/) { } +while (/[a-z]/) { } +do { } while (/[a-z]/); +if ([]) { } +while ([]) { } +do { } while ([]); +if ([1, 2]) { } +while ([1, 2]) { } +do { } while ([1, 2]); +if ({}) { } +while ({}) { } +do { } while ({}); +if ({ x: 1, y: 'a' }) { } +while ({ x: 1, y: 'a' }) { } +do { } while ({ x: 1, y: 'a' }); +if (function () { return 43; }) { } +while (function () { return 43; }) { } +do { } while (function () { return 43; }); +if (new C()) { } +while (new C()) { } +do { } while (new C()); +if (new D()) { } +while (new D()) { } +do { } while (new D()); // references var a = true; -if (a) { -} -while (a) { -} -do { -} while (a); +if (a) { } +while (a) { } +do { } while (a); var b = null; -if (b) { -} -while (b) { -} -do { -} while (b); +if (b) { } +while (b) { } +do { } while (b); var c = undefined; -if (c) { -} -while (c) { -} -do { -} while (c); +if (c) { } +while (c) { } +do { } while (c); var d = 0.0; -if (d) { -} -while (d) { -} -do { -} while (d); +if (d) { } +while (d) { } +do { } while (d); var e = 'a string'; -if (e) { -} -while (e) { -} -do { -} while (e); +if (e) { } +while (e) { } +do { } while (e); var f = ''; -if (f) { -} -while (f) { -} -do { -} while (f); +if (f) { } +while (f) { } +do { } while (f); var g = /[a-z]/; -if (g) { -} -while (g) { -} -do { -} while (g); +if (g) { } +while (g) { } +do { } while (g); var h = []; -if (h) { -} -while (h) { -} -do { -} while (h); -var i = [ - 1, - 2 -]; -if (i) { -} -while (i) { -} -do { -} while (i); +if (h) { } +while (h) { } +do { } while (h); +var i = [1, 2]; +if (i) { } +while (i) { } +do { } while (i); var j = {}; -if (j) { -} -while (j) { -} -do { -} while (j); -var k = { - x: 1, - y: 'a' -}; -if (k) { -} -while (k) { -} -do { -} while (k); -function fn(x) { - return null; -} -if (fn()) { -} -while (fn()) { -} -do { -} while (fn()); -if (fn) { -} -while (fn) { -} -do { -} while (fn); +if (j) { } +while (j) { } +do { } while (j); +var k = { x: 1, y: 'a' }; +if (k) { } +while (k) { } +do { } while (k); +function fn(x) { return null; } +if (fn()) { } +while (fn()) { } +do { } while (fn()); +if (fn) { } +while (fn) { } +do { } while (fn); diff --git a/tests/baselines/reference/illegalSuperCallsInConstructor.js b/tests/baselines/reference/illegalSuperCallsInConstructor.js index 5fbad149b91..0bdcebed9c5 100644 --- a/tests/baselines/reference/illegalSuperCallsInConstructor.js +++ b/tests/baselines/reference/illegalSuperCallsInConstructor.js @@ -35,15 +35,9 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var r2 = function () { - return _super.call(this); - }; - var r3 = function () { - _super.call(this); - }; - var r4 = function () { - _super.call(this); - }; + var r2 = function () { return _super.call(this); }; + var r3 = function () { _super.call(this); }; + var r4 = function () { _super.call(this); }; var r5 = { get foo() { _super.call(this); diff --git a/tests/baselines/reference/implementsClauseAlreadySeen.js b/tests/baselines/reference/implementsClauseAlreadySeen.js index 84823c13fa8..abb28886615 100644 --- a/tests/baselines/reference/implementsClauseAlreadySeen.js +++ b/tests/baselines/reference/implementsClauseAlreadySeen.js @@ -15,7 +15,6 @@ var C = (function () { var D = (function () { function D() { } - D.prototype.baz = function () { - }; + D.prototype.baz = function () { }; return D; })(); diff --git a/tests/baselines/reference/implicitAnyCastedValue.js b/tests/baselines/reference/implicitAnyCastedValue.js index bc0855c838b..be6bd1bfef3 100644 --- a/tests/baselines/reference/implicitAnyCastedValue.js +++ b/tests/baselines/reference/implicitAnyCastedValue.js @@ -160,7 +160,4 @@ function multipleRets2(x) { var bar1 = null; var bar2 = undefined; var bar3 = 0; -var array = [ - null, - undefined -]; +var array = [null, undefined]; diff --git a/tests/baselines/reference/implicitAnyDeclareFunctionExprWithoutFormalType.js b/tests/baselines/reference/implicitAnyDeclareFunctionExprWithoutFormalType.js index cba7602d049..9bfad713d82 100644 --- a/tests/baselines/reference/implicitAnyDeclareFunctionExprWithoutFormalType.js +++ b/tests/baselines/reference/implicitAnyDeclareFunctionExprWithoutFormalType.js @@ -19,32 +19,15 @@ var lambda10 = function temp1() { return 5; } //// [implicitAnyDeclareFunctionExprWithoutFormalType.js] // these should be errors for implicit any parameter -var lambda = function (l1) { -}; // Error at "l1" -var lambd2 = function (ll1, ll2) { -}; // Error at "ll1" -var lamda3 = function myLambda3(myParam) { -}; -var lamda4 = function () { - return null; -}; +var lambda = function (l1) { }; // Error at "l1" +var lambd2 = function (ll1, ll2) { }; // Error at "ll1" +var lamda3 = function myLambda3(myParam) { }; +var lamda4 = function () { return null; }; // these should be error for implicit any return type -var lambda5 = function temp() { - return null; -}; -var lambda6 = function () { - return null; -}; -var lambda7 = function temp() { - return undefined; -}; -var lambda8 = function () { - return undefined; -}; +var lambda5 = function temp() { return null; }; +var lambda6 = function () { return null; }; +var lambda7 = function temp() { return undefined; }; +var lambda8 = function () { return undefined; }; // this shouldn't be an error -var lambda9 = function () { - return 5; -}; -var lambda10 = function temp1() { - return 5; -}; +var lambda9 = function () { return 5; }; +var lambda10 = function temp1() { return 5; }; diff --git a/tests/baselines/reference/implicitAnyDeclareFunctionWithoutFormalType.js b/tests/baselines/reference/implicitAnyDeclareFunctionWithoutFormalType.js index 6332f444487..c13479daff3 100644 --- a/tests/baselines/reference/implicitAnyDeclareFunctionWithoutFormalType.js +++ b/tests/baselines/reference/implicitAnyDeclareFunctionWithoutFormalType.js @@ -13,14 +13,11 @@ function noError2(x: number, y: string) { }; //// [implicitAnyDeclareFunctionWithoutFormalType.js] // these should be errors -function foo(x) { -} +function foo(x) { } ; -function bar(x, y) { -} +function bar(x, y) { } ; // error at "y"; no error at "x" -function func2(a, b, c) { -} +function func2(a, b, c) { } ; // error at "a,b,c" function func3() { var args = []; @@ -40,6 +37,5 @@ function noError1(x, y) { if (y === void 0) { y = 2; } } ; -function noError2(x, y) { -} +function noError2(x, y) { } ; diff --git a/tests/baselines/reference/implicitAnyDeclareMemberWithoutType2.js b/tests/baselines/reference/implicitAnyDeclareMemberWithoutType2.js index 1a49449529e..59d625fff4a 100644 --- a/tests/baselines/reference/implicitAnyDeclareMemberWithoutType2.js +++ b/tests/baselines/reference/implicitAnyDeclareMemberWithoutType2.js @@ -15,7 +15,6 @@ var C = (function () { function C(c1, c2, c3) { this.x = null; // error at "x" } // error at "c1, c2" - C.prototype.funcOfC = function (f1, f2, f3) { - }; // error at "f1,f2" + C.prototype.funcOfC = function (f1, f2, f3) { }; // error at "f1,f2" return C; })(); diff --git a/tests/baselines/reference/implicitAnyDeclareVariablesWithoutTypeAndInit.js b/tests/baselines/reference/implicitAnyDeclareVariablesWithoutTypeAndInit.js index ae09bf2e40e..e3c44e9b783 100644 --- a/tests/baselines/reference/implicitAnyDeclareVariablesWithoutTypeAndInit.js +++ b/tests/baselines/reference/implicitAnyDeclareVariablesWithoutTypeAndInit.js @@ -14,8 +14,7 @@ var x1: any; var y1 = new x1; //// [implicitAnyDeclareVariablesWithoutTypeAndInit.js] // this should be an error var x; // error at "x" -function func(k) { -} +function func(k) { } ; //error at "k" func(x); // this shouldn't be an error diff --git a/tests/baselines/reference/implicitAnyFromCircularInference.js b/tests/baselines/reference/implicitAnyFromCircularInference.js index b2ea707d176..d818ea17105 100644 --- a/tests/baselines/reference/implicitAnyFromCircularInference.js +++ b/tests/baselines/reference/implicitAnyFromCircularInference.js @@ -58,21 +58,15 @@ var b; var c; // Error expected var d; -function f() { - return f; -} +function f() { return f; } // Error expected -function g() { - return g(); -} +function g() { return g(); } // Error expected var f1 = function () { return f1(); }; // Error expected -var f2 = function () { - return f2(); -}; +var f2 = function () { return f2(); }; // Error expected function h() { return foo(); @@ -80,9 +74,7 @@ function h() { return h() || "hello"; } } -function foo(x) { - return "abc"; -} +function foo(x) { return "abc"; } var C = (function () { function C() { // Error expected diff --git a/tests/baselines/reference/implicitAnyFunctionInvocationWithAnyArguements.js b/tests/baselines/reference/implicitAnyFunctionInvocationWithAnyArguements.js index 21a3171b439..bc5b9453665 100644 --- a/tests/baselines/reference/implicitAnyFunctionInvocationWithAnyArguements.js +++ b/tests/baselines/reference/implicitAnyFunctionInvocationWithAnyArguements.js @@ -38,42 +38,28 @@ var newC2 = new C([], null) //// [implicitAnyFunctionInvocationWithAnyArguements.js] // this should be errors var arg0 = null; // error at "arg0" -var anyArray = [ - null, - undefined -]; // error at array literal +var anyArray = [null, undefined]; // error at array literal var objL; // error at "y,z" var funcL; -function temp1(arg1) { -} // error at "temp1" -function testFunctionExprC(subReplace) { -} -function testFunctionExprC2(eq) { -} +function temp1(arg1) { } // error at "temp1" +function testFunctionExprC(subReplace) { } +function testFunctionExprC2(eq) { } ; -function testObjLiteral(objLit) { -} +function testObjLiteral(objLit) { } ; -function testFuncLiteral(funcLit) { -} +function testFuncLiteral(funcLit) { } ; // this should not be an error -testFunctionExprC2(function (v1, v2) { - return 1; -}); +testFunctionExprC2(function (v1, v2) { return 1; }); testObjLiteral(objL); testFuncLiteral(funcL); var k = temp1(null); var result = temp1(arg0); var result1 = temp1(anyArray); -function noError(variable, array) { -} +function noError(variable, array) { } noError(null, []); noError(undefined, []); -noError(null, [ - null, - undefined -]); +noError(null, [null, undefined]); noError(undefined, anyArray); var C = (function () { function C(emtpyArray, variable) { diff --git a/tests/baselines/reference/implicitAnyFunctionReturnNullOrUndefined.js b/tests/baselines/reference/implicitAnyFunctionReturnNullOrUndefined.js index 699b57603eb..82eb56fbde6 100644 --- a/tests/baselines/reference/implicitAnyFunctionReturnNullOrUndefined.js +++ b/tests/baselines/reference/implicitAnyFunctionReturnNullOrUndefined.js @@ -26,12 +26,8 @@ undefinedWidenFunction(); //// [implicitAnyFunctionReturnNullOrUndefined.js] // this should be an error -function nullWidenFunction() { - return null; -} // error at "nullWidenFunction" -function undefinedWidenFunction() { - return undefined; -} // error at "undefinedWidenFunction" +function nullWidenFunction() { return null; } // error at "nullWidenFunction" +function undefinedWidenFunction() { return undefined; } // error at "undefinedWidenFunction" var C = (function () { function C() { } @@ -44,18 +40,10 @@ var C = (function () { return C; })(); // this should not be an error -function foo1() { - return null; -} -function bar1() { - return undefined; -} -function fooBar() { - return 1; -} -function fooFoo() { - return 5; -} +function foo1() { return null; } +function bar1() { return undefined; } +function fooBar() { return 1; } +function fooFoo() { return 5; } // this should not be an error as the error is raised by expr above nullWidenFunction(); undefinedWidenFunction(); diff --git a/tests/baselines/reference/implicitAnyGenericTypeInference.js b/tests/baselines/reference/implicitAnyGenericTypeInference.js index 37ef042f262..583ab7f0b01 100644 --- a/tests/baselines/reference/implicitAnyGenericTypeInference.js +++ b/tests/baselines/reference/implicitAnyGenericTypeInference.js @@ -10,9 +10,5 @@ var r = c.compareTo(1, ''); //// [implicitAnyGenericTypeInference.js] var c; -c = { - compareTo: function (x, y) { - return y; - } -}; +c = { compareTo: function (x, y) { return y; } }; var r = c.compareTo(1, ''); diff --git a/tests/baselines/reference/implicitAnyGenerics.js b/tests/baselines/reference/implicitAnyGenerics.js index a5c98590a8f..daea0dfe54c 100644 --- a/tests/baselines/reference/implicitAnyGenerics.js +++ b/tests/baselines/reference/implicitAnyGenerics.js @@ -46,9 +46,7 @@ var d2 = new D(1); var d3 = new D(1); var d4 = new D(1); var d5 = new D(null); -function foo() { - return null; -} +function foo() { return null; } ; foo(); foo(); diff --git a/tests/baselines/reference/implicitAnyInCatch.js b/tests/baselines/reference/implicitAnyInCatch.js index 29a2e03a130..c35e92372e3 100644 --- a/tests/baselines/reference/implicitAnyInCatch.js +++ b/tests/baselines/reference/implicitAnyInCatch.js @@ -16,14 +16,11 @@ class C { //// [implicitAnyInCatch.js] // this should not be an error -try { -} +try { } catch (error) { - if (error.number === -2147024809) { - } -} -for (var key in this) { + if (error.number === -2147024809) { } } +for (var key in this) { } var C = (function () { function C() { } diff --git a/tests/baselines/reference/implicitAnyNewExprLackConstructorSignature.js b/tests/baselines/reference/implicitAnyNewExprLackConstructorSignature.js index 4218d9a9a21..9e558122b15 100644 --- a/tests/baselines/reference/implicitAnyNewExprLackConstructorSignature.js +++ b/tests/baselines/reference/implicitAnyNewExprLackConstructorSignature.js @@ -3,7 +3,5 @@ function Point() { this.x = 3; } var x: any = new Point(); // error at "new" //// [implicitAnyNewExprLackConstructorSignature.js] -function Point() { - this.x = 3; -} +function Point() { this.x = 3; } var x = new Point(); // error at "new" diff --git a/tests/baselines/reference/implicitAnyWidenToAny.js b/tests/baselines/reference/implicitAnyWidenToAny.js index 01ad0dcb9b2..838593a88ef 100644 --- a/tests/baselines/reference/implicitAnyWidenToAny.js +++ b/tests/baselines/reference/implicitAnyWidenToAny.js @@ -31,10 +31,7 @@ var obj1 = anyReturnFunc(); // these should be errors var x = null; // error at "x" var x1 = undefined; // error at "x1" -var widenArray = [ - null, - undefined -]; // error at "widenArray" +var widenArray = [null, undefined]; // error at "widenArray" var emptyArray = []; // error at "emptyArray" // these should not be error var AnimalObj = (function () { @@ -47,28 +44,13 @@ var bar = "Hello World"; var foo1 = null; var foo2 = undefined; var temp = 5; -var c = { - x: null -}; -var array1 = [ - "Bob", - 2 -]; +var c = { x: null }; +var array1 = ["Bob", 2]; var array2 = []; -var array3 = [ - null, - undefined -]; -var array4 = [ - null, - undefined -]; -var array5 = [ - null, - undefined -]; +var array3 = [null, undefined]; +var array4 = [null, undefined]; +var array5 = [null, undefined]; var objLit; -function anyReturnFunc() { -} +function anyReturnFunc() { } var obj0 = new objLit(1); var obj1 = anyReturnFunc(); diff --git a/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.js b/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.js index 35992b86fec..3329fb810a7 100644 --- a/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.js +++ b/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.js @@ -17,8 +17,7 @@ module m_private { //// [importAliasAnExternalModuleInsideAnInternalModule_file0.js] var m; (function (m) { - function foo() { - } + function foo() { } m.foo = foo; })(m = exports.m || (exports.m = {})); //// [importAliasAnExternalModuleInsideAnInternalModule_file1.js] diff --git a/tests/baselines/reference/importAliasIdentifiers.js b/tests/baselines/reference/importAliasIdentifiers.js index 620fdf13866..7bd15b28c66 100644 --- a/tests/baselines/reference/importAliasIdentifiers.js +++ b/tests/baselines/reference/importAliasIdentifiers.js @@ -69,27 +69,18 @@ var clodule = (function () { })(); var clodule; (function (clodule) { - var Point = { - x: 0, - y: 0 - }; + var Point = { x: 0, y: 0 }; })(clodule || (clodule = {})); var clolias = clodule; var p; var p; var p; function fundule() { - return { - x: 0, - y: 0 - }; + return { x: 0, y: 0 }; } var fundule; (function (fundule) { - var Point = { - x: 0, - y: 0 - }; + var Point = { x: 0, y: 0 }; })(fundule || (fundule = {})); var funlias = fundule; var p; diff --git a/tests/baselines/reference/importAsBaseClass.js b/tests/baselines/reference/importAsBaseClass.js index 9e52c4dd067..8114e88ca4b 100644 --- a/tests/baselines/reference/importAsBaseClass.js +++ b/tests/baselines/reference/importAsBaseClass.js @@ -14,9 +14,7 @@ class Hello extends Greeter { } var Greeter = (function () { function Greeter() { } - Greeter.prototype.greet = function () { - return 'greet'; - }; + Greeter.prototype.greet = function () { return 'greet'; }; return Greeter; })(); exports.Greeter = Greeter; diff --git a/tests/baselines/reference/importDecl.js b/tests/baselines/reference/importDecl.js index d6f2855908e..9d4839e5e7c 100644 --- a/tests/baselines/reference/importDecl.js +++ b/tests/baselines/reference/importDecl.js @@ -89,9 +89,7 @@ var d = (function () { })(); exports.d = d; exports.x; -function foo() { - return null; -} +function foo() { return null; } exports.foo = foo; //// [importDecl_require1.js] var d = (function () { @@ -101,9 +99,7 @@ var d = (function () { })(); exports.d = d; var x; -function foo() { - return null; -} +function foo() { return null; } exports.foo = foo; //// [importDecl_require2.js] var d = (function () { @@ -113,9 +109,7 @@ var d = (function () { })(); exports.d = d; exports.x; -function foo() { - return null; -} +function foo() { return null; } exports.foo = foo; //// [importDecl_require3.js] var d = (function () { @@ -125,14 +119,10 @@ var d = (function () { })(); exports.d = d; exports.x; -function foo() { - return null; -} +function foo() { return null; } exports.foo = foo; //// [importDecl_require4.js] -function foo2() { - return null; -} +function foo2() { return null; } exports.foo2 = foo2; //// [importDecl_1.js] /// diff --git a/tests/baselines/reference/importInTypePosition.js b/tests/baselines/reference/importInTypePosition.js index 08f7078cca3..c0d64a4ef7b 100644 --- a/tests/baselines/reference/importInTypePosition.js +++ b/tests/baselines/reference/importInTypePosition.js @@ -39,8 +39,5 @@ var C; (function (C) { var m; var p; - var p = { - x: 0, - y: 0 - }; + var p = { x: 0, y: 0 }; })(C || (C = {})); diff --git a/tests/baselines/reference/importStatements.js b/tests/baselines/reference/importStatements.js index dddbadbcc7a..b8d06a3546e 100644 --- a/tests/baselines/reference/importStatements.js +++ b/tests/baselines/reference/importStatements.js @@ -52,10 +52,7 @@ var C; (function (C) { var m; var p; - var p = { - x: 0, - y: 0 - }; + var p = { x: 0, y: 0 }; })(C || (C = {})); // code gen expected var D; diff --git a/tests/baselines/reference/importStatementsInterfaces.js b/tests/baselines/reference/importStatementsInterfaces.js index bb24aeb0f6b..4f7bb447565 100644 --- a/tests/baselines/reference/importStatementsInterfaces.js +++ b/tests/baselines/reference/importStatementsInterfaces.js @@ -47,11 +47,7 @@ var C; (function (C) { var m; var p; - var p = { - x: 0, - y: 0, - z: 0 - }; + var p = { x: 0, y: 0, z: 0 }; })(C || (C = {})); // no code gen expected var D; diff --git a/tests/baselines/reference/importUsedInExtendsList1.types b/tests/baselines/reference/importUsedInExtendsList1.types index 7261c34e75e..623b14e36aa 100644 --- a/tests/baselines/reference/importUsedInExtendsList1.types +++ b/tests/baselines/reference/importUsedInExtendsList1.types @@ -5,7 +5,7 @@ import foo = require('importUsedInExtendsList1_require'); class Sub extends foo.Super { } >Sub : Sub ->foo : unknown +>foo : typeof foo >Super : foo.Super var s: Sub; diff --git a/tests/baselines/reference/importedModuleAddToGlobal.js b/tests/baselines/reference/importedModuleAddToGlobal.js index a848ccb504b..015631dc965 100644 --- a/tests/baselines/reference/importedModuleAddToGlobal.js +++ b/tests/baselines/reference/importedModuleAddToGlobal.js @@ -28,7 +28,5 @@ var B; })(B || (B = {})); var C; (function (C) { - function hello() { - return null; - } + function hello() { return null; } })(C || (C = {})); diff --git a/tests/baselines/reference/inOperator.js b/tests/baselines/reference/inOperator.js index 1407ef9d59c..10059bcf2b7 100644 --- a/tests/baselines/reference/inOperator.js +++ b/tests/baselines/reference/inOperator.js @@ -14,12 +14,9 @@ if (y in c) { } //// [inOperator.js] var a = []; -for (var x in a) { -} -if (3 in a) { -} +for (var x in a) { } +if (3 in a) { } var b = '' in 0; var c; var y; -if (y in c) { -} +if (y in c) { } diff --git a/tests/baselines/reference/inOperatorWithFunction.js b/tests/baselines/reference/inOperatorWithFunction.js index f06e95ff6b7..bc293ca2c43 100644 --- a/tests/baselines/reference/inOperatorWithFunction.js +++ b/tests/baselines/reference/inOperatorWithFunction.js @@ -4,9 +4,5 @@ fn("a" in { "a": true }); //// [inOperatorWithFunction.js] -var fn = function (val) { - return val; -}; -fn("a" in { - "a": true -}); +var fn = function (val) { return val; }; +fn("a" in { "a": true }); diff --git a/tests/baselines/reference/incompatibleTypes.js b/tests/baselines/reference/incompatibleTypes.js index a0b4d0f9ca2..7e24afecf5f 100644 --- a/tests/baselines/reference/incompatibleTypes.js +++ b/tests/baselines/reference/incompatibleTypes.js @@ -102,18 +102,12 @@ var C4 = (function () { } return C4; })(); -function if1(a) { -} +function if1(a) { } var c1; var c2; if1(c1); -function of1(a) { - return null; -} -of1({ - e: 0, - f: 0 -}); +function of1(a) { return null; } +of1({ e: 0, f: 0 }); function foo(fn) { } function bar() { @@ -122,25 +116,7 @@ function bar() { map = {}; }); } -var o1 = { - e: 0, - f: 0 -}; -var a1 = [ - { - e: 0, - f: 0 - }, - { - e: 0, - f: 0 - }, - { - e: 0, - g: 0 - } -]; +var o1 = { e: 0, f: 0 }; +var a1 = [{ e: 0, f: 0 }, { e: 0, f: 0 }, { e: 0, g: 0 }]; var i1c1 = 5; -var fp1 = function (a) { - return 0; -}; +var fp1 = function (a) { return 0; }; diff --git a/tests/baselines/reference/incompleteObjectLiteral1.js b/tests/baselines/reference/incompleteObjectLiteral1.js index 6859267fee1..ecdbe86604a 100644 --- a/tests/baselines/reference/incompleteObjectLiteral1.js +++ b/tests/baselines/reference/incompleteObjectLiteral1.js @@ -3,7 +3,5 @@ var tt = { aa; } var x = tt; //// [incompleteObjectLiteral1.js] -var tt = { - aa: -}; +var tt = { aa: }; var x = tt; diff --git a/tests/baselines/reference/incrementOperatorWithAnyOtherType.js b/tests/baselines/reference/incrementOperatorWithAnyOtherType.js index 7fd47a937a8..4c9d570d07f 100644 --- a/tests/baselines/reference/incrementOperatorWithAnyOtherType.js +++ b/tests/baselines/reference/incrementOperatorWithAnyOtherType.js @@ -52,14 +52,8 @@ M.n++; // ++ operator on any type var ANY; var ANY1; -var ANY2 = [ - "", - "" -]; -var obj = { - x: 1, - y: null -}; +var ANY2 = ["", ""]; +var obj = { x: 1, y: null }; var A = (function () { function A() { } diff --git a/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.js b/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.js index 3e1c47faedc..6f76fba6d8c 100644 --- a/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.js +++ b/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.js @@ -72,16 +72,9 @@ ANY2++; //// [incrementOperatorWithAnyOtherTypeInvalidOperations.js] // ++ operator on any type var ANY1; -var ANY2 = [ - 1, - 2 -]; +var ANY2 = [1, 2]; var obj; -var obj1 = { - x: "", - y: function () { - } -}; +var obj1 = { x: "", y: function () { } }; function foo() { var a; return a; diff --git a/tests/baselines/reference/incrementOperatorWithNumberType.js b/tests/baselines/reference/incrementOperatorWithNumberType.js index e8312c5e5f2..09365833e3b 100644 --- a/tests/baselines/reference/incrementOperatorWithNumberType.js +++ b/tests/baselines/reference/incrementOperatorWithNumberType.js @@ -42,10 +42,7 @@ objA.a++, M.n++; //// [incrementOperatorWithNumberType.js] // ++ operator on number type var NUMBER; -var NUMBER1 = [ - 1, - 2 -]; +var NUMBER1 = [1, 2]; var A = (function () { function A() { } diff --git a/tests/baselines/reference/incrementOperatorWithNumberTypeInvalidOperations.js b/tests/baselines/reference/incrementOperatorWithNumberTypeInvalidOperations.js index 4629f10a964..eb9cd949280 100644 --- a/tests/baselines/reference/incrementOperatorWithNumberTypeInvalidOperations.js +++ b/tests/baselines/reference/incrementOperatorWithNumberTypeInvalidOperations.js @@ -49,19 +49,12 @@ foo()++; //// [incrementOperatorWithNumberTypeInvalidOperations.js] // ++ operator on number type var NUMBER; -var NUMBER1 = [ - 1, - 2 -]; -function foo() { - return 1; -} +var NUMBER1 = [1, 2]; +function foo() { return 1; } var A = (function () { function A() { } - A.foo = function () { - return 1; - }; + A.foo = function () { return 1; }; return A; })(); var M; @@ -74,27 +67,11 @@ var ResultIsNumber1 = ++NUMBER1; var ResultIsNumber2 = NUMBER1++; // number type literal var ResultIsNumber3 = ++1; -var ResultIsNumber4 = ++{ - x: 1, - y: 2 -}; -var ResultIsNumber5 = ++{ - x: 1, - y: function (n) { - return n; - } -}; +var ResultIsNumber4 = ++{ x: 1, y: 2 }; +var ResultIsNumber5 = ++{ x: 1, y: function (n) { return n; } }; var ResultIsNumber6 = 1++; -var ResultIsNumber7 = { - x: 1, - y: 2 -}++; -var ResultIsNumber8 = { - x: 1, - y: function (n) { - return n; - } -}++; +var ResultIsNumber7 = { x: 1, y: 2 }++; +var ResultIsNumber8 = { x: 1, y: function (n) { return n; } }++; // number type expressions var ResultIsNumber9 = ++foo(); var ResultIsNumber10 = ++A.foo(); diff --git a/tests/baselines/reference/incrementOperatorWithUnsupportedBooleanType.js b/tests/baselines/reference/incrementOperatorWithUnsupportedBooleanType.js index 09549a71a0c..6a974443f7b 100644 --- a/tests/baselines/reference/incrementOperatorWithUnsupportedBooleanType.js +++ b/tests/baselines/reference/incrementOperatorWithUnsupportedBooleanType.js @@ -57,15 +57,11 @@ objA.a++, M.n++; //// [incrementOperatorWithUnsupportedBooleanType.js] // ++ operator on boolean type var BOOLEAN; -function foo() { - return true; -} +function foo() { return true; } var A = (function () { function A() { } - A.foo = function () { - return true; - }; + A.foo = function () { return true; }; return A; })(); var M; @@ -78,27 +74,11 @@ var ResultIsNumber1 = ++BOOLEAN; var ResultIsNumber2 = BOOLEAN++; // boolean type literal var ResultIsNumber3 = ++true; -var ResultIsNumber4 = ++{ - x: true, - y: false -}; -var ResultIsNumber5 = ++{ - x: true, - y: function (n) { - return n; - } -}; +var ResultIsNumber4 = ++{ x: true, y: false }; +var ResultIsNumber5 = ++{ x: true, y: function (n) { return n; } }; var ResultIsNumber6 = true++; -var ResultIsNumber7 = { - x: true, - y: false -}++; -var ResultIsNumber8 = { - x: true, - y: function (n) { - return n; - } -}++; +var ResultIsNumber7 = { x: true, y: false }++; +var ResultIsNumber8 = { x: true, y: function (n) { return n; } }++; // boolean type expressions var ResultIsNumber9 = ++objA.a; var ResultIsNumber10 = ++M.n; diff --git a/tests/baselines/reference/incrementOperatorWithUnsupportedStringType.js b/tests/baselines/reference/incrementOperatorWithUnsupportedStringType.js index 5abb2cd8b79..82bf03cd83a 100644 --- a/tests/baselines/reference/incrementOperatorWithUnsupportedStringType.js +++ b/tests/baselines/reference/incrementOperatorWithUnsupportedStringType.js @@ -68,19 +68,12 @@ objA.a++, M.n++; //// [incrementOperatorWithUnsupportedStringType.js] // ++ operator on string type var STRING; -var STRING1 = [ - "", - "" -]; -function foo() { - return ""; -} +var STRING1 = ["", ""]; +function foo() { return ""; } var A = (function () { function A() { } - A.foo = function () { - return ""; - }; + A.foo = function () { return ""; }; return A; })(); var M; @@ -95,27 +88,11 @@ var ResultIsNumber3 = STRING++; var ResultIsNumber4 = STRING1++; // string type literal var ResultIsNumber5 = ++""; -var ResultIsNumber6 = ++{ - x: "", - y: "" -}; -var ResultIsNumber7 = ++{ - x: "", - y: function (s) { - return s; - } -}; +var ResultIsNumber6 = ++{ x: "", y: "" }; +var ResultIsNumber7 = ++{ x: "", y: function (s) { return s; } }; var ResultIsNumber8 = ""++; -var ResultIsNumber9 = { - x: "", - y: "" -}++; -var ResultIsNumber10 = { - x: "", - y: function (s) { - return s; - } -}++; +var ResultIsNumber9 = { x: "", y: "" }++; +var ResultIsNumber10 = { x: "", y: function (s) { return s; } }++; // string type expressions var ResultIsNumber11 = ++objA.a; var ResultIsNumber12 = ++M.n; diff --git a/tests/baselines/reference/indexSignaturesInferentialTyping.js b/tests/baselines/reference/indexSignaturesInferentialTyping.js index fc1525eda0f..53636be716c 100644 --- a/tests/baselines/reference/indexSignaturesInferentialTyping.js +++ b/tests/baselines/reference/indexSignaturesInferentialTyping.js @@ -9,25 +9,9 @@ var x4 = bar({ zero: 0, one: 1 }); // type should be number //// [indexSignaturesInferentialTyping.js] -function foo(items) { - return undefined; -} -function bar(items) { - return undefined; -} -var x1 = foo({ - 0: 0, - 1: 1 -}); // type should be number -var x2 = foo({ - zero: 0, - one: 1 -}); -var x3 = bar({ - 0: 0, - 1: 1 -}); -var x4 = bar({ - zero: 0, - one: 1 -}); // type should be number +function foo(items) { return undefined; } +function bar(items) { return undefined; } +var x1 = foo({ 0: 0, 1: 1 }); // type should be number +var x2 = foo({ zero: 0, one: 1 }); +var x3 = bar({ 0: 0, 1: 1 }); +var x4 = bar({ zero: 0, one: 1 }); // type should be number diff --git a/tests/baselines/reference/indexer.js b/tests/baselines/reference/indexer.js index 12c28236d8d..97e734a029f 100644 --- a/tests/baselines/reference/indexer.js +++ b/tests/baselines/reference/indexer.js @@ -11,12 +11,5 @@ var jq:JQuery={ 0: { id : "a" }, 1: { id : "b" } }; jq[0].id; //// [indexer.js] -var jq = { - 0: { - id: "a" - }, - 1: { - id: "b" - } -}; +var jq = { 0: { id: "a" }, 1: { id: "b" } }; jq[0].id; diff --git a/tests/baselines/reference/indexerA.js b/tests/baselines/reference/indexerA.js index 2a377c3436d..5216026f714 100644 --- a/tests/baselines/reference/indexerA.js +++ b/tests/baselines/reference/indexerA.js @@ -21,12 +21,5 @@ var JQuery = (function () { } return JQuery; })(); -var jq = { - 0: { - id: "a" - }, - 1: { - id: "b" - } -}; +var jq = { 0: { id: "a" }, 1: { id: "b" } }; jq[0].id; diff --git a/tests/baselines/reference/indexerWithTuple.js b/tests/baselines/reference/indexerWithTuple.js index b73b5e80a87..91d90792e6d 100644 --- a/tests/baselines/reference/indexerWithTuple.js +++ b/tests/baselines/reference/indexerWithTuple.js @@ -33,25 +33,10 @@ var eleUnion25 = unionTuple2["0"]; // boolean var eleUnion26 = unionTuple2["1"]; // string | number //// [indexerWithTuple.js] -var strNumTuple = [ - "foo", - 10 -]; -var numTupleTuple = [ - 10, - [ - "bar", - 20 - ] -]; -var unionTuple1 = [ - 10, - "foo" -]; -var unionTuple2 = [ - true, - "foo" -]; +var strNumTuple = ["foo", 10]; +var numTupleTuple = [10, ["bar", 20]]; +var unionTuple1 = [10, "foo"]; +var unionTuple2 = [true, "foo"]; // no error var idx0 = 0; var idx1 = 1; diff --git a/tests/baselines/reference/inferSecondaryParameter.js b/tests/baselines/reference/inferSecondaryParameter.js index a02e10b5570..24689aa9495 100644 --- a/tests/baselines/reference/inferSecondaryParameter.js +++ b/tests/baselines/reference/inferSecondaryParameter.js @@ -11,10 +11,7 @@ b.m("test", function (bug) { //// [inferSecondaryParameter.js] // type inference on 'bug' should give 'any' -var b = { - m: function (test, fn) { - } -}; +var b = { m: function (test, fn) { } }; b.m("test", function (bug) { var a = bug; }); diff --git a/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.js b/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.js index 194d9198d23..97fefc0571c 100644 --- a/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.js +++ b/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.js @@ -30,15 +30,8 @@ function h(nonarray) { args[_i - 1] = arguments[_i]; } } -function i(array, opt) { -} -var a = [ - 1, - 2, - 3, - 4, - 5 -]; +function i(array, opt) { } +var a = [1, 2, 3, 4, 5]; f(a); // OK g(a); // OK h(a); // OK diff --git a/tests/baselines/reference/inferenceFromParameterlessLambda.js b/tests/baselines/reference/inferenceFromParameterlessLambda.js index c1b970dee60..40c18c9afe8 100644 --- a/tests/baselines/reference/inferenceFromParameterlessLambda.js +++ b/tests/baselines/reference/inferenceFromParameterlessLambda.js @@ -11,11 +11,6 @@ foo(n => n.length, () => 'hi'); //// [inferenceFromParameterlessLambda.js] -function foo(o, i) { -} +function foo(o, i) { } // Infer string from second argument because it isn't context sensitive -foo(function (n) { - return n.length; -}, function () { - return 'hi'; -}); +foo(function (n) { return n.length; }, function () { return 'hi'; }); diff --git a/tests/baselines/reference/inferentialTypingWithFunctionType2.js b/tests/baselines/reference/inferentialTypingWithFunctionType2.js index 758f0e27465..a3215a19e25 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionType2.js +++ b/tests/baselines/reference/inferentialTypingWithFunctionType2.js @@ -8,8 +8,4 @@ var x = [1, 2, 3].map(identity)[0]; function identity(a) { return a; } -var x = [ - 1, - 2, - 3 -].map(identity)[0]; +var x = [1, 2, 3].map(identity)[0]; diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.js b/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.js index b9b6f9e4bde..aeb9a840773 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.js +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.js @@ -5,8 +5,4 @@ declare function identity(y: V): V; var s = map("", () => { return { x: identity }; }); //// [inferentialTypingWithFunctionTypeNested.js] -var s = map("", function () { - return { - x: identity - }; -}); +var s = map("", function () { return { x: identity }; }); diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.js b/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.js index b41a9f6240e..2f5eea63a8a 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.js +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.js @@ -36,16 +36,12 @@ s = map("", ("", identity)); //// [inferentialTypingWithFunctionTypeSyntacticScenarios.js] var s; // dotted name -var dottedIdentity = { - x: identity -}; +var dottedIdentity = { x: identity }; s = map("", dottedIdentity.x); // index expression s = map("", dottedIdentity['x']); // function call -s = map("", (function () { - return identity; -})()); +s = map("", (function () { return identity; })()); var ic; s = map("", new ic()); // assignment diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.js b/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.js index 0e413f9b171..35f0928378c 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.js +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.js @@ -7,11 +7,5 @@ var i = result[0].x; // number //// [inferentialTypingWithFunctionTypeZip.js] var pair; var zipWith; -var result = zipWith([ - 1, - 2 -], [ - 'a', - 'b' -], pair); +var result = zipWith([1, 2], ['a', 'b'], pair); var i = result[0].x; // number diff --git a/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.js b/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.js index af2b936b2a8..216604dd4d5 100644 --- a/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.js +++ b/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.js @@ -10,21 +10,5 @@ f({ x: [1] }, { x: [null] }).x[0] = "" // was error TS2011: Cannot convert 'stri function f(x, y) { return x; } -f({ - x: [ - null - ] -}, { - x: [ - 1 - ] -}).x[0] = ""; // ok -f({ - x: [ - 1 - ] -}, { - x: [ - null - ] -}).x[0] = ""; // was error TS2011: Cannot convert 'string' to 'number'. +f({ x: [null] }, { x: [1] }).x[0] = ""; // ok +f({ x: [1] }, { x: [null] }).x[0] = ""; // was error TS2011: Cannot convert 'string' to 'number'. diff --git a/tests/baselines/reference/inheritance.js b/tests/baselines/reference/inheritance.js index 1fca887a9b1..f7a274b1990 100644 --- a/tests/baselines/reference/inheritance.js +++ b/tests/baselines/reference/inheritance.js @@ -79,13 +79,9 @@ var ND = (function (_super) { })(N); var Good = (function () { function Good() { - this.f = function () { - return 0; - }; + this.f = function () { return 0; }; } - Good.prototype.g = function () { - return 0; - }; + Good.prototype.g = function () { return 0; }; return Good; })(); var Baad = (function (_super) { @@ -93,11 +89,7 @@ var Baad = (function (_super) { function Baad() { _super.apply(this, arguments); } - Baad.prototype.f = function () { - return 0; - }; - Baad.prototype.g = function (n) { - return 0; - }; + Baad.prototype.f = function () { return 0; }; + Baad.prototype.g = function (n) { return 0; }; return Baad; })(Good); diff --git a/tests/baselines/reference/inheritance1.js b/tests/baselines/reference/inheritance1.js index e6dbd35e0df..f00a46922bf 100644 --- a/tests/baselines/reference/inheritance1.js +++ b/tests/baselines/reference/inheritance1.js @@ -78,8 +78,7 @@ var Button = (function (_super) { function Button() { _super.apply(this, arguments); } - Button.prototype.select = function () { - }; + Button.prototype.select = function () { }; return Button; })(Control); var TextBox = (function (_super) { @@ -87,8 +86,7 @@ var TextBox = (function (_super) { function TextBox() { _super.apply(this, arguments); } - TextBox.prototype.select = function () { - }; + TextBox.prototype.select = function () { }; return TextBox; })(Control); var ImageBase = (function (_super) { @@ -108,15 +106,13 @@ var Image1 = (function (_super) { var Locations = (function () { function Locations() { } - Locations.prototype.select = function () { - }; + Locations.prototype.select = function () { }; return Locations; })(); var Locations1 = (function () { function Locations1() { } - Locations1.prototype.select = function () { - }; + Locations1.prototype.select = function () { }; return Locations1; })(); var sc; diff --git a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js index 45293ec3021..4544df2dcf2 100644 --- a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js +++ b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js @@ -20,8 +20,7 @@ var __extends = this.__extends || function (d, b) { var A = (function () { function A() { } - A.prototype.myMethod = function () { - }; + A.prototype.myMethod = function () { }; return A; })(); var B = (function (_super) { @@ -36,7 +35,6 @@ var C = (function (_super) { function C() { _super.apply(this, arguments); } - C.prototype.myMethod = function () { - }; + C.prototype.myMethod = function () { }; return C; })(B); diff --git a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js index 339511df6ba..df6e5943173 100644 --- a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js +++ b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js @@ -20,8 +20,7 @@ var __extends = this.__extends || function (d, b) { var A = (function () { function A() { } - A.prototype.myMethod = function () { - }; + A.prototype.myMethod = function () { }; return A; })(); var B = (function (_super) { @@ -36,7 +35,6 @@ var C = (function (_super) { function C() { _super.apply(this, arguments); } - C.prototype.myMethod = function () { - }; + C.prototype.myMethod = function () { }; return C; })(B); diff --git a/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js b/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js index f69a4962db6..682a8ab4402 100644 --- a/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js +++ b/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js @@ -20,8 +20,7 @@ var __extends = this.__extends || function (d, b) { var A = (function () { function A() { } - A.prototype.myMethod = function () { - }; + A.prototype.myMethod = function () { }; return A; })(); var B = (function (_super) { @@ -36,7 +35,6 @@ var C = (function (_super) { function C() { _super.apply(this, arguments); } - C.prototype.myMethod = function () { - }; + C.prototype.myMethod = function () { }; return C; })(B); diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.types b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.types index 2a71136613f..69b2ebb608d 100644 --- a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.types +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.types @@ -14,13 +14,13 @@ module N { export class D1 extends M.C1 { } >D1 : D1 ->M : unknown +>M : typeof M >C1 : M.C1 export class D2 extends M.C2 { } >D2 : D2 >T : T ->M : unknown +>M : typeof M >C2 : M.C2 >T : T } diff --git a/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.js b/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.js index 49fd1e40582..85801ca704f 100644 --- a/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.js +++ b/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.js @@ -9,11 +9,6 @@ fn(function (a, b) { return true; }) //// [inheritedFunctionAssignmentCompatibility.js] -function fn(cb) { -} -fn(function (a, b) { - return true; -}); -fn(function (a, b) { - return true; -}); +function fn(cb) { } +fn(function (a, b) { return true; }); +fn(function (a, b) { return true; }); diff --git a/tests/baselines/reference/initializePropertiesWithRenamedLet.js b/tests/baselines/reference/initializePropertiesWithRenamedLet.js index 1d34d7c13fc..d4f985bea56 100644 --- a/tests/baselines/reference/initializePropertiesWithRenamedLet.js +++ b/tests/baselines/reference/initializePropertiesWithRenamedLet.js @@ -20,27 +20,15 @@ if (true) { var x0; if (true) { var x0_1; - var obj1 = { - x0: x0_1 - }; - var obj2 = { - x0: x0_1 - }; + var obj1 = { x0: x0_1 }; + var obj2 = { x0: x0_1 }; } var x, y, z; if (true) { - var x_1 = ({ - x: 0 - }).x; - var y_1 = ({ - y: 0 - }).y; + var x_1 = ({ x: 0 }).x; + var y_1 = ({ y: 0 }).y; var z_1; - (_a = { - z: 0 - }, z_1 = _a.z, _a); - (_b = { - z: 0 - }, z_1 = _b.z, _b); + (_a = { z: 0 }, z_1 = _a.z, _a); + (_b = { z: 0 }, z_1 = _b.z, _b); } var _a, _b; diff --git a/tests/baselines/reference/innerBoundLambdaEmit.js b/tests/baselines/reference/innerBoundLambdaEmit.js index 2921cad55d0..c09cc8e5a66 100644 --- a/tests/baselines/reference/innerBoundLambdaEmit.js +++ b/tests/baselines/reference/innerBoundLambdaEmit.js @@ -18,6 +18,5 @@ var M; return Foo; })(); M.Foo = Foo; - var bar = function () { - }; + var bar = function () { }; })(M || (M = {})); diff --git a/tests/baselines/reference/innerFunc.js b/tests/baselines/reference/innerFunc.js index 1676d0789d1..c790c09e271 100644 --- a/tests/baselines/reference/innerFunc.js +++ b/tests/baselines/reference/innerFunc.js @@ -14,17 +14,13 @@ module M { //// [innerFunc.js] function salt() { - function pepper() { - return 5; - } + function pepper() { return 5; } return pepper(); } var M; (function (M) { function tungsten() { - function oxygen() { - return 6; - } + function oxygen() { return 6; } ; return oxygen(); } diff --git a/tests/baselines/reference/innerModExport1.js b/tests/baselines/reference/innerModExport1.js index d61e79f2396..cbeced37046 100644 --- a/tests/baselines/reference/innerModExport1.js +++ b/tests/baselines/reference/innerModExport1.js @@ -28,18 +28,12 @@ var Outer; { var non_export_var = 0; Outer.export_var = 1; - function NonExportFunc() { - return 0; - } - function ExportFunc() { - return 0; - } + function NonExportFunc() { return 0; } + function ExportFunc() { return 0; } Outer.ExportFunc = ExportFunc; } Outer.outer_var_export = 0; - function outerFuncExport() { - return 0; - } + function outerFuncExport() { return 0; } Outer.outerFuncExport = outerFuncExport; })(Outer || (Outer = {})); Outer.ExportFunc(); diff --git a/tests/baselines/reference/innerModExport2.js b/tests/baselines/reference/innerModExport2.js index 26399879e6d..a1526daf6f3 100644 --- a/tests/baselines/reference/innerModExport2.js +++ b/tests/baselines/reference/innerModExport2.js @@ -29,19 +29,13 @@ var Outer; { var non_export_var = 0; Outer.export_var = 1; - function NonExportFunc() { - return 0; - } - function ExportFunc() { - return 0; - } + function NonExportFunc() { return 0; } + function ExportFunc() { return 0; } Outer.ExportFunc = ExportFunc; } var export_var; Outer.outer_var_export = 0; - function outerFuncExport() { - return 0; - } + function outerFuncExport() { return 0; } Outer.outerFuncExport = outerFuncExport; })(Outer || (Outer = {})); Outer.NonExportFunc(); diff --git a/tests/baselines/reference/innerOverloads.js b/tests/baselines/reference/innerOverloads.js index 184b644406e..19e3fa78909 100644 --- a/tests/baselines/reference/innerOverloads.js +++ b/tests/baselines/reference/innerOverloads.js @@ -14,9 +14,7 @@ var x = outer(); // should work //// [innerOverloads.js] function outer() { - function inner(a) { - return a; - } + function inner(a) { return a; } return inner(0); } var x = outer(); // should work diff --git a/tests/baselines/reference/instanceAndStaticDeclarations1.js b/tests/baselines/reference/instanceAndStaticDeclarations1.js index 1396e2bcfa8..7dbd6dcbe7d 100644 --- a/tests/baselines/reference/instanceAndStaticDeclarations1.js +++ b/tests/baselines/reference/instanceAndStaticDeclarations1.js @@ -24,9 +24,7 @@ var Point = (function () { var dy = this.y - p.y; return Math.sqrt(dx * dx + dy * dy); }; - Point.distance = function (p1, p2) { - return p1.distance(p2); - }; + Point.distance = function (p1, p2) { return p1.distance(p2); }; Point.origin = new Point(0, 0); return Point; })(); diff --git a/tests/baselines/reference/instanceMemberAssignsToClassPrototype.js b/tests/baselines/reference/instanceMemberAssignsToClassPrototype.js index 28f7296f0ea..51c38282a72 100644 --- a/tests/baselines/reference/instanceMemberAssignsToClassPrototype.js +++ b/tests/baselines/reference/instanceMemberAssignsToClassPrototype.js @@ -17,18 +17,12 @@ var C = (function () { function C() { } C.prototype.foo = function () { - C.prototype.foo = function () { - }; + C.prototype.foo = function () { }; }; C.prototype.bar = function (x) { - C.prototype.bar = function () { - }; // error - C.prototype.bar = function (x) { - return x; - }; // ok - C.prototype.bar = function (x) { - return 1; - }; // ok + C.prototype.bar = function () { }; // error + C.prototype.bar = function (x) { return x; }; // ok + C.prototype.bar = function (x) { return 1; }; // ok return 1; }; return C; diff --git a/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js b/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js index eca12f7b1ae..7ab3b4a0aa3 100644 --- a/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js +++ b/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js @@ -60,14 +60,11 @@ var NonGeneric; get: function () { return 1; }, - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); - C.prototype.fn = function () { - return this; - }; + C.prototype.fn = function () { return this; }; return C; })(); var D = (function (_super) { @@ -95,14 +92,11 @@ var Generic; get: function () { return null; }, - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); - C.prototype.fn = function () { - return this; - }; + C.prototype.fn = function () { return this; }; return C; })(); var D = (function (_super) { diff --git a/tests/baselines/reference/instancePropertyInClassType.js b/tests/baselines/reference/instancePropertyInClassType.js index b2df44db6f0..863f18de323 100644 --- a/tests/baselines/reference/instancePropertyInClassType.js +++ b/tests/baselines/reference/instancePropertyInClassType.js @@ -50,14 +50,11 @@ var NonGeneric; get: function () { return 1; }, - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); - C.prototype.fn = function () { - return this; - }; + C.prototype.fn = function () { return this; }; return C; })(); var c = new C(1, 2); @@ -78,14 +75,11 @@ var Generic; get: function () { return null; }, - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); - C.prototype.fn = function () { - return this; - }; + C.prototype.fn = function () { return this; }; return C; })(); var c = new C(1, ''); diff --git a/tests/baselines/reference/instanceofOperatorWithInvalidOperands.js b/tests/baselines/reference/instanceofOperatorWithInvalidOperands.js index 8309b7e7c01..9f83181a146 100644 --- a/tests/baselines/reference/instanceofOperatorWithInvalidOperands.js +++ b/tests/baselines/reference/instanceofOperatorWithInvalidOperands.js @@ -50,8 +50,7 @@ var rc1 = '' instanceof {}; var C = (function () { function C() { } - C.prototype.foo = function () { - }; + C.prototype.foo = function () { }; return C; })(); var x; diff --git a/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.js b/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.js index 15e4239eb0a..3d7d2a7d017 100644 --- a/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.js +++ b/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.js @@ -27,8 +27,7 @@ var C = (function () { return C; })(); var c = new C(); -function Foo() { -} +function Foo() { } var r = new Foo(); var f; var r2 = new f(); diff --git a/tests/baselines/reference/instantiatedModule.js b/tests/baselines/reference/instantiatedModule.js index 2b1871aea9d..8cabdeabe49 100644 --- a/tests/baselines/reference/instantiatedModule.js +++ b/tests/baselines/reference/instantiatedModule.js @@ -82,10 +82,7 @@ var M2; function Point() { } Point.Origin = function () { - return { - x: 0, - y: 0 - }; + return { x: 0, y: 0 }; }; return Point; })(); diff --git a/tests/baselines/reference/intTypeCheck.js b/tests/baselines/reference/intTypeCheck.js index 41f648610b5..fbbe1bb5d03 100644 --- a/tests/baselines/reference/intTypeCheck.js +++ b/tests/baselines/reference/intTypeCheck.js @@ -209,8 +209,7 @@ var obj87: i8 = new {}; var Base = (function () { function Base() { } - Base.prototype.foo = function () { - }; + Base.prototype.foo = function () { }; return Base; })(); var anyVar; @@ -220,22 +219,15 @@ var anyVar; var obj0; var obj1 = { p: null, - p3: function () { - return 0; - }, - p6: function (pa1) { - return 0; - }, - p7: function (pa1, pa2) { - return 0; - } + p3: function () { return 0; }, + p6: function (pa1) { return 0; }, + p7: function (pa1, pa2) { return 0; } }; var obj2 = new Object(); var obj3 = new obj0; var obj4 = new Base; var obj5 = null; -var obj6 = function () { -}; +var obj6 = function () { }; //var obj7: i1 = function foo() { }; var obj8 = anyVar; var obj9 = new < i1 > anyVar; @@ -249,9 +241,7 @@ var obj13 = new Object(); var obj14 = new obj11; var obj15 = new Base; var obj16 = null; -var obj17 = function () { - return 0; -}; +var obj17 = function () { return 0; }; //var obj18: i2 = function foo() { }; var obj19 = anyVar; var obj20 = new < i2 > anyVar; @@ -265,8 +255,7 @@ var obj24 = new Object(); var obj25 = new obj22; var obj26 = new Base; var obj27 = null; -var obj28 = function () { -}; +var obj28 = function () { }; //var obj29: i3 = function foo() { }; var obj30 = anyVar; var obj31 = new < i3 > anyVar; @@ -280,8 +269,7 @@ var obj35 = new Object(); var obj36 = new obj33; var obj37 = new Base; var obj38 = null; -var obj39 = function () { -}; +var obj39 = function () { }; //var obj40: i4 = function foo() { }; var obj41 = anyVar; var obj42 = new < i4 > anyVar; @@ -295,8 +283,7 @@ var obj46 = new Object(); var obj47 = new obj44; var obj48 = new Base; var obj49 = null; -var obj50 = function () { -}; +var obj50 = function () { }; //var obj51: i5 = function foo() { }; var obj52 = anyVar; var obj53 = new < i5 > anyVar; @@ -310,8 +297,7 @@ var obj57 = new Object(); var obj58 = new obj55; var obj59 = new Base; var obj60 = null; -var obj61 = function () { -}; +var obj61 = function () { }; //var obj62: i6 = function foo() { }; var obj63 = anyVar; var obj64 = new < i6 > anyVar; @@ -325,8 +311,7 @@ var obj68 = new Object(); var obj69 = new obj66; var obj70 = new Base; var obj71 = null; -var obj72 = function () { -}; +var obj72 = function () { }; //var obj73: i7 = function foo() { }; var obj74 = anyVar; var obj75 = new < i7 > anyVar; @@ -340,8 +325,7 @@ var obj79 = new Object(); var obj80 = new obj77; var obj81 = new Base; var obj82 = null; -var obj83 = function () { -}; +var obj83 = function () { }; //var obj84: i8 = function foo() { }; var obj85 = anyVar; var obj86 = new < i8 > anyVar; diff --git a/tests/baselines/reference/interface0.js b/tests/baselines/reference/interface0.js index 63feadfc4c7..aecdb91e8a3 100644 --- a/tests/baselines/reference/interface0.js +++ b/tests/baselines/reference/interface0.js @@ -7,6 +7,4 @@ var y: Generic = { x: 3 }; //// [interface0.js] -var y = { - x: 3 -}; +var y = { x: 3 }; diff --git a/tests/baselines/reference/interfaceAssignmentCompat.js b/tests/baselines/reference/interfaceAssignmentCompat.js index 7ddd22ee863..edaebbd38a2 100644 --- a/tests/baselines/reference/interfaceAssignmentCompat.js +++ b/tests/baselines/reference/interfaceAssignmentCompat.js @@ -72,15 +72,9 @@ var M; function test() { var x = []; var result = ""; - x[0] = { - color: Color.Brown - }; - x[1] = { - color: Color.Blue - }; - x[2] = { - color: Color.Green - }; + x[0] = { color: Color.Brown }; + x[1] = { color: Color.Blue }; + x[2] = { color: Color.Green }; x = x.sort(CompareYeux); // parameter mismatch // type of z inferred from specialized array type var z = x.sort(CompareEyes); // ok diff --git a/tests/baselines/reference/interfaceContextualType.js b/tests/baselines/reference/interfaceContextualType.js index 996b8fc98d3..2dbdb958d6b 100644 --- a/tests/baselines/reference/interfaceContextualType.js +++ b/tests/baselines/reference/interfaceContextualType.js @@ -27,15 +27,11 @@ var Bug = (function () { } Bug.prototype.ok = function () { this.values = {}; - this.values['comments'] = { - italic: true - }; + this.values['comments'] = { italic: true }; }; Bug.prototype.shouldBeOK = function () { this.values = { - comments: { - italic: true - } + comments: { italic: true } }; }; return Bug; diff --git a/tests/baselines/reference/interfaceDeclaration2.js b/tests/baselines/reference/interfaceDeclaration2.js index 0bd59c065e0..30f9df0fac7 100644 --- a/tests/baselines/reference/interfaceDeclaration2.js +++ b/tests/baselines/reference/interfaceDeclaration2.js @@ -19,6 +19,5 @@ var I2 = (function () { } return I2; })(); -function I3() { -} +function I3() { } var I4; diff --git a/tests/baselines/reference/interfaceDeclaration4.js b/tests/baselines/reference/interfaceDeclaration4.js index 576479c2beb..728ef7156e9 100644 --- a/tests/baselines/reference/interfaceDeclaration4.js +++ b/tests/baselines/reference/interfaceDeclaration4.js @@ -69,5 +69,4 @@ var C3 = (function () { return C3; })(); I1; -{ -} +{ } diff --git a/tests/baselines/reference/interfaceExtendingClass.js b/tests/baselines/reference/interfaceExtendingClass.js index 39db7460915..f1232d78245 100644 --- a/tests/baselines/reference/interfaceExtendingClass.js +++ b/tests/baselines/reference/interfaceExtendingClass.js @@ -23,8 +23,7 @@ i = f; var Foo = (function () { function Foo() { } - Foo.prototype.y = function () { - }; + Foo.prototype.y = function () { }; Object.defineProperty(Foo.prototype, "Z", { get: function () { return 1; diff --git a/tests/baselines/reference/interfaceExtendingClass2.js b/tests/baselines/reference/interfaceExtendingClass2.js index b0958717aa8..6e6605e2459 100644 --- a/tests/baselines/reference/interfaceExtendingClass2.js +++ b/tests/baselines/reference/interfaceExtendingClass2.js @@ -19,8 +19,7 @@ interface I2 extends Foo { // error var Foo = (function () { function Foo() { } - Foo.prototype.y = function () { - }; + Foo.prototype.y = function () { }; Object.defineProperty(Foo.prototype, "Z", { get: function () { return 1; diff --git a/tests/baselines/reference/interfaceExtendsClass1.js b/tests/baselines/reference/interfaceExtendsClass1.js index 5903726c05d..d376f2dca98 100644 --- a/tests/baselines/reference/interfaceExtendsClass1.js +++ b/tests/baselines/reference/interfaceExtendsClass1.js @@ -35,8 +35,7 @@ var Button = (function (_super) { function Button() { _super.apply(this, arguments); } - Button.prototype.select = function () { - }; + Button.prototype.select = function () { }; return Button; })(Control); var TextBox = (function (_super) { @@ -44,8 +43,7 @@ var TextBox = (function (_super) { function TextBox() { _super.apply(this, arguments); } - TextBox.prototype.select = function () { - }; + TextBox.prototype.select = function () { }; return TextBox; })(Control); var Image = (function (_super) { @@ -58,7 +56,6 @@ var Image = (function (_super) { var Location = (function () { function Location() { } - Location.prototype.select = function () { - }; + Location.prototype.select = function () { }; return Location; })(); diff --git a/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js b/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js index 4cf0281ac7a..521a71199ad 100644 --- a/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js @@ -38,9 +38,7 @@ var C = (function () { function C() { this.x = 1; } - C.prototype.foo = function (x) { - return x; - }; + C.prototype.foo = function (x) { return x; }; return C; })(); var D = (function (_super) { @@ -48,14 +46,9 @@ var D = (function (_super) { function D() { _super.apply(this, arguments); } - D.prototype.foo = function (x) { - return x; - }; - D.prototype.other = function (x) { - return x; - }; - D.prototype.bar = function () { - }; + D.prototype.foo = function (x) { return x; }; + D.prototype.other = function (x) { return x; }; + D.prototype.bar = function () { }; return D; })(C); var c; diff --git a/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js index 5805302d7d7..c177f2e7a90 100644 --- a/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js @@ -34,9 +34,7 @@ var C = (function () { function C() { this.x = 1; } - C.prototype.foo = function (x) { - return x; - }; + C.prototype.foo = function (x) { return x; }; return C; })(); var D = (function (_super) { @@ -46,14 +44,9 @@ var D = (function (_super) { this.x = 2; this.y = 3; } - D.prototype.foo = function (x) { - return x; - }; - D.prototype.other = function (x) { - return x; - }; - D.prototype.bar = function () { - }; + D.prototype.foo = function (x) { return x; }; + D.prototype.other = function (x) { return x; }; + D.prototype.bar = function () { }; return D; })(C); var D2 = (function (_super) { @@ -62,13 +55,8 @@ var D2 = (function (_super) { _super.apply(this, arguments); this.x = ""; } - D2.prototype.foo = function (x) { - return x; - }; - D2.prototype.other = function (x) { - return x; - }; - D2.prototype.bar = function () { - }; + D2.prototype.foo = function (x) { return x; }; + D2.prototype.other = function (x) { return x; }; + D2.prototype.bar = function () { }; return D2; })(C); diff --git a/tests/baselines/reference/interfaceImplementation1.js b/tests/baselines/reference/interfaceImplementation1.js index ce82a24f63d..8f02596682d 100644 --- a/tests/baselines/reference/interfaceImplementation1.js +++ b/tests/baselines/reference/interfaceImplementation1.js @@ -50,8 +50,7 @@ c["foo"]; var C1 = (function () { function C1() { } - C1.prototype.iFn = function (n, s) { - }; + C1.prototype.iFn = function (n, s) { }; return C1; })(); var C2 = (function () { diff --git a/tests/baselines/reference/interfaceImplementation3.js b/tests/baselines/reference/interfaceImplementation3.js index 626c92e83d1..da85de545cd 100644 --- a/tests/baselines/reference/interfaceImplementation3.js +++ b/tests/baselines/reference/interfaceImplementation3.js @@ -19,7 +19,6 @@ class C4 implements I1 { var C4 = (function () { function C4() { } - C4.prototype.iFn = function () { - }; + C4.prototype.iFn = function () { }; return C4; })(); diff --git a/tests/baselines/reference/interfaceImplementation4.js b/tests/baselines/reference/interfaceImplementation4.js index 94565d1b22f..4a093381b5d 100644 --- a/tests/baselines/reference/interfaceImplementation4.js +++ b/tests/baselines/reference/interfaceImplementation4.js @@ -17,7 +17,6 @@ class C5 implements I1 { var C5 = (function () { function C5() { } - C5.prototype.iFn = function () { - }; + C5.prototype.iFn = function () { }; return C5; })(); diff --git a/tests/baselines/reference/interfaceImplementation5.js b/tests/baselines/reference/interfaceImplementation5.js index 667c5f045ec..c710eda84f5 100644 --- a/tests/baselines/reference/interfaceImplementation5.js +++ b/tests/baselines/reference/interfaceImplementation5.js @@ -36,9 +36,7 @@ var C1 = (function () { function C1() { } Object.defineProperty(C1.prototype, "getset1", { - get: function () { - return 1; - }, + get: function () { return 1; }, enumerable: true, configurable: true }); @@ -48,8 +46,7 @@ var C2 = (function () { function C2() { } Object.defineProperty(C2.prototype, "getset1", { - set: function (baz) { - }, + set: function (baz) { }, enumerable: true, configurable: true }); @@ -59,11 +56,8 @@ var C3 = (function () { function C3() { } Object.defineProperty(C3.prototype, "getset1", { - get: function () { - return 1; - }, - set: function (baz) { - }, + get: function () { return 1; }, + set: function (baz) { }, enumerable: true, configurable: true }); @@ -73,10 +67,7 @@ var C4 = (function () { function C4() { } Object.defineProperty(C4.prototype, "getset1", { - get: function () { - var x; - return x; - }, + get: function () { var x; return x; }, enumerable: true, configurable: true }); @@ -86,8 +77,7 @@ var C5 = (function () { function C5() { } Object.defineProperty(C5.prototype, "getset1", { - set: function (baz) { - }, + set: function (baz) { }, enumerable: true, configurable: true }); @@ -97,12 +87,8 @@ var C6 = (function () { function C6() { } Object.defineProperty(C6.prototype, "getset1", { - get: function () { - var x; - return x; - }, - set: function (baz) { - }, + get: function () { var x; return x; }, + set: function (baz) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/interfaceImplementation6.js b/tests/baselines/reference/interfaceImplementation6.js index c9bd9113e7e..4feb6804db3 100644 --- a/tests/baselines/reference/interfaceImplementation6.js +++ b/tests/baselines/reference/interfaceImplementation6.js @@ -44,9 +44,7 @@ define(["require", "exports"], function (require, exports) { })(); var Test = (function () { function Test() { - this.pt = { - item: 1 - }; + this.pt = { item: 1 }; } return Test; })(); diff --git a/tests/baselines/reference/interfaceImplementation7.js b/tests/baselines/reference/interfaceImplementation7.js index 6345fe93a33..2813d7ee0fe 100644 --- a/tests/baselines/reference/interfaceImplementation7.js +++ b/tests/baselines/reference/interfaceImplementation7.js @@ -14,8 +14,6 @@ class C1 implements i4 { var C1 = (function () { function C1() { } - C1.prototype.name = function () { - return ""; - }; + C1.prototype.name = function () { return ""; }; return C1; })(); diff --git a/tests/baselines/reference/interfaceMayNotBeExtendedWitACall.errors.txt b/tests/baselines/reference/interfaceMayNotBeExtendedWitACall.errors.txt index 06abf0987d6..f6ec9e02bbf 100644 --- a/tests/baselines/reference/interfaceMayNotBeExtendedWitACall.errors.txt +++ b/tests/baselines/reference/interfaceMayNotBeExtendedWitACall.errors.txt @@ -1,15 +1,12 @@ -tests/cases/compiler/interfaceMayNotBeExtendedWitACall.ts(3,29): error TS1005: ',' expected. -tests/cases/compiler/interfaceMayNotBeExtendedWitACall.ts(3,32): error TS1005: '=>' expected. +tests/cases/compiler/interfaceMayNotBeExtendedWitACall.ts(3,24): error TS2499: An interface can only extend an identifier/qualified-name with optional type arguments. -==== tests/cases/compiler/interfaceMayNotBeExtendedWitACall.ts (2 errors) ==== +==== tests/cases/compiler/interfaceMayNotBeExtendedWitACall.ts (1 errors) ==== interface color {} interface blue extends color() { // error - ~ -!!! error TS1005: ',' expected. - ~ -!!! error TS1005: '=>' expected. + ~~~~~~~ +!!! error TS2499: An interface can only extend an identifier/qualified-name with optional type arguments. } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceMayNotBeExtendedWitACall.js b/tests/baselines/reference/interfaceMayNotBeExtendedWitACall.js index a283722d6ad..f2660dd64f3 100644 --- a/tests/baselines/reference/interfaceMayNotBeExtendedWitACall.js +++ b/tests/baselines/reference/interfaceMayNotBeExtendedWitACall.js @@ -7,5 +7,3 @@ interface blue extends color() { // error //// [interfaceMayNotBeExtendedWitACall.js] -(function () { -}); diff --git a/tests/baselines/reference/interfaceNaming1.js b/tests/baselines/reference/interfaceNaming1.js index e16f186379b..2abd2106b2f 100644 --- a/tests/baselines/reference/interfaceNaming1.js +++ b/tests/baselines/reference/interfaceNaming1.js @@ -6,6 +6,5 @@ interface & { } //// [interfaceNaming1.js] interface; -{ -} +{ } interface & {}; diff --git a/tests/baselines/reference/interfaceSubtyping.js b/tests/baselines/reference/interfaceSubtyping.js index 840ce79d869..43004985782 100644 --- a/tests/baselines/reference/interfaceSubtyping.js +++ b/tests/baselines/reference/interfaceSubtyping.js @@ -14,8 +14,6 @@ var Camera = (function () { function Camera(str) { this.str = str; } - Camera.prototype.foo = function () { - return "s"; - }; + Camera.prototype.foo = function () { return "s"; }; return Camera; })(); diff --git a/tests/baselines/reference/interfaceWithPropertyOfEveryType.js b/tests/baselines/reference/interfaceWithPropertyOfEveryType.js index e10b83297bc..90c0d257d61 100644 --- a/tests/baselines/reference/interfaceWithPropertyOfEveryType.js +++ b/tests/baselines/reference/interfaceWithPropertyOfEveryType.js @@ -48,8 +48,7 @@ var C = (function () { } return C; })(); -function f1() { -} +function f1() { } var M; (function (M) { M.y = 1; @@ -64,16 +63,10 @@ var a = { c: true, d: {}, e: null, - f: [ - 1 - ], + f: [1], g: {}, - h: function (x) { - return 1; - }, - i: function (x) { - return x; - }, + h: function (x) { return 1; }, + i: function (x) { return x; }, j: null, k: new C(), l: f1, diff --git a/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType2.js b/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType2.js index 01907f410e3..d53ec04c183 100644 --- a/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType2.js +++ b/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType2.js @@ -19,14 +19,12 @@ interface Foo2 extends Base2 { // error var Base = (function () { function Base() { } - Base.prototype.x = function () { - }; + Base.prototype.x = function () { }; return Base; })(); var Base2 = (function () { function Base2() { } - Base2.prototype.x = function () { - }; + Base2.prototype.x = function () { }; return Base2; })(); diff --git a/tests/baselines/reference/invalidDoWhileBreakStatements.js b/tests/baselines/reference/invalidDoWhileBreakStatements.js index e6617ef98cd..807d58a8fea 100644 --- a/tests/baselines/reference/invalidDoWhileBreakStatements.js +++ b/tests/baselines/reference/invalidDoWhileBreakStatements.js @@ -60,8 +60,7 @@ THREE: do { // break forward do { break FIVE; - FIVE: do { - } while (true); + FIVE: do { } while (true); } while (true); // label on non-loop statement NINE: var y = 12; diff --git a/tests/baselines/reference/invalidDoWhileContinueStatements.js b/tests/baselines/reference/invalidDoWhileContinueStatements.js index d32ccfe0074..21a10a3451b 100644 --- a/tests/baselines/reference/invalidDoWhileContinueStatements.js +++ b/tests/baselines/reference/invalidDoWhileContinueStatements.js @@ -60,8 +60,7 @@ THREE: do { // continue forward do { continue FIVE; - FIVE: do { - } while (true); + FIVE: do { } while (true); } while (true); // label on non-loop statement NINE: var y = 12; diff --git a/tests/baselines/reference/invalidForBreakStatements.js b/tests/baselines/reference/invalidForBreakStatements.js index abcd078ff2d..5e3430ecb41 100644 --- a/tests/baselines/reference/invalidForBreakStatements.js +++ b/tests/baselines/reference/invalidForBreakStatements.js @@ -58,8 +58,7 @@ THREE: for (;;) { // break forward for (;;) { break FIVE; - FIVE: for (;;) { - } + FIVE: for (;;) { } } // label on non-loop statement NINE: var y = 12; diff --git a/tests/baselines/reference/invalidForContinueStatements.js b/tests/baselines/reference/invalidForContinueStatements.js index af0eba2a59a..2db1ce69ede 100644 --- a/tests/baselines/reference/invalidForContinueStatements.js +++ b/tests/baselines/reference/invalidForContinueStatements.js @@ -58,8 +58,7 @@ THREE: for (;;) { // continue forward for (;;) { continue FIVE; - FIVE: for (;;) { - } + FIVE: for (;;) { } } // label on non-loop statement NINE: var y = 12; diff --git a/tests/baselines/reference/invalidForInBreakStatements.js b/tests/baselines/reference/invalidForInBreakStatements.js index bf383613c3b..1784b9a57a6 100644 --- a/tests/baselines/reference/invalidForInBreakStatements.js +++ b/tests/baselines/reference/invalidForInBreakStatements.js @@ -59,8 +59,7 @@ THREE: for (var x in {}) { // break forward for (var x in {}) { break FIVE; - FIVE: for (var x in {}) { - } + FIVE: for (var x in {}) { } } // label on non-loop statement NINE: var y = 12; diff --git a/tests/baselines/reference/invalidForInContinueStatements.js b/tests/baselines/reference/invalidForInContinueStatements.js index d40dbd80ca0..94020d00f2b 100644 --- a/tests/baselines/reference/invalidForInContinueStatements.js +++ b/tests/baselines/reference/invalidForInContinueStatements.js @@ -59,8 +59,7 @@ THREE: for (var x in {}) { // continue forward for (var x in {}) { continue FIVE; - FIVE: for (var x in {}) { - } + FIVE: for (var x in {}) { } } // label on non-loop statement NINE: var y = 12; diff --git a/tests/baselines/reference/invalidModuleWithVarStatements.js b/tests/baselines/reference/invalidModuleWithVarStatements.js index 4014709d361..caa6b24f00f 100644 --- a/tests/baselines/reference/invalidModuleWithVarStatements.js +++ b/tests/baselines/reference/invalidModuleWithVarStatements.js @@ -35,8 +35,7 @@ var Y; })(Y || (Y = {})); var Y2; (function (Y2) { - function fn(x) { - } + function fn(x) { } })(Y2 || (Y2 = {})); var Y4; (function (Y4) { @@ -44,8 +43,7 @@ var Y4; })(Y4 || (Y4 = {})); var YY; (function (YY) { - function fn(x) { - } + function fn(x) { } })(YY || (YY = {})); var YY2; (function (YY2) { @@ -53,6 +51,5 @@ var YY2; })(YY2 || (YY2 = {})); var YY3; (function (YY3) { - function fn(x) { - } + function fn(x) { } })(YY3 || (YY3 = {})); diff --git a/tests/baselines/reference/invalidMultipleVariableDeclarations.js b/tests/baselines/reference/invalidMultipleVariableDeclarations.js index 62ea392be28..824bee92227 100644 --- a/tests/baselines/reference/invalidMultipleVariableDeclarations.js +++ b/tests/baselines/reference/invalidMultipleVariableDeclarations.js @@ -77,9 +77,7 @@ var D = (function () { } return D; })(); -function F(x) { - return 42; -} +function F(x) { return 42; } var M; (function (M) { var A = (function () { @@ -88,9 +86,7 @@ var M; return A; })(); M.A = A; - function F2(x) { - return x.toString(); - } + function F2(x) { return x.toString(); } M.F2 = F2; })(M || (M = {})); // all of these are errors @@ -104,24 +100,11 @@ var b; var b = new C(); var b = new C2(); var f = F; -var f = function (x) { - return ''; -}; +var f = function (x) { return ''; }; var arr; -var arr = [ - 1, - 2, - 3, - 4 -]; -var arr = [ - new C(), - new C2(), - new D() -]; -var arr2 = [ - new D() -]; +var arr = [1, 2, 3, 4]; +var arr = [new C(), new C2(), new D()]; +var arr2 = [new D()]; var arr2 = new Array(); var m; var m = M.A; diff --git a/tests/baselines/reference/invalidReturnStatements.js b/tests/baselines/reference/invalidReturnStatements.js index df6f6da6753..d637158780a 100644 --- a/tests/baselines/reference/invalidReturnStatements.js +++ b/tests/baselines/reference/invalidReturnStatements.js @@ -28,21 +28,15 @@ var __extends = this.__extends || function (d, b) { d.prototype = new __(); }; // all the following should be error -function fn1() { -} -function fn2() { -} -function fn3() { -} -function fn4() { -} -function fn7() { -} // should be valid: any includes void +function fn1() { } +function fn2() { } +function fn3() { } +function fn4() { } +function fn7() { } // should be valid: any includes void var C = (function () { function C() { } - C.prototype.dispose = function () { - }; + C.prototype.dispose = function () { }; return C; })(); var D = (function (_super) { @@ -52,11 +46,5 @@ var D = (function (_super) { } return D; })(C); -function fn10() { - return { - id: 12 - }; -} -function fn11() { - return new C(); -} +function fn10() { return { id: 12 }; } +function fn11() { return new C(); } diff --git a/tests/baselines/reference/invalidStaticField.js b/tests/baselines/reference/invalidStaticField.js index 5521af05c83..620c019fc18 100644 --- a/tests/baselines/reference/invalidStaticField.js +++ b/tests/baselines/reference/invalidStaticField.js @@ -6,9 +6,7 @@ class B { static NOT_NULL = new B(); } var A = (function () { function A() { } - A.prototype.foo = function () { - return B.NULL; - }; + A.prototype.foo = function () { return B.NULL; }; return A; })(); var B = (function () { diff --git a/tests/baselines/reference/invalidTryStatements.js b/tests/baselines/reference/invalidTryStatements.js index 8afadf41b4d..343ad6e0584 100644 --- a/tests/baselines/reference/invalidTryStatements.js +++ b/tests/baselines/reference/invalidTryStatements.js @@ -21,16 +21,10 @@ function fn() { var x; // ensure x is 'Any' } // no type annotation allowed - try { - } - catch (z) { - } - try { - } - catch (a) { - } - try { - } - catch (y) { - } + try { } + catch (z) { } + try { } + catch (a) { } + try { } + catch (y) { } } diff --git a/tests/baselines/reference/invalidTryStatements2.js b/tests/baselines/reference/invalidTryStatements2.js index d2ef92ac831..1b2976dc4e7 100644 --- a/tests/baselines/reference/invalidTryStatements2.js +++ b/tests/baselines/reference/invalidTryStatements2.js @@ -36,20 +36,16 @@ function fn() { } try { } - catch (x) { - } // error missing try - finally { - } // potential error; can be absorbed by the 'catch' + catch (x) { } // error missing try + finally { } // potential error; can be absorbed by the 'catch' } function fn2() { try { } - finally { - } // error missing try + finally { } // error missing try try { } // error missing try - catch (x) { - } // error missing try + catch (x) { } // error missing try // no error try { } diff --git a/tests/baselines/reference/invalidTypeOfTarget.js b/tests/baselines/reference/invalidTypeOfTarget.js index 88128d15e85..52b39f3c76a 100644 --- a/tests/baselines/reference/invalidTypeOfTarget.js +++ b/tests/baselines/reference/invalidTypeOfTarget.js @@ -15,6 +15,5 @@ var x3 = 1; var x4 = ''; var x5; var x6 = null; -var x7 = function f() { -}; +var x7 = function f() { }; var x8 = /123/; diff --git a/tests/baselines/reference/invalidUndefinedAssignments.js b/tests/baselines/reference/invalidUndefinedAssignments.js index 7617e5eae8e..dc846900ebb 100644 --- a/tests/baselines/reference/invalidUndefinedAssignments.js +++ b/tests/baselines/reference/invalidUndefinedAssignments.js @@ -44,7 +44,6 @@ var M; M.x = 1; })(M || (M = {})); M = x; -function i(a) { -} +function i(a) { } // BUG 767030 i = x; diff --git a/tests/baselines/reference/invalidUndefinedValues.js b/tests/baselines/reference/invalidUndefinedValues.js index 9361f43bbae..a0ed1b4f98a 100644 --- a/tests/baselines/reference/invalidUndefinedValues.js +++ b/tests/baselines/reference/invalidUndefinedValues.js @@ -54,10 +54,7 @@ var M; M.x = 1; })(M || (M = {})); x = M; -x = { - f: function () { - } -}; +x = { f: function () { } }; function f(a) { x = a; } diff --git a/tests/baselines/reference/invalidVoidAssignments.js b/tests/baselines/reference/invalidVoidAssignments.js index b821b0ca796..1ce03d1382a 100644 --- a/tests/baselines/reference/invalidVoidAssignments.js +++ b/tests/baselines/reference/invalidVoidAssignments.js @@ -59,7 +59,4 @@ var E; })(E || (E = {})); x = E; x = E.A; -x = { - f: function () { - } -}; +x = { f: function () { } }; diff --git a/tests/baselines/reference/invalidVoidValues.js b/tests/baselines/reference/invalidVoidValues.js index 13f2d681f26..409df03ef37 100644 --- a/tests/baselines/reference/invalidVoidValues.js +++ b/tests/baselines/reference/invalidVoidValues.js @@ -46,10 +46,7 @@ var a; x = a; var b; x = b; -x = { - f: function () { - } -}; +x = { f: function () { } }; var M; (function (M) { M.x = 1; diff --git a/tests/baselines/reference/invalidWhileBreakStatements.js b/tests/baselines/reference/invalidWhileBreakStatements.js index a8e261f036c..7f10a08d65c 100644 --- a/tests/baselines/reference/invalidWhileBreakStatements.js +++ b/tests/baselines/reference/invalidWhileBreakStatements.js @@ -59,8 +59,7 @@ THREE: while (true) { // break forward while (true) { break FIVE; - FIVE: while (true) { - } + FIVE: while (true) { } } // label on non-loop statement NINE: var y = 12; diff --git a/tests/baselines/reference/invalidWhileContinueStatements.js b/tests/baselines/reference/invalidWhileContinueStatements.js index 544314bf68d..b8234bf9604 100644 --- a/tests/baselines/reference/invalidWhileContinueStatements.js +++ b/tests/baselines/reference/invalidWhileContinueStatements.js @@ -59,8 +59,7 @@ THREE: while (true) { // continue forward while (true) { continue FIVE; - FIVE: while (true) { - } + FIVE: while (true) { } } // label on non-loop statement NINE: var y = 12; diff --git a/tests/baselines/reference/ipromise4.js b/tests/baselines/reference/ipromise4.js index 5b65e0818c2..98660aa5824 100644 --- a/tests/baselines/reference/ipromise4.js +++ b/tests/baselines/reference/ipromise4.js @@ -18,10 +18,5 @@ p.then(function (x) { return "hello"; } ).then(function (x) { return x } ); // s //// [ipromise4.js] var p = null; -p.then(function (x) { -}); // should not error -p.then(function (x) { - return "hello"; -}).then(function (x) { - return x; -}); // should not error +p.then(function (x) { }); // should not error +p.then(function (x) { return "hello"; }).then(function (x) { return x; }); // should not error diff --git a/tests/baselines/reference/iterableContextualTyping1.js b/tests/baselines/reference/iterableContextualTyping1.js index 12943b46894..8621bbd8417 100644 --- a/tests/baselines/reference/iterableContextualTyping1.js +++ b/tests/baselines/reference/iterableContextualTyping1.js @@ -2,6 +2,4 @@ var iter: Iterable<(x: string) => number> = [s => s.length]; //// [iterableContextualTyping1.js] -var iter = [ - s => s.length -]; +var iter = [s => s.length]; diff --git a/tests/baselines/reference/keywordField.js b/tests/baselines/reference/keywordField.js index b6b54de2067..581d5afa14a 100644 --- a/tests/baselines/reference/keywordField.js +++ b/tests/baselines/reference/keywordField.js @@ -13,8 +13,6 @@ var q = a["if"]; //// [keywordField.js] var obj = {}; obj.if = 1; -var a = { - if: "test" -}; +var a = { if: "test" }; var n = a.if; var q = a["if"]; diff --git a/tests/baselines/reference/lambdaExpression.js b/tests/baselines/reference/lambdaExpression.js index ece70d217f1..dc5c94c8b33 100644 --- a/tests/baselines/reference/lambdaExpression.js +++ b/tests/baselines/reference/lambdaExpression.js @@ -6,11 +6,7 @@ var x = 0; //// [lambdaExpression.js] -(function () { - return 0; -}); // Needs to be wrapped in parens to be a valid expression (not declaration) +(function () { return 0; }); // Needs to be wrapped in parens to be a valid expression (not declaration) var y = 0; -(function () { - return 0; -}); +(function () { return 0; }); var x = 0; diff --git a/tests/baselines/reference/lambdaParamTypes.js b/tests/baselines/reference/lambdaParamTypes.js index bc2858e9b49..3bd212512e4 100644 --- a/tests/baselines/reference/lambdaParamTypes.js +++ b/tests/baselines/reference/lambdaParamTypes.js @@ -24,45 +24,16 @@ thing.doSomething((x, y) => y.name.toExponential(0)); //// [lambdaParamTypes.js] -var thing = create([ - { - name: "bob", - id: 24 - }, - { - name: "doug", - id: 32 - } -]); +var thing = create([{ name: "bob", id: 24 }, { name: "doug", id: 32 }]); // Below should all be OK -thing.doSomething(function (x, y) { - return x.name.charAt(0); -}); // x.name should be string, so should be OK -thing.doSomething(function (x, y) { - return x.id.toExponential(0); -}); // x.id should be string, so should be OK -thing.doSomething(function (x, y) { - return y.name.charAt(0); -}); // x.name should be string, so should be OK -thing.doSomething(function (x, y) { - return y.id.toExponential(0); -}); // x.id should be string, so should be OK +thing.doSomething(function (x, y) { return x.name.charAt(0); }); // x.name should be string, so should be OK +thing.doSomething(function (x, y) { return x.id.toExponential(0); }); // x.id should be string, so should be OK +thing.doSomething(function (x, y) { return y.name.charAt(0); }); // x.name should be string, so should be OK +thing.doSomething(function (x, y) { return y.id.toExponential(0); }); // x.id should be string, so should be OK // Below should all be in error -thing.doSomething(function (x, y) { - return x.foo; -}); // no such property on x -thing.doSomething(function (x, y) { - return y.foo; -}); // no such property on y -thing.doSomething(function (x, y) { - return x.id.charAt(0); -}); // x.id should be number, no charAt member -thing.doSomething(function (x, y) { - return x.name.toExponential(0); -}); // x.name should be string, no toExponential member -thing.doSomething(function (x, y) { - return y.id.charAt(0); -}); -thing.doSomething(function (x, y) { - return y.name.toExponential(0); -}); +thing.doSomething(function (x, y) { return x.foo; }); // no such property on x +thing.doSomething(function (x, y) { return y.foo; }); // no such property on y +thing.doSomething(function (x, y) { return x.id.charAt(0); }); // x.id should be number, no charAt member +thing.doSomething(function (x, y) { return x.name.toExponential(0); }); // x.name should be string, no toExponential member +thing.doSomething(function (x, y) { return y.id.charAt(0); }); +thing.doSomething(function (x, y) { return y.name.toExponential(0); }); diff --git a/tests/baselines/reference/lambdaPropSelf.js b/tests/baselines/reference/lambdaPropSelf.js index 5211dcc47ca..8d1b16e1431 100644 --- a/tests/baselines/reference/lambdaPropSelf.js +++ b/tests/baselines/reference/lambdaPropSelf.js @@ -28,9 +28,7 @@ var Person = (function () { function Person(name, children) { var _this = this; this.name = name; - this.addChild = function () { - return _this.children.push("New child"); - }; + this.addChild = function () { return _this.children.push("New child"); }; this.children = ko.observableArray(children); } return Person; diff --git a/tests/baselines/reference/lastPropertyInLiteralWins.js b/tests/baselines/reference/lastPropertyInLiteralWins.js index 19ec4e21000..999fe45841b 100644 --- a/tests/baselines/reference/lastPropertyInLiteralWins.js +++ b/tests/baselines/reference/lastPropertyInLiteralWins.js @@ -21,14 +21,10 @@ function test(thing) { thing.thunk("str"); } test({ - thunk: function (str) { - }, - thunk: function (num) { - } + thunk: function (str) { }, + thunk: function (num) { } }); test({ - thunk: function (num) { - }, - thunk: function (str) { - } + thunk: function (num) { }, + thunk: function (str) { } }); diff --git a/tests/baselines/reference/letAndVarRedeclaration.js b/tests/baselines/reference/letAndVarRedeclaration.js index 35222660b64..fd4bfe67cac 100644 --- a/tests/baselines/reference/letAndVarRedeclaration.js +++ b/tests/baselines/reference/letAndVarRedeclaration.js @@ -55,13 +55,11 @@ module M2 { //// [letAndVarRedeclaration.js] let e0; var e0; -function e0() { -} +function e0() { } function f0() { let x1; var x1; - function x1() { - } + function x1() { } } function f1() { let x; @@ -69,16 +67,14 @@ function f1() { var x; } { - function x() { - } + function x() { } } } var M0; (function (M0) { let x2; var x2; - function x2() { - } + function x2() { } })(M0 || (M0 = {})); var M1; (function (M1) { @@ -87,8 +83,7 @@ var M1; var x2; } { - function x2() { - } + function x2() { } } })(M1 || (M1 = {})); let x11; diff --git a/tests/baselines/reference/letDeclarations-access.js b/tests/baselines/reference/letDeclarations-access.js index 404c2876310..6ae289d220f 100644 --- a/tests/baselines/reference/letDeclarations-access.js +++ b/tests/baselines/reference/letDeclarations-access.js @@ -58,11 +58,9 @@ x--; ++x; --x; var a = x + 1; -function f(v) { -} +function f(v) { } f(x); -if (x) { -} +if (x) { } x; (x); -x; diff --git a/tests/baselines/reference/letDeclarations-es5.js b/tests/baselines/reference/letDeclarations-es5.js index 1d4eb4afcbf..d8761ccbc64 100644 --- a/tests/baselines/reference/letDeclarations-es5.js +++ b/tests/baselines/reference/letDeclarations-es5.js @@ -20,7 +20,5 @@ var l3, l4, l5, l6; var l7 = false; var l8 = 23; var l9 = 0, l10 = "", l11 = null; -for (var l11_1 in {}) { -} -for (var l12 = 0; l12 < 9; l12++) { -} +for (var l11_1 in {}) { } +for (var l12 = 0; l12 < 9; l12++) { } diff --git a/tests/baselines/reference/letDeclarations.js b/tests/baselines/reference/letDeclarations.js index bc186b732f5..8acb82204e3 100644 --- a/tests/baselines/reference/letDeclarations.js +++ b/tests/baselines/reference/letDeclarations.js @@ -20,10 +20,8 @@ let l3, l4, l5, l6; let l7 = false; let l8 = 23; let l9 = 0, l10 = "", l11 = null; -for (let l11 in {}) { -} -for (let l12 = 0; l12 < 9; l12++) { -} +for (let l11 in {}) { } +for (let l12 = 0; l12 < 9; l12++) { } //// [letDeclarations.d.ts] diff --git a/tests/baselines/reference/letInLetOrConstDeclarations.js b/tests/baselines/reference/letInLetOrConstDeclarations.js index 6560ea84911..ee23abc4e4f 100644 --- a/tests/baselines/reference/letInLetOrConstDeclarations.js +++ b/tests/baselines/reference/letInLetOrConstDeclarations.js @@ -14,8 +14,7 @@ //// [letInLetOrConstDeclarations.js] { let let = 1; // should error - for (let let in []) { - } // should error + for (let let in []) { } // should error } { const let = 1; // should error diff --git a/tests/baselines/reference/letInNonStrictMode.js b/tests/baselines/reference/letInNonStrictMode.js index af21ce3281c..8a431535ae2 100644 --- a/tests/baselines/reference/letInNonStrictMode.js +++ b/tests/baselines/reference/letInNonStrictMode.js @@ -3,9 +3,5 @@ let [x] = [1]; let {a: y} = {a: 1}; //// [letInNonStrictMode.js] -var x = ([ - 1 -])[0]; -var y = ({ - a: 1 -}).a; +var x = ([1])[0]; +var y = ({ a: 1 }).a; diff --git a/tests/baselines/reference/lift.js b/tests/baselines/reference/lift.js index 21c09aaeb53..33f8200530b 100644 --- a/tests/baselines/reference/lift.js +++ b/tests/baselines/reference/lift.js @@ -37,11 +37,7 @@ var C = (function (_super) { var x = 10 + w; var ll = x * w; } - C.prototype.liftxyz = function () { - return x + z + this.y; - }; - C.prototype.liftxylocllz = function () { - return x + z + this.y + this.ll; - }; + C.prototype.liftxyz = function () { return x + z + this.y; }; + C.prototype.liftxylocllz = function () { return x + z + this.y + this.ll; }; return C; })(B); diff --git a/tests/baselines/reference/literals-negative.js b/tests/baselines/reference/literals-negative.js index c0c9624e6f2..39fd4ea38a5 100644 --- a/tests/baselines/reference/literals-negative.js +++ b/tests/baselines/reference/literals-negative.js @@ -17,8 +17,6 @@ if(null === isVoid()) { } var n = (null); var s = (null); var b = (n); -function isVoid() { -} +function isVoid() { } // Expected error: Values of type null and void cannot be compared -if (null === isVoid()) { -} +if (null === isVoid()) { } diff --git a/tests/baselines/reference/localImportNameVsGlobalName.js b/tests/baselines/reference/localImportNameVsGlobalName.js index 8ba7ec567a0..45ecdc4745e 100644 --- a/tests/baselines/reference/localImportNameVsGlobalName.js +++ b/tests/baselines/reference/localImportNameVsGlobalName.js @@ -27,8 +27,7 @@ var Keyboard; var App; (function (App) { var Key = Keyboard.Key; - function foo(key) { - } + function foo(key) { } App.foo = foo; foo(Key.UP); foo(Key.DOWN); diff --git a/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.js b/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.js index 891faacd4a4..28366739233 100644 --- a/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.js +++ b/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.js @@ -63,16 +63,9 @@ var ResultIsBoolean21 = !!!(ANY + ANY1); // ! operator on any type var ANY; var ANY1; -var ANY2 = [ - "", - "" -]; +var ANY2 = ["", ""]; var obj; -var obj1 = { - x: "", - y: function () { - } -}; +var obj1 = { x: "", y: function () { } }; function foo() { var a; return a; diff --git a/tests/baselines/reference/logicalNotOperatorWithBooleanType.js b/tests/baselines/reference/logicalNotOperatorWithBooleanType.js index 6f16fbfa2e4..107bd9a88ec 100644 --- a/tests/baselines/reference/logicalNotOperatorWithBooleanType.js +++ b/tests/baselines/reference/logicalNotOperatorWithBooleanType.js @@ -41,15 +41,11 @@ var ResultIsBoolean = !!BOOLEAN; //// [logicalNotOperatorWithBooleanType.js] // ! operator on boolean type var BOOLEAN; -function foo() { - return true; -} +function foo() { return true; } var A = (function () { function A() { } - A.foo = function () { - return false; - }; + A.foo = function () { return false; }; return A; })(); var M; @@ -61,10 +57,7 @@ var objA = new A(); var ResultIsBoolean1 = !BOOLEAN; // boolean type literal var ResultIsBoolean2 = !true; -var ResultIsBoolean3 = !{ - x: true, - y: false -}; +var ResultIsBoolean3 = !{ x: true, y: false }; // boolean type expressions var ResultIsBoolean4 = !objA.a; var ResultIsBoolean5 = !M.n; diff --git a/tests/baselines/reference/logicalNotOperatorWithNumberType.js b/tests/baselines/reference/logicalNotOperatorWithNumberType.js index 7beba45ba0b..0d0601cad23 100644 --- a/tests/baselines/reference/logicalNotOperatorWithNumberType.js +++ b/tests/baselines/reference/logicalNotOperatorWithNumberType.js @@ -48,19 +48,12 @@ var ResultIsBoolean13 = !!!(NUMBER + NUMBER); //// [logicalNotOperatorWithNumberType.js] // ! operator on number type var NUMBER; -var NUMBER1 = [ - 1, - 2 -]; -function foo() { - return 1; -} +var NUMBER1 = [1, 2]; +function foo() { return 1; } var A = (function () { function A() { } - A.foo = function () { - return 1; - }; + A.foo = function () { return 1; }; return A; })(); var M; @@ -73,16 +66,8 @@ var ResultIsBoolean1 = !NUMBER; var ResultIsBoolean2 = !NUMBER1; // number type literal var ResultIsBoolean3 = !1; -var ResultIsBoolean4 = !{ - x: 1, - y: 2 -}; -var ResultIsBoolean5 = !{ - x: 1, - y: function (n) { - return n; - } -}; +var ResultIsBoolean4 = !{ x: 1, y: 2 }; +var ResultIsBoolean5 = !{ x: 1, y: function (n) { return n; } }; // number type expressions var ResultIsBoolean6 = !objA.a; var ResultIsBoolean7 = !M.n; diff --git a/tests/baselines/reference/logicalNotOperatorWithStringType.js b/tests/baselines/reference/logicalNotOperatorWithStringType.js index 571857cb6b3..7f75814d601 100644 --- a/tests/baselines/reference/logicalNotOperatorWithStringType.js +++ b/tests/baselines/reference/logicalNotOperatorWithStringType.js @@ -47,19 +47,12 @@ var ResultIsBoolean14 = !!!(STRING + STRING); //// [logicalNotOperatorWithStringType.js] // ! operator on string type var STRING; -var STRING1 = [ - "", - "abc" -]; -function foo() { - return "abc"; -} +var STRING1 = ["", "abc"]; +function foo() { return "abc"; } var A = (function () { function A() { } - A.foo = function () { - return ""; - }; + A.foo = function () { return ""; }; return A; })(); var M; @@ -72,16 +65,8 @@ var ResultIsBoolean1 = !STRING; var ResultIsBoolean2 = !STRING1; // string type literal var ResultIsBoolean3 = !""; -var ResultIsBoolean4 = !{ - x: "", - y: "" -}; -var ResultIsBoolean5 = !{ - x: "", - y: function (s) { - return s; - } -}; +var ResultIsBoolean4 = !{ x: "", y: "" }; +var ResultIsBoolean5 = !{ x: "", y: function (s) { return s; } }; // string type expressions var ResultIsBoolean6 = !objA.a; var ResultIsBoolean7 = !M.n; diff --git a/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.js b/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.js index 12e55119c35..64bdc871571 100644 --- a/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.js +++ b/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.js @@ -11,10 +11,4 @@ var r: { a: string } = { a: '', b: 123 } || { a: '', b: true }; // If the || expression is contextually typed, the operands are contextually typed by the // same type and the result is of the best common type of the contextual type and the two // operand types. -var r = { - a: '', - b: 123 -} || { - a: '', - b: true -}; +var r = { a: '', b: 123 } || { a: '', b: true }; diff --git a/tests/baselines/reference/logicalOrExpressionIsNotContextuallyTyped.js b/tests/baselines/reference/logicalOrExpressionIsNotContextuallyTyped.js index 0731cb620a5..73e1c33a4e0 100644 --- a/tests/baselines/reference/logicalOrExpressionIsNotContextuallyTyped.js +++ b/tests/baselines/reference/logicalOrExpressionIsNotContextuallyTyped.js @@ -17,6 +17,4 @@ var r = a || ((a) => a.toLowerCase()); // operand types. var a; // bug 786110 -var r = a || (function (a) { - return a.toLowerCase(); -}); +var r = a || (function (a) { return a.toLowerCase(); }); diff --git a/tests/baselines/reference/logicalOrOperatorWithTypeParameters.js b/tests/baselines/reference/logicalOrOperatorWithTypeParameters.js index b73a3144064..e0fca87efa8 100644 --- a/tests/baselines/reference/logicalOrOperatorWithTypeParameters.js +++ b/tests/baselines/reference/logicalOrOperatorWithTypeParameters.js @@ -42,8 +42,6 @@ function fn2(t, u, v) { function fn3(t, u) { var r1 = t || u; var r2 = t || u; - var r3 = t || { - a: '' - }; + var r3 = t || { a: '' }; var r4 = t || u; } diff --git a/tests/baselines/reference/matchingOfObjectLiteralConstraints.js b/tests/baselines/reference/matchingOfObjectLiteralConstraints.js index 13d9e0e05e8..1d19359894d 100644 --- a/tests/baselines/reference/matchingOfObjectLiteralConstraints.js +++ b/tests/baselines/reference/matchingOfObjectLiteralConstraints.js @@ -5,8 +5,5 @@ foo2({ y: "foo" }, "foo"); //// [matchingOfObjectLiteralConstraints.js] -function foo2(x, z) { -} -foo2({ - y: "foo" -}, "foo"); +function foo2(x, z) { } +foo2({ y: "foo" }, "foo"); diff --git a/tests/baselines/reference/maxConstraints.js b/tests/baselines/reference/maxConstraints.js index 4ea37d30501..b2098ccaf2b 100644 --- a/tests/baselines/reference/maxConstraints.js +++ b/tests/baselines/reference/maxConstraints.js @@ -9,7 +9,5 @@ var max2: Comparer = (x, y) => { return (x.compareTo(y) > 0) ? x : y }; var maxResult = max2(1, 2); //// [maxConstraints.js] -var max2 = function (x, y) { - return (x.compareTo(y) > 0) ? x : y; -}; +var max2 = function (x, y) { return (x.compareTo(y) > 0) ? x : y; }; var maxResult = max2(1, 2); diff --git a/tests/baselines/reference/memberFunctionsWithPrivateOverloads.js b/tests/baselines/reference/memberFunctionsWithPrivateOverloads.js index dc347e95580..584bafad6f6 100644 --- a/tests/baselines/reference/memberFunctionsWithPrivateOverloads.js +++ b/tests/baselines/reference/memberFunctionsWithPrivateOverloads.js @@ -53,27 +53,19 @@ var r4 = D.bar(''); // error var C = (function () { function C() { } - C.prototype.foo = function (x, y) { - }; - C.prototype.bar = function (x, y) { - }; - C.foo = function (x, y) { - }; - C.bar = function (x, y) { - }; + C.prototype.foo = function (x, y) { }; + C.prototype.bar = function (x, y) { }; + C.foo = function (x, y) { }; + C.bar = function (x, y) { }; return C; })(); var D = (function () { function D() { } - D.prototype.foo = function (x, y) { - }; - D.prototype.bar = function (x, y) { - }; - D.foo = function (x, y) { - }; - D.bar = function (x, y) { - }; + D.prototype.foo = function (x, y) { }; + D.prototype.bar = function (x, y) { }; + D.foo = function (x, y) { }; + D.bar = function (x, y) { }; return D; })(); var c; diff --git a/tests/baselines/reference/memberFunctionsWithPublicOverloads.js b/tests/baselines/reference/memberFunctionsWithPublicOverloads.js index 5eaf894f549..efdd6efaffa 100644 --- a/tests/baselines/reference/memberFunctionsWithPublicOverloads.js +++ b/tests/baselines/reference/memberFunctionsWithPublicOverloads.js @@ -44,26 +44,18 @@ class D { var C = (function () { function C() { } - C.prototype.foo = function (x, y) { - }; - C.prototype.bar = function (x, y) { - }; - C.foo = function (x, y) { - }; - C.bar = function (x, y) { - }; + C.prototype.foo = function (x, y) { }; + C.prototype.bar = function (x, y) { }; + C.foo = function (x, y) { }; + C.bar = function (x, y) { }; return C; })(); var D = (function () { function D() { } - D.prototype.foo = function (x, y) { - }; - D.prototype.bar = function (x, y) { - }; - D.foo = function (x, y) { - }; - D.bar = function (x, y) { - }; + D.prototype.foo = function (x, y) { }; + D.prototype.bar = function (x, y) { }; + D.foo = function (x, y) { }; + D.bar = function (x, y) { }; return D; })(); diff --git a/tests/baselines/reference/memberFunctionsWithPublicPrivateOverloads.js b/tests/baselines/reference/memberFunctionsWithPublicPrivateOverloads.js index 2726756c803..7738bf4fe4e 100644 --- a/tests/baselines/reference/memberFunctionsWithPublicPrivateOverloads.js +++ b/tests/baselines/reference/memberFunctionsWithPublicPrivateOverloads.js @@ -66,35 +66,23 @@ var r2 = d.foo(2); // error var C = (function () { function C() { } - C.prototype.foo = function (x, y) { - }; - C.prototype.bar = function (x, y) { - }; - C.foo = function (x, y) { - }; - C.prototype.baz = function (x, y) { - }; - C.bar = function (x, y) { - }; - C.baz = function (x, y) { - }; + C.prototype.foo = function (x, y) { }; + C.prototype.bar = function (x, y) { }; + C.foo = function (x, y) { }; + C.prototype.baz = function (x, y) { }; + C.bar = function (x, y) { }; + C.baz = function (x, y) { }; return C; })(); var D = (function () { function D() { } - D.prototype.foo = function (x, y) { - }; - D.prototype.bar = function (x, y) { - }; - D.prototype.baz = function (x, y) { - }; - D.foo = function (x, y) { - }; - D.bar = function (x, y) { - }; - D.baz = function (x, y) { - }; + D.prototype.foo = function (x, y) { }; + D.prototype.bar = function (x, y) { }; + D.prototype.baz = function (x, y) { }; + D.foo = function (x, y) { }; + D.bar = function (x, y) { }; + D.baz = function (x, y) { }; return D; })(); var c; diff --git a/tests/baselines/reference/mergedDeclarations1.js b/tests/baselines/reference/mergedDeclarations1.js index 9dc432f94a6..641ff031ded 100644 --- a/tests/baselines/reference/mergedDeclarations1.js +++ b/tests/baselines/reference/mergedDeclarations1.js @@ -18,10 +18,7 @@ var b = point.equals(p1, p2); //// [mergedDeclarations1.js] function point(x, y) { - return { - x: x, - y: y - }; + return { x: x, y: y }; } var point; (function (point) { diff --git a/tests/baselines/reference/mergedDeclarations4.js b/tests/baselines/reference/mergedDeclarations4.js index a3dab29ff75..64fad6bd598 100644 --- a/tests/baselines/reference/mergedDeclarations4.js +++ b/tests/baselines/reference/mergedDeclarations4.js @@ -21,8 +21,7 @@ M.f.hello; //// [mergedDeclarations4.js] var M; (function (M) { - function f() { - } + function f() { } M.f = f; f(); M.f(); diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen2.js b/tests/baselines/reference/mergedModuleDeclarationCodeGen2.js index 06a590194f5..bb7c34e4ac5 100644 --- a/tests/baselines/reference/mergedModuleDeclarationCodeGen2.js +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen2.js @@ -15,8 +15,7 @@ var my; (function (data) { var foo; (function (foo) { - function buz() { - } + function buz() { } foo.buz = buz; })(foo = data.foo || (data.foo = {})); })(data = my.data || (my.data = {})); diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen3.js b/tests/baselines/reference/mergedModuleDeclarationCodeGen3.js index 43c55ed8291..4a002e88f3d 100644 --- a/tests/baselines/reference/mergedModuleDeclarationCodeGen3.js +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen3.js @@ -13,8 +13,7 @@ var my; (function (my) { var data; (function (data) { - function buz() { - } + function buz() { } data.buz = buz; })(data = my.data || (my.data = {})); })(my || (my = {})); diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen4.js b/tests/baselines/reference/mergedModuleDeclarationCodeGen4.js index af7f5bacef7..3e4a2dcd308 100644 --- a/tests/baselines/reference/mergedModuleDeclarationCodeGen4.js +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen4.js @@ -27,8 +27,7 @@ var superContain; (function (buz) { var data; (function (data) { - function foo() { - } + function foo() { } data.foo = foo; })(data = buz.data || (buz.data = {})); })(buz = my.buz || (my.buz = {})); diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen5.js b/tests/baselines/reference/mergedModuleDeclarationCodeGen5.js index 4bbad2e5678..44ab49d24e0 100644 --- a/tests/baselines/reference/mergedModuleDeclarationCodeGen5.js +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen5.js @@ -25,11 +25,9 @@ var M; (function (buz) { var plop; (function (plop) { - function doom() { - } + function doom() { } plop.doom = doom; - function M() { - } + function M() { } plop.M = M; })(plop = buz.plop || (buz.plop = {})); })(buz = M_1.buz || (M_1.buz = {})); @@ -40,10 +38,8 @@ var M; (function (buz_1) { var plop; (function (plop_1) { - function gunk() { - } - function buz() { - } + function gunk() { } + function buz() { } var fudge = (function () { function fudge() { } diff --git a/tests/baselines/reference/methodContainingLocalFunction.js b/tests/baselines/reference/methodContainingLocalFunction.js index 36487e3ad7c..f2f336d38b7 100644 --- a/tests/baselines/reference/methodContainingLocalFunction.js +++ b/tests/baselines/reference/methodContainingLocalFunction.js @@ -56,8 +56,7 @@ var BugExhibition = (function () { function BugExhibition() { } BugExhibition.prototype.exhibitBug = function () { - function localFunction() { - } + function localFunction() { } var x; x = localFunction; }; @@ -68,8 +67,7 @@ var BugExhibition2 = (function () { } Object.defineProperty(BugExhibition2, "exhibitBug", { get: function () { - function localFunction() { - } + function localFunction() { } var x; x = localFunction; return null; @@ -83,8 +81,7 @@ var BugExhibition3 = (function () { function BugExhibition3() { } BugExhibition3.prototype.exhibitBug = function () { - function localGenericFunction(u) { - } + function localGenericFunction(u) { } var x; x = localGenericFunction; }; @@ -94,8 +91,7 @@ var C = (function () { function C() { } C.prototype.exhibit = function () { - var funcExpr = function (u) { - }; + var funcExpr = function (u) { }; var x; x = funcExpr; }; @@ -104,8 +100,7 @@ var C = (function () { var M; (function (M) { function exhibitBug() { - function localFunction() { - } + function localFunction() { } var x; x = localFunction; } @@ -114,8 +109,7 @@ var M; var E; (function (E) { E[E["A"] = (function () { - function localFunction() { - } + function localFunction() { } var x; x = localFunction; return 0; diff --git a/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.js b/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.js index 0315f0c7a63..0465ea46f55 100644 --- a/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.js +++ b/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.js @@ -15,44 +15,12 @@ var r8 = map([1, ""], (x) => x.toString()); //// [mismatchedExplicitTypeParameterAndArgumentType.js] function map(xs, f) { var ys = []; - xs.forEach(function (x) { - return ys.push(f(x)); - }); + xs.forEach(function (x) { return ys.push(f(x)); }); return ys; } -var r0 = map([ - 1, - "" -], function (x) { - return x.toString(); -}); -var r5 = map([ - 1, - "" -], function (x) { - return x.toString(); -}); -var r6 = map([ - 1, - "" -], function (x) { - return x.toString(); -}); -var r7 = map([ - 1, - "" -], function (x) { - return x.toString(); -}); // error -var r7b = map([ - 1, - "" -], function (x) { - return x.toString(); -}); // error -var r8 = map([ - 1, - "" -], function (x) { - return x.toString(); -}); +var r0 = map([1, ""], function (x) { return x.toString(); }); +var r5 = map([1, ""], function (x) { return x.toString(); }); +var r6 = map([1, ""], function (x) { return x.toString(); }); +var r7 = map([1, ""], function (x) { return x.toString(); }); // error +var r7b = map([1, ""], function (x) { return x.toString(); }); // error +var r8 = map([1, ""], function (x) { return x.toString(); }); diff --git a/tests/baselines/reference/missingSelf.js b/tests/baselines/reference/missingSelf.js index a0400aa4b2e..56dcc4f9fa0 100644 --- a/tests/baselines/reference/missingSelf.js +++ b/tests/baselines/reference/missingSelf.js @@ -22,11 +22,8 @@ c2.b(); var CalcButton = (function () { function CalcButton() { } - CalcButton.prototype.a = function () { - this.onClick(); - }; - CalcButton.prototype.onClick = function () { - }; + CalcButton.prototype.a = function () { this.onClick(); }; + CalcButton.prototype.onClick = function () { }; return CalcButton; })(); var CalcButton2 = (function () { @@ -34,12 +31,9 @@ var CalcButton2 = (function () { } CalcButton2.prototype.b = function () { var _this = this; - (function () { - return _this.onClick(); - }); - }; - CalcButton2.prototype.onClick = function () { + (function () { return _this.onClick(); }); }; + CalcButton2.prototype.onClick = function () { }; return CalcButton2; })(); var c = new CalcButton(); diff --git a/tests/baselines/reference/missingTypeArguments2.js b/tests/baselines/reference/missingTypeArguments2.js index fe4b7c7dd79..bc5c1d88f46 100644 --- a/tests/baselines/reference/missingTypeArguments2.js +++ b/tests/baselines/reference/missingTypeArguments2.js @@ -13,9 +13,6 @@ var A = (function () { return A; })(); var x; -(function (a) { -}); +(function (a) { }); var y; -(function () { - return null; -}); +(function () { return null; }); diff --git a/tests/baselines/reference/mixingFunctionAndAmbientModule1.js b/tests/baselines/reference/mixingFunctionAndAmbientModule1.js index 3105c923304..db1bc28a144 100644 --- a/tests/baselines/reference/mixingFunctionAndAmbientModule1.js +++ b/tests/baselines/reference/mixingFunctionAndAmbientModule1.js @@ -45,13 +45,11 @@ module E { //// [mixingFunctionAndAmbientModule1.js] var A; (function (A) { - function My(s) { - } + function My(s) { } })(A || (A = {})); var B; (function (B) { - function My(s) { - } + function My(s) { } })(B || (B = {})); var C; (function (C) { diff --git a/tests/baselines/reference/mixingStaticAndInstanceOverloads.js b/tests/baselines/reference/mixingStaticAndInstanceOverloads.js index 59495280771..22367461c2c 100644 --- a/tests/baselines/reference/mixingStaticAndInstanceOverloads.js +++ b/tests/baselines/reference/mixingStaticAndInstanceOverloads.js @@ -39,37 +39,31 @@ class C5 { var C1 = (function () { function C1() { } - C1.foo1 = function (a) { - }; + C1.foo1 = function (a) { }; return C1; })(); var C2 = (function () { function C2() { } - C2.prototype.foo2 = function (a) { - }; + C2.prototype.foo2 = function (a) { }; return C2; })(); var C3 = (function () { function C3() { } - C3.prototype.foo3 = function (a) { - }; + C3.prototype.foo3 = function (a) { }; return C3; })(); var C4 = (function () { function C4() { } - C4.foo4 = function (a) { - }; + C4.foo4 = function (a) { }; return C4; })(); var C5 = (function () { function C5() { } - C5.prototype.foo5 = function (a) { - }; - C5.foo5 = function (a) { - }; + C5.prototype.foo5 = function (a) { }; + C5.foo5 = function (a) { }; return C5; })(); diff --git a/tests/baselines/reference/modFunctionCrash.js b/tests/baselines/reference/modFunctionCrash.js index f216788c0eb..0d4f62eae63 100644 --- a/tests/baselines/reference/modFunctionCrash.js +++ b/tests/baselines/reference/modFunctionCrash.js @@ -7,6 +7,4 @@ declare module Q { Q.f(function() {this;}); //// [modFunctionCrash.js] -Q.f(function () { - this; -}); +Q.f(function () { this; }); diff --git a/tests/baselines/reference/moduleCodeGenTest5.js b/tests/baselines/reference/moduleCodeGenTest5.js index 6f56f44c684..afc1ce23e37 100644 --- a/tests/baselines/reference/moduleCodeGenTest5.js +++ b/tests/baselines/reference/moduleCodeGenTest5.js @@ -24,17 +24,14 @@ var v = E2.B; //// [moduleCodeGenTest5.js] exports.x = 0; var y = 0; -function f1() { -} +function f1() { } exports.f1 = f1; -function f2() { -} +function f2() { } var C1 = (function () { function C1() { this.p1 = 0; } - C1.prototype.p2 = function () { - }; + C1.prototype.p2 = function () { }; return C1; })(); exports.C1 = C1; @@ -42,8 +39,7 @@ var C2 = (function () { function C2() { this.p1 = 0; } - C2.prototype.p2 = function () { - }; + C2.prototype.p2 = function () { }; return C2; })(); (function (E1) { diff --git a/tests/baselines/reference/moduleInTypePosition1.js b/tests/baselines/reference/moduleInTypePosition1.js index 92fcd5b16e2..972bbae63d1 100644 --- a/tests/baselines/reference/moduleInTypePosition1.js +++ b/tests/baselines/reference/moduleInTypePosition1.js @@ -19,5 +19,4 @@ var Promise = (function () { })(); exports.Promise = Promise; //// [moduleInTypePosition1_1.js] -var x = function (w1) { -}; +var x = function (w1) { }; diff --git a/tests/baselines/reference/moduleKeywordRepeatError.js b/tests/baselines/reference/moduleKeywordRepeatError.js index 8ec656f22ae..385bce001a2 100644 --- a/tests/baselines/reference/moduleKeywordRepeatError.js +++ b/tests/baselines/reference/moduleKeywordRepeatError.js @@ -6,5 +6,4 @@ module.module { } //// [moduleKeywordRepeatError.js] // "module.module { }" should raise a syntax error module.module; -{ -} +{ } diff --git a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.js b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.js index 63ccf613a77..1467ec18b91 100644 --- a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.js +++ b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.js @@ -102,8 +102,7 @@ var TypeScript; (function (TypeScript) { var Syntax; (function (Syntax) { - function childIndex() { - } + function childIndex() { } Syntax.childIndex = childIndex; var VariableWidthTokenWithTrailingTrivia = (function () { function VariableWidthTokenWithTrailingTrivia() { diff --git a/tests/baselines/reference/moduleNewExportBug.js b/tests/baselines/reference/moduleNewExportBug.js index 51e1bb24144..ce40915b2f6 100644 --- a/tests/baselines/reference/moduleNewExportBug.js +++ b/tests/baselines/reference/moduleNewExportBug.js @@ -19,8 +19,7 @@ var mod1; var C = (function () { function C() { } - C.prototype.moo = function () { - }; + C.prototype.moo = function () { }; return C; })(); })(mod1 || (mod1 = {})); diff --git a/tests/baselines/reference/moduleReopenedTypeOtherBlock.js b/tests/baselines/reference/moduleReopenedTypeOtherBlock.js index d2dc938872a..951c558ddfd 100644 --- a/tests/baselines/reference/moduleReopenedTypeOtherBlock.js +++ b/tests/baselines/reference/moduleReopenedTypeOtherBlock.js @@ -23,9 +23,7 @@ var M; var C2 = (function () { function C2() { } - C2.prototype.f = function () { - return null; - }; + C2.prototype.f = function () { return null; }; return C2; })(); M.C2 = C2; diff --git a/tests/baselines/reference/moduleReopenedTypeSameBlock.js b/tests/baselines/reference/moduleReopenedTypeSameBlock.js index c3546f20b2f..92e7e9e5228 100644 --- a/tests/baselines/reference/moduleReopenedTypeSameBlock.js +++ b/tests/baselines/reference/moduleReopenedTypeSameBlock.js @@ -21,9 +21,7 @@ var M; var C2 = (function () { function C2() { } - C2.prototype.f = function () { - return null; - }; + C2.prototype.f = function () { return null; }; return C2; })(); M.C2 = C2; diff --git a/tests/baselines/reference/moduleScoping.js b/tests/baselines/reference/moduleScoping.js index 1bcf1dbea0a..cbe435e570c 100644 --- a/tests/baselines/reference/moduleScoping.js +++ b/tests/baselines/reference/moduleScoping.js @@ -26,24 +26,15 @@ var x = v2; // Should be global v2 of type number again var v1 = "sausages"; // Global scope //// [file2.js] var v2 = 42; // Global scope -var v4 = function () { - return 5; -}; +var v4 = function () { return 5; }; //// [file3.js] exports.v3 = true; -var v2 = [ - 1, - 2, - 3 -]; // Module scope. Should not appear in global scope +var v2 = [1, 2, 3]; // Module scope. Should not appear in global scope //// [file4.js] var file3 = require('./file3'); var t1 = v1; var t2 = v2; var t3 = file3.v3; -var v4 = { - a: true, - b: NaN -}; // Should shadow global v2 in this module +var v4 = { a: true, b: NaN }; // Should shadow global v2 in this module //// [file5.js] var x = v2; // Should be global v2 of type number again diff --git a/tests/baselines/reference/moduleSymbolMerging.js b/tests/baselines/reference/moduleSymbolMerging.js index 0a812a62e09..d43fff1378a 100644 --- a/tests/baselines/reference/moduleSymbolMerging.js +++ b/tests/baselines/reference/moduleSymbolMerging.js @@ -22,9 +22,7 @@ var A; })(A || (A = {})); var B; (function (B) { - function f() { - return null; - } + function f() { return null; } B.f = f; })(B || (B = {})); diff --git a/tests/baselines/reference/moduleUnassignedVariable.js b/tests/baselines/reference/moduleUnassignedVariable.js index 179a2577adf..1765342efcd 100644 --- a/tests/baselines/reference/moduleUnassignedVariable.js +++ b/tests/baselines/reference/moduleUnassignedVariable.js @@ -12,11 +12,7 @@ module Bar { var Bar; (function (Bar) { Bar.a = 1; - function fooA() { - return Bar.a; - } // Correct: return Bar.a + function fooA() { return Bar.a; } // Correct: return Bar.a Bar.b; - function fooB() { - return Bar.b; - } // Incorrect: return b + function fooB() { return Bar.b; } // Incorrect: return b })(Bar || (Bar = {})); diff --git a/tests/baselines/reference/moduleVisibilityTest1.js b/tests/baselines/reference/moduleVisibilityTest1.js index 8f129f545de..f4655513bec 100644 --- a/tests/baselines/reference/moduleVisibilityTest1.js +++ b/tests/baselines/reference/moduleVisibilityTest1.js @@ -70,15 +70,11 @@ c.someMethodThatCallsAnOuterMethod(); //// [moduleVisibilityTest1.js] var OuterMod; (function (OuterMod) { - function someExportedOuterFunc() { - return -1; - } + function someExportedOuterFunc() { return -1; } OuterMod.someExportedOuterFunc = someExportedOuterFunc; var OuterInnerMod; (function (OuterInnerMod) { - function someExportedOuterInnerFunc() { - return "foo"; - } + function someExportedOuterInnerFunc() { return "foo"; } OuterInnerMod.someExportedOuterInnerFunc = someExportedOuterInnerFunc; })(OuterInnerMod = OuterMod.OuterInnerMod || (OuterMod.OuterInnerMod = {})); })(OuterMod || (OuterMod = {})); @@ -87,9 +83,7 @@ var M; (function (M) { var InnerMod; (function (InnerMod) { - function someExportedInnerFunc() { - return -2; - } + function someExportedInnerFunc() { return -2; } InnerMod.someExportedInnerFunc = someExportedInnerFunc; })(InnerMod = M.InnerMod || (M.InnerMod = {})); (function (E) { @@ -109,30 +103,18 @@ var M; var C = (function () { function C() { this.someProp = 1; - function someInnerFunc() { - return 2; - } + function someInnerFunc() { return 2; } var someInnerVar = 3; } - C.prototype.someMethodThatCallsAnOuterMethod = function () { - return OuterInnerAlias.someExportedOuterInnerFunc(); - }; - C.prototype.someMethodThatCallsAnInnerMethod = function () { - return InnerMod.someExportedInnerFunc(); - }; - C.prototype.someMethodThatCallsAnOuterInnerMethod = function () { - return OuterMod.someExportedOuterFunc(); - }; - C.prototype.someMethod = function () { - return 0; - }; + C.prototype.someMethodThatCallsAnOuterMethod = function () { return OuterInnerAlias.someExportedOuterInnerFunc(); }; + C.prototype.someMethodThatCallsAnInnerMethod = function () { return InnerMod.someExportedInnerFunc(); }; + C.prototype.someMethodThatCallsAnOuterInnerMethod = function () { return OuterMod.someExportedOuterFunc(); }; + C.prototype.someMethod = function () { return 0; }; return C; })(); M.C = C; var someModuleVar = 4; - function someModuleFunction() { - return 5; - } + function someModuleFunction() { return 5; } })(M || (M = {})); var M; (function (M) { diff --git a/tests/baselines/reference/moduleVisibilityTest2.js b/tests/baselines/reference/moduleVisibilityTest2.js index 63ecaf0c135..9102bd17ae2 100644 --- a/tests/baselines/reference/moduleVisibilityTest2.js +++ b/tests/baselines/reference/moduleVisibilityTest2.js @@ -71,15 +71,11 @@ c.someMethodThatCallsAnOuterMethod(); //// [moduleVisibilityTest2.js] var OuterMod; (function (OuterMod) { - function someExportedOuterFunc() { - return -1; - } + function someExportedOuterFunc() { return -1; } OuterMod.someExportedOuterFunc = someExportedOuterFunc; var OuterInnerMod; (function (OuterInnerMod) { - function someExportedOuterInnerFunc() { - return "foo"; - } + function someExportedOuterInnerFunc() { return "foo"; } OuterInnerMod.someExportedOuterInnerFunc = someExportedOuterInnerFunc; })(OuterInnerMod = OuterMod.OuterInnerMod || (OuterMod.OuterInnerMod = {})); })(OuterMod || (OuterMod = {})); @@ -88,9 +84,7 @@ var M; (function (M) { var InnerMod; (function (InnerMod) { - function someExportedInnerFunc() { - return -2; - } + function someExportedInnerFunc() { return -2; } InnerMod.someExportedInnerFunc = someExportedInnerFunc; })(InnerMod || (InnerMod = {})); var E; @@ -110,30 +104,18 @@ var M; var C = (function () { function C() { this.someProp = 1; - function someInnerFunc() { - return 2; - } + function someInnerFunc() { return 2; } var someInnerVar = 3; } - C.prototype.someMethodThatCallsAnOuterMethod = function () { - return OuterInnerAlias.someExportedOuterInnerFunc(); - }; - C.prototype.someMethodThatCallsAnInnerMethod = function () { - return InnerMod.someExportedInnerFunc(); - }; - C.prototype.someMethodThatCallsAnOuterInnerMethod = function () { - return OuterMod.someExportedOuterFunc(); - }; - C.prototype.someMethod = function () { - return 0; - }; + C.prototype.someMethodThatCallsAnOuterMethod = function () { return OuterInnerAlias.someExportedOuterInnerFunc(); }; + C.prototype.someMethodThatCallsAnInnerMethod = function () { return InnerMod.someExportedInnerFunc(); }; + C.prototype.someMethodThatCallsAnOuterInnerMethod = function () { return OuterMod.someExportedOuterFunc(); }; + C.prototype.someMethod = function () { return 0; }; return C; })(); M.C = C; var someModuleVar = 4; - function someModuleFunction() { - return 5; - } + function someModuleFunction() { return 5; } })(M || (M = {})); var M; (function (M) { diff --git a/tests/baselines/reference/moduleWithStatementsOfEveryKind.js b/tests/baselines/reference/moduleWithStatementsOfEveryKind.js index cab0d35aa5a..8ce4cb693f7 100644 --- a/tests/baselines/reference/moduleWithStatementsOfEveryKind.js +++ b/tests/baselines/reference/moduleWithStatementsOfEveryKind.js @@ -112,11 +112,7 @@ var A; var fn = function (s) { return 'hello ' + s; }; - var ol = { - s: 'hello', - id: 2, - isvalid: true - }; + var ol = { s: 'hello', id: 2, isvalid: true }; })(A || (A = {})); var Y; (function (Y) { @@ -170,9 +166,5 @@ var Y; Y.fn = function (s) { return 'hello ' + s; }; - Y.ol = { - s: 'hello', - id: 2, - isvalid: true - }; + Y.ol = { s: 'hello', id: 2, isvalid: true }; })(Y || (Y = {})); diff --git a/tests/baselines/reference/multiCallOverloads.js b/tests/baselines/reference/multiCallOverloads.js index 85b008d52b7..d4e765c5514 100644 --- a/tests/baselines/reference/multiCallOverloads.js +++ b/tests/baselines/reference/multiCallOverloads.js @@ -14,15 +14,10 @@ load(function(z?) {}) // this shouldn't be an error //// [multiCallOverloads.js] -function load(f) { -} -var f1 = function (z) { -}; -var f2 = function (z) { -}; +function load(f) { } +var f1 = function (z) { }; +var f2 = function (z) { }; load(f1); // ok load(f2); // ok -load(function () { -}); // this shouldn’t be an error -load(function (z) { -}); // this shouldn't be an error +load(function () { }); // this shouldn’t be an error +load(function (z) { }); // this shouldn't be an error diff --git a/tests/baselines/reference/multiLinePropertyAccessAndArrowFunctionIndent1.js b/tests/baselines/reference/multiLinePropertyAccessAndArrowFunctionIndent1.js index 4d0317a50a5..2ada9f1bb52 100644 --- a/tests/baselines/reference/multiLinePropertyAccessAndArrowFunctionIndent1.js +++ b/tests/baselines/reference/multiLinePropertyAccessAndArrowFunctionIndent1.js @@ -7,8 +7,8 @@ return this.edit(role) //// [multiLinePropertyAccessAndArrowFunctionIndent1.js] var _this = this; -return this.edit(role).then(function (role) { - return _this.roleService.add(role).then(function (data) { - return data.data; - }); +return this.edit(role) + .then(function (role) { + return _this.roleService.add(role) + .then(function (data) { return data.data; }); }); diff --git a/tests/baselines/reference/multiModuleClodule1.js b/tests/baselines/reference/multiModuleClodule1.js index a64abd81680..9f6d7b5014c 100644 --- a/tests/baselines/reference/multiModuleClodule1.js +++ b/tests/baselines/reference/multiModuleClodule1.js @@ -22,12 +22,9 @@ c.foo = C.foo; var C = (function () { function C(x) { } - C.prototype.foo = function () { - }; - C.prototype.bar = function () { - }; - C.boo = function () { - }; + C.prototype.foo = function () { }; + C.prototype.bar = function () { }; + C.boo = function () { }; return C; })(); var C; @@ -37,12 +34,9 @@ var C; })(C || (C = {})); var C; (function (C) { - function foo() { - } + function foo() { } C.foo = foo; - function baz() { - return ''; - } + function baz() { return ''; } })(C || (C = {})); var c = new C(C.x); c.foo = C.foo; diff --git a/tests/baselines/reference/multiModuleFundule1.js b/tests/baselines/reference/multiModuleFundule1.js index f643ed5ee4d..6aa9cb959ba 100644 --- a/tests/baselines/reference/multiModuleFundule1.js +++ b/tests/baselines/reference/multiModuleFundule1.js @@ -13,16 +13,14 @@ var r2 = new C(2); // using void returning function as constructor var r3 = C.foo(); //// [multiModuleFundule1.js] -function C(x) { -} +function C(x) { } var C; (function (C) { C.x = 1; })(C || (C = {})); var C; (function (C) { - function foo() { - } + function foo() { } C.foo = foo; })(C || (C = {})); var r = C(2); diff --git a/tests/baselines/reference/multipleInheritance.js b/tests/baselines/reference/multipleInheritance.js index 9cab77f3dba..269d5c2ea19 100644 --- a/tests/baselines/reference/multipleInheritance.js +++ b/tests/baselines/reference/multipleInheritance.js @@ -97,13 +97,9 @@ var ND = (function (_super) { })(N); var Good = (function () { function Good() { - this.f = function () { - return 0; - }; + this.f = function () { return 0; }; } - Good.prototype.g = function () { - return 0; - }; + Good.prototype.g = function () { return 0; }; return Good; })(); var Baad = (function (_super) { @@ -111,11 +107,7 @@ var Baad = (function (_super) { function Baad() { _super.apply(this, arguments); } - Baad.prototype.f = function () { - return 0; - }; - Baad.prototype.g = function (n) { - return 0; - }; + Baad.prototype.f = function () { return 0; }; + Baad.prototype.g = function (n) { return 0; }; return Baad; })(Good); diff --git a/tests/baselines/reference/multipleNumericIndexers.js b/tests/baselines/reference/multipleNumericIndexers.js index 31bd84e5356..638cf01569a 100644 --- a/tests/baselines/reference/multipleNumericIndexers.js +++ b/tests/baselines/reference/multipleNumericIndexers.js @@ -40,10 +40,7 @@ var C = (function () { return C; })(); var a; -var b = { - 1: '', - "2": '' -}; +var b = { 1: '', "2": '' }; var C2 = (function () { function C2() { } diff --git a/tests/baselines/reference/multipleStringIndexers.js b/tests/baselines/reference/multipleStringIndexers.js index b914b205654..55dd816e42b 100644 --- a/tests/baselines/reference/multipleStringIndexers.js +++ b/tests/baselines/reference/multipleStringIndexers.js @@ -39,9 +39,7 @@ var C = (function () { return C; })(); var a; -var b = { - y: '' -}; +var b = { y: '' }; var C2 = (function () { function C2() { } diff --git a/tests/baselines/reference/mutrec.js b/tests/baselines/reference/mutrec.js index ba6c8ade036..1d1ccb4e90b 100644 --- a/tests/baselines/reference/mutrec.js +++ b/tests/baselines/reference/mutrec.js @@ -43,15 +43,11 @@ g(i4); //// [mutrec.js] -function f(p) { - return p; -} +function f(p) { return p; } ; var b; f(b); -function g(p) { - return p; -} +function g(p) { return p; } ; var i2; g(i2); diff --git a/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js index 585a3d2178b..76fd13aa320 100644 --- a/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js +++ b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js @@ -20,9 +20,7 @@ var __extends = this.__extends || function (d, b) { var foo = (function () { function foo() { } - foo.prototype.bar = function () { - return null; - }; + foo.prototype.bar = function () { return null; }; return foo; })(); var foo2 = (function (_super) { diff --git a/tests/baselines/reference/nameCollisions.js b/tests/baselines/reference/nameCollisions.js index 51b66adcefe..2cfaba94993 100644 --- a/tests/baselines/reference/nameCollisions.js +++ b/tests/baselines/reference/nameCollisions.js @@ -76,10 +76,8 @@ var T; })(); // error var w; var f; - function f() { - } //error - function f2() { - } + function f() { } //error + function f2() { } var f2; // error var i; var C = (function () { @@ -87,17 +85,14 @@ var T; } return C; })(); - function C() { - } // error - function C2() { - } + function C() { } // error + function C2() { } var C2 = (function () { function C2() { } return C2; })(); // error - function fi() { - } + function fi() { } var cli = (function () { function cli() { } diff --git a/tests/baselines/reference/nameCollisionsInPropertyAssignments.js b/tests/baselines/reference/nameCollisionsInPropertyAssignments.js index 4c2634d881d..1f3631e03ba 100644 --- a/tests/baselines/reference/nameCollisionsInPropertyAssignments.js +++ b/tests/baselines/reference/nameCollisionsInPropertyAssignments.js @@ -4,8 +4,4 @@ var y = { x() { x++; } }; //// [nameCollisionsInPropertyAssignments.js] var x = 1; -var y = { - x: function () { - x++; - } -}; +var y = { x: function () { x++; } }; diff --git a/tests/baselines/reference/negateOperatorWithAnyOtherType.js b/tests/baselines/reference/negateOperatorWithAnyOtherType.js index 453b032e004..8418bbbe467 100644 --- a/tests/baselines/reference/negateOperatorWithAnyOtherType.js +++ b/tests/baselines/reference/negateOperatorWithAnyOtherType.js @@ -57,16 +57,9 @@ var ResultIsNumber15 = -(ANY - ANY1); // - operator on any type var ANY; var ANY1; -var ANY2 = [ - "", - "" -]; +var ANY2 = ["", ""]; var obj; -var obj1 = { - x: "", - y: function () { - } -}; +var obj1 = { x: "", y: function () { } }; function foo() { var a; return a; diff --git a/tests/baselines/reference/negateOperatorWithBooleanType.js b/tests/baselines/reference/negateOperatorWithBooleanType.js index f50382de652..9442f54490f 100644 --- a/tests/baselines/reference/negateOperatorWithBooleanType.js +++ b/tests/baselines/reference/negateOperatorWithBooleanType.js @@ -38,15 +38,11 @@ var ResultIsNumber7 = -A.foo(); //// [negateOperatorWithBooleanType.js] // - operator on boolean type var BOOLEAN; -function foo() { - return true; -} +function foo() { return true; } var A = (function () { function A() { } - A.foo = function () { - return false; - }; + A.foo = function () { return false; }; return A; })(); var M; @@ -58,10 +54,7 @@ var objA = new A(); var ResultIsNumber1 = -BOOLEAN; // boolean type literal var ResultIsNumber2 = -true; -var ResultIsNumber3 = -{ - x: true, - y: false -}; +var ResultIsNumber3 = -{ x: true, y: false }; // boolean type expressions var ResultIsNumber4 = -objA.a; var ResultIsNumber5 = -M.n; diff --git a/tests/baselines/reference/negateOperatorWithNumberType.js b/tests/baselines/reference/negateOperatorWithNumberType.js index 90cb9c073b3..5fa83e088c8 100644 --- a/tests/baselines/reference/negateOperatorWithNumberType.js +++ b/tests/baselines/reference/negateOperatorWithNumberType.js @@ -44,19 +44,12 @@ var ResultIsNumber11 = -(NUMBER - NUMBER); //// [negateOperatorWithNumberType.js] // - operator on number type var NUMBER; -var NUMBER1 = [ - 1, - 2 -]; -function foo() { - return 1; -} +var NUMBER1 = [1, 2]; +function foo() { return 1; } var A = (function () { function A() { } - A.foo = function () { - return 1; - }; + A.foo = function () { return 1; }; return A; })(); var M; @@ -69,16 +62,8 @@ var ResultIsNumber1 = -NUMBER; var ResultIsNumber2 = -NUMBER1; // number type literal var ResultIsNumber3 = -1; -var ResultIsNumber4 = -{ - x: 1, - y: 2 -}; -var ResultIsNumber5 = -{ - x: 1, - y: function (n) { - return n; - } -}; +var ResultIsNumber4 = -{ x: 1, y: 2 }; +var ResultIsNumber5 = -{ x: 1, y: function (n) { return n; } }; // number type expressions var ResultIsNumber6 = -objA.a; var ResultIsNumber7 = -M.n; diff --git a/tests/baselines/reference/negateOperatorWithStringType.js b/tests/baselines/reference/negateOperatorWithStringType.js index 153a5921094..bdbc4a3d664 100644 --- a/tests/baselines/reference/negateOperatorWithStringType.js +++ b/tests/baselines/reference/negateOperatorWithStringType.js @@ -43,19 +43,12 @@ var ResultIsNumber12 = -STRING.charAt(0); //// [negateOperatorWithStringType.js] // - operator on string type var STRING; -var STRING1 = [ - "", - "abc" -]; -function foo() { - return "abc"; -} +var STRING1 = ["", "abc"]; +function foo() { return "abc"; } var A = (function () { function A() { } - A.foo = function () { - return ""; - }; + A.foo = function () { return ""; }; return A; })(); var M; @@ -68,16 +61,8 @@ var ResultIsNumber1 = -STRING; var ResultIsNumber2 = -STRING1; // string type literal var ResultIsNumber3 = -""; -var ResultIsNumber4 = -{ - x: "", - y: "" -}; -var ResultIsNumber5 = -{ - x: "", - y: function (s) { - return s; - } -}; +var ResultIsNumber4 = -{ x: "", y: "" }; +var ResultIsNumber5 = -{ x: "", y: function (s) { return s; } }; // string type expressions var ResultIsNumber6 = -objA.a; var ResultIsNumber7 = -M.n; diff --git a/tests/baselines/reference/nestedClassDeclaration.errors.txt b/tests/baselines/reference/nestedClassDeclaration.errors.txt index f5c5e41ad99..f897c38d681 100644 --- a/tests/baselines/reference/nestedClassDeclaration.errors.txt +++ b/tests/baselines/reference/nestedClassDeclaration.errors.txt @@ -1,14 +1,12 @@ tests/cases/conformance/classes/nestedClassDeclaration.ts(5,5): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. tests/cases/conformance/classes/nestedClassDeclaration.ts(7,1): error TS1128: Declaration or statement expected. -tests/cases/conformance/classes/nestedClassDeclaration.ts(10,5): error TS1129: Statement expected. -tests/cases/conformance/classes/nestedClassDeclaration.ts(12,1): error TS1128: Declaration or statement expected. tests/cases/conformance/classes/nestedClassDeclaration.ts(15,11): error TS1005: ':' expected. tests/cases/conformance/classes/nestedClassDeclaration.ts(15,11): error TS2304: Cannot find name 'C4'. tests/cases/conformance/classes/nestedClassDeclaration.ts(15,14): error TS1005: ',' expected. tests/cases/conformance/classes/nestedClassDeclaration.ts(17,1): error TS1128: Declaration or statement expected. -==== tests/cases/conformance/classes/nestedClassDeclaration.ts (8 errors) ==== +==== tests/cases/conformance/classes/nestedClassDeclaration.ts (6 errors) ==== // nested classes are not allowed class C { @@ -23,12 +21,8 @@ tests/cases/conformance/classes/nestedClassDeclaration.ts(17,1): error TS1128: D function foo() { class C3 { - ~~~~~ -!!! error TS1129: Statement expected. } } - ~ -!!! error TS1128: Declaration or statement expected. var x = { class C4 { diff --git a/tests/baselines/reference/nestedClassDeclaration.js b/tests/baselines/reference/nestedClassDeclaration.js index c7f0ffe34fc..2fee6f08ab9 100644 --- a/tests/baselines/reference/nestedClassDeclaration.js +++ b/tests/baselines/reference/nestedClassDeclaration.js @@ -31,12 +31,11 @@ var C2 = (function () { return C2; })(); function foo() { + var C3 = (function () { + function C3() { + } + return C3; + })(); } -var C3 = (function () { - function C3() { - } - return C3; -})(); var x = { - class: C4 -}, _a = void 0; + class: C4 }, _a = void 0; diff --git a/tests/baselines/reference/nestedModules.js b/tests/baselines/reference/nestedModules.js index fe3af5ae69c..f146990ec82 100644 --- a/tests/baselines/reference/nestedModules.js +++ b/tests/baselines/reference/nestedModules.js @@ -37,10 +37,7 @@ var A; (function (A) { var B; (function (B) { - var Point = { - x: 0, - y: 0 - }; // bug 832088: could not find module 'C' + var Point = { x: 0, y: 0 }; // bug 832088: could not find module 'C' })(B = A.B || (A.B = {})); })(A || (A = {})); var M2; diff --git a/tests/baselines/reference/nestedRecursiveLambda.js b/tests/baselines/reference/nestedRecursiveLambda.js index eff3da0e216..0273b5691e6 100644 --- a/tests/baselines/reference/nestedRecursiveLambda.js +++ b/tests/baselines/reference/nestedRecursiveLambda.js @@ -8,26 +8,8 @@ void(r =>(r => r)); //// [nestedRecursiveLambda.js] function f(a) { - void (function (r) { - return (function (r) { - return r; - }); - }); + void (function (r) { return (function (r) { return r; }); }); } -f((function (r) { - return (function (r) { - return r; - }); -})); -void (function (r) { - return (function (r) { - return r; - }); -}); -[ - (function (r) { - return (function (r) { - return r; - }); - }) -]; +f((function (r) { return (function (r) { return r; }); })); +void (function (r) { return (function (r) { return r; }); }); +[(function (r) { return (function (r) { return r; }); })]; diff --git a/tests/baselines/reference/nestedSelf.js b/tests/baselines/reference/nestedSelf.js index b61a0956676..9c0feaa887f 100644 --- a/tests/baselines/reference/nestedSelf.js +++ b/tests/baselines/reference/nestedSelf.js @@ -17,13 +17,7 @@ var M; } C.prototype.foo = function () { var _this = this; - [ - 1, - 2, - 3 - ].map(function (x) { - return _this.n * x; - }); + [1, 2, 3].map(function (x) { return _this.n * x; }); }; return C; })(); diff --git a/tests/baselines/reference/newExpressionWithCast.js b/tests/baselines/reference/newExpressionWithCast.js index 6ce025a4267..8743d9b83bc 100644 --- a/tests/baselines/reference/newExpressionWithCast.js +++ b/tests/baselines/reference/newExpressionWithCast.js @@ -15,15 +15,12 @@ var test3 = new (Test3)(); //// [newExpressionWithCast.js] -function Test() { -} +function Test() { } // valid but error with noImplicitAny var test = new Test(); -function Test2() { -} +function Test2() { } // parse error var test2 = new < any > Test2(); -function Test3() { -} +function Test3() { } // valid with noImplicitAny var test3 = new Test3(); diff --git a/tests/baselines/reference/newFunctionImplicitAny.js b/tests/baselines/reference/newFunctionImplicitAny.js index 9f8d303680b..459c7d581d8 100644 --- a/tests/baselines/reference/newFunctionImplicitAny.js +++ b/tests/baselines/reference/newFunctionImplicitAny.js @@ -6,6 +6,5 @@ var test = new Test(); //// [newFunctionImplicitAny.js] // No implicit any error given when newing a function (up for debate) -function Test() { -} +function Test() { } var test = new Test(); diff --git a/tests/baselines/reference/newOperatorConformance.js b/tests/baselines/reference/newOperatorConformance.js index 4e5c209bbff..a04b10dc8fe 100644 --- a/tests/baselines/reference/newOperatorConformance.js +++ b/tests/baselines/reference/newOperatorConformance.js @@ -104,8 +104,7 @@ function newFn2(s) { var p; } // Construct expression of void returning function -function fnVoid() { -} +function fnVoid() { } var t = new fnVoid(); var t; // Chained new expressions diff --git a/tests/baselines/reference/newOperatorErrorCases.js b/tests/baselines/reference/newOperatorErrorCases.js index 8a44d51fb5c..b893beba02a 100644 --- a/tests/baselines/reference/newOperatorErrorCases.js +++ b/tests/baselines/reference/newOperatorErrorCases.js @@ -65,7 +65,5 @@ var c1 = new T; var c1; var c2 = new T(); // Parse error // Construct expression of non-void returning function -function fnNumber() { - return 32; -} +function fnNumber() { return 32; } var s = new fnNumber(); // Error diff --git a/tests/baselines/reference/noCollisionThisExpressionAndClassInGlobal.js b/tests/baselines/reference/noCollisionThisExpressionAndClassInGlobal.js index 4ddb34b094c..8a485a2ebe2 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndClassInGlobal.js +++ b/tests/baselines/reference/noCollisionThisExpressionAndClassInGlobal.js @@ -9,6 +9,4 @@ var _this = (function () { } return _this; })(); -var f = function () { - return _this; -}; +var f = function () { return _this; }; diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInAccessors.js b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInAccessors.js index 4e746582364..727b1b6087a 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInAccessors.js +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInAccessors.js @@ -50,23 +50,19 @@ var class1 = (function () { Object.defineProperty(class1.prototype, "a", { get: function () { var x2 = { - doStuff: function (callback) { - return function () { - var _this = 2; - return callback(_this); - }; - } + doStuff: function (callback) { return function () { + var _this = 2; + return callback(_this); + }; } }; return 10; }, set: function (val) { var x2 = { - doStuff: function (callback) { - return function () { - var _this = 2; - return callback(_this); - }; - } + doStuff: function (callback) { return function () { + var _this = 2; + return callback(_this); + }; } }; }, enumerable: true, @@ -81,22 +77,18 @@ var class2 = (function () { get: function () { var _this = 2; var x2 = { - doStuff: function (callback) { - return function () { - return callback(_this); - }; - } + doStuff: function (callback) { return function () { + return callback(_this); + }; } }; return 10; }, set: function (val) { var _this = 2; var x2 = { - doStuff: function (callback) { - return function () { - return callback(_this); - }; - } + doStuff: function (callback) { return function () { + return callback(_this); + }; } }; }, enumerable: true, diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.js b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.js index ce86ca47301..a01996848b1 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.js +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.js @@ -25,12 +25,10 @@ class class2 { var class1 = (function () { function class1() { var x2 = { - doStuff: function (callback) { - return function () { - var _this = 2; - return callback(_this); - }; - } + doStuff: function (callback) { return function () { + var _this = 2; + return callback(_this); + }; } }; } return class1; @@ -39,11 +37,9 @@ var class2 = (function () { function class2() { var _this = 2; var x2 = { - doStuff: function (callback) { - return function () { - return callback(_this); - }; - } + doStuff: function (callback) { return function () { + return callback(_this); + }; } }; } return class2; diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.js b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.js index d144a78fae3..bdb55633682 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.js +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.js @@ -11,7 +11,5 @@ function x() { var console; function x() { var _this = 5; - (function (x) { - console.log(_this); - }); + (function (x) { console.log(_this); }); } diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.js b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.js index 487751bd493..83f21d10425 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.js +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.js @@ -10,13 +10,9 @@ alert(x.doStuff(x => alert(x))); //// [noCollisionThisExpressionAndLocalVarInLambda.js] var x = { - doStuff: function (callback) { - return function () { - var _this = 2; - return callback(_this); - }; - } + doStuff: function (callback) { return function () { + var _this = 2; + return callback(_this); + }; } }; -alert(x.doStuff(function (x) { - return alert(x); -})); +alert(x.doStuff(function (x) { return alert(x); })); diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.js b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.js index f91039b6c61..b7e9cc7561f 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.js +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.js @@ -26,22 +26,18 @@ var a = (function () { } a.prototype.method1 = function () { return { - doStuff: function (callback) { - return function () { - var _this = 2; - return callback(_this); - }; - } + doStuff: function (callback) { return function () { + var _this = 2; + return callback(_this); + }; } }; }; a.prototype.method2 = function () { var _this = 2; return { - doStuff: function (callback) { - return function () { - return callback(_this); - }; - } + doStuff: function (callback) { return function () { + return callback(_this); + }; } }; }; return a; diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.js b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.js index 374a812ba4b..da989bed263 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.js +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.js @@ -23,12 +23,10 @@ class class2 { var class1 = (function () { function class1() { this.prop1 = { - doStuff: function (callback) { - return function () { - var _this = 2; - return callback(_this); - }; - } + doStuff: function (callback) { return function () { + var _this = 2; + return callback(_this); + }; } }; } return class1; @@ -36,11 +34,9 @@ var class1 = (function () { var class2 = (function () { function class2() { this.prop1 = { - doStuff: function (callback) { - return function () { - return callback(10); - }; - } + doStuff: function (callback) { return function () { + return callback(10); + }; } }; var _this = 2; } diff --git a/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.js b/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.js index c0377976e9b..bea476ed09f 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.js +++ b/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.js @@ -4,6 +4,4 @@ var f = () => _this; //// [noCollisionThisExpressionAndVarInGlobal.js] var _this = 1; -var f = function () { - return _this; -}; +var f = function () { return _this; }; diff --git a/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.js b/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.js index c34ad4c97bd..b3677681822 100644 --- a/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.js +++ b/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.js @@ -12,7 +12,5 @@ var console; var _this = 5; function x() { var _this = this; - (function (x) { - console.log(_this); - }); + (function (x) { console.log(_this); }); } diff --git a/tests/baselines/reference/noConstraintInReturnType1.js b/tests/baselines/reference/noConstraintInReturnType1.js index 747cbfdf758..0402f9d83cb 100644 --- a/tests/baselines/reference/noConstraintInReturnType1.js +++ b/tests/baselines/reference/noConstraintInReturnType1.js @@ -8,9 +8,7 @@ class List { var List = (function () { function List() { } - List.empty = function () { - return null; - }; + List.empty = function () { return null; }; return List; })(); diff --git a/tests/baselines/reference/noImplicitAnyForIn.js b/tests/baselines/reference/noImplicitAnyForIn.js index 067a553e2dd..c8743936a9a 100644 --- a/tests/baselines/reference/noImplicitAnyForIn.js +++ b/tests/baselines/reference/noImplicitAnyForIn.js @@ -32,16 +32,7 @@ var n = [[]] || []; for (n[idx++] in m); //// [noImplicitAnyForIn.js] -var x = [ - [ - 1, - 2, - 3 - ], - [ - "hello" - ] -]; +var x = [[1, 2, 3], ["hello"]]; for (var i in x) { for (var j in x[i]) { //Should yield an implicit 'any' error @@ -59,16 +50,8 @@ for (var a in x) { var c = a || b; } var idx = 0; -var m = [ - 1, - 2, - 3, - 4, - 5 -]; +var m = [1, 2, 3, 4, 5]; // Should yield an implicit 'any' error. -var n = [ - [] -] || []; +var n = [[]] || []; for (n[idx++] in m) ; diff --git a/tests/baselines/reference/noImplicitAnyForMethodParameters.js b/tests/baselines/reference/noImplicitAnyForMethodParameters.js index 379cf85b5e2..fc5b94d4768 100644 --- a/tests/baselines/reference/noImplicitAnyForMethodParameters.js +++ b/tests/baselines/reference/noImplicitAnyForMethodParameters.js @@ -18,14 +18,12 @@ class D { var C = (function () { function C() { } - C.prototype.foo = function (a) { - }; // OK - non-ambient class and private method - error + C.prototype.foo = function (a) { }; // OK - non-ambient class and private method - error return C; })(); var D = (function () { function D() { } - D.prototype.foo = function (a) { - }; // OK - non-ambient class and public method - error + D.prototype.foo = function (a) { }; // OK - non-ambient class and public method - error return D; })(); diff --git a/tests/baselines/reference/noImplicitAnyInCastExpression.js b/tests/baselines/reference/noImplicitAnyInCastExpression.js index 4e23b91527b..1b7cc59c7c0 100644 --- a/tests/baselines/reference/noImplicitAnyInCastExpression.js +++ b/tests/baselines/reference/noImplicitAnyInCastExpression.js @@ -19,15 +19,8 @@ interface IFoo { //// [noImplicitAnyInCastExpression.js] // verify no noImplictAny errors reported with cast expression // Expr type not assignable to target type -{ - a: null -}; +{ a: null }; // Expr type assignable to target type -{ - a: 2, - b: undefined -}; +{ a: 2, b: undefined }; // Neither types is assignable to each other -{ - c: null -}; +{ c: null }; diff --git a/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.js b/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.js index f14810c8013..7722165fd23 100644 --- a/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.js +++ b/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.js @@ -5,10 +5,5 @@ regexMatchList.forEach(match => ''.replace(match, '')); //// [noImplicitAnyInContextuallyTypesFunctionParamter.js] -var regexMatchList = [ - '', - '' -]; -regexMatchList.forEach(function (match) { - return ''.replace(match, ''); -}); +var regexMatchList = ['', '']; +regexMatchList.forEach(function (match) { return ''.replace(match, ''); }); diff --git a/tests/baselines/reference/noImplicitAnyParametersInBareFunctions.js b/tests/baselines/reference/noImplicitAnyParametersInBareFunctions.js index 6be61702143..8efe32d3140 100644 --- a/tests/baselines/reference/noImplicitAnyParametersInBareFunctions.js +++ b/tests/baselines/reference/noImplicitAnyParametersInBareFunctions.js @@ -46,20 +46,15 @@ var f14 = (x, ...r) => ""; //// [noImplicitAnyParametersInBareFunctions.js] // No implicit-'any' errors. -function f1() { -} +function f1() { } // Implicit-'any' error for x. -function f2(x) { -} +function f2(x) { } // No implicit-'any' errors. -function f3(x) { -} +function f3(x) { } // Implicit-'any' errors for x, y, and z. -function f4(x, y, z) { -} +function f4(x, y, z) { } // Implicit-'any' errors for x, and z. -function f5(x, y, z) { -} +function f5(x, y, z) { } // Implicit-'any[]' error for r. function f6() { var r = []; @@ -74,24 +69,15 @@ function f7(x) { r[_i - 1] = arguments[_i]; } } -function f8(x3, y3) { -} +function f8(x3, y3) { } // No implicit-'any' errors. -var f9 = function () { - return ""; -}; +var f9 = function () { return ""; }; // Implicit-'any' errors for x. -var f10 = function (x) { - return ""; -}; +var f10 = function (x) { return ""; }; // Implicit-'any' errors for x, y, and z. -var f11 = function (x, y, z) { - return ""; -}; +var f11 = function (x, y, z) { return ""; }; // Implicit-'any' errors for x and z. -var f12 = function (x, y, z) { - return ""; -}; +var f12 = function (x, y, z) { return ""; }; // Implicit-'any[]' error for r. var f13 = function () { var r = []; diff --git a/tests/baselines/reference/noImplicitAnyParametersInClass.js b/tests/baselines/reference/noImplicitAnyParametersInClass.js index 1460d07b729..0873935b600 100644 --- a/tests/baselines/reference/noImplicitAnyParametersInClass.js +++ b/tests/baselines/reference/noImplicitAnyParametersInClass.js @@ -96,21 +96,13 @@ class C { var C = (function () { function C() { // No implicit-'any' errors. - this.pub_f9 = function () { - return ""; - }; + this.pub_f9 = function () { return ""; }; // Implicit-'any' errors for x. - this.pub_f10 = function (x) { - return ""; - }; + this.pub_f10 = function (x) { return ""; }; // Implicit-'any' errors for x, y, and z. - this.pub_f11 = function (x, y, z) { - return ""; - }; + this.pub_f11 = function (x, y, z) { return ""; }; // Implicit-'any' errors for x and z. - this.pub_f12 = function (x, y, z) { - return ""; - }; + this.pub_f12 = function (x, y, z) { return ""; }; // Implicit-'any[]' error for r. this.pub_f13 = function () { var r = []; @@ -128,21 +120,13 @@ var C = (function () { return ""; }; // No implicit-'any' errors. - this.priv_f9 = function () { - return ""; - }; + this.priv_f9 = function () { return ""; }; // Implicit-'any' errors for x. - this.priv_f10 = function (x) { - return ""; - }; + this.priv_f10 = function (x) { return ""; }; // Implicit-'any' errors for x, y, and z. - this.priv_f11 = function (x, y, z) { - return ""; - }; + this.priv_f11 = function (x, y, z) { return ""; }; // Implicit-'any' errors for x and z. - this.priv_f12 = function (x, y, z) { - return ""; - }; + this.priv_f12 = function (x, y, z) { return ""; }; // Implicit-'any[]' error for r. this.priv_f13 = function () { var r = []; @@ -161,20 +145,15 @@ var C = (function () { }; } // No implicit-'any' errors. - C.prototype.pub_f1 = function () { - }; + C.prototype.pub_f1 = function () { }; // Implicit-'any' errors for x. - C.prototype.pub_f2 = function (x) { - }; + C.prototype.pub_f2 = function (x) { }; // No implicit-'any' errors. - C.prototype.pub_f3 = function (x) { - }; + C.prototype.pub_f3 = function (x) { }; // Implicit-'any' errors for x, y, and z. - C.prototype.pub_f4 = function (x, y, z) { - }; + C.prototype.pub_f4 = function (x, y, z) { }; // Implicit-'any' errors for x, and z. - C.prototype.pub_f5 = function (x, y, z) { - }; + C.prototype.pub_f5 = function (x, y, z) { }; // Implicit-'any[]' errors for r. C.prototype.pub_f6 = function () { var r = []; @@ -189,24 +168,18 @@ var C = (function () { r[_i - 1] = arguments[_i]; } }; - C.prototype.pub_f8 = function (x3, y3) { - }; + C.prototype.pub_f8 = function (x3, y3) { }; /////////////////////////////////////////// // No implicit-'any' errors. - C.prototype.priv_f1 = function () { - }; + C.prototype.priv_f1 = function () { }; // Implicit-'any' errors for x. - C.prototype.priv_f2 = function (x) { - }; + C.prototype.priv_f2 = function (x) { }; // No implicit-'any' errors. - C.prototype.priv_f3 = function (x) { - }; + C.prototype.priv_f3 = function (x) { }; // Implicit-'any' errors for x, y, and z. - C.prototype.priv_f4 = function (x, y, z) { - }; + C.prototype.priv_f4 = function (x, y, z) { }; // Implicit-'any' errors for x, and z. - C.prototype.priv_f5 = function (x, y, z) { - }; + C.prototype.priv_f5 = function (x, y, z) { }; // Implicit-'any[]' errors for r. C.prototype.priv_f6 = function () { var r = []; @@ -221,7 +194,6 @@ var C = (function () { r[_i - 1] = arguments[_i]; } }; - C.prototype.priv_f8 = function (x3, y3) { - }; + C.prototype.priv_f8 = function (x3, y3) { }; return C; })(); diff --git a/tests/baselines/reference/noImplicitAnyParametersInModule.js b/tests/baselines/reference/noImplicitAnyParametersInModule.js index d89c4229c7b..e7f30205559 100644 --- a/tests/baselines/reference/noImplicitAnyParametersInModule.js +++ b/tests/baselines/reference/noImplicitAnyParametersInModule.js @@ -50,20 +50,15 @@ module M { var M; (function (M) { // No implicit-'any' errors. - function m_f1() { - } + function m_f1() { } // Implicit-'any' error for x. - function m_f2(x) { - } + function m_f2(x) { } // No implicit-'any' errors. - function m_f3(x) { - } + function m_f3(x) { } // Implicit-'any' errors for x, y, and z. - function m_f4(x, y, z) { - } + function m_f4(x, y, z) { } // Implicit-'any' errors for x and z. - function m_f5(x, y, z) { - } + function m_f5(x, y, z) { } // Implicit-'any[]' error for r. function m_f6() { var r = []; @@ -78,24 +73,15 @@ var M; r[_i - 1] = arguments[_i]; } } - function m_f8(x3, y3) { - } + function m_f8(x3, y3) { } // No implicit-'any' errors. - var m_f9 = function () { - return ""; - }; + var m_f9 = function () { return ""; }; // Implicit-'any' error for x. - var m_f10 = function (x) { - return ""; - }; + var m_f10 = function (x) { return ""; }; // Implicit-'any' errors for x, y, and z. - var m_f11 = function (x, y, z) { - return ""; - }; + var m_f11 = function (x, y, z) { return ""; }; // Implicit-'any' errors for x and z. - var m_f12 = function (x, y, z) { - return ""; - }; + var m_f12 = function (x, y, z) { return ""; }; // Implicit-'any[]' errors for r. var m_f13 = function () { var r = []; diff --git a/tests/baselines/reference/noImplicitAnyWithOverloads.js b/tests/baselines/reference/noImplicitAnyWithOverloads.js index 3bce6e18ba3..fd56b6e0d73 100644 --- a/tests/baselines/reference/noImplicitAnyWithOverloads.js +++ b/tests/baselines/reference/noImplicitAnyWithOverloads.js @@ -10,8 +10,5 @@ function callb(a) { } callb((a) => { a.foo; }); // error, chose first overload //// [noImplicitAnyWithOverloads.js] -function callb(a) { -} -callb(function (a) { - a.foo; -}); // error, chose first overload +function callb(a) { } +callb(function (a) { a.foo; }); // error, chose first overload diff --git a/tests/baselines/reference/noSelfOnVars.js b/tests/baselines/reference/noSelfOnVars.js index 2e1f5080c26..913e3a23ba2 100644 --- a/tests/baselines/reference/noSelfOnVars.js +++ b/tests/baselines/reference/noSelfOnVars.js @@ -9,7 +9,6 @@ function foo() { //// [noSelfOnVars.js] function foo() { - function bar() { - } + function bar() { } var x = bar; } diff --git a/tests/baselines/reference/nonInstantiatedModule.js b/tests/baselines/reference/nonInstantiatedModule.js index ff7ea10358b..fc3ad19546f 100644 --- a/tests/baselines/reference/nonInstantiatedModule.js +++ b/tests/baselines/reference/nonInstantiatedModule.js @@ -62,10 +62,7 @@ var M2; var Point; (function (Point) { function Origin() { - return { - x: 0, - y: 0 - }; + return { x: 0, y: 0 }; } Point.Origin = Origin; })(Point = M2.Point || (M2.Point = {})); diff --git a/tests/baselines/reference/null.js b/tests/baselines/reference/null.js index c82cb3ab432..499d6901847 100644 --- a/tests/baselines/reference/null.js +++ b/tests/baselines/reference/null.js @@ -38,7 +38,4 @@ function g() { return null; return 3; } -var w = { - x: null, - y: 3 -}; +var w = { x: null, y: 3 }; diff --git a/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.js b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.js index b47a591444c..646a3474536 100644 --- a/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.js +++ b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.js @@ -108,22 +108,12 @@ var r4 = true ? new Date() : null; var r4 = true ? null : new Date(); var r5 = true ? /1/ : null; var r5 = true ? null : /1/; -var r6 = true ? { - foo: 1 -} : null; -var r6 = true ? null : { - foo: 1 -}; -var r7 = true ? function () { -} : null; -var r7 = true ? null : function () { -}; -var r8 = true ? function (x) { - return x; -} : null; -var r8b = true ? null : function (x) { - return x; -}; // type parameters not identical across declarations +var r6 = true ? { foo: 1 } : null; +var r6 = true ? null : { foo: 1 }; +var r7 = true ? function () { } : null; +var r7 = true ? null : function () { }; +var r8 = true ? function (x) { return x; } : null; +var r8b = true ? null : function (x) { return x; }; // type parameters not identical across declarations var i1; var r9 = true ? i1 : null; var r9 = true ? null : i1; @@ -151,8 +141,7 @@ var r13 = true ? E : null; var r13 = true ? null : E; var r14 = true ? E.A : null; var r14 = true ? null : E.A; -function f() { -} +function f() { } var f; (function (f) { f.bar = 1; diff --git a/tests/baselines/reference/numberAsInLHS.js b/tests/baselines/reference/numberAsInLHS.js index bcc1bcf7b84..d2fee353ab4 100644 --- a/tests/baselines/reference/numberAsInLHS.js +++ b/tests/baselines/reference/numberAsInLHS.js @@ -2,7 +2,4 @@ 3 in [0, 1] //// [numberAsInLHS.js] -3 in [ - 0, - 1 -]; +3 in [0, 1]; diff --git a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.js b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.js index 339f674b9da..cf08bb98217 100644 --- a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.js +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.js @@ -106,8 +106,7 @@ var C = (function () { get: function () { return ''; }, - set: function (v) { - } // ok + set: function (v) { } // ok , enumerable: true, configurable: true @@ -115,8 +114,7 @@ var C = (function () { C.prototype.foo = function () { return ''; }; - C.foo = function () { - }; // ok + C.foo = function () { }; // ok Object.defineProperty(C, "X", { get: function () { return 1; @@ -131,8 +129,7 @@ var a; var b = { a: '', b: 1, - c: function () { - }, + c: function () { }, "d": '', "e": 1, 1.0: '', @@ -143,8 +140,7 @@ var b = { get X() { return ''; }, - set X(v) { - }, + set X(v) { }, foo: function () { return ''; } diff --git a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js index 1cfd94a0c97..0474abef393 100644 --- a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js @@ -56,9 +56,7 @@ var __extends = this.__extends || function (d, b) { var A = (function () { function A() { } - A.prototype.foo = function () { - return ''; - }; + A.prototype.foo = function () { return ''; }; return A; })(); var B = (function (_super) { @@ -66,9 +64,7 @@ var B = (function (_super) { function B() { _super.apply(this, arguments); } - B.prototype.bar = function () { - return ''; - }; + B.prototype.bar = function () { return ''; }; return B; })(A); var Foo = (function () { diff --git a/tests/baselines/reference/numericIndexerConstraint1.js b/tests/baselines/reference/numericIndexerConstraint1.js index 9587863a035..ed51e3af066 100644 --- a/tests/baselines/reference/numericIndexerConstraint1.js +++ b/tests/baselines/reference/numericIndexerConstraint1.js @@ -8,8 +8,7 @@ var result: Foo = x["one"]; // error var Foo = (function () { function Foo() { } - Foo.prototype.foo = function () { - }; + Foo.prototype.foo = function () { }; return Foo; })(); var x; diff --git a/tests/baselines/reference/numericIndexerConstraint2.js b/tests/baselines/reference/numericIndexerConstraint2.js index edc9df36a13..4d8ce742e73 100644 --- a/tests/baselines/reference/numericIndexerConstraint2.js +++ b/tests/baselines/reference/numericIndexerConstraint2.js @@ -8,8 +8,7 @@ x = a; var Foo = (function () { function Foo() { } - Foo.prototype.foo = function () { - }; + Foo.prototype.foo = function () { }; return Foo; })(); var x; diff --git a/tests/baselines/reference/numericIndexerConstraint4.js b/tests/baselines/reference/numericIndexerConstraint4.js index cbbf6b68c4e..531c450e7e1 100644 --- a/tests/baselines/reference/numericIndexerConstraint4.js +++ b/tests/baselines/reference/numericIndexerConstraint4.js @@ -30,6 +30,4 @@ var B = (function (_super) { } return B; })(A); -var x = { - data: new B() -}; +var x = { data: new B() }; diff --git a/tests/baselines/reference/numericIndexerConstraint5.js b/tests/baselines/reference/numericIndexerConstraint5.js index b0684454394..3ad19f75d0b 100644 --- a/tests/baselines/reference/numericIndexerConstraint5.js +++ b/tests/baselines/reference/numericIndexerConstraint5.js @@ -3,8 +3,5 @@ var x = { name: "x", 0: new Date() }; var z: { [name: number]: string } = x; //// [numericIndexerConstraint5.js] -var x = { - name: "x", - 0: new Date() -}; +var x = { name: "x", 0: new Date() }; var z = x; diff --git a/tests/baselines/reference/numericIndexingResults.js b/tests/baselines/reference/numericIndexingResults.js index 043bf3265e9..70c6e15d15a 100644 --- a/tests/baselines/reference/numericIndexingResults.js +++ b/tests/baselines/reference/numericIndexingResults.js @@ -85,20 +85,14 @@ var r3 = a['3']; var r4 = a[1]; var r5 = a[2]; var r6 = a[3]; -var b = { - 1: '', - "2": '' -}; +var b = { 1: '', "2": '' }; var r1a = b['1']; var r2a = b['2']; var r3 = b['3']; var r4 = b[1]; var r5 = b[2]; var r6 = b[3]; -var b2 = { - 1: '', - "2": '' -}; +var b2 = { 1: '', "2": '' }; var r1b = b2['1']; var r2b = b2['2']; var r3 = b2['3']; diff --git a/tests/baselines/reference/objectLitIndexerContextualType.js b/tests/baselines/reference/objectLitIndexerContextualType.js index a6124814cff..f0cf90724b3 100644 --- a/tests/baselines/reference/objectLitIndexerContextualType.js +++ b/tests/baselines/reference/objectLitIndexerContextualType.js @@ -26,22 +26,14 @@ y = { var x; var y; x = { - s: function (t) { - return t * t; - } + s: function (t) { return t * t; } }; x = { - 0: function (t) { - return t * t; - } + 0: function (t) { return t * t; } }; y = { - s: function (t) { - return t * t; - } + s: function (t) { return t * t; } }; y = { - 0: function (t) { - return t * t; - } + 0: function (t) { return t * t; } }; diff --git a/tests/baselines/reference/objectLitStructuralTypeMismatch.js b/tests/baselines/reference/objectLitStructuralTypeMismatch.js index c24f742f082..380b8a2aacf 100644 --- a/tests/baselines/reference/objectLitStructuralTypeMismatch.js +++ b/tests/baselines/reference/objectLitStructuralTypeMismatch.js @@ -4,6 +4,4 @@ var x: { a: number; } = { b: 5 }; //// [objectLitStructuralTypeMismatch.js] // Shouldn't compile -var x = { - b: 5 -}; +var x = { b: 5 }; diff --git a/tests/baselines/reference/objectLitTargetTypeCallSite.js b/tests/baselines/reference/objectLitTargetTypeCallSite.js index 76cd4c660dc..999b889e415 100644 --- a/tests/baselines/reference/objectLitTargetTypeCallSite.js +++ b/tests/baselines/reference/objectLitTargetTypeCallSite.js @@ -9,7 +9,4 @@ process({a:true,b:"y"}); function process(x) { return x.a; } -process({ - a: true, - b: "y" -}); +process({ a: true, b: "y" }); diff --git a/tests/baselines/reference/objectLiteral1.js b/tests/baselines/reference/objectLiteral1.js index 7d625c8e815..ebeabd011b5 100644 --- a/tests/baselines/reference/objectLiteral1.js +++ b/tests/baselines/reference/objectLiteral1.js @@ -2,7 +2,4 @@ var v30 = {a:1, b:2}; //// [objectLiteral1.js] -var v30 = { - a: 1, - b: 2 -}; +var v30 = { a: 1, b: 2 }; diff --git a/tests/baselines/reference/objectLiteral2.js b/tests/baselines/reference/objectLiteral2.js index b517d99b05d..189e495c5f5 100644 --- a/tests/baselines/reference/objectLiteral2.js +++ b/tests/baselines/reference/objectLiteral2.js @@ -2,7 +2,4 @@ var v30 = {a:1, b:2}, v31; //// [objectLiteral2.js] -var v30 = { - a: 1, - b: 2 -}, v31; +var v30 = { a: 1, b: 2 }, v31; diff --git a/tests/baselines/reference/objectLiteralArraySpecialization.js b/tests/baselines/reference/objectLiteralArraySpecialization.js index 9f704adba0e..0a48a3dccdd 100644 --- a/tests/baselines/reference/objectLiteralArraySpecialization.js +++ b/tests/baselines/reference/objectLiteralArraySpecialization.js @@ -9,16 +9,5 @@ thing.doSomething((x, y) => x.name === "bob"); // should not error //// [objectLiteralArraySpecialization.js] -var thing = create([ - { - name: "bob", - id: 24 - }, - { - name: "doug", - id: 32 - } -]); // should not error -thing.doSomething(function (x, y) { - return x.name === "bob"; -}); // should not error +var thing = create([{ name: "bob", id: 24 }, { name: "doug", id: 32 }]); // should not error +thing.doSomething(function (x, y) { return x.name === "bob"; }); // should not error diff --git a/tests/baselines/reference/objectLiteralContextualTyping.js b/tests/baselines/reference/objectLiteralContextualTyping.js index c61452c2057..48686042754 100644 --- a/tests/baselines/reference/objectLiteralContextualTyping.js +++ b/tests/baselines/reference/objectLiteralContextualTyping.js @@ -29,23 +29,13 @@ var b: {}; //// [objectLiteralContextualTyping.js] // Tests related to #1774 -var x = foo({ - name: "Sprocket" -}); +var x = foo({ name: "Sprocket" }); var x; -var y = foo({ - name: "Sprocket", - description: "Bumpy wheel" -}); +var y = foo({ name: "Sprocket", description: "Bumpy wheel" }); var y; -var z = foo({ - name: "Sprocket", - description: false -}); +var z = foo({ name: "Sprocket", description: false }); var z; -var w = foo({ - a: 10 -}); +var w = foo({ a: 10 }); var w; var b = bar({}); var b; diff --git a/tests/baselines/reference/objectLiteralErrors.js b/tests/baselines/reference/objectLiteralErrors.js index ac1ab2ec10e..4dccc78b67d 100644 --- a/tests/baselines/reference/objectLiteralErrors.js +++ b/tests/baselines/reference/objectLiteralErrors.js @@ -48,210 +48,44 @@ var g3 = { get a(): number { return undefined; }, set a(n: string) { } }; //// [objectLiteralErrors.js] // Multiple properties with the same name -var e1 = { - a: 0, - a: 0 -}; -var e2 = { - a: '', - a: '' -}; -var e3 = { - a: 0, - a: '' -}; -var e4 = { - a: true, - a: false -}; -var e5 = { - a: {}, - a: {} -}; -var e6 = { - a: 0, - 'a': 0 -}; -var e7 = { - 'a': 0, - a: 0 -}; -var e8 = { - 'a': 0, - "a": 0 -}; -var e9 = { - 'a': 0, - 'a': 0 -}; -var e10 = { - "a": 0, - 'a': 0 -}; -var e11 = { - 1.0: 0, - '1': 0 -}; -var e12 = { - 0: 0, - 0: 0 -}; -var e13 = { - 0: 0, - 0: 0 -}; -var e14 = { - 0: 0, - 0x0: 0 -}; -var e14 = { - 0: 0, - 000: 0 -}; -var e15 = { - "100": 0, - 1e2: 0 -}; -var e16 = { - 0x20: 0, - 3.2e1: 0 -}; -var e17 = { - a: 0, - b: 1, - a: 0 -}; +var e1 = { a: 0, a: 0 }; +var e2 = { a: '', a: '' }; +var e3 = { a: 0, a: '' }; +var e4 = { a: true, a: false }; +var e5 = { a: {}, a: {} }; +var e6 = { a: 0, 'a': 0 }; +var e7 = { 'a': 0, a: 0 }; +var e8 = { 'a': 0, "a": 0 }; +var e9 = { 'a': 0, 'a': 0 }; +var e10 = { "a": 0, 'a': 0 }; +var e11 = { 1.0: 0, '1': 0 }; +var e12 = { 0: 0, 0: 0 }; +var e13 = { 0: 0, 0: 0 }; +var e14 = { 0: 0, 0x0: 0 }; +var e14 = { 0: 0, 000: 0 }; +var e15 = { "100": 0, 1e2: 0 }; +var e16 = { 0x20: 0, 3.2e1: 0 }; +var e17 = { a: 0, b: 1, a: 0 }; // Accessor and property with the same name -var f1 = { - a: 0, - get a() { - return 0; - } -}; -var f2 = { - a: '', - get a() { - return ''; - } -}; -var f3 = { - a: 0, - get a() { - return ''; - } -}; -var f4 = { - a: true, - get a() { - return false; - } -}; -var f5 = { - a: {}, - get a() { - return {}; - } -}; -var f6 = { - a: 0, - get 'a'() { - return 0; - } -}; -var f7 = { - 'a': 0, - get a() { - return 0; - } -}; -var f8 = { - 'a': 0, - get "a"() { - return 0; - } -}; -var f9 = { - 'a': 0, - get 'a'() { - return 0; - } -}; -var f10 = { - "a": 0, - get 'a'() { - return 0; - } -}; -var f11 = { - 1.0: 0, - get '1'() { - return 0; - } -}; -var f12 = { - 0: 0, - get 0() { - return 0; - } -}; -var f13 = { - 0: 0, - get 0() { - return 0; - } -}; -var f14 = { - 0: 0, - get 0x0() { - return 0; - } -}; -var f14 = { - 0: 0, - get 000() { - return 0; - } -}; -var f15 = { - "100": 0, - get 1e2() { - return 0; - } -}; -var f16 = { - 0x20: 0, - get 3.2e1() { - return 0; - } -}; -var f17 = { - a: 0, - get b() { - return 1; - }, - get a() { - return 0; - } -}; +var f1 = { a: 0, get a() { return 0; } }; +var f2 = { a: '', get a() { return ''; } }; +var f3 = { a: 0, get a() { return ''; } }; +var f4 = { a: true, get a() { return false; } }; +var f5 = { a: {}, get a() { return {}; } }; +var f6 = { a: 0, get 'a'() { return 0; } }; +var f7 = { 'a': 0, get a() { return 0; } }; +var f8 = { 'a': 0, get "a"() { return 0; } }; +var f9 = { 'a': 0, get 'a'() { return 0; } }; +var f10 = { "a": 0, get 'a'() { return 0; } }; +var f11 = { 1.0: 0, get '1'() { return 0; } }; +var f12 = { 0: 0, get 0() { return 0; } }; +var f13 = { 0: 0, get 0() { return 0; } }; +var f14 = { 0: 0, get 0x0() { return 0; } }; +var f14 = { 0: 0, get 000() { return 0; } }; +var f15 = { "100": 0, get 1e2() { return 0; } }; +var f16 = { 0x20: 0, get 3.2e1() { return 0; } }; +var f17 = { a: 0, get b() { return 1; }, get a() { return 0; } }; // Get and set accessor with mismatched type annotations -var g1 = { - get a() { - return 4; - }, - set a(n) { - } -}; -var g2 = { - get a() { - return 4; - }, - set a(n) { - } -}; -var g3 = { - get a() { - return undefined; - }, - set a(n) { - } -}; +var g1 = { get a() { return 4; }, set a(n) { } }; +var g2 = { get a() { return 4; }, set a(n) { } }; +var g3 = { get a() { return undefined; }, set a(n) { } }; diff --git a/tests/baselines/reference/objectLiteralErrorsES3.js b/tests/baselines/reference/objectLiteralErrorsES3.js index f2910c37c3e..031a68fd109 100644 --- a/tests/baselines/reference/objectLiteralErrorsES3.js +++ b/tests/baselines/reference/objectLiteralErrorsES3.js @@ -7,19 +7,6 @@ var e3 = { get a() { return ''; }, set a(n) { } }; //// [objectLiteralErrorsES3.js] -var e1 = { - get a() { - return 4; - } -}; -var e2 = { - set a(n) { - } -}; -var e3 = { - get a() { - return ''; - }, - set a(n) { - } -}; +var e1 = { get a() { return 4; } }; +var e2 = { set a(n) { } }; +var e3 = { get a() { return ''; }, set a(n) { } }; diff --git a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.js b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.js index b0f18da34df..7f9bdc5c54a 100644 --- a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.js +++ b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.js @@ -14,31 +14,10 @@ f2({ toString: (s: string) => s }) // error, missing property value from ArgsStr f2({ value: '', toString: (s) => s.uhhh }) // error //// [objectLiteralFunctionArgContextualTyping.js] -function f2(args) { -} -f2({ - hello: 1 -}); // error -f2({ - value: '' -}); // missing toString satisfied by Object's member -f2({ - value: '', - what: 1 -}); // missing toString satisfied by Object's member -f2({ - toString: function (s) { - return s; - } -}); // error, missing property value from ArgsString -f2({ - toString: function (s) { - return s; - } -}); // error, missing property value from ArgsString -f2({ - value: '', - toString: function (s) { - return s.uhhh; - } -}); // error +function f2(args) { } +f2({ hello: 1 }); // error +f2({ value: '' }); // missing toString satisfied by Object's member +f2({ value: '', what: 1 }); // missing toString satisfied by Object's member +f2({ toString: function (s) { return s; } }); // error, missing property value from ArgsString +f2({ toString: function (s) { return s; } }); // error, missing property value from ArgsString +f2({ value: '', toString: function (s) { return s.uhhh; } }); // error diff --git a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.js b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.js index 73d22c8dd51..96d1106e1ff 100644 --- a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.js +++ b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.js @@ -14,31 +14,10 @@ f2({ toString: (s: string) => s }) f2({ value: '', toString: (s) => s.uhhh }) //// [objectLiteralFunctionArgContextualTyping2.js] -function f2(args) { -} -f2({ - hello: 1 -}); -f2({ - value: '' -}); -f2({ - value: '', - what: 1 -}); -f2({ - toString: function (s) { - return s; - } -}); -f2({ - toString: function (s) { - return s; - } -}); -f2({ - value: '', - toString: function (s) { - return s.uhhh; - } -}); +function f2(args) { } +f2({ hello: 1 }); +f2({ value: '' }); +f2({ value: '', what: 1 }); +f2({ toString: function (s) { return s; } }); +f2({ toString: function (s) { return s; } }); +f2({ value: '', toString: function (s) { return s.uhhh; } }); diff --git a/tests/baselines/reference/objectLiteralGettersAndSetters.js b/tests/baselines/reference/objectLiteralGettersAndSetters.js index bdaf0966e10..d226c2c5569 100644 --- a/tests/baselines/reference/objectLiteralGettersAndSetters.js +++ b/tests/baselines/reference/objectLiteralGettersAndSetters.js @@ -85,139 +85,40 @@ var getParamType3 = { //// [objectLiteralGettersAndSetters.js] // Get and set accessor with the same name -var sameName1a = { - get 'a'() { - return ''; - }, - set a(n) { - var p = n; - var p; - } -}; -var sameName2a = { - get 0.0() { - return ''; - }, - set 0(n) { - var p = n; - var p; - } -}; -var sameName3a = { - get 0x20() { - return ''; - }, - set 3.2e1(n) { - var p = n; - var p; - } -}; -var sameName4a = { - get ''() { - return ''; - }, - set ""(n) { - var p = n; - var p; - } -}; -var sameName5a = { - get '\t'() { - return ''; - }, - set '\t'(n) { - var p = n; - var p; - } -}; -var sameName6a = { - get 'a'() { - return ''; - }, - set a(n) { - var p = n; - var p; - } -}; +var sameName1a = { get 'a'() { return ''; }, set a(n) { var p = n; var p; } }; +var sameName2a = { get 0.0() { return ''; }, set 0(n) { var p = n; var p; } }; +var sameName3a = { get 0x20() { return ''; }, set 3.2e1(n) { var p = n; var p; } }; +var sameName4a = { get ''() { return ''; }, set ""(n) { var p = n; var p; } }; +var sameName5a = { get '\t'() { return ''; }, set '\t'(n) { var p = n; var p; } }; +var sameName6a = { get 'a'() { return ''; }, set a(n) { var p = n; var p; } }; // PropertyName CallSignature{FunctionBody} is equivalent to PropertyName:function CallSignature{FunctionBody} -var callSig1 = { - num: function (n) { - return ''; - } -}; +var callSig1 = { num: function (n) { return ''; } }; var callSig1; -var callSig2 = { - num: function (n) { - return ''; - } -}; +var callSig2 = { num: function (n) { return ''; } }; var callSig2; -var callSig3 = { - num: function (n) { - return ''; - } -}; +var callSig3 = { num: function (n) { return ''; } }; var callSig3; // Get accessor only, type of the property is the annotated return type of the get accessor -var getter1 = { - get x() { - return undefined; - } -}; +var getter1 = { get x() { return undefined; } }; var getter1; // Get accessor only, type of the property is the inferred return type of the get accessor -var getter2 = { - get x() { - return ''; - } -}; +var getter2 = { get x() { return ''; } }; var getter2; // Set accessor only, type of the property is the param type of the set accessor -var setter1 = { - set x(n) { - } -}; +var setter1 = { set x(n) { } }; var setter1; // Set accessor only, type of the property is Any for an unannotated set accessor -var setter2 = { - set x(n) { - } -}; +var setter2 = { set x(n) { } }; var setter2; var anyVar; // Get and set accessor with matching type annotations -var sameType1 = { - get x() { - return undefined; - }, - set x(n) { - } -}; -var sameType2 = { - get x() { - return undefined; - }, - set x(n) { - } -}; -var sameType3 = { - get x() { - return undefined; - }, - set x(n) { - } -}; -var sameType4 = { - get x() { - return undefined; - }, - set x(n) { - } -}; +var sameType1 = { get x() { return undefined; }, set x(n) { } }; +var sameType2 = { get x() { return undefined; }, set x(n) { } }; +var sameType3 = { get x() { return undefined; }, set x(n) { } }; +var sameType4 = { get x() { return undefined; }, set x(n) { } }; // Type of unannotated get accessor return type is the type annotation of the set accessor param var setParamType1 = { - set n(x) { - }, + set n(x) { }, get n() { return function (t) { var p; @@ -232,8 +133,7 @@ var setParamType2 = { var p = t; }; }, - set n(x) { - } + set n(x) { } }; // Type of unannotated set accessor parameter is the return type annotation of the get accessor var getParamType1 = { @@ -241,14 +141,10 @@ var getParamType1 = { var y = x; var y; }, - get n() { - return ''; - } + get n() { return ''; } }; var getParamType2 = { - get n() { - return ''; - }, + get n() { return ''; }, set n(x) { var y = x; var y; @@ -256,9 +152,7 @@ var getParamType2 = { }; // Type of unannotated accessors is the inferred return type of the get accessor var getParamType3 = { - get n() { - return ''; - }, + get n() { return ''; }, set n(x) { var y = x; var y; diff --git a/tests/baselines/reference/objectLiteralIndexerErrors.js b/tests/baselines/reference/objectLiteralIndexerErrors.js index 2c619743094..5e0159015d5 100644 --- a/tests/baselines/reference/objectLiteralIndexerErrors.js +++ b/tests/baselines/reference/objectLiteralIndexerErrors.js @@ -18,11 +18,5 @@ o1 = { x: c, 0: a }; // string indexer is any, number indexer is A var a; var b; var c; -var o1 = { - x: b, - 0: a -}; // both indexers are A -o1 = { - x: c, - 0: a -}; // string indexer is any, number indexer is A +var o1 = { x: b, 0: a }; // both indexers are A +o1 = { x: c, 0: a }; // string indexer is any, number indexer is A diff --git a/tests/baselines/reference/objectLiteralIndexers.js b/tests/baselines/reference/objectLiteralIndexers.js index 97bb3ee78cc..c36cbfc7571 100644 --- a/tests/baselines/reference/objectLiteralIndexers.js +++ b/tests/baselines/reference/objectLiteralIndexers.js @@ -19,15 +19,6 @@ o1 = { x: c, 0: b }; // string indexer is any, number indexer is B var a; var b; var c; -var o1 = { - x: a, - 0: b -}; // string indexer is A, number indexer is B -o1 = { - x: b, - 0: c -}; // both indexers are any -o1 = { - x: c, - 0: b -}; // string indexer is any, number indexer is B +var o1 = { x: a, 0: b }; // string indexer is A, number indexer is B +o1 = { x: b, 0: c }; // both indexers are any +o1 = { x: c, 0: b }; // string indexer is any, number indexer is B diff --git a/tests/baselines/reference/objectLiteralMemberWithModifiers1.js b/tests/baselines/reference/objectLiteralMemberWithModifiers1.js index 998bc292740..a4389d49bdf 100644 --- a/tests/baselines/reference/objectLiteralMemberWithModifiers1.js +++ b/tests/baselines/reference/objectLiteralMemberWithModifiers1.js @@ -2,7 +2,4 @@ var v = { public foo() { } } //// [objectLiteralMemberWithModifiers1.js] -var v = { - foo: function () { - } -}; +var v = { foo: function () { } }; diff --git a/tests/baselines/reference/objectLiteralMemberWithModifiers2.js b/tests/baselines/reference/objectLiteralMemberWithModifiers2.js index d8cb4a3ad49..ffe2b6678df 100644 --- a/tests/baselines/reference/objectLiteralMemberWithModifiers2.js +++ b/tests/baselines/reference/objectLiteralMemberWithModifiers2.js @@ -2,7 +2,4 @@ var v = { public get foo() { } } //// [objectLiteralMemberWithModifiers2.js] -var v = { - get foo() { - } -}; +var v = { get foo() { } }; diff --git a/tests/baselines/reference/objectLiteralMemberWithQuestionMark1.js b/tests/baselines/reference/objectLiteralMemberWithQuestionMark1.js index 539c7a1cca9..62f7a6eefe2 100644 --- a/tests/baselines/reference/objectLiteralMemberWithQuestionMark1.js +++ b/tests/baselines/reference/objectLiteralMemberWithQuestionMark1.js @@ -2,7 +2,4 @@ var v = { foo?() { } } //// [objectLiteralMemberWithQuestionMark1.js] -var v = { - foo: function () { - } -}; +var v = { foo: function () { } }; diff --git a/tests/baselines/reference/objectLiteralMemberWithoutBlock1.js b/tests/baselines/reference/objectLiteralMemberWithoutBlock1.js index b8cd54803a5..d6a8579be04 100644 --- a/tests/baselines/reference/objectLiteralMemberWithoutBlock1.js +++ b/tests/baselines/reference/objectLiteralMemberWithoutBlock1.js @@ -2,6 +2,4 @@ var v = { foo(); } //// [objectLiteralMemberWithoutBlock1.js] -var v = { - foo: function () { } -}; +var v = { foo: function () { } }; diff --git a/tests/baselines/reference/objectLiteralParameterResolution.js b/tests/baselines/reference/objectLiteralParameterResolution.js index 1d680623600..5912a2229b1 100644 --- a/tests/baselines/reference/objectLiteralParameterResolution.js +++ b/tests/baselines/reference/objectLiteralParameterResolution.js @@ -23,9 +23,7 @@ var s = $.extend({ success: wrapSuccessCallback(requestContext, callback), error: wrapErrorCallback(requestContext, errorCallback), dataType: "json", - converters: { - "text json": "" - }, + converters: { "text json": "" }, traditional: true, timeout: 12 }, ""); diff --git a/tests/baselines/reference/objectLiteralReferencingInternalProperties.js b/tests/baselines/reference/objectLiteralReferencingInternalProperties.js index 1215dda92a7..793fa0c588a 100644 --- a/tests/baselines/reference/objectLiteralReferencingInternalProperties.js +++ b/tests/baselines/reference/objectLiteralReferencingInternalProperties.js @@ -2,7 +2,4 @@ var a = { b: 10, c: b }; // Should give error for attempting to reference b. //// [objectLiteralReferencingInternalProperties.js] -var a = { - b: 10, - c: b -}; // Should give error for attempting to reference b. +var a = { b: 10, c: b }; // Should give error for attempting to reference b. diff --git a/tests/baselines/reference/objectLiteralShorthandProperties.js b/tests/baselines/reference/objectLiteralShorthandProperties.js index 776b2bbe454..bc18ecfb948 100644 --- a/tests/baselines/reference/objectLiteralShorthandProperties.js +++ b/tests/baselines/reference/objectLiteralShorthandProperties.js @@ -32,8 +32,7 @@ var x3 = { a: 0, b: b, c: c, - d: function () { - }, + d: function () { }, x3: x3, parent: x3 }; diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.js b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.js index f9b1e2caa9a..251098eb6c8 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.js +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.js @@ -17,30 +17,12 @@ var person3: { name: string; id:number } = bar("Hello", 5); //// [objectLiteralShorthandPropertiesAssignment.js] var id = 10000; var name = "my name"; -var person = { - name: name, - id: id -}; -function foo(obj) { -} +var person = { name: name, id: id }; +function foo(obj) { } ; -function bar(name, id) { - return { - name: name, - id: id - }; -} -function bar1(name, id) { - return { - name: name - }; -} -function baz(name, id) { - return { - name: name, - id: id - }; -} +function bar(name, id) { return { name: name, id: id }; } +function bar1(name, id) { return { name: name }; } +function baz(name, id) { return { name: name, id: id }; } foo(person); var person1 = bar("Hello", 5); var person2 = bar("Hello", 5); diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.js b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.js index 4b21d8052ea..247ec56d127 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.js +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.js @@ -17,30 +17,12 @@ var person3: { name: string; id: number } = bar("Hello", 5); //// [objectLiteralShorthandPropertiesAssignmentES6.js] var id = 10000; var name = "my name"; -var person = { - name, - id -}; -function foo(obj) { -} +var person = { name, id }; +function foo(obj) { } ; -function bar(name, id) { - return { - name, - id - }; -} -function bar1(name, id) { - return { - name - }; -} -function baz(name, id) { - return { - name, - id - }; -} +function bar(name, id) { return { name, id }; } +function bar1(name, id) { return { name }; } +function baz(name, id) { return { name, id }; } foo(person); var person1 = bar("Hello", 5); var person2 = bar("Hello", 5); diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentError.js b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentError.js index 4f99576c30e..8e2d7f80356 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentError.js +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentError.js @@ -13,21 +13,9 @@ bar({ name, id }); // error //// [objectLiteralShorthandPropertiesAssignmentError.js] var id = 10000; var name = "my name"; -var person = { - name: name, - id: id -}; // error +var person = { name: name, id: id }; // error var person1 = name, id; ; // error: can't use short-hand property assignment in type position -function foo(name, id) { - return { - name: name, - id: id - }; -} // error -function bar(obj) { -} -bar({ - name: name, - id: id -}); // error +function foo(name, id) { return { name: name, id: id }; } // error +function bar(obj) { } +bar({ name: name, id: id }); // error diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.js b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.js index 1ccdb274865..71449746add 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.js +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.js @@ -11,22 +11,9 @@ var person2: { name: string, id: number } = bar("hello", 5); //// [objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.js] var id = 10000; var name = "my name"; -var person = { - name: name, - id: id -}; // error -function bar(name, id) { - return { - name: name, - id: id - }; -} // error -function foo(name, id) { - return { - name: name, - id: id - }; -} // error +var person = { name: name, id: id }; // error +function bar(name, id) { return { name: name, id: id }; } // error +function foo(name, id) { return { name: name, id: id }; } // error var person1 = name, id; ; // error : Can't use shorthand in the type position var person2 = bar("hello", 5); diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesES6.js b/tests/baselines/reference/objectLiteralShorthandPropertiesES6.js index c65087a8da7..9b19bdc8b5e 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesES6.js +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesES6.js @@ -32,8 +32,7 @@ var x3 = { a: 0, b, c, - d() { - }, + d() { }, x3, parent: x3 }; diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.js b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.js index 3c457178b3e..b72f0351b9c 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.js +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.js @@ -25,10 +25,8 @@ var v = { class }; // error var y = { "stringLiteral": , 42: , - get e() { - }, - set f() { - }, + get e() { }, + set f() { }, this: , super: , var: , @@ -37,13 +35,7 @@ var y = { }; var x = { a: .b, - a: [ - "ss" - ], - a: [ - 1 - ] + a: ["ss"], + a: [1] }; -var v = { - class: -}; // error +var v = { class: }; // error diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.js b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.js index 65eed2eace7..860abc24b19 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.js +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.js @@ -13,14 +13,7 @@ var obj = { name: name, id: id }; //// [objectLiteralShorthandPropertiesFunctionArgument.js] var id = 10000; var name = "my name"; -var person = { - name: name, - id: id -}; -function foo(p) { -} +var person = { name: name, id: id }; +function foo(p) { } foo(person); -var obj = { - name: name, - id: id -}; +var obj = { name: name, id: id }; diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument2.js b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument2.js index 3f396091d05..7e9d2e7ca8b 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument2.js +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument2.js @@ -11,10 +11,6 @@ foo(person); // error //// [objectLiteralShorthandPropertiesFunctionArgument2.js] var id = 10000; var name = "my name"; -var person = { - name: name, - id: id -}; -function foo(p) { -} +var person = { name: name, id: id }; +function foo(p) { } foo(person); // error diff --git a/tests/baselines/reference/objectLiteralWithSemicolons1.js b/tests/baselines/reference/objectLiteralWithSemicolons1.js index 85aa5f268c5..b820b14428c 100644 --- a/tests/baselines/reference/objectLiteralWithSemicolons1.js +++ b/tests/baselines/reference/objectLiteralWithSemicolons1.js @@ -2,8 +2,4 @@ var v = { a; b; c } //// [objectLiteralWithSemicolons1.js] -var v = { - a: , - b: , - c: c -}; +var v = { a: , b: , c: c }; diff --git a/tests/baselines/reference/objectLiteralWithSemicolons4.js b/tests/baselines/reference/objectLiteralWithSemicolons4.js index 9e1e3dea4b9..a01d52548ee 100644 --- a/tests/baselines/reference/objectLiteralWithSemicolons4.js +++ b/tests/baselines/reference/objectLiteralWithSemicolons4.js @@ -5,5 +5,4 @@ var v = { //// [objectLiteralWithSemicolons4.js] var v = { - a: -}; + a: }; diff --git a/tests/baselines/reference/objectLiteralWithSemicolons5.js b/tests/baselines/reference/objectLiteralWithSemicolons5.js index 36fef30ad75..1c9c4ddf544 100644 --- a/tests/baselines/reference/objectLiteralWithSemicolons5.js +++ b/tests/baselines/reference/objectLiteralWithSemicolons5.js @@ -2,10 +2,4 @@ var v = { foo() { }; a: b; get baz() { }; } //// [objectLiteralWithSemicolons5.js] -var v = { - foo: function () { - }, - a: b, - get baz() { - } -}; +var v = { foo: function () { }, a: b, get baz() { } }; diff --git a/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js b/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js index fa41e57e22e..16268c1331c 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js +++ b/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js @@ -76,8 +76,7 @@ var B = (function (_super) { var C = (function () { function C() { } - C.prototype.valueOf = function () { - }; + C.prototype.valueOf = function () { }; return C; })(); var c; @@ -91,8 +90,7 @@ var r2b = i.data; var r2c = r2b['hm']; // should be 'Object' var r2d = i['hm']; // should be 'any' var a = { - valueOf: function () { - }, + valueOf: function () { }, data: new B() }; var r3 = a.valueOf(); diff --git a/tests/baselines/reference/objectTypeHidingMembersOfObject.js b/tests/baselines/reference/objectTypeHidingMembersOfObject.js index 113329cf8b6..291cc1858fd 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfObject.js +++ b/tests/baselines/reference/objectTypeHidingMembersOfObject.js @@ -32,8 +32,7 @@ var r4: void = b.valueOf(); var C = (function () { function C() { } - C.prototype.valueOf = function () { - }; + C.prototype.valueOf = function () { }; return C; })(); var c; @@ -41,8 +40,7 @@ var r1 = c.valueOf(); var i; var r2 = i.valueOf(); var a = { - valueOf: function () { - } + valueOf: function () { } }; var r3 = a.valueOf(); var b; diff --git a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.js b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.js index 93d985f7987..5ae0c2fb1bb 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.js +++ b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.js @@ -29,16 +29,14 @@ i = o; // ok var C = (function () { function C() { } - C.prototype.toString = function () { - }; + C.prototype.toString = function () { }; return C; })(); var c; o = c; // error c = o; // ok var a = { - toString: function () { - } + toString: function () { } }; o = a; // error a = o; // ok diff --git a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.js b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.js index b8a5aa87aef..7a2b5e2ec2f 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.js +++ b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.js @@ -29,17 +29,14 @@ i = o; // error var C = (function () { function C() { } - C.prototype.toString = function () { - return 1; - }; + C.prototype.toString = function () { return 1; }; return C; })(); var c; o = c; // error c = o; // error var a = { - toString: function () { - } + toString: function () { } }; o = a; // error a = o; // ok diff --git a/tests/baselines/reference/objectTypesIdentity.js b/tests/baselines/reference/objectTypesIdentity.js index b757c18ac4f..7eccee23651 100644 --- a/tests/baselines/reference/objectTypesIdentity.js +++ b/tests/baselines/reference/objectTypesIdentity.js @@ -106,40 +106,21 @@ var C = (function () { return C; })(); var a; -var b = { - foo: '' -}; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} +var b = { foo: '' }; +function foo1(x) { } +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5(x) { } +function foo5b(x) { } +function foo6(x) { } +function foo7(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo13(x) { } +function foo14(x) { } diff --git a/tests/baselines/reference/objectTypesIdentity2.js b/tests/baselines/reference/objectTypesIdentity2.js index f721fb04b52..87057754cab 100644 --- a/tests/baselines/reference/objectTypesIdentity2.js +++ b/tests/baselines/reference/objectTypesIdentity2.js @@ -87,28 +87,15 @@ var E; (function (E) { E[E["A"] = 0] = "A"; })(E || (E = {})); -var b = { - foo: E.A -}; -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} +var b = { foo: E.A }; +function foo5(x) { } +function foo5b(x) { } +function foo6(x) { } +function foo7(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo13(x) { } +function foo14(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignatures.js b/tests/baselines/reference/objectTypesIdentityWithCallSignatures.js index 3465085bdaf..0c6952291f9 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignatures.js +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignatures.js @@ -105,68 +105,39 @@ function foo15(x: any) { } var A = (function () { function A() { } - A.prototype.foo = function (x) { - return null; - }; + A.prototype.foo = function (x) { return null; }; return A; })(); var B = (function () { function B() { } - B.prototype.foo = function (x) { - return null; - }; + B.prototype.foo = function (x) { return null; }; return B; })(); var C = (function () { function C() { } - C.prototype.foo = function (x) { - return null; - }; + C.prototype.foo = function (x) { return null; }; return C; })(); var a; -var b = { - foo: function (x) { - return ''; - } -}; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +var b = { foo: function (x) { return ''; } }; +function foo1(x) { } +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5(x) { } +function foo5b(x) { } +function foo6(x) { } +function foo7(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo14(x) { } +function foo15(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.js b/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.js index 5a45e4b5af0..43473d88e0a 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.js +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.js @@ -105,68 +105,39 @@ function foo15(x: any) { } var A = (function () { function A() { } - A.prototype.foo = function (x) { - return null; - }; + A.prototype.foo = function (x) { return null; }; return A; })(); var B = (function () { function B() { } - B.prototype.foo = function (x) { - return null; - }; + B.prototype.foo = function (x) { return null; }; return B; })(); var C = (function () { function C() { } - C.prototype.foo = function (x) { - return null; - }; + C.prototype.foo = function (x) { return null; }; return C; })(); var a; -var b = { - foo: function (x) { - return ''; - } -}; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +var b = { foo: function (x) { return ''; } }; +function foo1(x) { } +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5(x) { } +function foo5b(x) { } +function foo6(x) { } +function foo7(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo14(x) { } +function foo15(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignatures3.js b/tests/baselines/reference/objectTypesIdentityWithCallSignatures3.js index 289ba25bf6e..f4cfc8dc605 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignatures3.js +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignatures3.js @@ -42,17 +42,10 @@ function foo15(x: any) { } //// [objectTypesIdentityWithCallSignatures3.js] // object types are identical structurally var a; -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo14b(x) { -} -function foo15(x) { -} +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo13(x) { } +function foo14(x) { } +function foo14b(x) { } +function foo15(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.js b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.js index c258bc277d7..498867f0a02 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.js +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.js @@ -105,68 +105,39 @@ function foo15(x: any) { } var A = (function () { function A() { } - A.prototype.foo = function (x) { - return null; - }; + A.prototype.foo = function (x) { return null; }; return A; })(); var B = (function () { function B() { } - B.prototype.foo = function (x, y) { - return null; - }; + B.prototype.foo = function (x, y) { return null; }; return B; })(); var C = (function () { function C() { } - C.prototype.foo = function (x, y) { - return null; - }; + C.prototype.foo = function (x, y) { return null; }; return C; })(); var a; -var b = { - foo: function (x) { - return ''; - } -}; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +var b = { foo: function (x) { return ''; } }; +function foo1(x) { } +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5(x) { } +function foo5b(x) { } +function foo6(x) { } +function foo7(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo14(x) { } +function foo15(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts2.js b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts2.js index fe84b3e6b92..98b17767b75 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts2.js +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts2.js @@ -46,19 +46,11 @@ function foo15(x: any) { } //// [objectTypesIdentityWithCallSignaturesDifferingParamCounts2.js] // object types are identical structurally var a; -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo14b(x) { -} -function foo15(x) { -} +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5(x) { } +function foo13(x) { } +function foo14(x) { } +function foo14b(x) { } +function foo15(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.js b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.js index 29cb6f3cd54..54400ad81d1 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.js +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.js @@ -121,68 +121,41 @@ function foo15(x: any) { } var A = (function () { function A() { } - A.prototype.foo = function (x) { - return null; - }; + A.prototype.foo = function (x) { return null; }; return A; })(); var B = (function () { function B() { } - B.prototype.foo = function (x) { - return null; - }; + B.prototype.foo = function (x) { return null; }; return B; })(); var C = (function () { function C() { } - C.prototype.foo = function (x) { - return null; - }; + C.prototype.foo = function (x) { return null; }; return C; })(); var a; var b = { - foo: function (x) { - return ''; - } + foo: function (x) { return ''; } }; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +function foo1(x) { } +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5(x) { } +function foo5b(x) { } +function foo6(x) { } +function foo7(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo14(x) { } +function foo15(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithComplexConstraints.js b/tests/baselines/reference/objectTypesIdentityWithComplexConstraints.js index 9f16153da37..ca9db28223a 100644 --- a/tests/baselines/reference/objectTypesIdentityWithComplexConstraints.js +++ b/tests/baselines/reference/objectTypesIdentityWithComplexConstraints.js @@ -15,5 +15,4 @@ function foo(x: B); // error after constraints above made illegal function foo(x: any) { } //// [objectTypesIdentityWithComplexConstraints.js] -function foo(x) { -} +function foo(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures.js b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures.js index caf28cd05de..91208da5b90 100644 --- a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures.js +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures.js @@ -105,35 +105,19 @@ var C = (function () { return C; })(); var a; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo15(x) { -} +function foo1(x) { } +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo5(x) { } +function foo5b(x) { } +function foo6(x) { } +function foo7(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo15(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.js b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.js index 641524de5a6..87067b6be28 100644 --- a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.js +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.js @@ -91,36 +91,18 @@ var C = (function () { return C; })(); var a; -var b = { - new: function (x) { - return ''; - } -}; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +var b = { new: function (x) { return ''; } }; // not a construct signature, function called new +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo14(x) { } +function foo15(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.js b/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.js index 171dd5c3513..c95159ed997 100644 --- a/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.js +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.js @@ -91,36 +91,18 @@ var C = (function () { return C; })(); var a; -var b = { - new: function (x) { - return ''; - } -}; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +var b = { new: function (x) { return ''; } }; // not a construct signature, function called new +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo14(x) { } +function foo15(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.js index f366e79341f..c8bed1a47ab 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.js @@ -105,68 +105,39 @@ function foo15(x: any) { } var A = (function () { function A() { } - A.prototype.foo = function (x) { - return null; - }; + A.prototype.foo = function (x) { return null; }; return A; })(); var B = (function () { function B() { } - B.prototype.foo = function (x) { - return null; - }; + B.prototype.foo = function (x) { return null; }; return B; })(); var C = (function () { function C() { } - C.prototype.foo = function (x) { - return null; - }; + C.prototype.foo = function (x) { return null; }; return C; })(); var a; -var b = { - foo: function (x) { - return x; - } -}; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +var b = { foo: function (x) { return x; } }; +function foo1(x) { } +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5(x) { } +function foo5b(x) { } +function foo6(x) { } +function foo7(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo14(x) { } +function foo15(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.js index 9d184204345..6ef5d15fd98 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.js @@ -105,68 +105,39 @@ function foo15(x: any) { } var A = (function () { function A() { } - A.prototype.foo = function (x, y) { - return null; - }; + A.prototype.foo = function (x, y) { return null; }; return A; })(); var B = (function () { function B() { } - B.prototype.foo = function (x, y) { - return null; - }; + B.prototype.foo = function (x, y) { return null; }; return B; })(); var C = (function () { function C() { } - C.prototype.foo = function (x, y) { - return null; - }; + C.prototype.foo = function (x, y) { return null; }; return C; })(); var a; -var b = { - foo: function (x, y) { - return x; - } -}; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +var b = { foo: function (x, y) { return x; } }; +function foo1(x) { } +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5(x) { } +function foo5b(x) { } +function foo6(x) { } +function foo7(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo14(x) { } +function foo15(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.js index b5b7f6414e0..2b83064afed 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.js @@ -109,68 +109,39 @@ function foo15(x: any) { } var A = (function () { function A() { } - A.prototype.foo = function (x) { - return null; - }; + A.prototype.foo = function (x) { return null; }; return A; })(); var B = (function () { function B() { } - B.prototype.foo = function (x) { - return null; - }; + B.prototype.foo = function (x) { return null; }; return B; })(); var C = (function () { function C() { } - C.prototype.foo = function (x) { - return null; - }; + C.prototype.foo = function (x) { return null; }; return C; })(); var a; -var b = { - foo: function (x) { - return ''; - } -}; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +var b = { foo: function (x) { return ''; } }; +function foo1(x) { } +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5(x) { } +function foo5b(x) { } +function foo6(x) { } +function foo7(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo14(x) { } +function foo15(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.js index cc1957eef3d..1f9c5fa5256 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.js @@ -121,80 +121,47 @@ function foo15(x: any) { } var A = (function () { function A() { } - A.prototype.foo = function (x, y) { - return null; - }; + A.prototype.foo = function (x, y) { return null; }; return A; })(); var B = (function () { function B() { } - B.prototype.foo = function (x, y) { - return null; - }; + B.prototype.foo = function (x, y) { return null; }; return B; })(); var C = (function () { function C() { } - C.prototype.foo = function (x, y) { - return null; - }; + C.prototype.foo = function (x, y) { return null; }; return C; })(); var D = (function () { function D() { } - D.prototype.foo = function (x, y) { - return null; - }; + D.prototype.foo = function (x, y) { return null; }; return D; })(); var a; -var b = { - foo: function (x, y) { - return ''; - } -}; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo5c(x) { -} -function foo6c(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +var b = { foo: function (x, y) { return ''; } }; +function foo1(x) { } +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5(x) { } +function foo5b(x) { } +function foo5c(x) { } +function foo6c(x) { } +function foo6(x) { } +function foo7(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo14(x) { } +function foo15(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.js index 9774cbd2b41..21106b56b00 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.js @@ -140,80 +140,47 @@ var Two = (function () { var A = (function () { function A() { } - A.prototype.foo = function (x, y) { - return null; - }; + A.prototype.foo = function (x, y) { return null; }; return A; })(); var B = (function () { function B() { } - B.prototype.foo = function (x, y) { - return null; - }; + B.prototype.foo = function (x, y) { return null; }; return B; })(); var C = (function () { function C() { } - C.prototype.foo = function (x, y) { - return null; - }; + C.prototype.foo = function (x, y) { return null; }; return C; })(); var D = (function () { function D() { } - D.prototype.foo = function (x, y) { - return null; - }; + D.prototype.foo = function (x, y) { return null; }; return D; })(); var a; -var b = { - foo: function (x, y) { - return ''; - } -}; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo5c(x) { -} -function foo6c(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +var b = { foo: function (x, y) { return ''; } }; +function foo1(x) { } +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5(x) { } +function foo5b(x) { } +function foo5c(x) { } +function foo6c(x) { } +function foo6(x) { } +function foo7(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo14(x) { } +function foo15(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.js index ac686014aa6..99188347d36 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.js @@ -109,68 +109,39 @@ function foo15(x: any) { } var A = (function () { function A() { } - A.prototype.foo = function (x) { - return null; - }; + A.prototype.foo = function (x) { return null; }; return A; })(); var B = (function () { function B() { } - B.prototype.foo = function (x) { - return null; - }; + B.prototype.foo = function (x) { return null; }; return B; })(); var C = (function () { function C() { } - C.prototype.foo = function (x) { - return null; - }; + C.prototype.foo = function (x) { return null; }; return C; })(); var a; -var b = { - foo: function (x) { - return null; - } -}; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +var b = { foo: function (x) { return null; } }; +function foo1(x) { } +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5(x) { } +function foo5b(x) { } +function foo6(x) { } +function foo7(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo14(x) { } +function foo15(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.js index e25e379bde8..10d72bde0b3 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.js @@ -109,68 +109,39 @@ function foo15(x: any) { } var A = (function () { function A() { } - A.prototype.foo = function (x) { - return null; - }; + A.prototype.foo = function (x) { return null; }; return A; })(); var B = (function () { function B() { } - B.prototype.foo = function (x) { - return null; - }; + B.prototype.foo = function (x) { return null; }; return B; })(); var C = (function () { function C() { } - C.prototype.foo = function (x) { - return null; - }; + C.prototype.foo = function (x) { return null; }; return C; })(); var a; -var b = { - foo: function (x) { - return null; - } -}; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +var b = { foo: function (x) { return null; } }; +function foo1(x) { } +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5(x) { } +function foo5b(x) { } +function foo6(x) { } +function foo7(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo14(x) { } +function foo15(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.js index 48e98f904b0..5a20dfdecb6 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.js @@ -105,68 +105,39 @@ function foo15(x: any) { } var A = (function () { function A() { } - A.prototype.foo = function (x) { - return null; - }; + A.prototype.foo = function (x) { return null; }; return A; })(); var B = (function () { function B() { } - B.prototype.foo = function (x) { - return null; - }; + B.prototype.foo = function (x) { return null; }; return B; })(); var C = (function () { function C() { } - C.prototype.foo = function (x) { - return null; - }; + C.prototype.foo = function (x) { return null; }; return C; })(); var a; -var b = { - foo: function (x) { - return x; - } -}; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +var b = { foo: function (x) { return x; } }; +function foo1(x) { } +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5(x) { } +function foo5b(x) { } +function foo6(x) { } +function foo7(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo14(x) { } +function foo15(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.js index 944fb7d9846..6bfd019dc86 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.js @@ -43,17 +43,10 @@ function foo15(x: any) { } //// [objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.js] // object types are identical structurally var a; -function foo1(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo14b(x) { -} -function foo15(x) { -} +function foo1(x) { } +function foo2(x) { } +function foo3(x) { } +function foo13(x) { } +function foo14(x) { } +function foo14b(x) { } +function foo15(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.js index 518bbe550ec..ec9c786b890 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.js @@ -105,68 +105,39 @@ function foo15(x: any) { } var A = (function () { function A() { } - A.prototype.foo = function (x) { - return null; - }; + A.prototype.foo = function (x) { return null; }; return A; })(); var B = (function () { function B() { } - B.prototype.foo = function (x) { - return null; - }; + B.prototype.foo = function (x) { return null; }; return B; })(); var C = (function () { function C() { } - C.prototype.foo = function (x) { - return null; - }; + C.prototype.foo = function (x) { return null; }; return C; })(); var a; -var b = { - foo: function (x) { - return x; - } -}; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +var b = { foo: function (x) { return x; } }; +function foo1(x) { } +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5(x) { } +function foo5b(x) { } +function foo6(x) { } +function foo7(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo14(x) { } +function foo15(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.js index f84341e589b..a4af2bc820e 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.js @@ -109,68 +109,39 @@ function foo15(x: any) { } var A = (function () { function A() { } - A.prototype.foo = function (x, y) { - return null; - }; + A.prototype.foo = function (x, y) { return null; }; return A; })(); var B = (function () { function B() { } - B.prototype.foo = function (x, y) { - return null; - }; + B.prototype.foo = function (x, y) { return null; }; return B; })(); var C = (function () { function C() { } - C.prototype.foo = function (x, y) { - return null; - }; + C.prototype.foo = function (x, y) { return null; }; return C; })(); var a; -var b = { - foo: function (x, y) { - return x; - } -}; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +var b = { foo: function (x, y) { return x; } }; +function foo1(x) { } +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5(x) { } +function foo5b(x) { } +function foo6(x) { } +function foo7(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo14(x) { } +function foo15(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.js index ea385109821..28b2f978b55 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.js @@ -109,68 +109,39 @@ function foo15(x: any) { } var A = (function () { function A() { } - A.prototype.foo = function (x, y) { - return null; - }; + A.prototype.foo = function (x, y) { return null; }; return A; })(); var B = (function () { function B() { } - B.prototype.foo = function (x, y) { - return null; - }; + B.prototype.foo = function (x, y) { return null; }; return B; })(); var C = (function () { function C() { } - C.prototype.foo = function (x, y) { - return null; - }; + C.prototype.foo = function (x, y) { return null; }; return C; })(); var a; -var b = { - foo: function (x, y) { - return x; - } -}; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +var b = { foo: function (x, y) { return x; } }; +function foo1(x) { } +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5(x) { } +function foo5b(x) { } +function foo6(x) { } +function foo7(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo14(x) { } +function foo15(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.js index 34acdef8599..de9b4859fa1 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.js @@ -109,68 +109,39 @@ function foo15(x: any) { } var A = (function () { function A() { } - A.prototype.foo = function (x, y) { - return null; - }; + A.prototype.foo = function (x, y) { return null; }; return A; })(); var B = (function () { function B() { } - B.prototype.foo = function (x, y) { - return null; - }; + B.prototype.foo = function (x, y) { return null; }; return B; })(); var C = (function () { function C() { } - C.prototype.foo = function (x, y) { - return null; - }; + C.prototype.foo = function (x, y) { return null; }; return C; })(); var a; -var b = { - foo: function (x, y) { - return x; - } -}; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +var b = { foo: function (x, y) { return x; } }; +function foo1(x) { } +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5(x) { } +function foo5b(x) { } +function foo6(x) { } +function foo7(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo14(x) { } +function foo15(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.js index b252fc7f8fe..fdc67d4b84a 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.js @@ -92,34 +92,17 @@ var C = (function () { return C; })(); var a; -var b = { - new: function (x) { - return ''; - } -}; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} +var b = { new: function (x) { return ''; } }; // not a construct signature, function called new +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo14(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.js index e6450471a47..11dcdf0a609 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.js @@ -109,38 +109,19 @@ var D = (function () { return D; })(); var a; -var b = { - new: function (x, y) { - return ''; - } -}; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5c(x) { -} -function foo6c(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} +var b = { new: function (x, y) { return ''; } }; // not a construct signature, function called new +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5c(x) { } +function foo6c(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo14(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.js index 0a276be9f7a..5c6f59eef24 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.js @@ -128,38 +128,19 @@ var D = (function () { return D; })(); var a; -var b = { - new: function (x, y) { - return ''; - } -}; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5c(x) { -} -function foo6c(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} +var b = { new: function (x, y) { return ''; } }; // not a construct signature, function called new +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5c(x) { } +function foo6c(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo14(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.js index e1c64ed0ec6..556d1bcaee0 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.js @@ -99,38 +99,19 @@ var C = (function () { return C; })(); var a; -var b = { - new: function (x) { - return null; - } -}; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +var b = { new: function (x) { return null; } }; // not a construct signature, function called new +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo14(x) { } +function foo15(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.js index ade431026d5..68c32cb0e71 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.js @@ -95,36 +95,18 @@ var C = (function () { return C; })(); var a; -var b = { - new: function (x) { - return null; - } -}; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} +var b = { new: function (x) { return null; } }; // not a construct signature, function called new +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo14(x) { } +function foo15(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.js index 014b4126f2c..789e02d2d7b 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.js @@ -87,34 +87,17 @@ var C = (function () { return C; })(); var a; -var b = { - new: function (x) { - return x; - } -}; -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} +var b = { new: function (x) { return x; } }; +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo14(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.js index d30a3a798a2..5a501d05834 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.js @@ -87,34 +87,17 @@ var C = (function () { return C; })(); var a; -var b = { - new: function (x) { - return new C(x); - } -}; -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} +var b = { new: function (x) { return new C(x); } }; +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo14(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.js index f71ef509ca9..685a8441d97 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.js @@ -91,34 +91,17 @@ var C = (function () { return C; })(); var a; -var b = { - new: function (x, y) { - return new C(x, y); - } -}; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} +var b = { new: function (x, y) { return new C(x, y); } }; // not a construct signature, function called new +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo14(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.js index 00994a57fc8..f16d69acaa1 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.js @@ -91,34 +91,17 @@ var C = (function () { return C; })(); var a; -var b = { - new: function (x, y) { - return new C(x, y); - } -}; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} +var b = { new: function (x, y) { return new C(x, y); } }; // not a construct signature, function called new +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo14(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.js index 572a9db5d33..25c628e9e15 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.js @@ -91,34 +91,17 @@ var C = (function () { return C; })(); var a; -var b = { - new: function (x, y) { - return new C(x, y); - } -}; // not a construct signature, function called new -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo12b(x) { -} -function foo13(x) { -} -function foo14(x) { -} +var b = { new: function (x, y) { return new C(x, y); } }; // not a construct signature, function called new +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo12b(x) { } +function foo13(x) { } +function foo14(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js index e49566c5531..1dc6505456a 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js @@ -160,52 +160,27 @@ var PB = (function (_super) { return PB; })(B); var a; -var b = { - foo: '' -}; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo5c(x) { -} -function foo5d(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo11b(x) { -} -function foo11c(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} -function foo16(x) { -} +var b = { foo: '' }; +function foo1(x) { } +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5(x) { } +function foo5b(x) { } +function foo5c(x) { } +function foo5d(x) { } +function foo6(x) { } +function foo7(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo11b(x) { } +function foo11c(x) { } +function foo12(x) { } +function foo13(x) { } +function foo14(x) { } +function foo15(x) { } +function foo16(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js index ae00306f397..e2fd1b99bfa 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js @@ -175,52 +175,27 @@ var PB = (function (_super) { return PB; })(B); var a; -var b = { - foo: null -}; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo5c(x) { -} -function foo5d(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo11b(x) { -} -function foo11c(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} -function foo16(x) { -} +var b = { foo: null }; +function foo1(x) { } +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5(x) { } +function foo5b(x) { } +function foo5c(x) { } +function foo5d(x) { } +function foo6(x) { } +function foo7(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo11b(x) { } +function foo11c(x) { } +function foo12(x) { } +function foo13(x) { } +function foo14(x) { } +function foo15(x) { } +function foo16(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js index cc9d605153c..11d64efc9d5 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js @@ -160,52 +160,27 @@ var PB = (function (_super) { return PB; })(B); var a; -var b = { - foo: '' -}; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo5c(x) { -} -function foo5d(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo11b(x) { -} -function foo11c(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} -function foo16(x) { -} +var b = { foo: '' }; +function foo1(x) { } +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5(x) { } +function foo5b(x) { } +function foo5c(x) { } +function foo5d(x) { } +function foo6(x) { } +function foo7(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo11b(x) { } +function foo11c(x) { } +function foo12(x) { } +function foo13(x) { } +function foo14(x) { } +function foo15(x) { } +function foo16(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithOptionality.js b/tests/baselines/reference/objectTypesIdentityWithOptionality.js index 4fe529a1342..2a61cda1bb9 100644 --- a/tests/baselines/reference/objectTypesIdentityWithOptionality.js +++ b/tests/baselines/reference/objectTypesIdentityWithOptionality.js @@ -74,24 +74,13 @@ var C = (function () { return C; })(); var a; -var b = { - foo: '' -}; -function foo2(x) { -} -function foo3(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo10(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} +var b = { foo: '' }; +function foo2(x) { } +function foo3(x) { } +function foo6(x) { } +function foo7(x) { } +function foo8(x) { } +function foo10(x) { } +function foo12(x) { } +function foo13(x) { } +function foo14(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates.js b/tests/baselines/reference/objectTypesIdentityWithPrivates.js index e8072e7f186..5c8a0afed72 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates.js +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates.js @@ -158,52 +158,27 @@ var PB = (function (_super) { return PB; })(B); var a; -var b = { - foo: '' -}; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo5c(x) { -} -function foo5d(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo11b(x) { -} -function foo11c(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} -function foo16(x) { -} +var b = { foo: '' }; +function foo1(x) { } +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5(x) { } +function foo5b(x) { } +function foo5c(x) { } +function foo5d(x) { } +function foo6(x) { } +function foo7(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo11b(x) { } +function foo11c(x) { } +function foo12(x) { } +function foo13(x) { } +function foo14(x) { } +function foo15(x) { } +function foo16(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates2.js b/tests/baselines/reference/objectTypesIdentityWithPrivates2.js index 4e62e7b551a..36c3e67c70e 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates2.js +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates2.js @@ -58,17 +58,11 @@ var D = (function (_super) { } return D; })(C); -function foo1(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} +function foo1(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } var r = foo4(new C()); var r = foo4(new D()); -function foo5(x) { -} -function foo6(x) { -} +function foo5(x) { } +function foo6(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithPublics.js b/tests/baselines/reference/objectTypesIdentityWithPublics.js index 59b6e315c10..7c36eb48f2c 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPublics.js +++ b/tests/baselines/reference/objectTypesIdentityWithPublics.js @@ -106,40 +106,21 @@ var C = (function () { return C; })(); var a; -var b = { - foo: '' -}; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} +var b = { foo: '' }; +function foo1(x) { } +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5(x) { } +function foo5b(x) { } +function foo6(x) { } +function foo7(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo12(x) { } +function foo13(x) { } +function foo14(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js index f9abb678959..37c5537aa4b 100644 --- a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js @@ -160,52 +160,27 @@ var PB = (function (_super) { return PB; })(B); var a; -var b = { - foo: '' -}; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo5c(x) { -} -function foo5d(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo11b(x) { -} -function foo11c(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} -function foo16(x) { -} +var b = { foo: '' }; +function foo1(x) { } +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5(x) { } +function foo5b(x) { } +function foo5c(x) { } +function foo5d(x) { } +function foo6(x) { } +function foo7(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo11b(x) { } +function foo11c(x) { } +function foo12(x) { } +function foo13(x) { } +function foo14(x) { } +function foo15(x) { } +function foo16(x) { } diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js b/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js index 6bb5369122a..e90dc8598e4 100644 --- a/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js @@ -175,52 +175,27 @@ var PB = (function (_super) { return PB; })(B); var a; -var b = { - foo: null -}; -function foo1(x) { -} -function foo1b(x) { -} -function foo1c(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} -function foo5b(x) { -} -function foo5c(x) { -} -function foo5d(x) { -} -function foo6(x) { -} -function foo7(x) { -} -function foo8(x) { -} -function foo9(x) { -} -function foo10(x) { -} -function foo11(x) { -} -function foo11b(x) { -} -function foo11c(x) { -} -function foo12(x) { -} -function foo13(x) { -} -function foo14(x) { -} -function foo15(x) { -} -function foo16(x) { -} +var b = { foo: null }; +function foo1(x) { } +function foo1b(x) { } +function foo1c(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5(x) { } +function foo5b(x) { } +function foo5c(x) { } +function foo5d(x) { } +function foo6(x) { } +function foo7(x) { } +function foo8(x) { } +function foo9(x) { } +function foo10(x) { } +function foo11(x) { } +function foo11b(x) { } +function foo11c(x) { } +function foo12(x) { } +function foo13(x) { } +function foo14(x) { } +function foo15(x) { } +function foo16(x) { } diff --git a/tests/baselines/reference/objectTypesWithOptionalProperties2.js b/tests/baselines/reference/objectTypesWithOptionalProperties2.js index 3faa10447b6..cf0d113c244 100644 --- a/tests/baselines/reference/objectTypesWithOptionalProperties2.js +++ b/tests/baselines/reference/objectTypesWithOptionalProperties2.js @@ -42,7 +42,5 @@ var C2 = (function () { return C2; })(); var b = { - x: function () { - }, - 1: // error + x: function () { }, 1: // error }; diff --git a/tests/baselines/reference/objectTypesWithPredefinedTypesAsName2.errors.txt b/tests/baselines/reference/objectTypesWithPredefinedTypesAsName2.errors.txt index 32a693abdcb..f2dbd672300 100644 --- a/tests/baselines/reference/objectTypesWithPredefinedTypesAsName2.errors.txt +++ b/tests/baselines/reference/objectTypesWithPredefinedTypesAsName2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/specifyingTypes/predefinedTypes/objectTypesWithPredefinedTypesAsName2.ts(3,7): error TS1003: Identifier expected. +tests/cases/conformance/types/specifyingTypes/predefinedTypes/objectTypesWithPredefinedTypesAsName2.ts(3,7): error TS1005: '{' expected. ==== tests/cases/conformance/types/specifyingTypes/predefinedTypes/objectTypesWithPredefinedTypesAsName2.ts (1 errors) ==== @@ -6,4 +6,4 @@ tests/cases/conformance/types/specifyingTypes/predefinedTypes/objectTypesWithPre class void {} // parse error unlike the others ~~~~ -!!! error TS1003: Identifier expected. \ No newline at end of file +!!! error TS1005: '{' expected. \ No newline at end of file diff --git a/tests/baselines/reference/objectTypesWithPredefinedTypesAsName2.js b/tests/baselines/reference/objectTypesWithPredefinedTypesAsName2.js index b47901b2f0c..974744f1870 100644 --- a/tests/baselines/reference/objectTypesWithPredefinedTypesAsName2.js +++ b/tests/baselines/reference/objectTypesWithPredefinedTypesAsName2.js @@ -5,9 +5,9 @@ class void {} // parse error unlike the others //// [objectTypesWithPredefinedTypesAsName2.js] // it is an error to use a predefined type as a type name -var = (function () { - function () { +var default_1 = (function () { + function default_1() { } - return ; + return default_1; })(); void {}; // parse error unlike the others diff --git a/tests/baselines/reference/optionalAccessorsInInterface1.js b/tests/baselines/reference/optionalAccessorsInInterface1.js index cf6a795b6bd..dd274b133e5 100644 --- a/tests/baselines/reference/optionalAccessorsInInterface1.js +++ b/tests/baselines/reference/optionalAccessorsInInterface1.js @@ -17,13 +17,5 @@ defineMyProperty2({}, "name", { get: function () { return 5; } }); //// [optionalAccessorsInInterface1.js] -defineMyProperty({}, "name", { - get: function () { - return 5; - } -}); -defineMyProperty2({}, "name", { - get: function () { - return 5; - } -}); +defineMyProperty({}, "name", { get: function () { return 5; } }); +defineMyProperty2({}, "name", { get: function () { return 5; } }); diff --git a/tests/baselines/reference/optionalBindingParameters1.js b/tests/baselines/reference/optionalBindingParameters1.js index e2286bf40bd..536cb1e567a 100644 --- a/tests/baselines/reference/optionalBindingParameters1.js +++ b/tests/baselines/reference/optionalBindingParameters1.js @@ -12,13 +12,5 @@ foo([false, 0, ""]); function foo(_a) { var x = _a[0], y = _a[1], z = _a[2]; } -foo([ - "", - 0, - false -]); -foo([ - false, - 0, - "" -]); +foo(["", 0, false]); +foo([false, 0, ""]); diff --git a/tests/baselines/reference/optionalBindingParameters2.js b/tests/baselines/reference/optionalBindingParameters2.js index f9c55ebd4a3..04e1138561a 100644 --- a/tests/baselines/reference/optionalBindingParameters2.js +++ b/tests/baselines/reference/optionalBindingParameters2.js @@ -12,13 +12,5 @@ foo({ x: false, y: 0, z: "" }); function foo(_a) { var x = _a.x, y = _a.y, z = _a.z; } -foo({ - x: "", - y: 0, - z: false -}); -foo({ - x: false, - y: 0, - z: "" -}); +foo({ x: "", y: 0, z: false }); +foo({ x: false, y: 0, z: "" }); diff --git a/tests/baselines/reference/optionalBindingParametersInOverloads1.js b/tests/baselines/reference/optionalBindingParametersInOverloads1.js index 40f60108aa7..3658efa72c6 100644 --- a/tests/baselines/reference/optionalBindingParametersInOverloads1.js +++ b/tests/baselines/reference/optionalBindingParametersInOverloads1.js @@ -16,13 +16,5 @@ function foo() { rest[_i - 0] = arguments[_i]; } } -foo([ - "", - 0, - false -]); -foo([ - false, - 0, - "" -]); +foo(["", 0, false]); +foo([false, 0, ""]); diff --git a/tests/baselines/reference/optionalBindingParametersInOverloads2.js b/tests/baselines/reference/optionalBindingParametersInOverloads2.js index 18e4c10fc93..1ddfdae4f07 100644 --- a/tests/baselines/reference/optionalBindingParametersInOverloads2.js +++ b/tests/baselines/reference/optionalBindingParametersInOverloads2.js @@ -16,13 +16,5 @@ function foo() { rest[_i - 0] = arguments[_i]; } } -foo({ - x: "", - y: 0, - z: false -}); -foo({ - x: false, - y: 0, - z: "" -}); +foo({ x: "", y: 0, z: false }); +foo({ x: false, y: 0, z: "" }); diff --git a/tests/baselines/reference/optionalConstructorArgInSuper.js b/tests/baselines/reference/optionalConstructorArgInSuper.js index 45c0e032cd8..5204d7f8307 100644 --- a/tests/baselines/reference/optionalConstructorArgInSuper.js +++ b/tests/baselines/reference/optionalConstructorArgInSuper.js @@ -20,8 +20,7 @@ var __extends = this.__extends || function (d, b) { var Base = (function () { function Base(opt) { } - Base.prototype.foo = function (other) { - }; + Base.prototype.foo = function (other) { }; return Base; })(); var Derived = (function (_super) { diff --git a/tests/baselines/reference/optionalFunctionArgAssignability.js b/tests/baselines/reference/optionalFunctionArgAssignability.js index bca42060066..c82a47e88da 100644 --- a/tests/baselines/reference/optionalFunctionArgAssignability.js +++ b/tests/baselines/reference/optionalFunctionArgAssignability.js @@ -9,10 +9,6 @@ a = b; // error because number is not assignable to string //// [optionalFunctionArgAssignability.js] -var a = function then(onFulfill, onReject) { - return null; -}; -var b = function then(onFulFill, onReject) { - return null; -}; +var a = function then(onFulfill, onReject) { return null; }; +var b = function then(onFulFill, onReject) { return null; }; a = b; // error because number is not assignable to string diff --git a/tests/baselines/reference/optionalParamArgsTest.js b/tests/baselines/reference/optionalParamArgsTest.js index 6837c024ffb..5598f8d0872 100644 --- a/tests/baselines/reference/optionalParamArgsTest.js +++ b/tests/baselines/reference/optionalParamArgsTest.js @@ -139,12 +139,8 @@ var C1 = (function () { if (p === void 0) { p = 0; } this.n = 0; } - C1.prototype.C1M1 = function () { - return 0; - }; // returning C1M1A1 will result in "Unresolved symbol C1M1A1" - C1.prototype.C1M2 = function (C1M2A1) { - return C1M2A1; - }; // will return C1M1A2 without complaint + C1.prototype.C1M1 = function () { return 0; }; // returning C1M1A1 will result in "Unresolved symbol C1M1A1" + C1.prototype.C1M2 = function (C1M2A1) { return C1M2A1; }; // will return C1M1A2 without complaint // C1M3 contains all optional parameters C1.prototype.C1M3 = function (C1M3A1, C1M3A2) { if (C1M3A1 === void 0) { C1M3A1 = 0; } @@ -152,9 +148,7 @@ var C1 = (function () { return C1M3A1 + C1M3A2; }; // C1M4 contains a mix of optional and non-optional parameters - C1.prototype.C1M4 = function (C1M4A1, C1M4A2) { - return C1M4A1 + C1M4A2; - }; + C1.prototype.C1M4 = function (C1M4A1, C1M4A2) { return C1M4A1 + C1M4A2; }; C1.prototype.C1M5 = function (C1M5A1, C1M5A2, C1M5A3) { if (C1M5A2 === void 0) { C1M5A2 = 0; } return C1M5A1 + C1M5A2; @@ -175,34 +169,22 @@ var C2 = (function (_super) { } return C2; })(C1); -function F1() { - return 0; -} -function F2(F2A1) { - return F2A1; -} +function F1() { return 0; } +function F2(F2A1) { return F2A1; } function F3(F3A1, F3A2) { if (F3A1 === void 0) { F3A1 = 0; } if (F3A2 === void 0) { F3A2 = F3A1; } return F3A1 + F3A2; } -function F4(F4A1, F4A2) { - return F4A1 + F4A2; -} -var L1 = function () { - return 0; -}; -var L2 = function (L2A1) { - return L2A1; -}; +function F4(F4A1, F4A2) { return F4A1 + F4A2; } +var L1 = function () { return 0; }; +var L2 = function (L2A1) { return L2A1; }; var L3 = function (L3A1, L3A2) { if (L3A1 === void 0) { L3A1 = 0; } if (L3A2 === void 0) { L3A2 = L3A1; } return L3A1 + L3A2; }; -var L4 = function (L4A1, L4A2) { - return L4A1 + L4A2; -}; +var L4 = function (L4A1, L4A2) { return L4A1 + L4A2; }; var c1o1 = new C1(5); var i1o1 = new C1(5); // Valid @@ -264,17 +246,6 @@ function fnOpt1(id, children, expectedPath, isRoot) { if (children === void 0) { children = []; } if (expectedPath === void 0) { expectedPath = []; } } -function fnOpt2(id, children, expectedPath, isRoot) { -} -fnOpt1(1, [ - 2, - 3 -], [ - 1 -], true); -fnOpt2(1, [ - 2, - 3 -], [ - 1 -], true); +function fnOpt2(id, children, expectedPath, isRoot) { } +fnOpt1(1, [2, 3], [1], true); +fnOpt2(1, [2, 3], [1], true); diff --git a/tests/baselines/reference/optionalParamInOverride.js b/tests/baselines/reference/optionalParamInOverride.js index 0a094c6534c..cfdfce368d0 100644 --- a/tests/baselines/reference/optionalParamInOverride.js +++ b/tests/baselines/reference/optionalParamInOverride.js @@ -17,8 +17,7 @@ var __extends = this.__extends || function (d, b) { var Z = (function () { function Z() { } - Z.prototype.func = function () { - }; + Z.prototype.func = function () { }; return Z; })(); var Y = (function (_super) { @@ -26,7 +25,6 @@ var Y = (function (_super) { function Y() { _super.apply(this, arguments); } - Y.prototype.func = function (value) { - }; + Y.prototype.func = function (value) { }; return Y; })(Z); diff --git a/tests/baselines/reference/optionalPropertiesTest.js b/tests/baselines/reference/optionalPropertiesTest.js index 3c68b90fdd8..617db8d6185 100644 --- a/tests/baselines/reference/optionalPropertiesTest.js +++ b/tests/baselines/reference/optionalPropertiesTest.js @@ -43,21 +43,10 @@ test10_1 = test10_2; //// [optionalPropertiesTest.js] var x; var foo; -foo = { - id: 1234 -}; // Ok -foo = { - id: 1234, - name: "test" -}; // Ok -foo = { - name: "test" -}; // Error, id missing -foo = { - id: 1234, - print: function () { - } -}; // Ok +foo = { id: 1234 }; // Ok +foo = { id: 1234, name: "test" }; // Ok +foo = { name: "test" }; // Error, id missing +foo = { id: 1234, print: function () { } }; // Ok var s = foo.name || "default"; if (foo.print !== undefined) foo.print(); @@ -69,21 +58,11 @@ var test1 = {}; var test2 = {}; var test3 = {}; var test4 = {}; -var test5 = { - M: function () { - } -}; -var test6 = { - M: 5 -}; -var test7 = { - M: function () { - } -}; +var test5 = { M: function () { } }; +var test6 = { M: 5 }; +var test7 = { M: function () { } }; test7 = {}; -var test8 = { - M: 5 -}; +var test8 = { M: 5 }; test8 = {}; var test9_1; var test9_2; diff --git a/tests/baselines/reference/optionalSetterParam.js b/tests/baselines/reference/optionalSetterParam.js index 4b9b7f01360..1632f33be9f 100644 --- a/tests/baselines/reference/optionalSetterParam.js +++ b/tests/baselines/reference/optionalSetterParam.js @@ -10,8 +10,7 @@ var foo = (function () { function foo() { } Object.defineProperty(foo.prototype, "bar", { - set: function (param) { - }, + set: function (param) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.js b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.js index 66129a5d0be..9a04ea28fba 100644 --- a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.js +++ b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.js @@ -27,13 +27,7 @@ w({ s: "", n: 0 }).toLowerCase(); //// [orderMattersForSignatureGroupIdentity.js] var v; var v; -v({ - s: "", - n: 0 -}).toLowerCase(); +v({ s: "", n: 0 }).toLowerCase(); var w; var w; -w({ - s: "", - n: 0 -}).toLowerCase(); +w({ s: "", n: 0 }).toLowerCase(); diff --git a/tests/baselines/reference/overEagerReturnTypeSpecialization.js b/tests/baselines/reference/overEagerReturnTypeSpecialization.js index 3d91a6f2fa6..90fcc388b76 100644 --- a/tests/baselines/reference/overEagerReturnTypeSpecialization.js +++ b/tests/baselines/reference/overEagerReturnTypeSpecialization.js @@ -16,15 +16,7 @@ var r2: I1 = v1.func(num => num.toString()) // Correctly returns an I1 -.func(function (str) { - return str.length; -}); // should error -var r2 = v1.func(function (num) { - return num.toString(); -}) // Correctly returns an I1 -.func(function (str) { - return str.length; -}); // should be ok +var r1 = v1.func(function (num) { return num.toString(); }) // Correctly returns an I1 + .func(function (str) { return str.length; }); // should error +var r2 = v1.func(function (num) { return num.toString(); }) // Correctly returns an I1 + .func(function (str) { return str.length; }); // should be ok diff --git a/tests/baselines/reference/overloadAssignmentCompat.js b/tests/baselines/reference/overloadAssignmentCompat.js index f6767f6f33e..2d4bd931844 100644 --- a/tests/baselines/reference/overloadAssignmentCompat.js +++ b/tests/baselines/reference/overloadAssignmentCompat.js @@ -65,7 +65,5 @@ function attr2(nameOrMap, value) { return "s"; } } -function foo() { - return "a"; -} +function foo() { return "a"; } ; diff --git a/tests/baselines/reference/overloadCallTest.js b/tests/baselines/reference/overloadCallTest.js index f7eb97fc9eb..38930b7aea3 100644 --- a/tests/baselines/reference/overloadCallTest.js +++ b/tests/baselines/reference/overloadCallTest.js @@ -18,9 +18,7 @@ class foo { //// [overloadCallTest.js] var foo = (function () { function foo() { - function bar(foo) { - return "foo"; - } + function bar(foo) { return "foo"; } ; var test = bar("test"); var goo = bar(); diff --git a/tests/baselines/reference/overloadModifiersMustAgree.js b/tests/baselines/reference/overloadModifiersMustAgree.js index 8cb537c4410..3f9f7eb1415 100644 --- a/tests/baselines/reference/overloadModifiersMustAgree.js +++ b/tests/baselines/reference/overloadModifiersMustAgree.js @@ -19,9 +19,7 @@ interface I { var baz = (function () { function baz() { } - baz.prototype.foo = function (bar) { - }; // error - access modifiers do not agree + baz.prototype.foo = function (bar) { }; // error - access modifiers do not agree return baz; })(); -function bar(s) { -} +function bar(s) { } diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks1.js b/tests/baselines/reference/overloadOnConstConstraintChecks1.js index a59ca2ceda1..eb613586118 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks1.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks1.js @@ -32,8 +32,7 @@ var __extends = this.__extends || function (d, b) { var Base = (function () { function Base() { } - Base.prototype.foo = function () { - }; + Base.prototype.foo = function () { }; return Base; })(); var Derived1 = (function (_super) { @@ -41,8 +40,7 @@ var Derived1 = (function (_super) { function Derived1() { _super.apply(this, arguments); } - Derived1.prototype.bar = function () { - }; + Derived1.prototype.bar = function () { }; return Derived1; })(Base); var Derived2 = (function (_super) { @@ -50,8 +48,7 @@ var Derived2 = (function (_super) { function Derived2() { _super.apply(this, arguments); } - Derived2.prototype.baz = function () { - }; + Derived2.prototype.baz = function () { }; return Derived2; })(Base); var Derived3 = (function (_super) { @@ -59,8 +56,7 @@ var Derived3 = (function (_super) { function Derived3() { _super.apply(this, arguments); } - Derived3.prototype.biz = function () { - }; + Derived3.prototype.biz = function () { }; return Derived3; })(Base); var D = (function () { diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks2.js b/tests/baselines/reference/overloadOnConstConstraintChecks2.js index 071b9372636..25759d0a839 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks2.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks2.js @@ -35,8 +35,7 @@ var C = (function (_super) { function C() { _super.apply(this, arguments); } - C.prototype.foo = function () { - }; + C.prototype.foo = function () { }; return C; })(A); function foo(name) { diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks3.js b/tests/baselines/reference/overloadOnConstConstraintChecks3.js index 961411bf6e5..5980c852f41 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks3.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks3.js @@ -37,8 +37,7 @@ var C = (function (_super) { function C() { _super.apply(this, arguments); } - C.prototype.foo = function () { - }; + C.prototype.foo = function () { }; return C; })(A); function foo(name) { diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks4.js b/tests/baselines/reference/overloadOnConstConstraintChecks4.js index 5192afc35a2..b2ae1125750 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks4.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks4.js @@ -45,8 +45,7 @@ var C = (function (_super) { function C() { _super.apply(this, arguments); } - C.prototype.foo = function () { - }; + C.prototype.foo = function () { }; return C; })(A); function foo(name) { diff --git a/tests/baselines/reference/overloadOnConstInObjectLiteralImplementingAnInterface.js b/tests/baselines/reference/overloadOnConstInObjectLiteralImplementingAnInterface.js index 4ef71de6d3b..9bd8ca3a274 100644 --- a/tests/baselines/reference/overloadOnConstInObjectLiteralImplementingAnInterface.js +++ b/tests/baselines/reference/overloadOnConstInObjectLiteralImplementingAnInterface.js @@ -6,7 +6,4 @@ interface I { var i2: I = { x1: (a: number, cb: (x: 'hi') => number) => { } }; // error //// [overloadOnConstInObjectLiteralImplementingAnInterface.js] -var i2 = { - x1: function (a, cb) { - } -}; // error +var i2 = { x1: function (a, cb) { } }; // error diff --git a/tests/baselines/reference/overloadOnConstNoAnyImplementation.js b/tests/baselines/reference/overloadOnConstNoAnyImplementation.js index a17acae9354..0c2f330b5ed 100644 --- a/tests/baselines/reference/overloadOnConstNoAnyImplementation.js +++ b/tests/baselines/reference/overloadOnConstNoAnyImplementation.js @@ -24,13 +24,7 @@ function x1(a, cb) { cb('uh'); cb(1); // error } -var cb = function (x) { - return 1; -}; +var cb = function (x) { return 1; }; x1(1, cb); -x1(1, function (x) { - return 1; -}); // error -x1(1, function (x) { - return 1; -}); +x1(1, function (x) { return 1; }); // error +x1(1, function (x) { return 1; }); diff --git a/tests/baselines/reference/overloadOnConstNoAnyImplementation2.js b/tests/baselines/reference/overloadOnConstNoAnyImplementation2.js index 6c66c23f1f8..52f6639e352 100644 --- a/tests/baselines/reference/overloadOnConstNoAnyImplementation2.js +++ b/tests/baselines/reference/overloadOnConstNoAnyImplementation2.js @@ -35,15 +35,7 @@ var C = (function () { return C; })(); var c; -c.x1(1, function (x) { - return 1; -}); -c.x1(1, function (x) { - return 1; -}); -c.x1(1, function (x) { - return 1; -}); -c.x1(1, function (x) { - return 1; -}); +c.x1(1, function (x) { return 1; }); +c.x1(1, function (x) { return 1; }); +c.x1(1, function (x) { return 1; }); +c.x1(1, function (x) { return 1; }); diff --git a/tests/baselines/reference/overloadOnConstNoNonSpecializedSignature.js b/tests/baselines/reference/overloadOnConstNoNonSpecializedSignature.js index 33cc9c81b2c..980dfcb2145 100644 --- a/tests/baselines/reference/overloadOnConstNoNonSpecializedSignature.js +++ b/tests/baselines/reference/overloadOnConstNoNonSpecializedSignature.js @@ -9,7 +9,6 @@ class C { var C = (function () { function C() { } - C.prototype.x1 = function (a) { - }; + C.prototype.x1 = function (a) { }; return C; })(); diff --git a/tests/baselines/reference/overloadOnConstNoStringImplementation.js b/tests/baselines/reference/overloadOnConstNoStringImplementation.js index 1fbf18d854d..65fd6d07567 100644 --- a/tests/baselines/reference/overloadOnConstNoStringImplementation.js +++ b/tests/baselines/reference/overloadOnConstNoStringImplementation.js @@ -24,13 +24,7 @@ function x2(a, cb) { cb('uh'); cb(1); } -var cb = function (x) { - return 1; -}; +var cb = function (x) { return 1; }; x2(1, cb); // error -x2(1, function (x) { - return 1; -}); // error -x2(1, function (x) { - return 1; -}); +x2(1, function (x) { return 1; }); // error +x2(1, function (x) { return 1; }); diff --git a/tests/baselines/reference/overloadOnConstNoStringImplementation2.js b/tests/baselines/reference/overloadOnConstNoStringImplementation2.js index f51f84acb2a..71d7a4e4a3f 100644 --- a/tests/baselines/reference/overloadOnConstNoStringImplementation2.js +++ b/tests/baselines/reference/overloadOnConstNoStringImplementation2.js @@ -34,15 +34,7 @@ var C = (function () { return C; })(); var c; -c.x1(1, function (x) { - return 1; -}); -c.x1(1, function (x) { - return 1; -}); -c.x1(1, function (x) { - return 1; -}); -c.x1(1, function (x) { - return 1; -}); +c.x1(1, function (x) { return 1; }); +c.x1(1, function (x) { return 1; }); +c.x1(1, function (x) { return 1; }); +c.x1(1, function (x) { return 1; }); diff --git a/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js b/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js index f4037c3f668..cf9bc526b51 100644 --- a/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js +++ b/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js @@ -21,8 +21,7 @@ var __extends = this.__extends || function (d, b) { var Base = (function () { function Base() { } - Base.prototype.foo = function () { - }; + Base.prototype.foo = function () { }; return Base; })(); var Derived1 = (function (_super) { @@ -30,8 +29,7 @@ var Derived1 = (function (_super) { function Derived1() { _super.apply(this, arguments); } - Derived1.prototype.bar = function () { - }; + Derived1.prototype.bar = function () { }; return Derived1; })(Base); var Derived2 = (function (_super) { @@ -39,8 +37,7 @@ var Derived2 = (function (_super) { function Derived2() { _super.apply(this, arguments); } - Derived2.prototype.baz = function () { - }; + Derived2.prototype.baz = function () { }; return Derived2; })(Base); var Derived3 = (function (_super) { @@ -48,8 +45,7 @@ var Derived3 = (function (_super) { function Derived3() { _super.apply(this, arguments); } - Derived3.prototype.biz = function () { - }; + Derived3.prototype.biz = function () { }; return Derived3; })(Base); function foo(name) { diff --git a/tests/baselines/reference/overloadResolution.js b/tests/baselines/reference/overloadResolution.js index db042846c77..1ee5e077c08 100644 --- a/tests/baselines/reference/overloadResolution.js +++ b/tests/baselines/reference/overloadResolution.js @@ -127,16 +127,12 @@ var SomeDerived3 = (function (_super) { } return SomeDerived3; })(SomeBase); -function fn1() { - return null; -} +function fn1() { return null; } var s = fn1(undefined); var s; // No candidate overloads found fn1({}); // Error -function fn2() { - return undefined; -} +function fn2() { return undefined; } var d = fn2(0, undefined); var d; // Generic and non - generic overload where generic overload is the only candidate when called without type arguments @@ -145,9 +141,7 @@ var s = fn2(0, ''); fn2('', 0); // Error // Generic and non - generic overload where non - generic overload is the only candidate when called without type arguments fn2('', 0); // OK -function fn3() { - return null; -} +function fn3() { return null; } var s = fn3(3); var s = fn3('', 3, ''); var n = fn3(5, 5, 5); @@ -158,8 +152,7 @@ var s = fn3('', '', ''); var n = fn3('', '', 3); // Generic overloads with differing arity called with type argument count that doesn't match any overload fn3(); // Error -function fn4() { -} +function fn4() { } fn4('', 3); fn4(3, ''); // Error fn4('', 3); // Error @@ -174,12 +167,6 @@ fn4(null, null); // Error // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints fn4(true, null); // Error fn4(null, true); // Error -function fn5() { - return undefined; -} -var n = fn5(function (n) { - return n.toFixed(); -}); -var s = fn5(function (n) { - return n.substr(0); -}); +function fn5() { return undefined; } +var n = fn5(function (n) { return n.toFixed(); }); +var s = fn5(function (n) { return n.substr(0); }); diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.js b/tests/baselines/reference/overloadResolutionClassConstructors.js index 8b4e4316faf..2571a0e02db 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.js +++ b/tests/baselines/reference/overloadResolutionClassConstructors.js @@ -198,12 +198,6 @@ var fn5 = (function () { } return fn5; })(); -new fn5(function (n) { - return n.toFixed(); -}); -new fn5(function (n) { - return n.substr(0); -}); -new fn5(function (n) { - return n.blah; -}); // Error +new fn5(function (n) { return n.toFixed(); }); +new fn5(function (n) { return n.substr(0); }); +new fn5(function (n) { return n.blah; }); // Error diff --git a/tests/baselines/reference/overloadResolutionConstructors.js b/tests/baselines/reference/overloadResolutionConstructors.js index 39670160759..9e10215b1cb 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.js +++ b/tests/baselines/reference/overloadResolutionConstructors.js @@ -177,9 +177,5 @@ new fn4(null, null); // Error new fn4(true, null); // Error new fn4(null, true); // Error var fn5; -var n = new fn5(function (n) { - return n.toFixed(); -}); -var s = new fn5(function (n) { - return n.substr(0); -}); +var n = new fn5(function (n) { return n.toFixed(); }); +var s = new fn5(function (n) { return n.substr(0); }); diff --git a/tests/baselines/reference/overloadResolutionOverCTLambda.js b/tests/baselines/reference/overloadResolutionOverCTLambda.js index 84e8bb56ec7..18ad08c9c82 100644 --- a/tests/baselines/reference/overloadResolutionOverCTLambda.js +++ b/tests/baselines/reference/overloadResolutionOverCTLambda.js @@ -3,8 +3,5 @@ function foo(b: (item: number) => boolean) { } foo(a => a); // can not convert (number)=>bool to (number)=>number //// [overloadResolutionOverCTLambda.js] -function foo(b) { -} -foo(function (a) { - return a; -}); // can not convert (number)=>bool to (number)=>number +function foo(b) { } +foo(function (a) { return a; }); // can not convert (number)=>bool to (number)=>number diff --git a/tests/baselines/reference/overloadResolutionOverNonCTLambdas.js b/tests/baselines/reference/overloadResolutionOverNonCTLambdas.js index 86e84ced58f..170f2dd2137 100644 --- a/tests/baselines/reference/overloadResolutionOverNonCTLambdas.js +++ b/tests/baselines/reference/overloadResolutionOverNonCTLambdas.js @@ -43,18 +43,14 @@ var Bugs; rest[_i - 1] = arguments[_i]; } var index = rest[0]; - return typeof args[index] !== 'undefined' ? args[index] : match; + return typeof args[index] !== 'undefined' + ? args[index] + : match; }); return result; } })(Bugs || (Bugs = {})); -function bug3(f) { - return f("s"); -} -function fprime(x) { - return x; -} +function bug3(f) { return f("s"); } +function fprime(x) { return x; } bug3(fprime); -bug3(function (x) { - return x; -}); +bug3(function (x) { return x; }); diff --git a/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.js b/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.js index e2b11529c36..cf125bebbf5 100644 --- a/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.js +++ b/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.js @@ -26,17 +26,7 @@ var Bugs; (function (Bugs) { function bug3() { var tokens = []; - tokens.push({ - startIndex: 1, - type: '', - bracket: 3 - }); - tokens.push(({ - startIndex: 1, - type: '', - bracket: 3, - state: null, - length: 10 - })); + tokens.push({ startIndex: 1, type: '', bracket: 3 }); + tokens.push(({ startIndex: 1, type: '', bracket: 3, state: null, length: 10 })); } })(Bugs || (Bugs = {})); diff --git a/tests/baselines/reference/overloadResolutionTest1.js b/tests/baselines/reference/overloadResolutionTest1.js index 2d813e6effe..60b99ebf7b9 100644 --- a/tests/baselines/reference/overloadResolutionTest1.js +++ b/tests/baselines/reference/overloadResolutionTest1.js @@ -26,47 +26,17 @@ function foo4(bar:{a:any;}):any{ return bar }; var x = foo4({a:true}); // error //// [overloadResolutionTest1.js] -function foo(bar) { - return bar; -} +function foo(bar) { return bar; } ; -var x1 = foo([ - { - a: true - } -]); // works -var x11 = foo([ - { - a: 0 - } -]); // works -var x111 = foo([ - { - a: "s" - } -]); // error - does not match any signature -var x1111 = foo([ - { - a: null - } -]); // works - ambiguous call is resolved to be the first in the overload set so this returns a string -function foo2(bar) { - return bar; -} +var x1 = foo([{ a: true }]); // works +var x11 = foo([{ a: 0 }]); // works +var x111 = foo([{ a: "s" }]); // error - does not match any signature +var x1111 = foo([{ a: null }]); // works - ambiguous call is resolved to be the first in the overload set so this returns a string +function foo2(bar) { return bar; } ; -var x2 = foo2({ - a: 0 -}); // works -var x3 = foo2({ - a: true -}); // works -var x4 = foo2({ - a: "s" -}); // error -function foo4(bar) { - return bar; -} +var x2 = foo2({ a: 0 }); // works +var x3 = foo2({ a: true }); // works +var x4 = foo2({ a: "s" }); // error +function foo4(bar) { return bar; } ; -var x = foo4({ - a: true -}); // error +var x = foo4({ a: true }); // error diff --git a/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.js b/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.js index 0a1a87091c1..03063855267 100644 --- a/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.js +++ b/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.js @@ -7,11 +7,6 @@ x2((x) => 1 ); //// [overloadWithCallbacksWithDifferingOptionalityOnArgs.js] -function x2(callback) { -} -x2(function () { - return 1; -}); -x2(function (x) { - return 1; -}); +function x2(callback) { } +x2(function () { return 1; }); +x2(function (x) { return 1; }); diff --git a/tests/baselines/reference/overloadingOnConstants1.js b/tests/baselines/reference/overloadingOnConstants1.js index e325e7ad8c0..7ebeeb2890f 100644 --- a/tests/baselines/reference/overloadingOnConstants1.js +++ b/tests/baselines/reference/overloadingOnConstants1.js @@ -35,8 +35,7 @@ var __extends = this.__extends || function (d, b) { var Base = (function () { function Base() { } - Base.prototype.foo = function () { - }; + Base.prototype.foo = function () { }; return Base; })(); var Derived1 = (function (_super) { @@ -44,8 +43,7 @@ var Derived1 = (function (_super) { function Derived1() { _super.apply(this, arguments); } - Derived1.prototype.bar = function () { - }; + Derived1.prototype.bar = function () { }; return Derived1; })(Base); var Derived2 = (function (_super) { @@ -53,8 +51,7 @@ var Derived2 = (function (_super) { function Derived2() { _super.apply(this, arguments); } - Derived2.prototype.baz = function () { - }; + Derived2.prototype.baz = function () { }; return Derived2; })(Base); var Derived3 = (function (_super) { @@ -62,8 +59,7 @@ var Derived3 = (function (_super) { function Derived3() { _super.apply(this, arguments); } - Derived3.prototype.biz = function () { - }; + Derived3.prototype.biz = function () { }; return Derived3; })(Base); var d2; diff --git a/tests/baselines/reference/overloadingStaticFunctionsInFunctions.js b/tests/baselines/reference/overloadingStaticFunctionsInFunctions.js index 7e926a6250a..591826725b1 100644 --- a/tests/baselines/reference/overloadingStaticFunctionsInFunctions.js +++ b/tests/baselines/reference/overloadingStaticFunctionsInFunctions.js @@ -10,6 +10,5 @@ function boo() { test(); test(name, string); test(name ? : any); - { - } + { } } diff --git a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.js b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.js index 1eff021f569..63b4a2b1e93 100644 --- a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.js +++ b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.js @@ -28,12 +28,8 @@ var G = (function () { } return G; })(); -var result = foo(function (x) { - return new G(x); -}); // x has type D, new G(x) fails, so first overload is picked. -var result2 = foo(function (x) { - return new G(x); -}); // x has type D, new G(x) fails, so first overload is picked. +var result = foo(function (x) { return new G(x); }); // x has type D, new G(x) fails, so first overload is picked. +var result2 = foo(function (x) { return new G(x); }); // x has type D, new G(x) fails, so first overload is picked. var result3 = foo(function (x) { var y; // error that D does not satisfy constraint, y is of type G, entire call to foo is an error return y; diff --git a/tests/baselines/reference/overloadsInDifferentContainersDisagreeOnAmbient.js b/tests/baselines/reference/overloadsInDifferentContainersDisagreeOnAmbient.js index 4d0ac15c717..42c371dd218 100644 --- a/tests/baselines/reference/overloadsInDifferentContainersDisagreeOnAmbient.js +++ b/tests/baselines/reference/overloadsInDifferentContainersDisagreeOnAmbient.js @@ -11,7 +11,6 @@ module M { //// [overloadsInDifferentContainersDisagreeOnAmbient.js] var M; (function (M) { - function f() { - } + function f() { } M.f = f; })(M || (M = {})); diff --git a/tests/baselines/reference/overloadsWithProvisionalErrors.js b/tests/baselines/reference/overloadsWithProvisionalErrors.js index f684f1b12a9..c7fb4785d09 100644 --- a/tests/baselines/reference/overloadsWithProvisionalErrors.js +++ b/tests/baselines/reference/overloadsWithProvisionalErrors.js @@ -10,17 +10,6 @@ func(s => ({ a: blah })); // Two errors here, one for blah not being defined, an //// [overloadsWithProvisionalErrors.js] var func; -func(function (s) { - return ({}); -}); // Error for no applicable overload (object type is missing a and b) -func(function (s) { - return ({ - a: blah, - b: 3 - }); -}); // Only error inside the function, but not outside (since it would be applicable if not for the provisional error) -func(function (s) { - return ({ - a: blah - }); -}); // Two errors here, one for blah not being defined, and one for the overload since it would not be applicable anyway +func(function (s) { return ({}); }); // Error for no applicable overload (object type is missing a and b) +func(function (s) { return ({ a: blah, b: 3 }); }); // Only error inside the function, but not outside (since it would be applicable if not for the provisional error) +func(function (s) { return ({ a: blah }); }); // Two errors here, one for blah not being defined, and one for the overload since it would not be applicable anyway diff --git a/tests/baselines/reference/overloadsWithinClasses.js b/tests/baselines/reference/overloadsWithinClasses.js index 79f3c332be5..4ac612502c7 100644 --- a/tests/baselines/reference/overloadsWithinClasses.js +++ b/tests/baselines/reference/overloadsWithinClasses.js @@ -27,17 +27,14 @@ class X { var foo = (function () { function foo() { } - foo.fnOverload = function () { - }; - foo.fnOverload = function (foo) { - }; // error + foo.fnOverload = function () { }; + foo.fnOverload = function (foo) { }; // error return foo; })(); var bar = (function () { function bar() { } - bar.fnOverload = function (foo) { - }; // no error + bar.fnOverload = function (foo) { }; // no error return bar; })(); var X = (function () { diff --git a/tests/baselines/reference/parameterInitializersForwardReferencing.js b/tests/baselines/reference/parameterInitializersForwardReferencing.js index 61b116980ae..188a104f3af 100644 --- a/tests/baselines/reference/parameterInitializersForwardReferencing.js +++ b/tests/baselines/reference/parameterInitializersForwardReferencing.js @@ -74,17 +74,11 @@ function outside() { } } function defaultArgFunction(a, b) { - if (a === void 0) { a = function () { - return b; - }; } + if (a === void 0) { a = function () { return b; }; } if (b === void 0) { b = 1; } } function defaultArgArrow(a, b) { - if (a === void 0) { a = function () { - return function () { - return b; - }; - }; } + if (a === void 0) { a = function () { return function () { return b; }; }; } if (b === void 0) { b = 3; } } var C = (function () { @@ -107,8 +101,6 @@ var x = function (a, b, c) { }; // Should not produce errors - can reference later parameters if they occur within a function expression initializer. function f(a, b, c) { - if (b === void 0) { b = function () { - return c; - }; } + if (b === void 0) { b = function () { return c; }; } if (c === void 0) { c = b(); } } diff --git a/tests/baselines/reference/parametersWithNoAnnotationAreAny.js b/tests/baselines/reference/parametersWithNoAnnotationAreAny.js index d0b48460649..a8d06125d25 100644 --- a/tests/baselines/reference/parametersWithNoAnnotationAreAny.js +++ b/tests/baselines/reference/parametersWithNoAnnotationAreAny.js @@ -30,18 +30,10 @@ var b = { } //// [parametersWithNoAnnotationAreAny.js] -function foo(x) { - return x; -} -var f = function foo(x) { - return x; -}; -var f2 = function (x) { - return x; -}; -var f3 = function (x) { - return x; -}; +function foo(x) { return x; } +var f = function foo(x) { return x; }; +var f2 = function (x) { return x; }; +var f3 = function (x) { return x; }; var C = (function () { function C() { } @@ -58,7 +50,5 @@ var b = { a: function foo(x) { return x; }, - b: function (x) { - return x; - } + b: function (x) { return x; } }; diff --git a/tests/baselines/reference/parenthesizedContexualTyping1.js b/tests/baselines/reference/parenthesizedContexualTyping1.js index cd3a2937395..2f1e9ff62fc 100644 --- a/tests/baselines/reference/parenthesizedContexualTyping1.js +++ b/tests/baselines/reference/parenthesizedContexualTyping1.js @@ -33,82 +33,20 @@ var obj2: ObjType = ({ x: x => (x, undefined), y: y => (y, undefined) }); function fun(g, x) { return g(x); } -var a = fun(function (x) { - return x; -}, 10); -var b = fun((function (x) { - return x; -}), 10); -var c = fun(((function (x) { - return x; -})), 10); -var d = fun((((function (x) { - return x; -}))), 10); -var e = fun(function (x) { - return x; -}, function (x) { - return x; -}, 10); -var f = fun((function (x) { - return x; -}), (function (x) { - return x; -}), 10); -var g = fun(((function (x) { - return x; -})), ((function (x) { - return x; -})), 10); -var h = fun((((function (x) { - return x; -}))), ((function (x) { - return x; -})), 10); +var a = fun(function (x) { return x; }, 10); +var b = fun((function (x) { return x; }), 10); +var c = fun(((function (x) { return x; })), 10); +var d = fun((((function (x) { return x; }))), 10); +var e = fun(function (x) { return x; }, function (x) { return x; }, 10); +var f = fun((function (x) { return x; }), (function (x) { return x; }), 10); +var g = fun(((function (x) { return x; })), ((function (x) { return x; })), 10); +var h = fun((((function (x) { return x; }))), ((function (x) { return x; })), 10); // Ternaries in parens -var i = fun((Math.random() < 0.5 ? function (x) { - return x; -} : function (x) { - return undefined; -}), 10); -var j = fun((Math.random() < 0.5 ? (function (x) { - return x; -}) : (function (x) { - return undefined; -})), 10); -var k = fun((Math.random() < 0.5 ? (function (x) { - return x; -}) : (function (x) { - return undefined; -})), function (x) { - return x; -}, 10); -var l = fun(((Math.random() < 0.5 ? ((function (x) { - return x; -})) : ((function (x) { - return undefined; -})))), ((function (x) { - return x; -})), 10); -var lambda1 = function (x) { - return x; -}; -var lambda2 = (function (x) { - return x; -}); -var obj1 = { - x: function (x) { - return (x, undefined); - }, - y: function (y) { - return (y, undefined); - } -}; -var obj2 = ({ - x: function (x) { - return (x, undefined); - }, - y: function (y) { - return (y, undefined); - } -}); +var i = fun((Math.random() < 0.5 ? function (x) { return x; } : function (x) { return undefined; }), 10); +var j = fun((Math.random() < 0.5 ? (function (x) { return x; }) : (function (x) { return undefined; })), 10); +var k = fun((Math.random() < 0.5 ? (function (x) { return x; }) : (function (x) { return undefined; })), function (x) { return x; }, 10); +var l = fun(((Math.random() < 0.5 ? ((function (x) { return x; })) : ((function (x) { return undefined; })))), ((function (x) { return x; })), 10); +var lambda1 = function (x) { return x; }; +var lambda2 = (function (x) { return x; }); +var obj1 = { x: function (x) { return (x, undefined); }, y: function (y) { return (y, undefined); } }; +var obj2 = ({ x: function (x) { return (x, undefined); }, y: function (y) { return (y, undefined); } }); diff --git a/tests/baselines/reference/parenthesizedContexualTyping2.js b/tests/baselines/reference/parenthesizedContexualTyping2.js index 68aa28386e9..993a10ba49c 100644 --- a/tests/baselines/reference/parenthesizedContexualTyping2.js +++ b/tests/baselines/reference/parenthesizedContexualTyping2.js @@ -49,102 +49,20 @@ function fun() { } return undefined; } -var a = fun(function (x) { - x(undefined); - return x; -}, 10); -var b = fun((function (x) { - x(undefined); - return x; -}), 10); -var c = fun(((function (x) { - x(undefined); - return x; -})), 10); -var d = fun((((function (x) { - x(undefined); - return x; -}))), 10); -var e = fun(function (x) { - x(undefined); - return x; -}, function (x) { - x(undefined); - return x; -}, 10); -var f = fun((function (x) { - x(undefined); - return x; -}), (function (x) { - x(undefined); - return x; -}), 10); -var g = fun(((function (x) { - x(undefined); - return x; -})), ((function (x) { - x(undefined); - return x; -})), 10); -var h = fun((((function (x) { - x(undefined); - return x; -}))), ((function (x) { - x(undefined); - return x; -})), 10); +var a = fun(function (x) { x(undefined); return x; }, 10); +var b = fun((function (x) { x(undefined); return x; }), 10); +var c = fun(((function (x) { x(undefined); return x; })), 10); +var d = fun((((function (x) { x(undefined); return x; }))), 10); +var e = fun(function (x) { x(undefined); return x; }, function (x) { x(undefined); return x; }, 10); +var f = fun((function (x) { x(undefined); return x; }), (function (x) { x(undefined); return x; }), 10); +var g = fun(((function (x) { x(undefined); return x; })), ((function (x) { x(undefined); return x; })), 10); +var h = fun((((function (x) { x(undefined); return x; }))), ((function (x) { x(undefined); return x; })), 10); // Ternaries in parens -var i = fun((Math.random() < 0.5 ? function (x) { - x(undefined); - return x; -} : function (x) { - return undefined; -}), 10); -var j = fun((Math.random() < 0.5 ? (function (x) { - x(undefined); - return x; -}) : (function (x) { - return undefined; -})), 10); -var k = fun((Math.random() < 0.5 ? (function (x) { - x(undefined); - return x; -}) : (function (x) { - return undefined; -})), function (x) { - x(undefined); - return x; -}, 10); -var l = fun(((Math.random() < 0.5 ? ((function (x) { - x(undefined); - return x; -})) : ((function (x) { - return undefined; -})))), ((function (x) { - x(undefined); - return x; -})), 10); -var lambda1 = function (x) { - x(undefined); - return x; -}; -var lambda2 = (function (x) { - x(undefined); - return x; -}); -var obj1 = { - x: function (x) { - return (x, undefined); - }, - y: function (y) { - return (y, undefined); - } -}; -var obj2 = ({ - x: function (x) { - return (x, undefined); - }, - y: function (y) { - return (y, undefined); - } -}); +var i = fun((Math.random() < 0.5 ? function (x) { x(undefined); return x; } : function (x) { return undefined; }), 10); +var j = fun((Math.random() < 0.5 ? (function (x) { x(undefined); return x; }) : (function (x) { return undefined; })), 10); +var k = fun((Math.random() < 0.5 ? (function (x) { x(undefined); return x; }) : (function (x) { return undefined; })), function (x) { x(undefined); return x; }, 10); +var l = fun(((Math.random() < 0.5 ? ((function (x) { x(undefined); return x; })) : ((function (x) { return undefined; })))), ((function (x) { x(undefined); return x; })), 10); +var lambda1 = function (x) { x(undefined); return x; }; +var lambda2 = (function (x) { x(undefined); return x; }); +var obj1 = { x: function (x) { return (x, undefined); }, y: function (y) { return (y, undefined); } }; +var obj2 = ({ x: function (x) { return (x, undefined); }, y: function (y) { return (y, undefined); } }); diff --git a/tests/baselines/reference/parse1.js b/tests/baselines/reference/parse1.js index 08af81bda17..4804e31adcd 100644 --- a/tests/baselines/reference/parse1.js +++ b/tests/baselines/reference/parse1.js @@ -8,5 +8,6 @@ function foo() { //// [parse1.js] var bar = 42; function foo() { - bar.; + bar. + ; } diff --git a/tests/baselines/reference/parseClassDeclarationInStrictModeByDefaultInES6.errors.txt b/tests/baselines/reference/parseClassDeclarationInStrictModeByDefaultInES6.errors.txt index d109b048085..e1b0bb34529 100644 --- a/tests/baselines/reference/parseClassDeclarationInStrictModeByDefaultInES6.errors.txt +++ b/tests/baselines/reference/parseClassDeclarationInStrictModeByDefaultInES6.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(4,16): error TS1100: Invalid use of 'arguments' in strict mode. -tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(5,17): error TS1100: Invalid use of 'eval' in strict mode. -tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(6,9): error TS1100: Invalid use of 'arguments' in strict mode. +tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(4,16): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(5,17): error TS1210: Invalid use of 'eval'. Class definitions are automatically in strict mode. +tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(6,9): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(6,9): error TS2322: Type 'string' is not assignable to type 'IArguments'. Property 'callee' is missing in type 'String'. @@ -11,13 +11,13 @@ tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeBy public implements() { } public foo(arguments: any) { } ~~~~~~~~~ -!!! error TS1100: Invalid use of 'arguments' in strict mode. +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. private bar(eval:any) { ~~~~ -!!! error TS1100: Invalid use of 'eval' in strict mode. +!!! error TS1210: Invalid use of 'eval'. Class definitions are automatically in strict mode. arguments = "hello"; ~~~~~~~~~ -!!! error TS1100: Invalid use of 'arguments' in strict mode. +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. ~~~~~~~~~ !!! error TS2322: Type 'string' is not assignable to type 'IArguments'. !!! error TS2322: Property 'callee' is missing in type 'String'. diff --git a/tests/baselines/reference/parseClassDeclarationInStrictModeByDefaultInES6.js b/tests/baselines/reference/parseClassDeclarationInStrictModeByDefaultInES6.js index 2a8d75dde60..4a80f478b49 100644 --- a/tests/baselines/reference/parseClassDeclarationInStrictModeByDefaultInES6.js +++ b/tests/baselines/reference/parseClassDeclarationInStrictModeByDefaultInES6.js @@ -13,10 +13,8 @@ class C { constructor() { this.interface = 10; } - implements() { - } - foo(arguments) { - } + implements() { } + foo(arguments) { } bar(eval) { arguments = "hello"; } diff --git a/tests/baselines/reference/parseTypes.js b/tests/baselines/reference/parseTypes.js index 193533de04a..08cc9f2a6bd 100644 --- a/tests/baselines/reference/parseTypes.js +++ b/tests/baselines/reference/parseTypes.js @@ -18,13 +18,9 @@ var x = null; var y = null; var z = null; var w = null; -function f() { - return 3; -} +function f() { return 3; } ; -function g(s) { - true; -} +function g(s) { true; } ; y = f; y = g; diff --git a/tests/baselines/reference/parser0_004152.errors.txt b/tests/baselines/reference/parser0_004152.errors.txt index 97b9bfe34a6..43a8945ffea 100644 --- a/tests/baselines/reference/parser0_004152.errors.txt +++ b/tests/baselines/reference/parser0_004152.errors.txt @@ -32,11 +32,10 @@ tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,86): error T tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,94): error TS1005: ';' expected. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,96): error TS2300: Duplicate identifier '0'. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,97): error TS1005: ';' expected. -tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,98): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(3,25): error TS2304: Cannot find name 'SeedCoords'. -==== tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts (36 errors) ==== +==== 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. @@ -107,8 +106,6 @@ tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(3,25): error T !!! error TS2300: Duplicate identifier '0'. ~ !!! error TS1005: ';' expected. - ~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. private prevConfig: SeedCoords[][]; ~~~~~~~~~~ !!! error TS2304: Cannot find name 'SeedCoords'. diff --git a/tests/baselines/reference/parser0_004152.js b/tests/baselines/reference/parser0_004152.js index cce49f68fcc..cd6a20742a8 100644 --- a/tests/baselines/reference/parser0_004152.js +++ b/tests/baselines/reference/parser0_004152.js @@ -9,6 +9,7 @@ var Game = (function () { function Game() { this.position = new DisplayPosition([]); } + ; return Game; })(); exports.Game = Game; diff --git a/tests/baselines/reference/parser15.4.4.14-9-2.js b/tests/baselines/reference/parser15.4.4.14-9-2.js index e9a29e7eead..0f533cd9a26 100644 --- a/tests/baselines/reference/parser15.4.4.14-9-2.js +++ b/tests/baselines/reference/parser15.4.4.14-9-2.js @@ -37,15 +37,14 @@ runTestCase(testcase); * @description Array.prototype.indexOf must return correct index (Number) */ function testcase() { - var obj = { - toString: function () { - return 0; - } - }; + var obj = { toString: function () { return 0; } }; var one = 1; var _float = -(4 / 3); var a = new Array(false, undefined, null, "0", obj, -1.3333333333333, "str", -0, true, +0, one, 1, 0, false, _float, -(4 / 3)); - if (a.indexOf(-(4 / 3)) === 14 && a.indexOf(0) === 7 && a.indexOf(-0) === 7 && a.indexOf(1) === 10) { + if (a.indexOf(-(4 / 3)) === 14 && + a.indexOf(0) === 7 && + a.indexOf(-0) === 7 && + a.indexOf(1) === 10) { return true; } } diff --git a/tests/baselines/reference/parser509667.js b/tests/baselines/reference/parser509667.js index 21e0bc55ce4..0938613b295 100644 --- a/tests/baselines/reference/parser509667.js +++ b/tests/baselines/reference/parser509667.js @@ -16,7 +16,8 @@ var Foo = (function () { function Foo() { } Foo.prototype.f1 = function () { - if (this.) + if (this. + ) ; }; Foo.prototype.f2 = function () { diff --git a/tests/baselines/reference/parser509668.errors.txt b/tests/baselines/reference/parser509668.errors.txt index 5ea380592ef..588bda6d91c 100644 --- a/tests/baselines/reference/parser509668.errors.txt +++ b/tests/baselines/reference/parser509668.errors.txt @@ -1,10 +1,13 @@ +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509668.ts(3,16): error TS1003: Identifier expected. tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509668.ts(3,23): error TS1005: ',' expected. -==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509668.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509668.ts (2 errors) ==== class Foo3 { // Doesn't work, but should constructor (public ...args: string[]) { } + ~~~~~~ +!!! error TS1003: Identifier expected. ~~~ !!! error TS1005: ',' expected. } \ No newline at end of file diff --git a/tests/baselines/reference/parser509668.js b/tests/baselines/reference/parser509668.js index 63c5d8a1a95..a64c9c7b5b0 100644 --- a/tests/baselines/reference/parser509668.js +++ b/tests/baselines/reference/parser509668.js @@ -7,7 +7,7 @@ class Foo3 { //// [parser509668.js] var Foo3 = (function () { // Doesn't work, but should - function Foo3(public) { + function Foo3() { var args = []; for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i]; diff --git a/tests/baselines/reference/parser509669.js b/tests/baselines/reference/parser509669.js index e4ce2b90312..3fa4cf696c0 100644 --- a/tests/baselines/reference/parser509669.js +++ b/tests/baselines/reference/parser509669.js @@ -5,6 +5,5 @@ function foo():any { //// [parser509669.js] function foo() { - return function () { - }; + return function () { }; } diff --git a/tests/baselines/reference/parser512097.js b/tests/baselines/reference/parser512097.js index c495e68c847..ce73dadf3bc 100644 --- a/tests/baselines/reference/parser512097.js +++ b/tests/baselines/reference/parser512097.js @@ -5,8 +5,6 @@ if (true) { } //// [parser512097.js] -var tt = { - aa: -}; // After this point, no useful parsing occurs in the entire file +var tt = { aa: }; // After this point, no useful parsing occurs in the entire file if (true) { } diff --git a/tests/baselines/reference/parser521128.js b/tests/baselines/reference/parser521128.js index e16cbad6c33..2471f740d77 100644 --- a/tests/baselines/reference/parser521128.js +++ b/tests/baselines/reference/parser521128.js @@ -3,5 +3,4 @@ module.module { } //// [parser521128.js] module.module; -{ -} +{ } diff --git a/tests/baselines/reference/parser536727.js b/tests/baselines/reference/parser536727.js index 39b0d66f6c8..fe086d8d3be 100644 --- a/tests/baselines/reference/parser536727.js +++ b/tests/baselines/reference/parser536727.js @@ -13,14 +13,8 @@ foo(x); function foo(f) { return f(""); } -var g = function (x) { - return x + "blah"; -}; -var x = function () { - return g; -}; +var g = function (x) { return x + "blah"; }; +var x = function () { return g; }; foo(g); -foo(function () { - return g; -}); +foo(function () { return g; }); foo(x); diff --git a/tests/baselines/reference/parser553699.errors.txt b/tests/baselines/reference/parser553699.errors.txt index 5a0b9e2fba9..84bc6e60707 100644 --- a/tests/baselines/reference/parser553699.errors.txt +++ b/tests/baselines/reference/parser553699.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/RegressionTests/parser553699.ts(3,21): error TS2304: Cannot find name 'public'. +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser553699.ts(3,21): error TS1110: Type expected. ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser553699.ts (1 errors) ==== @@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser553699.ts(3,21) constructor() { } public banana (x: public) { } ~~~~~~ -!!! error TS2304: Cannot find name 'public'. +!!! error TS1110: Type expected. } class Bar { diff --git a/tests/baselines/reference/parser553699.js b/tests/baselines/reference/parser553699.js index f245ecc3446..c4cc51bf5af 100644 --- a/tests/baselines/reference/parser553699.js +++ b/tests/baselines/reference/parser553699.js @@ -12,8 +12,7 @@ class Bar { var Foo = (function () { function Foo() { } - Foo.prototype.banana = function (x) { - }; + Foo.prototype.banana = function (x, ) { }; return Foo; })(); var Bar = (function () { diff --git a/tests/baselines/reference/parser642331.errors.txt b/tests/baselines/reference/parser642331.errors.txt new file mode 100644 index 00000000000..fad38e66513 --- /dev/null +++ b/tests/baselines/reference/parser642331.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser642331.ts(2,18): error TS1003: Identifier expected. + + +==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser642331.ts (1 errors) ==== + class test { + constructor (static) { } + ~~~~~~ +!!! error TS1003: Identifier expected. + } + \ No newline at end of file diff --git a/tests/baselines/reference/parser642331.js b/tests/baselines/reference/parser642331.js index 056ea7dd384..3d88c096af3 100644 --- a/tests/baselines/reference/parser642331.js +++ b/tests/baselines/reference/parser642331.js @@ -6,7 +6,7 @@ class test { //// [parser642331.js] var test = (function () { - function test(static) { + function test() { } return test; })(); diff --git a/tests/baselines/reference/parser642331.types b/tests/baselines/reference/parser642331.types deleted file mode 100644 index 19cd40b76b8..00000000000 --- a/tests/baselines/reference/parser642331.types +++ /dev/null @@ -1,8 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser642331.ts === -class test { ->test : test - - constructor (static) { } ->static : any -} - diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic10.js b/tests/baselines/reference/parserAccessibilityAfterStatic10.js index feded66fe95..6756a57ce7e 100644 --- a/tests/baselines/reference/parserAccessibilityAfterStatic10.js +++ b/tests/baselines/reference/parserAccessibilityAfterStatic10.js @@ -9,7 +9,6 @@ static public intI() {} var Outer = (function () { function Outer() { } - Outer.intI = function () { - }; + Outer.intI = function () { }; return Outer; })(); diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic11.js b/tests/baselines/reference/parserAccessibilityAfterStatic11.js index 094202014a1..8b16153b797 100644 --- a/tests/baselines/reference/parserAccessibilityAfterStatic11.js +++ b/tests/baselines/reference/parserAccessibilityAfterStatic11.js @@ -9,7 +9,6 @@ static public() {} var Outer = (function () { function Outer() { } - Outer.public = function () { - }; + Outer.public = function () { }; return Outer; })(); diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic14.js b/tests/baselines/reference/parserAccessibilityAfterStatic14.js index b2a6be7464c..4455936a859 100644 --- a/tests/baselines/reference/parserAccessibilityAfterStatic14.js +++ b/tests/baselines/reference/parserAccessibilityAfterStatic14.js @@ -9,7 +9,6 @@ static public() {} var Outer = (function () { function Outer() { } - Outer.public = function () { - }; + Outer.public = function () { }; return Outer; })(); diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic7.js b/tests/baselines/reference/parserAccessibilityAfterStatic7.js index a2bc5c7fba3..2d94be8ea50 100644 --- a/tests/baselines/reference/parserAccessibilityAfterStatic7.js +++ b/tests/baselines/reference/parserAccessibilityAfterStatic7.js @@ -9,7 +9,6 @@ static public intI() {} var Outer = (function () { function Outer() { } - Outer.intI = function () { - }; + Outer.intI = function () { }; return Outer; })(); diff --git a/tests/baselines/reference/parserAccessors1.js b/tests/baselines/reference/parserAccessors1.js index b4cc809e7b2..6b47a46ede1 100644 --- a/tests/baselines/reference/parserAccessors1.js +++ b/tests/baselines/reference/parserAccessors1.js @@ -8,8 +8,7 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { - get: function () { - }, + get: function () { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/parserAccessors10.js b/tests/baselines/reference/parserAccessors10.js index f1bed41edee..d5d7e89a7d0 100644 --- a/tests/baselines/reference/parserAccessors10.js +++ b/tests/baselines/reference/parserAccessors10.js @@ -5,6 +5,5 @@ var v = { //// [parserAccessors10.js] var v = { - get foo() { - } + get foo() { } }; diff --git a/tests/baselines/reference/parserAccessors2.js b/tests/baselines/reference/parserAccessors2.js index 71cbd6f466b..482daa74a64 100644 --- a/tests/baselines/reference/parserAccessors2.js +++ b/tests/baselines/reference/parserAccessors2.js @@ -8,8 +8,7 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { - set: function (a) { - }, + set: function (a) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/parserAccessors3.js b/tests/baselines/reference/parserAccessors3.js index f5f9c43fb4f..287f607725a 100644 --- a/tests/baselines/reference/parserAccessors3.js +++ b/tests/baselines/reference/parserAccessors3.js @@ -2,7 +2,4 @@ var v = { get Foo() { } }; //// [parserAccessors3.js] -var v = { - get Foo() { - } -}; +var v = { get Foo() { } }; diff --git a/tests/baselines/reference/parserAccessors4.js b/tests/baselines/reference/parserAccessors4.js index 24ee1bbcdcd..0716078a8c8 100644 --- a/tests/baselines/reference/parserAccessors4.js +++ b/tests/baselines/reference/parserAccessors4.js @@ -2,7 +2,4 @@ var v = { set Foo(a) { } }; //// [parserAccessors4.js] -var v = { - set Foo(a) { - } -}; +var v = { set Foo(a) { } }; diff --git a/tests/baselines/reference/parserAccessors7.js b/tests/baselines/reference/parserAccessors7.js index be3802979b6..4b7f2d55860 100644 --- a/tests/baselines/reference/parserAccessors7.js +++ b/tests/baselines/reference/parserAccessors7.js @@ -2,7 +2,4 @@ var v = { get foo(v: number) { } }; //// [parserAccessors7.js] -var v = { - get foo(v) { - } -}; +var v = { get foo(v) { } }; diff --git a/tests/baselines/reference/parserAccessors8.js b/tests/baselines/reference/parserAccessors8.js index 3bb926521e9..18fb4454071 100644 --- a/tests/baselines/reference/parserAccessors8.js +++ b/tests/baselines/reference/parserAccessors8.js @@ -2,7 +2,4 @@ var v = { set foo() { } } //// [parserAccessors8.js] -var v = { - set foo() { - } -}; +var v = { set foo() { } }; diff --git a/tests/baselines/reference/parserAccessors9.js b/tests/baselines/reference/parserAccessors9.js index ad52d9827b3..448d93a2c01 100644 --- a/tests/baselines/reference/parserAccessors9.js +++ b/tests/baselines/reference/parserAccessors9.js @@ -2,7 +2,4 @@ var v = { set foo(a, b) { } } //// [parserAccessors9.js] -var v = { - set foo(a, b) { - } -}; +var v = { set foo(a, b) { } }; diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.js b/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.js index 18a1dee3e9f..6c74814917a 100644 --- a/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.js +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.js @@ -7,6 +7,5 @@ function f1() { //// [parserAmbiguityWithBinaryOperator1.js] function f1() { var a, b, c; - if (a < b || b > (c + 1)) { - } + if (a < b || b > (c + 1)) { } } diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.js b/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.js index 9589d57e3af..6cd6de58d47 100644 --- a/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.js +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.js @@ -7,6 +7,5 @@ function f() { //// [parserAmbiguityWithBinaryOperator2.js] function f() { var a, b, c; - if (a < b && b > (c + 1)) { - } + if (a < b && b > (c + 1)) { } } diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.js b/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.js index 95745263c71..e3df2894777 100644 --- a/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.js +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.js @@ -8,6 +8,5 @@ function f() { //// [parserAmbiguityWithBinaryOperator3.js] function f() { var a, b, c; - if (a < b && b < (c + 1)) { - } + if (a < b && b < (c + 1)) { } } diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator4.js b/tests/baselines/reference/parserAmbiguityWithBinaryOperator4.js index cdcec030ae7..a6ba380112b 100644 --- a/tests/baselines/reference/parserAmbiguityWithBinaryOperator4.js +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator4.js @@ -7,6 +7,5 @@ function g() { //// [parserAmbiguityWithBinaryOperator4.js] function g() { var a, b, c; - if (a(c + 1)) { - } + if (a(c + 1)) { } } diff --git a/tests/baselines/reference/parserArrayLiteralExpression10.js b/tests/baselines/reference/parserArrayLiteralExpression10.js index 5f49958b862..986d3045dc0 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression10.js +++ b/tests/baselines/reference/parserArrayLiteralExpression10.js @@ -2,7 +2,4 @@ var v = [1,1,]; //// [parserArrayLiteralExpression10.js] -var v = [ - 1, - 1, -]; +var v = [1, 1,]; diff --git a/tests/baselines/reference/parserArrayLiteralExpression11.js b/tests/baselines/reference/parserArrayLiteralExpression11.js index 79b4bf35182..24ab8968fea 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression11.js +++ b/tests/baselines/reference/parserArrayLiteralExpression11.js @@ -2,8 +2,4 @@ var v = [1,,1]; //// [parserArrayLiteralExpression11.js] -var v = [ - 1, - , - 1 -]; +var v = [1, , 1]; diff --git a/tests/baselines/reference/parserArrayLiteralExpression12.js b/tests/baselines/reference/parserArrayLiteralExpression12.js index 1ad1bc40121..6795ef29908 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression12.js +++ b/tests/baselines/reference/parserArrayLiteralExpression12.js @@ -2,9 +2,4 @@ var v = [1,,,1]; //// [parserArrayLiteralExpression12.js] -var v = [ - 1, - , - , - 1 -]; +var v = [1, , , 1]; diff --git a/tests/baselines/reference/parserArrayLiteralExpression13.js b/tests/baselines/reference/parserArrayLiteralExpression13.js index 78b08548288..504663e5ced 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression13.js +++ b/tests/baselines/reference/parserArrayLiteralExpression13.js @@ -2,10 +2,4 @@ var v = [1,,1,,1]; //// [parserArrayLiteralExpression13.js] -var v = [ - 1, - , - 1, - , - 1 -]; +var v = [1, , 1, , 1]; diff --git a/tests/baselines/reference/parserArrayLiteralExpression14.js b/tests/baselines/reference/parserArrayLiteralExpression14.js index 188b9e734ff..eeb13dc53a5 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression14.js +++ b/tests/baselines/reference/parserArrayLiteralExpression14.js @@ -2,16 +2,4 @@ var v = [,,1,1,,1,,1,1,,1]; //// [parserArrayLiteralExpression14.js] -var v = [ - , - , - 1, - 1, - , - 1, - , - 1, - 1, - , - 1 -]; +var v = [, , 1, 1, , 1, , 1, 1, , 1]; diff --git a/tests/baselines/reference/parserArrayLiteralExpression15.js b/tests/baselines/reference/parserArrayLiteralExpression15.js index 4894a874bef..84ab9dac240 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression15.js +++ b/tests/baselines/reference/parserArrayLiteralExpression15.js @@ -2,16 +2,4 @@ var v = [,,1,1,,1,,1,1,,1,]; //// [parserArrayLiteralExpression15.js] -var v = [ - , - , - 1, - 1, - , - 1, - , - 1, - 1, - , - 1, -]; +var v = [, , 1, 1, , 1, , 1, 1, , 1,]; diff --git a/tests/baselines/reference/parserArrayLiteralExpression2.js b/tests/baselines/reference/parserArrayLiteralExpression2.js index 587b4180ec6..1fb26155eb5 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression2.js +++ b/tests/baselines/reference/parserArrayLiteralExpression2.js @@ -2,6 +2,4 @@ var v = [,]; //// [parserArrayLiteralExpression2.js] -var v = [ - , -]; +var v = [,]; diff --git a/tests/baselines/reference/parserArrayLiteralExpression3.js b/tests/baselines/reference/parserArrayLiteralExpression3.js index 45a9c945ba8..2d7d19fc2c3 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression3.js +++ b/tests/baselines/reference/parserArrayLiteralExpression3.js @@ -2,7 +2,4 @@ var v = [,,]; //// [parserArrayLiteralExpression3.js] -var v = [ - , - , -]; +var v = [, ,]; diff --git a/tests/baselines/reference/parserArrayLiteralExpression4.js b/tests/baselines/reference/parserArrayLiteralExpression4.js index 7a69500ba74..2287897338e 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression4.js +++ b/tests/baselines/reference/parserArrayLiteralExpression4.js @@ -2,8 +2,4 @@ var v = [,,,]; //// [parserArrayLiteralExpression4.js] -var v = [ - , - , - , -]; +var v = [, , ,]; diff --git a/tests/baselines/reference/parserArrayLiteralExpression5.js b/tests/baselines/reference/parserArrayLiteralExpression5.js index 1affdb1ac38..43b784b2e5e 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression5.js +++ b/tests/baselines/reference/parserArrayLiteralExpression5.js @@ -2,6 +2,4 @@ var v = [1]; //// [parserArrayLiteralExpression5.js] -var v = [ - 1 -]; +var v = [1]; diff --git a/tests/baselines/reference/parserArrayLiteralExpression6.js b/tests/baselines/reference/parserArrayLiteralExpression6.js index b5831c7345e..28cd901f4ac 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression6.js +++ b/tests/baselines/reference/parserArrayLiteralExpression6.js @@ -2,7 +2,4 @@ var v = [,1]; //// [parserArrayLiteralExpression6.js] -var v = [ - , - 1 -]; +var v = [, 1]; diff --git a/tests/baselines/reference/parserArrayLiteralExpression7.js b/tests/baselines/reference/parserArrayLiteralExpression7.js index e10cf021a73..b302e87e352 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression7.js +++ b/tests/baselines/reference/parserArrayLiteralExpression7.js @@ -2,6 +2,4 @@ var v = [1,]; //// [parserArrayLiteralExpression7.js] -var v = [ - 1, -]; +var v = [1,]; diff --git a/tests/baselines/reference/parserArrayLiteralExpression8.js b/tests/baselines/reference/parserArrayLiteralExpression8.js index 6d8b252521d..223a86db229 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression8.js +++ b/tests/baselines/reference/parserArrayLiteralExpression8.js @@ -2,7 +2,4 @@ var v = [,1,]; //// [parserArrayLiteralExpression8.js] -var v = [ - , - 1, -]; +var v = [, 1,]; diff --git a/tests/baselines/reference/parserArrayLiteralExpression9.js b/tests/baselines/reference/parserArrayLiteralExpression9.js index d44d072eb57..5043f522dde 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression9.js +++ b/tests/baselines/reference/parserArrayLiteralExpression9.js @@ -2,7 +2,4 @@ var v = [1,1]; //// [parserArrayLiteralExpression9.js] -var v = [ - 1, - 1 -]; +var v = [1, 1]; diff --git a/tests/baselines/reference/parserArrowFunctionExpression1.js b/tests/baselines/reference/parserArrowFunctionExpression1.js index 5ab29fee64c..e4ae59fdb99 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression1.js +++ b/tests/baselines/reference/parserArrowFunctionExpression1.js @@ -2,5 +2,4 @@ var v = (public x: string) => { }; //// [parserArrowFunctionExpression1.js] -var v = function (x) { -}; +var v = function (x) { }; diff --git a/tests/baselines/reference/parserArrowFunctionExpression2.js b/tests/baselines/reference/parserArrowFunctionExpression2.js index 5059cf32182..9004468ec76 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression2.js +++ b/tests/baselines/reference/parserArrowFunctionExpression2.js @@ -2,6 +2,5 @@ a = () => { } || a //// [parserArrowFunctionExpression2.js] -a = function () { -}; +a = function () { }; || a; diff --git a/tests/baselines/reference/parserArrowFunctionExpression3.js b/tests/baselines/reference/parserArrowFunctionExpression3.js index 68ea230d87b..9e6b2706108 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression3.js +++ b/tests/baselines/reference/parserArrowFunctionExpression3.js @@ -2,5 +2,4 @@ a = (() => { } || a) //// [parserArrowFunctionExpression3.js] -a = (function () { -}) || a; +a = (function () { }) || a; diff --git a/tests/baselines/reference/parserArrowFunctionExpression4.js b/tests/baselines/reference/parserArrowFunctionExpression4.js index 53aaee9e6ff..e77a42162cd 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression4.js +++ b/tests/baselines/reference/parserArrowFunctionExpression4.js @@ -2,5 +2,4 @@ a = (() => { }, a) //// [parserArrowFunctionExpression4.js] -a = (function () { -}, a); +a = (function () { }, a); diff --git a/tests/baselines/reference/parserCastVersusArrowFunction1.js b/tests/baselines/reference/parserCastVersusArrowFunction1.js index 63a19924d3e..df46753b9e4 100644 --- a/tests/baselines/reference/parserCastVersusArrowFunction1.js +++ b/tests/baselines/reference/parserCastVersusArrowFunction1.js @@ -11,16 +11,10 @@ var v = (a, b); var v = (a = 1, b = 2); //// [parserCastVersusArrowFunction1.js] -var v = function () { - return 1; -}; +var v = function () { return 1; }; var v = a; -var v = function (a) { - return 1; -}; -var v = function (a, b) { - return 1; -}; +var v = function (a) { return 1; }; +var v = function (a, b) { return 1; }; var v = function (a, b) { if (a === void 0) { a = 1; } if (b === void 0) { b = 2; } diff --git a/tests/baselines/reference/parserClass1.js b/tests/baselines/reference/parserClass1.js index 1245da3363f..eb1d17566aa 100644 --- a/tests/baselines/reference/parserClass1.js +++ b/tests/baselines/reference/parserClass1.js @@ -13,21 +13,11 @@ var NullLogger = (function () { function NullLogger() { } - NullLogger.prototype.information = function () { - return false; - }; - NullLogger.prototype.debug = function () { - return false; - }; - NullLogger.prototype.warning = function () { - return false; - }; - NullLogger.prototype.error = function () { - return false; - }; - NullLogger.prototype.fatal = function () { - return false; - }; + NullLogger.prototype.information = function () { return false; }; + NullLogger.prototype.debug = function () { return false; }; + NullLogger.prototype.warning = function () { return false; }; + NullLogger.prototype.error = function () { return false; }; + NullLogger.prototype.fatal = function () { return false; }; NullLogger.prototype.log = function (s) { }; return NullLogger; diff --git a/tests/baselines/reference/parserClassDeclaration11.js b/tests/baselines/reference/parserClassDeclaration11.js index 80a27d71e6c..078d3553a43 100644 --- a/tests/baselines/reference/parserClassDeclaration11.js +++ b/tests/baselines/reference/parserClassDeclaration11.js @@ -8,7 +8,6 @@ class C { var C = (function () { function C() { } - C.prototype.foo = function () { - }; + C.prototype.foo = function () { }; return C; })(); diff --git a/tests/baselines/reference/parserClassDeclaration13.js b/tests/baselines/reference/parserClassDeclaration13.js index dcb704ae1d3..93ce76fb168 100644 --- a/tests/baselines/reference/parserClassDeclaration13.js +++ b/tests/baselines/reference/parserClassDeclaration13.js @@ -8,7 +8,6 @@ class C { var C = (function () { function C() { } - C.prototype.bar = function () { - }; + C.prototype.bar = function () { }; return C; })(); diff --git a/tests/baselines/reference/parserClassDeclaration16.js b/tests/baselines/reference/parserClassDeclaration16.js index 7048980597e..a6a92d73afa 100644 --- a/tests/baselines/reference/parserClassDeclaration16.js +++ b/tests/baselines/reference/parserClassDeclaration16.js @@ -8,7 +8,6 @@ class C { var C = (function () { function C() { } - C.prototype.foo = function () { - }; + C.prototype.foo = function () { }; return C; })(); diff --git a/tests/baselines/reference/parserClassDeclaration19.js b/tests/baselines/reference/parserClassDeclaration19.js index 5b77e263ec9..7900aa4d552 100644 --- a/tests/baselines/reference/parserClassDeclaration19.js +++ b/tests/baselines/reference/parserClassDeclaration19.js @@ -8,7 +8,6 @@ class C { var C = (function () { function C() { } - C.prototype["foo"] = function () { - }; + C.prototype["foo"] = function () { }; return C; })(); diff --git a/tests/baselines/reference/parserClassDeclaration20.js b/tests/baselines/reference/parserClassDeclaration20.js index 68d97b66bb9..7c99f2d8ee6 100644 --- a/tests/baselines/reference/parserClassDeclaration20.js +++ b/tests/baselines/reference/parserClassDeclaration20.js @@ -8,7 +8,6 @@ class C { var C = (function () { function C() { } - C.prototype["0"] = function () { - }; + C.prototype["0"] = function () { }; return C; })(); diff --git a/tests/baselines/reference/parserClassDeclaration21.js b/tests/baselines/reference/parserClassDeclaration21.js index 248f10e8681..fa4cef46e0e 100644 --- a/tests/baselines/reference/parserClassDeclaration21.js +++ b/tests/baselines/reference/parserClassDeclaration21.js @@ -8,7 +8,6 @@ class C { var C = (function () { function C() { } - C.prototype[1] = function () { - }; + C.prototype[1] = function () { }; return C; })(); diff --git a/tests/baselines/reference/parserClassDeclaration22.js b/tests/baselines/reference/parserClassDeclaration22.js index 60f708d4835..596f7a4474b 100644 --- a/tests/baselines/reference/parserClassDeclaration22.js +++ b/tests/baselines/reference/parserClassDeclaration22.js @@ -8,7 +8,6 @@ class C { var C = (function () { function C() { } - C.prototype["bar"] = function () { - }; + C.prototype["bar"] = function () { }; return C; })(); diff --git a/tests/baselines/reference/parserCommaInTypeMemberList2.js b/tests/baselines/reference/parserCommaInTypeMemberList2.js index 9593bdea98f..fd79326b7b0 100644 --- a/tests/baselines/reference/parserCommaInTypeMemberList2.js +++ b/tests/baselines/reference/parserCommaInTypeMemberList2.js @@ -3,6 +3,4 @@ var s = $.extend< { workItem: any }, { workItem: any, width: string }>({ workIte //// [parserCommaInTypeMemberList2.js] -var s = $.extend({ - workItem: this._workItem -}, {}); +var s = $.extend({ workItem: this._workItem }, {}); diff --git a/tests/baselines/reference/parserComputedPropertyName1.js b/tests/baselines/reference/parserComputedPropertyName1.js index 4a42b2e97e7..ee5b0a22cb6 100644 --- a/tests/baselines/reference/parserComputedPropertyName1.js +++ b/tests/baselines/reference/parserComputedPropertyName1.js @@ -2,6 +2,4 @@ var v = { [e] }; //// [parserComputedPropertyName1.js] -var v = { - [e]: -}; +var v = { [e]: }; diff --git a/tests/baselines/reference/parserComputedPropertyName12.js b/tests/baselines/reference/parserComputedPropertyName12.js index 71cf1d352f4..c78f2f15ff7 100644 --- a/tests/baselines/reference/parserComputedPropertyName12.js +++ b/tests/baselines/reference/parserComputedPropertyName12.js @@ -5,6 +5,5 @@ class C { //// [parserComputedPropertyName12.js] class C { - [e]() { - } + [e]() { } } diff --git a/tests/baselines/reference/parserComputedPropertyName17.js b/tests/baselines/reference/parserComputedPropertyName17.js index cfff46e52fc..f1fc4caacb3 100644 --- a/tests/baselines/reference/parserComputedPropertyName17.js +++ b/tests/baselines/reference/parserComputedPropertyName17.js @@ -2,7 +2,4 @@ var v = { set [e](v) { } } //// [parserComputedPropertyName17.js] -var v = { - set [e](v) { - } -}; +var v = { set [e](v) { } }; diff --git a/tests/baselines/reference/parserComputedPropertyName2.js b/tests/baselines/reference/parserComputedPropertyName2.js index ea8532945a1..f3c41f963f5 100644 --- a/tests/baselines/reference/parserComputedPropertyName2.js +++ b/tests/baselines/reference/parserComputedPropertyName2.js @@ -2,6 +2,4 @@ var v = { [e]: 1 }; //// [parserComputedPropertyName2.js] -var v = { - [e]: 1 -}; +var v = { [e]: 1 }; diff --git a/tests/baselines/reference/parserComputedPropertyName24.js b/tests/baselines/reference/parserComputedPropertyName24.js index 8fc0a5be3a5..8c72afde620 100644 --- a/tests/baselines/reference/parserComputedPropertyName24.js +++ b/tests/baselines/reference/parserComputedPropertyName24.js @@ -5,6 +5,5 @@ class C { //// [parserComputedPropertyName24.js] class C { - set [e](v) { - } + set [e](v) { } } diff --git a/tests/baselines/reference/parserComputedPropertyName3.js b/tests/baselines/reference/parserComputedPropertyName3.js index b3c8cc27bf8..70273ed501d 100644 --- a/tests/baselines/reference/parserComputedPropertyName3.js +++ b/tests/baselines/reference/parserComputedPropertyName3.js @@ -2,7 +2,4 @@ var v = { [e]() { } }; //// [parserComputedPropertyName3.js] -var v = { - [e]() { - } -}; +var v = { [e]() { } }; diff --git a/tests/baselines/reference/parserComputedPropertyName33.js b/tests/baselines/reference/parserComputedPropertyName33.js index 64239bc1284..ab80967c21a 100644 --- a/tests/baselines/reference/parserComputedPropertyName33.js +++ b/tests/baselines/reference/parserComputedPropertyName33.js @@ -12,5 +12,4 @@ class C { this[e] = 0[e2](); } } -{ -} +{ } diff --git a/tests/baselines/reference/parserComputedPropertyName38.js b/tests/baselines/reference/parserComputedPropertyName38.js index e5c9512ad2d..e47f5233a77 100644 --- a/tests/baselines/reference/parserComputedPropertyName38.js +++ b/tests/baselines/reference/parserComputedPropertyName38.js @@ -6,5 +6,4 @@ class C { //// [parserComputedPropertyName38.js] class C { } -(() => { -}); +(() => { }); diff --git a/tests/baselines/reference/parserComputedPropertyName39.js b/tests/baselines/reference/parserComputedPropertyName39.js index cee81ccc3d0..541d1965385 100644 --- a/tests/baselines/reference/parserComputedPropertyName39.js +++ b/tests/baselines/reference/parserComputedPropertyName39.js @@ -8,5 +8,4 @@ class C { "use strict"; class C { } -(() => { -}); +(() => { }); diff --git a/tests/baselines/reference/parserComputedPropertyName4.js b/tests/baselines/reference/parserComputedPropertyName4.js index 679733529a3..e456ca74f93 100644 --- a/tests/baselines/reference/parserComputedPropertyName4.js +++ b/tests/baselines/reference/parserComputedPropertyName4.js @@ -2,7 +2,4 @@ var v = { get [e]() { } }; //// [parserComputedPropertyName4.js] -var v = { - get [e]() { - } -}; +var v = { get [e]() { } }; diff --git a/tests/baselines/reference/parserComputedPropertyName40.js b/tests/baselines/reference/parserComputedPropertyName40.js index 417e37067d1..3d9091bd645 100644 --- a/tests/baselines/reference/parserComputedPropertyName40.js +++ b/tests/baselines/reference/parserComputedPropertyName40.js @@ -5,6 +5,5 @@ class C { //// [parserComputedPropertyName40.js] class C { - [a ? "" : ""]() { - } + [a ? "" : ""]() { } } diff --git a/tests/baselines/reference/parserComputedPropertyName5.js b/tests/baselines/reference/parserComputedPropertyName5.js index 956b885bffb..b94acd5523b 100644 --- a/tests/baselines/reference/parserComputedPropertyName5.js +++ b/tests/baselines/reference/parserComputedPropertyName5.js @@ -2,7 +2,4 @@ var v = { public get [e]() { } }; //// [parserComputedPropertyName5.js] -var v = { - get [e]() { - } -}; +var v = { get [e]() { } }; diff --git a/tests/baselines/reference/parserComputedPropertyName6.js b/tests/baselines/reference/parserComputedPropertyName6.js index b18bb6ff305..b60ad66a9d8 100644 --- a/tests/baselines/reference/parserComputedPropertyName6.js +++ b/tests/baselines/reference/parserComputedPropertyName6.js @@ -2,7 +2,4 @@ var v = { [e]: 1, [e + e]: 2 }; //// [parserComputedPropertyName6.js] -var v = { - [e]: 1, - [e + e]: 2 -}; +var v = { [e]: 1, [e + e]: 2 }; diff --git a/tests/baselines/reference/parserES3Accessors1.js b/tests/baselines/reference/parserES3Accessors1.js index 4900c1f32d9..b4d0b9d6576 100644 --- a/tests/baselines/reference/parserES3Accessors1.js +++ b/tests/baselines/reference/parserES3Accessors1.js @@ -8,8 +8,7 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { - get: function () { - }, + get: function () { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/parserES3Accessors2.js b/tests/baselines/reference/parserES3Accessors2.js index 08259f2655e..3d18e8ac280 100644 --- a/tests/baselines/reference/parserES3Accessors2.js +++ b/tests/baselines/reference/parserES3Accessors2.js @@ -8,8 +8,7 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { - set: function (a) { - }, + set: function (a) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/parserES3Accessors3.js b/tests/baselines/reference/parserES3Accessors3.js index c7dc2e3cea6..f623fc546fd 100644 --- a/tests/baselines/reference/parserES3Accessors3.js +++ b/tests/baselines/reference/parserES3Accessors3.js @@ -2,7 +2,4 @@ var v = { get Foo() { } }; //// [parserES3Accessors3.js] -var v = { - get Foo() { - } -}; +var v = { get Foo() { } }; diff --git a/tests/baselines/reference/parserES3Accessors4.js b/tests/baselines/reference/parserES3Accessors4.js index 9133c29a02a..2bc5c9d1f78 100644 --- a/tests/baselines/reference/parserES3Accessors4.js +++ b/tests/baselines/reference/parserES3Accessors4.js @@ -2,7 +2,4 @@ var v = { set Foo(a) { } }; //// [parserES3Accessors4.js] -var v = { - set Foo(a) { - } -}; +var v = { set Foo(a) { } }; diff --git a/tests/baselines/reference/parserES5ComputedPropertyName2.js b/tests/baselines/reference/parserES5ComputedPropertyName2.js index d8a5bb45fac..4569c00d7b3 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName2.js +++ b/tests/baselines/reference/parserES5ComputedPropertyName2.js @@ -2,7 +2,5 @@ var v = { [e]: 1 }; //// [parserES5ComputedPropertyName2.js] -var v = (_a = {}, - _a[e] = 1, - _a); +var v = (_a = {}, _a[e] = 1, _a); var _a; diff --git a/tests/baselines/reference/parserES5ComputedPropertyName3.js b/tests/baselines/reference/parserES5ComputedPropertyName3.js index 85a031fdfa3..1fdb5ced65d 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName3.js +++ b/tests/baselines/reference/parserES5ComputedPropertyName3.js @@ -2,8 +2,5 @@ var v = { [e]() { } }; //// [parserES5ComputedPropertyName3.js] -var v = (_a = {}, - _a[e] = function () { - }, - _a); +var v = (_a = {}, _a[e] = function () { }, _a); var _a; diff --git a/tests/baselines/reference/parserES5ComputedPropertyName4.js b/tests/baselines/reference/parserES5ComputedPropertyName4.js index 5233471b6ff..499e9a426d9 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName4.js +++ b/tests/baselines/reference/parserES5ComputedPropertyName4.js @@ -2,12 +2,9 @@ var v = { get [e]() { } }; //// [parserES5ComputedPropertyName4.js] -var v = (_a = {}, - _a[e] = Object.defineProperty({ - get: function () { - }, - enumerable: true, - configurable: true - }), - _a); +var v = (_a = {}, Object.defineProperty(_a, e, { + get: function () { }, + enumerable: true, + configurable: true +}), _a); var _a; diff --git a/tests/baselines/reference/parserES5ForOfStatement17.js b/tests/baselines/reference/parserES5ForOfStatement17.js index 29b4f32b912..7995c4c689e 100644 --- a/tests/baselines/reference/parserES5ForOfStatement17.js +++ b/tests/baselines/reference/parserES5ForOfStatement17.js @@ -2,5 +2,4 @@ for (var of; ;) { } //// [parserES5ForOfStatement17.js] -for (var of;;) { -} +for (var of;;) { } diff --git a/tests/baselines/reference/parserES5ForOfStatement19.js b/tests/baselines/reference/parserES5ForOfStatement19.js index 3838461a640..7ed0d5a333a 100644 --- a/tests/baselines/reference/parserES5ForOfStatement19.js +++ b/tests/baselines/reference/parserES5ForOfStatement19.js @@ -2,5 +2,4 @@ for (var of in of) { } //// [parserES5ForOfStatement19.js] -for (var of in of) { -} +for (var of in of) { } diff --git a/tests/baselines/reference/parserES5ForOfStatement20.js b/tests/baselines/reference/parserES5ForOfStatement20.js index 74fceaef68c..c51cbbc2a3a 100644 --- a/tests/baselines/reference/parserES5ForOfStatement20.js +++ b/tests/baselines/reference/parserES5ForOfStatement20.js @@ -2,5 +2,4 @@ for (var of = 0 in of) { } //// [parserES5ForOfStatement20.js] -for (var of = 0 in of) { -} +for (var of = 0 in of) { } diff --git a/tests/baselines/reference/parserES5SymbolProperty7.js b/tests/baselines/reference/parserES5SymbolProperty7.js index b6096b798df..102d10af417 100644 --- a/tests/baselines/reference/parserES5SymbolProperty7.js +++ b/tests/baselines/reference/parserES5SymbolProperty7.js @@ -7,7 +7,6 @@ class C { var C = (function () { function C() { } - C.prototype[Symbol.toStringTag] = function () { - }; + C.prototype[Symbol.toStringTag] = function () { }; return C; })(); diff --git a/tests/baselines/reference/parserErrantSemicolonInClass1.errors.txt b/tests/baselines/reference/parserErrantSemicolonInClass1.errors.txt index 7e71ec8fc61..aec80ad934d 100644 --- a/tests/baselines/reference/parserErrantSemicolonInClass1.errors.txt +++ b/tests/baselines/reference/parserErrantSemicolonInClass1.errors.txt @@ -1,7 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserErrantSemicolonInClass1.ts(9,21): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserErrantSemicolonInClass1.ts(12,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserErrantSemicolonInClass1.ts(15,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserErrantSemicolonInClass1.ts(18,23): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserErrantSemicolonInClass1.ts(24,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserErrantSemicolonInClass1.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserErrantSemicolonInClass1.ts (4 errors) ==== class a { //constructor (); constructor (n: number); @@ -11,23 +14,29 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserErrantSemicolonIn } public pgF() { }; - ~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. public pv; public get d() { + ~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return 30; } public set d() { + ~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } public static get p2() { + ~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return { x: 30, y: 40 }; } private static d2() { } private static get p3() { + ~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return "string"; } private pv3; diff --git a/tests/baselines/reference/parserErrantSemicolonInClass1.js b/tests/baselines/reference/parserErrantSemicolonInClass1.js index 56eb3427168..f3834da7e78 100644 --- a/tests/baselines/reference/parserErrantSemicolonInClass1.js +++ b/tests/baselines/reference/parserErrantSemicolonInClass1.js @@ -39,8 +39,8 @@ class a { var a = (function () { function a(ns) { } - a.prototype.pgF = function () { - }; + a.prototype.pgF = function () { }; + ; Object.defineProperty(a.prototype, "d", { get: function () { return 30; @@ -52,10 +52,7 @@ var a = (function () { }); Object.defineProperty(a, "p2", { get: function () { - return { - x: 30, - y: 40 - }; + return { x: 30, y: 40 }; }, enumerable: true, configurable: true diff --git a/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression1.js b/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression1.js index bea1ae993a5..c33dbc2a626 100644 --- a/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression1.js +++ b/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression1.js @@ -3,12 +3,5 @@ var v = [1, 2, 3 4, 5, 6, 7]; //// [parserErrorRecoveryArrayLiteralExpression1.js] -var v = [ - 1, - 2, - 3, - 4, - 5, - 6, - 7 -]; +var v = [1, 2, 3, + 4, 5, 6, 7]; diff --git a/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression2.js b/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression2.js index c56dcd4ad9e..0bfe59964db 100644 --- a/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression2.js +++ b/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression2.js @@ -5,13 +5,5 @@ var points = [-0.6961439251899719, 1.207661509513855, 0.19374050199985504, -0 //// [parserErrorRecoveryArrayLiteralExpression2.js] -var points = [ - -0.6961439251899719, - 1.207661509513855, - 0.19374050199985504, - -0, - .7042760848999023, - 1.1955541372299194, - 0.19600726664066315, - -0.7120069861412048 -]; +var points = [-0.6961439251899719, 1.207661509513855, 0.19374050199985504, -0, + .7042760848999023, 1.1955541372299194, 0.19600726664066315, -0.7120069861412048]; diff --git a/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression3.js b/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression3.js index a40433ba461..c366c750cc7 100644 --- a/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression3.js +++ b/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression3.js @@ -4,11 +4,6 @@ var texCoords = [2, 2, 0.5000001192092895, 0.8749999 ; 403953552, 0.500000119209 //// [parserErrorRecoveryArrayLiteralExpression3.js] -var texCoords = [ - 2, - 2, - 0.5000001192092895, - 0.8749999 -]; +var texCoords = [2, 2, 0.5000001192092895, 0.8749999]; 403953552, 0.5000001192092895, 0.8749999403953552; ; diff --git a/tests/baselines/reference/parserErrorRecovery_Block1.js b/tests/baselines/reference/parserErrorRecovery_Block1.js index cdcd5856fa6..e2bc5f89a39 100644 --- a/tests/baselines/reference/parserErrorRecovery_Block1.js +++ b/tests/baselines/reference/parserErrorRecovery_Block1.js @@ -6,6 +6,7 @@ function f() { //// [parserErrorRecovery_Block1.js] function f() { - 1 + ; + 1 + + ; return; } diff --git a/tests/baselines/reference/parserErrorRecovery_Block3.js b/tests/baselines/reference/parserErrorRecovery_Block3.js index 30183fb7d8b..55b0a4d65e7 100644 --- a/tests/baselines/reference/parserErrorRecovery_Block3.js +++ b/tests/baselines/reference/parserErrorRecovery_Block3.js @@ -10,8 +10,7 @@ class C { var C = (function () { function C() { } - C.prototype.a = function () { - }; + C.prototype.a = function () { }; C.prototype.b = function () { }; return C; diff --git a/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.js b/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.js index c26b16b5a0a..ae2509c3f49 100644 --- a/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.js +++ b/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.js @@ -41,9 +41,7 @@ var Shapes; this.con = "hello"; } // Instance member - Point.prototype.getDist = function () { - return Math.sqrt(this.x * this.x + this.y * this.y); - }; + Point.prototype.getDist = function () { return Math.sqrt(this.x * this.x + this.y * this.y); }; // Static member Point.origin = new Point(0, 0); return Point; diff --git a/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable2.js b/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable2.js index 866f96a8030..4936b1ea8bc 100644 --- a/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable2.js +++ b/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable2.js @@ -41,9 +41,7 @@ var Shapes; this.con = "hello"; } // Instance member - Point.prototype.getDist = function () { - return Math.sqrt(this.x * this.x + this.y * this.y); - }; + Point.prototype.getDist = function () { return Math.sqrt(this.x * this.x + this.y * this.y); }; // Static member Point.origin = new Point(0, 0); return Point; diff --git a/tests/baselines/reference/parserErrorRecovery_ObjectLiteral1.js b/tests/baselines/reference/parserErrorRecovery_ObjectLiteral1.js index 04085a4b595..dbf89fec52b 100644 --- a/tests/baselines/reference/parserErrorRecovery_ObjectLiteral1.js +++ b/tests/baselines/reference/parserErrorRecovery_ObjectLiteral1.js @@ -2,7 +2,4 @@ var v = { a: 1 b: 2 } //// [parserErrorRecovery_ObjectLiteral1.js] -var v = { - a: 1, - b: 2 -}; +var v = { a: 1, b: 2 }; diff --git a/tests/baselines/reference/parserErrorRecovery_ObjectLiteral2.js b/tests/baselines/reference/parserErrorRecovery_ObjectLiteral2.js index 3c258ef406e..6a703759fff 100644 --- a/tests/baselines/reference/parserErrorRecovery_ObjectLiteral2.js +++ b/tests/baselines/reference/parserErrorRecovery_ObjectLiteral2.js @@ -3,7 +3,5 @@ var v = { a return; //// [parserErrorRecovery_ObjectLiteral2.js] -var v = { - a: , - return: -}; +var v = { a: , + return: }; diff --git a/tests/baselines/reference/parserErrorRecovery_ObjectLiteral3.js b/tests/baselines/reference/parserErrorRecovery_ObjectLiteral3.js index 49902122ac3..eecf45fea4f 100644 --- a/tests/baselines/reference/parserErrorRecovery_ObjectLiteral3.js +++ b/tests/baselines/reference/parserErrorRecovery_ObjectLiteral3.js @@ -3,7 +3,5 @@ var v = { a: return; //// [parserErrorRecovery_ObjectLiteral3.js] -var v = { - a: , - return: -}; +var v = { a: , + return: }; diff --git a/tests/baselines/reference/parserErrorRecovery_ObjectLiteral4.js b/tests/baselines/reference/parserErrorRecovery_ObjectLiteral4.js index b0962100500..87a1a31437e 100644 --- a/tests/baselines/reference/parserErrorRecovery_ObjectLiteral4.js +++ b/tests/baselines/reference/parserErrorRecovery_ObjectLiteral4.js @@ -3,7 +3,5 @@ var v = { a: 1 return; //// [parserErrorRecovery_ObjectLiteral4.js] -var v = { - a: 1, - return: -}; +var v = { a: 1, + return: }; diff --git a/tests/baselines/reference/parserErrorRecovery_ObjectLiteral5.js b/tests/baselines/reference/parserErrorRecovery_ObjectLiteral5.js index 6b691e376ce..97e618946a0 100644 --- a/tests/baselines/reference/parserErrorRecovery_ObjectLiteral5.js +++ b/tests/baselines/reference/parserErrorRecovery_ObjectLiteral5.js @@ -3,7 +3,5 @@ var v = { a: 1, return; //// [parserErrorRecovery_ObjectLiteral5.js] -var v = { - a: 1, - return: -}; +var v = { a: 1, + return: }; diff --git a/tests/baselines/reference/parserErrorRecovery_ParameterList6.js b/tests/baselines/reference/parserErrorRecovery_ParameterList6.js index e83c045208d..060ad14766b 100644 --- a/tests/baselines/reference/parserErrorRecovery_ParameterList6.js +++ b/tests/baselines/reference/parserErrorRecovery_ParameterList6.js @@ -11,5 +11,4 @@ var Foo = (function () { return Foo; })(); break ; -{ -} +{ } diff --git a/tests/baselines/reference/parserErrorRecovery_SwitchStatement1.js b/tests/baselines/reference/parserErrorRecovery_SwitchStatement1.js index 63591985d1e..4d8008639c9 100644 --- a/tests/baselines/reference/parserErrorRecovery_SwitchStatement1.js +++ b/tests/baselines/reference/parserErrorRecovery_SwitchStatement1.js @@ -10,8 +10,10 @@ switch (e) { //// [parserErrorRecovery_SwitchStatement1.js] switch (e) { case 1: - 1 + ; + 1 + + ; case 2: - 1 + ; + 1 + + ; default: } diff --git a/tests/baselines/reference/parserErrorRecovery_SwitchStatement2.errors.txt b/tests/baselines/reference/parserErrorRecovery_SwitchStatement2.errors.txt index 12e8c8b6500..86bc6fbfd74 100644 --- a/tests/baselines/reference/parserErrorRecovery_SwitchStatement2.errors.txt +++ b/tests/baselines/reference/parserErrorRecovery_SwitchStatement2.errors.txt @@ -1,8 +1,9 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/SwitchStatements/parserErrorRecovery_SwitchStatement2.ts(3,13): error TS2304: Cannot find name 'e'. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/SwitchStatements/parserErrorRecovery_SwitchStatement2.ts(5,1): error TS1130: 'case' or 'default' expected. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/SwitchStatements/parserErrorRecovery_SwitchStatement2.ts(6,2): error TS1005: '}' expected. -==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/SwitchStatements/parserErrorRecovery_SwitchStatement2.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/SwitchStatements/parserErrorRecovery_SwitchStatement2.ts (3 errors) ==== class C { constructor() { switch (e) { @@ -12,4 +13,6 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/SwitchStatements/parser class D { ~~~~~ !!! error TS1130: 'case' or 'default' expected. - } \ No newline at end of file + } + +!!! error TS1005: '}' expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserErrorRecovery_SwitchStatement2.js b/tests/baselines/reference/parserErrorRecovery_SwitchStatement2.js index d7000bc23d7..0fd532dde15 100644 --- a/tests/baselines/reference/parserErrorRecovery_SwitchStatement2.js +++ b/tests/baselines/reference/parserErrorRecovery_SwitchStatement2.js @@ -11,11 +11,11 @@ var C = (function () { function C() { switch (e) { } + var D = (function () { + function D() { + } + return D; + })(); } return C; })(); -var D = (function () { - function D() { - } - return D; -})(); diff --git a/tests/baselines/reference/parserForOfStatement17.js b/tests/baselines/reference/parserForOfStatement17.js index 38ee81e71fc..a6e2aee79a4 100644 --- a/tests/baselines/reference/parserForOfStatement17.js +++ b/tests/baselines/reference/parserForOfStatement17.js @@ -2,5 +2,4 @@ for (var of; ;) { } //// [parserForOfStatement17.js] -for (var of;;) { -} +for (var of;;) { } diff --git a/tests/baselines/reference/parserForOfStatement18.js b/tests/baselines/reference/parserForOfStatement18.js index 519d92f3357..c30fbb60857 100644 --- a/tests/baselines/reference/parserForOfStatement18.js +++ b/tests/baselines/reference/parserForOfStatement18.js @@ -2,5 +2,4 @@ for (var of of of) { } //// [parserForOfStatement18.js] -for (var of of of) { -} +for (var of of of) { } diff --git a/tests/baselines/reference/parserForOfStatement19.js b/tests/baselines/reference/parserForOfStatement19.js index 9b6a5c8da27..c838e8c71e0 100644 --- a/tests/baselines/reference/parserForOfStatement19.js +++ b/tests/baselines/reference/parserForOfStatement19.js @@ -2,5 +2,4 @@ for (var of in of) { } //// [parserForOfStatement19.js] -for (var of in of) { -} +for (var of in of) { } diff --git a/tests/baselines/reference/parserForOfStatement20.js b/tests/baselines/reference/parserForOfStatement20.js index 7190bbeb1d2..8599238d853 100644 --- a/tests/baselines/reference/parserForOfStatement20.js +++ b/tests/baselines/reference/parserForOfStatement20.js @@ -2,5 +2,4 @@ for (var of = 0 in of) { } //// [parserForOfStatement20.js] -for (var of = 0 in of) { -} +for (var of = 0 in of) { } diff --git a/tests/baselines/reference/parserForOfStatement21.js b/tests/baselines/reference/parserForOfStatement21.js index 593582e035a..5db883e18a0 100644 --- a/tests/baselines/reference/parserForOfStatement21.js +++ b/tests/baselines/reference/parserForOfStatement21.js @@ -2,5 +2,4 @@ for (var of of) { } //// [parserForOfStatement21.js] -for ( of of) { -} +for ( of of) { } diff --git a/tests/baselines/reference/parserFunctionDeclaration4.js b/tests/baselines/reference/parserFunctionDeclaration4.js index 285f36e6838..a36a41e0809 100644 --- a/tests/baselines/reference/parserFunctionDeclaration4.js +++ b/tests/baselines/reference/parserFunctionDeclaration4.js @@ -3,5 +3,4 @@ function foo(); function bar() { } //// [parserFunctionDeclaration4.js] -function bar() { -} +function bar() { } diff --git a/tests/baselines/reference/parserFunctionDeclaration5.js b/tests/baselines/reference/parserFunctionDeclaration5.js index 1c80f842c0d..fd35c14675e 100644 --- a/tests/baselines/reference/parserFunctionDeclaration5.js +++ b/tests/baselines/reference/parserFunctionDeclaration5.js @@ -3,5 +3,4 @@ function foo(); function foo() { } //// [parserFunctionDeclaration5.js] -function foo() { -} +function foo() { } diff --git a/tests/baselines/reference/parserFunctionDeclaration6.js b/tests/baselines/reference/parserFunctionDeclaration6.js index 6f877b07b14..05afe2d33a8 100644 --- a/tests/baselines/reference/parserFunctionDeclaration6.js +++ b/tests/baselines/reference/parserFunctionDeclaration6.js @@ -6,6 +6,5 @@ //// [parserFunctionDeclaration6.js] { - function bar() { - } + function bar() { } } diff --git a/tests/baselines/reference/parserFunctionPropertyAssignment1.js b/tests/baselines/reference/parserFunctionPropertyAssignment1.js index c66c134ac48..ea7b20f05d5 100644 --- a/tests/baselines/reference/parserFunctionPropertyAssignment1.js +++ b/tests/baselines/reference/parserFunctionPropertyAssignment1.js @@ -2,7 +2,4 @@ var v = { foo() { } }; //// [parserFunctionPropertyAssignment1.js] -var v = { - foo: function () { - } -}; +var v = { foo: function () { } }; diff --git a/tests/baselines/reference/parserFunctionPropertyAssignment2.js b/tests/baselines/reference/parserFunctionPropertyAssignment2.js index 7f6b3001c9b..668e8df2cfc 100644 --- a/tests/baselines/reference/parserFunctionPropertyAssignment2.js +++ b/tests/baselines/reference/parserFunctionPropertyAssignment2.js @@ -2,7 +2,4 @@ var v = { 0() { } }; //// [parserFunctionPropertyAssignment2.js] -var v = { - 0: function () { - } -}; +var v = { 0: function () { } }; diff --git a/tests/baselines/reference/parserFunctionPropertyAssignment3.js b/tests/baselines/reference/parserFunctionPropertyAssignment3.js index 2ed2152ae19..87a98ac402c 100644 --- a/tests/baselines/reference/parserFunctionPropertyAssignment3.js +++ b/tests/baselines/reference/parserFunctionPropertyAssignment3.js @@ -2,7 +2,4 @@ var v = { "foo"() { } }; //// [parserFunctionPropertyAssignment3.js] -var v = { - "foo": function () { - } -}; +var v = { "foo": function () { } }; diff --git a/tests/baselines/reference/parserFunctionPropertyAssignment4.js b/tests/baselines/reference/parserFunctionPropertyAssignment4.js index eb95d79ac40..e9b41e754e6 100644 --- a/tests/baselines/reference/parserFunctionPropertyAssignment4.js +++ b/tests/baselines/reference/parserFunctionPropertyAssignment4.js @@ -2,7 +2,4 @@ var v = { 0() { } }; //// [parserFunctionPropertyAssignment4.js] -var v = { - 0: function () { - } -}; +var v = { 0: function () { } }; diff --git a/tests/baselines/reference/parserFuzz1.js b/tests/baselines/reference/parserFuzz1.js index 969c07c1659..b9ffb540049 100644 --- a/tests/baselines/reference/parserFuzz1.js +++ b/tests/baselines/reference/parserFuzz1.js @@ -6,8 +6,6 @@ cla >> 2; +1 + >>> + 2; diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity14.js b/tests/baselines/reference/parserGreaterThanTokenAmbiguity14.js index 5cc8bb3b88e..b2eba6d5873 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity14.js +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity14.js @@ -3,5 +3,6 @@ = 2; //// [parserGreaterThanTokenAmbiguity14.js] -1 >> ; +1 >> +; 2; diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity15.js b/tests/baselines/reference/parserGreaterThanTokenAmbiguity15.js index df9e55b7e3c..b6f905e12e7 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity15.js +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity15.js @@ -5,4 +5,6 @@ 2; //// [parserGreaterThanTokenAmbiguity15.js] -1 >>= 2; +1 + >>= + 2; diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity19.js b/tests/baselines/reference/parserGreaterThanTokenAmbiguity19.js index 52035691c84..d0671d8649f 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity19.js +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity19.js @@ -3,5 +3,6 @@ = 2; //// [parserGreaterThanTokenAmbiguity19.js] -1 >>> ; +1 >>> +; 2; diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity20.js b/tests/baselines/reference/parserGreaterThanTokenAmbiguity20.js index e6043febcd1..01d1d6401f2 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity20.js +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity20.js @@ -5,4 +5,6 @@ 2; //// [parserGreaterThanTokenAmbiguity20.js] -1 >>>= 2; +1 + >>>= + 2; diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity4.js b/tests/baselines/reference/parserGreaterThanTokenAmbiguity4.js index 5ef065681dc..dcfb51575e4 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity4.js +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity4.js @@ -3,4 +3,5 @@ > 2; //// [parserGreaterThanTokenAmbiguity4.js] -1 > > 2; +1 > + > 2; diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.js b/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.js index a707e808b4a..c65b76f504a 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.js +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.js @@ -5,4 +5,6 @@ 2; //// [parserGreaterThanTokenAmbiguity5.js] -1 >> 2; +1 + >> + 2; diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity9.js b/tests/baselines/reference/parserGreaterThanTokenAmbiguity9.js index 25c5ed53a7c..96be8d0749c 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity9.js +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity9.js @@ -3,4 +3,5 @@ > 2; //// [parserGreaterThanTokenAmbiguity9.js] -1 >> > 2; +1 >> + > 2; diff --git a/tests/baselines/reference/parserInExpression1.js b/tests/baselines/reference/parserInExpression1.js index 21538288049..d6100b9b57f 100644 --- a/tests/baselines/reference/parserInExpression1.js +++ b/tests/baselines/reference/parserInExpression1.js @@ -2,6 +2,4 @@ console.log("a" in { "a": true }); //// [parserInExpression1.js] -console.log("a" in { - "a": true -}); +console.log("a" in { "a": true }); diff --git a/tests/baselines/reference/parserInvalidIdentifiersInVariableStatements1.errors.txt b/tests/baselines/reference/parserInvalidIdentifiersInVariableStatements1.errors.txt index c57ca1e3028..d7245fc7082 100644 --- a/tests/baselines/reference/parserInvalidIdentifiersInVariableStatements1.errors.txt +++ b/tests/baselines/reference/parserInvalidIdentifiersInVariableStatements1.errors.txt @@ -1,8 +1,9 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/VariableLists/parserInvalidIdentifiersInVariableStatements1.ts(1,5): error TS1134: Variable declaration expected. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/VariableLists/parserInvalidIdentifiersInVariableStatements1.ts(3,5): error TS1134: Variable declaration expected. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/VariableLists/parserInvalidIdentifiersInVariableStatements1.ts(3,10): error TS1005: '{' expected. -==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/VariableLists/parserInvalidIdentifiersInVariableStatements1.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/VariableLists/parserInvalidIdentifiersInVariableStatements1.ts (3 errors) ==== var export; ~~~~~~ !!! error TS1134: Variable declaration expected. @@ -10,5 +11,7 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/VariableLists/parserInv var class; ~~~~~ !!! error TS1134: Variable declaration expected. + ~ +!!! error TS1005: '{' expected. var bar; \ No newline at end of file diff --git a/tests/baselines/reference/parserInvalidIdentifiersInVariableStatements1.js b/tests/baselines/reference/parserInvalidIdentifiersInVariableStatements1.js index 09fcffc1b0d..e6b9c9fa1b8 100644 --- a/tests/baselines/reference/parserInvalidIdentifiersInVariableStatements1.js +++ b/tests/baselines/reference/parserInvalidIdentifiersInVariableStatements1.js @@ -9,4 +9,10 @@ var bar; var ; var foo; var ; +var default_1 = (function () { + function default_1() { + } + return default_1; +})(); +; var bar; diff --git a/tests/baselines/reference/parserMemberAccessor1.js b/tests/baselines/reference/parserMemberAccessor1.js index 3d4690d58e9..866a171bc43 100644 --- a/tests/baselines/reference/parserMemberAccessor1.js +++ b/tests/baselines/reference/parserMemberAccessor1.js @@ -9,10 +9,8 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "foo", { - get: function () { - }, - set: function (a) { - }, + get: function () { }, + set: function (a) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration1.js b/tests/baselines/reference/parserMemberAccessorDeclaration1.js index 1f0b5eb3bd9..30534735cfc 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration1.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration1.js @@ -8,8 +8,7 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "a", { - get: function () { - }, + get: function () { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration10.js b/tests/baselines/reference/parserMemberAccessorDeclaration10.js index dba06544963..d778b192279 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration10.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration10.js @@ -8,8 +8,7 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { - get: function () { - } + get: function () { } exports.Foo = Foo;, enumerable: true, configurable: true diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration11.js b/tests/baselines/reference/parserMemberAccessorDeclaration11.js index 2a286b8ca6b..da8d7fc6425 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration11.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration11.js @@ -8,8 +8,7 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { - get: function () { - }, + get: function () { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration12.js b/tests/baselines/reference/parserMemberAccessorDeclaration12.js index aea6eccfbc2..72923e060c4 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration12.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration12.js @@ -8,8 +8,7 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { - get: function (a) { - }, + get: function (a) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration13.js b/tests/baselines/reference/parserMemberAccessorDeclaration13.js index f6ca4ee6a02..14b0f1b0a05 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration13.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration13.js @@ -8,8 +8,7 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { - set: function () { - }, + set: function () { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration14.js b/tests/baselines/reference/parserMemberAccessorDeclaration14.js index 62877d402d1..21b11219ca1 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration14.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration14.js @@ -8,8 +8,7 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { - set: function (a, b) { - }, + set: function (a, b) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration15.js b/tests/baselines/reference/parserMemberAccessorDeclaration15.js index 59ff360d432..0d01c75840c 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration15.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration15.js @@ -8,8 +8,7 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { - set: function (a) { - }, + set: function (a) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration17.js b/tests/baselines/reference/parserMemberAccessorDeclaration17.js index 6c99c7ddae6..d61fa2e8409 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration17.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration17.js @@ -8,8 +8,7 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { - set: function (a) { - }, + set: function (a) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration2.js b/tests/baselines/reference/parserMemberAccessorDeclaration2.js index 00cc2812014..f29efc846ee 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration2.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration2.js @@ -8,8 +8,7 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "b", { - get: function () { - }, + get: function () { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration3.js b/tests/baselines/reference/parserMemberAccessorDeclaration3.js index 86fc2c3e532..9c64bf02522 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration3.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration3.js @@ -8,8 +8,7 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "0", { - get: function () { - }, + get: function () { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration4.js b/tests/baselines/reference/parserMemberAccessorDeclaration4.js index 552c2c1d27a..e65f6431a7c 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration4.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration4.js @@ -8,8 +8,7 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "a", { - set: function (i) { - }, + set: function (i) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration5.js b/tests/baselines/reference/parserMemberAccessorDeclaration5.js index 309df8b68ec..d304a44d64d 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration5.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration5.js @@ -8,8 +8,7 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "a", { - set: function (i) { - }, + set: function (i) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration6.js b/tests/baselines/reference/parserMemberAccessorDeclaration6.js index 0b44673f146..9c6f3ce8a55 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration6.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration6.js @@ -8,8 +8,7 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "0", { - set: function (i) { - }, + set: function (i) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration7.js b/tests/baselines/reference/parserMemberAccessorDeclaration7.js index 0d2d24092e5..ce103accf61 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration7.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration7.js @@ -8,8 +8,7 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { - get: function () { - }, + get: function () { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration8.js b/tests/baselines/reference/parserMemberAccessorDeclaration8.js index dd93fa4852e..07f12acae40 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration8.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration8.js @@ -8,8 +8,7 @@ var C = (function () { function C() { } Object.defineProperty(C, "Foo", { - get: function () { - }, + get: function () { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration9.js b/tests/baselines/reference/parserMemberAccessorDeclaration9.js index 5fca86f689b..02183d46ef1 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration9.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration9.js @@ -8,8 +8,7 @@ var C = (function () { function C() { } Object.defineProperty(C, "Foo", { - get: function () { - }, + get: function () { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/parserMemberFunctionDeclaration1.js b/tests/baselines/reference/parserMemberFunctionDeclaration1.js index 564245157b0..1d40fa94700 100644 --- a/tests/baselines/reference/parserMemberFunctionDeclaration1.js +++ b/tests/baselines/reference/parserMemberFunctionDeclaration1.js @@ -7,7 +7,6 @@ class C { var C = (function () { function C() { } - C.prototype.Foo = function () { - }; + C.prototype.Foo = function () { }; return C; })(); diff --git a/tests/baselines/reference/parserMemberFunctionDeclaration2.js b/tests/baselines/reference/parserMemberFunctionDeclaration2.js index 0f103c90b7d..fed1a6a0743 100644 --- a/tests/baselines/reference/parserMemberFunctionDeclaration2.js +++ b/tests/baselines/reference/parserMemberFunctionDeclaration2.js @@ -7,7 +7,6 @@ class C { var C = (function () { function C() { } - C.Foo = function () { - }; + C.Foo = function () { }; return C; })(); diff --git a/tests/baselines/reference/parserMemberFunctionDeclaration3.js b/tests/baselines/reference/parserMemberFunctionDeclaration3.js index 46243f08dad..18bbec7ba5f 100644 --- a/tests/baselines/reference/parserMemberFunctionDeclaration3.js +++ b/tests/baselines/reference/parserMemberFunctionDeclaration3.js @@ -7,7 +7,6 @@ class C { var C = (function () { function C() { } - C.Foo = function () { - }; + C.Foo = function () { }; return C; })(); diff --git a/tests/baselines/reference/parserMemberFunctionDeclaration4.js b/tests/baselines/reference/parserMemberFunctionDeclaration4.js index bcf00aeb1bc..cd12f23442c 100644 --- a/tests/baselines/reference/parserMemberFunctionDeclaration4.js +++ b/tests/baselines/reference/parserMemberFunctionDeclaration4.js @@ -7,8 +7,7 @@ class C { var C = (function () { function C() { } - C.prototype.Foo = function () { - } + C.prototype.Foo = function () { } exports.Foo = Foo;; return C; })(); diff --git a/tests/baselines/reference/parserMemberFunctionDeclaration5.js b/tests/baselines/reference/parserMemberFunctionDeclaration5.js index da2d2281999..75630d34551 100644 --- a/tests/baselines/reference/parserMemberFunctionDeclaration5.js +++ b/tests/baselines/reference/parserMemberFunctionDeclaration5.js @@ -7,7 +7,6 @@ class C { var C = (function () { function C() { } - C.prototype.Foo = function () { - }; + C.prototype.Foo = function () { }; return C; })(); diff --git a/tests/baselines/reference/parserMemberFunctionDeclarationAmbiguities1.js b/tests/baselines/reference/parserMemberFunctionDeclarationAmbiguities1.js index 59017d97fe2..e0a0f7860cc 100644 --- a/tests/baselines/reference/parserMemberFunctionDeclarationAmbiguities1.js +++ b/tests/baselines/reference/parserMemberFunctionDeclarationAmbiguities1.js @@ -17,21 +17,13 @@ class C { var C = (function () { function C() { } - C.prototype.public = function () { - }; - C.prototype.static = function () { - }; - C.prototype.public = function () { - }; - C.prototype.static = function () { - }; - C.public = function () { - }; - C.static = function () { - }; - C.public = function () { - }; - C.static = function () { - }; + C.prototype.public = function () { }; + C.prototype.static = function () { }; + C.prototype.public = function () { }; + C.prototype.static = function () { }; + C.public = function () { }; + C.static = function () { }; + C.public = function () { }; + C.static = function () { }; return C; })(); diff --git a/tests/baselines/reference/parserMissingLambdaOpenBrace1.js b/tests/baselines/reference/parserMissingLambdaOpenBrace1.js index 1c532f3d4b4..8280d8dc9b2 100644 --- a/tests/baselines/reference/parserMissingLambdaOpenBrace1.js +++ b/tests/baselines/reference/parserMissingLambdaOpenBrace1.js @@ -16,9 +16,7 @@ var C = (function () { var _this = this; return fromDoWhile(function (test) { var index = 0; - return _this.doWhile(function (item, i) { - return filter(item, i) ? test(item, index++) : true; - }); + return _this.doWhile(function (item, i) { return filter(item, i) ? test(item, index++) : true; }); }); }; return C; diff --git a/tests/baselines/reference/parserMissingToken1.js b/tests/baselines/reference/parserMissingToken1.js index 506e628fa38..7017d9d0b17 100644 --- a/tests/baselines/reference/parserMissingToken1.js +++ b/tests/baselines/reference/parserMissingToken1.js @@ -3,7 +3,5 @@ a / finally //// [parserMissingToken1.js] a / ; -try { -} -finally { -} +try { } +finally { } diff --git a/tests/baselines/reference/parserNoASIOnCallAfterFunctionExpression1.js b/tests/baselines/reference/parserNoASIOnCallAfterFunctionExpression1.js index 83df05206ce..51581b1c74f 100644 --- a/tests/baselines/reference/parserNoASIOnCallAfterFunctionExpression1.js +++ b/tests/baselines/reference/parserNoASIOnCallAfterFunctionExpression1.js @@ -4,5 +4,4 @@ var x = function () { } //// [parserNoASIOnCallAfterFunctionExpression1.js] -var x = function () { -}(window).foo; +var x = function () { }(window).foo; diff --git a/tests/baselines/reference/parserNotHexLiteral1.js b/tests/baselines/reference/parserNotHexLiteral1.js index eadbf8da275..89b978fcaa8 100644 --- a/tests/baselines/reference/parserNotHexLiteral1.js +++ b/tests/baselines/reference/parserNotHexLiteral1.js @@ -7,10 +7,7 @@ console.info (x.e0); //// [parserNotHexLiteral1.js] -var x = { - e0: 'cat', - x0: 'dog' -}; +var x = { e0: 'cat', x0: 'dog' }; console.info(x.x0); // tsc dies on this next line with "bug.ts (5,16): Expected ')'" // tsc seems to be parsing the e0 as a hex constant. diff --git a/tests/baselines/reference/parserObjectLiterals1.js b/tests/baselines/reference/parserObjectLiterals1.js index 2224809474b..426b8107d3b 100644 --- a/tests/baselines/reference/parserObjectLiterals1.js +++ b/tests/baselines/reference/parserObjectLiterals1.js @@ -2,7 +2,4 @@ var v = { a: 1, b: 2 }; //// [parserObjectLiterals1.js] -var v = { - a: 1, - b: 2 -}; +var v = { a: 1, b: 2 }; diff --git a/tests/baselines/reference/parserParameterList1.js b/tests/baselines/reference/parserParameterList1.js index 49af7780b1f..86b0690728d 100644 --- a/tests/baselines/reference/parserParameterList1.js +++ b/tests/baselines/reference/parserParameterList1.js @@ -7,7 +7,6 @@ class C { var C = (function () { function C() { } - C.prototype.F = function (A, B) { - }; + C.prototype.F = function (A, B) { }; return C; })(); diff --git a/tests/baselines/reference/parserParameterList15.js b/tests/baselines/reference/parserParameterList15.js index 289c65c88c2..83216f12568 100644 --- a/tests/baselines/reference/parserParameterList15.js +++ b/tests/baselines/reference/parserParameterList15.js @@ -3,5 +3,4 @@ function foo(a = 4); function foo(a, b) {} //// [parserParameterList15.js] -function foo(a, b) { -} +function foo(a, b) { } diff --git a/tests/baselines/reference/parserParameterList16.js b/tests/baselines/reference/parserParameterList16.js index 368939bbcdc..50c58215478 100644 --- a/tests/baselines/reference/parserParameterList16.js +++ b/tests/baselines/reference/parserParameterList16.js @@ -8,7 +8,6 @@ class C { var C = (function () { function C() { } - C.prototype.foo = function (a, b) { - }; + C.prototype.foo = function (a, b) { }; return C; })(); diff --git a/tests/baselines/reference/parserParameterList3.js b/tests/baselines/reference/parserParameterList3.js index 01135f0ceff..3992dc548ef 100644 --- a/tests/baselines/reference/parserParameterList3.js +++ b/tests/baselines/reference/parserParameterList3.js @@ -7,7 +7,6 @@ class C { var C = (function () { function C() { } - C.prototype.F = function (A, B) { - }; + C.prototype.F = function (A, B) { }; return C; })(); diff --git a/tests/baselines/reference/parserRealSource1.js b/tests/baselines/reference/parserRealSource1.js index c62897c9aff..d19c2242f0b 100644 --- a/tests/baselines/reference/parserRealSource1.js +++ b/tests/baselines/reference/parserRealSource1.js @@ -189,21 +189,11 @@ var TypeScript; var NullLogger = (function () { function NullLogger() { } - NullLogger.prototype.information = function () { - return false; - }; - NullLogger.prototype.debug = function () { - return false; - }; - NullLogger.prototype.warning = function () { - return false; - }; - NullLogger.prototype.error = function () { - return false; - }; - NullLogger.prototype.fatal = function () { - return false; - }; + NullLogger.prototype.information = function () { return false; }; + NullLogger.prototype.debug = function () { return false; }; + NullLogger.prototype.warning = function () { return false; }; + NullLogger.prototype.error = function () { return false; }; + NullLogger.prototype.fatal = function () { return false; }; NullLogger.prototype.log = function (s) { }; return NullLogger; @@ -218,21 +208,11 @@ var TypeScript; this._error = this.logger.error(); this._fatal = this.logger.fatal(); } - LoggerAdapter.prototype.information = function () { - return this._information; - }; - LoggerAdapter.prototype.debug = function () { - return this._debug; - }; - LoggerAdapter.prototype.warning = function () { - return this._warning; - }; - LoggerAdapter.prototype.error = function () { - return this._error; - }; - LoggerAdapter.prototype.fatal = function () { - return this._fatal; - }; + LoggerAdapter.prototype.information = function () { return this._information; }; + LoggerAdapter.prototype.debug = function () { return this._debug; }; + LoggerAdapter.prototype.warning = function () { return this._warning; }; + LoggerAdapter.prototype.error = function () { return this._error; }; + LoggerAdapter.prototype.fatal = function () { return this._fatal; }; LoggerAdapter.prototype.log = function (s) { this.logger.log(s); }; @@ -243,21 +223,11 @@ var TypeScript; function BufferedLogger() { this.logContents = []; } - BufferedLogger.prototype.information = function () { - return false; - }; - BufferedLogger.prototype.debug = function () { - return false; - }; - BufferedLogger.prototype.warning = function () { - return false; - }; - BufferedLogger.prototype.error = function () { - return false; - }; - BufferedLogger.prototype.fatal = function () { - return false; - }; + BufferedLogger.prototype.information = function () { return false; }; + BufferedLogger.prototype.debug = function () { return false; }; + BufferedLogger.prototype.warning = function () { return false; }; + BufferedLogger.prototype.error = function () { return false; }; + BufferedLogger.prototype.fatal = function () { return false; }; BufferedLogger.prototype.log = function (s) { this.logContents.push(s); }; diff --git a/tests/baselines/reference/parserRealSource10.js b/tests/baselines/reference/parserRealSource10.js index 871b9019edc..2ddc7a8dce2 100644 --- a/tests/baselines/reference/parserRealSource10.js +++ b/tests/baselines/reference/parserRealSource10.js @@ -813,7 +813,8 @@ var TypeScript; else { var tokenInfo = lookupToken(this.tokenId); if (tokenInfo != undefined) { - if ((tokenInfo.unopNodeType != NodeType.None) || (tokenInfo.binopNodeType != NodeType.None)) { + if ((tokenInfo.unopNodeType != NodeType.None) || + (tokenInfo.binopNodeType != NodeType.None)) { return TokenClass.Operator; } } diff --git a/tests/baselines/reference/parserRealSource11.errors.txt b/tests/baselines/reference/parserRealSource11.errors.txt index bf5432062b0..718bda19a67 100644 --- a/tests/baselines/reference/parserRealSource11.errors.txt +++ b/tests/baselines/reference/parserRealSource11.errors.txt @@ -115,6 +115,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(504,58): error tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(506,22): error TS2304: Cannot find name 'NodeType'. tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(507,58): error TS2304: Cannot find name 'TokenID'. tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(518,32): error TS2304: Cannot find name 'NodeType'. +tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(520,29): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(525,27): error TS2304: Cannot find name 'Signature'. tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(527,36): error TS2304: Cannot find name 'TypeFlow'. tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(528,34): error TS2304: Cannot find name 'NodeType'. @@ -246,6 +247,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(963,27): error tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(969,31): error TS2304: Cannot find name 'Symbol'. tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(977,32): error TS2304: Cannot find name 'Symbol'. tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(981,27): error TS2304: Cannot find name 'Type'. +tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(985,29): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(1004,44): error TS2304: Cannot find name 'hasFlag'. tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(1004,67): error TS2304: Cannot find name 'FncFlags'. tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(1005,57): error TS2304: Cannot find name 'FncFlags'. @@ -515,7 +517,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,30): error tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error TS2304: Cannot find name 'TokenID'. -==== tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts (515 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts (517 errors) ==== // 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. @@ -1270,6 +1272,8 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error !!! error TS2304: Cannot find name 'NodeType'. public target: AST, public arguments: ASTList) { + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. super(nodeType); this.minChar = this.target.minChar; } @@ -1997,6 +2001,8 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error constructor (public name: Identifier, public bod: ASTList, public isConstructor: boolean, public arguments: ASTList, public vars: ASTList, public scopes: ASTList, public statics: ASTList, + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. nodeType: number) { super(nodeType); diff --git a/tests/baselines/reference/parserRealSource11.js b/tests/baselines/reference/parserRealSource11.js index 89c38a96fdf..72fec692184 100644 --- a/tests/baselines/reference/parserRealSource11.js +++ b/tests/baselines/reference/parserRealSource11.js @@ -2397,18 +2397,10 @@ var TypeScript; this.postComments = null; this.isParenthesized = false; } - AST.prototype.isExpression = function () { - return false; - }; - AST.prototype.isStatementOrExpression = function () { - return false; - }; - AST.prototype.isCompoundStatement = function () { - return false; - }; - AST.prototype.isLeaf = function () { - return this.isStatementOrExpression() && (!this.isCompoundStatement()); - }; + AST.prototype.isExpression = function () { return false; }; + AST.prototype.isStatementOrExpression = function () { return false; }; + AST.prototype.isCompoundStatement = function () { return false; }; + AST.prototype.isLeaf = function () { return this.isStatementOrExpression() && (!this.isCompoundStatement()); }; AST.prototype.typeCheck = function (typeFlow) { switch (this.nodeType) { case NodeType.Error: @@ -2491,18 +2483,13 @@ var TypeScript; }; AST.prototype.print = function (context) { context.startLine(); - var lineCol = { - line: -1, - col: -1 - }; - var limLineCol = { - line: -1, - col: -1 - }; + var lineCol = { line: -1, col: -1 }; + var limLineCol = { line: -1, col: -1 }; if (context.parser !== null) { context.parser.getSourceLineCol(lineCol, this.minChar); context.parser.getSourceLineCol(limLineCol, this.limChar); - context.write("(" + lineCol.line + "," + lineCol.col + ")--" + "(" + limLineCol.line + "," + limLineCol.col + "): "); + context.write("(" + lineCol.line + "," + lineCol.col + ")--" + + "(" + limLineCol.line + "," + limLineCol.col + "): "); } var lab = this.printLabel(); if (hasFlag(this.flags, ASTFlags.Error)) { @@ -2649,12 +2636,8 @@ var TypeScript; this.text = actualText; } }; - Identifier.prototype.isMissing = function () { - return false; - }; - Identifier.prototype.isLeaf = function () { - return true; - }; + Identifier.prototype.isMissing = function () { return false; }; + Identifier.prototype.isLeaf = function () { return true; }; Identifier.prototype.treeViewLabel = function () { return "id: " + this.actualText; }; @@ -2698,9 +2681,7 @@ var TypeScript; _super.call(this, NodeType.Label); this.id = id; } - Label.prototype.printLabel = function () { - return this.id.actualText + ":"; - }; + Label.prototype.printLabel = function () { return this.id.actualText + ":"; }; Label.prototype.typeCheck = function (typeFlow) { this.type = typeFlow.voidType; return this; @@ -2723,12 +2704,8 @@ var TypeScript; function Expression(nodeType) { _super.call(this, nodeType); } - Expression.prototype.isExpression = function () { - return true; - }; - Expression.prototype.isStatementOrExpression = function () { - return true; - }; + Expression.prototype.isExpression = function () { return true; }; + Expression.prototype.isStatementOrExpression = function () { return true; }; return Expression; })(AST); TypeScript.Expression = Expression; @@ -3189,9 +3166,7 @@ var TypeScript; this.varFlags = VarFlags.None; this.isDynamicImport = false; } - ImportDeclaration.prototype.isStatementOrExpression = function () { - return true; - }; + ImportDeclaration.prototype.isStatementOrExpression = function () { return true; }; ImportDeclaration.prototype.emit = function (emitter, tokenId, startLine) { var mod = this.alias.type; // REVIEW: Only modules may be aliased for now, though there's no real @@ -3252,18 +3227,10 @@ var TypeScript; this.varFlags = VarFlags.None; this.sym = null; } - BoundDecl.prototype.isStatementOrExpression = function () { - return true; - }; - BoundDecl.prototype.isPrivate = function () { - return hasFlag(this.varFlags, VarFlags.Private); - }; - BoundDecl.prototype.isPublic = function () { - return hasFlag(this.varFlags, VarFlags.Public); - }; - BoundDecl.prototype.isProperty = function () { - return hasFlag(this.varFlags, VarFlags.Property); - }; + BoundDecl.prototype.isStatementOrExpression = function () { return true; }; + BoundDecl.prototype.isPrivate = function () { return hasFlag(this.varFlags, VarFlags.Private); }; + BoundDecl.prototype.isPublic = function () { return hasFlag(this.varFlags, VarFlags.Public); }; + BoundDecl.prototype.isProperty = function () { return hasFlag(this.varFlags, VarFlags.Property); }; BoundDecl.prototype.typeCheck = function (typeFlow) { return typeFlow.typeCheckBoundDecl(this); }; @@ -3278,15 +3245,9 @@ var TypeScript; function VarDecl(id, nest) { _super.call(this, id, NodeType.VarDecl, nest); } - VarDecl.prototype.isAmbient = function () { - return hasFlag(this.varFlags, VarFlags.Ambient); - }; - VarDecl.prototype.isExported = function () { - return hasFlag(this.varFlags, VarFlags.Exported); - }; - VarDecl.prototype.isStatic = function () { - return hasFlag(this.varFlags, VarFlags.Static); - }; + VarDecl.prototype.isAmbient = function () { return hasFlag(this.varFlags, VarFlags.Ambient); }; + VarDecl.prototype.isExported = function () { return hasFlag(this.varFlags, VarFlags.Exported); }; + VarDecl.prototype.isStatic = function () { return hasFlag(this.varFlags, VarFlags.Static); }; VarDecl.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitJavascriptVarDecl(this, tokenId); }; @@ -3303,9 +3264,7 @@ var TypeScript; this.isOptional = false; this.parameterPropertySym = null; } - ArgDecl.prototype.isOptionalArg = function () { - return this.isOptional || this.init; - }; + ArgDecl.prototype.isOptionalArg = function () { return this.isOptional || this.init; }; ArgDecl.prototype.treeViewLabel = function () { return "arg: " + this.id.actualText; }; @@ -3366,12 +3325,8 @@ var TypeScript; } return this.internalNameCache; }; - FuncDecl.prototype.hasSelfReference = function () { - return hasFlag(this.fncFlags, FncFlags.HasSelfReference); - }; - FuncDecl.prototype.setHasSelfReference = function () { - this.fncFlags |= FncFlags.HasSelfReference; - }; + FuncDecl.prototype.hasSelfReference = function () { return hasFlag(this.fncFlags, FncFlags.HasSelfReference); }; + FuncDecl.prototype.setHasSelfReference = function () { this.fncFlags |= FncFlags.HasSelfReference; }; FuncDecl.prototype.addCloRef = function (id, sym) { if (this.envids == null) { this.envids = new Identifier[]; @@ -3425,45 +3380,19 @@ var TypeScript; FuncDecl.prototype.isMethod = function () { return (this.fncFlags & FncFlags.Method) != FncFlags.None; }; - FuncDecl.prototype.isCallMember = function () { - return hasFlag(this.fncFlags, FncFlags.CallMember); - }; - FuncDecl.prototype.isConstructMember = function () { - return hasFlag(this.fncFlags, FncFlags.ConstructMember); - }; - FuncDecl.prototype.isIndexerMember = function () { - return hasFlag(this.fncFlags, FncFlags.IndexerMember); - }; - FuncDecl.prototype.isSpecialFn = function () { - return this.isCallMember() || this.isIndexerMember() || this.isConstructMember(); - }; - FuncDecl.prototype.isAnonymousFn = function () { - return this.name === null; - }; - FuncDecl.prototype.isAccessor = function () { - return hasFlag(this.fncFlags, FncFlags.GetAccessor) || hasFlag(this.fncFlags, FncFlags.SetAccessor); - }; - FuncDecl.prototype.isGetAccessor = function () { - return hasFlag(this.fncFlags, FncFlags.GetAccessor); - }; - FuncDecl.prototype.isSetAccessor = function () { - return hasFlag(this.fncFlags, FncFlags.SetAccessor); - }; - FuncDecl.prototype.isAmbient = function () { - return hasFlag(this.fncFlags, FncFlags.Ambient); - }; - FuncDecl.prototype.isExported = function () { - return hasFlag(this.fncFlags, FncFlags.Exported); - }; - FuncDecl.prototype.isPrivate = function () { - return hasFlag(this.fncFlags, FncFlags.Private); - }; - FuncDecl.prototype.isPublic = function () { - return hasFlag(this.fncFlags, FncFlags.Public); - }; - FuncDecl.prototype.isStatic = function () { - return hasFlag(this.fncFlags, FncFlags.Static); - }; + FuncDecl.prototype.isCallMember = function () { return hasFlag(this.fncFlags, FncFlags.CallMember); }; + FuncDecl.prototype.isConstructMember = function () { return hasFlag(this.fncFlags, FncFlags.ConstructMember); }; + FuncDecl.prototype.isIndexerMember = function () { return hasFlag(this.fncFlags, FncFlags.IndexerMember); }; + FuncDecl.prototype.isSpecialFn = function () { return this.isCallMember() || this.isIndexerMember() || this.isConstructMember(); }; + FuncDecl.prototype.isAnonymousFn = function () { return this.name === null; }; + FuncDecl.prototype.isAccessor = function () { return hasFlag(this.fncFlags, FncFlags.GetAccessor) || hasFlag(this.fncFlags, FncFlags.SetAccessor); }; + FuncDecl.prototype.isGetAccessor = function () { return hasFlag(this.fncFlags, FncFlags.GetAccessor); }; + FuncDecl.prototype.isSetAccessor = function () { return hasFlag(this.fncFlags, FncFlags.SetAccessor); }; + FuncDecl.prototype.isAmbient = function () { return hasFlag(this.fncFlags, FncFlags.Ambient); }; + FuncDecl.prototype.isExported = function () { return hasFlag(this.fncFlags, FncFlags.Exported); }; + FuncDecl.prototype.isPrivate = function () { return hasFlag(this.fncFlags, FncFlags.Private); }; + FuncDecl.prototype.isPublic = function () { return hasFlag(this.fncFlags, FncFlags.Public); }; + FuncDecl.prototype.isStatic = function () { return hasFlag(this.fncFlags, FncFlags.Static); }; FuncDecl.prototype.treeViewLabel = function () { if (this.name == null) { return "funcExpr"; @@ -3475,12 +3404,8 @@ var TypeScript; FuncDecl.prototype.ClearFlags = function () { this.fncFlags = FncFlags.None; }; - FuncDecl.prototype.isSignature = function () { - return (this.fncFlags & FncFlags.Signature) != FncFlags.None; - }; - FuncDecl.prototype.hasStaticDeclarations = function () { - return (!this.isConstructor && (this.statics.members.length > 0 || this.innerStaticFuncs.length > 0)); - }; + FuncDecl.prototype.isSignature = function () { return (this.fncFlags & FncFlags.Signature) != FncFlags.None; }; + FuncDecl.prototype.hasStaticDeclarations = function () { return (!this.isConstructor && (this.statics.members.length > 0 || this.innerStaticFuncs.length > 0)); }; return FuncDecl; })(AST); TypeScript.FuncDecl = FuncDecl; @@ -3589,15 +3514,9 @@ var TypeScript; this.scopes = scopes; this.prettyName = this.name.actualText; } - ModuleDeclaration.prototype.isExported = function () { - return hasFlag(this.modFlags, ModuleFlags.Exported); - }; - ModuleDeclaration.prototype.isAmbient = function () { - return hasFlag(this.modFlags, ModuleFlags.Ambient); - }; - ModuleDeclaration.prototype.isEnum = function () { - return hasFlag(this.modFlags, ModuleFlags.IsEnum); - }; + ModuleDeclaration.prototype.isExported = function () { return hasFlag(this.modFlags, ModuleFlags.Exported); }; + ModuleDeclaration.prototype.isAmbient = function () { return hasFlag(this.modFlags, ModuleFlags.Ambient); }; + ModuleDeclaration.prototype.isEnum = function () { return hasFlag(this.modFlags, ModuleFlags.IsEnum); }; ModuleDeclaration.prototype.recordNonInterface = function () { this.modFlags &= ~ModuleFlags.ShouldEmitModuleDecl; }; @@ -3670,15 +3589,9 @@ var TypeScript; _super.call(this, nodeType); this.flags |= ASTFlags.IsStatement; } - Statement.prototype.isLoop = function () { - return false; - }; - Statement.prototype.isStatementOrExpression = function () { - return true; - }; - Statement.prototype.isCompoundStatement = function () { - return this.isLoop(); - }; + Statement.prototype.isLoop = function () { return false; }; + Statement.prototype.isStatementOrExpression = function () { return true; }; + Statement.prototype.isCompoundStatement = function () { return this.isLoop(); }; Statement.prototype.typeCheck = function (typeFlow) { this.type = typeFlow.voidType; return this; @@ -3782,9 +3695,7 @@ var TypeScript; this.target = null; this.resolvedTarget = null; } - Jump.prototype.hasExplicitTarget = function () { - return (this.target); - }; + Jump.prototype.hasExplicitTarget = function () { return (this.target); }; Jump.prototype.setResolvedTarget = function (parser, stmt) { if (stmt.isLoop()) { this.resolvedTarget = stmt; @@ -3835,9 +3746,7 @@ var TypeScript; this.cond = cond; this.body = null; } - WhileStatement.prototype.isLoop = function () { - return true; - }; + WhileStatement.prototype.isLoop = function () { return true; }; WhileStatement.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); emitter.recordSourceMappingStart(this); @@ -3890,9 +3799,7 @@ var TypeScript; this.whileAST = null; this.cond = null; } - DoWhileStatement.prototype.isLoop = function () { - return true; - }; + DoWhileStatement.prototype.isLoop = function () { return true; }; DoWhileStatement.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); emitter.recordSourceMappingStart(this); @@ -3948,9 +3855,7 @@ var TypeScript; this.elseBod = null; this.statement = new ASTSpan(); } - IfStatement.prototype.isCompoundStatement = function () { - return true; - }; + IfStatement.prototype.isCompoundStatement = function () { return true; }; IfStatement.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); emitter.recordSourceMappingStart(this); @@ -4070,9 +3975,7 @@ var TypeScript; this.lval.varFlags |= VarFlags.AutoInit; } } - ForInStatement.prototype.isLoop = function () { - return true; - }; + ForInStatement.prototype.isLoop = function () { return true; }; ForInStatement.prototype.isFiltered = function () { if (this.body) { var singleItem = null; @@ -4099,13 +4002,16 @@ var TypeScript; var target = cond.target; if (target.nodeType == NodeType.Dot) { var binex = target; - if ((binex.operand1.nodeType == NodeType.Name) && (this.obj.nodeType == NodeType.Name) && (binex.operand1.actualText == this.obj.actualText)) { + if ((binex.operand1.nodeType == NodeType.Name) && + (this.obj.nodeType == NodeType.Name) && + (binex.operand1.actualText == this.obj.actualText)) { var prop = binex.operand2; if (prop.actualText == "hasOwnProperty") { var args = cond.arguments; if ((args !== null) && (args.members.length == 1)) { var arg = args.members[0]; - if ((arg.nodeType == NodeType.Name) && (this.lval.nodeType == NodeType.Name)) { + if ((arg.nodeType == NodeType.Name) && + (this.lval.nodeType == NodeType.Name)) { if ((this.lval.actualText) == arg.actualText) { return true; } @@ -4179,9 +4085,7 @@ var TypeScript; _super.call(this, NodeType.For); this.init = init; } - ForStatement.prototype.isLoop = function () { - return true; - }; + ForStatement.prototype.isLoop = function () { return true; }; ForStatement.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); emitter.recordSourceMappingStart(this); @@ -4273,9 +4177,7 @@ var TypeScript; this.expr = expr; this.withSym = null; } - WithStatement.prototype.isCompoundStatement = function () { - return true; - }; + WithStatement.prototype.isCompoundStatement = function () { return true; }; WithStatement.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); emitter.recordSourceMappingStart(this); @@ -4302,9 +4204,7 @@ var TypeScript; this.defaultCase = null; this.statement = new ASTSpan(); } - SwitchStatement.prototype.isCompoundStatement = function () { - return true; - }; + SwitchStatement.prototype.isCompoundStatement = function () { return true; }; SwitchStatement.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); emitter.recordSourceMappingStart(this); @@ -4458,9 +4358,7 @@ var TypeScript; this.tryNode = tryNode; this.finallyNode = finallyNode; } - TryFinally.prototype.isCompoundStatement = function () { - return true; - }; + TryFinally.prototype.isCompoundStatement = function () { return true; }; TryFinally.prototype.emit = function (emitter, tokenId, startLine) { emitter.recordSourceMappingStart(this); emitter.emitJavascript(this.tryNode, TokenID.Try, false); @@ -4505,9 +4403,7 @@ var TypeScript; this.tryNode = tryNode; this.catchNode = catchNode; } - TryCatch.prototype.isCompoundStatement = function () { - return true; - }; + TryCatch.prototype.isCompoundStatement = function () { return true; }; TryCatch.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); emitter.recordSourceMappingStart(this); @@ -4697,9 +4593,7 @@ var TypeScript; } } else { - this.text = [ - (this.content.replace(/^\s+|\s+$/g, '')) - ]; + this.text = [(this.content.replace(/^\s+|\s+$/g, ''))]; } } return this.text; diff --git a/tests/baselines/reference/parserRealSource14.js b/tests/baselines/reference/parserRealSource14.js index f36f00235ff..4312cb38517 100644 --- a/tests/baselines/reference/parserRealSource14.js +++ b/tests/baselines/reference/parserRealSource14.js @@ -607,9 +607,7 @@ var TypeScript; }; AstPath.prototype.clone = function () { var clone = new AstPath(); - clone.asts = this.asts.map(function (value) { - return value; - }); + clone.asts = this.asts.map(function (value) { return value; }); clone.top = this.top; return clone; }; @@ -658,167 +656,288 @@ var TypeScript; AstPath.prototype.isNameOfClass = function () { if (this.ast() === null || this.parent() === null) return false; - return (this.ast().nodeType === TypeScript.NodeType.Name) && (this.parent().nodeType === TypeScript.NodeType.ClassDeclaration) && (this.parent().name === this.ast()); + return (this.ast().nodeType === TypeScript.NodeType.Name) && + (this.parent().nodeType === TypeScript.NodeType.ClassDeclaration) && + (this.parent().name === this.ast()); }; AstPath.prototype.isNameOfInterface = function () { if (this.ast() === null || this.parent() === null) return false; - return (this.ast().nodeType === TypeScript.NodeType.Name) && (this.parent().nodeType === TypeScript.NodeType.InterfaceDeclaration) && (this.parent().name === this.ast()); + return (this.ast().nodeType === TypeScript.NodeType.Name) && + (this.parent().nodeType === TypeScript.NodeType.InterfaceDeclaration) && + (this.parent().name === this.ast()); }; AstPath.prototype.isNameOfArgument = function () { if (this.ast() === null || this.parent() === null) return false; - return (this.ast().nodeType === TypeScript.NodeType.Name) && (this.parent().nodeType === TypeScript.NodeType.ArgDecl) && (this.parent().id === this.ast()); + return (this.ast().nodeType === TypeScript.NodeType.Name) && + (this.parent().nodeType === TypeScript.NodeType.ArgDecl) && + (this.parent().id === this.ast()); }; AstPath.prototype.isNameOfVariable = function () { if (this.ast() === null || this.parent() === null) return false; - return (this.ast().nodeType === TypeScript.NodeType.Name) && (this.parent().nodeType === TypeScript.NodeType.VarDecl) && (this.parent().id === this.ast()); + return (this.ast().nodeType === TypeScript.NodeType.Name) && + (this.parent().nodeType === TypeScript.NodeType.VarDecl) && + (this.parent().id === this.ast()); }; AstPath.prototype.isNameOfModule = function () { if (this.ast() === null || this.parent() === null) return false; - return (this.ast().nodeType === TypeScript.NodeType.Name) && (this.parent().nodeType === TypeScript.NodeType.ModuleDeclaration) && (this.parent().name === this.ast()); + return (this.ast().nodeType === TypeScript.NodeType.Name) && + (this.parent().nodeType === TypeScript.NodeType.ModuleDeclaration) && + (this.parent().name === this.ast()); }; AstPath.prototype.isNameOfFunction = function () { if (this.ast() === null || this.parent() === null) return false; - return (this.ast().nodeType === TypeScript.NodeType.Name) && (this.parent().nodeType === TypeScript.NodeType.FuncDecl) && (this.parent().name === this.ast()); + return (this.ast().nodeType === TypeScript.NodeType.Name) && + (this.parent().nodeType === TypeScript.NodeType.FuncDecl) && + (this.parent().name === this.ast()); }; AstPath.prototype.isChildOfScript = function () { var ast = lastOf(this.asts); - return this.count() >= 3 && this.asts[this.top] === ast && this.asts[this.top - 1].nodeType === TypeScript.NodeType.List && this.asts[this.top - 2].nodeType === TypeScript.NodeType.Script; + return this.count() >= 3 && + this.asts[this.top] === ast && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.List && + this.asts[this.top - 2].nodeType === TypeScript.NodeType.Script; }; AstPath.prototype.isChildOfModule = function () { var ast = lastOf(this.asts); - return this.count() >= 3 && this.asts[this.top] === ast && this.asts[this.top - 1].nodeType === TypeScript.NodeType.List && this.asts[this.top - 2].nodeType === TypeScript.NodeType.ModuleDeclaration; + return this.count() >= 3 && + this.asts[this.top] === ast && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.List && + this.asts[this.top - 2].nodeType === TypeScript.NodeType.ModuleDeclaration; }; AstPath.prototype.isChildOfClass = function () { var ast = lastOf(this.asts); - return this.count() >= 3 && this.asts[this.top] === ast && this.asts[this.top - 1].nodeType === TypeScript.NodeType.List && this.asts[this.top - 2].nodeType === TypeScript.NodeType.ClassDeclaration; + return this.count() >= 3 && + this.asts[this.top] === ast && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.List && + this.asts[this.top - 2].nodeType === TypeScript.NodeType.ClassDeclaration; }; AstPath.prototype.isArgumentOfClassConstructor = function () { var ast = lastOf(this.asts); - return this.count() >= 5 && this.asts[this.top] === ast && this.asts[this.top - 1].nodeType === TypeScript.NodeType.List && this.asts[this.top - 2].nodeType === TypeScript.NodeType.FuncDecl && this.asts[this.top - 3].nodeType === TypeScript.NodeType.List && this.asts[this.top - 4].nodeType === TypeScript.NodeType.ClassDeclaration && (this.asts[this.top - 2].isConstructor) && (this.asts[this.top - 2].arguments === this.asts[this.top - 1]) && (this.asts[this.top - 4].constructorDecl === this.asts[this.top - 2]); + return this.count() >= 5 && + this.asts[this.top] === ast && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.List && + this.asts[this.top - 2].nodeType === TypeScript.NodeType.FuncDecl && + this.asts[this.top - 3].nodeType === TypeScript.NodeType.List && + this.asts[this.top - 4].nodeType === TypeScript.NodeType.ClassDeclaration && + (this.asts[this.top - 2].isConstructor) && + (this.asts[this.top - 2].arguments === this.asts[this.top - 1]) && + (this.asts[this.top - 4].constructorDecl === this.asts[this.top - 2]); }; AstPath.prototype.isChildOfInterface = function () { var ast = lastOf(this.asts); - return this.count() >= 3 && this.asts[this.top] === ast && this.asts[this.top - 1].nodeType === TypeScript.NodeType.List && this.asts[this.top - 2].nodeType === TypeScript.NodeType.InterfaceDeclaration; + return this.count() >= 3 && + this.asts[this.top] === ast && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.List && + this.asts[this.top - 2].nodeType === TypeScript.NodeType.InterfaceDeclaration; }; AstPath.prototype.isTopLevelImplicitModule = function () { - return this.count() >= 1 && this.asts[this.top].nodeType === TypeScript.NodeType.ModuleDeclaration && TypeScript.hasFlag(this.asts[this.top].modFlags, TypeScript.ModuleFlags.IsWholeFile); + return this.count() >= 1 && + this.asts[this.top].nodeType === TypeScript.NodeType.ModuleDeclaration && + TypeScript.hasFlag(this.asts[this.top].modFlags, TypeScript.ModuleFlags.IsWholeFile); }; AstPath.prototype.isBodyOfTopLevelImplicitModule = function () { - return this.count() >= 2 && this.asts[this.top - 0].nodeType === TypeScript.NodeType.List && this.asts[this.top - 1].nodeType === TypeScript.NodeType.ModuleDeclaration && this.asts[this.top - 1].members == this.asts[this.top - 0] && TypeScript.hasFlag(this.asts[this.top - 1].modFlags, TypeScript.ModuleFlags.IsWholeFile); + return this.count() >= 2 && + this.asts[this.top - 0].nodeType === TypeScript.NodeType.List && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.ModuleDeclaration && + this.asts[this.top - 1].members == this.asts[this.top - 0] && + TypeScript.hasFlag(this.asts[this.top - 1].modFlags, TypeScript.ModuleFlags.IsWholeFile); }; AstPath.prototype.isBodyOfScript = function () { - return this.count() >= 2 && this.asts[this.top - 1].nodeType === TypeScript.NodeType.Script && this.asts[this.top - 1].bod == this.asts[this.top - 0]; + return this.count() >= 2 && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.Script && + this.asts[this.top - 1].bod == this.asts[this.top - 0]; }; AstPath.prototype.isBodyOfSwitch = function () { - return this.count() >= 2 && this.asts[this.top - 1].nodeType === TypeScript.NodeType.Switch && this.asts[this.top - 1].caseList == this.asts[this.top - 0]; + return this.count() >= 2 && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.Switch && + this.asts[this.top - 1].caseList == this.asts[this.top - 0]; }; AstPath.prototype.isBodyOfModule = function () { - return this.count() >= 2 && this.asts[this.top - 1].nodeType === TypeScript.NodeType.ModuleDeclaration && this.asts[this.top - 1].members == this.asts[this.top - 0]; + return this.count() >= 2 && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.ModuleDeclaration && + this.asts[this.top - 1].members == this.asts[this.top - 0]; }; AstPath.prototype.isBodyOfClass = function () { - return this.count() >= 2 && this.asts[this.top - 1].nodeType === TypeScript.NodeType.ClassDeclaration && this.asts[this.top - 1].members == this.asts[this.top - 0]; + return this.count() >= 2 && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.ClassDeclaration && + this.asts[this.top - 1].members == this.asts[this.top - 0]; }; AstPath.prototype.isBodyOfFunction = function () { - return this.count() >= 2 && this.asts[this.top - 1].nodeType === TypeScript.NodeType.FuncDecl && this.asts[this.top - 1].bod == this.asts[this.top - 0]; + return this.count() >= 2 && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.FuncDecl && + this.asts[this.top - 1].bod == this.asts[this.top - 0]; }; AstPath.prototype.isBodyOfInterface = function () { - return this.count() >= 2 && this.asts[this.top - 1].nodeType === TypeScript.NodeType.InterfaceDeclaration && this.asts[this.top - 1].members == this.asts[this.top - 0]; + return this.count() >= 2 && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.InterfaceDeclaration && + this.asts[this.top - 1].members == this.asts[this.top - 0]; }; AstPath.prototype.isBodyOfBlock = function () { - return this.count() >= 2 && this.asts[this.top - 1].nodeType === TypeScript.NodeType.Block && this.asts[this.top - 1].statements == this.asts[this.top - 0]; + return this.count() >= 2 && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.Block && + this.asts[this.top - 1].statements == this.asts[this.top - 0]; }; AstPath.prototype.isBodyOfFor = function () { - return this.count() >= 2 && this.asts[this.top - 1].nodeType === TypeScript.NodeType.For && this.asts[this.top - 1].body == this.asts[this.top - 0]; + return this.count() >= 2 && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.For && + this.asts[this.top - 1].body == this.asts[this.top - 0]; }; AstPath.prototype.isBodyOfCase = function () { - return this.count() >= 2 && this.asts[this.top - 1].nodeType === TypeScript.NodeType.Case && this.asts[this.top - 1].body == this.asts[this.top - 0]; + return this.count() >= 2 && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.Case && + this.asts[this.top - 1].body == this.asts[this.top - 0]; }; AstPath.prototype.isBodyOfTry = function () { - return this.count() >= 2 && this.asts[this.top - 1].nodeType === TypeScript.NodeType.Try && this.asts[this.top - 1].body == this.asts[this.top - 0]; + return this.count() >= 2 && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.Try && + this.asts[this.top - 1].body == this.asts[this.top - 0]; }; AstPath.prototype.isBodyOfCatch = function () { - return this.count() >= 2 && this.asts[this.top - 1].nodeType === TypeScript.NodeType.Catch && this.asts[this.top - 1].body == this.asts[this.top - 0]; + return this.count() >= 2 && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.Catch && + this.asts[this.top - 1].body == this.asts[this.top - 0]; }; AstPath.prototype.isBodyOfDoWhile = function () { - return this.count() >= 2 && this.asts[this.top - 1].nodeType === TypeScript.NodeType.DoWhile && this.asts[this.top - 1].body == this.asts[this.top - 0]; + return this.count() >= 2 && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.DoWhile && + this.asts[this.top - 1].body == this.asts[this.top - 0]; }; AstPath.prototype.isBodyOfWhile = function () { - return this.count() >= 2 && this.asts[this.top - 1].nodeType === TypeScript.NodeType.While && this.asts[this.top - 1].body == this.asts[this.top - 0]; + return this.count() >= 2 && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.While && + this.asts[this.top - 1].body == this.asts[this.top - 0]; }; AstPath.prototype.isBodyOfForIn = function () { - return this.count() >= 2 && this.asts[this.top - 1].nodeType === TypeScript.NodeType.ForIn && this.asts[this.top - 1].body == this.asts[this.top - 0]; + return this.count() >= 2 && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.ForIn && + this.asts[this.top - 1].body == this.asts[this.top - 0]; }; AstPath.prototype.isBodyOfWith = function () { - return this.count() >= 2 && this.asts[this.top - 1].nodeType === TypeScript.NodeType.With && this.asts[this.top - 1].body == this.asts[this.top - 0]; + return this.count() >= 2 && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.With && + this.asts[this.top - 1].body == this.asts[this.top - 0]; }; AstPath.prototype.isBodyOfFinally = function () { - return this.count() >= 2 && this.asts[this.top - 1].nodeType === TypeScript.NodeType.Finally && this.asts[this.top - 1].body == this.asts[this.top - 0]; + return this.count() >= 2 && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.Finally && + this.asts[this.top - 1].body == this.asts[this.top - 0]; }; AstPath.prototype.isCaseOfSwitch = function () { - return this.count() >= 3 && this.asts[this.top - 2].nodeType === TypeScript.NodeType.Switch && this.asts[this.top - 1].nodeType === TypeScript.NodeType.List && this.asts[this.top - 2].caseList == this.asts[this.top - 1]; + return this.count() >= 3 && + this.asts[this.top - 2].nodeType === TypeScript.NodeType.Switch && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.List && + this.asts[this.top - 2].caseList == this.asts[this.top - 1]; }; AstPath.prototype.isDefaultCaseOfSwitch = function () { - return this.count() >= 3 && this.asts[this.top - 2].nodeType === TypeScript.NodeType.Switch && this.asts[this.top - 1].nodeType === TypeScript.NodeType.List && this.asts[this.top - 2].caseList == this.asts[this.top - 1] && this.asts[this.top - 2].defaultCase == this.asts[this.top - 0]; + return this.count() >= 3 && + this.asts[this.top - 2].nodeType === TypeScript.NodeType.Switch && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.List && + this.asts[this.top - 2].caseList == this.asts[this.top - 1] && + this.asts[this.top - 2].defaultCase == this.asts[this.top - 0]; }; AstPath.prototype.isListOfObjectLit = function () { - return this.count() >= 2 && this.asts[this.top - 1].nodeType === TypeScript.NodeType.ObjectLit && this.asts[this.top - 0].nodeType === TypeScript.NodeType.List && this.asts[this.top - 1].operand == this.asts[this.top - 0]; + return this.count() >= 2 && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.ObjectLit && + this.asts[this.top - 0].nodeType === TypeScript.NodeType.List && + this.asts[this.top - 1].operand == this.asts[this.top - 0]; }; AstPath.prototype.isBodyOfObjectLit = function () { return this.isListOfObjectLit(); }; AstPath.prototype.isEmptyListOfObjectLit = function () { - return this.count() >= 2 && this.asts[this.top - 1].nodeType === TypeScript.NodeType.ObjectLit && this.asts[this.top - 0].nodeType === TypeScript.NodeType.List && this.asts[this.top - 1].operand == this.asts[this.top - 0] && this.asts[this.top - 0].members.length == 0; + return this.count() >= 2 && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.ObjectLit && + this.asts[this.top - 0].nodeType === TypeScript.NodeType.List && + this.asts[this.top - 1].operand == this.asts[this.top - 0] && + this.asts[this.top - 0].members.length == 0; }; AstPath.prototype.isMemberOfObjectLit = function () { - return this.count() >= 3 && this.asts[this.top - 2].nodeType === TypeScript.NodeType.ObjectLit && this.asts[this.top - 1].nodeType === TypeScript.NodeType.List && this.asts[this.top - 0].nodeType === TypeScript.NodeType.Member && this.asts[this.top - 2].operand == this.asts[this.top - 1]; + return this.count() >= 3 && + this.asts[this.top - 2].nodeType === TypeScript.NodeType.ObjectLit && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.List && + this.asts[this.top - 0].nodeType === TypeScript.NodeType.Member && + this.asts[this.top - 2].operand == this.asts[this.top - 1]; }; AstPath.prototype.isNameOfMemberOfObjectLit = function () { - return this.count() >= 4 && this.asts[this.top - 3].nodeType === TypeScript.NodeType.ObjectLit && this.asts[this.top - 2].nodeType === TypeScript.NodeType.List && this.asts[this.top - 1].nodeType === TypeScript.NodeType.Member && this.asts[this.top - 0].nodeType === TypeScript.NodeType.Name && this.asts[this.top - 3].operand == this.asts[this.top - 2]; + return this.count() >= 4 && + this.asts[this.top - 3].nodeType === TypeScript.NodeType.ObjectLit && + this.asts[this.top - 2].nodeType === TypeScript.NodeType.List && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.Member && + this.asts[this.top - 0].nodeType === TypeScript.NodeType.Name && + this.asts[this.top - 3].operand == this.asts[this.top - 2]; }; AstPath.prototype.isListOfArrayLit = function () { - return this.count() >= 2 && this.asts[this.top - 1].nodeType === TypeScript.NodeType.ArrayLit && this.asts[this.top - 0].nodeType === TypeScript.NodeType.List && this.asts[this.top - 1].operand == this.asts[this.top - 0]; + return this.count() >= 2 && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.ArrayLit && + this.asts[this.top - 0].nodeType === TypeScript.NodeType.List && + this.asts[this.top - 1].operand == this.asts[this.top - 0]; }; AstPath.prototype.isTargetOfMember = function () { - return this.count() >= 2 && this.asts[this.top - 1].nodeType === TypeScript.NodeType.Member && this.asts[this.top - 1].operand1 === this.asts[this.top - 0]; + return this.count() >= 2 && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.Member && + this.asts[this.top - 1].operand1 === this.asts[this.top - 0]; }; AstPath.prototype.isMemberOfMember = function () { - return this.count() >= 2 && this.asts[this.top - 1].nodeType === TypeScript.NodeType.Member && this.asts[this.top - 1].operand2 === this.asts[this.top - 0]; + return this.count() >= 2 && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.Member && + this.asts[this.top - 1].operand2 === this.asts[this.top - 0]; }; AstPath.prototype.isItemOfList = function () { - return this.count() >= 2 && this.asts[this.top - 1].nodeType === TypeScript.NodeType.List; + return this.count() >= 2 && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.List; //(this.asts[this.top - 1]).operand2 === this.asts[this.top - 0]; }; AstPath.prototype.isThenOfIf = function () { - return this.count() >= 2 && this.asts[this.top - 1].nodeType === TypeScript.NodeType.If && this.asts[this.top - 1].thenBod == this.asts[this.top - 0]; + return this.count() >= 2 && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.If && + this.asts[this.top - 1].thenBod == this.asts[this.top - 0]; }; AstPath.prototype.isElseOfIf = function () { - return this.count() >= 2 && this.asts[this.top - 1].nodeType === TypeScript.NodeType.If && this.asts[this.top - 1].elseBod == this.asts[this.top - 0]; + return this.count() >= 2 && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.If && + this.asts[this.top - 1].elseBod == this.asts[this.top - 0]; }; AstPath.prototype.isBodyOfDefaultCase = function () { return this.isBodyOfCase(); }; AstPath.prototype.isSingleStatementList = function () { - return this.count() >= 1 && this.asts[this.top].nodeType === TypeScript.NodeType.List && this.asts[this.top].members.length === 1; + return this.count() >= 1 && + this.asts[this.top].nodeType === TypeScript.NodeType.List && + this.asts[this.top].members.length === 1; }; AstPath.prototype.isArgumentListOfFunction = function () { - return this.count() >= 2 && this.asts[this.top - 0].nodeType === TypeScript.NodeType.List && this.asts[this.top - 1].nodeType === TypeScript.NodeType.FuncDecl && this.asts[this.top - 1].arguments === this.asts[this.top - 0]; + return this.count() >= 2 && + this.asts[this.top - 0].nodeType === TypeScript.NodeType.List && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.FuncDecl && + this.asts[this.top - 1].arguments === this.asts[this.top - 0]; }; AstPath.prototype.isArgumentOfFunction = function () { - return this.count() >= 3 && this.asts[this.top - 1].nodeType === TypeScript.NodeType.List && this.asts[this.top - 2].nodeType === TypeScript.NodeType.FuncDecl && this.asts[this.top - 2].arguments === this.asts[this.top - 1]; + return this.count() >= 3 && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.List && + this.asts[this.top - 2].nodeType === TypeScript.NodeType.FuncDecl && + this.asts[this.top - 2].arguments === this.asts[this.top - 1]; }; AstPath.prototype.isArgumentListOfCall = function () { - return this.count() >= 2 && this.asts[this.top - 0].nodeType === TypeScript.NodeType.List && this.asts[this.top - 1].nodeType === TypeScript.NodeType.Call && this.asts[this.top - 1].arguments === this.asts[this.top - 0]; + return this.count() >= 2 && + this.asts[this.top - 0].nodeType === TypeScript.NodeType.List && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.Call && + this.asts[this.top - 1].arguments === this.asts[this.top - 0]; }; AstPath.prototype.isArgumentListOfNew = function () { - return this.count() >= 2 && this.asts[this.top - 0].nodeType === TypeScript.NodeType.List && this.asts[this.top - 1].nodeType === TypeScript.NodeType.New && this.asts[this.top - 1].arguments === this.asts[this.top - 0]; + return this.count() >= 2 && + this.asts[this.top - 0].nodeType === TypeScript.NodeType.List && + this.asts[this.top - 1].nodeType === TypeScript.NodeType.New && + this.asts[this.top - 1].arguments === this.asts[this.top - 0]; }; AstPath.prototype.isSynthesizedBlock = function () { - return this.count() >= 1 && this.asts[this.top - 0].nodeType === TypeScript.NodeType.Block && this.asts[this.top - 0].isStatementBlock === false; + return this.count() >= 1 && + this.asts[this.top - 0].nodeType === TypeScript.NodeType.Block && + this.asts[this.top - 0].isStatementBlock === false; }; return AstPath; })(); @@ -879,7 +998,9 @@ var TypeScript; // bar // 0123 // If "position == 3", the caret is at the "right" of the "r" character, which should be considered valid - var inclusive = hasFlag(options, GetAstPathOptions.EdgeInclusive) || cur.nodeType === TypeScript.NodeType.Name || pos === script.limChar; // Special "EOF" case + var inclusive = hasFlag(options, GetAstPathOptions.EdgeInclusive) || + cur.nodeType === TypeScript.NodeType.Name || + pos === script.limChar; // Special "EOF" case var minChar = cur.minChar; var limChar = cur.limChar + (inclusive ? 1 : 0); if (pos >= minChar && pos < limChar) { diff --git a/tests/baselines/reference/parserRealSource4.js b/tests/baselines/reference/parserRealSource4.js index 1d6ed0aaf13..563e9e92a08 100644 --- a/tests/baselines/reference/parserRealSource4.js +++ b/tests/baselines/reference/parserRealSource4.js @@ -377,9 +377,7 @@ var TypeScript; } return false; }; - StringHashTable.prototype.count = function () { - return this.itemCount; - }; + StringHashTable.prototype.count = function () { return this.itemCount; }; StringHashTable.prototype.lookup = function (key) { var data = this.table[key]; if (data != undefined) { @@ -515,9 +513,7 @@ var TypeScript; } return result; }; - HashTable.prototype.count = function () { - return this.itemCount; - }; + HashTable.prototype.count = function () { return this.itemCount; }; HashTable.prototype.lookup = function (key) { var current; var val = this.hashFn(key); diff --git a/tests/baselines/reference/parserRealSource6.js b/tests/baselines/reference/parserRealSource6.js index e747b95e610..d65207b8c77 100644 --- a/tests/baselines/reference/parserRealSource6.js +++ b/tests/baselines/reference/parserRealSource6.js @@ -329,7 +329,8 @@ var TypeScript; // is has not been fully re-parsed yet. if (ast.nodeType == NodeType.Script && context.pos > limChar) limChar = context.pos; - if ((minChar <= context.pos) && (limChar >= context.pos)) { + if ((minChar <= context.pos) && + (limChar >= context.pos)) { switch (ast.nodeType) { case NodeType.Script: var script = ast; diff --git a/tests/baselines/reference/parserRealSource7.js b/tests/baselines/reference/parserRealSource7.js index 73b9aab5017..5073c33febd 100644 --- a/tests/baselines/reference/parserRealSource7.js +++ b/tests/baselines/reference/parserRealSource7.js @@ -962,11 +962,7 @@ var TypeScript; var importDecl = ast; var isExported = hasFlag(importDecl.varFlags, VarFlags.Exported); // REVIEW: technically, this call isn't strictly necessary, since we'll find the type during the call to resolveTypeMembers - var aliasedModSymbol = findSymbolFromAlias(importDecl.alias, { - topLevelScope: scopeChain, - members: null, - tcContext: context - }); + var aliasedModSymbol = findSymbolFromAlias(importDecl.alias, { topLevelScope: scopeChain, members: null, tcContext: context }); var isGlobal = context.scopeChain.container == context.checker.gloMod; if (aliasedModSymbol) { var aliasedModType = aliasedModSymbol.getType(); @@ -1057,7 +1053,8 @@ var TypeScript; if (isExported) { typeSymbol.flags |= SymbolFlags.Exported; } - if ((context.scopeChain.moduleDecl) || (context.scopeChain.container == context.checker.gloMod)) { + if ((context.scopeChain.moduleDecl) || + (context.scopeChain.container == context.checker.gloMod)) { typeSymbol.flags |= SymbolFlags.ModuleMember; } moduleDecl.mod = modType; @@ -1083,7 +1080,11 @@ var TypeScript; // REVIEW-CLASSES if (!typeSymbol) { var valTypeSymbol = scopeChain.scope.findLocal(className, false, false); - if (valTypeSymbol && valTypeSymbol.isType() && valTypeSymbol.declAST && valTypeSymbol.declAST.nodeType == NodeType.FuncDecl && valTypeSymbol.declAST.isSignature()) { + if (valTypeSymbol && + valTypeSymbol.isType() && + valTypeSymbol.declAST && + valTypeSymbol.declAST.nodeType == NodeType.FuncDecl && + valTypeSymbol.declAST.isSignature()) { typeSymbol = valTypeSymbol; foundValSymbol = true; if (isExported) { @@ -1237,7 +1238,10 @@ var TypeScript; if (context.scopeChain.moduleDecl) { context.scopeChain.moduleDecl.recordNonInterface(); } - if (isProperty || isExported || (context.scopeChain.container == context.checker.gloMod) || context.scopeChain.moduleDecl) { + if (isProperty || + isExported || + (context.scopeChain.container == context.checker.gloMod) || + context.scopeChain.moduleDecl) { if (isAmbient) { var existingSym = scopeChain.scope.findLocal(varDecl.id.text, false, false); if (existingSym) { @@ -1258,7 +1262,8 @@ var TypeScript; } field.symbol = fieldSymbol; fieldSymbol.declAST = ast; - if ((context.scopeChain.moduleDecl) || (context.scopeChain.container == context.checker.gloMod)) { + if ((context.scopeChain.moduleDecl) || + (context.scopeChain.container == context.checker.gloMod)) { fieldSymbol.flags |= SymbolFlags.ModuleMember; fieldSymbol.declModule = context.scopeChain.moduleDecl; } @@ -1309,7 +1314,12 @@ var TypeScript; // If the parent is the constructor, and this isn't an instance method, skip it. // That way, we'll set the type during scope assignment, and can be sure that the // function will be placed in the constructor-local scope - if (!funcDecl.isConstructor && containerSym && containerSym.declAST && containerSym.declAST.nodeType == NodeType.FuncDecl && containerSym.declAST.isConstructor && !funcDecl.isMethod()) { + if (!funcDecl.isConstructor && + containerSym && + containerSym.declAST && + containerSym.declAST.nodeType == NodeType.FuncDecl && + containerSym.declAST.isConstructor && + !funcDecl.isMethod()) { return go; } // Interfaces and overloads @@ -1398,7 +1408,14 @@ var TypeScript; } } // REVIEW: Move this check into the typecheck phase? It's only being run over properties... - if (fgSym && !fgSym.isAccessor() && fgSym.type && fgSym.type.construct && fgSym.type.construct.signatures != [] && (fgSym.type.construct.signatures[0].declAST == null || !hasFlag(fgSym.type.construct.signatures[0].declAST.fncFlags, FncFlags.Ambient)) && !funcDecl.isConstructor) { + if (fgSym && + !fgSym.isAccessor() && + fgSym.type && + fgSym.type.construct && + fgSym.type.construct.signatures != [] && + (fgSym.type.construct.signatures[0].declAST == null || + !hasFlag(fgSym.type.construct.signatures[0].declAST.fncFlags, FncFlags.Ambient)) && + !funcDecl.isConstructor) { context.checker.errorReporter.simpleError(funcDecl, "Functions may not have class overloads"); } if (fgSym && !(fgSym.kind() == SymbolKind.Type) && funcDecl.isMethod() && !funcDecl.isAccessor() && !funcDecl.isConstructor) { diff --git a/tests/baselines/reference/parserRealSource8.js b/tests/baselines/reference/parserRealSource8.js index fcdb170ae12..8a667ad6dbe 100644 --- a/tests/baselines/reference/parserRealSource8.js +++ b/tests/baselines/reference/parserRealSource8.js @@ -632,7 +632,8 @@ var TypeScript; // the enclosing scope // REVIEW: Some twisted logic here - this needs to be cleaned up once old classes are removed // - if it's a new class, always use the contained scope, since we initialize the constructor scope below - if (context.scopeChain.thisType && (!funcDecl.isConstructor || hasFlag(funcDecl.fncFlags, FncFlags.ClassMethod))) { + if (context.scopeChain.thisType && + (!funcDecl.isConstructor || hasFlag(funcDecl.fncFlags, FncFlags.ClassMethod))) { var instType = context.scopeChain.thisType; if (!(instType.typeFlags & TypeFlags.IsClass) && !hasFlag(funcDecl.fncFlags, FncFlags.ClassMethod)) { if (!funcDecl.isMethod() || isStatic) { @@ -644,7 +645,10 @@ var TypeScript; } } else { - if (context.scopeChain.previous.scope.container && context.scopeChain.previous.scope.container.declAST && context.scopeChain.previous.scope.container.declAST.nodeType == NodeType.FuncDecl && context.scopeChain.previous.scope.container.declAST.isConstructor) { + if (context.scopeChain.previous.scope.container && + context.scopeChain.previous.scope.container.declAST && + context.scopeChain.previous.scope.container.declAST.nodeType == NodeType.FuncDecl && + context.scopeChain.previous.scope.container.declAST.isConstructor) { // if the parent is the class constructor, use the constructor scope parentScope = instType.constructorScope; } @@ -681,7 +685,12 @@ var TypeScript; outerFnc.innerStaticFuncs[outerFnc.innerStaticFuncs.length] = funcDecl; } else { - if (!funcDecl.isConstructor && container && container.declAST && container.declAST.nodeType == NodeType.FuncDecl && container.declAST.isConstructor && !funcDecl.isMethod()) { + if (!funcDecl.isConstructor && + container && + container.declAST && + container.declAST.nodeType == NodeType.FuncDecl && + container.declAST.isConstructor && + !funcDecl.isMethod()) { funcScope = context.scopeChain.thisType.constructorScope; //locals; } else { @@ -702,7 +711,11 @@ var TypeScript; } context.typeFlow.checker.createFunctionSignature(funcDecl, container, funcScope, fgSym, fgSym == null); // it's a getter or setter for a class property - if (!funcDecl.accessorSymbol && (funcDecl.fncFlags & FncFlags.ClassMethod) && container && ((!fgSym || fgSym.declAST.nodeType != NodeType.FuncDecl) && funcDecl.isAccessor()) || (fgSym && fgSym.isAccessor())) { + if (!funcDecl.accessorSymbol && + (funcDecl.fncFlags & FncFlags.ClassMethod) && + container && + ((!fgSym || fgSym.declAST.nodeType != NodeType.FuncDecl) && funcDecl.isAccessor()) || + (fgSym && fgSym.isAccessor())) { funcDecl.accessorSymbol = context.typeFlow.checker.createAccessorSymbol(funcDecl, fgSym, container.getType(), (funcDecl.isMethod() && isStatic), true, funcScope, container); } funcDecl.type.symbol.flags |= SymbolFlags.TypeSetDuringScopeAssignment; diff --git a/tests/baselines/reference/parserRealSource9.js b/tests/baselines/reference/parserRealSource9.js index 5b1423bff39..dba28c4f295 100644 --- a/tests/baselines/reference/parserRealSource9.js +++ b/tests/baselines/reference/parserRealSource9.js @@ -364,9 +364,7 @@ var TypeScript; // context of a given module (E.g., an outer import statement) if (typeSymbol.aliasLink && !typeSymbol.type && typeSymbol.aliasLink.alias.nodeType == NodeType.Name) { var modPath = typeSymbol.aliasLink.alias.text; - var modSym = this.checker.findSymbolForDynamicModule(modPath, this.checker.locationInfo.filename, function (id) { - return scope.find(id, false, true); - }); + var modSym = this.checker.findSymbolForDynamicModule(modPath, this.checker.locationInfo.filename, function (id) { return scope.find(id, false, true); }); if (modSym) { typeSymbol.type = modSym.getType(); } diff --git a/tests/baselines/reference/parserRegularExpressionDivideAmbiguity1.js b/tests/baselines/reference/parserRegularExpressionDivideAmbiguity1.js index 79e0c04d409..c3e61545c2c 100644 --- a/tests/baselines/reference/parserRegularExpressionDivideAmbiguity1.js +++ b/tests/baselines/reference/parserRegularExpressionDivideAmbiguity1.js @@ -3,4 +3,5 @@ /notregexp/a.foo(); //// [parserRegularExpressionDivideAmbiguity1.js] -1 / notregexp / a.foo(); +1 + / notregexp / a.foo(); diff --git a/tests/baselines/reference/parserReturnStatement4.js b/tests/baselines/reference/parserReturnStatement4.js index aab5215ba07..f6800cbb8fd 100644 --- a/tests/baselines/reference/parserReturnStatement4.js +++ b/tests/baselines/reference/parserReturnStatement4.js @@ -2,8 +2,4 @@ var v = { get foo() { return } }; //// [parserReturnStatement4.js] -var v = { - get foo() { - return; - } -}; +var v = { get foo() { return; } }; diff --git a/tests/baselines/reference/parserSetAccessorWithTypeParameters1.js b/tests/baselines/reference/parserSetAccessorWithTypeParameters1.js index a19675167c8..651640c6466 100644 --- a/tests/baselines/reference/parserSetAccessorWithTypeParameters1.js +++ b/tests/baselines/reference/parserSetAccessorWithTypeParameters1.js @@ -8,8 +8,7 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "foo", { - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/parserShorthandPropertyAssignment1.js b/tests/baselines/reference/parserShorthandPropertyAssignment1.js index 2aabfc906ae..0ef3c50d78f 100644 --- a/tests/baselines/reference/parserShorthandPropertyAssignment1.js +++ b/tests/baselines/reference/parserShorthandPropertyAssignment1.js @@ -4,10 +4,6 @@ var name:any, id: any; foo({ name?, id? }); //// [parserShorthandPropertyAssignment1.js] -function foo(obj) { -} +function foo(obj) { } var name, id; -foo({ - name: name, - id: id -}); +foo({ name: name, id: id }); diff --git a/tests/baselines/reference/parserShorthandPropertyAssignment2.js b/tests/baselines/reference/parserShorthandPropertyAssignment2.js index f05c9b08b33..0de0fa3829f 100644 --- a/tests/baselines/reference/parserShorthandPropertyAssignment2.js +++ b/tests/baselines/reference/parserShorthandPropertyAssignment2.js @@ -2,6 +2,4 @@ var v = { class }; //// [parserShorthandPropertyAssignment2.js] -var v = { - class: -}; +var v = { class: }; diff --git a/tests/baselines/reference/parserShorthandPropertyAssignment3.js b/tests/baselines/reference/parserShorthandPropertyAssignment3.js index a1d5ad3e646..814a725dcba 100644 --- a/tests/baselines/reference/parserShorthandPropertyAssignment3.js +++ b/tests/baselines/reference/parserShorthandPropertyAssignment3.js @@ -2,6 +2,4 @@ var v = { "" }; //// [parserShorthandPropertyAssignment3.js] -var v = { - "": -}; +var v = { "": }; diff --git a/tests/baselines/reference/parserShorthandPropertyAssignment4.js b/tests/baselines/reference/parserShorthandPropertyAssignment4.js index b0f05e2d9e3..e10928ae2ab 100644 --- a/tests/baselines/reference/parserShorthandPropertyAssignment4.js +++ b/tests/baselines/reference/parserShorthandPropertyAssignment4.js @@ -2,6 +2,4 @@ var v = { 0 }; //// [parserShorthandPropertyAssignment4.js] -var v = { - 0: -}; +var v = { 0: }; diff --git a/tests/baselines/reference/parserShorthandPropertyAssignment5.js b/tests/baselines/reference/parserShorthandPropertyAssignment5.js index 9dc4c781123..90d74722a99 100644 --- a/tests/baselines/reference/parserShorthandPropertyAssignment5.js +++ b/tests/baselines/reference/parserShorthandPropertyAssignment5.js @@ -4,6 +4,4 @@ var obj = { greet? }; //// [parserShorthandPropertyAssignment5.js] var greet = "hello"; -var obj = { - greet: greet -}; +var obj = { greet: greet }; diff --git a/tests/baselines/reference/parserSkippedTokens16.js b/tests/baselines/reference/parserSkippedTokens16.js index a31d0e7e248..dfbd8a4277a 100644 --- a/tests/baselines/reference/parserSkippedTokens16.js +++ b/tests/baselines/reference/parserSkippedTokens16.js @@ -11,15 +11,12 @@ var x = //// [parserSkippedTokens16.js] foo(); Bar; -{ -} -{ -} +{ } +{ } 4 + ; 5; var M; (function (M) { - function a(T) { - } + function a(T) { } })(M || (M = {})); var x = ; diff --git a/tests/baselines/reference/parserStrictMode12.js b/tests/baselines/reference/parserStrictMode12.js index 199ed43cc97..ce97b2a91cb 100644 --- a/tests/baselines/reference/parserStrictMode12.js +++ b/tests/baselines/reference/parserStrictMode12.js @@ -4,7 +4,4 @@ var v = { set foo(eval) { } } //// [parserStrictMode12.js] "use strict"; -var v = { - set foo(eval) { - } -}; +var v = { set foo(eval) { } }; diff --git a/tests/baselines/reference/parserSymbolIndexer5.js b/tests/baselines/reference/parserSymbolIndexer5.js index 43c456b64aa..3aa046e2114 100644 --- a/tests/baselines/reference/parserSymbolIndexer5.js +++ b/tests/baselines/reference/parserSymbolIndexer5.js @@ -5,6 +5,5 @@ var x = { //// [parserSymbolIndexer5.js] var x = { - [s]: symbol, - "": + [s]: symbol, "": }; diff --git a/tests/baselines/reference/parserSymbolProperty7.js b/tests/baselines/reference/parserSymbolProperty7.js index a3061ee1b58..1b3abdd62f0 100644 --- a/tests/baselines/reference/parserSymbolProperty7.js +++ b/tests/baselines/reference/parserSymbolProperty7.js @@ -5,6 +5,5 @@ class C { //// [parserSymbolProperty7.js] class C { - [Symbol.toStringTag]() { - } + [Symbol.toStringTag]() { } } diff --git a/tests/baselines/reference/parserUnaryExpression2.js b/tests/baselines/reference/parserUnaryExpression2.js index 97b17b2b800..2d1fa8eef56 100644 --- a/tests/baselines/reference/parserUnaryExpression2.js +++ b/tests/baselines/reference/parserUnaryExpression2.js @@ -2,5 +2,4 @@ ++function(e) { } //// [parserUnaryExpression2.js] -++function (e) { -}; +++function (e) { }; diff --git a/tests/baselines/reference/parserUnaryExpression3.js b/tests/baselines/reference/parserUnaryExpression3.js index f075032a7c9..37a9f72e7b2 100644 --- a/tests/baselines/reference/parserUnaryExpression3.js +++ b/tests/baselines/reference/parserUnaryExpression3.js @@ -2,6 +2,4 @@ ++[0]; //// [parserUnaryExpression3.js] -++[ - 0 -]; +++[0]; diff --git a/tests/baselines/reference/parserUnicodeWhitespaceCharacter1.js b/tests/baselines/reference/parserUnicodeWhitespaceCharacter1.js index e6f7a2374e5..dfd9b807053 100644 --- a/tests/baselines/reference/parserUnicodeWhitespaceCharacter1.js +++ b/tests/baselines/reference/parserUnicodeWhitespaceCharacter1.js @@ -3,5 +3,4 @@ function foo(){ } //// [parserUnicodeWhitespaceCharacter1.js] -function foo() { -} +function foo() { } diff --git a/tests/baselines/reference/parserUsingConstructorAsIdentifier.js b/tests/baselines/reference/parserUsingConstructorAsIdentifier.js index c239bbe3c31..ebf5663573c 100644 --- a/tests/baselines/reference/parserUsingConstructorAsIdentifier.js +++ b/tests/baselines/reference/parserUsingConstructorAsIdentifier.js @@ -41,8 +41,7 @@ //// [parserUsingConstructorAsIdentifier.js] function define(constructor, instanceMembers, staticMembers) { - constructor = constructor || function () { - }; + constructor = constructor || function () { }; PluginUtilities.Utilities.markSupportedForProcessing(constructor); if (instanceMembers) { initializeProperties(constructor.prototype, instanceMembers); @@ -54,17 +53,11 @@ function define(constructor, instanceMembers, staticMembers) { } function derive(baseClass, constructor, instanceMembers, staticMembers) { if (baseClass) { - constructor = constructor || function () { - }; + constructor = constructor || function () { }; var basePrototype = baseClass.prototype; constructor.prototype = Object.create(basePrototype); PluginUtilities.Utilities.markSupportedForProcessing(constructor); - Object.defineProperty(constructor.prototype, "constructor", { - value: constructor, - writable: true, - configurable: true, - enumerable: true - }); + Object.defineProperty(constructor.prototype, "constructor", { value: constructor, writable: true, configurable: true, enumerable: true }); if (instanceMembers) { initializeProperties(constructor.prototype, instanceMembers); } @@ -78,8 +71,7 @@ function derive(baseClass, constructor, instanceMembers, staticMembers) { } } function mix(constructor) { - constructor = constructor || function () { - }; + constructor = constructor || function () { }; var i, len; for (i = 1, len = arguments.length; i < len; i++) { initializeProperties(constructor.prototype, arguments[i]); diff --git a/tests/baselines/reference/parserharness.js b/tests/baselines/reference/parserharness.js index 3645f21e5ce..02304380013 100644 --- a/tests/baselines/reference/parserharness.js +++ b/tests/baselines/reference/parserharness.js @@ -2151,9 +2151,7 @@ var Harness; function bugs(content) { var bugs = content.match(/\bbug (\d+)/i); if (bugs) { - bugs.forEach(function (bug) { - return assert.bug(bug); - }); + bugs.forEach(function (bug) { return assert.bug(bug); }); } } Assert.bugs = bugs; @@ -2166,9 +2164,7 @@ var Harness; function arrayLengthIs(arr, length) { if (arr.length != length) { var actual = ''; - arr.forEach(function (n) { - return actual = actual + '\n ' + n.toString(); - }); + arr.forEach(function (n) { return actual = actual + '\n ' + n.toString(); }); Assert.throwAssertError(new Error('Expected array to have ' + length + ' elements. Actual elements were:' + actual)); } } @@ -2275,28 +2271,17 @@ var Harness; var Logger = (function () { function Logger() { } - Logger.prototype.start = function (fileName, priority) { - }; - Logger.prototype.end = function (fileName) { - }; - Logger.prototype.scenarioStart = function (scenario) { - }; - Logger.prototype.scenarioEnd = function (scenario, error) { - }; - Logger.prototype.testStart = function (test) { - }; - Logger.prototype.pass = function (test) { - }; - Logger.prototype.bug = function (test) { - }; - Logger.prototype.fail = function (test) { - }; - Logger.prototype.error = function (test, error) { - }; - Logger.prototype.comment = function (comment) { - }; - Logger.prototype.verify = function (test, passed, actual, expected, message) { - }; + Logger.prototype.start = function (fileName, priority) { }; + Logger.prototype.end = function (fileName) { }; + Logger.prototype.scenarioStart = function (scenario) { }; + Logger.prototype.scenarioEnd = function (scenario, error) { }; + Logger.prototype.testStart = function (test) { }; + Logger.prototype.pass = function (test) { }; + Logger.prototype.bug = function (test) { }; + Logger.prototype.fail = function (test) { }; + Logger.prototype.error = function (test, error) { }; + Logger.prototype.comment = function (comment) { }; + Logger.prototype.verify = function (test, passed, actual, expected, message) { }; return Logger; })(); Harness.Logger = Logger; @@ -2363,16 +2348,13 @@ var Harness; return false; } }; - Runnable.prototype.run = function (done) { - }; + Runnable.prototype.run = function (done) { }; Runnable.prototype.runBlock = function (done) { return this.call(this.block, done); }; Runnable.prototype.runChild = function (index, done) { var _this = this; - return this.call((function (done) { - return _this.children[index].run(done); - }), done); + return this.call((function (done) { return _this.children[index].run(done); }), done); }; Runnable.pushGlobalErrorHandler = function (done) { errorHandlerStack.push(function (e) { @@ -2410,25 +2392,17 @@ var Harness; TestCase.prototype.run = function (done) { var that = this; Runnable.currentStack.push(this); - emitLog('testStart', { - desc: this.description - }); + emitLog('testStart', { desc: this.description }); if (this.block) { var async = this.runBlock(function (e) { if (e) { that.passed = false; that.error = e; - emitLog('error', { - desc: this.description, - pass: false - }, e); + emitLog('error', { desc: this.description, pass: false }, e); } else { that.passed = true; - emitLog('pass', { - desc: this.description, - pass: true - }); + emitLog('pass', { desc: this.description, pass: true }); } Runnable.currentStack.pop(); done(); @@ -2449,24 +2423,15 @@ var Harness; Scenario.prototype.run = function (done) { var that = this; Runnable.currentStack.push(this); - emitLog('scenarioStart', { - desc: this.description - }); + emitLog('scenarioStart', { desc: this.description }); var async = this.runBlock(function (e) { Runnable.currentStack.pop(); if (e) { that.passed = false; that.error = e; - var metadata = { - id: undefined, - desc: this.description, - pass: false, - bugs: assert.bugIds - }; + var metadata = { id: undefined, desc: this.description, pass: false, bugs: assert.bugIds }; // Report all bugs affecting this scenario - assert.bugIds.forEach(function (desc) { - return emitLog('bug', metadata, desc); - }); + assert.bugIds.forEach(function (desc) { return emitLog('bug', metadata, desc); }); emitLog('scenarioEnd', metadata, e); done(); } @@ -2493,16 +2458,9 @@ var Harness; if (async) return; } - var metadata = { - id: undefined, - desc: this.description, - pass: this.passed, - bugs: assert.bugIds - }; + var metadata = { id: undefined, desc: this.description, pass: this.passed, bugs: assert.bugIds }; // Report all bugs affecting this scenario - assert.bugIds.forEach(function (desc) { - return emitLog('bug', metadata, desc); - }); + assert.bugIds.forEach(function (desc) { return emitLog('bug', metadata, desc); }); emitLog('scenarioEnd', metadata); done(); }; @@ -2627,16 +2585,11 @@ var Harness; this.description = ""; this.results = {}; } - Benchmark.prototype.bench = function (subBench) { - }; - Benchmark.prototype.before = function () { - }; - Benchmark.prototype.beforeEach = function () { - }; - Benchmark.prototype.after = function () { - }; - Benchmark.prototype.afterEach = function () { - }; + Benchmark.prototype.bench = function (subBench) { }; + Benchmark.prototype.before = function () { }; + Benchmark.prototype.beforeEach = function () { }; + Benchmark.prototype.after = function () { }; + Benchmark.prototype.afterEach = function () { }; Benchmark.prototype.addTimingFor = function (name, timing) { this.results[name] = this.results[name] || new Dataset(); this.results[name].add(timing); @@ -2672,13 +2625,9 @@ var Harness; b.after(); for (var prop in b.results) { var description = b.description + (prop ? ": " + prop : ''); - emitLog('testStart', { - desc: description - }); + emitLog('testStart', { desc: description }); emitLog('pass', { - desc: description, - pass: true, - perfResults: { + desc: description, pass: true, perfResults: { mean: b.results[prop].mean(), min: b.results[prop].min(), max: b.results[prop].max(), @@ -2743,18 +2692,10 @@ var Harness; this.fileCollection[s] = writer; return writer; }; - EmitterIOHost.prototype.directoryExists = function (s) { - return false; - }; - EmitterIOHost.prototype.fileExists = function (s) { - return typeof this.fileCollection[s] !== 'undefined'; - }; - EmitterIOHost.prototype.resolvePath = function (s) { - return s; - }; - EmitterIOHost.prototype.reset = function () { - this.fileCollection = {}; - }; + EmitterIOHost.prototype.directoryExists = function (s) { return false; }; + EmitterIOHost.prototype.fileExists = function (s) { return typeof this.fileCollection[s] !== 'undefined'; }; + EmitterIOHost.prototype.resolvePath = function (s) { return s; }; + EmitterIOHost.prototype.reset = function () { this.fileCollection = {}; }; EmitterIOHost.prototype.toArray = function () { var result = []; for (var p in this.fileCollection) { @@ -2764,10 +2705,7 @@ var Harness; if (p !== '0.js') { current.lines.unshift('////[' + p + ']'); } - result.push({ - filename: p, - file: this.fileCollection[p] - }); + result.push({ filename: p, file: this.fileCollection[p] }); } } } @@ -2831,9 +2769,7 @@ var Harness; Type.prototype.normalizeToArray = function (arg) { if ((Array.isArray && Array.isArray(arg)) || arg instanceof Array) return arg; - return [ - arg - ]; + return [arg]; }; Type.prototype.compilesOk = function (testCode) { var errors = null; @@ -2991,9 +2927,7 @@ var Harness; var tyInfo = compiler.pullGetTypeInfoAtPosition(targetPosition, script2); var name = this.getTypeInfoName(tyInfo.ast); var foundValue = new Type(tyInfo.typeInfo, code, name); - if (!matchingIdentifiers.some(function (value) { - return (value.identifier === foundValue.identifier) && (value.code === foundValue.code) && (value.type === foundValue.type); - })) { + if (!matchingIdentifiers.some(function (value) { return (value.identifier === foundValue.identifier) && (value.code === foundValue.code) && (value.type === foundValue.type); })) { matchingIdentifiers.push(foundValue); } } @@ -3003,9 +2937,7 @@ var Harness; var name = this.getTypeInfoName(tyInfo.ast); if (name === targetIdentifier) { var foundValue = new Type(tyInfo.typeInfo, code, targetIdentifier); - if (!matchingIdentifiers.some(function (value) { - return (value.identifier === foundValue.identifier) && (value.code === foundValue.code) && (value.type === foundValue.type); - })) { + if (!matchingIdentifiers.some(function (value) { return (value.identifier === foundValue.identifier) && (value.code === foundValue.code) && (value.type === foundValue.type); })) { matchingIdentifiers.push(foundValue); } } @@ -3111,15 +3043,9 @@ var Harness; outputs[fn] = new Harness.Compiler.WriterAggregator(); return outputs[fn]; }, - directoryExists: function (path) { - return true; - }, - fileExists: function (path) { - return true; - }, - resolvePath: function (path) { - return path; - } + directoryExists: function (path) { return true; }, + fileExists: function (path) { return true; }, + resolvePath: function (path) { return path; } }); compiler.emitDeclarations(); var results = null; @@ -3160,9 +3086,7 @@ var Harness; this.fileResults = fileResults; this.scripts = scripts; var lines = []; - fileResults.forEach(function (v) { - return lines = lines.concat(v.file.lines); - }); + fileResults.forEach(function (v) { return lines = lines.concat(v.file.lines); }); this.code = lines.join("\n"); this.errors = []; for (var i = 0; i < errorLines.length; i++) { @@ -3219,9 +3143,7 @@ var Harness; function reset() { stdout.reset(); stderr.reset(); - var files = compiler.units.map(function (value) { - return value.filename; - }); + var files = compiler.units.map(function (value) { return value.filename; }); for (var i = 0; i < files.length; i++) { var fname = files[i]; if (fname !== 'lib.d.ts') { @@ -3382,24 +3304,12 @@ var Harness; (function (TestCaseParser) { optionRegex = /^[\/]{2}\s*@(\w+):\s*(\S*)/gm; // multiple matches on multiple lines // List of allowed metadata names - var fileMetadataNames = [ - "filename", - "comments", - "declaration", - "module", - "nolib", - "sourcemap", - "target", - "out" - ]; + var fileMetadataNames = ["filename", "comments", "declaration", "module", "nolib", "sourcemap", "target", "out"]; function extractCompilerSettings(content) { var opts = []; var match; while ((match = optionRegex.exec(content)) != null) { - opts.push({ - flag: match[1], - value: match[2] - }); + opts.push({ flag: match[1], value: match[2] }); } return opts; } @@ -3492,10 +3402,7 @@ var Harness; references: refs }; files.push(newTestFile); - return { - settings: settings, - testUnitData: files - }; + return { settings: settings, testUnitData: files }; } TestCaseParser.makeUnitsFromTest = makeUnitsFromTest; })(TestCaseParser = Harness.TestCaseParser || (Harness.TestCaseParser = {})); @@ -3542,21 +3449,9 @@ var Harness; return TypeScript.ScriptEditRange.unknown(); } var entries = this.editRanges.slice(initialEditRangeIndex); - var minDistFromStart = entries.map(function (x) { - return x.editRange.minChar; - }).reduce(function (prev, current) { - return Math.min(prev, current); - }); - var minDistFromEnd = entries.map(function (x) { - return x.length - x.editRange.limChar; - }).reduce(function (prev, current) { - return Math.min(prev, current); - }); - var aggDelta = entries.map(function (x) { - return x.editRange.delta; - }).reduce(function (prev, current) { - return prev + current; - }); + var minDistFromStart = entries.map(function (x) { return x.editRange.minChar; }).reduce(function (prev, current) { return Math.min(prev, current); }); + var minDistFromEnd = entries.map(function (x) { return x.length - x.editRange.limChar; }).reduce(function (prev, current) { return Math.min(prev, current); }); + var aggDelta = entries.map(function (x) { return x.editRange.delta; }).reduce(function (prev, current) { return prev + current; }); return new TypeScript.ScriptEditRange(minDistFromStart, entries[0].length - minDistFromEnd, aggDelta); }; return ScriptInfo; @@ -3606,21 +3501,11 @@ var Harness; ////////////////////////////////////////////////////////////////////// // ILogger implementation // - TypeScriptLS.prototype.information = function () { - return false; - }; - TypeScriptLS.prototype.debug = function () { - return true; - }; - TypeScriptLS.prototype.warning = function () { - return true; - }; - TypeScriptLS.prototype.error = function () { - return true; - }; - TypeScriptLS.prototype.fatal = function () { - return true; - }; + TypeScriptLS.prototype.information = function () { return false; }; + TypeScriptLS.prototype.debug = function () { return true; }; + TypeScriptLS.prototype.warning = function () { return true; }; + TypeScriptLS.prototype.error = function () { return true; }; + TypeScriptLS.prototype.fatal = function () { return true; }; TypeScriptLS.prototype.log = function (s) { // For debugging... //IO.printLine("TypeScriptLS:" + s); @@ -3667,8 +3552,7 @@ var Harness; TypeScriptLS.prototype.parseSourceText = function (fileName, sourceText) { var parser = new TypeScript.Parser(); parser.setErrorRecovery(null); - parser.errorCallback = function (a, b, c, d) { - }; + parser.errorCallback = function (a, b, c, d) { }; var script = parser.parse(sourceText, fileName, 0); return script; }; @@ -3728,10 +3612,7 @@ var Harness; function mapEdits(edits) { var result = []; for (var i = 0; i < edits.length; i++) { - result.push({ - edit: edits[i], - index: i - }); + result.push({ edit: edits[i], index: i }); } return result; } @@ -3773,9 +3654,7 @@ var Harness; return result; }; TypeScriptLS.prototype.getHostSettings = function () { - return JSON.stringify({ - usePullLanguageService: Harness.usePull - }); + return JSON.stringify({ usePullLanguageService: Harness.usePull }); }; return TypeScriptLS; })(); @@ -3812,9 +3691,7 @@ var Harness; Runner.runCollateral = runCollateral; function runJSString(code, callback) { // List of names that get overriden by various test code we eval - var dangerNames = [ - 'Array' - ]; + var dangerNames = ['Array']; var globalBackup = {}; var n = null; for (n in dangerNames) { @@ -3932,10 +3809,7 @@ var Harness; expected = expected.replace(/\r\n?/g, '\n'); actual = actual.replace(/\r\n?/g, '\n'); } - return { - expected: expected, - actual: actual - }; + return { expected: expected, actual: actual }; } function writeComparison(expected, actual, relativeFilename, actualFilename, descriptionForDescribe) { if (expected != actual) { diff --git a/tests/baselines/reference/parserindenter.js b/tests/baselines/reference/parserindenter.js index 514a24afcf6..511e75ea135 100644 --- a/tests/baselines/reference/parserindenter.js +++ b/tests/baselines/reference/parserindenter.js @@ -778,7 +778,10 @@ var Formatting; } Indenter.prototype.GetIndentationEdits = function (token, nextToken, node, sameLineIndent) { if (this.logger.information()) { - this.logger.log("GetIndentationEdits(" + "t1=[" + token.Span.startPosition() + "," + token.Span.endPosition() + "], " + "t2=[" + (nextToken == null ? "null" : (nextToken.Span.startPosition() + "," + nextToken.Span.endPosition())) + "]" + ")"); + this.logger.log("GetIndentationEdits(" + + "t1=[" + token.Span.startPosition() + "," + token.Span.endPosition() + "], " + + "t2=[" + (nextToken == null ? "null" : (nextToken.Span.startPosition() + "," + nextToken.Span.endPosition())) + "]" + + ")"); } var result = this.GetIndentationEditsWorker(token, nextToken, node, sameLineIndent); if (this.logger.information()) { @@ -938,7 +941,8 @@ var Formatting; }; Indenter.prototype.GetSpecialCaseIndentationForLCurly = function (node) { var indentationInfo = null; - if (node.AuthorNode.Details.Kind == AuthorParseNodeKind.apnkFncDecl || node.AuthorNode.EdgeLabel == AuthorParseNodeEdge.apneThen || node.AuthorNode.EdgeLabel == AuthorParseNodeEdge.apneElse) { + if (node.AuthorNode.Details.Kind == AuthorParseNodeKind.apnkFncDecl || + node.AuthorNode.EdgeLabel == AuthorParseNodeEdge.apneThen || node.AuthorNode.EdgeLabel == AuthorParseNodeEdge.apneElse) { // flushed with the node (function & if) indentationInfo = node.GetNodeStartLineIndentation(this); return indentationInfo; @@ -1233,7 +1237,8 @@ var Formatting; // Get the parent that is really on a different line from the self node var startNodeLineNumber = this.snapshot.GetLineNumberFromPosition(tree.StartNodeSelf.AuthorNode.Details.StartOffset); parent = tree.StartNodeSelf.Parent; - while (parent != null && startNodeLineNumber == this.snapshot.GetLineNumberFromPosition(parent.AuthorNode.Details.StartOffset)) { + while (parent != null && + startNodeLineNumber == this.snapshot.GetLineNumberFromPosition(parent.AuthorNode.Details.StartOffset)) { parent = parent.Parent; } } @@ -1331,7 +1336,8 @@ var Formatting; } }; Indenter.prototype.IsMultiLineString = function (token) { - return token.tokenID === TypeScript.TokenID.StringLiteral && this.snapshot.GetLineNumberFromPosition(token.Span.endPosition()) > this.snapshot.GetLineNumberFromPosition(token.Span.startPosition()); + return token.tokenID === TypeScript.TokenID.StringLiteral && + this.snapshot.GetLineNumberFromPosition(token.Span.endPosition()) > this.snapshot.GetLineNumberFromPosition(token.Span.startPosition()); }; return Indenter; })(); diff --git a/tests/baselines/reference/parsingClassRecoversWhenHittingUnexpectedSemicolon.errors.txt b/tests/baselines/reference/parsingClassRecoversWhenHittingUnexpectedSemicolon.errors.txt deleted file mode 100644 index 09eabb5b588..00000000000 --- a/tests/baselines/reference/parsingClassRecoversWhenHittingUnexpectedSemicolon.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -tests/cases/compiler/parsingClassRecoversWhenHittingUnexpectedSemicolon.ts(2,19): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. - - -==== tests/cases/compiler/parsingClassRecoversWhenHittingUnexpectedSemicolon.ts (1 errors) ==== - class C { - public f() { }; - ~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. - private m; - } - \ No newline at end of file diff --git a/tests/baselines/reference/parsingClassRecoversWhenHittingUnexpectedSemicolon.js b/tests/baselines/reference/parsingClassRecoversWhenHittingUnexpectedSemicolon.js index add4e3a69f3..59129f91b97 100644 --- a/tests/baselines/reference/parsingClassRecoversWhenHittingUnexpectedSemicolon.js +++ b/tests/baselines/reference/parsingClassRecoversWhenHittingUnexpectedSemicolon.js @@ -9,7 +9,7 @@ class C { var C = (function () { function C() { } - C.prototype.f = function () { - }; + C.prototype.f = function () { }; + ; return C; })(); diff --git a/tests/baselines/reference/parsingClassRecoversWhenHittingUnexpectedSemicolon.types b/tests/baselines/reference/parsingClassRecoversWhenHittingUnexpectedSemicolon.types new file mode 100644 index 00000000000..6fdfccfa7fd --- /dev/null +++ b/tests/baselines/reference/parsingClassRecoversWhenHittingUnexpectedSemicolon.types @@ -0,0 +1,11 @@ +=== tests/cases/compiler/parsingClassRecoversWhenHittingUnexpectedSemicolon.ts === +class C { +>C : C + + public f() { }; +>f : () => void + + private m; +>m : any +} + diff --git a/tests/baselines/reference/partiallyAmbientFundule.js b/tests/baselines/reference/partiallyAmbientFundule.js index 21cb5179aef..9b52ca2147f 100644 --- a/tests/baselines/reference/partiallyAmbientFundule.js +++ b/tests/baselines/reference/partiallyAmbientFundule.js @@ -5,5 +5,4 @@ declare module foo { function foo () { } // Legal, because module is ambient //// [partiallyAmbientFundule.js] -function foo() { -} // Legal, because module is ambient +function foo() { } // Legal, because module is ambient diff --git a/tests/baselines/reference/plusOperatorWithAnyOtherType.js b/tests/baselines/reference/plusOperatorWithAnyOtherType.js index 5a30af7e9f6..33ac4ebb144 100644 --- a/tests/baselines/reference/plusOperatorWithAnyOtherType.js +++ b/tests/baselines/reference/plusOperatorWithAnyOtherType.js @@ -60,17 +60,9 @@ var ResultIsNumber19 = +(undefined + undefined); // + operator on any type var ANY; var ANY1; -var ANY2 = [ - "", - "" -]; +var ANY2 = ["", ""]; var obj; -var obj1 = { - x: function (s) { - }, - y: function (s1) { - } -}; +var obj1 = { x: function (s) { }, y: function (s1) { } }; function foo() { var a; return a; diff --git a/tests/baselines/reference/plusOperatorWithBooleanType.js b/tests/baselines/reference/plusOperatorWithBooleanType.js index 81c62222805..5af1a8fb903 100644 --- a/tests/baselines/reference/plusOperatorWithBooleanType.js +++ b/tests/baselines/reference/plusOperatorWithBooleanType.js @@ -38,15 +38,11 @@ var ResultIsNumber7 = +A.foo(); //// [plusOperatorWithBooleanType.js] // + operator on boolean type var BOOLEAN; -function foo() { - return true; -} +function foo() { return true; } var A = (function () { function A() { } - A.foo = function () { - return false; - }; + A.foo = function () { return false; }; return A; })(); var M; @@ -58,10 +54,7 @@ var objA = new A(); var ResultIsNumber1 = +BOOLEAN; // boolean type literal var ResultIsNumber2 = +true; -var ResultIsNumber3 = +{ - x: true, - y: false -}; +var ResultIsNumber3 = +{ x: true, y: false }; // boolean type expressions var ResultIsNumber4 = +objA.a; var ResultIsNumber5 = +M.n; diff --git a/tests/baselines/reference/plusOperatorWithNumberType.js b/tests/baselines/reference/plusOperatorWithNumberType.js index a42147e0a30..a0adaa5dec2 100644 --- a/tests/baselines/reference/plusOperatorWithNumberType.js +++ b/tests/baselines/reference/plusOperatorWithNumberType.js @@ -44,19 +44,12 @@ var ResultIsNumber11 = +(NUMBER + NUMBER); //// [plusOperatorWithNumberType.js] // + operator on number type var NUMBER; -var NUMBER1 = [ - 1, - 2 -]; -function foo() { - return 1; -} +var NUMBER1 = [1, 2]; +function foo() { return 1; } var A = (function () { function A() { } - A.foo = function () { - return 1; - }; + A.foo = function () { return 1; }; return A; })(); var M; @@ -69,16 +62,8 @@ var ResultIsNumber1 = +NUMBER; var ResultIsNumber2 = +NUMBER1; // number type literal var ResultIsNumber3 = +1; -var ResultIsNumber4 = +{ - x: 1, - y: 2 -}; -var ResultIsNumber5 = +{ - x: 1, - y: function (n) { - return n; - } -}; +var ResultIsNumber4 = +{ x: 1, y: 2 }; +var ResultIsNumber5 = +{ x: 1, y: function (n) { return n; } }; // number type expressions var ResultIsNumber6 = +objA.a; var ResultIsNumber7 = +M.n; diff --git a/tests/baselines/reference/plusOperatorWithStringType.js b/tests/baselines/reference/plusOperatorWithStringType.js index b725f62adbe..ed2c60111b3 100644 --- a/tests/baselines/reference/plusOperatorWithStringType.js +++ b/tests/baselines/reference/plusOperatorWithStringType.js @@ -43,19 +43,12 @@ var ResultIsNumber12 = +STRING.charAt(0); //// [plusOperatorWithStringType.js] // + operator on string type var STRING; -var STRING1 = [ - "", - "abc" -]; -function foo() { - return "abc"; -} +var STRING1 = ["", "abc"]; +function foo() { return "abc"; } var A = (function () { function A() { } - A.foo = function () { - return ""; - }; + A.foo = function () { return ""; }; return A; })(); var M; @@ -68,16 +61,8 @@ var ResultIsNumber1 = +STRING; var ResultIsNumber2 = +STRING1; // string type literal var ResultIsNumber3 = +""; -var ResultIsNumber4 = +{ - x: "", - y: "" -}; -var ResultIsNumber5 = +{ - x: "", - y: function (s) { - return s; - } -}; +var ResultIsNumber4 = +{ x: "", y: "" }; +var ResultIsNumber5 = +{ x: "", y: function (s) { return s; } }; // string type expressions var ResultIsNumber6 = +objA.a; var ResultIsNumber7 = +M.n; diff --git a/tests/baselines/reference/primitiveConstraints1.js b/tests/baselines/reference/primitiveConstraints1.js index 7d697e57dfa..9ee39d74e80 100644 --- a/tests/baselines/reference/primitiveConstraints1.js +++ b/tests/baselines/reference/primitiveConstraints1.js @@ -7,9 +7,7 @@ foo2(1, 'hm'); // error //// [primitiveConstraints1.js] -function foo1(t, u) { -} +function foo1(t, u) { } foo1('hm', 1); // no error -function foo2(t, u) { -} +function foo2(t, u) { } foo2(1, 'hm'); // error diff --git a/tests/baselines/reference/primitiveMembers.errors.txt b/tests/baselines/reference/primitiveMembers.errors.txt index 801d3fac45c..da8b75f9bc5 100644 --- a/tests/baselines/reference/primitiveMembers.errors.txt +++ b/tests/baselines/reference/primitiveMembers.errors.txt @@ -1,10 +1,8 @@ tests/cases/compiler/primitiveMembers.ts(5,3): error TS2339: Property 'toBAZ' does not exist on type 'number'. tests/cases/compiler/primitiveMembers.ts(11,1): error TS2322: Type 'Number' is not assignable to type 'number'. -tests/cases/compiler/primitiveMembers.ts(24,35): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/compiler/primitiveMembers.ts(25,56): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -==== tests/cases/compiler/primitiveMembers.ts (4 errors) ==== +==== tests/cases/compiler/primitiveMembers.ts (2 errors) ==== var x = 5; var r = /yo/; r.source; @@ -33,11 +31,7 @@ tests/cases/compiler/primitiveMembers.ts(25,56): error TS1068: Unexpected token. class baz { public bar(): void { }; } - ~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. class foo extends baz { public bar(){ return undefined}; } - ~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. diff --git a/tests/baselines/reference/primitiveMembers.js b/tests/baselines/reference/primitiveMembers.js index 18ade7ca775..629d55ed0f7 100644 --- a/tests/baselines/reference/primitiveMembers.js +++ b/tests/baselines/reference/primitiveMembers.js @@ -48,9 +48,7 @@ var N; n = N; // should not work, as 'number' has a different brand N = n; // should work var o = {}; -var f = function (x) { - return x.length; -}; +var f = function (x) { return x.length; }; var r2 = /./g; var n2 = 34; var s = "yo"; @@ -59,8 +57,8 @@ var n3 = 5 || {}; var baz = (function () { function baz() { } - baz.prototype.bar = function () { - }; + baz.prototype.bar = function () { }; + ; return baz; })(); var foo = (function (_super) { @@ -68,8 +66,7 @@ var foo = (function (_super) { function foo() { _super.apply(this, arguments); } - foo.prototype.bar = function () { - return undefined; - }; + foo.prototype.bar = function () { return undefined; }; + ; return foo; })(baz); diff --git a/tests/baselines/reference/primtiveTypesAreIdentical.js b/tests/baselines/reference/primtiveTypesAreIdentical.js index 00a77fac917..19bdadb4cee 100644 --- a/tests/baselines/reference/primtiveTypesAreIdentical.js +++ b/tests/baselines/reference/primtiveTypesAreIdentical.js @@ -33,21 +33,14 @@ function foo7(x: any) { } //// [primtiveTypesAreIdentical.js] // primitive types are identical to themselves so these overloads will all cause errors -function foo1(x) { -} -function foo2(x) { -} -function foo3(x) { -} -function foo4(x) { -} -function foo5(x) { -} +function foo1(x) { } +function foo2(x) { } +function foo3(x) { } +function foo4(x) { } +function foo5(x) { } var E; (function (E) { E[E["A"] = 0] = "A"; })(E || (E = {})); -function foo6(x) { -} -function foo7(x) { -} +function foo6(x) { } +function foo7(x) { } diff --git a/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface1.types b/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface1.types index f0c8c25be29..936f04731f6 100644 --- a/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface1.types +++ b/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface1.types @@ -12,9 +12,9 @@ interface Foo { >T : T } var Foo: new () => Foo.A>; ->Foo : new () => export=.A> +>Foo : new () => Foo.A> >Foo : unknown ->A : export=.A +>A : Foo.A >Foo : Foo export = Foo; diff --git a/tests/baselines/reference/privateClassPropertyAccessibleWithinClass.js b/tests/baselines/reference/privateClassPropertyAccessibleWithinClass.js index e754d49280c..116b255a921 100644 --- a/tests/baselines/reference/privateClassPropertyAccessibleWithinClass.js +++ b/tests/baselines/reference/privateClassPropertyAccessibleWithinClass.js @@ -37,34 +37,20 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "y", { - get: function () { - return this.x; - }, - set: function (x) { - this.y = this.x; - }, + get: function () { return this.x; }, + set: function (x) { this.y = this.x; }, enumerable: true, configurable: true }); - C.prototype.foo = function () { - return this.foo; - }; + C.prototype.foo = function () { return this.foo; }; Object.defineProperty(C, "y", { - get: function () { - return this.x; - }, - set: function (x) { - this.y = this.x; - }, + get: function () { return this.x; }, + set: function (x) { this.y = this.x; }, enumerable: true, configurable: true }); - C.foo = function () { - return this.foo; - }; - C.bar = function () { - this.foo(); - }; + C.foo = function () { return this.foo; }; + C.bar = function () { this.foo(); }; return C; })(); // added level of function nesting @@ -74,54 +60,40 @@ var C2 = (function () { Object.defineProperty(C2.prototype, "y", { get: function () { var _this = this; - (function () { - return _this.x; - }); + (function () { return _this.x; }); return null; }, set: function (x) { var _this = this; - (function () { - _this.y = _this.x; - }); + (function () { _this.y = _this.x; }); }, enumerable: true, configurable: true }); C2.prototype.foo = function () { var _this = this; - (function () { - return _this.foo; - }); + (function () { return _this.foo; }); }; Object.defineProperty(C2, "y", { get: function () { var _this = this; - (function () { - return _this.x; - }); + (function () { return _this.x; }); return null; }, set: function (x) { var _this = this; - (function () { - _this.y = _this.x; - }); + (function () { _this.y = _this.x; }); }, enumerable: true, configurable: true }); C2.foo = function () { var _this = this; - (function () { - return _this.foo; - }); + (function () { return _this.foo; }); }; C2.bar = function () { var _this = this; - (function () { - return _this.foo(); - }); + (function () { return _this.foo(); }); }; return C2; })(); diff --git a/tests/baselines/reference/privateIndexer2.js b/tests/baselines/reference/privateIndexer2.js index a90e03a5bc2..1268c6e4c25 100644 --- a/tests/baselines/reference/privateIndexer2.js +++ b/tests/baselines/reference/privateIndexer2.js @@ -14,6 +14,7 @@ var y: { var x = (_a = {}, _a[x] = string, _a.string = , - _a); + _a +); var y; var _a; diff --git a/tests/baselines/reference/privateInstanceVisibility.js b/tests/baselines/reference/privateInstanceVisibility.js index e1ccb287515..b730a763e1e 100644 --- a/tests/baselines/reference/privateInstanceVisibility.js +++ b/tests/baselines/reference/privateInstanceVisibility.js @@ -57,9 +57,7 @@ var Test; var C = (function () { function C() { } - C.prototype.getX = function () { - return this.x; - }; + C.prototype.getX = function () { return this.x; }; C.prototype.clone = function (other) { this.x = other.x; }; diff --git a/tests/baselines/reference/privateStaticMemberAccessibility.js b/tests/baselines/reference/privateStaticMemberAccessibility.js index dd022d8646a..fdcb2663299 100644 --- a/tests/baselines/reference/privateStaticMemberAccessibility.js +++ b/tests/baselines/reference/privateStaticMemberAccessibility.js @@ -24,9 +24,7 @@ var Derived = (function (_super) { __extends(Derived, _super); function Derived() { _super.apply(this, arguments); - this.bing = function () { - return Base.foo; - }; // error + this.bing = function () { return Base.foo; }; // error } Derived.bar = Base.foo; // error return Derived; diff --git a/tests/baselines/reference/privateVisibility.js b/tests/baselines/reference/privateVisibility.js index 80e0bf51a1b..d70d7b4756f 100644 --- a/tests/baselines/reference/privateVisibility.js +++ b/tests/baselines/reference/privateVisibility.js @@ -32,11 +32,8 @@ var Foo = (function () { this.pubProp = 0; this.privProp = 0; } - Foo.prototype.pubMeth = function () { - this.privMeth(); - }; - Foo.prototype.privMeth = function () { - }; + Foo.prototype.pubMeth = function () { this.privMeth(); }; + Foo.prototype.privMeth = function () { }; return Foo; })(); var f = new Foo(); diff --git a/tests/baselines/reference/privateVisibles.js b/tests/baselines/reference/privateVisibles.js index c9206964f80..b2cb673c681 100644 --- a/tests/baselines/reference/privateVisibles.js +++ b/tests/baselines/reference/privateVisibles.js @@ -15,8 +15,6 @@ var Foo = (function () { this.pvar = 0; var n = this.pvar; } - Foo.prototype.meth = function () { - var q = this.pvar; - }; + Foo.prototype.meth = function () { var q = this.pvar; }; return Foo; })(); diff --git a/tests/baselines/reference/project/baseline/amd/decl.js b/tests/baselines/reference/project/baseline/amd/decl.js index 96eaed7142c..ed53ca816db 100644 --- a/tests/baselines/reference/project/baseline/amd/decl.js +++ b/tests/baselines/reference/project/baseline/amd/decl.js @@ -1,10 +1,7 @@ define(["require", "exports"], function (require, exports) { ; function point(x, y) { - return { - x: x, - y: y - }; + return { x: x, y: y }; } exports.point = point; }); diff --git a/tests/baselines/reference/project/baseline/node/decl.js b/tests/baselines/reference/project/baseline/node/decl.js index 50cca2c0f42..eb0c46dd93e 100644 --- a/tests/baselines/reference/project/baseline/node/decl.js +++ b/tests/baselines/reference/project/baseline/node/decl.js @@ -1,8 +1,5 @@ ; function point(x, y) { - return { - x: x, - y: y - }; + return { x: x, y: y }; } exports.point = point; diff --git a/tests/baselines/reference/project/baseline2/amd/decl.js b/tests/baselines/reference/project/baseline2/amd/decl.js index 96eaed7142c..ed53ca816db 100644 --- a/tests/baselines/reference/project/baseline2/amd/decl.js +++ b/tests/baselines/reference/project/baseline2/amd/decl.js @@ -1,10 +1,7 @@ define(["require", "exports"], function (require, exports) { ; function point(x, y) { - return { - x: x, - y: y - }; + return { x: x, y: y }; } exports.point = point; }); diff --git a/tests/baselines/reference/project/baseline2/amd/dont_emit.js b/tests/baselines/reference/project/baseline2/amd/dont_emit.js index 6b45d747c1c..d3e9e871c2d 100644 --- a/tests/baselines/reference/project/baseline2/amd/dont_emit.js +++ b/tests/baselines/reference/project/baseline2/amd/dont_emit.js @@ -1,6 +1,3 @@ define(["require", "exports"], function (require, exports) { - var p = { - x: 10, - y: 20 - }; + var p = { x: 10, y: 20 }; }); diff --git a/tests/baselines/reference/project/baseline2/node/decl.js b/tests/baselines/reference/project/baseline2/node/decl.js index 50cca2c0f42..eb0c46dd93e 100644 --- a/tests/baselines/reference/project/baseline2/node/decl.js +++ b/tests/baselines/reference/project/baseline2/node/decl.js @@ -1,8 +1,5 @@ ; function point(x, y) { - return { - x: x, - y: y - }; + return { x: x, y: y }; } exports.point = point; diff --git a/tests/baselines/reference/project/baseline2/node/dont_emit.js b/tests/baselines/reference/project/baseline2/node/dont_emit.js index 4322b9c60b6..b6239b1295d 100644 --- a/tests/baselines/reference/project/baseline2/node/dont_emit.js +++ b/tests/baselines/reference/project/baseline2/node/dont_emit.js @@ -1,4 +1 @@ -var p = { - x: 10, - y: 20 -}; +var p = { x: 10, y: 20 }; diff --git a/tests/baselines/reference/project/nonRelative/amd/lib/bar/a.js b/tests/baselines/reference/project/nonRelative/amd/lib/bar/a.js index 5351258111e..6ffe8c53445 100644 --- a/tests/baselines/reference/project/nonRelative/amd/lib/bar/a.js +++ b/tests/baselines/reference/project/nonRelative/amd/lib/bar/a.js @@ -1,5 +1,4 @@ define(["require", "exports"], function (require, exports) { - function hello() { - } + function hello() { } exports.hello = hello; }); diff --git a/tests/baselines/reference/project/nonRelative/amd/lib/foo/a.js b/tests/baselines/reference/project/nonRelative/amd/lib/foo/a.js index 5351258111e..6ffe8c53445 100644 --- a/tests/baselines/reference/project/nonRelative/amd/lib/foo/a.js +++ b/tests/baselines/reference/project/nonRelative/amd/lib/foo/a.js @@ -1,5 +1,4 @@ define(["require", "exports"], function (require, exports) { - function hello() { - } + function hello() { } exports.hello = hello; }); diff --git a/tests/baselines/reference/project/nonRelative/amd/lib/foo/b.js b/tests/baselines/reference/project/nonRelative/amd/lib/foo/b.js index 5351258111e..6ffe8c53445 100644 --- a/tests/baselines/reference/project/nonRelative/amd/lib/foo/b.js +++ b/tests/baselines/reference/project/nonRelative/amd/lib/foo/b.js @@ -1,5 +1,4 @@ define(["require", "exports"], function (require, exports) { - function hello() { - } + function hello() { } exports.hello = hello; }); diff --git a/tests/baselines/reference/project/nonRelative/node/lib/bar/a.js b/tests/baselines/reference/project/nonRelative/node/lib/bar/a.js index 3bc8930ed53..58114de3a4d 100644 --- a/tests/baselines/reference/project/nonRelative/node/lib/bar/a.js +++ b/tests/baselines/reference/project/nonRelative/node/lib/bar/a.js @@ -1,3 +1,2 @@ -function hello() { -} +function hello() { } exports.hello = hello; diff --git a/tests/baselines/reference/project/nonRelative/node/lib/foo/a.js b/tests/baselines/reference/project/nonRelative/node/lib/foo/a.js index 3bc8930ed53..58114de3a4d 100644 --- a/tests/baselines/reference/project/nonRelative/node/lib/foo/a.js +++ b/tests/baselines/reference/project/nonRelative/node/lib/foo/a.js @@ -1,3 +1,2 @@ -function hello() { -} +function hello() { } exports.hello = hello; diff --git a/tests/baselines/reference/project/nonRelative/node/lib/foo/b.js b/tests/baselines/reference/project/nonRelative/node/lib/foo/b.js index 3bc8930ed53..58114de3a4d 100644 --- a/tests/baselines/reference/project/nonRelative/node/lib/foo/b.js +++ b/tests/baselines/reference/project/nonRelative/node/lib/foo/b.js @@ -1,3 +1,2 @@ -function hello() { -} +function hello() { } exports.hello = hello; diff --git a/tests/baselines/reference/project/prologueEmit/amd/out.js b/tests/baselines/reference/project/prologueEmit/amd/out.js index f311ea7ba24..b19a07f6490 100644 --- a/tests/baselines/reference/project/prologueEmit/amd/out.js +++ b/tests/baselines/reference/project/prologueEmit/amd/out.js @@ -1,8 +1,6 @@ var _this = this; // Add a lambda to ensure global 'this' capture is triggered -(function () { - return _this.window; -}); +(function () { return _this.window; }); var __extends = this.__extends || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } diff --git a/tests/baselines/reference/project/prologueEmit/node/out.js b/tests/baselines/reference/project/prologueEmit/node/out.js index f311ea7ba24..b19a07f6490 100644 --- a/tests/baselines/reference/project/prologueEmit/node/out.js +++ b/tests/baselines/reference/project/prologueEmit/node/out.js @@ -1,8 +1,6 @@ var _this = this; // Add a lambda to ensure global 'this' capture is triggered -(function () { - return _this.window; -}); +(function () { return _this.window; }); var __extends = this.__extends || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/li'b/class'A.js b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/li'b/class'A.js index 649db9a606d..115b5fff25f 100644 --- a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/li'b/class'A.js +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/li'b/class'A.js @@ -3,8 +3,7 @@ var test; var ClassA = (function () { function ClassA() { } - ClassA.prototype.method = function () { - }; + ClassA.prototype.method = function () { }; return ClassA; })(); test.ClassA = ClassA; diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/li'b/class'A.js b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/li'b/class'A.js index 649db9a606d..115b5fff25f 100644 --- a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/li'b/class'A.js +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/li'b/class'A.js @@ -3,8 +3,7 @@ var test; var ClassA = (function () { function ClassA() { } - ClassA.prototype.method = function () { - }; + ClassA.prototype.method = function () { }; return ClassA; })(); test.ClassA = ClassA; diff --git a/tests/baselines/reference/promiseChaining.js b/tests/baselines/reference/promiseChaining.js index acf6b715175..ce15e2d44c1 100644 --- a/tests/baselines/reference/promiseChaining.js +++ b/tests/baselines/reference/promiseChaining.js @@ -19,13 +19,7 @@ var Chain = (function () { Chain.prototype.then = function (cb) { var result = cb(this.value); // should get a fresh type parameter which each then call - var z = this.then(function (x) { - return result; - }) /*S*/.then(function (x) { - return "abc"; - }) /*string*/.then(function (x) { - return x.length; - }); // No error + var z = this.then(function (x) { return result; }) /*S*/.then(function (x) { return "abc"; }) /*string*/.then(function (x) { return x.length; }); // No error return new Chain(result); }; return Chain; diff --git a/tests/baselines/reference/promiseChaining1.js b/tests/baselines/reference/promiseChaining1.js index 54e5064809e..001f1ffc1a6 100644 --- a/tests/baselines/reference/promiseChaining1.js +++ b/tests/baselines/reference/promiseChaining1.js @@ -19,13 +19,7 @@ var Chain2 = (function () { Chain2.prototype.then = function (cb) { var result = cb(this.value); // should get a fresh type parameter which each then call - var z = this.then(function (x) { - return result; - }) /*S*/.then(function (x) { - return "abc"; - }) /*Function*/.then(function (x) { - return x.length; - }); // Should error on "abc" because it is not a Function + var z = this.then(function (x) { return result; }) /*S*/.then(function (x) { return "abc"; }) /*Function*/.then(function (x) { return x.length; }); // Should error on "abc" because it is not a Function return new Chain2(result); }; return Chain2; diff --git a/tests/baselines/reference/promiseChaining2.js b/tests/baselines/reference/promiseChaining2.js index 88b601aad82..ed03ab2c97a 100644 --- a/tests/baselines/reference/promiseChaining2.js +++ b/tests/baselines/reference/promiseChaining2.js @@ -19,13 +19,7 @@ var Chain2 = (function () { Chain2.prototype.then = function (cb) { var result = cb(this.value); // should get a fresh type parameter which each then call - var z = this.then(function (x) { - return result; - }).then(function (x) { - return "abc"; - }).then(function (x) { - return x.length; - }); + var z = this.then(function (x) { return result; }).then(function (x) { return "abc"; }).then(function (x) { return x.length; }); return new Chain2(result); }; return Chain2; diff --git a/tests/baselines/reference/promisePermutations.js b/tests/baselines/reference/promisePermutations.js index 83b1f251e61..e59e49d6f8c 100644 --- a/tests/baselines/reference/promisePermutations.js +++ b/tests/baselines/reference/promisePermutations.js @@ -251,17 +251,13 @@ var s9d = s9.then(sPromise, sPromise, sPromise); // ok var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // error var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok -var r10 = testFunction10(function (x) { - return x; -}); +var r10 = testFunction10(function (x) { return x; }); var r10a = r10.then(testFunction10, testFunction10, testFunction10); // ok var r10b = r10.then(sIPromise, sIPromise, sIPromise); // ok var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok var r10d = r10.then(testFunction, sIPromise, nIPromise); // ok var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok -var s10 = testFunction10P(function (x) { - return x; -}); +var s10 = testFunction10P(function (x) { return x; }); var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok var s10b = s10.then(testFunction10P, testFunction10P, testFunction10P); // ok var s10c = s10.then(testFunction10P, testFunction10, testFunction10); // ok @@ -275,13 +271,9 @@ var s11; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // error -var r12 = testFunction12(function (x) { - return x; -}); +var r12 = testFunction12(function (x) { return x; }); var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok -var s12 = testFunction12(function (x) { - return x; -}); +var s12 = testFunction12(function (x) { return x; }); var s12a = s12.then(testFunction12, testFunction12, testFunction12); // ok var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); // ok var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok diff --git a/tests/baselines/reference/promisePermutations2.js b/tests/baselines/reference/promisePermutations2.js index 9a321e03667..a7b5d8cf835 100644 --- a/tests/baselines/reference/promisePermutations2.js +++ b/tests/baselines/reference/promisePermutations2.js @@ -251,17 +251,13 @@ var s9d = s9.then(sPromise, sPromise, sPromise); // ok var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // error var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok -var r10 = testFunction10(function (x) { - return x; -}); +var r10 = testFunction10(function (x) { return x; }); var r10a = r10.then(testFunction10, testFunction10, testFunction10); // ok var r10b = r10.then(sIPromise, sIPromise, sIPromise); // ok var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok var r10d = r10.then(testFunction, sIPromise, nIPromise); // error var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok -var s10 = testFunction10P(function (x) { - return x; -}); +var s10 = testFunction10P(function (x) { return x; }); var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok var s10b = s10.then(testFunction10P, testFunction10P, testFunction10P); // ok var s10c = s10.then(testFunction10P, testFunction10, testFunction10); // ok @@ -275,13 +271,9 @@ var s11; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // ok var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // ok -var r12 = testFunction12(function (x) { - return x; -}); +var r12 = testFunction12(function (x) { return x; }); var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok -var s12 = testFunction12(function (x) { - return x; -}); +var s12 = testFunction12(function (x) { return x; }); var s12a = s12.then(testFunction12, testFunction12, testFunction12); // ok var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); // ok var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok diff --git a/tests/baselines/reference/promisePermutations3.js b/tests/baselines/reference/promisePermutations3.js index cbee4093a65..eb9c882b971 100644 --- a/tests/baselines/reference/promisePermutations3.js +++ b/tests/baselines/reference/promisePermutations3.js @@ -251,17 +251,13 @@ var s9d = s9.then(sPromise, sPromise, sPromise); // ok var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // error var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok -var r10 = testFunction10(function (x) { - return x; -}); +var r10 = testFunction10(function (x) { return x; }); var r10a = r10.then(testFunction10, testFunction10, testFunction10); // ok var r10b = r10.then(sIPromise, sIPromise, sIPromise); // ok var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok var r10d = r10.then(testFunction, sIPromise, nIPromise); // error var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok -var s10 = testFunction10P(function (x) { - return x; -}); +var s10 = testFunction10P(function (x) { return x; }); var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok var s10b = s10.then(testFunction10P, testFunction10P, testFunction10P); // ok var s10c = s10.then(testFunction10P, testFunction10, testFunction10); // ok @@ -275,13 +271,9 @@ var s11; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // error -var r12 = testFunction12(function (x) { - return x; -}); +var r12 = testFunction12(function (x) { return x; }); var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok -var s12 = testFunction12(function (x) { - return x; -}); +var s12 = testFunction12(function (x) { return x; }); var s12a = s12.then(testFunction12, testFunction12, testFunction12); // ok var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); // ok var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok diff --git a/tests/baselines/reference/promiseTypeInference.js b/tests/baselines/reference/promiseTypeInference.js index 8124c4b03a8..6faf131438a 100644 --- a/tests/baselines/reference/promiseTypeInference.js +++ b/tests/baselines/reference/promiseTypeInference.js @@ -12,6 +12,4 @@ var $$x = load("something").then(s => convert(s)); //// [promiseTypeInference.js] -var $$x = load("something").then(function (s) { - return convert(s); -}); +var $$x = load("something").then(function (s) { return convert(s); }); diff --git a/tests/baselines/reference/propertyAccess.js b/tests/baselines/reference/propertyAccess.js index d646ca40763..9295ce43b26 100644 --- a/tests/baselines/reference/propertyAccess.js +++ b/tests/baselines/reference/propertyAccess.js @@ -176,28 +176,15 @@ var Compass; Compass[Compass["East"] = 2] = "East"; Compass[Compass["West"] = 3] = "West"; })(Compass || (Compass = {})); -var numIndex = { - 3: 'three', - 'three': 'three' -}; -var strIndex = { - 'N': Compass.North, - 'E': Compass.East -}; +var numIndex = { 3: 'three', 'three': 'three' }; +var strIndex = { 'N': Compass.North, 'E': Compass.East }; var bothIndex; -function noIndex() { -} +function noIndex() { } var obj = { 10: 'ten', x: 'hello', y: 32, - z: { - n: 'world', - m: 15, - o: function () { - return false; - } - }, + z: { n: 'world', m: 15, o: function () { return false; } }, 'literal property': 100 }; var anyVar = {}; diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js index 81cdcec5434..88baee7752e 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js @@ -92,9 +92,7 @@ var __extends = this.__extends || function (d, b) { var A = (function () { function A() { } - A.prototype.foo = function () { - return ''; - }; + A.prototype.foo = function () { return ''; }; return A; })(); var B = (function (_super) { diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js index eb3770bc0b3..941adc7ab43 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js @@ -67,9 +67,7 @@ var __extends = this.__extends || function (d, b) { var A = (function () { function A() { } - A.prototype.foo = function () { - return ''; - }; + A.prototype.foo = function () { return ''; }; return A; })(); var B = (function (_super) { diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js index 3a88ec832f7..fe3c9433796 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js @@ -54,9 +54,7 @@ var __extends = this.__extends || function (d, b) { var A = (function () { function A() { } - A.prototype.foo = function () { - return ''; - }; + A.prototype.foo = function () { return ''; }; return A; })(); var B = (function (_super) { diff --git a/tests/baselines/reference/propertyAndAccessorWithSameName.js b/tests/baselines/reference/propertyAndAccessorWithSameName.js index f466483cede..f8978ac4d18 100644 --- a/tests/baselines/reference/propertyAndAccessorWithSameName.js +++ b/tests/baselines/reference/propertyAndAccessorWithSameName.js @@ -36,8 +36,7 @@ var D = (function () { function D() { } Object.defineProperty(D.prototype, "x", { - set: function (v) { - } // error + set: function (v) { } // error , enumerable: true, configurable: true @@ -51,8 +50,7 @@ var E = (function () { get: function () { return 1; }, - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/propertyAndFunctionWithSameName.js b/tests/baselines/reference/propertyAndFunctionWithSameName.js index ec5f1903e8a..eb0b437fd5c 100644 --- a/tests/baselines/reference/propertyAndFunctionWithSameName.js +++ b/tests/baselines/reference/propertyAndFunctionWithSameName.js @@ -23,7 +23,6 @@ var C = (function () { var D = (function () { function D() { } - D.prototype.x = function (v) { - }; // error + D.prototype.x = function (v) { }; // error return D; })(); diff --git a/tests/baselines/reference/propertyOrdering.js b/tests/baselines/reference/propertyOrdering.js index 1dc930f93a1..f0f4644a983 100644 --- a/tests/baselines/reference/propertyOrdering.js +++ b/tests/baselines/reference/propertyOrdering.js @@ -31,9 +31,7 @@ var Foo = (function () { Foo.prototype.foo = function () { return this._store.length; // shouldn't be an error }; - Foo.prototype.bar = function () { - return this.store; - }; // should be an error + Foo.prototype.bar = function () { return this.store; }; // should be an error return Foo; })(); var Bar = (function () { diff --git a/tests/baselines/reference/propertyWrappedInTry.js b/tests/baselines/reference/propertyWrappedInTry.js index 459e35f91ae..e7f8a28d688 100644 --- a/tests/baselines/reference/propertyWrappedInTry.js +++ b/tests/baselines/reference/propertyWrappedInTry.js @@ -28,8 +28,7 @@ var Foo = (function () { try { bar = someInitThatMightFail(); } -catch (e) { -} +catch (e) { } baz(); { return this.bar; // doesn't get rewritten to Foo.bar. diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinClass.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinClass.js index 63c6929e8b7..19ec9f50d27 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinClass.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinClass.js @@ -37,34 +37,20 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "y", { - get: function () { - return this.x; - }, - set: function (x) { - this.y = this.x; - }, + get: function () { return this.x; }, + set: function (x) { this.y = this.x; }, enumerable: true, configurable: true }); - C.prototype.foo = function () { - return this.foo; - }; + C.prototype.foo = function () { return this.foo; }; Object.defineProperty(C, "y", { - get: function () { - return this.x; - }, - set: function (x) { - this.y = this.x; - }, + get: function () { return this.x; }, + set: function (x) { this.y = this.x; }, enumerable: true, configurable: true }); - C.foo = function () { - return this.foo; - }; - C.bar = function () { - this.foo(); - }; + C.foo = function () { return this.foo; }; + C.bar = function () { this.foo(); }; return C; })(); // added level of function nesting @@ -74,54 +60,40 @@ var C2 = (function () { Object.defineProperty(C2.prototype, "y", { get: function () { var _this = this; - (function () { - return _this.x; - }); + (function () { return _this.x; }); return null; }, set: function (x) { var _this = this; - (function () { - _this.y = _this.x; - }); + (function () { _this.y = _this.x; }); }, enumerable: true, configurable: true }); C2.prototype.foo = function () { var _this = this; - (function () { - return _this.foo; - }); + (function () { return _this.foo; }); }; Object.defineProperty(C2, "y", { get: function () { var _this = this; - (function () { - return _this.x; - }); + (function () { return _this.x; }); return null; }, set: function (x) { var _this = this; - (function () { - _this.y = _this.x; - }); + (function () { _this.y = _this.x; }); }, enumerable: true, configurable: true }); C2.foo = function () { var _this = this; - (function () { - return _this.foo; - }); + (function () { return _this.foo; }); }; C2.bar = function () { var _this = this; - (function () { - return _this.foo(); - }); + (function () { return _this.foo(); }); }; return C2; })(); diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js index 381d10f43ea..28a1da5ffec 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js @@ -38,36 +38,20 @@ var C = (function (_super) { _super.apply(this, arguments); } Object.defineProperty(C.prototype, "y", { - get: function () { - return this.x; - }, - set: function (x) { - this.y = this.x; - }, + get: function () { return this.x; }, + set: function (x) { this.y = this.x; }, enumerable: true, configurable: true }); - C.prototype.foo = function () { - return this.x; - }; - C.prototype.bar = function () { - return this.foo(); - }; + C.prototype.foo = function () { return this.x; }; + C.prototype.bar = function () { return this.foo(); }; Object.defineProperty(C, "y", { - get: function () { - return this.x; - }, - set: function (x) { - this.y = this.x; - }, + get: function () { return this.x; }, + set: function (x) { this.y = this.x; }, enumerable: true, configurable: true }); - C.foo = function () { - return this.x; - }; - C.bar = function () { - this.foo(); - }; + C.foo = function () { return this.x; }; + C.bar = function () { this.foo(); }; return C; })(B); diff --git a/tests/baselines/reference/prototypes.js b/tests/baselines/reference/prototypes.js index 4ecdafb3dc4..4d7ddc4a4d5 100644 --- a/tests/baselines/reference/prototypes.js +++ b/tests/baselines/reference/prototypes.js @@ -7,6 +7,5 @@ f.prototype; //// [prototypes.js] Object.prototype; // ok new Object().prototype; // error -function f() { -} +function f() { } f.prototype; diff --git a/tests/baselines/reference/qualifiedModuleLocals.js b/tests/baselines/reference/qualifiedModuleLocals.js index 2909be7639d..b7ba5b70e81 100644 --- a/tests/baselines/reference/qualifiedModuleLocals.js +++ b/tests/baselines/reference/qualifiedModuleLocals.js @@ -13,11 +13,8 @@ A.a(); //// [qualifiedModuleLocals.js] var A; (function (A) { - function b() { - } - function a() { - A.b(); - } + function b() { } + function a() { A.b(); } A.a = a; // A.b should be an unresolved symbol error })(A || (A = {})); A.a(); diff --git a/tests/baselines/reference/quotedAccessorName1.js b/tests/baselines/reference/quotedAccessorName1.js index 93fd5b8dd6b..69e0fdb2c8e 100644 --- a/tests/baselines/reference/quotedAccessorName1.js +++ b/tests/baselines/reference/quotedAccessorName1.js @@ -8,9 +8,7 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "foo", { - get: function () { - return 0; - }, + get: function () { return 0; }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/quotedAccessorName2.js b/tests/baselines/reference/quotedAccessorName2.js index 43041a29bf4..5d2d4861550 100644 --- a/tests/baselines/reference/quotedAccessorName2.js +++ b/tests/baselines/reference/quotedAccessorName2.js @@ -8,9 +8,7 @@ var C = (function () { function C() { } Object.defineProperty(C, "foo", { - get: function () { - return 0; - }, + get: function () { return 0; }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/quotedFunctionName1.js b/tests/baselines/reference/quotedFunctionName1.js index 28d75186474..69f4f2cfaa3 100644 --- a/tests/baselines/reference/quotedFunctionName1.js +++ b/tests/baselines/reference/quotedFunctionName1.js @@ -7,7 +7,6 @@ class Test1 { var Test1 = (function () { function Test1() { } - Test1.prototype["prop1"] = function () { - }; + Test1.prototype["prop1"] = function () { }; return Test1; })(); diff --git a/tests/baselines/reference/quotedFunctionName2.js b/tests/baselines/reference/quotedFunctionName2.js index 46d8d9bae9d..3173ec29f13 100644 --- a/tests/baselines/reference/quotedFunctionName2.js +++ b/tests/baselines/reference/quotedFunctionName2.js @@ -7,7 +7,6 @@ class Test1 { var Test1 = (function () { function Test1() { } - Test1["prop1"] = function () { - }; + Test1["prop1"] = function () { }; return Test1; })(); diff --git a/tests/baselines/reference/quotedPropertyName3.js b/tests/baselines/reference/quotedPropertyName3.js index 8e6342e1ba3..4191418e42a 100644 --- a/tests/baselines/reference/quotedPropertyName3.js +++ b/tests/baselines/reference/quotedPropertyName3.js @@ -13,9 +13,7 @@ var Test = (function () { } Test.prototype.foo = function () { var _this = this; - var x = function () { - return _this["prop1"]; - }; + var x = function () { return _this["prop1"]; }; var y = x(); }; return Test; diff --git a/tests/baselines/reference/rectype.js b/tests/baselines/reference/rectype.js index ed303b6b26e..15c5d9861f4 100644 --- a/tests/baselines/reference/rectype.js +++ b/tests/baselines/reference/rectype.js @@ -16,9 +16,7 @@ module M { //// [rectype.js] var M; (function (M) { - function f(p) { - return f; - } + function f(p) { return f; } M.f = f; ; var i; diff --git a/tests/baselines/reference/recur1.js b/tests/baselines/reference/recur1.js index 3dd0e14ad97..37a8b6eb3f2 100644 --- a/tests/baselines/reference/recur1.js +++ b/tests/baselines/reference/recur1.js @@ -9,8 +9,6 @@ cobalt.pitch = function() {} //// [recur1.js] var salt = new salt.pepper(); -salt.pepper = function () { -}; +salt.pepper = function () { }; var cobalt = new cobalt.pitch(); -cobalt.pitch = function () { -}; +cobalt.pitch = function () { }; diff --git a/tests/baselines/reference/recursiveBaseConstructorCreation1.js b/tests/baselines/reference/recursiveBaseConstructorCreation1.js index 69a71a4f79c..c475f604b14 100644 --- a/tests/baselines/reference/recursiveBaseConstructorCreation1.js +++ b/tests/baselines/reference/recursiveBaseConstructorCreation1.js @@ -16,8 +16,7 @@ var __extends = this.__extends || function (d, b) { var C1 = (function () { function C1() { } - C1.prototype.func = function (param) { - }; + C1.prototype.func = function (param) { }; return C1; })(); var C2 = (function (_super) { diff --git a/tests/baselines/reference/recursiveClassReferenceTest.js b/tests/baselines/reference/recursiveClassReferenceTest.js index 5f8be8bfdf1..d47d9340a8c 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.js +++ b/tests/baselines/reference/recursiveClassReferenceTest.js @@ -122,9 +122,7 @@ var Sample; var StartFindAction = (function () { function StartFindAction() { } - StartFindAction.prototype.getId = function () { - return "yo"; - }; + StartFindAction.prototype.getId = function () { return "yo"; }; StartFindAction.prototype.run = function (Thing) { return true; }; @@ -148,11 +146,9 @@ var Sample; // scenario 1 codeThing.addWidget("addWidget", this); } - FindWidget.prototype.gar = function (runner) { - if (true) { - return runner(this); - } - }; + FindWidget.prototype.gar = function (runner) { if (true) { + return runner(this); + } }; FindWidget.prototype.getDomNode = function () { return domNode; }; @@ -167,9 +163,7 @@ var Sample; var AbstractMode = (function () { function AbstractMode() { } - AbstractMode.prototype.getInitialState = function () { - return null; - }; + AbstractMode.prototype.getInitialState = function () { return null; }; return AbstractMode; })(); var Sample; @@ -190,9 +184,7 @@ var Sample; State.prototype.equals = function (other) { return this === other; }; - State.prototype.getMode = function () { - return mode; - }; + State.prototype.getMode = function () { return mode; }; return State; })(); PlainText.State = State; diff --git a/tests/baselines/reference/recursiveClassReferenceTest.js.map b/tests/baselines/reference/recursiveClassReferenceTest.js.map index acc518edaca..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;wBAAiBE,MAAMA,CAACA,IAAIA,CAACA;oBAACA,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;oBAAIE,EAAEA,CAACA,CAACA,IAAIA,CAACA,CAACA,CAACA;wBAAAA,MAAMA,CAACA,MAAMA,CAACA,IAAIA,CAACA,CAACA;oBAAAA,CAACA;gBAAAA,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;QAAmCE,MAAMA,CAACA,IAAIA,CAACA;IAAAA,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;wBAA0BI,MAAMA,CAACA,IAAIA,CAACA;oBAACA,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 7e1295d6306..23950aba4ba 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt +++ b/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt @@ -229,7 +229,7 @@ sourceFile:recursiveClassReferenceTest.ts >>> } 1->^^^^^^^^^^^^^^^^^^^^ 2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1->export class StartFindAction implements Sample.Thing.IAction { > > public getId() { return "yo"; } @@ -243,61 +243,56 @@ sourceFile:recursiveClassReferenceTest.ts 1->Emitted(19, 21) Source(41, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.constructor) 2 >Emitted(19, 22) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.constructor) --- ->>> StartFindAction.prototype.getId = function () { +>>> StartFindAction.prototype.getId = function () { return "yo"; }; 1->^^^^^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^^^^^ +6 > ^ +7 > ^^^^ +8 > ^ +9 > ^ +10> ^ 1-> 2 > getId 3 > +4 > public getId() { +5 > return +6 > +7 > "yo" +8 > ; +9 > +10> } 1->Emitted(20, 21) Source(35, 10) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) 2 >Emitted(20, 52) Source(35, 15) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) 3 >Emitted(20, 55) Source(35, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) ---- ->>> return "yo"; -1 >^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^ -5 > ^ -1 >public getId() { -2 > return -3 > -4 > "yo" -5 > ; -1 >Emitted(21, 25) Source(35, 20) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) -2 >Emitted(21, 31) Source(35, 26) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) -3 >Emitted(21, 32) Source(35, 27) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) -4 >Emitted(21, 36) Source(35, 31) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) -5 >Emitted(21, 37) Source(35, 32) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) ---- ->>> }; -1 >^^^^^^^^^^^^^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -1 >Emitted(22, 21) Source(35, 33) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) -2 >Emitted(22, 22) Source(35, 34) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) +4 >Emitted(20, 69) Source(35, 20) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) +5 >Emitted(20, 75) Source(35, 26) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) +6 >Emitted(20, 76) Source(35, 27) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) +7 >Emitted(20, 80) Source(35, 31) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) +8 >Emitted(20, 81) Source(35, 32) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) +9 >Emitted(20, 82) Source(35, 33) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) +10>Emitted(20, 83) Source(35, 34) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) --- >>> StartFindAction.prototype.run = function (Thing) { -1->^^^^^^^^^^^^^^^^^^^^ +1 >^^^^^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^^^ 4 > ^^^^^^^^^^ 5 > ^^^^^ -1-> +1 > > > public 2 > run 3 > 4 > public run( 5 > Thing:Sample.Thing.ICodeThing -1->Emitted(23, 21) Source(37, 10) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) -2 >Emitted(23, 50) Source(37, 13) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) -3 >Emitted(23, 53) Source(37, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) -4 >Emitted(23, 63) Source(37, 14) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) -5 >Emitted(23, 68) Source(37, 43) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +1 >Emitted(21, 21) Source(37, 10) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +2 >Emitted(21, 50) Source(37, 13) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +3 >Emitted(21, 53) Source(37, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +4 >Emitted(21, 63) Source(37, 14) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +5 >Emitted(21, 68) Source(37, 43) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) --- >>> return true; 1 >^^^^^^^^^^^^^^^^^^^^^^^^ @@ -312,11 +307,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > 4 > true 5 > ; -1 >Emitted(24, 25) Source(39, 4) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) -2 >Emitted(24, 31) Source(39, 10) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) -3 >Emitted(24, 32) Source(39, 11) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) -4 >Emitted(24, 36) Source(39, 15) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) -5 >Emitted(24, 37) Source(39, 16) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) +1 >Emitted(22, 25) Source(39, 4) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) +2 >Emitted(22, 31) Source(39, 10) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) +3 >Emitted(22, 32) Source(39, 11) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) +4 >Emitted(22, 36) Source(39, 15) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) +5 >Emitted(22, 37) Source(39, 16) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) --- >>> }; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -325,8 +320,8 @@ sourceFile:recursiveClassReferenceTest.ts 1 > > 2 > } -1 >Emitted(25, 21) Source(40, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) -2 >Emitted(25, 22) Source(40, 4) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) +1 >Emitted(23, 21) Source(40, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) +2 >Emitted(23, 22) Source(40, 4) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) --- >>> return StartFindAction; 1->^^^^^^^^^^^^^^^^^^^^ @@ -334,8 +329,8 @@ sourceFile:recursiveClassReferenceTest.ts 1-> > 2 > } -1->Emitted(26, 21) Source(41, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) -2 >Emitted(26, 43) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +1->Emitted(24, 21) Source(41, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +2 >Emitted(24, 43) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) --- >>> })(); 1 >^^^^^^^^^^^^^^^^ @@ -355,10 +350,10 @@ sourceFile:recursiveClassReferenceTest.ts > return true; > } > } -1 >Emitted(27, 17) Source(41, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) -2 >Emitted(27, 18) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) -3 >Emitted(27, 18) Source(33, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find) -4 >Emitted(27, 22) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find) +1 >Emitted(25, 17) Source(41, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +2 >Emitted(25, 18) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +3 >Emitted(25, 18) Source(33, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find) +4 >Emitted(25, 22) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find) --- >>> Find.StartFindAction = StartFindAction; 1->^^^^^^^^^^^^^^^^ @@ -378,10 +373,10 @@ sourceFile:recursiveClassReferenceTest.ts > } > } 4 > -1->Emitted(28, 17) Source(33, 15) + SourceIndex(0) name (Sample.Actions.Thing.Find) -2 >Emitted(28, 37) Source(33, 30) + SourceIndex(0) name (Sample.Actions.Thing.Find) -3 >Emitted(28, 55) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find) -4 >Emitted(28, 56) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find) +1->Emitted(26, 17) Source(33, 15) + SourceIndex(0) name (Sample.Actions.Thing.Find) +2 >Emitted(26, 37) Source(33, 30) + SourceIndex(0) name (Sample.Actions.Thing.Find) +3 >Emitted(26, 55) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find) +4 >Emitted(26, 56) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find) --- >>> })(Find = Thing_1.Find || (Thing_1.Find = {})); 1->^^^^^^^^^^^^ @@ -413,15 +408,15 @@ sourceFile:recursiveClassReferenceTest.ts > } > } > } -1->Emitted(29, 13) Source(42, 1) + SourceIndex(0) name (Sample.Actions.Thing.Find) -2 >Emitted(29, 14) Source(42, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find) -3 >Emitted(29, 16) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing) -4 >Emitted(29, 20) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing) -5 >Emitted(29, 23) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing) -6 >Emitted(29, 35) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing) -7 >Emitted(29, 40) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing) -8 >Emitted(29, 52) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing) -9 >Emitted(29, 60) Source(42, 2) + SourceIndex(0) name (Sample.Actions.Thing) +1->Emitted(27, 13) Source(42, 1) + SourceIndex(0) name (Sample.Actions.Thing.Find) +2 >Emitted(27, 14) Source(42, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find) +3 >Emitted(27, 16) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing) +4 >Emitted(27, 20) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing) +5 >Emitted(27, 23) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing) +6 >Emitted(27, 35) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing) +7 >Emitted(27, 40) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing) +8 >Emitted(27, 52) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing) +9 >Emitted(27, 60) Source(42, 2) + SourceIndex(0) name (Sample.Actions.Thing) --- >>> })(Thing = Actions.Thing || (Actions.Thing = {})); 1 >^^^^^^^^ @@ -453,15 +448,15 @@ sourceFile:recursiveClassReferenceTest.ts > } > } > } -1 >Emitted(30, 9) Source(42, 1) + SourceIndex(0) name (Sample.Actions.Thing) -2 >Emitted(30, 10) Source(42, 2) + SourceIndex(0) name (Sample.Actions.Thing) -3 >Emitted(30, 12) Source(32, 23) + SourceIndex(0) name (Sample.Actions) -4 >Emitted(30, 17) Source(32, 28) + SourceIndex(0) name (Sample.Actions) -5 >Emitted(30, 20) Source(32, 23) + SourceIndex(0) name (Sample.Actions) -6 >Emitted(30, 33) Source(32, 28) + SourceIndex(0) name (Sample.Actions) -7 >Emitted(30, 38) Source(32, 23) + SourceIndex(0) name (Sample.Actions) -8 >Emitted(30, 51) Source(32, 28) + SourceIndex(0) name (Sample.Actions) -9 >Emitted(30, 59) Source(42, 2) + SourceIndex(0) name (Sample.Actions) +1 >Emitted(28, 9) Source(42, 1) + SourceIndex(0) name (Sample.Actions.Thing) +2 >Emitted(28, 10) Source(42, 2) + SourceIndex(0) name (Sample.Actions.Thing) +3 >Emitted(28, 12) Source(32, 23) + SourceIndex(0) name (Sample.Actions) +4 >Emitted(28, 17) Source(32, 28) + SourceIndex(0) name (Sample.Actions) +5 >Emitted(28, 20) Source(32, 23) + SourceIndex(0) name (Sample.Actions) +6 >Emitted(28, 33) Source(32, 28) + SourceIndex(0) name (Sample.Actions) +7 >Emitted(28, 38) Source(32, 23) + SourceIndex(0) name (Sample.Actions) +8 >Emitted(28, 51) Source(32, 28) + SourceIndex(0) name (Sample.Actions) +9 >Emitted(28, 59) Source(42, 2) + SourceIndex(0) name (Sample.Actions) --- >>> })(Actions = Sample.Actions || (Sample.Actions = {})); 1->^^^^ @@ -492,15 +487,15 @@ sourceFile:recursiveClassReferenceTest.ts > } > } > } -1->Emitted(31, 5) Source(42, 1) + SourceIndex(0) name (Sample.Actions) -2 >Emitted(31, 6) Source(42, 2) + SourceIndex(0) name (Sample.Actions) -3 >Emitted(31, 8) Source(32, 15) + SourceIndex(0) name (Sample) -4 >Emitted(31, 15) Source(32, 22) + SourceIndex(0) name (Sample) -5 >Emitted(31, 18) Source(32, 15) + SourceIndex(0) name (Sample) -6 >Emitted(31, 32) Source(32, 22) + SourceIndex(0) name (Sample) -7 >Emitted(31, 37) Source(32, 15) + SourceIndex(0) name (Sample) -8 >Emitted(31, 51) Source(32, 22) + SourceIndex(0) name (Sample) -9 >Emitted(31, 59) Source(42, 2) + SourceIndex(0) name (Sample) +1->Emitted(29, 5) Source(42, 1) + SourceIndex(0) name (Sample.Actions) +2 >Emitted(29, 6) Source(42, 2) + SourceIndex(0) name (Sample.Actions) +3 >Emitted(29, 8) Source(32, 15) + SourceIndex(0) name (Sample) +4 >Emitted(29, 15) Source(32, 22) + SourceIndex(0) name (Sample) +5 >Emitted(29, 18) Source(32, 15) + SourceIndex(0) name (Sample) +6 >Emitted(29, 32) Source(32, 22) + SourceIndex(0) name (Sample) +7 >Emitted(29, 37) Source(32, 15) + SourceIndex(0) name (Sample) +8 >Emitted(29, 51) Source(32, 22) + SourceIndex(0) name (Sample) +9 >Emitted(29, 59) Source(42, 2) + SourceIndex(0) name (Sample) --- >>>})(Sample || (Sample = {})); 1 > @@ -527,13 +522,13 @@ sourceFile:recursiveClassReferenceTest.ts > } > } > } -1 >Emitted(32, 1) Source(42, 1) + SourceIndex(0) name (Sample) -2 >Emitted(32, 2) Source(42, 2) + SourceIndex(0) name (Sample) -3 >Emitted(32, 4) Source(32, 8) + SourceIndex(0) -4 >Emitted(32, 10) Source(32, 14) + SourceIndex(0) -5 >Emitted(32, 15) Source(32, 8) + SourceIndex(0) -6 >Emitted(32, 21) Source(32, 14) + SourceIndex(0) -7 >Emitted(32, 29) Source(42, 2) + SourceIndex(0) +1 >Emitted(30, 1) Source(42, 1) + SourceIndex(0) name (Sample) +2 >Emitted(30, 2) Source(42, 2) + SourceIndex(0) name (Sample) +3 >Emitted(30, 4) Source(32, 8) + SourceIndex(0) +4 >Emitted(30, 10) Source(32, 14) + SourceIndex(0) +5 >Emitted(30, 15) Source(32, 8) + SourceIndex(0) +6 >Emitted(30, 21) Source(32, 14) + SourceIndex(0) +7 >Emitted(30, 29) Source(42, 2) + SourceIndex(0) --- >>>var Sample; 1 > @@ -567,10 +562,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(33, 1) Source(44, 1) + SourceIndex(0) -2 >Emitted(33, 5) Source(44, 8) + SourceIndex(0) -3 >Emitted(33, 11) Source(44, 14) + SourceIndex(0) -4 >Emitted(33, 12) Source(64, 2) + SourceIndex(0) +1 >Emitted(31, 1) Source(44, 1) + SourceIndex(0) +2 >Emitted(31, 5) Source(44, 8) + SourceIndex(0) +3 >Emitted(31, 11) Source(44, 14) + SourceIndex(0) +4 >Emitted(31, 12) Source(64, 2) + SourceIndex(0) --- >>>(function (Sample) { 1-> @@ -579,9 +574,9 @@ sourceFile:recursiveClassReferenceTest.ts 1-> 2 >module 3 > Sample -1->Emitted(34, 1) Source(44, 1) + SourceIndex(0) -2 >Emitted(34, 12) Source(44, 8) + SourceIndex(0) -3 >Emitted(34, 18) Source(44, 14) + SourceIndex(0) +1->Emitted(32, 1) Source(44, 1) + SourceIndex(0) +2 >Emitted(32, 12) Source(44, 8) + SourceIndex(0) +3 >Emitted(32, 18) Source(44, 14) + SourceIndex(0) --- >>> var Thing; 1 >^^^^ @@ -613,10 +608,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(35, 5) Source(44, 15) + SourceIndex(0) name (Sample) -2 >Emitted(35, 9) Source(44, 15) + SourceIndex(0) name (Sample) -3 >Emitted(35, 14) Source(44, 20) + SourceIndex(0) name (Sample) -4 >Emitted(35, 15) Source(64, 2) + SourceIndex(0) name (Sample) +1 >Emitted(33, 5) Source(44, 15) + SourceIndex(0) name (Sample) +2 >Emitted(33, 9) Source(44, 15) + SourceIndex(0) name (Sample) +3 >Emitted(33, 14) Source(44, 20) + SourceIndex(0) name (Sample) +4 >Emitted(33, 15) Source(64, 2) + SourceIndex(0) name (Sample) --- >>> (function (Thing) { 1->^^^^ @@ -626,9 +621,9 @@ sourceFile:recursiveClassReferenceTest.ts 1-> 2 > 3 > Thing -1->Emitted(36, 5) Source(44, 15) + SourceIndex(0) name (Sample) -2 >Emitted(36, 16) Source(44, 15) + SourceIndex(0) name (Sample) -3 >Emitted(36, 21) Source(44, 20) + SourceIndex(0) name (Sample) +1->Emitted(34, 5) Source(44, 15) + SourceIndex(0) name (Sample) +2 >Emitted(34, 16) Source(44, 15) + SourceIndex(0) name (Sample) +3 >Emitted(34, 21) Source(44, 20) + SourceIndex(0) name (Sample) --- >>> var Widgets; 1->^^^^^^^^ @@ -660,10 +655,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1->Emitted(37, 9) Source(44, 21) + SourceIndex(0) name (Sample.Thing) -2 >Emitted(37, 13) Source(44, 21) + SourceIndex(0) name (Sample.Thing) -3 >Emitted(37, 20) Source(44, 28) + SourceIndex(0) name (Sample.Thing) -4 >Emitted(37, 21) Source(64, 2) + SourceIndex(0) name (Sample.Thing) +1->Emitted(35, 9) Source(44, 21) + SourceIndex(0) name (Sample.Thing) +2 >Emitted(35, 13) Source(44, 21) + SourceIndex(0) name (Sample.Thing) +3 >Emitted(35, 20) Source(44, 28) + SourceIndex(0) name (Sample.Thing) +4 >Emitted(35, 21) Source(64, 2) + SourceIndex(0) name (Sample.Thing) --- >>> (function (Widgets) { 1->^^^^^^^^ @@ -677,18 +672,18 @@ sourceFile:recursiveClassReferenceTest.ts 3 > Widgets 4 > 5 > { -1->Emitted(38, 9) Source(44, 21) + SourceIndex(0) name (Sample.Thing) -2 >Emitted(38, 20) Source(44, 21) + SourceIndex(0) name (Sample.Thing) -3 >Emitted(38, 27) Source(44, 28) + SourceIndex(0) name (Sample.Thing) -4 >Emitted(38, 29) Source(44, 29) + SourceIndex(0) name (Sample.Thing) -5 >Emitted(38, 30) Source(44, 30) + SourceIndex(0) name (Sample.Thing) +1->Emitted(36, 9) Source(44, 21) + SourceIndex(0) name (Sample.Thing) +2 >Emitted(36, 20) Source(44, 21) + SourceIndex(0) name (Sample.Thing) +3 >Emitted(36, 27) Source(44, 28) + SourceIndex(0) name (Sample.Thing) +4 >Emitted(36, 29) Source(44, 29) + SourceIndex(0) name (Sample.Thing) +5 >Emitted(36, 30) Source(44, 30) + SourceIndex(0) name (Sample.Thing) --- >>> var FindWidget = (function () { 1->^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(39, 13) Source(45, 2) + SourceIndex(0) name (Sample.Thing.Widgets) +1->Emitted(37, 13) Source(45, 2) + SourceIndex(0) name (Sample.Thing.Widgets) --- >>> function FindWidget(codeThing) { 1->^^^^^^^^^^^^^^^^ @@ -703,9 +698,9 @@ sourceFile:recursiveClassReferenceTest.ts > 2 > constructor(private 3 > codeThing: Sample.Thing.ICodeThing -1->Emitted(40, 17) Source(50, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) -2 >Emitted(40, 37) Source(50, 23) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) -3 >Emitted(40, 46) Source(50, 57) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +1->Emitted(38, 17) Source(50, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +2 >Emitted(38, 37) Source(50, 23) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +3 >Emitted(38, 46) Source(50, 57) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) --- >>> this.codeThing = codeThing; 1->^^^^^^^^^^^^^^^^^^^^ @@ -718,11 +713,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > 4 > codeThing 5 > : Sample.Thing.ICodeThing -1->Emitted(41, 21) Source(50, 23) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -2 >Emitted(41, 35) Source(50, 32) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -3 >Emitted(41, 38) Source(50, 23) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -4 >Emitted(41, 47) Source(50, 32) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -5 >Emitted(41, 48) Source(50, 57) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +1->Emitted(39, 21) Source(50, 23) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +2 >Emitted(39, 35) Source(50, 32) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +3 >Emitted(39, 38) Source(50, 23) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +4 >Emitted(39, 47) Source(50, 32) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +5 >Emitted(39, 48) Source(50, 57) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) --- >>> this.domNode = null; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -735,11 +730,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > :any = 4 > null 5 > ; -1 >Emitted(42, 21) Source(49, 11) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -2 >Emitted(42, 33) Source(49, 18) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -3 >Emitted(42, 36) Source(49, 25) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -4 >Emitted(42, 40) Source(49, 29) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -5 >Emitted(42, 41) Source(49, 30) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +1 >Emitted(40, 21) Source(49, 11) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +2 >Emitted(40, 33) Source(49, 18) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +3 >Emitted(40, 36) Source(49, 25) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +4 >Emitted(40, 40) Source(49, 29) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +5 >Emitted(40, 41) Source(49, 30) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) --- >>> // scenario 1 1 >^^^^^^^^^^^^^^^^^^^^ @@ -752,9 +747,9 @@ sourceFile:recursiveClassReferenceTest.ts > 2 > 3 > // scenario 1 -1 >Emitted(43, 21) Source(52, 7) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -2 >Emitted(43, 21) Source(51, 7) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -3 >Emitted(43, 34) Source(51, 20) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +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->^^^^^^^^^^^^^^^^^^^^ @@ -778,113 +773,108 @@ sourceFile:recursiveClassReferenceTest.ts 8 > this 9 > ) 10> ; -1->Emitted(44, 21) Source(52, 7) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -2 >Emitted(44, 30) Source(52, 16) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -3 >Emitted(44, 31) Source(52, 17) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -4 >Emitted(44, 40) Source(52, 26) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -5 >Emitted(44, 41) Source(52, 27) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -6 >Emitted(44, 52) Source(52, 38) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -7 >Emitted(44, 54) Source(52, 40) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -8 >Emitted(44, 58) Source(52, 44) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -9 >Emitted(44, 59) Source(52, 45) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -10>Emitted(44, 60) Source(52, 46) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +1->Emitted(42, 21) Source(52, 7) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +2 >Emitted(42, 30) Source(52, 16) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +3 >Emitted(42, 31) Source(52, 17) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +4 >Emitted(42, 40) Source(52, 26) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +5 >Emitted(42, 41) Source(52, 27) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +6 >Emitted(42, 52) Source(52, 38) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +7 >Emitted(42, 54) Source(52, 40) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +8 >Emitted(42, 58) Source(52, 44) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +9 >Emitted(42, 59) Source(52, 45) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +10>Emitted(42, 60) Source(52, 46) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) --- >>> } 1 >^^^^^^^^^^^^^^^^ 2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 > } -1 >Emitted(45, 17) Source(53, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -2 >Emitted(45, 18) Source(53, 4) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +1 >Emitted(43, 17) Source(53, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +2 >Emitted(43, 18) Source(53, 4) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) --- ->>> FindWidget.prototype.gar = function (runner) { +>>> FindWidget.prototype.gar = function (runner) { if (true) { 1->^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^^^ 4 > ^^^^^^^^^^ 5 > ^^^^^^ +6 > ^^^^ +7 > ^^ +8 > ^ +9 > ^ +10> ^^^^ +11> ^ +12> ^ +13> ^ 1-> 2 > gar 3 > 4 > public gar( 5 > runner:(widget:Sample.Thing.IWidget)=>any -1->Emitted(46, 17) Source(47, 10) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) -2 >Emitted(46, 41) Source(47, 13) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) -3 >Emitted(46, 44) Source(47, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) -4 >Emitted(46, 54) Source(47, 14) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) -5 >Emitted(46, 60) Source(47, 55) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +6 > ) { +7 > if +8 > +9 > ( +10> true +11> ) +12> +13> { +1->Emitted(44, 17) Source(47, 10) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +2 >Emitted(44, 41) Source(47, 13) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +3 >Emitted(44, 44) Source(47, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +4 >Emitted(44, 54) Source(47, 14) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +5 >Emitted(44, 60) Source(47, 55) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +6 >Emitted(44, 64) Source(47, 59) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +7 >Emitted(44, 66) Source(47, 61) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +8 >Emitted(44, 67) Source(47, 62) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +9 >Emitted(44, 68) Source(47, 63) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +10>Emitted(44, 72) Source(47, 67) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +11>Emitted(44, 73) Source(47, 68) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +12>Emitted(44, 74) Source(47, 69) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +13>Emitted(44, 75) Source(47, 70) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) --- ->>> if (true) { +>>> return runner(this); 1 >^^^^^^^^^^^^^^^^^^^^ -2 > ^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^ -7 > ^ -8 > ^ -9 > ^^^^^^^^^^^^^^-> -1 >) { -2 > if -3 > -4 > ( -5 > true -6 > ) -7 > -8 > { -1 >Emitted(47, 21) Source(47, 59) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -2 >Emitted(47, 23) Source(47, 61) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -3 >Emitted(47, 24) Source(47, 62) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -4 >Emitted(47, 25) Source(47, 63) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -5 >Emitted(47, 29) Source(47, 67) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -6 >Emitted(47, 30) Source(47, 68) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -7 >Emitted(47, 31) Source(47, 69) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -8 >Emitted(47, 32) Source(47, 70) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) ---- ->>> return runner(this); -1->^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^ -5 > ^ -6 > ^^^^ -7 > ^ -8 > ^ -1-> -2 > return -3 > -4 > runner -5 > ( -6 > this -7 > ) -8 > ; -1->Emitted(48, 25) Source(47, 70) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -2 >Emitted(48, 31) Source(47, 76) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -3 >Emitted(48, 32) Source(47, 77) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -4 >Emitted(48, 38) Source(47, 83) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -5 >Emitted(48, 39) Source(47, 84) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -6 >Emitted(48, 43) Source(47, 88) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -7 >Emitted(48, 44) Source(47, 89) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -8 >Emitted(48, 45) Source(47, 90) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) ---- ->>> } -1 >^^^^^^^^^^^^^^^^^^^^ -2 > ^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^^^^ +7 > ^ +8 > ^ 1 > -2 > } -1 >Emitted(49, 21) Source(47, 90) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -2 >Emitted(49, 22) Source(47, 91) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +2 > return +3 > +4 > runner +5 > ( +6 > this +7 > ) +8 > ; +1 >Emitted(45, 21) Source(47, 70) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +2 >Emitted(45, 27) Source(47, 76) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +3 >Emitted(45, 28) Source(47, 77) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +4 >Emitted(45, 34) Source(47, 83) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +5 >Emitted(45, 35) Source(47, 84) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +6 >Emitted(45, 39) Source(47, 88) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +7 >Emitted(45, 40) Source(47, 89) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +8 >Emitted(45, 41) Source(47, 90) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) --- ->>> }; +>>> } }; 1 >^^^^^^^^^^^^^^^^ 2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > 2 > } -1 >Emitted(50, 17) Source(47, 91) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -2 >Emitted(50, 18) Source(47, 92) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +3 > +4 > } +1 >Emitted(46, 17) Source(47, 90) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +2 >Emitted(46, 18) Source(47, 91) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +3 >Emitted(46, 19) Source(47, 91) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +4 >Emitted(46, 20) Source(47, 92) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) --- >>> FindWidget.prototype.getDomNode = function () { 1->^^^^^^^^^^^^^^^^ @@ -901,9 +891,9 @@ sourceFile:recursiveClassReferenceTest.ts > public 2 > getDomNode 3 > -1->Emitted(51, 17) Source(55, 10) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) -2 >Emitted(51, 48) Source(55, 20) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) -3 >Emitted(51, 51) Source(55, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +1->Emitted(47, 17) Source(55, 10) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +2 >Emitted(47, 48) Source(55, 20) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +3 >Emitted(47, 51) Source(55, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) --- >>> return domNode; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -917,11 +907,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > 4 > domNode 5 > ; -1 >Emitted(52, 21) Source(56, 4) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) -2 >Emitted(52, 27) Source(56, 10) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) -3 >Emitted(52, 28) Source(56, 11) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) -4 >Emitted(52, 35) Source(56, 18) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) -5 >Emitted(52, 36) Source(56, 19) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) +1 >Emitted(48, 21) Source(56, 4) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) +2 >Emitted(48, 27) Source(56, 10) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) +3 >Emitted(48, 28) Source(56, 11) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) +4 >Emitted(48, 35) Source(56, 18) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) +5 >Emitted(48, 36) Source(56, 19) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) --- >>> }; 1 >^^^^^^^^^^^^^^^^ @@ -930,8 +920,8 @@ sourceFile:recursiveClassReferenceTest.ts 1 > > 2 > } -1 >Emitted(53, 17) Source(57, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) -2 >Emitted(53, 18) Source(57, 4) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) +1 >Emitted(49, 17) Source(57, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) +2 >Emitted(49, 18) Source(57, 4) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) --- >>> FindWidget.prototype.destroy = function () { 1->^^^^^^^^^^^^^^^^ @@ -942,9 +932,9 @@ sourceFile:recursiveClassReferenceTest.ts > public 2 > destroy 3 > -1->Emitted(54, 17) Source(59, 10) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) -2 >Emitted(54, 45) Source(59, 17) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) -3 >Emitted(54, 48) Source(59, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +1->Emitted(50, 17) Source(59, 10) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +2 >Emitted(50, 45) Source(59, 17) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +3 >Emitted(50, 48) Source(59, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) --- >>> }; 1 >^^^^^^^^^^^^^^^^ @@ -954,8 +944,8 @@ sourceFile:recursiveClassReferenceTest.ts > > 2 > } -1 >Emitted(55, 17) Source(61, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.destroy) -2 >Emitted(55, 18) Source(61, 4) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.destroy) +1 >Emitted(51, 17) Source(61, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.destroy) +2 >Emitted(51, 18) Source(61, 4) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.destroy) --- >>> return FindWidget; 1->^^^^^^^^^^^^^^^^ @@ -964,8 +954,8 @@ sourceFile:recursiveClassReferenceTest.ts > > 2 > } -1->Emitted(56, 17) Source(63, 2) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) -2 >Emitted(56, 34) Source(63, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +1->Emitted(52, 17) Source(63, 2) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +2 >Emitted(52, 34) Source(63, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) --- >>> })(); 1 >^^^^^^^^^^^^ @@ -995,10 +985,10 @@ sourceFile:recursiveClassReferenceTest.ts > } > > } -1 >Emitted(57, 13) Source(63, 2) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) -2 >Emitted(57, 14) Source(63, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) -3 >Emitted(57, 14) Source(45, 2) + SourceIndex(0) name (Sample.Thing.Widgets) -4 >Emitted(57, 18) Source(63, 3) + SourceIndex(0) name (Sample.Thing.Widgets) +1 >Emitted(53, 13) Source(63, 2) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +2 >Emitted(53, 14) Source(63, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +3 >Emitted(53, 14) Source(45, 2) + SourceIndex(0) name (Sample.Thing.Widgets) +4 >Emitted(53, 18) Source(63, 3) + SourceIndex(0) name (Sample.Thing.Widgets) --- >>> Widgets.FindWidget = FindWidget; 1->^^^^^^^^^^^^ @@ -1028,10 +1018,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } 4 > -1->Emitted(58, 13) Source(45, 15) + SourceIndex(0) name (Sample.Thing.Widgets) -2 >Emitted(58, 31) Source(45, 25) + SourceIndex(0) name (Sample.Thing.Widgets) -3 >Emitted(58, 44) Source(63, 3) + SourceIndex(0) name (Sample.Thing.Widgets) -4 >Emitted(58, 45) Source(63, 3) + SourceIndex(0) name (Sample.Thing.Widgets) +1->Emitted(54, 13) Source(45, 15) + SourceIndex(0) name (Sample.Thing.Widgets) +2 >Emitted(54, 31) Source(45, 25) + SourceIndex(0) name (Sample.Thing.Widgets) +3 >Emitted(54, 44) Source(63, 3) + SourceIndex(0) name (Sample.Thing.Widgets) +4 >Emitted(54, 45) Source(63, 3) + SourceIndex(0) name (Sample.Thing.Widgets) --- >>> })(Widgets = Thing.Widgets || (Thing.Widgets = {})); 1->^^^^^^^^ @@ -1073,15 +1063,15 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1->Emitted(59, 9) Source(64, 1) + SourceIndex(0) name (Sample.Thing.Widgets) -2 >Emitted(59, 10) Source(64, 2) + SourceIndex(0) name (Sample.Thing.Widgets) -3 >Emitted(59, 12) Source(44, 21) + SourceIndex(0) name (Sample.Thing) -4 >Emitted(59, 19) Source(44, 28) + SourceIndex(0) name (Sample.Thing) -5 >Emitted(59, 22) Source(44, 21) + SourceIndex(0) name (Sample.Thing) -6 >Emitted(59, 35) Source(44, 28) + SourceIndex(0) name (Sample.Thing) -7 >Emitted(59, 40) Source(44, 21) + SourceIndex(0) name (Sample.Thing) -8 >Emitted(59, 53) Source(44, 28) + SourceIndex(0) name (Sample.Thing) -9 >Emitted(59, 61) Source(64, 2) + SourceIndex(0) name (Sample.Thing) +1->Emitted(55, 9) Source(64, 1) + SourceIndex(0) name (Sample.Thing.Widgets) +2 >Emitted(55, 10) Source(64, 2) + SourceIndex(0) name (Sample.Thing.Widgets) +3 >Emitted(55, 12) Source(44, 21) + SourceIndex(0) name (Sample.Thing) +4 >Emitted(55, 19) Source(44, 28) + SourceIndex(0) name (Sample.Thing) +5 >Emitted(55, 22) Source(44, 21) + SourceIndex(0) name (Sample.Thing) +6 >Emitted(55, 35) Source(44, 28) + SourceIndex(0) name (Sample.Thing) +7 >Emitted(55, 40) Source(44, 21) + SourceIndex(0) name (Sample.Thing) +8 >Emitted(55, 53) Source(44, 28) + SourceIndex(0) name (Sample.Thing) +9 >Emitted(55, 61) Source(64, 2) + SourceIndex(0) name (Sample.Thing) --- >>> })(Thing = Sample.Thing || (Sample.Thing = {})); 1 >^^^^ @@ -1122,15 +1112,15 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(60, 5) Source(64, 1) + SourceIndex(0) name (Sample.Thing) -2 >Emitted(60, 6) Source(64, 2) + SourceIndex(0) name (Sample.Thing) -3 >Emitted(60, 8) Source(44, 15) + SourceIndex(0) name (Sample) -4 >Emitted(60, 13) Source(44, 20) + SourceIndex(0) name (Sample) -5 >Emitted(60, 16) Source(44, 15) + SourceIndex(0) name (Sample) -6 >Emitted(60, 28) Source(44, 20) + SourceIndex(0) name (Sample) -7 >Emitted(60, 33) Source(44, 15) + SourceIndex(0) name (Sample) -8 >Emitted(60, 45) Source(44, 20) + SourceIndex(0) name (Sample) -9 >Emitted(60, 53) Source(64, 2) + SourceIndex(0) name (Sample) +1 >Emitted(56, 5) Source(64, 1) + SourceIndex(0) name (Sample.Thing) +2 >Emitted(56, 6) Source(64, 2) + SourceIndex(0) name (Sample.Thing) +3 >Emitted(56, 8) Source(44, 15) + SourceIndex(0) name (Sample) +4 >Emitted(56, 13) Source(44, 20) + SourceIndex(0) name (Sample) +5 >Emitted(56, 16) Source(44, 15) + SourceIndex(0) name (Sample) +6 >Emitted(56, 28) Source(44, 20) + SourceIndex(0) name (Sample) +7 >Emitted(56, 33) Source(44, 15) + SourceIndex(0) name (Sample) +8 >Emitted(56, 45) Source(44, 20) + SourceIndex(0) name (Sample) +9 >Emitted(56, 53) Source(64, 2) + SourceIndex(0) name (Sample) --- >>>})(Sample || (Sample = {})); 1 > @@ -1168,13 +1158,13 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(61, 1) Source(64, 1) + SourceIndex(0) name (Sample) -2 >Emitted(61, 2) Source(64, 2) + SourceIndex(0) name (Sample) -3 >Emitted(61, 4) Source(44, 8) + SourceIndex(0) -4 >Emitted(61, 10) Source(44, 14) + SourceIndex(0) -5 >Emitted(61, 15) Source(44, 8) + SourceIndex(0) -6 >Emitted(61, 21) Source(44, 14) + SourceIndex(0) -7 >Emitted(61, 29) Source(64, 2) + SourceIndex(0) +1 >Emitted(57, 1) Source(64, 1) + SourceIndex(0) name (Sample) +2 >Emitted(57, 2) Source(64, 2) + SourceIndex(0) name (Sample) +3 >Emitted(57, 4) Source(44, 8) + SourceIndex(0) +4 >Emitted(57, 10) Source(44, 14) + SourceIndex(0) +5 >Emitted(57, 15) Source(44, 8) + SourceIndex(0) +6 >Emitted(57, 21) Source(44, 14) + SourceIndex(0) +7 >Emitted(57, 29) Source(64, 2) + SourceIndex(0) --- >>>var AbstractMode = (function () { 1-> @@ -1183,67 +1173,62 @@ sourceFile:recursiveClassReferenceTest.ts > >interface IMode { getInitialState(): IState;} > -1->Emitted(62, 1) Source(67, 1) + SourceIndex(0) +1->Emitted(58, 1) Source(67, 1) + SourceIndex(0) --- >>> function AbstractMode() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(63, 5) Source(67, 1) + SourceIndex(0) name (AbstractMode) +1->Emitted(59, 5) Source(67, 1) + SourceIndex(0) name (AbstractMode) --- >>> } 1->^^^^ 2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1->class AbstractMode implements IMode { public getInitialState(): IState { return null;} 2 > } -1->Emitted(64, 5) Source(67, 88) + SourceIndex(0) name (AbstractMode.constructor) -2 >Emitted(64, 6) Source(67, 89) + SourceIndex(0) name (AbstractMode.constructor) +1->Emitted(60, 5) Source(67, 88) + SourceIndex(0) name (AbstractMode.constructor) +2 >Emitted(60, 6) Source(67, 89) + SourceIndex(0) name (AbstractMode.constructor) --- ->>> AbstractMode.prototype.getInitialState = function () { +>>> AbstractMode.prototype.getInitialState = function () { return null; }; 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^^^^^ +6 > ^ +7 > ^^^^ +8 > ^ +9 > ^ +10> ^ 1-> 2 > getInitialState 3 > -1->Emitted(65, 5) Source(67, 46) + SourceIndex(0) name (AbstractMode) -2 >Emitted(65, 43) Source(67, 61) + SourceIndex(0) name (AbstractMode) -3 >Emitted(65, 46) Source(67, 39) + SourceIndex(0) name (AbstractMode) ---- ->>> return null; -1 >^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^ -5 > ^ -1 >public getInitialState(): IState { -2 > return -3 > -4 > null -5 > ; -1 >Emitted(66, 9) Source(67, 74) + SourceIndex(0) name (AbstractMode.getInitialState) -2 >Emitted(66, 15) Source(67, 80) + SourceIndex(0) name (AbstractMode.getInitialState) -3 >Emitted(66, 16) Source(67, 81) + SourceIndex(0) name (AbstractMode.getInitialState) -4 >Emitted(66, 20) Source(67, 85) + SourceIndex(0) name (AbstractMode.getInitialState) -5 >Emitted(66, 21) Source(67, 86) + SourceIndex(0) name (AbstractMode.getInitialState) ---- ->>> }; -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -1 >Emitted(67, 5) Source(67, 86) + SourceIndex(0) name (AbstractMode.getInitialState) -2 >Emitted(67, 6) Source(67, 87) + SourceIndex(0) name (AbstractMode.getInitialState) +4 > public getInitialState(): IState { +5 > return +6 > +7 > null +8 > ; +9 > +10> } +1->Emitted(61, 5) Source(67, 46) + SourceIndex(0) name (AbstractMode) +2 >Emitted(61, 43) Source(67, 61) + SourceIndex(0) name (AbstractMode) +3 >Emitted(61, 46) Source(67, 39) + SourceIndex(0) name (AbstractMode) +4 >Emitted(61, 60) Source(67, 74) + SourceIndex(0) name (AbstractMode.getInitialState) +5 >Emitted(61, 66) Source(67, 80) + SourceIndex(0) name (AbstractMode.getInitialState) +6 >Emitted(61, 67) Source(67, 81) + SourceIndex(0) name (AbstractMode.getInitialState) +7 >Emitted(61, 71) Source(67, 85) + SourceIndex(0) name (AbstractMode.getInitialState) +8 >Emitted(61, 72) Source(67, 86) + SourceIndex(0) name (AbstractMode.getInitialState) +9 >Emitted(61, 73) Source(67, 86) + SourceIndex(0) name (AbstractMode.getInitialState) +10>Emitted(61, 74) Source(67, 87) + SourceIndex(0) name (AbstractMode.getInitialState) --- >>> return AbstractMode; -1->^^^^ +1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^ -1-> +1 > 2 > } -1->Emitted(68, 5) Source(67, 88) + SourceIndex(0) name (AbstractMode) -2 >Emitted(68, 24) Source(67, 89) + SourceIndex(0) name (AbstractMode) +1 >Emitted(62, 5) Source(67, 88) + SourceIndex(0) name (AbstractMode) +2 >Emitted(62, 24) Source(67, 89) + SourceIndex(0) name (AbstractMode) --- >>>})(); 1 > @@ -1255,10 +1240,10 @@ sourceFile:recursiveClassReferenceTest.ts 2 >} 3 > 4 > class AbstractMode implements IMode { public getInitialState(): IState { return null;} } -1 >Emitted(69, 1) Source(67, 88) + SourceIndex(0) name (AbstractMode) -2 >Emitted(69, 2) Source(67, 89) + SourceIndex(0) name (AbstractMode) -3 >Emitted(69, 2) Source(67, 1) + SourceIndex(0) -4 >Emitted(69, 6) Source(67, 89) + SourceIndex(0) +1 >Emitted(63, 1) Source(67, 88) + SourceIndex(0) name (AbstractMode) +2 >Emitted(63, 2) Source(67, 89) + SourceIndex(0) name (AbstractMode) +3 >Emitted(63, 2) Source(67, 1) + SourceIndex(0) +4 >Emitted(63, 6) Source(67, 89) + SourceIndex(0) --- >>>var Sample; 1-> @@ -1303,10 +1288,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1->Emitted(70, 1) Source(76, 1) + SourceIndex(0) -2 >Emitted(70, 5) Source(76, 8) + SourceIndex(0) -3 >Emitted(70, 11) Source(76, 14) + SourceIndex(0) -4 >Emitted(70, 12) Source(100, 2) + SourceIndex(0) +1->Emitted(64, 1) Source(76, 1) + SourceIndex(0) +2 >Emitted(64, 5) Source(76, 8) + SourceIndex(0) +3 >Emitted(64, 11) Source(76, 14) + SourceIndex(0) +4 >Emitted(64, 12) Source(100, 2) + SourceIndex(0) --- >>>(function (Sample) { 1-> @@ -1315,9 +1300,9 @@ sourceFile:recursiveClassReferenceTest.ts 1-> 2 >module 3 > Sample -1->Emitted(71, 1) Source(76, 1) + SourceIndex(0) -2 >Emitted(71, 12) Source(76, 8) + SourceIndex(0) -3 >Emitted(71, 18) Source(76, 14) + SourceIndex(0) +1->Emitted(65, 1) Source(76, 1) + SourceIndex(0) +2 >Emitted(65, 12) Source(76, 8) + SourceIndex(0) +3 >Emitted(65, 18) Source(76, 14) + SourceIndex(0) --- >>> var Thing; 1 >^^^^ @@ -1353,10 +1338,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(72, 5) Source(76, 15) + SourceIndex(0) name (Sample) -2 >Emitted(72, 9) Source(76, 15) + SourceIndex(0) name (Sample) -3 >Emitted(72, 14) Source(76, 20) + SourceIndex(0) name (Sample) -4 >Emitted(72, 15) Source(100, 2) + SourceIndex(0) name (Sample) +1 >Emitted(66, 5) Source(76, 15) + SourceIndex(0) name (Sample) +2 >Emitted(66, 9) Source(76, 15) + SourceIndex(0) name (Sample) +3 >Emitted(66, 14) Source(76, 20) + SourceIndex(0) name (Sample) +4 >Emitted(66, 15) Source(100, 2) + SourceIndex(0) name (Sample) --- >>> (function (Thing) { 1->^^^^ @@ -1366,9 +1351,9 @@ sourceFile:recursiveClassReferenceTest.ts 1-> 2 > 3 > Thing -1->Emitted(73, 5) Source(76, 15) + SourceIndex(0) name (Sample) -2 >Emitted(73, 16) Source(76, 15) + SourceIndex(0) name (Sample) -3 >Emitted(73, 21) Source(76, 20) + SourceIndex(0) name (Sample) +1->Emitted(67, 5) Source(76, 15) + SourceIndex(0) name (Sample) +2 >Emitted(67, 16) Source(76, 15) + SourceIndex(0) name (Sample) +3 >Emitted(67, 21) Source(76, 20) + SourceIndex(0) name (Sample) --- >>> var Languages; 1->^^^^^^^^ @@ -1404,10 +1389,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1->Emitted(74, 9) Source(76, 21) + SourceIndex(0) name (Sample.Thing) -2 >Emitted(74, 13) Source(76, 21) + SourceIndex(0) name (Sample.Thing) -3 >Emitted(74, 22) Source(76, 30) + SourceIndex(0) name (Sample.Thing) -4 >Emitted(74, 23) Source(100, 2) + SourceIndex(0) name (Sample.Thing) +1->Emitted(68, 9) Source(76, 21) + SourceIndex(0) name (Sample.Thing) +2 >Emitted(68, 13) Source(76, 21) + SourceIndex(0) name (Sample.Thing) +3 >Emitted(68, 22) Source(76, 30) + SourceIndex(0) name (Sample.Thing) +4 >Emitted(68, 23) Source(100, 2) + SourceIndex(0) name (Sample.Thing) --- >>> (function (Languages) { 1->^^^^^^^^ @@ -1416,9 +1401,9 @@ sourceFile:recursiveClassReferenceTest.ts 1-> 2 > 3 > Languages -1->Emitted(75, 9) Source(76, 21) + SourceIndex(0) name (Sample.Thing) -2 >Emitted(75, 20) Source(76, 21) + SourceIndex(0) name (Sample.Thing) -3 >Emitted(75, 29) Source(76, 30) + SourceIndex(0) name (Sample.Thing) +1->Emitted(69, 9) Source(76, 21) + SourceIndex(0) name (Sample.Thing) +2 >Emitted(69, 20) Source(76, 21) + SourceIndex(0) name (Sample.Thing) +3 >Emitted(69, 29) Source(76, 30) + SourceIndex(0) name (Sample.Thing) --- >>> var PlainText; 1 >^^^^^^^^^^^^ @@ -1454,10 +1439,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(76, 13) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) -2 >Emitted(76, 17) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) -3 >Emitted(76, 26) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages) -4 >Emitted(76, 27) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages) +1 >Emitted(70, 13) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) +2 >Emitted(70, 17) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) +3 >Emitted(70, 26) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages) +4 >Emitted(70, 27) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages) --- >>> (function (PlainText) { 1->^^^^^^^^^^^^ @@ -1471,11 +1456,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > PlainText 4 > 5 > { -1->Emitted(77, 13) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) -2 >Emitted(77, 24) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) -3 >Emitted(77, 33) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages) -4 >Emitted(77, 35) Source(76, 41) + SourceIndex(0) name (Sample.Thing.Languages) -5 >Emitted(77, 36) Source(76, 42) + SourceIndex(0) name (Sample.Thing.Languages) +1->Emitted(71, 13) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) +2 >Emitted(71, 24) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) +3 >Emitted(71, 33) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages) +4 >Emitted(71, 35) Source(76, 41) + SourceIndex(0) name (Sample.Thing.Languages) +5 >Emitted(71, 36) Source(76, 42) + SourceIndex(0) name (Sample.Thing.Languages) --- >>> var State = (function () { 1->^^^^^^^^^^^^^^^^ @@ -1483,7 +1468,7 @@ sourceFile:recursiveClassReferenceTest.ts 1-> > > -1->Emitted(78, 17) Source(78, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +1->Emitted(72, 17) Source(78, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) --- >>> function State(mode) { 1->^^^^^^^^^^^^^^^^^^^^ @@ -1494,9 +1479,9 @@ sourceFile:recursiveClassReferenceTest.ts > 2 > constructor(private 3 > mode: IMode -1->Emitted(79, 21) Source(79, 9) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) -2 >Emitted(79, 36) Source(79, 29) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) -3 >Emitted(79, 40) Source(79, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +1->Emitted(73, 21) Source(79, 9) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +2 >Emitted(73, 36) Source(79, 29) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +3 >Emitted(73, 40) Source(79, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) --- >>> this.mode = mode; 1->^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1509,11 +1494,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > 4 > mode 5 > : IMode -1->Emitted(80, 25) Source(79, 29) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) -2 >Emitted(80, 34) Source(79, 33) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) -3 >Emitted(80, 37) Source(79, 29) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) -4 >Emitted(80, 41) Source(79, 33) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) -5 >Emitted(80, 42) Source(79, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) +1->Emitted(74, 25) Source(79, 29) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) +2 >Emitted(74, 34) Source(79, 33) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) +3 >Emitted(74, 37) Source(79, 29) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) +4 >Emitted(74, 41) Source(79, 33) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) +5 >Emitted(74, 42) Source(79, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) --- >>> } 1 >^^^^^^^^^^^^^^^^^^^^ @@ -1521,8 +1506,8 @@ sourceFile:recursiveClassReferenceTest.ts 3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 >) { 2 > } -1 >Emitted(81, 21) Source(79, 44) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) -2 >Emitted(81, 22) Source(79, 45) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) +1 >Emitted(75, 21) Source(79, 44) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) +2 >Emitted(75, 22) Source(79, 45) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) --- >>> State.prototype.clone = function () { 1->^^^^^^^^^^^^^^^^^^^^ @@ -1532,9 +1517,9 @@ sourceFile:recursiveClassReferenceTest.ts > public 2 > clone 3 > -1->Emitted(82, 21) Source(80, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) -2 >Emitted(82, 42) Source(80, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) -3 >Emitted(82, 45) Source(80, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +1->Emitted(76, 21) Source(80, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +2 >Emitted(76, 42) Source(80, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +3 >Emitted(76, 45) Source(80, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) --- >>> return this; 1 >^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1548,11 +1533,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > 4 > this 5 > ; -1 >Emitted(83, 25) Source(81, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) -2 >Emitted(83, 31) Source(81, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) -3 >Emitted(83, 32) Source(81, 11) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) -4 >Emitted(83, 36) Source(81, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) -5 >Emitted(83, 37) Source(81, 16) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) +1 >Emitted(77, 25) Source(81, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) +2 >Emitted(77, 31) Source(81, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) +3 >Emitted(77, 32) Source(81, 11) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) +4 >Emitted(77, 36) Source(81, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) +5 >Emitted(77, 37) Source(81, 16) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) --- >>> }; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -1561,8 +1546,8 @@ sourceFile:recursiveClassReferenceTest.ts 1 > > 2 > } -1 >Emitted(84, 21) Source(82, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) -2 >Emitted(84, 22) Source(82, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) +1 >Emitted(78, 21) Source(82, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) +2 >Emitted(78, 22) Source(82, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) --- >>> State.prototype.equals = function (other) { 1->^^^^^^^^^^^^^^^^^^^^ @@ -1577,11 +1562,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > 4 > public equals( 5 > other:IState -1->Emitted(85, 21) Source(84, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) -2 >Emitted(85, 43) Source(84, 16) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) -3 >Emitted(85, 46) Source(84, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) -4 >Emitted(85, 56) Source(84, 17) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) -5 >Emitted(85, 61) Source(84, 29) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +1->Emitted(79, 21) Source(84, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +2 >Emitted(79, 43) Source(84, 16) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +3 >Emitted(79, 46) Source(84, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +4 >Emitted(79, 56) Source(84, 17) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +5 >Emitted(79, 61) Source(84, 29) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) --- >>> return this === other; 1 >^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1599,71 +1584,66 @@ sourceFile:recursiveClassReferenceTest.ts 5 > === 6 > other 7 > ; -1 >Emitted(86, 25) Source(85, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) -2 >Emitted(86, 31) Source(85, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) -3 >Emitted(86, 32) Source(85, 11) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) -4 >Emitted(86, 36) Source(85, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) -5 >Emitted(86, 41) Source(85, 20) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) -6 >Emitted(86, 46) Source(85, 25) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) -7 >Emitted(86, 47) Source(85, 26) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) +1 >Emitted(80, 25) Source(85, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) +2 >Emitted(80, 31) Source(85, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) +3 >Emitted(80, 32) Source(85, 11) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) +4 >Emitted(80, 36) Source(85, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) +5 >Emitted(80, 41) Source(85, 20) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) +6 >Emitted(80, 46) Source(85, 25) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) +7 >Emitted(80, 47) Source(85, 26) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) --- >>> }; 1 >^^^^^^^^^^^^^^^^^^^^ 2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 > } -1 >Emitted(87, 21) Source(86, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) -2 >Emitted(87, 22) Source(86, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) +1 >Emitted(81, 21) Source(86, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) +2 >Emitted(81, 22) Source(86, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) --- ->>> State.prototype.getMode = function () { +>>> State.prototype.getMode = function () { return mode; }; 1->^^^^^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^^^^^ +6 > ^ +7 > ^^^^ +8 > ^ +9 > ^ +10> ^ 1-> > > public 2 > getMode 3 > -1->Emitted(88, 21) Source(88, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) -2 >Emitted(88, 44) Source(88, 17) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) -3 >Emitted(88, 47) Source(88, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) ---- ->>> return mode; -1 >^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^ -5 > ^ -1 >public getMode(): IMode { -2 > return -3 > -4 > mode -5 > ; -1 >Emitted(89, 25) Source(88, 29) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) -2 >Emitted(89, 31) Source(88, 35) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) -3 >Emitted(89, 32) Source(88, 36) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) -4 >Emitted(89, 36) Source(88, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) -5 >Emitted(89, 37) Source(88, 41) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) ---- ->>> }; -1 >^^^^^^^^^^^^^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1 > -2 > } -1 >Emitted(90, 21) Source(88, 42) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) -2 >Emitted(90, 22) Source(88, 43) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) +4 > public getMode(): IMode { +5 > return +6 > +7 > mode +8 > ; +9 > +10> } +1->Emitted(82, 21) Source(88, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +2 >Emitted(82, 44) Source(88, 17) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +3 >Emitted(82, 47) Source(88, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +4 >Emitted(82, 61) Source(88, 29) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) +5 >Emitted(82, 67) Source(88, 35) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) +6 >Emitted(82, 68) Source(88, 36) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) +7 >Emitted(82, 72) Source(88, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) +8 >Emitted(82, 73) Source(88, 41) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) +9 >Emitted(82, 74) Source(88, 42) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) +10>Emitted(82, 75) Source(88, 43) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) --- >>> return State; -1->^^^^^^^^^^^^^^^^^^^^ +1 >^^^^^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^ -1-> +1 > > 2 > } -1->Emitted(91, 21) Source(89, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) -2 >Emitted(91, 33) Source(89, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +1 >Emitted(83, 21) Source(89, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +2 >Emitted(83, 33) Source(89, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) --- >>> })(); 1 >^^^^^^^^^^^^^^^^ @@ -1686,10 +1666,10 @@ sourceFile:recursiveClassReferenceTest.ts > > public getMode(): IMode { return mode; } > } -1 >Emitted(92, 17) Source(89, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) -2 >Emitted(92, 18) Source(89, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) -3 >Emitted(92, 18) Source(78, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) -4 >Emitted(92, 22) Source(89, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +1 >Emitted(84, 17) Source(89, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +2 >Emitted(84, 18) Source(89, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +3 >Emitted(84, 18) Source(78, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +4 >Emitted(84, 22) Source(89, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) --- >>> PlainText.State = State; 1->^^^^^^^^^^^^^^^^ @@ -1712,10 +1692,10 @@ sourceFile:recursiveClassReferenceTest.ts > public getMode(): IMode { return mode; } > } 4 > -1->Emitted(93, 17) Source(78, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) -2 >Emitted(93, 32) Source(78, 20) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) -3 >Emitted(93, 40) Source(89, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) -4 >Emitted(93, 41) Source(89, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +1->Emitted(85, 17) Source(78, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +2 >Emitted(85, 32) Source(78, 20) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +3 >Emitted(85, 40) Source(89, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +4 >Emitted(85, 41) Source(89, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) --- >>> var Mode = (function (_super) { 1->^^^^^^^^^^^^^^^^ @@ -1723,29 +1703,29 @@ sourceFile:recursiveClassReferenceTest.ts 1-> > > -1->Emitted(94, 17) Source(91, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +1->Emitted(86, 17) Source(91, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) --- >>> __extends(Mode, _super); 1->^^^^^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^ 1->export class Mode extends 2 > AbstractMode -1->Emitted(95, 21) Source(91, 28) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) -2 >Emitted(95, 45) Source(91, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +1->Emitted(87, 21) Source(91, 28) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +2 >Emitted(87, 45) Source(91, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) --- >>> function Mode() { 1 >^^^^^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > -1 >Emitted(96, 21) Source(91, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +1 >Emitted(88, 21) Source(91, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) --- >>> _super.apply(this, arguments); 1->^^^^^^^^^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1->export class Mode extends 2 > AbstractMode -1->Emitted(97, 25) Source(91, 28) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.constructor) -2 >Emitted(97, 55) Source(91, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.constructor) +1->Emitted(89, 25) Source(91, 28) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.constructor) +2 >Emitted(89, 55) Source(91, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.constructor) --- >>> } 1 >^^^^^^^^^^^^^^^^^^^^ @@ -1761,8 +1741,8 @@ sourceFile:recursiveClassReferenceTest.ts > > 2 > } -1 >Emitted(98, 21) Source(99, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.constructor) -2 >Emitted(98, 22) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.constructor) +1 >Emitted(90, 21) Source(99, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.constructor) +2 >Emitted(90, 22) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.constructor) --- >>> // scenario 2 1->^^^^^^^^^^^^^^^^^^^^ @@ -1770,8 +1750,8 @@ sourceFile:recursiveClassReferenceTest.ts 3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> 2 > // scenario 2 -1->Emitted(99, 21) Source(93, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) -2 >Emitted(99, 34) Source(93, 16) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +1->Emitted(91, 21) Source(93, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +2 >Emitted(91, 34) Source(93, 16) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) --- >>> Mode.prototype.getInitialState = function () { 1->^^^^^^^^^^^^^^^^^^^^ @@ -1781,9 +1761,9 @@ sourceFile:recursiveClassReferenceTest.ts > public 2 > getInitialState 3 > -1->Emitted(100, 21) Source(94, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) -2 >Emitted(100, 51) Source(94, 25) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) -3 >Emitted(100, 54) Source(94, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +1->Emitted(92, 21) Source(94, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +2 >Emitted(92, 51) Source(94, 25) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +3 >Emitted(92, 54) Source(94, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) --- >>> return new State(self); 1 >^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1805,15 +1785,15 @@ sourceFile:recursiveClassReferenceTest.ts 7 > self 8 > ) 9 > ; -1 >Emitted(101, 25) Source(95, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) -2 >Emitted(101, 31) Source(95, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) -3 >Emitted(101, 32) Source(95, 11) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) -4 >Emitted(101, 36) Source(95, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) -5 >Emitted(101, 41) Source(95, 20) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) -6 >Emitted(101, 42) Source(95, 21) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) -7 >Emitted(101, 46) Source(95, 25) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) -8 >Emitted(101, 47) Source(95, 26) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) -9 >Emitted(101, 48) Source(95, 27) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +1 >Emitted(93, 25) Source(95, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +2 >Emitted(93, 31) Source(95, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +3 >Emitted(93, 32) Source(95, 11) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +4 >Emitted(93, 36) Source(95, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +5 >Emitted(93, 41) Source(95, 20) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +6 >Emitted(93, 42) Source(95, 21) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +7 >Emitted(93, 46) Source(95, 25) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +8 >Emitted(93, 47) Source(95, 26) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +9 >Emitted(93, 48) Source(95, 27) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) --- >>> }; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -1822,8 +1802,8 @@ sourceFile:recursiveClassReferenceTest.ts 1 > > 2 > } -1 >Emitted(102, 21) Source(96, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) -2 >Emitted(102, 22) Source(96, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +1 >Emitted(94, 21) Source(96, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +2 >Emitted(94, 22) Source(96, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) --- >>> return Mode; 1->^^^^^^^^^^^^^^^^^^^^ @@ -1834,8 +1814,8 @@ sourceFile:recursiveClassReferenceTest.ts > > 2 > } -1->Emitted(103, 21) Source(99, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) -2 >Emitted(103, 32) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +1->Emitted(95, 21) Source(99, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +2 >Emitted(95, 32) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) --- >>> })(AbstractMode); 1->^^^^^^^^^^^^^^^^ @@ -1859,12 +1839,12 @@ sourceFile:recursiveClassReferenceTest.ts > > > } -1->Emitted(104, 17) Source(99, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) -2 >Emitted(104, 18) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) -3 >Emitted(104, 18) Source(91, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) -4 >Emitted(104, 20) Source(91, 28) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) -5 >Emitted(104, 32) Source(91, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) -6 >Emitted(104, 34) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +1->Emitted(96, 17) Source(99, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +2 >Emitted(96, 18) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +3 >Emitted(96, 18) Source(91, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +4 >Emitted(96, 20) Source(91, 28) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +5 >Emitted(96, 32) Source(91, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +6 >Emitted(96, 34) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) --- >>> PlainText.Mode = Mode; 1->^^^^^^^^^^^^^^^^ @@ -1884,10 +1864,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } 4 > -1->Emitted(105, 17) Source(91, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) -2 >Emitted(105, 31) Source(91, 19) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) -3 >Emitted(105, 38) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) -4 >Emitted(105, 39) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +1->Emitted(97, 17) Source(91, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +2 >Emitted(97, 31) Source(91, 19) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +3 >Emitted(97, 38) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +4 >Emitted(97, 39) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) --- >>> })(PlainText = Languages.PlainText || (Languages.PlainText = {})); 1->^^^^^^^^^^^^ @@ -1933,15 +1913,15 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1->Emitted(106, 13) Source(100, 1) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) -2 >Emitted(106, 14) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) -3 >Emitted(106, 16) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) -4 >Emitted(106, 25) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages) -5 >Emitted(106, 28) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) -6 >Emitted(106, 47) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages) -7 >Emitted(106, 52) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) -8 >Emitted(106, 71) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages) -9 >Emitted(106, 79) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages) +1->Emitted(98, 13) Source(100, 1) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +2 >Emitted(98, 14) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +3 >Emitted(98, 16) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) +4 >Emitted(98, 25) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages) +5 >Emitted(98, 28) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) +6 >Emitted(98, 47) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages) +7 >Emitted(98, 52) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) +8 >Emitted(98, 71) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages) +9 >Emitted(98, 79) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages) --- >>> })(Languages = Thing.Languages || (Thing.Languages = {})); 1 >^^^^^^^^ @@ -1986,15 +1966,15 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(107, 9) Source(100, 1) + SourceIndex(0) name (Sample.Thing.Languages) -2 >Emitted(107, 10) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages) -3 >Emitted(107, 12) Source(76, 21) + SourceIndex(0) name (Sample.Thing) -4 >Emitted(107, 21) Source(76, 30) + SourceIndex(0) name (Sample.Thing) -5 >Emitted(107, 24) Source(76, 21) + SourceIndex(0) name (Sample.Thing) -6 >Emitted(107, 39) Source(76, 30) + SourceIndex(0) name (Sample.Thing) -7 >Emitted(107, 44) Source(76, 21) + SourceIndex(0) name (Sample.Thing) -8 >Emitted(107, 59) Source(76, 30) + SourceIndex(0) name (Sample.Thing) -9 >Emitted(107, 67) Source(100, 2) + SourceIndex(0) name (Sample.Thing) +1 >Emitted(99, 9) Source(100, 1) + SourceIndex(0) name (Sample.Thing.Languages) +2 >Emitted(99, 10) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages) +3 >Emitted(99, 12) Source(76, 21) + SourceIndex(0) name (Sample.Thing) +4 >Emitted(99, 21) Source(76, 30) + SourceIndex(0) name (Sample.Thing) +5 >Emitted(99, 24) Source(76, 21) + SourceIndex(0) name (Sample.Thing) +6 >Emitted(99, 39) Source(76, 30) + SourceIndex(0) name (Sample.Thing) +7 >Emitted(99, 44) Source(76, 21) + SourceIndex(0) name (Sample.Thing) +8 >Emitted(99, 59) Source(76, 30) + SourceIndex(0) name (Sample.Thing) +9 >Emitted(99, 67) Source(100, 2) + SourceIndex(0) name (Sample.Thing) --- >>> })(Thing = Sample.Thing || (Sample.Thing = {})); 1 >^^^^ @@ -2039,15 +2019,15 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(108, 5) Source(100, 1) + SourceIndex(0) name (Sample.Thing) -2 >Emitted(108, 6) Source(100, 2) + SourceIndex(0) name (Sample.Thing) -3 >Emitted(108, 8) Source(76, 15) + SourceIndex(0) name (Sample) -4 >Emitted(108, 13) Source(76, 20) + SourceIndex(0) name (Sample) -5 >Emitted(108, 16) Source(76, 15) + SourceIndex(0) name (Sample) -6 >Emitted(108, 28) Source(76, 20) + SourceIndex(0) name (Sample) -7 >Emitted(108, 33) Source(76, 15) + SourceIndex(0) name (Sample) -8 >Emitted(108, 45) Source(76, 20) + SourceIndex(0) name (Sample) -9 >Emitted(108, 53) Source(100, 2) + SourceIndex(0) name (Sample) +1 >Emitted(100, 5) Source(100, 1) + SourceIndex(0) name (Sample.Thing) +2 >Emitted(100, 6) Source(100, 2) + SourceIndex(0) name (Sample.Thing) +3 >Emitted(100, 8) Source(76, 15) + SourceIndex(0) name (Sample) +4 >Emitted(100, 13) Source(76, 20) + SourceIndex(0) name (Sample) +5 >Emitted(100, 16) Source(76, 15) + SourceIndex(0) name (Sample) +6 >Emitted(100, 28) Source(76, 20) + SourceIndex(0) name (Sample) +7 >Emitted(100, 33) Source(76, 15) + SourceIndex(0) name (Sample) +8 >Emitted(100, 45) Source(76, 20) + SourceIndex(0) name (Sample) +9 >Emitted(100, 53) Source(100, 2) + SourceIndex(0) name (Sample) --- >>>})(Sample || (Sample = {})); 1 > @@ -2089,12 +2069,12 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(109, 1) Source(100, 1) + SourceIndex(0) name (Sample) -2 >Emitted(109, 2) Source(100, 2) + SourceIndex(0) name (Sample) -3 >Emitted(109, 4) Source(76, 8) + SourceIndex(0) -4 >Emitted(109, 10) Source(76, 14) + SourceIndex(0) -5 >Emitted(109, 15) Source(76, 8) + SourceIndex(0) -6 >Emitted(109, 21) Source(76, 14) + SourceIndex(0) -7 >Emitted(109, 29) Source(100, 2) + SourceIndex(0) +1 >Emitted(101, 1) Source(100, 1) + SourceIndex(0) name (Sample) +2 >Emitted(101, 2) Source(100, 2) + SourceIndex(0) name (Sample) +3 >Emitted(101, 4) Source(76, 8) + SourceIndex(0) +4 >Emitted(101, 10) Source(76, 14) + SourceIndex(0) +5 >Emitted(101, 15) Source(76, 8) + SourceIndex(0) +6 >Emitted(101, 21) Source(76, 14) + SourceIndex(0) +7 >Emitted(101, 29) Source(100, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=recursiveClassReferenceTest.js.map \ No newline at end of file diff --git a/tests/baselines/reference/recursiveFunctionTypes.js b/tests/baselines/reference/recursiveFunctionTypes.js index 6f10ef99080..040c323066d 100644 --- a/tests/baselines/reference/recursiveFunctionTypes.js +++ b/tests/baselines/reference/recursiveFunctionTypes.js @@ -45,39 +45,27 @@ f7(""); // ok (function takes an any param) f7(); // ok //// [recursiveFunctionTypes.js] -function fn() { - return 1; -} +function fn() { return 1; } var x = fn; // error var y = fn; // ok var f; var g; -function f1(d) { -} -function f2() { -} -function g2() { -} -function f3() { - return f3; -} +function f1(d) { } +function f2() { } +function g2() { } +function f3() { return f3; } var a = f3; // error var C = (function () { function C() { } - C.g = function (t) { - }; + C.g = function (t) { }; return C; })(); C.g(3); // error var f4; f4 = 3; // error -function f5() { - return f5; -} -function f6(a) { - return f6; -} +function f5() { return f5; } +function f6(a) { return f6; } f6("", 3); // error (arity mismatch) f6(""); // ok (function takes an any param) f6(); // ok diff --git a/tests/baselines/reference/recursiveFunctionTypes1.js b/tests/baselines/reference/recursiveFunctionTypes1.js index 2f2d072cb6b..c4c255d5e44 100644 --- a/tests/baselines/reference/recursiveFunctionTypes1.js +++ b/tests/baselines/reference/recursiveFunctionTypes1.js @@ -7,7 +7,6 @@ class C { var C = (function () { function C() { } - C.g = function (t) { - }; + C.g = function (t) { }; return C; })(); diff --git a/tests/baselines/reference/recursiveGetterAccess.js b/tests/baselines/reference/recursiveGetterAccess.js index cf042c2c1a0..1dea2e02d3a 100644 --- a/tests/baselines/reference/recursiveGetterAccess.js +++ b/tests/baselines/reference/recursiveGetterAccess.js @@ -10,9 +10,7 @@ var MyClass = (function () { function MyClass() { } Object.defineProperty(MyClass.prototype, "testProp", { - get: function () { - return this.testProp; - }, + get: function () { return this.testProp; }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/recursiveIdenticalOverloadResolution.js b/tests/baselines/reference/recursiveIdenticalOverloadResolution.js index e1ea203ac5b..3c53c2b2a0a 100644 --- a/tests/baselines/reference/recursiveIdenticalOverloadResolution.js +++ b/tests/baselines/reference/recursiveIdenticalOverloadResolution.js @@ -20,9 +20,7 @@ module M { //// [recursiveIdenticalOverloadResolution.js] var M; (function (M) { - function f(p) { - return f; - } + function f(p) { return f; } ; var i; f(i); diff --git a/tests/baselines/reference/recursiveInference1.js b/tests/baselines/reference/recursiveInference1.js index 839e13130f2..3a26ead542d 100644 --- a/tests/baselines/reference/recursiveInference1.js +++ b/tests/baselines/reference/recursiveInference1.js @@ -3,7 +3,5 @@ function fib(x:number) { return x <= 1 ? x : fib(x - 1) + fib(x - 2); } var result = fib(5); //// [recursiveInference1.js] -function fib(x) { - return x <= 1 ? x : fib(x - 1) + fib(x - 2); -} +function fib(x) { return x <= 1 ? x : fib(x - 1) + fib(x - 2); } var result = fib(5); diff --git a/tests/baselines/reference/recursiveInferenceBug.js b/tests/baselines/reference/recursiveInferenceBug.js index cffa96415dc..5b4d4f0c0a1 100644 --- a/tests/baselines/reference/recursiveInferenceBug.js +++ b/tests/baselines/reference/recursiveInferenceBug.js @@ -17,9 +17,6 @@ function f(x) { return x; } var zz = { - g: function () { - }, - get f() { - return "abc"; - } + g: function () { }, + get f() { return "abc"; } }; diff --git a/tests/baselines/reference/recursiveInheritance3.js b/tests/baselines/reference/recursiveInheritance3.js index 710b691fa94..bc9fb6cb4f9 100644 --- a/tests/baselines/reference/recursiveInheritance3.js +++ b/tests/baselines/reference/recursiveInheritance3.js @@ -13,8 +13,6 @@ var C = (function () { function C() { this.x = 1; } - C.prototype.foo = function (x) { - return x; - }; + C.prototype.foo = function (x) { return x; }; return C; })(); diff --git a/tests/baselines/reference/recursiveInitializer.js b/tests/baselines/reference/recursiveInitializer.js index 2b33e873cb1..82abf2b50af 100644 --- a/tests/baselines/reference/recursiveInitializer.js +++ b/tests/baselines/reference/recursiveInitializer.js @@ -35,6 +35,4 @@ var b2 = !!b2; var b3 = !b3 || b3; // expected boolean here. actually 'any' var b4 = (!b4) && b4; // expected boolean here. actually 'any' // (x:string) => any -var f = function (x) { - return f(x); -}; +var f = function (x) { return f(x); }; diff --git a/tests/baselines/reference/recursiveLetConst.js b/tests/baselines/reference/recursiveLetConst.js index 7d9aea3a754..9c6151cde34 100644 --- a/tests/baselines/reference/recursiveLetConst.js +++ b/tests/baselines/reference/recursiveLetConst.js @@ -20,23 +20,12 @@ let x = x + 1; let [x1] = x1 + 1; const y = y + 2; const [y1] = y1 + 1; -for (let v = v;;) { -} -for (let [v] = v;;) { -} -for (let v in v) { -} -for (let v of v) { -} -for (let [v] of v) { -} +for (let v = v;;) { } +for (let [v] = v;;) { } +for (let v in v) { } +for (let v of v) { } +for (let [v] of v) { } let [x2 = x2] = []; let z0 = () => z0; -let z1 = function () { - return z1; -}; -let z2 = { - f() { - return z2; - } -}; +let z1 = function () { return z1; }; +let z2 = { f() { return z2; } }; diff --git a/tests/baselines/reference/recursiveObjectLiteral.js b/tests/baselines/reference/recursiveObjectLiteral.js index 80c512a8280..70de48d2499 100644 --- a/tests/baselines/reference/recursiveObjectLiteral.js +++ b/tests/baselines/reference/recursiveObjectLiteral.js @@ -2,6 +2,4 @@ var a = { f: a }; //// [recursiveObjectLiteral.js] -var a = { - f: a -}; +var a = { f: a }; diff --git a/tests/baselines/reference/recursiveProperties.js b/tests/baselines/reference/recursiveProperties.js index 63644484956..84d9ebcd27c 100644 --- a/tests/baselines/reference/recursiveProperties.js +++ b/tests/baselines/reference/recursiveProperties.js @@ -12,9 +12,7 @@ var A = (function () { function A() { } Object.defineProperty(A.prototype, "testProp", { - get: function () { - return this.testProp; - }, + get: function () { return this.testProp; }, enumerable: true, configurable: true }); @@ -24,9 +22,7 @@ var B = (function () { function B() { } Object.defineProperty(B.prototype, "testProp", { - set: function (value) { - this.testProp = value; - }, + set: function (value) { this.testProp = value; }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/recursiveReturns.js b/tests/baselines/reference/recursiveReturns.js index d01825f8cbf..18c9ed4dd7c 100644 --- a/tests/baselines/reference/recursiveReturns.js +++ b/tests/baselines/reference/recursiveReturns.js @@ -20,9 +20,7 @@ function R1() { R1(); return; } -function R2() { - R2(); -} +function R2() { R2(); } function R3(n) { if (n == 0) { } diff --git a/tests/baselines/reference/recursiveTypesUsedAsFunctionParameters.js b/tests/baselines/reference/recursiveTypesUsedAsFunctionParameters.js index b056e90e909..0cef9be47ab 100644 --- a/tests/baselines/reference/recursiveTypesUsedAsFunctionParameters.js +++ b/tests/baselines/reference/recursiveTypesUsedAsFunctionParameters.js @@ -59,13 +59,9 @@ function foo(x) { function foo2(x) { } function other() { - function foo3(x) { - } - function foo4(x) { - } - function foo5(x) { - return null; - } + function foo3(x) { } + function foo4(x) { } + function foo5(x) { return null; } var list; var myList; var r = foo5(list); diff --git a/tests/baselines/reference/redefineArray.js b/tests/baselines/reference/redefineArray.js index 93494232436..080d2b1a2d2 100644 --- a/tests/baselines/reference/redefineArray.js +++ b/tests/baselines/reference/redefineArray.js @@ -2,6 +2,4 @@ Array = function (n:number, s:string) {return n;}; //// [redefineArray.js] -Array = function (n, s) { - return n; -}; +Array = function (n, s) { return n; }; diff --git a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js index 608090e8722..24f0e7f1bcb 100644 --- a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js +++ b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js @@ -1036,41 +1036,31 @@ var rionegrensis; caniventer.prototype.salomonseni = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; caniventer.prototype.uchidai = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; caniventer.prototype.raffrayana = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; caniventer.prototype.Uranium = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; caniventer.prototype.nayaur = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return caniventer; @@ -1084,41 +1074,31 @@ var rionegrensis; veraecrucis.prototype.naso = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; veraecrucis.prototype.vancouverensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; veraecrucis.prototype.africana = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; veraecrucis.prototype.palliolata = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; veraecrucis.prototype.nivicola = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return veraecrucis; @@ -1139,41 +1119,31 @@ var julianae; nudicaudus.prototype.brandtii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; nudicaudus.prototype.maxwellii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; nudicaudus.prototype.endoi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; nudicaudus.prototype.venezuelae = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; nudicaudus.prototype.zamicrus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return nudicaudus; @@ -1185,57 +1155,43 @@ var julianae; galapagoensis.prototype.isabellae = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; galapagoensis.prototype.rueppellii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; galapagoensis.prototype.peregusna = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; galapagoensis.prototype.gliroides = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; galapagoensis.prototype.banakrisi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; galapagoensis.prototype.rozendaali = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; galapagoensis.prototype.stuhlmanni = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return galapagoensis; @@ -1247,57 +1203,43 @@ var julianae; albidens.prototype.mattheyi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; albidens.prototype.Astatine = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; albidens.prototype.vincenti = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; albidens.prototype.hirta = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; albidens.prototype.virginianus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; albidens.prototype.macrophyllum = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; albidens.prototype.porcellus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return albidens; @@ -1311,105 +1253,79 @@ var julianae; oralis.prototype.cepapi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oralis.prototype.porteri = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oralis.prototype.bindi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oralis.prototype.puda = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oralis.prototype.mindorensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oralis.prototype.ignitus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oralis.prototype.rufus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oralis.prototype.monax = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oralis.prototype.unalascensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oralis.prototype.wuchihensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oralis.prototype.leucippe = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oralis.prototype.ordii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oralis.prototype.eisentrauti = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return oralis; @@ -1423,57 +1339,43 @@ var julianae; sumatrana.prototype.wolffsohni = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; sumatrana.prototype.geata = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; sumatrana.prototype.awashensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; sumatrana.prototype.sturdeei = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; sumatrana.prototype.pachyurus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; sumatrana.prototype.lyelli = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; sumatrana.prototype.neohibernicus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return sumatrana; @@ -1485,89 +1387,67 @@ var julianae; gerbillus.prototype.pundti = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gerbillus.prototype.tristrami = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gerbillus.prototype.swarthi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gerbillus.prototype.horsfieldii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gerbillus.prototype.diazi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gerbillus.prototype.rennelli = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gerbillus.prototype.maulinus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gerbillus.prototype.muscina = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gerbillus.prototype.pelengensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gerbillus.prototype.abramus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gerbillus.prototype.reevesi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return gerbillus; @@ -1579,97 +1459,73 @@ var julianae; acariensis.prototype.levicula = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; acariensis.prototype.minous = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; acariensis.prototype.cinereiventer = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; acariensis.prototype.longicaudatus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; acariensis.prototype.baeodon = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; acariensis.prototype.soricoides = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; acariensis.prototype.datae = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; acariensis.prototype.spixii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; acariensis.prototype.anakuma = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; acariensis.prototype.kihaulei = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; acariensis.prototype.gymnura = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; acariensis.prototype.olchonensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return acariensis; @@ -1683,25 +1539,19 @@ var julianae; durangae.prototype.Californium = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; durangae.prototype.Flerovium = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; durangae.prototype.phrudus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return durangae; @@ -1716,17 +1566,13 @@ var ruatanica; hector.prototype.humulis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; hector.prototype.eurycerus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return hector; @@ -1741,25 +1587,19 @@ var Lanthanum; suillus.prototype.spilosoma = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; suillus.prototype.tumbalensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; suillus.prototype.anatolicus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return suillus; @@ -1773,81 +1613,61 @@ var Lanthanum; nitidus.prototype.granatensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; nitidus.prototype.negligens = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; nitidus.prototype.lewisi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; nitidus.prototype.arge = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; nitidus.prototype.dominicensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; nitidus.prototype.taurus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; nitidus.prototype.tonganus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; nitidus.prototype.silvatica = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; nitidus.prototype.midas = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; nitidus.prototype.bicornis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return nitidus; @@ -1861,65 +1681,49 @@ var Lanthanum; megalonyx.prototype.phillipsii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; megalonyx.prototype.melanogaster = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; megalonyx.prototype.elaphus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; megalonyx.prototype.elater = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; megalonyx.prototype.ourebi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; megalonyx.prototype.caraccioli = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; megalonyx.prototype.parva = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; megalonyx.prototype.albipes = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return megalonyx; @@ -1931,113 +1735,85 @@ var Lanthanum; jugularis.prototype.torrei = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; jugularis.prototype.revoili = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; jugularis.prototype.macrobullatus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; jugularis.prototype.compactus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; jugularis.prototype.talpinus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; jugularis.prototype.stramineus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; jugularis.prototype.dartmouthi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; jugularis.prototype.ogilbyi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; jugularis.prototype.incomtus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; jugularis.prototype.surdaster = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; jugularis.prototype.melanorhinus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; jugularis.prototype.picticaudata = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; jugularis.prototype.pomona = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; jugularis.prototype.ileile = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return jugularis; @@ -2054,113 +1830,85 @@ var rendalli; zuluensis.prototype.telfairi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; zuluensis.prototype.keyensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; zuluensis.prototype.occasius = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; zuluensis.prototype.damarensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; zuluensis.prototype.Neptunium = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; zuluensis.prototype.griseoflavus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; zuluensis.prototype.thar = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; zuluensis.prototype.alborufus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; zuluensis.prototype.fusicaudus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; zuluensis.prototype.gordonorum = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; zuluensis.prototype.ruber = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; zuluensis.prototype.desmarestianus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; zuluensis.prototype.lutillus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; zuluensis.prototype.salocco = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return zuluensis; @@ -2172,81 +1920,61 @@ var rendalli; moojeni.prototype.floweri = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; moojeni.prototype.montosa = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; moojeni.prototype.miletus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; moojeni.prototype.heaneyi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; moojeni.prototype.marchei = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; moojeni.prototype.budini = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; moojeni.prototype.maggietaylorae = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; moojeni.prototype.poliocephalus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; moojeni.prototype.zibethicus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; moojeni.prototype.biacensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return moojeni; @@ -2260,25 +1988,19 @@ var rendalli; crenulata.prototype.salvanius = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; crenulata.prototype.maritimus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; crenulata.prototype.edax = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return crenulata; @@ -2293,65 +2015,49 @@ var trivirgatus; tumidifrons.prototype.nivalis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; tumidifrons.prototype.vestitus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; tumidifrons.prototype.aequatorius = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; tumidifrons.prototype.scherman = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; tumidifrons.prototype.improvisum = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; tumidifrons.prototype.cervinipes = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; tumidifrons.prototype.audax = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; tumidifrons.prototype.vallinus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return tumidifrons; @@ -2365,57 +2071,43 @@ var trivirgatus; mixtus.prototype.ochrogaster = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; mixtus.prototype.bryophilus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; mixtus.prototype.liechtensteini = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; mixtus.prototype.crawfordi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; mixtus.prototype.hypsibia = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; mixtus.prototype.matacus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; mixtus.prototype.demidoff = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return mixtus; @@ -2427,17 +2119,13 @@ var trivirgatus; lotor.prototype.balensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; lotor.prototype.pullata = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return lotor; @@ -2449,57 +2137,43 @@ var trivirgatus; falconeri.prototype.cabrali = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; falconeri.prototype.gouldi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; falconeri.prototype.fuscicollis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; falconeri.prototype.martiensseni = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; falconeri.prototype.gaoligongensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; falconeri.prototype.shawi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; falconeri.prototype.gmelini = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return falconeri; @@ -2511,113 +2185,85 @@ var trivirgatus; oconnelli.prototype.youngsoni = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oconnelli.prototype.terrestris = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oconnelli.prototype.chrysopus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oconnelli.prototype.fuscomurina = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oconnelli.prototype.hellwaldii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oconnelli.prototype.aenea = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oconnelli.prototype.perrini = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oconnelli.prototype.entellus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oconnelli.prototype.krebsii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oconnelli.prototype.cephalotes = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oconnelli.prototype.molossinus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oconnelli.prototype.luisi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oconnelli.prototype.ceylonicus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oconnelli.prototype.ralli = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return oconnelli; @@ -2632,33 +2278,25 @@ var quasiater; bobrinskoi.prototype.crassicaudatus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; bobrinskoi.prototype.mulatta = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; bobrinskoi.prototype.ansorgei = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; bobrinskoi.prototype.Copper = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return bobrinskoi; @@ -2675,33 +2313,25 @@ var ruatanica; americanus.prototype.nasoloi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; americanus.prototype.mystacalis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; americanus.prototype.fardoulisi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; americanus.prototype.tumidus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return americanus; @@ -2718,105 +2348,79 @@ var lavali; wilsoni.prototype.setiger = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; wilsoni.prototype.lorentzii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; wilsoni.prototype.antisensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; wilsoni.prototype.blossevillii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; wilsoni.prototype.bontanus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; wilsoni.prototype.caligata = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; wilsoni.prototype.franqueti = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; wilsoni.prototype.roberti = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; wilsoni.prototype.degelidus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; wilsoni.prototype.amoenus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; wilsoni.prototype.kob = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; wilsoni.prototype.csorbai = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; wilsoni.prototype.dorsata = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return wilsoni; @@ -2836,105 +2440,79 @@ var lavali; otion.prototype.bonaerensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; otion.prototype.dussumieri = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; otion.prototype.osvaldoreigi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; otion.prototype.grevyi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; otion.prototype.hirtula = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; otion.prototype.cristatus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; otion.prototype.darlingtoni = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; otion.prototype.fontanierii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; otion.prototype.umbrosus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; otion.prototype.chiriquinus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; otion.prototype.orarius = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; otion.prototype.ilaeus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; otion.prototype.musschenbroekii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return otion; @@ -2946,97 +2524,73 @@ var lavali; xanthognathus.prototype.nanulus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; xanthognathus.prototype.albigena = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; xanthognathus.prototype.onca = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; xanthognathus.prototype.gunnii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; xanthognathus.prototype.apeco = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; xanthognathus.prototype.variegates = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; xanthognathus.prototype.goudotii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; xanthognathus.prototype.pohlei = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; xanthognathus.prototype.ineptus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; xanthognathus.prototype.euryotis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; xanthognathus.prototype.maurisca = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; xanthognathus.prototype.coyhaiquensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return xanthognathus; @@ -3050,65 +2604,49 @@ var lavali; thaeleri.prototype.coromandra = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; thaeleri.prototype.parvipes = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; thaeleri.prototype.sponsorius = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; thaeleri.prototype.vates = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; thaeleri.prototype.roosmalenorum = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; thaeleri.prototype.rubicola = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; thaeleri.prototype.ikonnikovi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; thaeleri.prototype.paramicrus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return thaeleri; @@ -3122,17 +2660,13 @@ var lavali; lepturus.prototype.ferrumequinum = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; lepturus.prototype.aequalis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return lepturus; @@ -3149,73 +2683,55 @@ var dogramacii; robustulus.prototype.fossor = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; robustulus.prototype.humboldti = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; robustulus.prototype.mexicana = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; robustulus.prototype.martini = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; robustulus.prototype.beatus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; robustulus.prototype.leporina = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; robustulus.prototype.pearsonii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; robustulus.prototype.keaysi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; robustulus.prototype.hindei = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return robustulus; @@ -3227,9 +2743,7 @@ var dogramacii; koepckeae.prototype.culturatus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return koepckeae; @@ -3241,105 +2755,79 @@ var dogramacii; kaiseri.prototype.bedfordiae = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; kaiseri.prototype.paramorum = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; kaiseri.prototype.rubidus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; kaiseri.prototype.juninensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; kaiseri.prototype.marginata = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; kaiseri.prototype.Meitnerium = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; kaiseri.prototype.pinetorum = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; kaiseri.prototype.hoolock = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; kaiseri.prototype.poeyi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; kaiseri.prototype.Thulium = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; kaiseri.prototype.patrius = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; kaiseri.prototype.quadraticauda = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; kaiseri.prototype.ater = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return kaiseri; @@ -3351,65 +2839,49 @@ var dogramacii; aurata.prototype.grunniens = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; aurata.prototype.howensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; aurata.prototype.karlkoopmani = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; aurata.prototype.mirapitanga = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; aurata.prototype.ophiodon = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; aurata.prototype.landeri = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; aurata.prototype.sonomae = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; aurata.prototype.erythromos = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return aurata; @@ -3426,113 +2898,85 @@ var lutreolus; schlegeli.prototype.mittendorfi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; schlegeli.prototype.blicki = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; schlegeli.prototype.culionensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; schlegeli.prototype.scrofa = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; schlegeli.prototype.fernandoni = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; schlegeli.prototype.Tin = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; schlegeli.prototype.marmorata = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; schlegeli.prototype.tavaratra = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; schlegeli.prototype.peregrina = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; schlegeli.prototype.frontalis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; schlegeli.prototype.cuniculus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; schlegeli.prototype.magdalenae = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; schlegeli.prototype.andamanensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; schlegeli.prototype.dispar = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return schlegeli; @@ -3547,89 +2991,67 @@ var argurus; dauricus.prototype.chinensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; dauricus.prototype.duodecimcostatus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; dauricus.prototype.foxi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; dauricus.prototype.macleayii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; dauricus.prototype.darienensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; dauricus.prototype.hardwickii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; dauricus.prototype.albifrons = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; dauricus.prototype.jacobitus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; dauricus.prototype.guentheri = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; dauricus.prototype.mahomet = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; dauricus.prototype.misionensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return dauricus; @@ -3644,65 +3066,49 @@ var nigra; dolichurus.prototype.solomonis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; dolichurus.prototype.alfredi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; dolichurus.prototype.morrisi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; dolichurus.prototype.lekaguli = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; dolichurus.prototype.dimissus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; dolichurus.prototype.phaeotis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; dolichurus.prototype.ustus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; dolichurus.prototype.sagei = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return dolichurus; @@ -3719,49 +3125,37 @@ var panglima; amphibius.prototype.bottegi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; amphibius.prototype.jerdoni = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; amphibius.prototype.camtschatica = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; amphibius.prototype.spadix = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; amphibius.prototype.luismanueli = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; amphibius.prototype.aceramarcae = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return amphibius; @@ -3775,25 +3169,19 @@ var panglima; fundatus.prototype.crassulus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; fundatus.prototype.flamarioni = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; fundatus.prototype.mirabilis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return fundatus; @@ -3807,41 +3195,31 @@ var panglima; abidi.prototype.greyii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; abidi.prototype.macedonicus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; abidi.prototype.galili = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; abidi.prototype.thierryi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; abidi.prototype.ega = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return abidi; @@ -3856,57 +3234,43 @@ var quasiater; carolinensis.prototype.concinna = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; carolinensis.prototype.aeneus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; carolinensis.prototype.aloysiisabaudiae = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; carolinensis.prototype.tenellus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; carolinensis.prototype.andium = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; carolinensis.prototype.persephone = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; carolinensis.prototype.patrizii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return carolinensis; @@ -3923,97 +3287,73 @@ var minutus; himalayana.prototype.simoni = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; himalayana.prototype.lobata = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; himalayana.prototype.rusticus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; himalayana.prototype.latona = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; himalayana.prototype.famulus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; himalayana.prototype.flaviceps = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; himalayana.prototype.paradoxolophus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; himalayana.prototype.Osmium = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; himalayana.prototype.vulgaris = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; himalayana.prototype.betsileoensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; himalayana.prototype.vespuccii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; himalayana.prototype.olympus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return himalayana; @@ -4030,65 +3370,49 @@ var caurinus; mahaganus.prototype.martiniquensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; mahaganus.prototype.devius = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; mahaganus.prototype.masalai = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; mahaganus.prototype.kathleenae = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; mahaganus.prototype.simulus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; mahaganus.prototype.nigrovittatus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; mahaganus.prototype.senegalensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; mahaganus.prototype.acticola = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return mahaganus; @@ -4103,9 +3427,7 @@ var macrorhinos; marmosurus.prototype.tansaniana = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return marmosurus; @@ -4122,9 +3444,7 @@ var howi; angulatus.prototype.pennatus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return angulatus; @@ -4148,65 +3468,49 @@ var nigra; thalia.prototype.dichotomus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; thalia.prototype.arnuxii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; thalia.prototype.verheyeni = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; thalia.prototype.dauuricus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; thalia.prototype.tristriatus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; thalia.prototype.lasiura = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; thalia.prototype.gangetica = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; thalia.prototype.brucei = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return thalia; @@ -4223,9 +3527,7 @@ var sagitta; walkeri.prototype.maracajuensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return walkeri; @@ -4242,9 +3544,7 @@ var minutus; inez.prototype.vexillaris = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return inez; @@ -4272,73 +3572,55 @@ var panamensis; linulus.prototype.goslingi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; linulus.prototype.taki = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; linulus.prototype.fumosus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; linulus.prototype.rufinus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; linulus.prototype.lami = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; linulus.prototype.regina = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; linulus.prototype.nanilla = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; linulus.prototype.enganus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; linulus.prototype.gomantongensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return linulus; @@ -4353,105 +3635,79 @@ var nigra; gracilis.prototype.weddellii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gracilis.prototype.echinothrix = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gracilis.prototype.garridoi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gracilis.prototype.rouxii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gracilis.prototype.aurita = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gracilis.prototype.geoffrensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gracilis.prototype.theresa = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gracilis.prototype.melanocarpus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gracilis.prototype.dubiaquercus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gracilis.prototype.pectoralis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gracilis.prototype.apoensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gracilis.prototype.grisescens = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gracilis.prototype.ramirohitra = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return gracilis; @@ -4468,105 +3724,79 @@ var samarensis; pelurus.prototype.Palladium = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; pelurus.prototype.castanea = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; pelurus.prototype.chamek = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; pelurus.prototype.nigriceps = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; pelurus.prototype.lunatus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; pelurus.prototype.madurae = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; pelurus.prototype.chinchilla = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; pelurus.prototype.eliasi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; pelurus.prototype.proditor = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; pelurus.prototype.gambianus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; pelurus.prototype.petteri = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; pelurus.prototype.nusatenggara = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; pelurus.prototype.olitor = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return pelurus; @@ -4580,113 +3810,85 @@ var samarensis; fuscus.prototype.planifrons = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; fuscus.prototype.badia = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; fuscus.prototype.prymnolopha = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; fuscus.prototype.natalensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; fuscus.prototype.hunteri = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; fuscus.prototype.sapiens = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; fuscus.prototype.macrocercus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; fuscus.prototype.nimbae = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; fuscus.prototype.suricatta = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; fuscus.prototype.jagorii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; fuscus.prototype.beecrofti = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; fuscus.prototype.imaizumii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; fuscus.prototype.colocolo = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; fuscus.prototype.wolfi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return fuscus; @@ -4698,33 +3900,25 @@ var samarensis; pallidus.prototype.oblativa = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; pallidus.prototype.watersi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; pallidus.prototype.glacialis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; pallidus.prototype.viaria = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return pallidus; @@ -4736,41 +3930,31 @@ var samarensis; cahirinus.prototype.alashanicus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; cahirinus.prototype.flaviventer = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; cahirinus.prototype.bottai = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; cahirinus.prototype.pinetis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; cahirinus.prototype.saussurei = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return cahirinus; @@ -4787,41 +3971,31 @@ var sagitta; leptoceros.prototype.victus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; leptoceros.prototype.hoplomyoides = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; leptoceros.prototype.gratiosus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; leptoceros.prototype.rex = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; leptoceros.prototype.bolami = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return leptoceros; @@ -4838,9 +4012,7 @@ var daubentonii; nigricans.prototype.woosnami = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return nigricans; @@ -4866,25 +4038,19 @@ var argurus; pygmaea.prototype.pajeros = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; pygmaea.prototype.capucinus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; pygmaea.prototype.cuvieri = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return pygmaea; @@ -4901,57 +4067,43 @@ var chrysaeolus; sarasinorum.prototype.belzebul = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; sarasinorum.prototype.hinpoon = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; sarasinorum.prototype.kandti = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; sarasinorum.prototype.cynosuros = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; sarasinorum.prototype.Germanium = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; sarasinorum.prototype.Ununoctium = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; sarasinorum.prototype.princeps = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return sarasinorum; @@ -4966,57 +4118,43 @@ var argurus; wetmorei.prototype.leucoptera = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; wetmorei.prototype.ochraventer = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; wetmorei.prototype.tephromelas = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; wetmorei.prototype.cracens = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; wetmorei.prototype.jamaicensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; wetmorei.prototype.gymnocaudus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; wetmorei.prototype.mayori = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return wetmorei; @@ -5033,65 +4171,49 @@ var argurus; oreas.prototype.salamonis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oreas.prototype.paniscus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oreas.prototype.fagani = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oreas.prototype.papuanus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oreas.prototype.timidus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oreas.prototype.nghetinhensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oreas.prototype.barbei = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; oreas.prototype.univittatus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return oreas; @@ -5106,97 +4228,73 @@ var daubentonii; arboreus.prototype.capreolus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; arboreus.prototype.moreni = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; arboreus.prototype.hypoleucos = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; arboreus.prototype.paedulcus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; arboreus.prototype.pucheranii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; arboreus.prototype.stella = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; arboreus.prototype.brasiliensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; arboreus.prototype.brevicaudata = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; arboreus.prototype.vitticollis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; arboreus.prototype.huangensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; arboreus.prototype.cameroni = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; arboreus.prototype.tianshanica = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return arboreus; @@ -5211,105 +4309,79 @@ var patas; uralensis.prototype.cartilagonodus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; uralensis.prototype.pyrrhinus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; uralensis.prototype.insulans = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; uralensis.prototype.nigricauda = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; uralensis.prototype.muricauda = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; uralensis.prototype.albicaudus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; uralensis.prototype.fallax = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; uralensis.prototype.attenuata = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; uralensis.prototype.megalura = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; uralensis.prototype.neblina = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; uralensis.prototype.citellus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; uralensis.prototype.tanezumi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; uralensis.prototype.albiventer = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return uralensis; @@ -5326,17 +4398,13 @@ var provocax; melanoleuca.prototype.Neodymium = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; melanoleuca.prototype.baeri = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return melanoleuca; @@ -5351,17 +4419,13 @@ var sagitta; sicarius.prototype.Chlorine = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; sicarius.prototype.simulator = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return sicarius; @@ -5378,113 +4442,85 @@ var howi; marcanoi.prototype.formosae = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; marcanoi.prototype.dudui = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; marcanoi.prototype.leander = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; marcanoi.prototype.martinsi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; marcanoi.prototype.beatrix = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; marcanoi.prototype.griseoventer = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; marcanoi.prototype.zerda = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; marcanoi.prototype.yucatanicus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; marcanoi.prototype.nigrita = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; marcanoi.prototype.jouvenetae = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; marcanoi.prototype.indefessus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; marcanoi.prototype.vuquangensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; marcanoi.prototype.Zirconium = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; marcanoi.prototype.hyaena = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return marcanoi; @@ -5499,97 +4535,73 @@ var argurus; gilbertii.prototype.nasutus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gilbertii.prototype.poecilops = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gilbertii.prototype.sondaicus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gilbertii.prototype.auriventer = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gilbertii.prototype.cherriei = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gilbertii.prototype.lindberghi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gilbertii.prototype.pipistrellus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gilbertii.prototype.paranus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gilbertii.prototype.dubosti = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gilbertii.prototype.opossum = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gilbertii.prototype.oreopolus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; gilbertii.prototype.amurensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return gilbertii; @@ -5613,105 +4625,79 @@ var lutreolus; punicus.prototype.strandi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; punicus.prototype.lar = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; punicus.prototype.erica = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; punicus.prototype.trichura = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; punicus.prototype.lemniscatus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; punicus.prototype.aspalax = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; punicus.prototype.marshalli = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; punicus.prototype.Zinc = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; punicus.prototype.monochromos = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; punicus.prototype.purinus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; punicus.prototype.ischyrus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; punicus.prototype.tenuis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; punicus.prototype.Helium = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return punicus; @@ -5726,49 +4712,37 @@ var macrorhinos; daphaenodon.prototype.bredanensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; daphaenodon.prototype.othus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; daphaenodon.prototype.hammondi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; daphaenodon.prototype.aureocollaris = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; daphaenodon.prototype.flavipes = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; daphaenodon.prototype.callosus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return daphaenodon; @@ -5783,97 +4757,73 @@ var sagitta; cinereus.prototype.zunigae = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; cinereus.prototype.microps = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; cinereus.prototype.guaporensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; cinereus.prototype.tonkeana = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; cinereus.prototype.montensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; cinereus.prototype.sphinx = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; cinereus.prototype.glis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; cinereus.prototype.dorsalis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; cinereus.prototype.fimbriatus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; cinereus.prototype.sara = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; cinereus.prototype.epimelas = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; cinereus.prototype.pittieri = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return cinereus; @@ -5905,81 +4855,61 @@ var gabriellae; amicus.prototype.pirrensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; amicus.prototype.phaeura = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; amicus.prototype.voratus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; amicus.prototype.satarae = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; amicus.prototype.hooperi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; amicus.prototype.perrensi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; amicus.prototype.ridei = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; amicus.prototype.audeberti = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; amicus.prototype.Lutetium = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; amicus.prototype.atrox = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return amicus; @@ -5991,9 +4921,7 @@ var gabriellae; echinatus.prototype.tenuipes = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return echinatus; @@ -6008,49 +4936,37 @@ var imperfecta; lasiurus.prototype.marisae = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; lasiurus.prototype.fulvus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; lasiurus.prototype.paranaensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; lasiurus.prototype.didactylus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; lasiurus.prototype.schreibersii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; lasiurus.prototype.orii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return lasiurus; @@ -6062,89 +4978,67 @@ var imperfecta; subspinosus.prototype.monticularis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; subspinosus.prototype.Gadolinium = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; subspinosus.prototype.oasicus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; subspinosus.prototype.paterculus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; subspinosus.prototype.punctata = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; subspinosus.prototype.invictus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; subspinosus.prototype.stangeri = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; subspinosus.prototype.siskiyou = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; subspinosus.prototype.welwitschii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; subspinosus.prototype.Polonium = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; subspinosus.prototype.harpia = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return subspinosus; @@ -6158,25 +5052,19 @@ var imperfecta; ciliolabrum.prototype.leschenaultii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; ciliolabrum.prototype.ludia = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; ciliolabrum.prototype.sinicus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return ciliolabrum; @@ -6191,33 +5079,25 @@ var quasiater; wattsi.prototype.lagotis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; wattsi.prototype.hussoni = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; wattsi.prototype.bilarni = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; wattsi.prototype.cabrerae = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return wattsi; @@ -6234,73 +5114,55 @@ var petrophilus; sodyi.prototype.saundersiae = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; sodyi.prototype.imberbis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; sodyi.prototype.cansdalei = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; sodyi.prototype.Lawrencium = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; sodyi.prototype.catta = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; sodyi.prototype.breviceps = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; sodyi.prototype.transitionalis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; sodyi.prototype.heptneri = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; sodyi.prototype.bairdii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return sodyi; @@ -6317,65 +5179,49 @@ var caurinus; megaphyllus.prototype.montana = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; megaphyllus.prototype.amatus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; megaphyllus.prototype.bucculentus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; megaphyllus.prototype.lepida = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; megaphyllus.prototype.graecus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; megaphyllus.prototype.forsteri = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; megaphyllus.prototype.perotensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; megaphyllus.prototype.cirrhosus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return megaphyllus; @@ -6390,25 +5236,19 @@ var minutus; portoricensis.prototype.relictus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; portoricensis.prototype.aequatorianus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; portoricensis.prototype.rhinogradoides = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return portoricensis; @@ -6423,105 +5263,79 @@ var lutreolus; foina.prototype.tarfayensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; foina.prototype.Promethium = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; foina.prototype.salinae = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; foina.prototype.kerri = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; foina.prototype.scotti = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; foina.prototype.camerunensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; foina.prototype.affinis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; foina.prototype.siebersi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; foina.prototype.maquassiensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; foina.prototype.layardi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; foina.prototype.bishopi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; foina.prototype.apodemoides = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; foina.prototype.argentiventer = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return foina; @@ -6538,81 +5352,61 @@ var lutreolus; cor.prototype.antinorii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; cor.prototype.voi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; cor.prototype.mussoi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; cor.prototype.truncatus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; cor.prototype.achates = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; cor.prototype.praedatrix = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; cor.prototype.mzabi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; cor.prototype.xanthinus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; cor.prototype.tapoatafa = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; cor.prototype.castroviejoi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return cor; @@ -6627,17 +5421,13 @@ var howi; coludo.prototype.bernhardi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; coludo.prototype.isseli = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return coludo; @@ -6654,17 +5444,13 @@ var argurus; germaini.prototype.sharpei = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; germaini.prototype.palmarum = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return germaini; @@ -6679,89 +5465,67 @@ var sagitta; stolzmanni.prototype.riparius = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; stolzmanni.prototype.dhofarensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; stolzmanni.prototype.tricolor = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; stolzmanni.prototype.gardneri = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; stolzmanni.prototype.walleri = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; stolzmanni.prototype.talpoides = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; stolzmanni.prototype.pallipes = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; stolzmanni.prototype.lagurus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; stolzmanni.prototype.hipposideros = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; stolzmanni.prototype.griselda = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; stolzmanni.prototype.florium = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return stolzmanni; @@ -6778,105 +5542,79 @@ var dammermani; melanops.prototype.blarina = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; melanops.prototype.harwoodi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; melanops.prototype.ashaninka = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; melanops.prototype.wiedii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; melanops.prototype.godmani = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; melanops.prototype.condorensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; melanops.prototype.xerophila = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; melanops.prototype.laminatus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; melanops.prototype.archeri = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; melanops.prototype.hidalgo = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; melanops.prototype.unicolor = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; melanops.prototype.philippii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; melanops.prototype.bocagei = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return melanops; @@ -6893,65 +5631,49 @@ var argurus; peninsulae.prototype.aitkeni = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; peninsulae.prototype.novaeangliae = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; peninsulae.prototype.olallae = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; peninsulae.prototype.anselli = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; peninsulae.prototype.timminsi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; peninsulae.prototype.sordidus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; peninsulae.prototype.telfordi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; peninsulae.prototype.cavernarum = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return peninsulae; @@ -6966,105 +5688,79 @@ var argurus; netscheri.prototype.gravis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; netscheri.prototype.ruschii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; netscheri.prototype.tricuspidatus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; netscheri.prototype.fernandezi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; netscheri.prototype.colletti = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; netscheri.prototype.microbullatus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; netscheri.prototype.eburneae = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; netscheri.prototype.tatei = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; netscheri.prototype.millardi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; netscheri.prototype.pruinosus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; netscheri.prototype.delator = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; netscheri.prototype.nyikae = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; netscheri.prototype.ruemmleri = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return netscheri; @@ -7081,105 +5777,79 @@ var ruatanica; Praseodymium.prototype.clara = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; Praseodymium.prototype.spectabilis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; Praseodymium.prototype.kamensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; Praseodymium.prototype.ruddi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; Praseodymium.prototype.bartelsii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; Praseodymium.prototype.yerbabuenae = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; Praseodymium.prototype.davidi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; Praseodymium.prototype.pilirostris = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; Praseodymium.prototype.catherinae = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; Praseodymium.prototype.frontata = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; Praseodymium.prototype.Terbium = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; Praseodymium.prototype.thomensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; Praseodymium.prototype.soricinus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return Praseodymium; @@ -7196,9 +5866,7 @@ var caurinus; johorensis.prototype.maini = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return johorensis; @@ -7213,9 +5881,7 @@ var argurus; luctuosa.prototype.loriae = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return luctuosa; @@ -7230,65 +5896,49 @@ var panamensis; setulosus.prototype.duthieae = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; setulosus.prototype.guereza = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; setulosus.prototype.buselaphus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; setulosus.prototype.nuttalli = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; setulosus.prototype.pelii = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; setulosus.prototype.tunneyi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; setulosus.prototype.lamula = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; setulosus.prototype.vampyrus = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return setulosus; @@ -7303,41 +5953,31 @@ var petrophilus; rosalia.prototype.palmeri = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; rosalia.prototype.baeops = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; rosalia.prototype.ozensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; rosalia.prototype.creaghi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; rosalia.prototype.montivaga = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return rosalia; @@ -7354,49 +5994,37 @@ var caurinus; psilurus.prototype.socialis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; psilurus.prototype.lundi = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; psilurus.prototype.araeum = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; psilurus.prototype.calamianensis = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; psilurus.prototype.petersoni = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; psilurus.prototype.nitela = function () { var _this = this; var x; - (function () { - var y = _this; - }); + (function () { var y = _this; }); return x; }; return psilurus; diff --git a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.types b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.types index 7f0163cf1e3..c4aec3ea8c2 100644 --- a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.types +++ b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.types @@ -4,7 +4,7 @@ module rionegrensis { export class caniventer extends Lanthanum.nitidus { >caniventer : caniventer ->Lanthanum : unknown +>Lanthanum : typeof Lanthanum >nitidus : Lanthanum.nitidus >petrophilus : unknown >minutilla : petrophilus.minutilla @@ -89,7 +89,7 @@ module rionegrensis { >veraecrucis : veraecrucis >T0 : T0 >T1 : T1 ->trivirgatus : unknown +>trivirgatus : typeof trivirgatus >mixtus : trivirgatus.mixtus >gabriellae : unknown >amicus : gabriellae.amicus @@ -514,7 +514,7 @@ module julianae { >oralis : oralis >T0 : T0 >T1 : T1 ->caurinus : unknown +>caurinus : typeof caurinus >psilurus : caurinus.psilurus cepapi() : caurinus.psilurus { var x : caurinus.psilurus; () => { var y = this; }; return x; } @@ -751,7 +751,7 @@ module julianae { } export class sumatrana extends Lanthanum.jugularis { >sumatrana : sumatrana ->Lanthanum : unknown +>Lanthanum : typeof Lanthanum >jugularis : Lanthanum.jugularis wolffsohni() : Lanthanum.suillus { var x : Lanthanum.suillus; () => { var y = this; }; return x; } @@ -1276,7 +1276,7 @@ module julianae { } export class durangae extends dogramacii.aurata { >durangae : durangae ->dogramacii : unknown +>dogramacii : typeof dogramacii >aurata : dogramacii.aurata Californium() : panamensis.setulosus { var x : panamensis.setulosus; () => { var y = this; }; return x; } @@ -1429,7 +1429,7 @@ module Lanthanum { >nitidus : nitidus >T0 : T0 >T1 : T1 ->argurus : unknown +>argurus : typeof argurus >gilbertii : argurus.gilbertii >lavali : unknown >thaeleri : lavali.thaeleri @@ -1598,7 +1598,7 @@ module Lanthanum { } export class megalonyx extends caurinus.johorensis { >megalonyx : megalonyx ->caurinus : unknown +>caurinus : typeof caurinus >johorensis : caurinus.johorensis >caurinus : unknown >megaphyllus : caurinus.megaphyllus @@ -1984,7 +1984,7 @@ module rendalli { export class zuluensis extends julianae.steerii { >zuluensis : zuluensis ->julianae : unknown +>julianae : typeof julianae >steerii : julianae.steerii telfairi() : argurus.wetmorei { var x : argurus.wetmorei; () => { var y = this; }; return x; } @@ -2418,7 +2418,7 @@ module rendalli { >crenulata : crenulata >T0 : T0 >T1 : T1 ->trivirgatus : unknown +>trivirgatus : typeof trivirgatus >falconeri : trivirgatus.falconeri salvanius() : howi.coludo { var x : howi.coludo; () => { var y = this; }; return x; } @@ -2612,7 +2612,7 @@ module trivirgatus { >mixtus : mixtus >T0 : T0 >T1 : T1 ->argurus : unknown +>argurus : typeof argurus >pygmaea : argurus.pygmaea >argurus : unknown >oreas : argurus.oreas @@ -3349,7 +3349,7 @@ module ruatanica { export class americanus extends imperfecta.ciliolabrum { >americanus : americanus ->imperfecta : unknown +>imperfecta : typeof imperfecta >ciliolabrum : imperfecta.ciliolabrum >argurus : unknown >germaini : argurus.germaini @@ -3418,7 +3418,7 @@ module lavali { export class wilsoni extends Lanthanum.nitidus { >wilsoni : wilsoni ->Lanthanum : unknown +>Lanthanum : typeof Lanthanum >nitidus : Lanthanum.nitidus >rionegrensis : unknown >caniventer : rionegrensis.caniventer @@ -3638,7 +3638,7 @@ module lavali { } export class otion extends howi.coludo { >otion : otion ->howi : unknown +>howi : typeof howi >coludo : howi.coludo >argurus : unknown >oreas : argurus.oreas @@ -4112,7 +4112,7 @@ module lavali { } export class thaeleri extends argurus.oreas { >thaeleri : thaeleri ->argurus : unknown +>argurus : typeof argurus >oreas : argurus.oreas coromandra() : julianae.galapagoensis { var x : julianae.galapagoensis; () => { var y = this; }; return x; } @@ -4275,7 +4275,7 @@ module lavali { } export class lepturus extends Lanthanum.suillus { >lepturus : lepturus ->Lanthanum : unknown +>Lanthanum : typeof Lanthanum >suillus : Lanthanum.suillus >dammermani : unknown >melanops : dammermani.melanops @@ -4350,7 +4350,7 @@ module dogramacii { export class robustulus extends lavali.wilsoni { >robustulus : robustulus ->lavali : unknown +>lavali : typeof lavali >wilsoni : lavali.wilsoni fossor() : minutus.inez { var x : minutus.inez; () => { var y = this; }; return x; } @@ -4924,7 +4924,7 @@ module lutreolus { export class schlegeli extends lavali.beisa { >schlegeli : schlegeli ->lavali : unknown +>lavali : typeof lavali >beisa : lavali.beisa mittendorfi() : rionegrensis.caniventer { var x : rionegrensis.caniventer; () => { var y = this; }; return x; } @@ -5661,7 +5661,7 @@ module panglima { >amphibius : amphibius >T0 : T0 >T1 : T1 ->caurinus : unknown +>caurinus : typeof caurinus >johorensis : caurinus.johorensis >Lanthanum : unknown >nitidus : Lanthanum.nitidus @@ -5794,7 +5794,7 @@ module panglima { >fundatus : fundatus >T0 : T0 >T1 : T1 ->lutreolus : unknown +>lutreolus : typeof lutreolus >schlegeli : lutreolus.schlegeli crassulus(): nigra.gracilis { var x: nigra.gracilis; () => { var y = this; }; return x; } @@ -5899,7 +5899,7 @@ module panglima { >abidi : abidi >T0 : T0 >T1 : T1 ->argurus : unknown +>argurus : typeof argurus >dauricus : argurus.dauricus >argurus : unknown >germaini : argurus.germaini @@ -6113,7 +6113,7 @@ module minutus { >himalayana : himalayana >T0 : T0 >T1 : T1 ->lutreolus : unknown +>lutreolus : typeof lutreolus >punicus : lutreolus.punicus simoni(): argurus.netscheri> { var x: argurus.netscheri>; () => { var y = this; }; return x; } @@ -6356,7 +6356,7 @@ module caurinus { >mahaganus : mahaganus >T0 : T0 >T1 : T1 ->panglima : unknown +>panglima : typeof panglima >fundatus : panglima.fundatus >quasiater : unknown >carolinensis : quasiater.carolinensis @@ -6584,7 +6584,7 @@ module howi { >angulatus : angulatus >T0 : T0 >T1 : T1 ->sagitta : unknown +>sagitta : typeof sagitta >stolzmanni : sagitta.stolzmanni pennatus(): howi.marcanoi { var x: howi.marcanoi; () => { var y = this; }; return x; } @@ -6791,7 +6791,7 @@ module sagitta { export class walkeri extends minutus.portoricensis { >walkeri : walkeri ->minutus : unknown +>minutus : typeof minutus >portoricensis : minutus.portoricensis maracajuensis(): samarensis.cahirinus { var x: samarensis.cahirinus; () => { var y = this; }; return x; } @@ -6822,7 +6822,7 @@ module minutus { >inez : inez >T0 : T0 >T1 : T1 ->samarensis : unknown +>samarensis : typeof samarensis >pelurus : samarensis.pelurus >argurus : unknown >germaini : argurus.germaini @@ -6855,7 +6855,7 @@ module macrorhinos { export class konganensis extends imperfecta.lasiurus { >konganensis : konganensis ->imperfecta : unknown +>imperfecta : typeof imperfecta >lasiurus : imperfecta.lasiurus >caurinus : unknown >psilurus : caurinus.psilurus @@ -6870,7 +6870,7 @@ module panamensis { >linulus : linulus >T0 : T0 >T1 : T1 ->ruatanica : unknown +>ruatanica : typeof ruatanica >hector : ruatanica.hector >julianae : unknown >sumatrana : julianae.sumatrana @@ -7330,7 +7330,7 @@ module samarensis { >pelurus : pelurus >T0 : T0 >T1 : T1 ->sagitta : unknown +>sagitta : typeof sagitta >stolzmanni : sagitta.stolzmanni Palladium(): panamensis.linulus { var x: panamensis.linulus; () => { var y = this; }; return x; } @@ -7587,7 +7587,7 @@ module samarensis { >fuscus : fuscus >T0 : T0 >T1 : T1 ->macrorhinos : unknown +>macrorhinos : typeof macrorhinos >daphaenodon : macrorhinos.daphaenodon planifrons(): nigra.gracilis { var x: nigra.gracilis; () => { var y = this; }; return x; } @@ -8064,7 +8064,7 @@ module sagitta { >leptoceros : leptoceros >T0 : T0 >T1 : T1 ->caurinus : unknown +>caurinus : typeof caurinus >johorensis : caurinus.johorensis >argurus : unknown >peninsulae : argurus.peninsulae @@ -8175,7 +8175,7 @@ module daubentonii { >nigricans : nigricans >T0 : T0 >T1 : T1 ->sagitta : unknown +>sagitta : typeof sagitta >stolzmanni : sagitta.stolzmanni woosnami(): dogramacii.robustulus { var x: dogramacii.robustulus; () => { var y = this; }; return x; } @@ -8207,7 +8207,7 @@ module argurus { >pygmaea : pygmaea >T0 : T0 >T1 : T1 ->rendalli : unknown +>rendalli : typeof rendalli >moojeni : rendalli.moojeni >macrorhinos : unknown >konganensis : macrorhinos.konganensis @@ -8258,7 +8258,7 @@ module chrysaeolus { >sarasinorum : sarasinorum >T0 : T0 >T1 : T1 ->caurinus : unknown +>caurinus : typeof caurinus >psilurus : caurinus.psilurus belzebul(): samarensis.pallidus { var x: samarensis.pallidus; () => { var y = this; }; return x; } @@ -8500,7 +8500,7 @@ module argurus { export class oreas extends lavali.wilsoni { >oreas : oreas ->lavali : unknown +>lavali : typeof lavali >wilsoni : lavali.wilsoni salamonis(): lavali.xanthognathus { var x: lavali.xanthognathus; () => { var y = this; }; return x; } @@ -9129,7 +9129,7 @@ module provocax { export class melanoleuca extends lavali.wilsoni { >melanoleuca : melanoleuca ->lavali : unknown +>lavali : typeof lavali >wilsoni : lavali.wilsoni Neodymium(): macrorhinos.marmosurus, lutreolus.foina> { var x: macrorhinos.marmosurus, lutreolus.foina>; () => { var y = this; }; return x; } @@ -9275,7 +9275,7 @@ module howi { export class marcanoi extends Lanthanum.megalonyx { >marcanoi : marcanoi ->Lanthanum : unknown +>Lanthanum : typeof Lanthanum >megalonyx : Lanthanum.megalonyx formosae(): Lanthanum.megalonyx { var x: Lanthanum.megalonyx; () => { var y = this; }; return x; } @@ -10362,7 +10362,7 @@ module gabriellae { >klossii : klossii >T0 : T0 >T1 : T1 ->imperfecta : unknown +>imperfecta : typeof imperfecta >lasiurus : imperfecta.lasiurus >dogramacii : unknown >robustulus : dogramacii.robustulus @@ -10871,7 +10871,7 @@ module imperfecta { >ciliolabrum : ciliolabrum >T0 : T0 >T1 : T1 ->dogramacii : unknown +>dogramacii : typeof dogramacii >robustulus : dogramacii.robustulus leschenaultii(): argurus.dauricus> { var x: argurus.dauricus>; () => { var y = this; }; return x; } @@ -11034,7 +11034,7 @@ module petrophilus { >sodyi : sodyi >T0 : T0 >T1 : T1 ->quasiater : unknown +>quasiater : typeof quasiater >bobrinskoi : quasiater.bobrinskoi saundersiae(): samarensis.pallidus { var x: samarensis.pallidus; () => { var y = this; }; return x; } @@ -11167,7 +11167,7 @@ module caurinus { export class megaphyllus extends imperfecta.lasiurus> { >megaphyllus : megaphyllus ->imperfecta : unknown +>imperfecta : typeof imperfecta >lasiurus : imperfecta.lasiurus >julianae : unknown >acariensis : julianae.acariensis @@ -11600,7 +11600,7 @@ module lutreolus { >cor : cor >T0 : T0 >T1 : T1 ->panglima : unknown +>panglima : typeof panglima >fundatus : panglima.fundatus >panamensis : unknown >linulus : panamensis.linulus @@ -11846,7 +11846,7 @@ module argurus { export class germaini extends gabriellae.amicus { >germaini : germaini ->gabriellae : unknown +>gabriellae : typeof gabriellae >amicus : gabriellae.amicus sharpei(): lavali.wilsoni { var x: lavali.wilsoni; () => { var y = this; }; return x; } @@ -12058,7 +12058,7 @@ module dammermani { export class melanops extends minutus.inez { >melanops : melanops ->minutus : unknown +>minutus : typeof minutus >inez : minutus.inez >sagitta : unknown >stolzmanni : sagitta.stolzmanni @@ -12307,7 +12307,7 @@ module argurus { export class peninsulae extends patas.uralensis { >peninsulae : peninsulae ->patas : unknown +>patas : typeof patas >uralensis : patas.uralensis aitkeni(): trivirgatus.mixtus, panglima.amphibius> { var x: trivirgatus.mixtus, panglima.amphibius>; () => { var y = this; }; return x; } @@ -12771,7 +12771,7 @@ module ruatanica { >Praseodymium : Praseodymium >T0 : T0 >T1 : T1 ->ruatanica : unknown +>ruatanica : typeof ruatanica >hector : hector >lutreolus : unknown >punicus : lutreolus.punicus @@ -13118,7 +13118,7 @@ module caurinus { >johorensis : johorensis >T0 : T0 >T1 : T1 ->lutreolus : unknown +>lutreolus : typeof lutreolus >punicus : lutreolus.punicus maini(): ruatanica.Praseodymium { var x: ruatanica.Praseodymium; () => { var y = this; }; return x; } @@ -13564,7 +13564,7 @@ module caurinus { export class psilurus extends lutreolus.punicus { >psilurus : psilurus ->lutreolus : unknown +>lutreolus : typeof lutreolus >punicus : lutreolus.punicus socialis(): panglima.amphibius { var x: panglima.amphibius; () => { var y = this; }; return x; } diff --git a/tests/baselines/reference/restArgAssignmentCompat.js b/tests/baselines/reference/restArgAssignmentCompat.js index a640560c051..3f8749f332d 100644 --- a/tests/baselines/reference/restArgAssignmentCompat.js +++ b/tests/baselines/reference/restArgAssignmentCompat.js @@ -15,14 +15,9 @@ function f() { for (var _i = 0; _i < arguments.length; _i++) { x[_i - 0] = arguments[_i]; } - x.forEach(function (n, i) { - return void ('item ' + i + ' = ' + n); - }); -} -function g(x, y) { + x.forEach(function (n, i) { return void ('item ' + i + ' = ' + n); }); } +function g(x, y) { } var n = g; n = f; -n([ - 4 -], 'foo'); +n([4], 'foo'); diff --git a/tests/baselines/reference/restElementMustBeLast.js b/tests/baselines/reference/restElementMustBeLast.js index 2e11ce91de8..337cb6de6f6 100644 --- a/tests/baselines/reference/restElementMustBeLast.js +++ b/tests/baselines/reference/restElementMustBeLast.js @@ -4,14 +4,6 @@ var [...a, x] = [1, 2, 3]; // Error, rest must be last element //// [restElementMustBeLast.js] -var _a = [ - 1, - 2, - 3 -], x = _a[1]; // Error, rest must be last element -_b = [ - 1, - 2, - 3 -], x = _b[1]; // Error, rest must be last element +var _a = [1, 2, 3], x = _a[1]; // Error, rest must be last element +_b = [1, 2, 3], x = _b[1]; // Error, rest must be last element var _b; diff --git a/tests/baselines/reference/restParameterNotLast.js b/tests/baselines/reference/restParameterNotLast.js index 791d83849a1..4ca416a47ec 100644 --- a/tests/baselines/reference/restParameterNotLast.js +++ b/tests/baselines/reference/restParameterNotLast.js @@ -2,5 +2,4 @@ function f(...x, y) { } //// [restParameterNotLast.js] -function f(x, y) { -} +function f(x, y) { } diff --git a/tests/baselines/reference/returnInConstructor1.js b/tests/baselines/reference/returnInConstructor1.js index 30ce79bc369..0096c4d65b6 100644 --- a/tests/baselines/reference/returnInConstructor1.js +++ b/tests/baselines/reference/returnInConstructor1.js @@ -77,47 +77,39 @@ var A = (function () { function A() { return; } - A.prototype.foo = function () { - }; + A.prototype.foo = function () { }; return A; })(); var B = (function () { function B() { return 1; // error } - B.prototype.foo = function () { - }; + B.prototype.foo = function () { }; return B; })(); var C = (function () { function C() { return this; } - C.prototype.foo = function () { - }; + C.prototype.foo = function () { }; return C; })(); var D = (function () { function D() { return "test"; // error } - D.prototype.foo = function () { - }; + D.prototype.foo = function () { }; return D; })(); var E = (function () { function E() { - return { - foo: 1 - }; + return { foo: 1 }; } return E; })(); var F = (function () { function F() { - return { - foo: 1 - }; //error + return { foo: 1 }; //error } return F; })(); @@ -125,10 +117,8 @@ var G = (function () { function G() { this.test = 2; } - G.prototype.test1 = function () { - }; - G.prototype.foo = function () { - }; + G.prototype.test1 = function () { }; + G.prototype.foo = function () { }; return G; })(); var H = (function (_super) { diff --git a/tests/baselines/reference/returnStatements.js b/tests/baselines/reference/returnStatements.js index b968998e4d6..77b6ae1f774 100644 --- a/tests/baselines/reference/returnStatements.js +++ b/tests/baselines/reference/returnStatements.js @@ -32,35 +32,18 @@ var __extends = this.__extends || function (d, b) { d.prototype = new __(); }; // all the following should be valid -function fn1() { - return 1; -} -function fn2() { - return ''; -} -function fn3() { - return undefined; -} -function fn4() { - return; -} -function fn5() { - return true; -} -function fn6() { - return new Date(12); -} -function fn7() { - return null; -} -function fn8() { - return; -} // OK, eq. to 'return undefined' +function fn1() { return 1; } +function fn2() { return ''; } +function fn3() { return undefined; } +function fn4() { return; } +function fn5() { return true; } +function fn6() { return new Date(12); } +function fn7() { return null; } +function fn8() { return; } // OK, eq. to 'return undefined' var C = (function () { function C() { } - C.prototype.dispose = function () { - }; + C.prototype.dispose = function () { }; return C; })(); var D = (function (_super) { @@ -70,17 +53,7 @@ var D = (function (_super) { } return D; })(C); -function fn10() { - return { - id: 12 - }; -} -function fn11() { - return new C(); -} -function fn12() { - return new D(); -} -function fn13() { - return null; -} +function fn10() { return { id: 12 }; } +function fn11() { return new C(); } +function fn12() { return new D(); } +function fn13() { return null; } diff --git a/tests/baselines/reference/returnTypeParameter.js b/tests/baselines/reference/returnTypeParameter.js index 58667207055..d5f46cba776 100644 --- a/tests/baselines/reference/returnTypeParameter.js +++ b/tests/baselines/reference/returnTypeParameter.js @@ -3,8 +3,5 @@ function f(a: T): T { } // error, no return statement function f2(a: T): T { return T; } // bug was that this satisfied the return statement requirement //// [returnTypeParameter.js] -function f(a) { -} // error, no return statement -function f2(a) { - return T; -} // bug was that this satisfied the return statement requirement +function f(a) { } // error, no return statement +function f2(a) { return T; } // bug was that this satisfied the return statement requirement diff --git a/tests/baselines/reference/returnTypeParameterWithModules.js b/tests/baselines/reference/returnTypeParameterWithModules.js index 2dc8da604f9..4790fe1341b 100644 --- a/tests/baselines/reference/returnTypeParameterWithModules.js +++ b/tests/baselines/reference/returnTypeParameterWithModules.js @@ -18,12 +18,7 @@ module M2 { var M1; (function (M1) { function reduce(ar, f, e) { - return Array.prototype.reduce.apply(ar, e ? [ - f, - e - ] : [ - f - ]); + return Array.prototype.reduce.apply(ar, e ? [f, e] : [f]); } M1.reduce = reduce; ; @@ -38,9 +33,7 @@ var M2; M2.compose = compose; ; function compose2(g, f) { - return function (x) { - return g(f(x)); - }; + return function (x) { return g(f(x)); }; } M2.compose2 = compose2; ; diff --git a/tests/baselines/reference/returnTypeTypeArguments.js b/tests/baselines/reference/returnTypeTypeArguments.js index 5be549d2f34..b374cb1c581 100644 --- a/tests/baselines/reference/returnTypeTypeArguments.js +++ b/tests/baselines/reference/returnTypeTypeArguments.js @@ -92,65 +92,31 @@ var Three = (function () { } return Three; })(); -function A1() { - return null; -} -function A2() { - return null; -} -function A3() { - return null; -} -function B1() { - return null; -} -function B2() { - return null; -} -function B3() { - return null; -} +function A1() { return null; } +function A2() { return null; } +function A3() { return null; } +function B1() { return null; } +function B2() { return null; } +function B3() { return null; } var C = (function () { function C() { } - C.prototype.A1 = function () { - return null; - }; - C.prototype.A2 = function () { - return null; - }; - C.prototype.A3 = function () { - return null; - }; - C.prototype.B1 = function () { - return null; - }; - C.prototype.B2 = function () { - return null; - }; - C.prototype.B3 = function () { - return null; - }; + C.prototype.A1 = function () { return null; }; + C.prototype.A2 = function () { return null; }; + C.prototype.A3 = function () { return null; }; + C.prototype.B1 = function () { return null; }; + C.prototype.B2 = function () { return null; }; + C.prototype.B3 = function () { return null; }; return C; })(); var D = (function () { function D() { } - D.prototype.A2 = function () { - return null; - }; - D.prototype.A3 = function () { - return null; - }; - D.prototype.B1 = function () { - return null; - }; - D.prototype.B2 = function () { - return null; - }; - D.prototype.B3 = function () { - return null; - }; + D.prototype.A2 = function () { return null; }; + D.prototype.A3 = function () { return null; }; + D.prototype.B1 = function () { return null; }; + D.prototype.B2 = function () { return null; }; + D.prototype.B3 = function () { return null; }; return D; })(); var Y = (function () { diff --git a/tests/baselines/reference/reverseInferenceInContextualInstantiation.js b/tests/baselines/reference/reverseInferenceInContextualInstantiation.js index 7108029ac54..f9c3242e1ea 100644 --- a/tests/baselines/reference/reverseInferenceInContextualInstantiation.js +++ b/tests/baselines/reference/reverseInferenceInContextualInstantiation.js @@ -5,8 +5,6 @@ x.sort(compare); // Error, but shouldn't be //// [reverseInferenceInContextualInstantiation.js] -function compare(a, b) { - return 0; -} +function compare(a, b) { return 0; } var x; x.sort(compare); // Error, but shouldn't be diff --git a/tests/baselines/reference/scannertest1.js b/tests/baselines/reference/scannertest1.js index dc003e95a8f..b96c965a79e 100644 --- a/tests/baselines/reference/scannertest1.js +++ b/tests/baselines/reference/scannertest1.js @@ -33,11 +33,17 @@ var CharacterInfo = (function () { return c >= CharacterCodes._0 && c <= CharacterCodes._9; }; CharacterInfo.isHexDigit = function (c) { - return isDecimalDigit(c) || (c >= CharacterCodes.A && c <= CharacterCodes.F) || (c >= CharacterCodes.a && c <= CharacterCodes.f); + return isDecimalDigit(c) || + (c >= CharacterCodes.A && c <= CharacterCodes.F) || + (c >= CharacterCodes.a && c <= CharacterCodes.f); }; CharacterInfo.hexValue = function (c) { Debug.assert(isHexDigit(c)); - return isDecimalDigit(c) ? (c - CharacterCodes._0) : (c >= CharacterCodes.A && c <= CharacterCodes.F) ? c - CharacterCodes.A + 10 : c - CharacterCodes.a + 10; + return isDecimalDigit(c) + ? (c - CharacterCodes._0) + : (c >= CharacterCodes.A && c <= CharacterCodes.F) + ? c - CharacterCodes.A + 10 + : c - CharacterCodes.a + 10; }; return CharacterInfo; })(); diff --git a/tests/baselines/reference/scopingInCatchBlocks.js b/tests/baselines/reference/scopingInCatchBlocks.js index 2d3ca7098b5..3121f4e9c79 100644 --- a/tests/baselines/reference/scopingInCatchBlocks.js +++ b/tests/baselines/reference/scopingInCatchBlocks.js @@ -11,17 +11,12 @@ var x = ex1; // should error //// [scopingInCatchBlocks.js] -try { -} +try { } catch (ex1) { throw ex1; } -try { -} -catch (ex1) { -} // should not error -try { -} -catch (ex1) { -} // should not error +try { } +catch (ex1) { } // should not error +try { } +catch (ex1) { } // should not error var x = ex1; // should error diff --git a/tests/baselines/reference/selfInCallback.js b/tests/baselines/reference/selfInCallback.js index 85f16390f96..25228b03187 100644 --- a/tests/baselines/reference/selfInCallback.js +++ b/tests/baselines/reference/selfInCallback.js @@ -12,14 +12,10 @@ var C = (function () { function C() { this.p1 = 0; } - C.prototype.callback = function (cb) { - cb(); - }; + C.prototype.callback = function (cb) { cb(); }; C.prototype.doit = function () { var _this = this; - this.callback(function () { - _this.p1 + 1; - }); + this.callback(function () { _this.p1 + 1; }); }; return C; })(); diff --git a/tests/baselines/reference/selfInLambdas.js b/tests/baselines/reference/selfInLambdas.js index 67006603c8e..6b09cf2e227 100644 --- a/tests/baselines/reference/selfInLambdas.js +++ b/tests/baselines/reference/selfInLambdas.js @@ -53,9 +53,7 @@ var o = { var _this = this; window.onmousemove = function () { _this.counter++; - var f = function () { - return _this.counter; - }; + var f = function () { return _this.counter; }; }; } }; diff --git a/tests/baselines/reference/separate1-2.js b/tests/baselines/reference/separate1-2.js index bda277467e8..6ef155ca0f4 100644 --- a/tests/baselines/reference/separate1-2.js +++ b/tests/baselines/reference/separate1-2.js @@ -6,7 +6,6 @@ module X { //// [separate1-2.js] var X; (function (X) { - function f() { - } + function f() { } X.f = f; })(X || (X = {})); diff --git a/tests/baselines/reference/separateCompilationAmbientConstEnum.errors.txt b/tests/baselines/reference/separateCompilationAmbientConstEnum.errors.txt new file mode 100644 index 00000000000..6ea2e445e29 --- /dev/null +++ b/tests/baselines/reference/separateCompilationAmbientConstEnum.errors.txt @@ -0,0 +1,10 @@ +tests/cases/compiler/separateCompilationAmbientConstEnum.ts(3,20): error TS1209: Ambient const enums are not allowed when the '--separateCompilation' flag is provided. + + +==== tests/cases/compiler/separateCompilationAmbientConstEnum.ts (1 errors) ==== + + + declare const enum E { X = 1} + ~ +!!! error TS1209: Ambient const enums are not allowed when the '--separateCompilation' flag is provided. + export var y; \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationAmbientConstEnum.js b/tests/baselines/reference/separateCompilationAmbientConstEnum.js new file mode 100644 index 00000000000..5b3af0957e7 --- /dev/null +++ b/tests/baselines/reference/separateCompilationAmbientConstEnum.js @@ -0,0 +1,8 @@ +//// [separateCompilationAmbientConstEnum.ts] + + +declare const enum E { X = 1} +export var y; + +//// [separateCompilationAmbientConstEnum.js] +export var y; diff --git a/tests/baselines/reference/separateCompilationDeclaration.errors.txt b/tests/baselines/reference/separateCompilationDeclaration.errors.txt new file mode 100644 index 00000000000..8951184584c --- /dev/null +++ b/tests/baselines/reference/separateCompilationDeclaration.errors.txt @@ -0,0 +1,7 @@ +error TS5044: Option 'declaration' cannot be specified with option 'separateCompilation'. + + +!!! error TS5044: Option 'declaration' cannot be specified with option 'separateCompilation'. +==== tests/cases/compiler/separateCompilationDeclaration.ts (0 errors) ==== + + export var x; \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationDeclaration.js b/tests/baselines/reference/separateCompilationDeclaration.js new file mode 100644 index 00000000000..33d64b088de --- /dev/null +++ b/tests/baselines/reference/separateCompilationDeclaration.js @@ -0,0 +1,10 @@ +//// [separateCompilationDeclaration.ts] + +export var x; + +//// [separateCompilationDeclaration.js] +export var x; + + +//// [separateCompilationDeclaration.d.ts] +export declare var x: any; diff --git a/tests/baselines/reference/separateCompilationES6.js b/tests/baselines/reference/separateCompilationES6.js new file mode 100644 index 00000000000..cf05e5590a8 --- /dev/null +++ b/tests/baselines/reference/separateCompilationES6.js @@ -0,0 +1,5 @@ +//// [separateCompilationES6.ts] +export var x; + +//// [separateCompilationES6.js] +export var x; diff --git a/tests/baselines/reference/separateCompilationES6.types b/tests/baselines/reference/separateCompilationES6.types new file mode 100644 index 00000000000..70381906800 --- /dev/null +++ b/tests/baselines/reference/separateCompilationES6.types @@ -0,0 +1,4 @@ +=== tests/cases/compiler/separateCompilationES6.ts === +export var x; +>x : any + diff --git a/tests/baselines/reference/separateCompilationImportExportElision.errors.txt b/tests/baselines/reference/separateCompilationImportExportElision.errors.txt new file mode 100644 index 00000000000..db418681e83 --- /dev/null +++ b/tests/baselines/reference/separateCompilationImportExportElision.errors.txt @@ -0,0 +1,28 @@ +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 (4 errors) ==== + + import {c} from "module" + ~~~~~~~~ +!!! error TS2307: Cannot find external module 'module'. + import {c2} from "module" + ~~~~~~~~ +!!! error TS2307: Cannot find external module 'module'. + import * as ns from "module" + ~~~~~~~~ +!!! error TS2307: Cannot find external module 'module'. + + class C extends c2.C { + } + + let x = new c(); + let y = ns.value; + + export {c1} from "module"; + ~~~~~~~~ +!!! error TS2307: Cannot find external 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 new file mode 100644 index 00000000000..2d255798c3f --- /dev/null +++ b/tests/baselines/reference/separateCompilationImportExportElision.js @@ -0,0 +1,37 @@ +//// [separateCompilationImportExportElision.ts] + +import {c} from "module" +import {c2} from "module" +import * as ns from "module" + +class C extends c2.C { +} + +let x = new c(); +let y = ns.value; + +export {c1} from "module"; +export var z = x; + +//// [separateCompilationImportExportElision.js] +var __extends = this.__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 module_1 = require("module"); +var module_2 = require("module"); +var ns = require("module"); +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + return C; +})(module_2.c2.C); +var x = new module_1.c(); +var y = ns.value; +var module_3 = require("module"); +exports.c1 = module_3.c1; +exports.z = x; diff --git a/tests/baselines/reference/separateCompilationNoEmitOnError.errors.txt b/tests/baselines/reference/separateCompilationNoEmitOnError.errors.txt new file mode 100644 index 00000000000..61d4f2d6d9e --- /dev/null +++ b/tests/baselines/reference/separateCompilationNoEmitOnError.errors.txt @@ -0,0 +1,7 @@ +error TS5045: Option 'noEmitOnError' cannot be specified with option 'separateCompilation'. + + +!!! error TS5045: Option 'noEmitOnError' cannot be specified with option 'separateCompilation'. +==== tests/cases/compiler/separateCompilationNoEmitOnError.ts (0 errors) ==== + + export var x; \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationNoExternalModule.errors.txt b/tests/baselines/reference/separateCompilationNoExternalModule.errors.txt new file mode 100644 index 00000000000..269727584d4 --- /dev/null +++ b/tests/baselines/reference/separateCompilationNoExternalModule.errors.txt @@ -0,0 +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 (1 errors) ==== + + var x; + ~~~ +!!! error TS1208: Cannot compile non-external modules when the '--separateCompilation' flag is provided. \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationNoExternalModule.js b/tests/baselines/reference/separateCompilationNoExternalModule.js new file mode 100644 index 00000000000..9ddc8bdef2c --- /dev/null +++ b/tests/baselines/reference/separateCompilationNoExternalModule.js @@ -0,0 +1,6 @@ +//// [separateCompilationNoExternalModule.ts] + +var x; + +//// [separateCompilationNoExternalModule.js] +var x; diff --git a/tests/baselines/reference/separateCompilationNonAmbientConstEnum.js b/tests/baselines/reference/separateCompilationNonAmbientConstEnum.js new file mode 100644 index 00000000000..74096adca1f --- /dev/null +++ b/tests/baselines/reference/separateCompilationNonAmbientConstEnum.js @@ -0,0 +1,14 @@ +//// [separateCompilationNonAmbientConstEnum.ts] + +const enum E { X = 100 }; +var e = E.X; +export var x; + +//// [separateCompilationNonAmbientConstEnum.js] +var E; +(function (E) { + E[E["X"] = 100] = "X"; +})(E || (E = {})); +; +var e = E.X; +export var x; diff --git a/tests/baselines/reference/separateCompilationNonAmbientConstEnum.types b/tests/baselines/reference/separateCompilationNonAmbientConstEnum.types new file mode 100644 index 00000000000..d444cbd1493 --- /dev/null +++ b/tests/baselines/reference/separateCompilationNonAmbientConstEnum.types @@ -0,0 +1,15 @@ +=== tests/cases/compiler/separateCompilationNonAmbientConstEnum.ts === + +const enum E { X = 100 }; +>E : E +>X : E + +var e = E.X; +>e : E +>E.X : E +>E : typeof E +>X : E + +export var x; +>x : any + diff --git a/tests/baselines/reference/separateCompilationOut.errors.txt b/tests/baselines/reference/separateCompilationOut.errors.txt new file mode 100644 index 00000000000..7c2631a7182 --- /dev/null +++ b/tests/baselines/reference/separateCompilationOut.errors.txt @@ -0,0 +1,12 @@ +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. + + +!!! error TS5046: Option 'out' cannot be specified with option 'separateCompilation'. +==== tests/cases/compiler/file1.ts (0 errors) ==== + + export var x; +==== 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 diff --git a/tests/baselines/reference/separateCompilationOut.js b/tests/baselines/reference/separateCompilationOut.js new file mode 100644 index 00000000000..67dd2dcfbfa --- /dev/null +++ b/tests/baselines/reference/separateCompilationOut.js @@ -0,0 +1,12 @@ +//// [tests/cases/compiler/separateCompilationOut.ts] //// + +//// [file1.ts] + +export var x; +//// [file2.ts] +var y; + +//// [file1.js] +export var x; +//// [all.js] +var y; diff --git a/tests/baselines/reference/separateCompilationSourceMap.errors.txt b/tests/baselines/reference/separateCompilationSourceMap.errors.txt new file mode 100644 index 00000000000..5274ef3921e --- /dev/null +++ b/tests/baselines/reference/separateCompilationSourceMap.errors.txt @@ -0,0 +1,7 @@ +error TS5043: Option 'sourceMap' cannot be specified with option 'separateCompilation'. + + +!!! error TS5043: Option 'sourceMap' cannot be specified with option 'separateCompilation'. +==== tests/cases/compiler/separateCompilationSourceMap.ts (0 errors) ==== + + export var x; \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationSourceMap.js b/tests/baselines/reference/separateCompilationSourceMap.js new file mode 100644 index 00000000000..1e8f141eb47 --- /dev/null +++ b/tests/baselines/reference/separateCompilationSourceMap.js @@ -0,0 +1,7 @@ +//// [separateCompilationSourceMap.ts] + +export var x; + +//// [separateCompilationSourceMap.js] +export var x; +//# sourceMappingURL=separateCompilationSourceMap.js.map \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationSourceMap.js.map b/tests/baselines/reference/separateCompilationSourceMap.js.map new file mode 100644 index 00000000000..68c4e2c78db --- /dev/null +++ b/tests/baselines/reference/separateCompilationSourceMap.js.map @@ -0,0 +1,2 @@ +//// [separateCompilationSourceMap.js.map] +{"version":3,"file":"separateCompilationSourceMap.js","sourceRoot":"","sources":["separateCompilationSourceMap.ts"],"names":[],"mappings":"AACA,WAAW,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationSourceMap.sourcemap.txt b/tests/baselines/reference/separateCompilationSourceMap.sourcemap.txt new file mode 100644 index 00000000000..74e0d73d7e0 --- /dev/null +++ b/tests/baselines/reference/separateCompilationSourceMap.sourcemap.txt @@ -0,0 +1,27 @@ +=================================================================== +JsFile: separateCompilationSourceMap.js +mapUrl: separateCompilationSourceMap.js.map +sourceRoot: +sources: separateCompilationSourceMap.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/separateCompilationSourceMap.js +sourceFile:separateCompilationSourceMap.ts +------------------------------------------------------------------- +>>>export var x; +1 > +2 >^^^^^^^^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export var +3 > x +4 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +3 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +4 >Emitted(1, 14) Source(2, 14) + SourceIndex(0) +--- +>>>//# sourceMappingURL=separateCompilationSourceMap.js.map \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationSpecifiedModule.js b/tests/baselines/reference/separateCompilationSpecifiedModule.js new file mode 100644 index 00000000000..5f3c7ceb39c --- /dev/null +++ b/tests/baselines/reference/separateCompilationSpecifiedModule.js @@ -0,0 +1,5 @@ +//// [separateCompilationSpecifiedModule.ts] +export var x; + +//// [separateCompilationSpecifiedModule.js] +exports.x; diff --git a/tests/baselines/reference/separateCompilationSpecifiedModule.types b/tests/baselines/reference/separateCompilationSpecifiedModule.types new file mode 100644 index 00000000000..497f63faf62 --- /dev/null +++ b/tests/baselines/reference/separateCompilationSpecifiedModule.types @@ -0,0 +1,4 @@ +=== tests/cases/compiler/separateCompilationSpecifiedModule.ts === +export var x; +>x : any + diff --git a/tests/baselines/reference/separateCompilationUnspecifiedModule.errors.txt b/tests/baselines/reference/separateCompilationUnspecifiedModule.errors.txt new file mode 100644 index 00000000000..ab0fd7ffe9d --- /dev/null +++ b/tests/baselines/reference/separateCompilationUnspecifiedModule.errors.txt @@ -0,0 +1,6 @@ +error TS5047: Option 'separateCompilation' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher. + + +!!! error TS5047: Option 'separateCompilation' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher. +==== tests/cases/compiler/separateCompilationUnspecifiedModule.ts (0 errors) ==== + export var x; \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationUnspecifiedModule.js b/tests/baselines/reference/separateCompilationUnspecifiedModule.js new file mode 100644 index 00000000000..0f2e5c71a87 --- /dev/null +++ b/tests/baselines/reference/separateCompilationUnspecifiedModule.js @@ -0,0 +1,5 @@ +//// [separateCompilationUnspecifiedModule.ts] +export var x; + +//// [separateCompilationUnspecifiedModule.js] +exports.x; diff --git a/tests/baselines/reference/separateCompilationWithDeclarationFile.js b/tests/baselines/reference/separateCompilationWithDeclarationFile.js new file mode 100644 index 00000000000..71d7ef41929 --- /dev/null +++ b/tests/baselines/reference/separateCompilationWithDeclarationFile.js @@ -0,0 +1,11 @@ +//// [tests/cases/compiler/separateCompilationWithDeclarationFile.ts] //// + +//// [file1.d.ts] + +declare function foo(): void; + +//// [file1.ts] +export var x; + +//// [file1.js] +export var x; diff --git a/tests/baselines/reference/separateCompilationWithDeclarationFile.types b/tests/baselines/reference/separateCompilationWithDeclarationFile.types new file mode 100644 index 00000000000..94adc5fa27e --- /dev/null +++ b/tests/baselines/reference/separateCompilationWithDeclarationFile.types @@ -0,0 +1,9 @@ +=== tests/cases/compiler/file1.d.ts === + +declare function foo(): void; +>foo : () => void + +=== tests/cases/compiler/file1.ts === +export var x; +>x : any + diff --git a/tests/baselines/reference/shadowPrivateMembers.js b/tests/baselines/reference/shadowPrivateMembers.js index 3d7e3db7ef1..098a7914a71 100644 --- a/tests/baselines/reference/shadowPrivateMembers.js +++ b/tests/baselines/reference/shadowPrivateMembers.js @@ -13,8 +13,7 @@ var __extends = this.__extends || function (d, b) { var base = (function () { function base() { } - base.prototype.n = function () { - }; + base.prototype.n = function () { }; return base; })(); var derived = (function (_super) { @@ -22,7 +21,6 @@ var derived = (function (_super) { function derived() { _super.apply(this, arguments); } - derived.prototype.n = function () { - }; + derived.prototype.n = function () { }; return derived; })(base); diff --git a/tests/baselines/reference/shadowedInternalModule.js b/tests/baselines/reference/shadowedInternalModule.js index 90bbd023584..3a7c6d4d61a 100644 --- a/tests/baselines/reference/shadowedInternalModule.js +++ b/tests/baselines/reference/shadowedInternalModule.js @@ -37,17 +37,11 @@ module Z { // all errors imported modules conflict with local variables var A; (function (A) { - A.Point = { - x: 0, - y: 0 - }; + A.Point = { x: 0, y: 0 }; })(A || (A = {})); var B; (function (B) { - var A = { - x: 0, - y: 0 - }; + var A = { x: 0, y: 0 }; })(B || (B = {})); var X; (function (X) { diff --git a/tests/baselines/reference/shadowingViaLocalValueOrBindingElement.js b/tests/baselines/reference/shadowingViaLocalValueOrBindingElement.js index a930f7405ff..b3c44600d1d 100644 --- a/tests/baselines/reference/shadowingViaLocalValueOrBindingElement.js +++ b/tests/baselines/reference/shadowingViaLocalValueOrBindingElement.js @@ -15,17 +15,9 @@ if (true) { var x_1; if (true) { var x = 0; // Error - var _a = ({ - x: 0 - }).x, x = _a === void 0 ? 0 : _a; // Error - var _b = ({ - x: 0 - }).x, x = _b === void 0 ? 0 : _b; // Error - var x = ({ - x: 0 - }).x; // Error - var x = ({ - x: 0 - }).x; // Error + var _a = ({ x: 0 }).x, x = _a === void 0 ? 0 : _a; // Error + var _b = ({ x: 0 }).x, x = _b === void 0 ? 0 : _b; // Error + var x = ({ x: 0 }).x; // Error + var x = ({ x: 0 }).x; // Error } } diff --git a/tests/baselines/reference/simpleArrowFunctionParameterReferencedInObjectLiteral1.js b/tests/baselines/reference/simpleArrowFunctionParameterReferencedInObjectLiteral1.js index 2cbc58ac19a..fbf01bc167a 100644 --- a/tests/baselines/reference/simpleArrowFunctionParameterReferencedInObjectLiteral1.js +++ b/tests/baselines/reference/simpleArrowFunctionParameterReferencedInObjectLiteral1.js @@ -3,10 +3,4 @@ //// [simpleArrowFunctionParameterReferencedInObjectLiteral1.js] -[].map(function () { - return [].map(function (p) { - return ({ - X: p - }); - }); -}); +[].map(function () { return [].map(function (p) { return ({ X: p }); }); }); diff --git a/tests/baselines/reference/sourceMap-FileWithComments.js b/tests/baselines/reference/sourceMap-FileWithComments.js index 6143ff95fb8..e9755f6c048 100644 --- a/tests/baselines/reference/sourceMap-FileWithComments.js +++ b/tests/baselines/reference/sourceMap-FileWithComments.js @@ -48,9 +48,7 @@ var Shapes; this.y = y; } // Instance member - Point.prototype.getDist = function () { - return Math.sqrt(this.x * this.x + this.y * this.y); - }; + Point.prototype.getDist = function () { return Math.sqrt(this.x * this.x + this.y * this.y); }; // Static member Point.origin = new Point(0, 0); return Point; diff --git a/tests/baselines/reference/sourceMap-FileWithComments.js.map b/tests/baselines/reference/sourceMap-FileWithComments.js.map index 3da9be212f5..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":"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;YAAYE,MAAMA,CAACA,IAAIA,CAACA,IAAIA,CAACA,IAAIA,CAACA,CAACA,GAAGA,IAAIA,CAACA,CAACA,GAAGA,IAAIA,CAACA,CAACA,GAAGA,IAAIA,CAACA,CAACA,CAACA,CAACA;QAACA,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 +{"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 be00cb7f263..8283006042a 100644 --- a/tests/baselines/reference/sourceMap-FileWithComments.sourcemap.txt +++ b/tests/baselines/reference/sourceMap-FileWithComments.sourcemap.txt @@ -176,7 +176,7 @@ sourceFile:sourceMap-FileWithComments.ts >>> // Instance member 1->^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > > @@ -184,112 +184,106 @@ sourceFile:sourceMap-FileWithComments.ts 1->Emitted(11, 9) Source(15, 9) + SourceIndex(0) name (Shapes.Point) 2 >Emitted(11, 27) Source(15, 27) + SourceIndex(0) name (Shapes.Point) --- ->>> Point.prototype.getDist = function () { +>>> Point.prototype.getDist = function () { return Math.sqrt(this.x * this.x + this.y * this.y); }; 1->^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^^^ -4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +4 > ^^^^^^^^^^^^^^ +5 > ^^^^^^ +6 > ^ +7 > ^^^^ +8 > ^ +9 > ^^^^ +10> ^ +11> ^^^^ +12> ^ +13> ^ +14> ^^^ +15> ^^^^ +16> ^ +17> ^ +18> ^^^ +19> ^^^^ +20> ^ +21> ^ +22> ^^^ +23> ^^^^ +24> ^ +25> ^ +26> ^ +27> ^ +28> ^ +29> ^ 1-> > 2 > getDist 3 > +4 > getDist() { +5 > return +6 > +7 > Math +8 > . +9 > sqrt +10> ( +11> this +12> . +13> x +14> * +15> this +16> . +17> x +18> + +19> this +20> . +21> y +22> * +23> this +24> . +25> y +26> ) +27> ; +28> +29> } 1->Emitted(12, 9) Source(16, 9) + SourceIndex(0) name (Shapes.Point) 2 >Emitted(12, 32) Source(16, 16) + SourceIndex(0) name (Shapes.Point) 3 >Emitted(12, 35) Source(16, 9) + SourceIndex(0) name (Shapes.Point) ---- ->>> return Math.sqrt(this.x * this.x + this.y * this.y); -1->^^^^^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^ -5 > ^ -6 > ^^^^ -7 > ^ -8 > ^^^^ -9 > ^ -10> ^ -11> ^^^ -12> ^^^^ -13> ^ -14> ^ -15> ^^^ -16> ^^^^ -17> ^ -18> ^ -19> ^^^ -20> ^^^^ -21> ^ -22> ^ -23> ^ -24> ^ -1->getDist() { -2 > return -3 > -4 > Math -5 > . -6 > sqrt -7 > ( -8 > this -9 > . -10> x -11> * -12> this -13> . -14> x -15> + -16> this -17> . -18> y -19> * -20> this -21> . -22> y -23> ) -24> ; -1->Emitted(13, 13) Source(16, 21) + SourceIndex(0) name (Shapes.Point.getDist) -2 >Emitted(13, 19) Source(16, 27) + SourceIndex(0) name (Shapes.Point.getDist) -3 >Emitted(13, 20) Source(16, 28) + SourceIndex(0) name (Shapes.Point.getDist) -4 >Emitted(13, 24) Source(16, 32) + SourceIndex(0) name (Shapes.Point.getDist) -5 >Emitted(13, 25) Source(16, 33) + SourceIndex(0) name (Shapes.Point.getDist) -6 >Emitted(13, 29) Source(16, 37) + SourceIndex(0) name (Shapes.Point.getDist) -7 >Emitted(13, 30) Source(16, 38) + SourceIndex(0) name (Shapes.Point.getDist) -8 >Emitted(13, 34) Source(16, 42) + SourceIndex(0) name (Shapes.Point.getDist) -9 >Emitted(13, 35) Source(16, 43) + SourceIndex(0) name (Shapes.Point.getDist) -10>Emitted(13, 36) Source(16, 44) + SourceIndex(0) name (Shapes.Point.getDist) -11>Emitted(13, 39) Source(16, 47) + SourceIndex(0) name (Shapes.Point.getDist) -12>Emitted(13, 43) Source(16, 51) + SourceIndex(0) name (Shapes.Point.getDist) -13>Emitted(13, 44) Source(16, 52) + SourceIndex(0) name (Shapes.Point.getDist) -14>Emitted(13, 45) Source(16, 53) + SourceIndex(0) name (Shapes.Point.getDist) -15>Emitted(13, 48) Source(16, 56) + SourceIndex(0) name (Shapes.Point.getDist) -16>Emitted(13, 52) Source(16, 60) + SourceIndex(0) name (Shapes.Point.getDist) -17>Emitted(13, 53) Source(16, 61) + SourceIndex(0) name (Shapes.Point.getDist) -18>Emitted(13, 54) Source(16, 62) + SourceIndex(0) name (Shapes.Point.getDist) -19>Emitted(13, 57) Source(16, 65) + SourceIndex(0) name (Shapes.Point.getDist) -20>Emitted(13, 61) Source(16, 69) + SourceIndex(0) name (Shapes.Point.getDist) -21>Emitted(13, 62) Source(16, 70) + SourceIndex(0) name (Shapes.Point.getDist) -22>Emitted(13, 63) Source(16, 71) + SourceIndex(0) name (Shapes.Point.getDist) -23>Emitted(13, 64) Source(16, 72) + SourceIndex(0) name (Shapes.Point.getDist) -24>Emitted(13, 65) Source(16, 73) + SourceIndex(0) name (Shapes.Point.getDist) ---- ->>> }; -1 >^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > -2 > } -1 >Emitted(14, 9) Source(16, 74) + SourceIndex(0) name (Shapes.Point.getDist) -2 >Emitted(14, 10) Source(16, 75) + SourceIndex(0) name (Shapes.Point.getDist) +4 >Emitted(12, 49) Source(16, 21) + SourceIndex(0) name (Shapes.Point.getDist) +5 >Emitted(12, 55) Source(16, 27) + SourceIndex(0) name (Shapes.Point.getDist) +6 >Emitted(12, 56) Source(16, 28) + SourceIndex(0) name (Shapes.Point.getDist) +7 >Emitted(12, 60) Source(16, 32) + SourceIndex(0) name (Shapes.Point.getDist) +8 >Emitted(12, 61) Source(16, 33) + SourceIndex(0) name (Shapes.Point.getDist) +9 >Emitted(12, 65) Source(16, 37) + SourceIndex(0) name (Shapes.Point.getDist) +10>Emitted(12, 66) Source(16, 38) + SourceIndex(0) name (Shapes.Point.getDist) +11>Emitted(12, 70) Source(16, 42) + SourceIndex(0) name (Shapes.Point.getDist) +12>Emitted(12, 71) Source(16, 43) + SourceIndex(0) name (Shapes.Point.getDist) +13>Emitted(12, 72) Source(16, 44) + SourceIndex(0) name (Shapes.Point.getDist) +14>Emitted(12, 75) Source(16, 47) + SourceIndex(0) name (Shapes.Point.getDist) +15>Emitted(12, 79) Source(16, 51) + SourceIndex(0) name (Shapes.Point.getDist) +16>Emitted(12, 80) Source(16, 52) + SourceIndex(0) name (Shapes.Point.getDist) +17>Emitted(12, 81) Source(16, 53) + SourceIndex(0) name (Shapes.Point.getDist) +18>Emitted(12, 84) Source(16, 56) + SourceIndex(0) name (Shapes.Point.getDist) +19>Emitted(12, 88) Source(16, 60) + SourceIndex(0) name (Shapes.Point.getDist) +20>Emitted(12, 89) Source(16, 61) + SourceIndex(0) name (Shapes.Point.getDist) +21>Emitted(12, 90) Source(16, 62) + SourceIndex(0) name (Shapes.Point.getDist) +22>Emitted(12, 93) Source(16, 65) + SourceIndex(0) name (Shapes.Point.getDist) +23>Emitted(12, 97) Source(16, 69) + SourceIndex(0) name (Shapes.Point.getDist) +24>Emitted(12, 98) Source(16, 70) + SourceIndex(0) name (Shapes.Point.getDist) +25>Emitted(12, 99) Source(16, 71) + SourceIndex(0) name (Shapes.Point.getDist) +26>Emitted(12, 100) Source(16, 72) + SourceIndex(0) name (Shapes.Point.getDist) +27>Emitted(12, 101) Source(16, 73) + SourceIndex(0) name (Shapes.Point.getDist) +28>Emitted(12, 102) Source(16, 74) + SourceIndex(0) name (Shapes.Point.getDist) +29>Emitted(12, 103) Source(16, 75) + SourceIndex(0) name (Shapes.Point.getDist) --- >>> // Static member -1->^^^^^^^^ +1 >^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^ 3 > ^^^^^^^^^^^^^^^^-> -1-> +1 > > > 2 > // Static member -1->Emitted(15, 9) Source(18, 9) + SourceIndex(0) name (Shapes.Point) -2 >Emitted(15, 25) Source(18, 25) + SourceIndex(0) name (Shapes.Point) +1 >Emitted(13, 9) Source(18, 9) + SourceIndex(0) name (Shapes.Point) +2 >Emitted(13, 25) Source(18, 25) + SourceIndex(0) name (Shapes.Point) --- >>> Point.origin = new Point(0, 0); 1->^^^^^^^^ @@ -315,17 +309,17 @@ sourceFile:sourceMap-FileWithComments.ts 9 > 0 10> ) 11> ; -1->Emitted(16, 9) Source(19, 16) + SourceIndex(0) name (Shapes.Point) -2 >Emitted(16, 21) Source(19, 22) + SourceIndex(0) name (Shapes.Point) -3 >Emitted(16, 24) Source(19, 25) + SourceIndex(0) name (Shapes.Point) -4 >Emitted(16, 28) Source(19, 29) + SourceIndex(0) name (Shapes.Point) -5 >Emitted(16, 33) Source(19, 34) + SourceIndex(0) name (Shapes.Point) -6 >Emitted(16, 34) Source(19, 35) + SourceIndex(0) name (Shapes.Point) -7 >Emitted(16, 35) Source(19, 36) + SourceIndex(0) name (Shapes.Point) -8 >Emitted(16, 37) Source(19, 38) + SourceIndex(0) name (Shapes.Point) -9 >Emitted(16, 38) Source(19, 39) + SourceIndex(0) name (Shapes.Point) -10>Emitted(16, 39) Source(19, 40) + SourceIndex(0) name (Shapes.Point) -11>Emitted(16, 40) Source(19, 41) + SourceIndex(0) name (Shapes.Point) +1->Emitted(14, 9) Source(19, 16) + SourceIndex(0) name (Shapes.Point) +2 >Emitted(14, 21) Source(19, 22) + SourceIndex(0) name (Shapes.Point) +3 >Emitted(14, 24) Source(19, 25) + SourceIndex(0) name (Shapes.Point) +4 >Emitted(14, 28) Source(19, 29) + SourceIndex(0) name (Shapes.Point) +5 >Emitted(14, 33) Source(19, 34) + SourceIndex(0) name (Shapes.Point) +6 >Emitted(14, 34) Source(19, 35) + SourceIndex(0) name (Shapes.Point) +7 >Emitted(14, 35) Source(19, 36) + SourceIndex(0) name (Shapes.Point) +8 >Emitted(14, 37) Source(19, 38) + SourceIndex(0) name (Shapes.Point) +9 >Emitted(14, 38) Source(19, 39) + SourceIndex(0) name (Shapes.Point) +10>Emitted(14, 39) Source(19, 40) + SourceIndex(0) name (Shapes.Point) +11>Emitted(14, 40) Source(19, 41) + SourceIndex(0) name (Shapes.Point) --- >>> return Point; 1 >^^^^^^^^ @@ -333,8 +327,8 @@ sourceFile:sourceMap-FileWithComments.ts 1 > > 2 > } -1 >Emitted(17, 9) Source(20, 5) + SourceIndex(0) name (Shapes.Point) -2 >Emitted(17, 21) Source(20, 6) + SourceIndex(0) name (Shapes.Point) +1 >Emitted(15, 9) Source(20, 5) + SourceIndex(0) name (Shapes.Point) +2 >Emitted(15, 21) Source(20, 6) + SourceIndex(0) name (Shapes.Point) --- >>> })(); 1 >^^^^ @@ -355,10 +349,10 @@ sourceFile:sourceMap-FileWithComments.ts > // Static member > static origin = new Point(0, 0); > } -1 >Emitted(18, 5) Source(20, 5) + SourceIndex(0) name (Shapes.Point) -2 >Emitted(18, 6) Source(20, 6) + SourceIndex(0) name (Shapes.Point) -3 >Emitted(18, 6) Source(11, 5) + SourceIndex(0) name (Shapes) -4 >Emitted(18, 10) Source(20, 6) + SourceIndex(0) name (Shapes) +1 >Emitted(16, 5) Source(20, 5) + SourceIndex(0) name (Shapes.Point) +2 >Emitted(16, 6) Source(20, 6) + SourceIndex(0) name (Shapes.Point) +3 >Emitted(16, 6) Source(11, 5) + SourceIndex(0) name (Shapes) +4 >Emitted(16, 10) Source(20, 6) + SourceIndex(0) name (Shapes) --- >>> Shapes.Point = Point; 1->^^^^ @@ -379,10 +373,10 @@ sourceFile:sourceMap-FileWithComments.ts > static origin = new Point(0, 0); > } 4 > -1->Emitted(19, 5) Source(11, 18) + SourceIndex(0) name (Shapes) -2 >Emitted(19, 17) Source(11, 23) + SourceIndex(0) name (Shapes) -3 >Emitted(19, 25) Source(20, 6) + SourceIndex(0) name (Shapes) -4 >Emitted(19, 26) Source(20, 6) + SourceIndex(0) name (Shapes) +1->Emitted(17, 5) Source(11, 18) + SourceIndex(0) name (Shapes) +2 >Emitted(17, 17) Source(11, 23) + SourceIndex(0) name (Shapes) +3 >Emitted(17, 25) Source(20, 6) + SourceIndex(0) name (Shapes) +4 >Emitted(17, 26) Source(20, 6) + SourceIndex(0) name (Shapes) --- >>> // Variable comment after class 1->^^^^ @@ -394,9 +388,9 @@ sourceFile:sourceMap-FileWithComments.ts > 2 > 3 > // Variable comment after class -1->Emitted(20, 5) Source(23, 5) + SourceIndex(0) name (Shapes) -2 >Emitted(20, 5) Source(22, 5) + SourceIndex(0) name (Shapes) -3 >Emitted(20, 36) Source(22, 36) + SourceIndex(0) name (Shapes) +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 >^^^^^^^^ @@ -411,11 +405,11 @@ sourceFile:sourceMap-FileWithComments.ts 3 > = 4 > 10 5 > ; -1 >Emitted(21, 9) Source(23, 9) + SourceIndex(0) name (Shapes) -2 >Emitted(21, 10) Source(23, 10) + SourceIndex(0) name (Shapes) -3 >Emitted(21, 13) Source(23, 13) + SourceIndex(0) name (Shapes) -4 >Emitted(21, 15) Source(23, 15) + SourceIndex(0) name (Shapes) -5 >Emitted(21, 16) Source(23, 16) + SourceIndex(0) name (Shapes) +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->^^^^ @@ -423,7 +417,7 @@ sourceFile:sourceMap-FileWithComments.ts 1-> > > -1->Emitted(22, 5) Source(25, 5) + SourceIndex(0) name (Shapes) +1->Emitted(20, 5) Source(25, 5) + SourceIndex(0) name (Shapes) --- >>> } 1->^^^^ @@ -432,8 +426,8 @@ sourceFile:sourceMap-FileWithComments.ts 1->export function foo() { > 2 > } -1->Emitted(23, 5) Source(26, 5) + SourceIndex(0) name (Shapes.foo) -2 >Emitted(23, 6) Source(26, 6) + SourceIndex(0) name (Shapes.foo) +1->Emitted(21, 5) Source(26, 5) + SourceIndex(0) name (Shapes.foo) +2 >Emitted(21, 6) Source(26, 6) + SourceIndex(0) name (Shapes.foo) --- >>> Shapes.foo = foo; 1->^^^^ @@ -446,10 +440,10 @@ sourceFile:sourceMap-FileWithComments.ts 3 > () { > } 4 > -1->Emitted(24, 5) Source(25, 21) + SourceIndex(0) name (Shapes) -2 >Emitted(24, 15) Source(25, 24) + SourceIndex(0) name (Shapes) -3 >Emitted(24, 21) Source(26, 6) + SourceIndex(0) name (Shapes) -4 >Emitted(24, 22) Source(26, 6) + SourceIndex(0) name (Shapes) +1->Emitted(22, 5) Source(25, 21) + SourceIndex(0) name (Shapes) +2 >Emitted(22, 15) Source(25, 24) + SourceIndex(0) name (Shapes) +3 >Emitted(22, 21) Source(26, 6) + SourceIndex(0) name (Shapes) +4 >Emitted(22, 22) Source(26, 6) + SourceIndex(0) name (Shapes) --- >>> /** comment after function 1->^^^^ @@ -462,8 +456,8 @@ sourceFile:sourceMap-FileWithComments.ts > */ > 2 > -1->Emitted(25, 5) Source(31, 5) + SourceIndex(0) name (Shapes) -2 >Emitted(25, 5) Source(28, 5) + SourceIndex(0) name (Shapes) +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 >>> */ @@ -472,7 +466,7 @@ sourceFile:sourceMap-FileWithComments.ts 1->/** comment after function > * this is another comment > */ -1->Emitted(27, 7) Source(30, 7) + SourceIndex(0) name (Shapes) +1->Emitted(25, 7) Source(30, 7) + SourceIndex(0) name (Shapes) --- >>> var b = 10; 1->^^^^^^^^ @@ -487,11 +481,11 @@ sourceFile:sourceMap-FileWithComments.ts 3 > = 4 > 10 5 > ; -1->Emitted(28, 9) Source(31, 9) + SourceIndex(0) name (Shapes) -2 >Emitted(28, 10) Source(31, 10) + SourceIndex(0) name (Shapes) -3 >Emitted(28, 13) Source(31, 13) + SourceIndex(0) name (Shapes) -4 >Emitted(28, 15) Source(31, 15) + SourceIndex(0) name (Shapes) -5 >Emitted(28, 16) Source(31, 16) + SourceIndex(0) name (Shapes) +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-> @@ -533,13 +527,13 @@ sourceFile:sourceMap-FileWithComments.ts > */ > var b = 10; > } -1->Emitted(29, 1) Source(32, 1) + SourceIndex(0) name (Shapes) -2 >Emitted(29, 2) Source(32, 2) + SourceIndex(0) name (Shapes) -3 >Emitted(29, 4) Source(8, 8) + SourceIndex(0) -4 >Emitted(29, 10) Source(8, 14) + SourceIndex(0) -5 >Emitted(29, 15) Source(8, 8) + SourceIndex(0) -6 >Emitted(29, 21) Source(8, 14) + SourceIndex(0) -7 >Emitted(29, 29) Source(32, 2) + SourceIndex(0) +1->Emitted(27, 1) Source(32, 1) + SourceIndex(0) name (Shapes) +2 >Emitted(27, 2) Source(32, 2) + SourceIndex(0) name (Shapes) +3 >Emitted(27, 4) Source(8, 8) + SourceIndex(0) +4 >Emitted(27, 10) Source(8, 14) + SourceIndex(0) +5 >Emitted(27, 15) Source(8, 8) + SourceIndex(0) +6 >Emitted(27, 21) Source(8, 14) + SourceIndex(0) +7 >Emitted(27, 29) Source(32, 2) + SourceIndex(0) --- >>>/** Local Variable */ 1 > @@ -552,9 +546,9 @@ sourceFile:sourceMap-FileWithComments.ts > 2 > 3 >/** Local Variable */ -1 >Emitted(30, 1) Source(35, 1) + SourceIndex(0) -2 >Emitted(30, 1) Source(34, 1) + SourceIndex(0) -3 >Emitted(30, 22) Source(34, 22) + SourceIndex(0) +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->^^^^ @@ -584,19 +578,19 @@ sourceFile:sourceMap-FileWithComments.ts 11> 4 12> ) 13> ; -1->Emitted(31, 5) Source(35, 5) + SourceIndex(0) -2 >Emitted(31, 6) Source(35, 6) + SourceIndex(0) -3 >Emitted(31, 9) Source(35, 17) + SourceIndex(0) -4 >Emitted(31, 13) Source(35, 21) + SourceIndex(0) -5 >Emitted(31, 19) Source(35, 27) + SourceIndex(0) -6 >Emitted(31, 20) Source(35, 28) + SourceIndex(0) -7 >Emitted(31, 25) Source(35, 33) + SourceIndex(0) -8 >Emitted(31, 26) Source(35, 34) + SourceIndex(0) -9 >Emitted(31, 27) Source(35, 35) + SourceIndex(0) -10>Emitted(31, 29) Source(35, 37) + SourceIndex(0) -11>Emitted(31, 30) Source(35, 38) + SourceIndex(0) -12>Emitted(31, 31) Source(35, 39) + SourceIndex(0) -13>Emitted(31, 32) Source(35, 40) + SourceIndex(0) +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 > @@ -619,14 +613,14 @@ sourceFile:sourceMap-FileWithComments.ts 7 > getDist 8 > () 9 > ; -1 >Emitted(32, 1) Source(36, 1) + SourceIndex(0) -2 >Emitted(32, 5) Source(36, 5) + SourceIndex(0) -3 >Emitted(32, 9) Source(36, 9) + SourceIndex(0) -4 >Emitted(32, 12) Source(36, 12) + SourceIndex(0) -5 >Emitted(32, 13) Source(36, 13) + SourceIndex(0) -6 >Emitted(32, 14) Source(36, 14) + SourceIndex(0) -7 >Emitted(32, 21) Source(36, 21) + SourceIndex(0) -8 >Emitted(32, 23) Source(36, 23) + SourceIndex(0) -9 >Emitted(32, 24) Source(36, 24) + SourceIndex(0) +1 >Emitted(30, 1) Source(36, 1) + SourceIndex(0) +2 >Emitted(30, 5) Source(36, 5) + SourceIndex(0) +3 >Emitted(30, 9) Source(36, 9) + SourceIndex(0) +4 >Emitted(30, 12) Source(36, 12) + SourceIndex(0) +5 >Emitted(30, 13) Source(36, 13) + SourceIndex(0) +6 >Emitted(30, 14) Source(36, 14) + SourceIndex(0) +7 >Emitted(30, 21) Source(36, 21) + SourceIndex(0) +8 >Emitted(30, 23) Source(36, 23) + SourceIndex(0) +9 >Emitted(30, 24) Source(36, 24) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMap-FileWithComments.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js index 33efe0fabec..486cdd39637 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js @@ -9,9 +9,7 @@ var Greeter = (function () { function Greeter() { var _this = this; this.a = 10; - this.returnA = function () { - return _this.a; - }; + this.returnA = function () { return _this.a; }; } return Greeter; })(); diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js.map b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js.map index d085c2f9cc1..b0325217c7a 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js.map +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js.map] -{"version":3,"file":"sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js","sourceRoot":"","sources":["sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.ts"],"names":["Greeter","Greeter.constructor"],"mappings":"AAAA;IAAAA;QAAAC,iBAGCA;QAFUA,MAACA,GAAGA,EAAEA,CAACA;QACPA,YAAOA,GAAGA;mBAAMA,KAAIA,CAACA,CAACA;QAANA,CAAMA,CAACA;IAClCA,CAACA;IAADD,cAACA;AAADA,CAACA,AAHD,IAGC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js","sourceRoot":"","sources":["sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.ts"],"names":["Greeter","Greeter.constructor"],"mappings":"AAAA;IAAAA;QAAAC,iBAGCA;QAFUA,MAACA,GAAGA,EAAEA,CAACA;QACPA,YAAOA,GAAGA,cAAMA,OAAAA,KAAIA,CAACA,CAACA,EAANA,CAAMA,CAACA;IAClCA,CAACA;IAADD,cAACA;AAADA,CAACA,AAHD,IAGC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.sourcemap.txt b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.sourcemap.txt index ff4d526ffcd..555f1c096c2 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.sourcemap.txt @@ -37,7 +37,7 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatemen 3 > ^^^ 4 > ^^ 5 > ^ -6 > ^^^^^^^^^^^^^^^^^-> +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > 2 > a 3 > = @@ -49,43 +49,41 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatemen 4 >Emitted(4, 20) Source(2, 18) + SourceIndex(0) name (Greeter.constructor) 5 >Emitted(4, 21) Source(2, 19) + SourceIndex(0) name (Greeter.constructor) --- ->>> this.returnA = function () { +>>> this.returnA = function () { return _this.a; }; 1->^^^^^^^^ 2 > ^^^^^^^^^^^^ 3 > ^^^ -4 > ^^^^^-> +4 > ^^^^^^^^^^^^^^ +5 > ^^^^^^^ +6 > ^^^^^ +7 > ^ +8 > ^ +9 > ^^ +10> ^ +11> ^ 1-> > public 2 > returnA 3 > = +4 > () => +5 > +6 > this +7 > . +8 > a +9 > +10> this.a +11> ; 1->Emitted(5, 9) Source(3, 12) + SourceIndex(0) name (Greeter.constructor) 2 >Emitted(5, 21) Source(3, 19) + SourceIndex(0) name (Greeter.constructor) 3 >Emitted(5, 24) Source(3, 22) + SourceIndex(0) name (Greeter.constructor) ---- ->>> return _this.a; -1->^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^ -3 > ^ -4 > ^ -1->() => -2 > this -3 > . -4 > a -1->Emitted(6, 20) Source(3, 28) + SourceIndex(0) name (Greeter.constructor) -2 >Emitted(6, 25) Source(3, 32) + SourceIndex(0) name (Greeter.constructor) -3 >Emitted(6, 26) Source(3, 33) + SourceIndex(0) name (Greeter.constructor) -4 >Emitted(6, 27) Source(3, 34) + SourceIndex(0) name (Greeter.constructor) ---- ->>> }; -1 >^^^^^^^^ -2 > ^ -3 > ^ -1 > -2 > this.a -3 > ; -1 >Emitted(7, 9) Source(3, 28) + SourceIndex(0) name (Greeter.constructor) -2 >Emitted(7, 10) Source(3, 34) + SourceIndex(0) name (Greeter.constructor) -3 >Emitted(7, 11) Source(3, 35) + SourceIndex(0) name (Greeter.constructor) +4 >Emitted(5, 38) Source(3, 28) + SourceIndex(0) name (Greeter.constructor) +5 >Emitted(5, 45) Source(3, 28) + SourceIndex(0) name (Greeter.constructor) +6 >Emitted(5, 50) Source(3, 32) + SourceIndex(0) name (Greeter.constructor) +7 >Emitted(5, 51) Source(3, 33) + SourceIndex(0) name (Greeter.constructor) +8 >Emitted(5, 52) Source(3, 34) + SourceIndex(0) name (Greeter.constructor) +9 >Emitted(5, 54) Source(3, 28) + SourceIndex(0) name (Greeter.constructor) +10>Emitted(5, 55) Source(3, 34) + SourceIndex(0) name (Greeter.constructor) +11>Emitted(5, 56) Source(3, 35) + SourceIndex(0) name (Greeter.constructor) --- >>> } 1 >^^^^ @@ -94,16 +92,16 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatemen 1 > > 2 > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) name (Greeter.constructor) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) name (Greeter.constructor) +1 >Emitted(6, 5) Source(4, 1) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) name (Greeter.constructor) --- >>> return Greeter; 1->^^^^ 2 > ^^^^^^^^^^^^^^ 1-> 2 > } -1->Emitted(9, 5) Source(4, 1) + SourceIndex(0) name (Greeter) -2 >Emitted(9, 19) Source(4, 2) + SourceIndex(0) name (Greeter) +1->Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (Greeter) +2 >Emitted(7, 19) Source(4, 2) + SourceIndex(0) name (Greeter) --- >>>})(); 1 > @@ -118,9 +116,9 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatemen > public a = 10; > public returnA = () => this.a; > } -1 >Emitted(10, 1) Source(4, 1) + SourceIndex(0) name (Greeter) -2 >Emitted(10, 2) Source(4, 2) + SourceIndex(0) name (Greeter) -3 >Emitted(10, 2) Source(1, 1) + SourceIndex(0) -4 >Emitted(10, 6) Source(4, 2) + SourceIndex(0) +1 >Emitted(8, 1) Source(4, 1) + SourceIndex(0) name (Greeter) +2 >Emitted(8, 2) Source(4, 2) + SourceIndex(0) name (Greeter) +3 >Emitted(8, 2) Source(1, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDecorators.js b/tests/baselines/reference/sourceMapValidationDecorators.js index 81ce9bc60ff..5577a6967cd 100644 --- a/tests/baselines/reference/sourceMapValidationDecorators.js +++ b/tests/baselines/reference/sourceMapValidationDecorators.js @@ -55,19 +55,14 @@ class Greeter { } //// [sourceMapValidationDecorators.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; +var __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } }; var Greeter = (function () { function Greeter(greeting) { var b = []; @@ -93,15 +88,39 @@ var Greeter = (function () { configurable: true }); Greeter.x1 = 10; - Object.defineProperty(Greeter.prototype, "greet", __decorate([PropertyDecorator1, PropertyDecorator2(40)], Greeter.prototype, "greet", Object.getOwnPropertyDescriptor(Greeter.prototype, "greet"))); - __decorate([PropertyDecorator1, PropertyDecorator2(50)], Greeter.prototype, "x"); - __decorate([ParameterDecorator1, ParameterDecorator2(70)], Greeter.prototype, "fn", 0); - __decorate([ParameterDecorator1, ParameterDecorator2(90)], Greeter.prototype, "greetings", 0); - Object.defineProperty(Greeter.prototype, "greetings", __decorate([PropertyDecorator1, PropertyDecorator2(80)], Greeter.prototype, "greetings", Object.getOwnPropertyDescriptor(Greeter.prototype, "greetings"))); - __decorate([PropertyDecorator1, PropertyDecorator2(60)], Greeter, "x1"); - __decorate([ParameterDecorator1, ParameterDecorator2(20)], Greeter, void 0, 0); - __decorate([ParameterDecorator1, ParameterDecorator2(30)], Greeter, void 0, 1); - Greeter = __decorate([ClassDecorator1, ClassDecorator2(10)], Greeter); + Object.defineProperty(Greeter.prototype, "greet", + __decorate([ + PropertyDecorator1, + PropertyDecorator2(40) + ], Greeter.prototype, "greet", Object.getOwnPropertyDescriptor(Greeter.prototype, "greet"))); + __decorate([ + PropertyDecorator1, + PropertyDecorator2(50) + ], Greeter.prototype, "x"); + Object.defineProperty(Greeter.prototype, "fn", + __decorate([ + __param(0, ParameterDecorator1), + __param(0, ParameterDecorator2(70)) + ], Greeter.prototype, "fn", Object.getOwnPropertyDescriptor(Greeter.prototype, "fn"))); + Object.defineProperty(Greeter.prototype, "greetings", + __decorate([ + PropertyDecorator1, + PropertyDecorator2(80), + __param(0, ParameterDecorator1), + __param(0, ParameterDecorator2(90)) + ], Greeter.prototype, "greetings", Object.getOwnPropertyDescriptor(Greeter.prototype, "greetings"))); + __decorate([ + PropertyDecorator1, + PropertyDecorator2(60) + ], Greeter, "x1"); + Greeter = __decorate([ + ClassDecorator1, + ClassDecorator2(10), + __param(0, ParameterDecorator1), + __param(0, ParameterDecorator2(20)), + __param(1, ParameterDecorator1), + __param(1, ParameterDecorator2(30)) + ], Greeter); return Greeter; })(); //# sourceMappingURL=sourceMapValidationDecorators.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDecorators.js.map b/tests/baselines/reference/sourceMapValidationDecorators.js.map index 4cca04a1e3c..84ebad316fa 100644 --- a/tests/baselines/reference/sourceMapValidationDecorators.js.map +++ b/tests/baselines/reference/sourceMapValidationDecorators.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDecorators.js.map] -{"version":3,"file":"sourceMapValidationDecorators.js","sourceRoot":"","sources":["sourceMapValidationDecorators.ts"],"names":["Greeter","Greeter.constructor","Greeter.greet","Greeter.fn","Greeter.greetings"],"mappings":";;;;;;;;;;;;;AAOA;IAGIA,iBAGSA,QAAgBA;QAEvBC,WAEcA;aAFdA,WAEcA,CAFdA,sBAEcA,CAFdA,IAEcA;YAFdA,0BAEcA;;QAJPA,aAAQA,GAARA,QAAQA,CAAQA;IAKzBA,CAACA;IAIDD,uBAAKA,GAFLA;QAGIE,MAAMA,CAACA,MAAMA,GAAGA,IAAIA,CAACA,QAAQA,GAAGA,OAAOA,CAACA;IAC5CA,CAACA;IAUOF,oBAAEA,GAAVA,UAGEA,CAASA;QACPG,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;IACzBA,CAACA;IAEDH,sBAEIA,8BAASA;aAFbA;YAGII,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;QACzBA,CAACA;aAEDJ,UAGEA,SAAiBA;YACfI,IAAIA,CAACA,QAAQA,GAAGA,SAASA,CAACA;QAC9BA,CAACA;;;OAPAJ;IAbcA,UAAEA,GAAWA,EAAEA,CAACA;IAZ/BA,sBAEAA,0BAAKA,cAFJA,kBAAkBA,EAClBA,kBAAkBA,CAACA,EAAEA,CAACA,GACvBA,0BAAKA,kCAALA,0BAAKA,IAEJA;IAEDA,YAACA,kBAAkBA,EAClBA,kBAAkBA,CAACA,EAAEA,CAACA,GACfA,sBAACA,EAASA;IAOhBA,YAACA,mBAAmBA,EACnBA,mBAAmBA,CAACA,EAAEA,CAACA,GACxBA,0BAACA,EAAQA;IAWTA,YAACA,mBAAmBA,EACnBA,mBAAmBA,CAACA,EAAEA,CAACA,GACxBA,iCAASA,EAAQA;IATnBA,sBAEIA,8BAASA,cAFZA,kBAAkBA,EAClBA,kBAAkBA,CAACA,EAAEA,CAACA,GACnBA,8BAASA,kCAATA,8BAASA,IAEZA;IAfDA,YAACA,kBAAkBA,EAClBA,kBAAkBA,CAACA,EAAEA,CAACA,GACRA,aAAEA,EAAcA;IArB7BA,YAACA,mBAAmBA,EACnBA,mBAAmBA,CAACA,EAAEA,CAACA,GACjBA,kBAAQA,EAAQA;IAEvBA,YAACA,mBAAmBA,EACnBA,mBAAmBA,CAACA,EAAEA,CAACA,GACrBA,kBAACA,EAAUA;IAVpBA,sBAACA,eAAeA,EACfA,eAAeA,CAACA,EAAEA,CAACA,YA6CnBA;IAADA,cAACA;AAADA,CAACA,AA9CD,IA8CC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDecorators.js","sourceRoot":"","sources":["sourceMapValidationDecorators.ts"],"names":["Greeter","Greeter.constructor","Greeter.greet","Greeter.fn","Greeter.greetings"],"mappings":";;;;;;;;AAOA;IAGIA,iBAGSA,QAAgBA;QAEvBC,WAEcA;aAFdA,WAEcA,CAFdA,sBAEcA,CAFdA,IAEcA;YAFdA,0BAEcA;;QAJPA,aAAQA,GAARA,QAAQA,CAAQA;IAKzBA,CAACA;IAIDD,uBAAKA,GAFLA;QAGIE,MAAMA,CAACA,MAAMA,GAAGA,IAAIA,CAACA,QAAQA,GAAGA,OAAOA,CAACA;IAC5CA,CAACA;IAUOF,oBAAEA,GAAVA,UAGEA,CAASA;QACPG,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;IACzBA,CAACA;IAEDH,sBAEIA,8BAASA;aAFbA;YAGII,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;QACzBA,CAACA;aAEDJ,UAGEA,SAAiBA;YACfI,IAAIA,CAACA,QAAQA,GAAGA,SAASA,CAACA;QAC9BA,CAACA;;;OAPAJ;IAbcA,UAAEA,GAAWA,EAAEA,CAACA;IAZ/BA,sBAEAA,0BAAKA;;YAFJA,kBAAkBA;YAClBA,kBAAkBA,CAACA,EAAEA,CAACA;WACvBA,0BAAKA,kCAALA,0BAAKA,IAEJA;IAEDA;QAACA,kBAAkBA;QAClBA,kBAAkBA,CAACA,EAAEA,CAACA;OACfA,sBAACA,EAASA;IAMlBA,sBAAQA,uBAAEA;;YACRA,WAACA,mBAAmBA,CAAAA;YACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;WAFlBA,uBAAEA,kCAAFA,uBAAEA,IAKTA;IAEDA,sBAEIA,8BAASA;;YAFZA,kBAAkBA;YAClBA,kBAAkBA,CAACA,EAAEA,CAACA;YAMrBA,WAACA,mBAAmBA,CAAAA;YACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;WANtBA,8BAASA,kCAATA,8BAASA,IAEZA;IAfDA;QAACA,kBAAkBA;QAClBA,kBAAkBA,CAACA,EAAEA,CAACA;OACRA,aAAEA,EAAcA;IAzBnCA;QAACA,eAAeA;QACfA,eAAeA,CAACA,EAAEA,CAACA;QAGdA,WAACA,mBAAmBA,CAAAA;QACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;QAGxBA,WAACA,mBAAmBA,CAAAA;QACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;gBAqC7BA;IAADA,cAACA;AAADA,CAACA,AA9CD,IA8CC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt index c0b9d97e6f0..f4c64c49579 100644 --- a/tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt @@ -8,19 +8,14 @@ sources: sourceMapValidationDecorators.ts emittedFile:tests/cases/compiler/sourceMapValidationDecorators.js sourceFile:sourceMapValidationDecorators.ts ------------------------------------------------------------------- ->>>var __decorate = this.__decorate || function (decorators, target, key, value) { ->>> var kind = typeof (arguments.length == 2 ? value = target : value); ->>> for (var i = decorators.length - 1; i >= 0; --i) { ->>> var decorator = decorators[i]; ->>> switch (kind) { ->>> case "function": value = decorator(value) || value; break; ->>> case "number": decorator(target, key, value); break; ->>> case "undefined": decorator(target, key); break; ->>> case "object": value = decorator(target, key, value) || value; break; ->>> } +>>>var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +>>> switch (arguments.length) { +>>> case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); +>>> case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); +>>> case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); >>> } ->>> return value; >>>}; +>>>var __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } }; >>>var Greeter = (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> @@ -32,7 +27,7 @@ sourceFile:sourceMapValidationDecorators.ts >declare function ParameterDecorator2(x: number): (target: Function, key: string | symbol, paramIndex: number) => void; > > -1 >Emitted(14, 1) Source(8, 1) + SourceIndex(0) +1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) --- >>> function Greeter(greeting) { 1->^^^^ @@ -47,9 +42,9 @@ sourceFile:sourceMapValidationDecorators.ts > @ParameterDecorator2(20) > public 3 > greeting: string -1->Emitted(15, 5) Source(11, 5) + SourceIndex(0) name (Greeter) -2 >Emitted(15, 22) Source(14, 14) + SourceIndex(0) name (Greeter) -3 >Emitted(15, 30) Source(14, 30) + SourceIndex(0) name (Greeter) +1->Emitted(10, 5) Source(11, 5) + SourceIndex(0) name (Greeter) +2 >Emitted(10, 22) Source(14, 14) + SourceIndex(0) name (Greeter) +3 >Emitted(10, 30) Source(14, 30) + SourceIndex(0) name (Greeter) --- >>> var b = []; 1 >^^^^^^^^ @@ -61,8 +56,8 @@ sourceFile:sourceMapValidationDecorators.ts 2 > @ParameterDecorator1 > @ParameterDecorator2(30) > ...b: string[] -1 >Emitted(16, 9) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) -2 >Emitted(16, 20) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) +1 >Emitted(11, 9) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(11, 20) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) --- >>> for (var _i = 1; _i < arguments.length; _i++) { 1->^^^^^^^^^^^^^ @@ -83,12 +78,12 @@ sourceFile:sourceMapValidationDecorators.ts 6 > @ParameterDecorator1 > @ParameterDecorator2(30) > ...b: string[] -1->Emitted(17, 14) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) -2 >Emitted(17, 25) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) -3 >Emitted(17, 26) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) -4 >Emitted(17, 48) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) -5 >Emitted(17, 49) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) -6 >Emitted(17, 53) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) +1->Emitted(12, 14) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(12, 25) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) +3 >Emitted(12, 26) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) +4 >Emitted(12, 48) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) +5 >Emitted(12, 49) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) +6 >Emitted(12, 53) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) --- >>> b[_i - 1] = arguments[_i]; 1 >^^^^^^^^^^^^ @@ -97,8 +92,8 @@ sourceFile:sourceMapValidationDecorators.ts 2 > @ParameterDecorator1 > @ParameterDecorator2(30) > ...b: string[] -1 >Emitted(18, 13) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) -2 >Emitted(18, 39) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) +1 >Emitted(13, 13) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(13, 39) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) --- >>> } >>> this.greeting = greeting; @@ -112,11 +107,11 @@ sourceFile:sourceMapValidationDecorators.ts 3 > 4 > greeting 5 > : string -1 >Emitted(20, 9) Source(14, 14) + SourceIndex(0) name (Greeter.constructor) -2 >Emitted(20, 22) Source(14, 22) + SourceIndex(0) name (Greeter.constructor) -3 >Emitted(20, 25) Source(14, 14) + SourceIndex(0) name (Greeter.constructor) -4 >Emitted(20, 33) Source(14, 22) + SourceIndex(0) name (Greeter.constructor) -5 >Emitted(20, 34) Source(14, 30) + SourceIndex(0) name (Greeter.constructor) +1 >Emitted(15, 9) Source(14, 14) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(15, 22) Source(14, 22) + SourceIndex(0) name (Greeter.constructor) +3 >Emitted(15, 25) Source(14, 14) + SourceIndex(0) name (Greeter.constructor) +4 >Emitted(15, 33) Source(14, 22) + SourceIndex(0) name (Greeter.constructor) +5 >Emitted(15, 34) Source(14, 30) + SourceIndex(0) name (Greeter.constructor) --- >>> } 1 >^^^^ @@ -129,8 +124,8 @@ sourceFile:sourceMapValidationDecorators.ts > ...b: string[]) { > 2 > } -1 >Emitted(21, 5) Source(19, 5) + SourceIndex(0) name (Greeter.constructor) -2 >Emitted(21, 6) Source(19, 6) + SourceIndex(0) name (Greeter.constructor) +1 >Emitted(16, 5) Source(19, 5) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(16, 6) Source(19, 6) + SourceIndex(0) name (Greeter.constructor) --- >>> Greeter.prototype.greet = function () { 1->^^^^ @@ -144,9 +139,9 @@ sourceFile:sourceMapValidationDecorators.ts > 2 > greet 3 > -1->Emitted(22, 5) Source(23, 5) + SourceIndex(0) name (Greeter) -2 >Emitted(22, 28) Source(23, 10) + SourceIndex(0) name (Greeter) -3 >Emitted(22, 31) Source(21, 5) + SourceIndex(0) name (Greeter) +1->Emitted(17, 5) Source(23, 5) + SourceIndex(0) name (Greeter) +2 >Emitted(17, 28) Source(23, 10) + SourceIndex(0) name (Greeter) +3 >Emitted(17, 31) Source(21, 5) + SourceIndex(0) name (Greeter) --- >>> return "

" + this.greeting + "

"; 1->^^^^^^^^ @@ -174,17 +169,17 @@ sourceFile:sourceMapValidationDecorators.ts 9 > + 10> "" 11> ; -1->Emitted(23, 9) Source(24, 9) + SourceIndex(0) name (Greeter.greet) -2 >Emitted(23, 15) Source(24, 15) + SourceIndex(0) name (Greeter.greet) -3 >Emitted(23, 16) Source(24, 16) + SourceIndex(0) name (Greeter.greet) -4 >Emitted(23, 22) Source(24, 22) + SourceIndex(0) name (Greeter.greet) -5 >Emitted(23, 25) Source(24, 25) + SourceIndex(0) name (Greeter.greet) -6 >Emitted(23, 29) Source(24, 29) + SourceIndex(0) name (Greeter.greet) -7 >Emitted(23, 30) Source(24, 30) + SourceIndex(0) name (Greeter.greet) -8 >Emitted(23, 38) Source(24, 38) + SourceIndex(0) name (Greeter.greet) -9 >Emitted(23, 41) Source(24, 41) + SourceIndex(0) name (Greeter.greet) -10>Emitted(23, 48) Source(24, 48) + SourceIndex(0) name (Greeter.greet) -11>Emitted(23, 49) Source(24, 49) + SourceIndex(0) name (Greeter.greet) +1->Emitted(18, 9) Source(24, 9) + SourceIndex(0) name (Greeter.greet) +2 >Emitted(18, 15) Source(24, 15) + SourceIndex(0) name (Greeter.greet) +3 >Emitted(18, 16) Source(24, 16) + SourceIndex(0) name (Greeter.greet) +4 >Emitted(18, 22) Source(24, 22) + SourceIndex(0) name (Greeter.greet) +5 >Emitted(18, 25) Source(24, 25) + SourceIndex(0) name (Greeter.greet) +6 >Emitted(18, 29) Source(24, 29) + SourceIndex(0) name (Greeter.greet) +7 >Emitted(18, 30) Source(24, 30) + SourceIndex(0) name (Greeter.greet) +8 >Emitted(18, 38) Source(24, 38) + SourceIndex(0) name (Greeter.greet) +9 >Emitted(18, 41) Source(24, 41) + SourceIndex(0) name (Greeter.greet) +10>Emitted(18, 48) Source(24, 48) + SourceIndex(0) name (Greeter.greet) +11>Emitted(18, 49) Source(24, 49) + SourceIndex(0) name (Greeter.greet) --- >>> }; 1 >^^^^ @@ -193,8 +188,8 @@ sourceFile:sourceMapValidationDecorators.ts 1 > > 2 > } -1 >Emitted(24, 5) Source(25, 5) + SourceIndex(0) name (Greeter.greet) -2 >Emitted(24, 6) Source(25, 6) + SourceIndex(0) name (Greeter.greet) +1 >Emitted(19, 5) Source(25, 5) + SourceIndex(0) name (Greeter.greet) +2 >Emitted(19, 6) Source(25, 6) + SourceIndex(0) name (Greeter.greet) --- >>> Greeter.prototype.fn = function (x) { 1->^^^^ @@ -220,11 +215,11 @@ sourceFile:sourceMapValidationDecorators.ts > @ParameterDecorator2(70) > 5 > x: number -1->Emitted(25, 5) Source(35, 13) + SourceIndex(0) name (Greeter) -2 >Emitted(25, 25) Source(35, 15) + SourceIndex(0) name (Greeter) -3 >Emitted(25, 28) Source(35, 5) + SourceIndex(0) name (Greeter) -4 >Emitted(25, 38) Source(38, 7) + SourceIndex(0) name (Greeter) -5 >Emitted(25, 39) Source(38, 16) + SourceIndex(0) name (Greeter) +1->Emitted(20, 5) Source(35, 13) + SourceIndex(0) name (Greeter) +2 >Emitted(20, 25) Source(35, 15) + SourceIndex(0) name (Greeter) +3 >Emitted(20, 28) Source(35, 5) + SourceIndex(0) name (Greeter) +4 >Emitted(20, 38) Source(38, 7) + SourceIndex(0) name (Greeter) +5 >Emitted(20, 39) Source(38, 16) + SourceIndex(0) name (Greeter) --- >>> return this.greeting; 1 >^^^^^^^^ @@ -242,13 +237,13 @@ sourceFile:sourceMapValidationDecorators.ts 5 > . 6 > greeting 7 > ; -1 >Emitted(26, 9) Source(39, 9) + SourceIndex(0) name (Greeter.fn) -2 >Emitted(26, 15) Source(39, 15) + SourceIndex(0) name (Greeter.fn) -3 >Emitted(26, 16) Source(39, 16) + SourceIndex(0) name (Greeter.fn) -4 >Emitted(26, 20) Source(39, 20) + SourceIndex(0) name (Greeter.fn) -5 >Emitted(26, 21) Source(39, 21) + SourceIndex(0) name (Greeter.fn) -6 >Emitted(26, 29) Source(39, 29) + SourceIndex(0) name (Greeter.fn) -7 >Emitted(26, 30) Source(39, 30) + SourceIndex(0) name (Greeter.fn) +1 >Emitted(21, 9) Source(39, 9) + SourceIndex(0) name (Greeter.fn) +2 >Emitted(21, 15) Source(39, 15) + SourceIndex(0) name (Greeter.fn) +3 >Emitted(21, 16) Source(39, 16) + SourceIndex(0) name (Greeter.fn) +4 >Emitted(21, 20) Source(39, 20) + SourceIndex(0) name (Greeter.fn) +5 >Emitted(21, 21) Source(39, 21) + SourceIndex(0) name (Greeter.fn) +6 >Emitted(21, 29) Source(39, 29) + SourceIndex(0) name (Greeter.fn) +7 >Emitted(21, 30) Source(39, 30) + SourceIndex(0) name (Greeter.fn) --- >>> }; 1 >^^^^ @@ -257,8 +252,8 @@ sourceFile:sourceMapValidationDecorators.ts 1 > > 2 > } -1 >Emitted(27, 5) Source(40, 5) + SourceIndex(0) name (Greeter.fn) -2 >Emitted(27, 6) Source(40, 6) + SourceIndex(0) name (Greeter.fn) +1 >Emitted(22, 5) Source(40, 5) + SourceIndex(0) name (Greeter.fn) +2 >Emitted(22, 6) Source(40, 6) + SourceIndex(0) name (Greeter.fn) --- >>> Object.defineProperty(Greeter.prototype, "greetings", { 1->^^^^ @@ -271,15 +266,15 @@ sourceFile:sourceMapValidationDecorators.ts > @PropertyDecorator2(80) > get 3 > greetings -1->Emitted(28, 5) Source(42, 5) + SourceIndex(0) name (Greeter) -2 >Emitted(28, 27) Source(44, 9) + SourceIndex(0) name (Greeter) -3 >Emitted(28, 57) Source(44, 18) + SourceIndex(0) name (Greeter) +1->Emitted(23, 5) Source(42, 5) + SourceIndex(0) name (Greeter) +2 >Emitted(23, 27) Source(44, 9) + SourceIndex(0) name (Greeter) +3 >Emitted(23, 57) Source(44, 18) + SourceIndex(0) name (Greeter) --- >>> get: function () { 1 >^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^-> 1 > -1 >Emitted(29, 14) Source(42, 5) + SourceIndex(0) name (Greeter) +1 >Emitted(24, 14) Source(42, 5) + SourceIndex(0) name (Greeter) --- >>> return this.greeting; 1->^^^^^^^^^^^^ @@ -299,13 +294,13 @@ sourceFile:sourceMapValidationDecorators.ts 5 > . 6 > greeting 7 > ; -1->Emitted(30, 13) Source(45, 9) + SourceIndex(0) name (Greeter.greetings) -2 >Emitted(30, 19) Source(45, 15) + SourceIndex(0) name (Greeter.greetings) -3 >Emitted(30, 20) Source(45, 16) + SourceIndex(0) name (Greeter.greetings) -4 >Emitted(30, 24) Source(45, 20) + SourceIndex(0) name (Greeter.greetings) -5 >Emitted(30, 25) Source(45, 21) + SourceIndex(0) name (Greeter.greetings) -6 >Emitted(30, 33) Source(45, 29) + SourceIndex(0) name (Greeter.greetings) -7 >Emitted(30, 34) Source(45, 30) + SourceIndex(0) name (Greeter.greetings) +1->Emitted(25, 13) Source(45, 9) + SourceIndex(0) name (Greeter.greetings) +2 >Emitted(25, 19) Source(45, 15) + SourceIndex(0) name (Greeter.greetings) +3 >Emitted(25, 20) Source(45, 16) + SourceIndex(0) name (Greeter.greetings) +4 >Emitted(25, 24) Source(45, 20) + SourceIndex(0) name (Greeter.greetings) +5 >Emitted(25, 25) Source(45, 21) + SourceIndex(0) name (Greeter.greetings) +6 >Emitted(25, 33) Source(45, 29) + SourceIndex(0) name (Greeter.greetings) +7 >Emitted(25, 34) Source(45, 30) + SourceIndex(0) name (Greeter.greetings) --- >>> }, 1 >^^^^^^^^ @@ -314,8 +309,8 @@ sourceFile:sourceMapValidationDecorators.ts 1 > > 2 > } -1 >Emitted(31, 9) Source(46, 5) + SourceIndex(0) name (Greeter.greetings) -2 >Emitted(31, 10) Source(46, 6) + SourceIndex(0) name (Greeter.greetings) +1 >Emitted(26, 9) Source(46, 5) + SourceIndex(0) name (Greeter.greetings) +2 >Emitted(26, 10) Source(46, 6) + SourceIndex(0) name (Greeter.greetings) --- >>> set: function (greetings) { 1->^^^^^^^^^^^^^ @@ -330,9 +325,9 @@ sourceFile:sourceMapValidationDecorators.ts > @ParameterDecorator2(90) > 3 > greetings: string -1->Emitted(32, 14) Source(48, 5) + SourceIndex(0) name (Greeter) -2 >Emitted(32, 24) Source(51, 7) + SourceIndex(0) name (Greeter) -3 >Emitted(32, 33) Source(51, 24) + SourceIndex(0) name (Greeter) +1->Emitted(27, 14) Source(48, 5) + SourceIndex(0) name (Greeter) +2 >Emitted(27, 24) Source(51, 7) + SourceIndex(0) name (Greeter) +3 >Emitted(27, 33) Source(51, 24) + SourceIndex(0) name (Greeter) --- >>> this.greeting = greetings; 1->^^^^^^^^^^^^ @@ -350,13 +345,13 @@ sourceFile:sourceMapValidationDecorators.ts 5 > = 6 > greetings 7 > ; -1->Emitted(33, 13) Source(52, 9) + SourceIndex(0) name (Greeter.greetings) -2 >Emitted(33, 17) Source(52, 13) + SourceIndex(0) name (Greeter.greetings) -3 >Emitted(33, 18) Source(52, 14) + SourceIndex(0) name (Greeter.greetings) -4 >Emitted(33, 26) Source(52, 22) + SourceIndex(0) name (Greeter.greetings) -5 >Emitted(33, 29) Source(52, 25) + SourceIndex(0) name (Greeter.greetings) -6 >Emitted(33, 38) Source(52, 34) + SourceIndex(0) name (Greeter.greetings) -7 >Emitted(33, 39) Source(52, 35) + SourceIndex(0) name (Greeter.greetings) +1->Emitted(28, 13) Source(52, 9) + SourceIndex(0) name (Greeter.greetings) +2 >Emitted(28, 17) Source(52, 13) + SourceIndex(0) name (Greeter.greetings) +3 >Emitted(28, 18) Source(52, 14) + SourceIndex(0) name (Greeter.greetings) +4 >Emitted(28, 26) Source(52, 22) + SourceIndex(0) name (Greeter.greetings) +5 >Emitted(28, 29) Source(52, 25) + SourceIndex(0) name (Greeter.greetings) +6 >Emitted(28, 38) Source(52, 34) + SourceIndex(0) name (Greeter.greetings) +7 >Emitted(28, 39) Source(52, 35) + SourceIndex(0) name (Greeter.greetings) --- >>> }, 1 >^^^^^^^^ @@ -365,8 +360,8 @@ sourceFile:sourceMapValidationDecorators.ts 1 > > 2 > } -1 >Emitted(34, 9) Source(53, 5) + SourceIndex(0) name (Greeter.greetings) -2 >Emitted(34, 10) Source(53, 6) + SourceIndex(0) name (Greeter.greetings) +1 >Emitted(29, 9) Source(53, 5) + SourceIndex(0) name (Greeter.greetings) +2 >Emitted(29, 10) Source(53, 6) + SourceIndex(0) name (Greeter.greetings) --- >>> enumerable: true, >>> configurable: true @@ -374,7 +369,7 @@ sourceFile:sourceMapValidationDecorators.ts 1->^^^^^^^ 2 > ^^^^^^^^^^^^^^-> 1-> -1->Emitted(37, 8) Source(46, 6) + SourceIndex(0) name (Greeter) +1->Emitted(32, 8) Source(46, 6) + SourceIndex(0) name (Greeter) --- >>> Greeter.x1 = 10; 1->^^^^ @@ -382,170 +377,508 @@ sourceFile:sourceMapValidationDecorators.ts 3 > ^^^ 4 > ^^ 5 > ^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> 2 > x1 3 > : number = 4 > 10 5 > ; -1->Emitted(38, 5) Source(33, 20) + SourceIndex(0) name (Greeter) -2 >Emitted(38, 15) Source(33, 22) + SourceIndex(0) name (Greeter) -3 >Emitted(38, 18) Source(33, 33) + SourceIndex(0) name (Greeter) -4 >Emitted(38, 20) Source(33, 35) + SourceIndex(0) name (Greeter) -5 >Emitted(38, 21) Source(33, 36) + SourceIndex(0) name (Greeter) +1->Emitted(33, 5) Source(33, 20) + SourceIndex(0) name (Greeter) +2 >Emitted(33, 15) Source(33, 22) + SourceIndex(0) name (Greeter) +3 >Emitted(33, 18) Source(33, 33) + SourceIndex(0) name (Greeter) +4 >Emitted(33, 20) Source(33, 35) + SourceIndex(0) name (Greeter) +5 >Emitted(33, 21) Source(33, 36) + SourceIndex(0) name (Greeter) --- ->>> Object.defineProperty(Greeter.prototype, "greet", __decorate([PropertyDecorator1, PropertyDecorator2(40)], Greeter.prototype, "greet", Object.getOwnPropertyDescriptor(Greeter.prototype, "greet"))); +>>> Object.defineProperty(Greeter.prototype, "greet", 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^ 3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ -4 > ^^^^^^^^^^^^^^ -5 > ^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^ -8 > ^ -9 > ^^ -10> ^ -11> ^^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^ -13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^ -15> ^^^^ 1-> 2 > @PropertyDecorator1 > @PropertyDecorator2(40) > 3 > greet -4 > -5 > PropertyDecorator1 -6 > - > @ -7 > PropertyDecorator2 -8 > ( -9 > 40 -10> ) -11> - > -12> greet -13> -14> greet -15> () { - > return "

" + this.greeting + "

"; - > } -1->Emitted(39, 5) Source(21, 5) + SourceIndex(0) name (Greeter) -2 >Emitted(39, 27) Source(23, 5) + SourceIndex(0) name (Greeter) -3 >Emitted(39, 53) Source(23, 10) + SourceIndex(0) name (Greeter) -4 >Emitted(39, 67) Source(21, 6) + SourceIndex(0) name (Greeter) -5 >Emitted(39, 85) Source(21, 24) + SourceIndex(0) name (Greeter) -6 >Emitted(39, 87) Source(22, 6) + SourceIndex(0) name (Greeter) -7 >Emitted(39, 105) Source(22, 24) + SourceIndex(0) name (Greeter) -8 >Emitted(39, 106) Source(22, 25) + SourceIndex(0) name (Greeter) -9 >Emitted(39, 108) Source(22, 27) + SourceIndex(0) name (Greeter) -10>Emitted(39, 109) Source(22, 28) + SourceIndex(0) name (Greeter) -11>Emitted(39, 112) Source(23, 5) + SourceIndex(0) name (Greeter) -12>Emitted(39, 138) Source(23, 10) + SourceIndex(0) name (Greeter) -13>Emitted(39, 172) Source(23, 5) + SourceIndex(0) name (Greeter) -14>Emitted(39, 198) Source(23, 10) + SourceIndex(0) name (Greeter) -15>Emitted(39, 202) Source(25, 6) + SourceIndex(0) name (Greeter) +1->Emitted(34, 5) Source(21, 5) + SourceIndex(0) name (Greeter) +2 >Emitted(34, 27) Source(23, 5) + SourceIndex(0) name (Greeter) +3 >Emitted(34, 53) Source(23, 10) + SourceIndex(0) name (Greeter) --- ->>> __decorate([PropertyDecorator1, PropertyDecorator2(50)], Greeter.prototype, "x"); +>>> __decorate([ +>>> PropertyDecorator1, +1 >^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^^^^-> +1 > +2 > PropertyDecorator1 +1 >Emitted(36, 13) Source(21, 6) + SourceIndex(0) name (Greeter) +2 >Emitted(36, 31) Source(21, 24) + SourceIndex(0) name (Greeter) +--- +>>> PropertyDecorator2(40) +1->^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > @ +2 > PropertyDecorator2 +3 > ( +4 > 40 +5 > ) +1->Emitted(37, 13) Source(22, 6) + SourceIndex(0) name (Greeter) +2 >Emitted(37, 31) Source(22, 24) + SourceIndex(0) name (Greeter) +3 >Emitted(37, 32) Source(22, 25) + SourceIndex(0) name (Greeter) +4 >Emitted(37, 34) Source(22, 27) + SourceIndex(0) name (Greeter) +5 >Emitted(37, 35) Source(22, 28) + SourceIndex(0) name (Greeter) +--- +>>> ], Greeter.prototype, "greet", Object.getOwnPropertyDescriptor(Greeter.prototype, "greet"))); +1->^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^^^ +1-> + > +2 > greet +3 > +4 > greet +5 > () { + > return "

" + this.greeting + "

"; + > } +1->Emitted(38, 12) Source(23, 5) + SourceIndex(0) name (Greeter) +2 >Emitted(38, 38) Source(23, 10) + SourceIndex(0) name (Greeter) +3 >Emitted(38, 72) Source(23, 5) + SourceIndex(0) name (Greeter) +4 >Emitted(38, 98) Source(23, 10) + SourceIndex(0) name (Greeter) +5 >Emitted(38, 102) Source(25, 6) + SourceIndex(0) name (Greeter) +--- +>>> __decorate([ 1 >^^^^ -2 > ^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^ -4 > ^^ -5 > ^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^^ -8 > ^ -9 > ^^^ -10> ^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^-> +2 > ^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > > -2 > @ -3 > PropertyDecorator1 -4 > - > @ -5 > PropertyDecorator2 -6 > ( -7 > 50 -8 > ) -9 > - > private -10> x -11> : string; -1 >Emitted(40, 5) Source(27, 5) + SourceIndex(0) name (Greeter) -2 >Emitted(40, 17) Source(27, 6) + SourceIndex(0) name (Greeter) -3 >Emitted(40, 35) Source(27, 24) + SourceIndex(0) name (Greeter) -4 >Emitted(40, 37) Source(28, 6) + SourceIndex(0) name (Greeter) -5 >Emitted(40, 55) Source(28, 24) + SourceIndex(0) name (Greeter) -6 >Emitted(40, 56) Source(28, 25) + SourceIndex(0) name (Greeter) -7 >Emitted(40, 58) Source(28, 27) + SourceIndex(0) name (Greeter) -8 >Emitted(40, 59) Source(28, 28) + SourceIndex(0) name (Greeter) -9 >Emitted(40, 62) Source(29, 13) + SourceIndex(0) name (Greeter) -10>Emitted(40, 84) Source(29, 14) + SourceIndex(0) name (Greeter) -11>Emitted(40, 86) Source(29, 23) + SourceIndex(0) name (Greeter) +1 >Emitted(39, 5) Source(27, 5) + SourceIndex(0) name (Greeter) --- ->>> __decorate([ParameterDecorator1, ParameterDecorator2(70)], Greeter.prototype, "fn", 0); +>>> PropertyDecorator1, +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^^^^-> +1->@ +2 > PropertyDecorator1 +1->Emitted(40, 9) Source(27, 6) + SourceIndex(0) name (Greeter) +2 >Emitted(40, 27) Source(27, 24) + SourceIndex(0) name (Greeter) +--- +>>> PropertyDecorator2(50) +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +6 > ^^-> +1-> + > @ +2 > PropertyDecorator2 +3 > ( +4 > 50 +5 > ) +1->Emitted(41, 9) Source(28, 6) + SourceIndex(0) name (Greeter) +2 >Emitted(41, 27) Source(28, 24) + SourceIndex(0) name (Greeter) +3 >Emitted(41, 28) Source(28, 25) + SourceIndex(0) name (Greeter) +4 >Emitted(41, 30) Source(28, 27) + SourceIndex(0) name (Greeter) +5 >Emitted(41, 31) Source(28, 28) + SourceIndex(0) name (Greeter) +--- +>>> ], Greeter.prototype, "x"); +1->^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^-> +1-> + > private +2 > x +3 > : string; +1->Emitted(42, 8) Source(29, 13) + SourceIndex(0) name (Greeter) +2 >Emitted(42, 30) Source(29, 14) + SourceIndex(0) name (Greeter) +3 >Emitted(42, 32) Source(29, 23) + SourceIndex(0) name (Greeter) +--- +>>> Object.defineProperty(Greeter.prototype, "fn", 1->^^^^ -2 > ^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^ -4 > ^^ -5 > ^^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^^ -8 > ^ -9 > ^^^ -10> ^^^^^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^-> +2 > ^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^ 1-> > > @PropertyDecorator1 > @PropertyDecorator2(60) > private static x1: number = 10; > - > private fn( - > -2 > @ -3 > ParameterDecorator1 -4 > - > @ -5 > ParameterDecorator2 -6 > ( -7 > 70 -8 > ) -9 > - > -10> x -11> : number -1->Emitted(41, 5) Source(36, 7) + SourceIndex(0) name (Greeter) -2 >Emitted(41, 17) Source(36, 8) + SourceIndex(0) name (Greeter) -3 >Emitted(41, 36) Source(36, 27) + SourceIndex(0) name (Greeter) -4 >Emitted(41, 38) Source(37, 8) + SourceIndex(0) name (Greeter) -5 >Emitted(41, 57) Source(37, 27) + SourceIndex(0) name (Greeter) -6 >Emitted(41, 58) Source(37, 28) + SourceIndex(0) name (Greeter) -7 >Emitted(41, 60) Source(37, 30) + SourceIndex(0) name (Greeter) -8 >Emitted(41, 61) Source(37, 31) + SourceIndex(0) name (Greeter) -9 >Emitted(41, 64) Source(38, 7) + SourceIndex(0) name (Greeter) -10>Emitted(41, 90) Source(38, 8) + SourceIndex(0) name (Greeter) -11>Emitted(41, 92) Source(38, 16) + SourceIndex(0) name (Greeter) + > +2 > private +3 > fn +1->Emitted(43, 5) Source(35, 5) + SourceIndex(0) name (Greeter) +2 >Emitted(43, 27) Source(35, 13) + SourceIndex(0) name (Greeter) +3 >Emitted(43, 50) Source(35, 15) + SourceIndex(0) name (Greeter) --- ->>> __decorate([ParameterDecorator1, ParameterDecorator2(90)], Greeter.prototype, "greetings", 0); +>>> __decorate([ +>>> __param(0, ParameterDecorator1), +1 >^^^^^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^ +4 > ^ +5 > ^^^^^-> +1 >( + > +2 > @ +3 > ParameterDecorator1 +4 > +1 >Emitted(45, 13) Source(36, 7) + SourceIndex(0) name (Greeter) +2 >Emitted(45, 24) Source(36, 8) + SourceIndex(0) name (Greeter) +3 >Emitted(45, 43) Source(36, 27) + SourceIndex(0) name (Greeter) +4 >Emitted(45, 44) Source(36, 27) + SourceIndex(0) name (Greeter) +--- +>>> __param(0, ParameterDecorator2(70)) +1->^^^^^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 > @ +3 > ParameterDecorator2 +4 > ( +5 > 70 +6 > ) +7 > +1->Emitted(46, 13) Source(37, 7) + SourceIndex(0) name (Greeter) +2 >Emitted(46, 24) Source(37, 8) + SourceIndex(0) name (Greeter) +3 >Emitted(46, 43) Source(37, 27) + SourceIndex(0) name (Greeter) +4 >Emitted(46, 44) Source(37, 28) + SourceIndex(0) name (Greeter) +5 >Emitted(46, 46) Source(37, 30) + SourceIndex(0) name (Greeter) +6 >Emitted(46, 47) Source(37, 31) + SourceIndex(0) name (Greeter) +7 >Emitted(46, 48) Source(37, 31) + SourceIndex(0) name (Greeter) +--- +>>> ], Greeter.prototype, "fn", Object.getOwnPropertyDescriptor(Greeter.prototype, "fn"))); +1->^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^^^ +1-> +2 > fn +3 > +4 > fn +5 > ( + > @ParameterDecorator1 + > @ParameterDecorator2(70) + > x: number) { + > return this.greeting; + > } +1->Emitted(47, 12) Source(35, 13) + SourceIndex(0) name (Greeter) +2 >Emitted(47, 35) Source(35, 15) + SourceIndex(0) name (Greeter) +3 >Emitted(47, 69) Source(35, 13) + SourceIndex(0) name (Greeter) +4 >Emitted(47, 92) Source(35, 15) + SourceIndex(0) name (Greeter) +5 >Emitted(47, 96) Source(40, 6) + SourceIndex(0) name (Greeter) +--- +>>> Object.defineProperty(Greeter.prototype, "greetings", +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > + > + > +2 > @PropertyDecorator1 + > @PropertyDecorator2(80) + > get +3 > greetings +1 >Emitted(48, 5) Source(42, 5) + SourceIndex(0) name (Greeter) +2 >Emitted(48, 27) Source(44, 9) + SourceIndex(0) name (Greeter) +3 >Emitted(48, 57) Source(44, 18) + SourceIndex(0) name (Greeter) +--- +>>> __decorate([ +>>> PropertyDecorator1, +1 >^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^-> +1 > +2 > PropertyDecorator1 +1 >Emitted(50, 13) Source(42, 6) + SourceIndex(0) name (Greeter) +2 >Emitted(50, 31) Source(42, 24) + SourceIndex(0) name (Greeter) +--- +>>> PropertyDecorator2(80), +1->^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^-> +1-> + > @ +2 > PropertyDecorator2 +3 > ( +4 > 80 +5 > ) +1->Emitted(51, 13) Source(43, 6) + SourceIndex(0) name (Greeter) +2 >Emitted(51, 31) Source(43, 24) + SourceIndex(0) name (Greeter) +3 >Emitted(51, 32) Source(43, 25) + SourceIndex(0) name (Greeter) +4 >Emitted(51, 34) Source(43, 27) + SourceIndex(0) name (Greeter) +5 >Emitted(51, 35) Source(43, 28) + SourceIndex(0) name (Greeter) +--- +>>> __param(0, ParameterDecorator1), +1->^^^^^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^ +4 > ^ +5 > ^^^^^-> +1-> + > get greetings() { + > return this.greeting; + > } + > + > set greetings( + > +2 > @ +3 > ParameterDecorator1 +4 > +1->Emitted(52, 13) Source(49, 7) + SourceIndex(0) name (Greeter) +2 >Emitted(52, 24) Source(49, 8) + SourceIndex(0) name (Greeter) +3 >Emitted(52, 43) Source(49, 27) + SourceIndex(0) name (Greeter) +4 >Emitted(52, 44) Source(49, 27) + SourceIndex(0) name (Greeter) +--- +>>> __param(0, ParameterDecorator2(90)) +1->^^^^^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 > @ +3 > ParameterDecorator2 +4 > ( +5 > 90 +6 > ) +7 > +1->Emitted(53, 13) Source(50, 7) + SourceIndex(0) name (Greeter) +2 >Emitted(53, 24) Source(50, 8) + SourceIndex(0) name (Greeter) +3 >Emitted(53, 43) Source(50, 27) + SourceIndex(0) name (Greeter) +4 >Emitted(53, 44) Source(50, 28) + SourceIndex(0) name (Greeter) +5 >Emitted(53, 46) Source(50, 30) + SourceIndex(0) name (Greeter) +6 >Emitted(53, 47) Source(50, 31) + SourceIndex(0) name (Greeter) +7 >Emitted(53, 48) Source(50, 31) + SourceIndex(0) name (Greeter) +--- +>>> ], Greeter.prototype, "greetings", Object.getOwnPropertyDescriptor(Greeter.prototype, "greetings"))); +1->^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^^^ +1-> +2 > greetings +3 > +4 > greetings +5 > () { + > return this.greeting; + > } +1->Emitted(54, 12) Source(44, 9) + SourceIndex(0) name (Greeter) +2 >Emitted(54, 42) Source(44, 18) + SourceIndex(0) name (Greeter) +3 >Emitted(54, 76) Source(44, 9) + SourceIndex(0) name (Greeter) +4 >Emitted(54, 106) Source(44, 18) + SourceIndex(0) name (Greeter) +5 >Emitted(54, 110) Source(46, 6) + SourceIndex(0) name (Greeter) +--- +>>> __decorate([ +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +1 >Emitted(55, 5) Source(31, 5) + SourceIndex(0) name (Greeter) +--- +>>> PropertyDecorator1, +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^^^^-> +1->@ +2 > PropertyDecorator1 +1->Emitted(56, 9) Source(31, 6) + SourceIndex(0) name (Greeter) +2 >Emitted(56, 27) Source(31, 24) + SourceIndex(0) name (Greeter) +--- +>>> PropertyDecorator2(60) +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +1-> + > @ +2 > PropertyDecorator2 +3 > ( +4 > 60 +5 > ) +1->Emitted(57, 9) Source(32, 6) + SourceIndex(0) name (Greeter) +2 >Emitted(57, 27) Source(32, 24) + SourceIndex(0) name (Greeter) +3 >Emitted(57, 28) Source(32, 25) + SourceIndex(0) name (Greeter) +4 >Emitted(57, 30) Source(32, 27) + SourceIndex(0) name (Greeter) +5 >Emitted(57, 31) Source(32, 28) + SourceIndex(0) name (Greeter) +--- +>>> ], Greeter, "x1"); +1 >^^^^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^-> +1 > + > private static +2 > x1 +3 > : number = 10; +1 >Emitted(58, 8) Source(33, 20) + SourceIndex(0) name (Greeter) +2 >Emitted(58, 21) Source(33, 22) + SourceIndex(0) name (Greeter) +3 >Emitted(58, 23) Source(33, 36) + SourceIndex(0) name (Greeter) +--- +>>> Greeter = __decorate([ 1->^^^^ -2 > ^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^ -4 > ^^ -5 > ^^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^^ -8 > ^ -9 > ^^^ -10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1->) { +2 > ^^^^^^^^^^^^^^^^^^^^^-> +1-> +1->Emitted(59, 5) Source(8, 1) + SourceIndex(0) name (Greeter) +--- +>>> ClassDecorator1, +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^^^^^-> +1->@ +2 > ClassDecorator1 +1->Emitted(60, 9) Source(8, 2) + SourceIndex(0) name (Greeter) +2 >Emitted(60, 24) Source(8, 17) + SourceIndex(0) name (Greeter) +--- +>>> ClassDecorator2(10), +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> + >@ +2 > ClassDecorator2 +3 > ( +4 > 10 +5 > ) +1->Emitted(61, 9) Source(9, 2) + SourceIndex(0) name (Greeter) +2 >Emitted(61, 24) Source(9, 17) + SourceIndex(0) name (Greeter) +3 >Emitted(61, 25) Source(9, 18) + SourceIndex(0) name (Greeter) +4 >Emitted(61, 27) Source(9, 20) + SourceIndex(0) name (Greeter) +5 >Emitted(61, 28) Source(9, 21) + SourceIndex(0) name (Greeter) +--- +>>> __param(0, ParameterDecorator1), +1->^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^ +4 > ^ +5 > ^^^^^^-> +1-> + >class Greeter { + > constructor( + > +2 > @ +3 > ParameterDecorator1 +4 > +1->Emitted(62, 9) Source(12, 7) + SourceIndex(0) name (Greeter) +2 >Emitted(62, 20) Source(12, 8) + SourceIndex(0) name (Greeter) +3 >Emitted(62, 39) Source(12, 27) + SourceIndex(0) name (Greeter) +4 >Emitted(62, 40) Source(12, 27) + SourceIndex(0) name (Greeter) +--- +>>> __param(0, ParameterDecorator2(20)), +1->^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^ +1-> + > +2 > @ +3 > ParameterDecorator2 +4 > ( +5 > 20 +6 > ) +7 > +1->Emitted(63, 9) Source(13, 7) + SourceIndex(0) name (Greeter) +2 >Emitted(63, 20) Source(13, 8) + SourceIndex(0) name (Greeter) +3 >Emitted(63, 39) Source(13, 27) + SourceIndex(0) name (Greeter) +4 >Emitted(63, 40) Source(13, 28) + SourceIndex(0) name (Greeter) +5 >Emitted(63, 42) Source(13, 30) + SourceIndex(0) name (Greeter) +6 >Emitted(63, 43) Source(13, 31) + SourceIndex(0) name (Greeter) +7 >Emitted(63, 44) Source(13, 31) + SourceIndex(0) name (Greeter) +--- +>>> __param(1, ParameterDecorator1), +1 >^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^ +4 > ^ +5 > ^^^^^-> +1 > + > public greeting: string, + > + > +2 > @ +3 > ParameterDecorator1 +4 > +1 >Emitted(64, 9) Source(16, 7) + SourceIndex(0) name (Greeter) +2 >Emitted(64, 20) Source(16, 8) + SourceIndex(0) name (Greeter) +3 >Emitted(64, 39) Source(16, 27) + SourceIndex(0) name (Greeter) +4 >Emitted(64, 40) Source(16, 27) + SourceIndex(0) name (Greeter) +--- +>>> __param(1, ParameterDecorator2(30)) +1->^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^ +1-> + > +2 > @ +3 > ParameterDecorator2 +4 > ( +5 > 30 +6 > ) +7 > +1->Emitted(65, 9) Source(17, 7) + SourceIndex(0) name (Greeter) +2 >Emitted(65, 20) Source(17, 8) + SourceIndex(0) name (Greeter) +3 >Emitted(65, 39) Source(17, 27) + SourceIndex(0) name (Greeter) +4 >Emitted(65, 40) Source(17, 28) + SourceIndex(0) name (Greeter) +5 >Emitted(65, 42) Source(17, 30) + SourceIndex(0) name (Greeter) +6 >Emitted(65, 43) Source(17, 31) + SourceIndex(0) name (Greeter) +7 >Emitted(65, 44) Source(17, 31) + SourceIndex(0) name (Greeter) +--- +>>> ], Greeter); +1 >^^^^^^^^^^^^^^^^ +2 > ^^^^-> +1 > + > ...b: string[]) { + > } + > + > @PropertyDecorator1 + > @PropertyDecorator2(40) + > greet() { + > return "

" + this.greeting + "

"; + > } + > + > @PropertyDecorator1 + > @PropertyDecorator2(50) + > private x: string; + > + > @PropertyDecorator1 + > @PropertyDecorator2(60) + > private static x1: number = 10; + > + > private fn( + > @ParameterDecorator1 + > @ParameterDecorator2(70) + > x: number) { > return this.greeting; > } > @@ -556,281 +889,21 @@ sourceFile:sourceMapValidationDecorators.ts > } > > set greetings( - > -2 > @ -3 > ParameterDecorator1 -4 > - > @ -5 > ParameterDecorator2 -6 > ( -7 > 90 -8 > ) -9 > - > -10> greetings -11> : string -1->Emitted(42, 5) Source(49, 7) + SourceIndex(0) name (Greeter) -2 >Emitted(42, 17) Source(49, 8) + SourceIndex(0) name (Greeter) -3 >Emitted(42, 36) Source(49, 27) + SourceIndex(0) name (Greeter) -4 >Emitted(42, 38) Source(50, 8) + SourceIndex(0) name (Greeter) -5 >Emitted(42, 57) Source(50, 27) + SourceIndex(0) name (Greeter) -6 >Emitted(42, 58) Source(50, 28) + SourceIndex(0) name (Greeter) -7 >Emitted(42, 60) Source(50, 30) + SourceIndex(0) name (Greeter) -8 >Emitted(42, 61) Source(50, 31) + SourceIndex(0) name (Greeter) -9 >Emitted(42, 64) Source(51, 7) + SourceIndex(0) name (Greeter) -10>Emitted(42, 97) Source(51, 16) + SourceIndex(0) name (Greeter) -11>Emitted(42, 99) Source(51, 24) + SourceIndex(0) name (Greeter) ---- ->>> Object.defineProperty(Greeter.prototype, "greetings", __decorate([PropertyDecorator1, PropertyDecorator2(80)], Greeter.prototype, "greetings", Object.getOwnPropertyDescriptor(Greeter.prototype, "greetings"))); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -4 > ^^^^^^^^^^^^^^ -5 > ^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^ -8 > ^ -9 > ^^ -10> ^ -11> ^^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -15> ^^^^ -1-> -2 > @PropertyDecorator1 - > @PropertyDecorator2(80) - > get -3 > greetings -4 > -5 > PropertyDecorator1 -6 > - > @ -7 > PropertyDecorator2 -8 > ( -9 > 80 -10> ) -11> - > get -12> greetings -13> -14> greetings -15> () { - > return this.greeting; - > } -1->Emitted(43, 5) Source(42, 5) + SourceIndex(0) name (Greeter) -2 >Emitted(43, 27) Source(44, 9) + SourceIndex(0) name (Greeter) -3 >Emitted(43, 57) Source(44, 18) + SourceIndex(0) name (Greeter) -4 >Emitted(43, 71) Source(42, 6) + SourceIndex(0) name (Greeter) -5 >Emitted(43, 89) Source(42, 24) + SourceIndex(0) name (Greeter) -6 >Emitted(43, 91) Source(43, 6) + SourceIndex(0) name (Greeter) -7 >Emitted(43, 109) Source(43, 24) + SourceIndex(0) name (Greeter) -8 >Emitted(43, 110) Source(43, 25) + SourceIndex(0) name (Greeter) -9 >Emitted(43, 112) Source(43, 27) + SourceIndex(0) name (Greeter) -10>Emitted(43, 113) Source(43, 28) + SourceIndex(0) name (Greeter) -11>Emitted(43, 116) Source(44, 9) + SourceIndex(0) name (Greeter) -12>Emitted(43, 146) Source(44, 18) + SourceIndex(0) name (Greeter) -13>Emitted(43, 180) Source(44, 9) + SourceIndex(0) name (Greeter) -14>Emitted(43, 210) Source(44, 18) + SourceIndex(0) name (Greeter) -15>Emitted(43, 214) Source(46, 6) + SourceIndex(0) name (Greeter) ---- ->>> __decorate([PropertyDecorator1, PropertyDecorator2(60)], Greeter, "x1"); -1 >^^^^ -2 > ^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^ -4 > ^^ -5 > ^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^^ -8 > ^ -9 > ^^^ -10> ^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^-> -1 > -2 > @ -3 > PropertyDecorator1 -4 > - > @ -5 > PropertyDecorator2 -6 > ( -7 > 60 -8 > ) -9 > - > private static -10> x1 -11> : number = 10; -1 >Emitted(44, 5) Source(31, 5) + SourceIndex(0) name (Greeter) -2 >Emitted(44, 17) Source(31, 6) + SourceIndex(0) name (Greeter) -3 >Emitted(44, 35) Source(31, 24) + SourceIndex(0) name (Greeter) -4 >Emitted(44, 37) Source(32, 6) + SourceIndex(0) name (Greeter) -5 >Emitted(44, 55) Source(32, 24) + SourceIndex(0) name (Greeter) -6 >Emitted(44, 56) Source(32, 25) + SourceIndex(0) name (Greeter) -7 >Emitted(44, 58) Source(32, 27) + SourceIndex(0) name (Greeter) -8 >Emitted(44, 59) Source(32, 28) + SourceIndex(0) name (Greeter) -9 >Emitted(44, 62) Source(33, 20) + SourceIndex(0) name (Greeter) -10>Emitted(44, 75) Source(33, 22) + SourceIndex(0) name (Greeter) -11>Emitted(44, 77) Source(33, 36) + SourceIndex(0) name (Greeter) ---- ->>> __decorate([ParameterDecorator1, ParameterDecorator2(20)], Greeter, void 0, 0); -1->^^^^ -2 > ^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^ -4 > ^^ -5 > ^^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^^ -8 > ^ -9 > ^^^ -10> ^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^-> -1-> -2 > @ -3 > ParameterDecorator1 -4 > - > @ -5 > ParameterDecorator2 -6 > ( -7 > 20 -8 > ) -9 > - > public -10> greeting -11> : string -1->Emitted(45, 5) Source(12, 7) + SourceIndex(0) name (Greeter) -2 >Emitted(45, 17) Source(12, 8) + SourceIndex(0) name (Greeter) -3 >Emitted(45, 36) Source(12, 27) + SourceIndex(0) name (Greeter) -4 >Emitted(45, 38) Source(13, 8) + SourceIndex(0) name (Greeter) -5 >Emitted(45, 57) Source(13, 27) + SourceIndex(0) name (Greeter) -6 >Emitted(45, 58) Source(13, 28) + SourceIndex(0) name (Greeter) -7 >Emitted(45, 60) Source(13, 30) + SourceIndex(0) name (Greeter) -8 >Emitted(45, 61) Source(13, 31) + SourceIndex(0) name (Greeter) -9 >Emitted(45, 64) Source(14, 14) + SourceIndex(0) name (Greeter) -10>Emitted(45, 82) Source(14, 22) + SourceIndex(0) name (Greeter) -11>Emitted(45, 84) Source(14, 30) + SourceIndex(0) name (Greeter) ---- ->>> __decorate([ParameterDecorator1, ParameterDecorator2(30)], Greeter, void 0, 1); -1->^^^^ -2 > ^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^ -4 > ^^ -5 > ^^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^^ -8 > ^ -9 > ^^^ -10> ^^^^^^^^^^^^^^^^^^ -11> ^^ -1->, - > - > -2 > @ -3 > ParameterDecorator1 -4 > - > @ -5 > ParameterDecorator2 -6 > ( -7 > 30 -8 > ) -9 > - > ... -10> b -11> : string[] -1->Emitted(46, 5) Source(16, 7) + SourceIndex(0) name (Greeter) -2 >Emitted(46, 17) Source(16, 8) + SourceIndex(0) name (Greeter) -3 >Emitted(46, 36) Source(16, 27) + SourceIndex(0) name (Greeter) -4 >Emitted(46, 38) Source(17, 8) + SourceIndex(0) name (Greeter) -5 >Emitted(46, 57) Source(17, 27) + SourceIndex(0) name (Greeter) -6 >Emitted(46, 58) Source(17, 28) + SourceIndex(0) name (Greeter) -7 >Emitted(46, 60) Source(17, 30) + SourceIndex(0) name (Greeter) -8 >Emitted(46, 61) Source(17, 31) + SourceIndex(0) name (Greeter) -9 >Emitted(46, 64) Source(18, 10) + SourceIndex(0) name (Greeter) -10>Emitted(46, 82) Source(18, 11) + SourceIndex(0) name (Greeter) -11>Emitted(46, 84) Source(18, 21) + SourceIndex(0) name (Greeter) ---- ->>> Greeter = __decorate([ClassDecorator1, ClassDecorator2(10)], Greeter); -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^ -4 > ^^ -5 > ^^^^^^^^^^^^^^^ -6 > ^ -7 > ^^ -8 > ^ -9 > ^^^^^^^^^^^^ -1 > -2 > @ -3 > ClassDecorator1 -4 > - > @ -5 > ClassDecorator2 -6 > ( -7 > 10 -8 > ) -9 > - > class Greeter { - > constructor( - > @ParameterDecorator1 - > @ParameterDecorator2(20) - > public greeting: string, - > - > @ParameterDecorator1 - > @ParameterDecorator2(30) - > ...b: string[]) { - > } - > - > @PropertyDecorator1 - > @PropertyDecorator2(40) - > greet() { - > return "

" + this.greeting + "

"; - > } - > - > @PropertyDecorator1 - > @PropertyDecorator2(50) - > private x: string; - > - > @PropertyDecorator1 - > @PropertyDecorator2(60) - > private static x1: number = 10; - > - > private fn( - > @ParameterDecorator1 - > @ParameterDecorator2(70) - > x: number) { - > return this.greeting; - > } - > - > @PropertyDecorator1 - > @PropertyDecorator2(80) - > get greetings() { - > return this.greeting; - > } - > - > set greetings( - > @ParameterDecorator1 - > @ParameterDecorator2(90) - > greetings: string) { - > this.greeting = greetings; - > } - > } -1 >Emitted(47, 5) Source(8, 1) + SourceIndex(0) name (Greeter) -2 >Emitted(47, 27) Source(8, 2) + SourceIndex(0) name (Greeter) -3 >Emitted(47, 42) Source(8, 17) + SourceIndex(0) name (Greeter) -4 >Emitted(47, 44) Source(9, 2) + SourceIndex(0) name (Greeter) -5 >Emitted(47, 59) Source(9, 17) + SourceIndex(0) name (Greeter) -6 >Emitted(47, 60) Source(9, 18) + SourceIndex(0) name (Greeter) -7 >Emitted(47, 62) Source(9, 20) + SourceIndex(0) name (Greeter) -8 >Emitted(47, 63) Source(9, 21) + SourceIndex(0) name (Greeter) -9 >Emitted(47, 75) Source(54, 2) + SourceIndex(0) name (Greeter) + > @ParameterDecorator1 + > @ParameterDecorator2(90) + > greetings: string) { + > this.greeting = greetings; + > } + >} +1 >Emitted(66, 17) Source(54, 2) + SourceIndex(0) name (Greeter) --- >>> return Greeter; -1 >^^^^ +1->^^^^ 2 > ^^^^^^^^^^^^^^ -1 > +1-> 2 > } -1 >Emitted(48, 5) Source(54, 1) + SourceIndex(0) name (Greeter) -2 >Emitted(48, 19) Source(54, 2) + SourceIndex(0) name (Greeter) +1->Emitted(67, 5) Source(54, 1) + SourceIndex(0) name (Greeter) +2 >Emitted(67, 19) Source(54, 2) + SourceIndex(0) name (Greeter) --- >>>})(); 1 > @@ -888,9 +961,9 @@ sourceFile:sourceMapValidationDecorators.ts > this.greeting = greetings; > } > } -1 >Emitted(49, 1) Source(54, 1) + SourceIndex(0) name (Greeter) -2 >Emitted(49, 2) Source(54, 2) + SourceIndex(0) name (Greeter) -3 >Emitted(49, 2) Source(8, 1) + SourceIndex(0) -4 >Emitted(49, 6) Source(54, 2) + SourceIndex(0) +1 >Emitted(68, 1) Source(54, 1) + SourceIndex(0) name (Greeter) +2 >Emitted(68, 2) Source(54, 2) + SourceIndex(0) name (Greeter) +3 >Emitted(68, 2) Source(8, 1) + SourceIndex(0) +4 >Emitted(68, 6) Source(54, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationDecorators.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFunctionExpressions.js b/tests/baselines/reference/sourceMapValidationFunctionExpressions.js index 5aa2c9902ea..f215c5071e4 100644 --- a/tests/baselines/reference/sourceMapValidationFunctionExpressions.js +++ b/tests/baselines/reference/sourceMapValidationFunctionExpressions.js @@ -14,7 +14,5 @@ var greet = function (greeting) { return greetings; }; greet("Hello"); -var incrGreetings = function () { - return greetings++; -}; +var incrGreetings = function () { return greetings++; }; //# sourceMappingURL=sourceMapValidationFunctionExpressions.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFunctionExpressions.js.map b/tests/baselines/reference/sourceMapValidationFunctionExpressions.js.map index a55cd03c9ed..0ab0bdac146 100644 --- a/tests/baselines/reference/sourceMapValidationFunctionExpressions.js.map +++ b/tests/baselines/reference/sourceMapValidationFunctionExpressions.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationFunctionExpressions.js.map] -{"version":3,"file":"sourceMapValidationFunctionExpressions.js","sourceRoot":"","sources":["sourceMapValidationFunctionExpressions.ts"],"names":[],"mappings":"AAAA,IAAI,SAAS,GAAG,CAAC,CAAC;AAClB,IAAI,KAAK,GAAG,UAAC,QAAgB;IACzB,SAAS,EAAE,CAAC;IACZ,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC,CAAA;AACD,KAAK,CAAC,OAAO,CAAC,CAAC;AACf,IAAI,aAAa,GAAG;WAAM,SAAS,EAAE;AAAX,CAAW,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationFunctionExpressions.js","sourceRoot":"","sources":["sourceMapValidationFunctionExpressions.ts"],"names":[],"mappings":"AAAA,IAAI,SAAS,GAAG,CAAC,CAAC;AAClB,IAAI,KAAK,GAAG,UAAC,QAAgB;IACzB,SAAS,EAAE,CAAC;IACZ,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC,CAAA;AACD,KAAK,CAAC,OAAO,CAAC,CAAC;AACf,IAAI,aAAa,GAAG,cAAM,OAAA,SAAS,EAAE,EAAX,CAAW,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFunctionExpressions.sourcemap.txt b/tests/baselines/reference/sourceMapValidationFunctionExpressions.sourcemap.txt index d745903dafa..722afe1f9d9 100644 --- a/tests/baselines/reference/sourceMapValidationFunctionExpressions.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationFunctionExpressions.sourcemap.txt @@ -104,7 +104,7 @@ sourceFile:sourceMapValidationFunctionExpressions.ts 4 > ^^^^^^^ 5 > ^ 6 > ^ -7 > ^^^^^^^^^^^^^^^^^^^-> +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > 2 >greet @@ -119,43 +119,41 @@ sourceFile:sourceMapValidationFunctionExpressions.ts 5 >Emitted(6, 15) Source(6, 15) + SourceIndex(0) 6 >Emitted(6, 16) Source(6, 16) + SourceIndex(0) --- ->>>var incrGreetings = function () { +>>>var incrGreetings = function () { return greetings++; }; 1-> 2 >^^^^ 3 > ^^^^^^^^^^^^^ 4 > ^^^ -5 > ^^^^-> +5 > ^^^^^^^^^^^^^^ +6 > ^^^^^^^ +7 > ^^^^^^^^^ +8 > ^^ +9 > ^^ +10> ^ +11> ^ +12> ^^^^^^^^^-> 1-> > 2 >var 3 > incrGreetings 4 > = +5 > () => +6 > +7 > greetings +8 > ++ +9 > +10> greetings++ +11> ; 1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) 2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) 3 >Emitted(7, 18) Source(7, 18) + SourceIndex(0) 4 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) ---- ->>> return greetings++; -1->^^^^^^^^^^^ -2 > ^^^^^^^^^ -3 > ^^ -1->() => -2 > greetings -3 > ++ -1->Emitted(8, 12) Source(7, 27) + SourceIndex(0) -2 >Emitted(8, 21) Source(7, 36) + SourceIndex(0) -3 >Emitted(8, 23) Source(7, 38) + SourceIndex(0) ---- ->>>}; -1 > -2 >^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >greetings++ -3 > ; -1 >Emitted(9, 1) Source(7, 27) + SourceIndex(0) -2 >Emitted(9, 2) Source(7, 38) + SourceIndex(0) -3 >Emitted(9, 3) Source(7, 39) + SourceIndex(0) +5 >Emitted(7, 35) Source(7, 27) + SourceIndex(0) +6 >Emitted(7, 42) Source(7, 27) + SourceIndex(0) +7 >Emitted(7, 51) Source(7, 36) + SourceIndex(0) +8 >Emitted(7, 53) Source(7, 38) + SourceIndex(0) +9 >Emitted(7, 55) Source(7, 27) + SourceIndex(0) +10>Emitted(7, 56) Source(7, 38) + SourceIndex(0) +11>Emitted(7, 57) Source(7, 39) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationFunctionExpressions.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFunctionPropertyAssignment.js b/tests/baselines/reference/sourceMapValidationFunctionPropertyAssignment.js index be4c5bbf083..289d29d02bd 100644 --- a/tests/baselines/reference/sourceMapValidationFunctionPropertyAssignment.js +++ b/tests/baselines/reference/sourceMapValidationFunctionPropertyAssignment.js @@ -2,8 +2,5 @@ var x = { n() { } }; //// [sourceMapValidationFunctionPropertyAssignment.js] -var x = { - n: function () { - } -}; +var x = { n: function () { } }; //# sourceMappingURL=sourceMapValidationFunctionPropertyAssignment.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFunctionPropertyAssignment.js.map b/tests/baselines/reference/sourceMapValidationFunctionPropertyAssignment.js.map index 9ff69d21921..81066a66bad 100644 --- a/tests/baselines/reference/sourceMapValidationFunctionPropertyAssignment.js.map +++ b/tests/baselines/reference/sourceMapValidationFunctionPropertyAssignment.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationFunctionPropertyAssignment.js.map] -{"version":3,"file":"sourceMapValidationFunctionPropertyAssignment.js","sourceRoot":"","sources":["sourceMapValidationFunctionPropertyAssignment.ts"],"names":["n"],"mappings":"AAAA,IAAI,CAAC,GAAG;IAAE,CAAC;IAAKA,CAACA;CAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationFunctionPropertyAssignment.js","sourceRoot":"","sources":["sourceMapValidationFunctionPropertyAssignment.ts"],"names":["n"],"mappings":"AAAA,IAAI,CAAC,GAAG,EAAE,CAAC,gBAAKA,CAACA,EAAE,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFunctionPropertyAssignment.sourcemap.txt b/tests/baselines/reference/sourceMapValidationFunctionPropertyAssignment.sourcemap.txt index 3595fcebf3c..52a8bfe688c 100644 --- a/tests/baselines/reference/sourceMapValidationFunctionPropertyAssignment.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationFunctionPropertyAssignment.sourcemap.txt @@ -8,45 +8,37 @@ sources: sourceMapValidationFunctionPropertyAssignment.ts emittedFile:tests/cases/compiler/sourceMapValidationFunctionPropertyAssignment.js sourceFile:sourceMapValidationFunctionPropertyAssignment.ts ------------------------------------------------------------------- ->>>var x = { +>>>var x = { n: function () { } }; 1 > 2 >^^^^ 3 > ^ 4 > ^^^ -5 > ^^^^^^^^^^^^^-> +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > 2 >var 3 > x 4 > = +5 > { +6 > n +7 > () { +8 > } +9 > } +10> ; 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) 2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) 3 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) 4 >Emitted(1, 9) Source(1, 9) + SourceIndex(0) ---- ->>> n: function () { -1->^^^^ -2 > ^ -3 > ^-> -1->{ -2 > n -1->Emitted(2, 5) Source(1, 11) + SourceIndex(0) -2 >Emitted(2, 6) Source(1, 12) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -1->() { -2 > } -1->Emitted(3, 5) Source(1, 17) + SourceIndex(0) name (n) -2 >Emitted(3, 6) Source(1, 18) + SourceIndex(0) name (n) ---- ->>>}; -1 >^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > } -2 > ; -1 >Emitted(4, 2) Source(1, 20) + SourceIndex(0) -2 >Emitted(4, 3) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) +6 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 17) + SourceIndex(0) name (n) +8 >Emitted(1, 29) Source(1, 18) + SourceIndex(0) name (n) +9 >Emitted(1, 31) Source(1, 20) + SourceIndex(0) +10>Emitted(1, 32) Source(1, 21) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationFunctionPropertyAssignment.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationStatements.js b/tests/baselines/reference/sourceMapValidationStatements.js index 85a4dc33889..8a4b565e9b0 100644 --- a/tests/baselines/reference/sourceMapValidationStatements.js +++ b/tests/baselines/reference/sourceMapValidationStatements.js @@ -136,22 +136,19 @@ function f() { z = 10; } switch (obj.z) { - case 0: - { - x++; - break; - } - case 1: - { - x--; - break; - } - default: - { - x *= 2; - x = 50; - break; - } + case 0: { + x++; + break; + } + case 1: { + x--; + break; + } + default: { + x *= 2; + x = 50; + break; + } } while (x < 10) { x++; diff --git a/tests/baselines/reference/sourceMapValidationStatements.js.map b/tests/baselines/reference/sourceMapValidationStatements.js.map index 63731751060..a1ea3b1db79 100644 --- a/tests/baselines/reference/sourceMapValidationStatements.js.map +++ b/tests/baselines/reference/sourceMapValidationStatements.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationStatements.js.map] -{"version":3,"file":"sourceMapValidationStatements.js","sourceRoot":"","sources":["sourceMapValidationStatements.ts"],"names":["f"],"mappings":"AAAA;IACIA,IAAIA,CAACA,CAACA;IACNA,IAAIA,CAACA,GAAGA,CAACA,CAACA;IACVA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,EAAEA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;QAC1BA,CAACA,IAAIA,CAACA,CAACA;QACPA,CAACA,IAAIA,CAACA,CAACA;IACXA,CAACA;IACDA,EAAEA,CAACA,CAACA,CAACA,GAAGA,EAAEA,CAACA,CAACA,CAACA;QACTA,CAACA,IAAIA,CAACA,CAACA;IACXA,CAACA;IAACA,IAAIA,CAACA,CAACA;QACJA,CAACA,IAAIA,EAAEA,CAACA;QACRA,CAACA,EAAEA,CAACA;IACRA,CAACA;IACDA,IAAIA,CAACA,GAAGA;QACJA,CAACA;QACDA,CAACA;QACDA,CAACA;KACJA,CAACA;IACFA,IAAIA,GAAGA,GAAGA;QACNA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,OAAOA;KACbA,CAACA;IACFA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;QACdA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,CAACA;QACbA,IAAIA,CAACA,GAAGA,EAAEA,CAACA;IACfA,CAACA;IACDA,IAAIA,CAACA;QACDA,GAAGA,CAACA,CAACA,GAAGA,MAAMA,CAACA;IACnBA,CAAEA;IAAAA,KAAKA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA;QACTA,EAAEA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,EAAEA,CAACA,CAACA,CAACA;YACbA,GAAGA,CAACA,CAACA,GAAGA,EAAEA,CAACA;QACfA,CAACA;QAACA,IAAIA,CAACA,CAACA;YACJA,GAAGA,CAACA,CAACA,GAAGA,KAAKA,CAACA;QAClBA,CAACA;IACLA,CAACA;IACDA,IAAIA,CAACA;QACDA,MAAMA,IAAIA,KAAKA,EAAEA,CAACA;IACtBA,CAAEA;IAAAA,KAAKA,CAACA,CAACA,EAAEA,CAACA,CAACA,CAACA;QACVA,IAAIA,CAACA,GAAGA,EAAEA,CAACA;IACfA,CAACA;YAASA,CAACA;QACPA,CAACA,GAAGA,EAAEA,CAACA;IACXA,CAACA;IACDA,MAAMA,GAAGA,EAAEA,CAACA;QACRA,CAACA,GAAGA,CAACA,CAACA;QACNA,CAACA,GAAGA,EAAEA,CAACA;IACXA,CAACA;IACDA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,CAACA;QACZA,KAAKA,CAACA;YAAEA,CAACA;gBACLA,CAACA,EAAEA,CAACA;gBACJA,KAAKA,CAACA;YAEVA,CAACA;QACDA,KAAKA,CAACA;YAAEA,CAACA;gBACLA,CAACA,EAAEA,CAACA;gBACJA,KAAKA,CAACA;YAEVA,CAACA;QACDA;YAASA,CAACA;gBACNA,CAACA,IAAIA,CAACA,CAACA;gBACPA,CAACA,GAAGA,EAAEA,CAACA;gBACPA,KAAKA,CAACA;YAEVA,CAACA;IACLA,CAACA;IACDA,OAAOA,CAACA,GAAGA,EAAEA,EAAEA,CAACA;QACZA,CAACA,EAAEA,CAACA;IACRA,CAACA;IACDA,GAAGA,CAACA;QACAA,CAACA,EAAEA,CAACA;IACRA,CAACA,QAAQA,CAACA,GAAGA,CAACA,EAACA;IACfA,CAACA,GAAGA,CAACA,CAACA;IACNA,IAAIA,CAACA,GAAGA,CAACA,CAACA,IAAIA,CAACA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,CAACA;IACjCA,CAACA,CAACA,IAAIA,CAACA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,CAACA;IACzBA,CAACA,KAAKA,CAACA,CAACA;IACRA,CAACA,GAAGA,CAACA,GAAGA,EAAEA,CAACA;IACXA,IAAIA,CAACA,GAAGA,CAACA,CAACA;IACVA,MAAMA,CAACA;AACXA,CAACA;AACD,IAAI,CAAC,GAAG;IACJ,IAAI,CAAC,GAAG,EAAE,CAAC;IACX,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACd,CAAC,CAAC;AACF,CAAC,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationStatements.js","sourceRoot":"","sources":["sourceMapValidationStatements.ts"],"names":["f"],"mappings":"AAAA;IACIA,IAAIA,CAACA,CAACA;IACNA,IAAIA,CAACA,GAAGA,CAACA,CAACA;IACVA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,EAAEA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;QAC1BA,CAACA,IAAIA,CAACA,CAACA;QACPA,CAACA,IAAIA,CAACA,CAACA;IACXA,CAACA;IACDA,EAAEA,CAACA,CAACA,CAACA,GAAGA,EAAEA,CAACA,CAACA,CAACA;QACTA,CAACA,IAAIA,CAACA,CAACA;IACXA,CAACA;IAACA,IAAIA,CAACA,CAACA;QACJA,CAACA,IAAIA,EAAEA,CAACA;QACRA,CAACA,EAAEA,CAACA;IACRA,CAACA;IACDA,IAAIA,CAACA,GAAGA;QACJA,CAACA;QACDA,CAACA;QACDA,CAACA;KACJA,CAACA;IACFA,IAAIA,GAAGA,GAAGA;QACNA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,OAAOA;KACbA,CAACA;IACFA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;QACdA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,CAACA;QACbA,IAAIA,CAACA,GAAGA,EAAEA,CAACA;IACfA,CAACA;IACDA,IAAIA,CAACA;QACDA,GAAGA,CAACA,CAACA,GAAGA,MAAMA,CAACA;IACnBA,CAAEA;IAAAA,KAAKA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA;QACTA,EAAEA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,EAAEA,CAACA,CAACA,CAACA;YACbA,GAAGA,CAACA,CAACA,GAAGA,EAAEA,CAACA;QACfA,CAACA;QAACA,IAAIA,CAACA,CAACA;YACJA,GAAGA,CAACA,CAACA,GAAGA,KAAKA,CAACA;QAClBA,CAACA;IACLA,CAACA;IACDA,IAAIA,CAACA;QACDA,MAAMA,IAAIA,KAAKA,EAAEA,CAACA;IACtBA,CAAEA;IAAAA,KAAKA,CAACA,CAACA,EAAEA,CAACA,CAACA,CAACA;QACVA,IAAIA,CAACA,GAAGA,EAAEA,CAACA;IACfA,CAACA;YAASA,CAACA;QACPA,CAACA,GAAGA,EAAEA,CAACA;IACXA,CAACA;IACDA,MAAMA,GAAGA,EAAEA,CAACA;QACRA,CAACA,GAAGA,CAACA,CAACA;QACNA,CAACA,GAAGA,EAAEA,CAACA;IACXA,CAACA;IACDA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,CAACA;QACZA,KAAKA,CAACA,EAAEA,CAACA;YACLA,CAACA,EAAEA,CAACA;YACJA,KAAKA,CAACA;QAEVA,CAACA;QACDA,KAAKA,CAACA,EAAEA,CAACA;YACLA,CAACA,EAAEA,CAACA;YACJA,KAAKA,CAACA;QAEVA,CAACA;QACDA,SAASA,CAACA;YACNA,CAACA,IAAIA,CAACA,CAACA;YACPA,CAACA,GAAGA,EAAEA,CAACA;YACPA,KAAKA,CAACA;QAEVA,CAACA;IACLA,CAACA;IACDA,OAAOA,CAACA,GAAGA,EAAEA,EAAEA,CAACA;QACZA,CAACA,EAAEA,CAACA;IACRA,CAACA;IACDA,GAAGA,CAACA;QACAA,CAACA,EAAEA,CAACA;IACRA,CAACA,QAAQA,CAACA,GAAGA,CAACA,EAACA;IACfA,CAACA,GAAGA,CAACA,CAACA;IACNA,IAAIA,CAACA,GAAGA,CAACA,CAACA,IAAIA,CAACA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,CAACA;IACjCA,CAACA,CAACA,IAAIA,CAACA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,CAACA;IACzBA,CAACA,KAAKA,CAACA,CAACA;IACRA,CAACA,GAAGA,CAACA,GAAGA,EAAEA,CAACA;IACXA,IAAIA,CAACA,GAAGA,CAACA,CAACA;IACVA,MAAMA,CAACA;AACXA,CAACA;AACD,IAAI,CAAC,GAAG;IACJ,IAAI,CAAC,GAAG,EAAE,CAAC;IACX,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACd,CAAC,CAAC;AACF,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationStatements.sourcemap.txt b/tests/baselines/reference/sourceMapValidationStatements.sourcemap.txt index 789d98afe5a..2a2daed01db 100644 --- a/tests/baselines/reference/sourceMapValidationStatements.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationStatements.sourcemap.txt @@ -930,200 +930,191 @@ sourceFile:sourceMapValidationStatements.ts 9 >Emitted(52, 20) Source(47, 20) + SourceIndex(0) name (f) 10>Emitted(52, 21) Source(47, 21) + SourceIndex(0) name (f) --- ->>> case 0: +>>> case 0: { 1 >^^^^^^^^ 2 > ^^^^^ 3 > ^ +4 > ^^ +5 > ^ 1 > > 2 > case 3 > 0 +4 > : +5 > { 1 >Emitted(53, 9) Source(48, 9) + SourceIndex(0) name (f) 2 >Emitted(53, 14) Source(48, 14) + SourceIndex(0) name (f) 3 >Emitted(53, 15) Source(48, 15) + SourceIndex(0) name (f) +4 >Emitted(53, 17) Source(48, 17) + SourceIndex(0) name (f) +5 >Emitted(53, 18) Source(48, 18) + SourceIndex(0) name (f) --- ->>> { +>>> x++; 1 >^^^^^^^^^^^^ 2 > ^ -3 > ^^^^^^^^-> -1 >: -2 > { -1 >Emitted(54, 13) Source(48, 17) + SourceIndex(0) name (f) -2 >Emitted(54, 14) Source(48, 18) + SourceIndex(0) name (f) +3 > ^^ +4 > ^ +5 > ^^^-> +1 > + > +2 > x +3 > ++ +4 > ; +1 >Emitted(54, 13) Source(49, 13) + SourceIndex(0) name (f) +2 >Emitted(54, 14) Source(49, 14) + SourceIndex(0) name (f) +3 >Emitted(54, 16) Source(49, 16) + SourceIndex(0) name (f) +4 >Emitted(54, 17) Source(49, 17) + SourceIndex(0) name (f) --- ->>> x++; -1->^^^^^^^^^^^^^^^^ -2 > ^ -3 > ^^ -4 > ^ -5 > ^^^-> +>>> break; +1->^^^^^^^^^^^^ +2 > ^^^^^ +3 > ^ 1-> > -2 > x -3 > ++ -4 > ; -1->Emitted(55, 17) Source(49, 13) + SourceIndex(0) name (f) -2 >Emitted(55, 18) Source(49, 14) + SourceIndex(0) name (f) -3 >Emitted(55, 20) Source(49, 16) + SourceIndex(0) name (f) -4 >Emitted(55, 21) Source(49, 17) + SourceIndex(0) name (f) +2 > break +3 > ; +1->Emitted(55, 13) Source(50, 13) + SourceIndex(0) name (f) +2 >Emitted(55, 18) Source(50, 18) + SourceIndex(0) name (f) +3 >Emitted(55, 19) Source(50, 19) + SourceIndex(0) name (f) --- ->>> break; -1->^^^^^^^^^^^^^^^^ -2 > ^^^^^ -3 > ^ -1-> - > -2 > break -3 > ; -1->Emitted(56, 17) Source(50, 13) + SourceIndex(0) name (f) -2 >Emitted(56, 22) Source(50, 18) + SourceIndex(0) name (f) -3 >Emitted(56, 23) Source(50, 19) + SourceIndex(0) name (f) ---- ->>> } -1 >^^^^^^^^^^^^ -2 > ^ -3 > ^^^-> +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^-> 1 > > > -2 > } -1 >Emitted(57, 13) Source(52, 9) + SourceIndex(0) name (f) -2 >Emitted(57, 14) Source(52, 10) + SourceIndex(0) name (f) +2 > } +1 >Emitted(56, 9) Source(52, 9) + SourceIndex(0) name (f) +2 >Emitted(56, 10) Source(52, 10) + SourceIndex(0) name (f) --- ->>> case 1: +>>> case 1: { 1->^^^^^^^^ 2 > ^^^^^ 3 > ^ +4 > ^^ +5 > ^ 1-> > 2 > case 3 > 1 -1->Emitted(58, 9) Source(53, 9) + SourceIndex(0) name (f) -2 >Emitted(58, 14) Source(53, 14) + SourceIndex(0) name (f) -3 >Emitted(58, 15) Source(53, 15) + SourceIndex(0) name (f) +4 > : +5 > { +1->Emitted(57, 9) Source(53, 9) + SourceIndex(0) name (f) +2 >Emitted(57, 14) Source(53, 14) + SourceIndex(0) name (f) +3 >Emitted(57, 15) Source(53, 15) + SourceIndex(0) name (f) +4 >Emitted(57, 17) Source(53, 17) + SourceIndex(0) name (f) +5 >Emitted(57, 18) Source(53, 18) + SourceIndex(0) name (f) --- ->>> { +>>> x--; 1 >^^^^^^^^^^^^ 2 > ^ -3 > ^^^^^^^^-> -1 >: -2 > { -1 >Emitted(59, 13) Source(53, 17) + SourceIndex(0) name (f) -2 >Emitted(59, 14) Source(53, 18) + SourceIndex(0) name (f) +3 > ^^ +4 > ^ +5 > ^^^-> +1 > + > +2 > x +3 > -- +4 > ; +1 >Emitted(58, 13) Source(54, 13) + SourceIndex(0) name (f) +2 >Emitted(58, 14) Source(54, 14) + SourceIndex(0) name (f) +3 >Emitted(58, 16) Source(54, 16) + SourceIndex(0) name (f) +4 >Emitted(58, 17) Source(54, 17) + SourceIndex(0) name (f) --- ->>> x--; -1->^^^^^^^^^^^^^^^^ -2 > ^ -3 > ^^ -4 > ^ -5 > ^^^-> +>>> break; +1->^^^^^^^^^^^^ +2 > ^^^^^ +3 > ^ 1-> > -2 > x -3 > -- -4 > ; -1->Emitted(60, 17) Source(54, 13) + SourceIndex(0) name (f) -2 >Emitted(60, 18) Source(54, 14) + SourceIndex(0) name (f) -3 >Emitted(60, 20) Source(54, 16) + SourceIndex(0) name (f) -4 >Emitted(60, 21) Source(54, 17) + SourceIndex(0) name (f) +2 > break +3 > ; +1->Emitted(59, 13) Source(55, 13) + SourceIndex(0) name (f) +2 >Emitted(59, 18) Source(55, 18) + SourceIndex(0) name (f) +3 >Emitted(59, 19) Source(55, 19) + SourceIndex(0) name (f) --- ->>> break; -1->^^^^^^^^^^^^^^^^ -2 > ^^^^^ -3 > ^ -1-> - > -2 > break -3 > ; -1->Emitted(61, 17) Source(55, 13) + SourceIndex(0) name (f) -2 >Emitted(61, 22) Source(55, 18) + SourceIndex(0) name (f) -3 >Emitted(61, 23) Source(55, 19) + SourceIndex(0) name (f) ---- ->>> } -1 >^^^^^^^^^^^^ -2 > ^ -3 > ^^^^-> +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> 1 > > > -2 > } -1 >Emitted(62, 13) Source(57, 9) + SourceIndex(0) name (f) -2 >Emitted(62, 14) Source(57, 10) + SourceIndex(0) name (f) +2 > } +1 >Emitted(60, 9) Source(57, 9) + SourceIndex(0) name (f) +2 >Emitted(60, 10) Source(57, 10) + SourceIndex(0) name (f) --- ->>> default: +>>> default: { 1->^^^^^^^^ -2 > ^^^^^^-> +2 > ^^^^^^^^^ +3 > ^ +4 > ^^-> 1-> > -1->Emitted(63, 9) Source(58, 9) + SourceIndex(0) name (f) +2 > default: +3 > { +1->Emitted(61, 9) Source(58, 9) + SourceIndex(0) name (f) +2 >Emitted(61, 18) Source(58, 18) + SourceIndex(0) name (f) +3 >Emitted(61, 19) Source(58, 19) + SourceIndex(0) name (f) --- ->>> { +>>> x *= 2; 1->^^^^^^^^^^^^ 2 > ^ -3 > ^^^^^^^^^^^-> -1->default: -2 > { -1->Emitted(64, 13) Source(58, 18) + SourceIndex(0) name (f) -2 >Emitted(64, 14) Source(58, 19) + SourceIndex(0) name (f) ---- ->>> x *= 2; -1->^^^^^^^^^^^^^^^^ -2 > ^ -3 > ^^^^ -4 > ^ -5 > ^ -6 > ^-> +3 > ^^^^ +4 > ^ +5 > ^ +6 > ^-> 1-> > -2 > x -3 > *= -4 > 2 -5 > ; -1->Emitted(65, 17) Source(59, 13) + SourceIndex(0) name (f) -2 >Emitted(65, 18) Source(59, 14) + SourceIndex(0) name (f) -3 >Emitted(65, 22) Source(59, 18) + SourceIndex(0) name (f) -4 >Emitted(65, 23) Source(59, 19) + SourceIndex(0) name (f) -5 >Emitted(65, 24) Source(59, 20) + SourceIndex(0) name (f) +2 > x +3 > *= +4 > 2 +5 > ; +1->Emitted(62, 13) Source(59, 13) + SourceIndex(0) name (f) +2 >Emitted(62, 14) Source(59, 14) + SourceIndex(0) name (f) +3 >Emitted(62, 18) Source(59, 18) + SourceIndex(0) name (f) +4 >Emitted(62, 19) Source(59, 19) + SourceIndex(0) name (f) +5 >Emitted(62, 20) Source(59, 20) + SourceIndex(0) name (f) --- ->>> x = 50; -1->^^^^^^^^^^^^^^^^ -2 > ^ -3 > ^^^ -4 > ^^ -5 > ^ +>>> x = 50; +1->^^^^^^^^^^^^ +2 > ^ +3 > ^^^ +4 > ^^ +5 > ^ 1-> > -2 > x -3 > = -4 > 50 -5 > ; -1->Emitted(66, 17) Source(60, 13) + SourceIndex(0) name (f) -2 >Emitted(66, 18) Source(60, 14) + SourceIndex(0) name (f) -3 >Emitted(66, 21) Source(60, 17) + SourceIndex(0) name (f) -4 >Emitted(66, 23) Source(60, 19) + SourceIndex(0) name (f) -5 >Emitted(66, 24) Source(60, 20) + SourceIndex(0) name (f) +2 > x +3 > = +4 > 50 +5 > ; +1->Emitted(63, 13) Source(60, 13) + SourceIndex(0) name (f) +2 >Emitted(63, 14) Source(60, 14) + SourceIndex(0) name (f) +3 >Emitted(63, 17) Source(60, 17) + SourceIndex(0) name (f) +4 >Emitted(63, 19) Source(60, 19) + SourceIndex(0) name (f) +5 >Emitted(63, 20) Source(60, 20) + SourceIndex(0) name (f) --- ->>> break; -1 >^^^^^^^^^^^^^^^^ -2 > ^^^^^ -3 > ^ +>>> break; +1 >^^^^^^^^^^^^ +2 > ^^^^^ +3 > ^ 1 > > -2 > break -3 > ; -1 >Emitted(67, 17) Source(61, 13) + SourceIndex(0) name (f) -2 >Emitted(67, 22) Source(61, 18) + SourceIndex(0) name (f) -3 >Emitted(67, 23) Source(61, 19) + SourceIndex(0) name (f) +2 > break +3 > ; +1 >Emitted(64, 13) Source(61, 13) + SourceIndex(0) name (f) +2 >Emitted(64, 18) Source(61, 18) + SourceIndex(0) name (f) +3 >Emitted(64, 19) Source(61, 19) + SourceIndex(0) name (f) --- ->>> } -1 >^^^^^^^^^^^^ -2 > ^ +>>> } +1 >^^^^^^^^ +2 > ^ 1 > > > -2 > } -1 >Emitted(68, 13) Source(63, 9) + SourceIndex(0) name (f) -2 >Emitted(68, 14) Source(63, 10) + SourceIndex(0) name (f) +2 > } +1 >Emitted(65, 9) Source(63, 9) + SourceIndex(0) name (f) +2 >Emitted(65, 10) Source(63, 10) + SourceIndex(0) name (f) --- >>> } 1 >^^^^ @@ -1132,8 +1123,8 @@ sourceFile:sourceMapValidationStatements.ts 1 > > 2 > } -1 >Emitted(69, 5) Source(64, 5) + SourceIndex(0) name (f) -2 >Emitted(69, 6) Source(64, 6) + SourceIndex(0) name (f) +1 >Emitted(66, 5) Source(64, 5) + SourceIndex(0) name (f) +2 >Emitted(66, 6) Source(64, 6) + SourceIndex(0) name (f) --- >>> while (x < 10) { 1->^^^^ @@ -1151,13 +1142,13 @@ sourceFile:sourceMapValidationStatements.ts 5 > 10 6 > ) 7 > { -1->Emitted(70, 5) Source(65, 5) + SourceIndex(0) name (f) -2 >Emitted(70, 12) Source(65, 12) + SourceIndex(0) name (f) -3 >Emitted(70, 13) Source(65, 13) + SourceIndex(0) name (f) -4 >Emitted(70, 16) Source(65, 16) + SourceIndex(0) name (f) -5 >Emitted(70, 18) Source(65, 18) + SourceIndex(0) name (f) -6 >Emitted(70, 20) Source(65, 20) + SourceIndex(0) name (f) -7 >Emitted(70, 21) Source(65, 21) + SourceIndex(0) name (f) +1->Emitted(67, 5) Source(65, 5) + SourceIndex(0) name (f) +2 >Emitted(67, 12) Source(65, 12) + SourceIndex(0) name (f) +3 >Emitted(67, 13) Source(65, 13) + SourceIndex(0) name (f) +4 >Emitted(67, 16) Source(65, 16) + SourceIndex(0) name (f) +5 >Emitted(67, 18) Source(65, 18) + SourceIndex(0) name (f) +6 >Emitted(67, 20) Source(65, 20) + SourceIndex(0) name (f) +7 >Emitted(67, 21) Source(65, 21) + SourceIndex(0) name (f) --- >>> x++; 1 >^^^^^^^^ @@ -1169,10 +1160,10 @@ sourceFile:sourceMapValidationStatements.ts 2 > x 3 > ++ 4 > ; -1 >Emitted(71, 9) Source(66, 9) + SourceIndex(0) name (f) -2 >Emitted(71, 10) Source(66, 10) + SourceIndex(0) name (f) -3 >Emitted(71, 12) Source(66, 12) + SourceIndex(0) name (f) -4 >Emitted(71, 13) Source(66, 13) + SourceIndex(0) name (f) +1 >Emitted(68, 9) Source(66, 9) + SourceIndex(0) name (f) +2 >Emitted(68, 10) Source(66, 10) + SourceIndex(0) name (f) +3 >Emitted(68, 12) Source(66, 12) + SourceIndex(0) name (f) +4 >Emitted(68, 13) Source(66, 13) + SourceIndex(0) name (f) --- >>> } 1 >^^^^ @@ -1181,8 +1172,8 @@ sourceFile:sourceMapValidationStatements.ts 1 > > 2 > } -1 >Emitted(72, 5) Source(67, 5) + SourceIndex(0) name (f) -2 >Emitted(72, 6) Source(67, 6) + SourceIndex(0) name (f) +1 >Emitted(69, 5) Source(67, 5) + SourceIndex(0) name (f) +2 >Emitted(69, 6) Source(67, 6) + SourceIndex(0) name (f) --- >>> do { 1->^^^^ @@ -1193,9 +1184,9 @@ sourceFile:sourceMapValidationStatements.ts > 2 > do 3 > { -1->Emitted(73, 5) Source(68, 5) + SourceIndex(0) name (f) -2 >Emitted(73, 8) Source(68, 8) + SourceIndex(0) name (f) -3 >Emitted(73, 9) Source(68, 9) + SourceIndex(0) name (f) +1->Emitted(70, 5) Source(68, 5) + SourceIndex(0) name (f) +2 >Emitted(70, 8) Source(68, 8) + SourceIndex(0) name (f) +3 >Emitted(70, 9) Source(68, 9) + SourceIndex(0) name (f) --- >>> x--; 1->^^^^^^^^ @@ -1208,10 +1199,10 @@ sourceFile:sourceMapValidationStatements.ts 2 > x 3 > -- 4 > ; -1->Emitted(74, 9) Source(69, 9) + SourceIndex(0) name (f) -2 >Emitted(74, 10) Source(69, 10) + SourceIndex(0) name (f) -3 >Emitted(74, 12) Source(69, 12) + SourceIndex(0) name (f) -4 >Emitted(74, 13) Source(69, 13) + SourceIndex(0) name (f) +1->Emitted(71, 9) Source(69, 9) + SourceIndex(0) name (f) +2 >Emitted(71, 10) Source(69, 10) + SourceIndex(0) name (f) +3 >Emitted(71, 12) Source(69, 12) + SourceIndex(0) name (f) +4 >Emitted(71, 13) Source(69, 13) + SourceIndex(0) name (f) --- >>> } while (x > 4); 1->^^^^ @@ -1229,13 +1220,13 @@ sourceFile:sourceMapValidationStatements.ts 5 > > 6 > 4 7 > ) -1->Emitted(75, 5) Source(70, 5) + SourceIndex(0) name (f) -2 >Emitted(75, 6) Source(70, 6) + SourceIndex(0) name (f) -3 >Emitted(75, 14) Source(70, 14) + SourceIndex(0) name (f) -4 >Emitted(75, 15) Source(70, 15) + SourceIndex(0) name (f) -5 >Emitted(75, 18) Source(70, 18) + SourceIndex(0) name (f) -6 >Emitted(75, 19) Source(70, 19) + SourceIndex(0) name (f) -7 >Emitted(75, 21) Source(70, 20) + SourceIndex(0) name (f) +1->Emitted(72, 5) Source(70, 5) + SourceIndex(0) name (f) +2 >Emitted(72, 6) Source(70, 6) + SourceIndex(0) name (f) +3 >Emitted(72, 14) Source(70, 14) + SourceIndex(0) name (f) +4 >Emitted(72, 15) Source(70, 15) + SourceIndex(0) name (f) +5 >Emitted(72, 18) Source(70, 18) + SourceIndex(0) name (f) +6 >Emitted(72, 19) Source(70, 19) + SourceIndex(0) name (f) +7 >Emitted(72, 21) Source(70, 20) + SourceIndex(0) name (f) --- >>> x = y; 1 >^^^^ @@ -1250,11 +1241,11 @@ sourceFile:sourceMapValidationStatements.ts 3 > = 4 > y 5 > ; -1 >Emitted(76, 5) Source(71, 5) + SourceIndex(0) name (f) -2 >Emitted(76, 6) Source(71, 6) + SourceIndex(0) name (f) -3 >Emitted(76, 9) Source(71, 9) + SourceIndex(0) name (f) -4 >Emitted(76, 10) Source(71, 10) + SourceIndex(0) name (f) -5 >Emitted(76, 11) Source(71, 11) + SourceIndex(0) name (f) +1 >Emitted(73, 5) Source(71, 5) + SourceIndex(0) name (f) +2 >Emitted(73, 6) Source(71, 6) + SourceIndex(0) name (f) +3 >Emitted(73, 9) Source(71, 9) + SourceIndex(0) name (f) +4 >Emitted(73, 10) Source(71, 10) + SourceIndex(0) name (f) +5 >Emitted(73, 11) Source(71, 11) + SourceIndex(0) name (f) --- >>> var z = (x == 1) ? x + 1 : x - 1; 1->^^^^ @@ -1294,24 +1285,24 @@ sourceFile:sourceMapValidationStatements.ts 16> - 17> 1 18> ; -1->Emitted(77, 5) Source(72, 5) + SourceIndex(0) name (f) -2 >Emitted(77, 9) Source(72, 9) + SourceIndex(0) name (f) -3 >Emitted(77, 10) Source(72, 10) + SourceIndex(0) name (f) -4 >Emitted(77, 13) Source(72, 13) + SourceIndex(0) name (f) -5 >Emitted(77, 14) Source(72, 14) + SourceIndex(0) name (f) -6 >Emitted(77, 15) Source(72, 15) + SourceIndex(0) name (f) -7 >Emitted(77, 19) Source(72, 19) + SourceIndex(0) name (f) -8 >Emitted(77, 20) Source(72, 20) + SourceIndex(0) name (f) -9 >Emitted(77, 21) Source(72, 21) + SourceIndex(0) name (f) -10>Emitted(77, 24) Source(72, 24) + SourceIndex(0) name (f) -11>Emitted(77, 25) Source(72, 25) + SourceIndex(0) name (f) -12>Emitted(77, 28) Source(72, 28) + SourceIndex(0) name (f) -13>Emitted(77, 29) Source(72, 29) + SourceIndex(0) name (f) -14>Emitted(77, 32) Source(72, 32) + SourceIndex(0) name (f) -15>Emitted(77, 33) Source(72, 33) + SourceIndex(0) name (f) -16>Emitted(77, 36) Source(72, 36) + SourceIndex(0) name (f) -17>Emitted(77, 37) Source(72, 37) + SourceIndex(0) name (f) -18>Emitted(77, 38) Source(72, 38) + SourceIndex(0) name (f) +1->Emitted(74, 5) Source(72, 5) + SourceIndex(0) name (f) +2 >Emitted(74, 9) Source(72, 9) + SourceIndex(0) name (f) +3 >Emitted(74, 10) Source(72, 10) + SourceIndex(0) name (f) +4 >Emitted(74, 13) Source(72, 13) + SourceIndex(0) name (f) +5 >Emitted(74, 14) Source(72, 14) + SourceIndex(0) name (f) +6 >Emitted(74, 15) Source(72, 15) + SourceIndex(0) name (f) +7 >Emitted(74, 19) Source(72, 19) + SourceIndex(0) name (f) +8 >Emitted(74, 20) Source(72, 20) + SourceIndex(0) name (f) +9 >Emitted(74, 21) Source(72, 21) + SourceIndex(0) name (f) +10>Emitted(74, 24) Source(72, 24) + SourceIndex(0) name (f) +11>Emitted(74, 25) Source(72, 25) + SourceIndex(0) name (f) +12>Emitted(74, 28) Source(72, 28) + SourceIndex(0) name (f) +13>Emitted(74, 29) Source(72, 29) + SourceIndex(0) name (f) +14>Emitted(74, 32) Source(72, 32) + SourceIndex(0) name (f) +15>Emitted(74, 33) Source(72, 33) + SourceIndex(0) name (f) +16>Emitted(74, 36) Source(72, 36) + SourceIndex(0) name (f) +17>Emitted(74, 37) Source(72, 37) + SourceIndex(0) name (f) +18>Emitted(74, 38) Source(72, 38) + SourceIndex(0) name (f) --- >>> (x == 1) ? x + 1 : x - 1; 1 >^^^^ @@ -1345,21 +1336,21 @@ sourceFile:sourceMapValidationStatements.ts 13> - 14> 1 15> ; -1 >Emitted(78, 5) Source(73, 5) + SourceIndex(0) name (f) -2 >Emitted(78, 6) Source(73, 6) + SourceIndex(0) name (f) -3 >Emitted(78, 7) Source(73, 7) + SourceIndex(0) name (f) -4 >Emitted(78, 11) Source(73, 11) + SourceIndex(0) name (f) -5 >Emitted(78, 12) Source(73, 12) + SourceIndex(0) name (f) -6 >Emitted(78, 13) Source(73, 13) + SourceIndex(0) name (f) -7 >Emitted(78, 16) Source(73, 16) + SourceIndex(0) name (f) -8 >Emitted(78, 17) Source(73, 17) + SourceIndex(0) name (f) -9 >Emitted(78, 20) Source(73, 20) + SourceIndex(0) name (f) -10>Emitted(78, 21) Source(73, 21) + SourceIndex(0) name (f) -11>Emitted(78, 24) Source(73, 24) + SourceIndex(0) name (f) -12>Emitted(78, 25) Source(73, 25) + SourceIndex(0) name (f) -13>Emitted(78, 28) Source(73, 28) + SourceIndex(0) name (f) -14>Emitted(78, 29) Source(73, 29) + SourceIndex(0) name (f) -15>Emitted(78, 30) Source(73, 30) + SourceIndex(0) name (f) +1 >Emitted(75, 5) Source(73, 5) + SourceIndex(0) name (f) +2 >Emitted(75, 6) Source(73, 6) + SourceIndex(0) name (f) +3 >Emitted(75, 7) Source(73, 7) + SourceIndex(0) name (f) +4 >Emitted(75, 11) Source(73, 11) + SourceIndex(0) name (f) +5 >Emitted(75, 12) Source(73, 12) + SourceIndex(0) name (f) +6 >Emitted(75, 13) Source(73, 13) + SourceIndex(0) name (f) +7 >Emitted(75, 16) Source(73, 16) + SourceIndex(0) name (f) +8 >Emitted(75, 17) Source(73, 17) + SourceIndex(0) name (f) +9 >Emitted(75, 20) Source(73, 20) + SourceIndex(0) name (f) +10>Emitted(75, 21) Source(73, 21) + SourceIndex(0) name (f) +11>Emitted(75, 24) Source(73, 24) + SourceIndex(0) name (f) +12>Emitted(75, 25) Source(73, 25) + SourceIndex(0) name (f) +13>Emitted(75, 28) Source(73, 28) + SourceIndex(0) name (f) +14>Emitted(75, 29) Source(73, 29) + SourceIndex(0) name (f) +15>Emitted(75, 30) Source(73, 30) + SourceIndex(0) name (f) --- >>> x === 1; 1 >^^^^ @@ -1374,11 +1365,11 @@ sourceFile:sourceMapValidationStatements.ts 3 > === 4 > 1 5 > ; -1 >Emitted(79, 5) Source(74, 5) + SourceIndex(0) name (f) -2 >Emitted(79, 6) Source(74, 6) + SourceIndex(0) name (f) -3 >Emitted(79, 11) Source(74, 11) + SourceIndex(0) name (f) -4 >Emitted(79, 12) Source(74, 12) + SourceIndex(0) name (f) -5 >Emitted(79, 13) Source(74, 13) + SourceIndex(0) name (f) +1 >Emitted(76, 5) Source(74, 5) + SourceIndex(0) name (f) +2 >Emitted(76, 6) Source(74, 6) + SourceIndex(0) name (f) +3 >Emitted(76, 11) Source(74, 11) + SourceIndex(0) name (f) +4 >Emitted(76, 12) Source(74, 12) + SourceIndex(0) name (f) +5 >Emitted(76, 13) Source(74, 13) + SourceIndex(0) name (f) --- >>> x = z = 40; 1->^^^^ @@ -1396,13 +1387,13 @@ sourceFile:sourceMapValidationStatements.ts 5 > = 6 > 40 7 > ; -1->Emitted(80, 5) Source(75, 5) + SourceIndex(0) name (f) -2 >Emitted(80, 6) Source(75, 6) + SourceIndex(0) name (f) -3 >Emitted(80, 9) Source(75, 9) + SourceIndex(0) name (f) -4 >Emitted(80, 10) Source(75, 10) + SourceIndex(0) name (f) -5 >Emitted(80, 13) Source(75, 13) + SourceIndex(0) name (f) -6 >Emitted(80, 15) Source(75, 15) + SourceIndex(0) name (f) -7 >Emitted(80, 16) Source(75, 16) + SourceIndex(0) name (f) +1->Emitted(77, 5) Source(75, 5) + SourceIndex(0) name (f) +2 >Emitted(77, 6) Source(75, 6) + SourceIndex(0) name (f) +3 >Emitted(77, 9) Source(75, 9) + SourceIndex(0) name (f) +4 >Emitted(77, 10) Source(75, 10) + SourceIndex(0) name (f) +5 >Emitted(77, 13) Source(75, 13) + SourceIndex(0) name (f) +6 >Emitted(77, 15) Source(75, 15) + SourceIndex(0) name (f) +7 >Emitted(77, 16) Source(75, 16) + SourceIndex(0) name (f) --- >>> eval("y"); 1 >^^^^ @@ -1418,12 +1409,12 @@ sourceFile:sourceMapValidationStatements.ts 4 > "y" 5 > ) 6 > ; -1 >Emitted(81, 5) Source(76, 5) + SourceIndex(0) name (f) -2 >Emitted(81, 9) Source(76, 9) + SourceIndex(0) name (f) -3 >Emitted(81, 10) Source(76, 10) + SourceIndex(0) name (f) -4 >Emitted(81, 13) Source(76, 13) + SourceIndex(0) name (f) -5 >Emitted(81, 14) Source(76, 14) + SourceIndex(0) name (f) -6 >Emitted(81, 15) Source(76, 15) + SourceIndex(0) name (f) +1 >Emitted(78, 5) Source(76, 5) + SourceIndex(0) name (f) +2 >Emitted(78, 9) Source(76, 9) + SourceIndex(0) name (f) +3 >Emitted(78, 10) Source(76, 10) + SourceIndex(0) name (f) +4 >Emitted(78, 13) Source(76, 13) + SourceIndex(0) name (f) +5 >Emitted(78, 14) Source(76, 14) + SourceIndex(0) name (f) +6 >Emitted(78, 15) Source(76, 15) + SourceIndex(0) name (f) --- >>> return; 1 >^^^^ @@ -1433,9 +1424,9 @@ sourceFile:sourceMapValidationStatements.ts > 2 > return 3 > ; -1 >Emitted(82, 5) Source(77, 5) + SourceIndex(0) name (f) -2 >Emitted(82, 11) Source(77, 11) + SourceIndex(0) name (f) -3 >Emitted(82, 12) Source(77, 12) + SourceIndex(0) name (f) +1 >Emitted(79, 5) Source(77, 5) + SourceIndex(0) name (f) +2 >Emitted(79, 11) Source(77, 11) + SourceIndex(0) name (f) +3 >Emitted(79, 12) Source(77, 12) + SourceIndex(0) name (f) --- >>>} 1 > @@ -1444,8 +1435,8 @@ sourceFile:sourceMapValidationStatements.ts 1 > > 2 >} -1 >Emitted(83, 1) Source(78, 1) + SourceIndex(0) name (f) -2 >Emitted(83, 2) Source(78, 2) + SourceIndex(0) name (f) +1 >Emitted(80, 1) Source(78, 1) + SourceIndex(0) name (f) +2 >Emitted(80, 2) Source(78, 2) + SourceIndex(0) name (f) --- >>>var b = function () { 1-> @@ -1458,10 +1449,10 @@ sourceFile:sourceMapValidationStatements.ts 2 >var 3 > b 4 > = -1->Emitted(84, 1) Source(79, 1) + SourceIndex(0) -2 >Emitted(84, 5) Source(79, 5) + SourceIndex(0) -3 >Emitted(84, 6) Source(79, 6) + SourceIndex(0) -4 >Emitted(84, 9) Source(79, 9) + SourceIndex(0) +1->Emitted(81, 1) Source(79, 1) + SourceIndex(0) +2 >Emitted(81, 5) Source(79, 5) + SourceIndex(0) +3 >Emitted(81, 6) Source(79, 6) + SourceIndex(0) +4 >Emitted(81, 9) Source(79, 9) + SourceIndex(0) --- >>> var x = 10; 1->^^^^ @@ -1477,12 +1468,12 @@ sourceFile:sourceMapValidationStatements.ts 4 > = 5 > 10 6 > ; -1->Emitted(85, 5) Source(80, 5) + SourceIndex(0) -2 >Emitted(85, 9) Source(80, 9) + SourceIndex(0) -3 >Emitted(85, 10) Source(80, 10) + SourceIndex(0) -4 >Emitted(85, 13) Source(80, 13) + SourceIndex(0) -5 >Emitted(85, 15) Source(80, 15) + SourceIndex(0) -6 >Emitted(85, 16) Source(80, 16) + SourceIndex(0) +1->Emitted(82, 5) Source(80, 5) + SourceIndex(0) +2 >Emitted(82, 9) Source(80, 9) + SourceIndex(0) +3 >Emitted(82, 10) Source(80, 10) + SourceIndex(0) +4 >Emitted(82, 13) Source(80, 13) + SourceIndex(0) +5 >Emitted(82, 15) Source(80, 15) + SourceIndex(0) +6 >Emitted(82, 16) Source(80, 16) + SourceIndex(0) --- >>> x = x + 1; 1 >^^^^ @@ -1500,13 +1491,13 @@ sourceFile:sourceMapValidationStatements.ts 5 > + 6 > 1 7 > ; -1 >Emitted(86, 5) Source(81, 5) + SourceIndex(0) -2 >Emitted(86, 6) Source(81, 6) + SourceIndex(0) -3 >Emitted(86, 9) Source(81, 9) + SourceIndex(0) -4 >Emitted(86, 10) Source(81, 10) + SourceIndex(0) -5 >Emitted(86, 13) Source(81, 13) + SourceIndex(0) -6 >Emitted(86, 14) Source(81, 14) + SourceIndex(0) -7 >Emitted(86, 15) Source(81, 15) + SourceIndex(0) +1 >Emitted(83, 5) Source(81, 5) + SourceIndex(0) +2 >Emitted(83, 6) Source(81, 6) + SourceIndex(0) +3 >Emitted(83, 9) Source(81, 9) + SourceIndex(0) +4 >Emitted(83, 10) Source(81, 10) + SourceIndex(0) +5 >Emitted(83, 13) Source(81, 13) + SourceIndex(0) +6 >Emitted(83, 14) Source(81, 14) + SourceIndex(0) +7 >Emitted(83, 15) Source(81, 15) + SourceIndex(0) --- >>>}; 1 > @@ -1517,9 +1508,9 @@ sourceFile:sourceMapValidationStatements.ts > 2 >} 3 > ; -1 >Emitted(87, 1) Source(82, 1) + SourceIndex(0) -2 >Emitted(87, 2) Source(82, 2) + SourceIndex(0) -3 >Emitted(87, 3) Source(82, 3) + SourceIndex(0) +1 >Emitted(84, 1) Source(82, 1) + SourceIndex(0) +2 >Emitted(84, 2) Source(82, 2) + SourceIndex(0) +3 >Emitted(84, 3) Source(82, 3) + SourceIndex(0) --- >>>f(); 1-> @@ -1532,9 +1523,9 @@ sourceFile:sourceMapValidationStatements.ts 2 >f 3 > () 4 > ; -1->Emitted(88, 1) Source(83, 1) + SourceIndex(0) -2 >Emitted(88, 2) Source(83, 2) + SourceIndex(0) -3 >Emitted(88, 4) Source(83, 4) + SourceIndex(0) -4 >Emitted(88, 5) Source(83, 5) + SourceIndex(0) +1->Emitted(85, 1) Source(83, 1) + SourceIndex(0) +2 >Emitted(85, 2) Source(83, 2) + SourceIndex(0) +3 >Emitted(85, 4) Source(83, 4) + SourceIndex(0) +4 >Emitted(85, 5) Source(83, 5) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationStatements.js.map \ No newline at end of file diff --git a/tests/baselines/reference/spaceBeforeQuestionMarkInPropertyAssignment.js b/tests/baselines/reference/spaceBeforeQuestionMarkInPropertyAssignment.js index 87aff29c210..d439cc3b020 100644 --- a/tests/baselines/reference/spaceBeforeQuestionMarkInPropertyAssignment.js +++ b/tests/baselines/reference/spaceBeforeQuestionMarkInPropertyAssignment.js @@ -2,6 +2,4 @@ var x = {x ?: 1} // should not crash //// [spaceBeforeQuestionMarkInPropertyAssignment.js] -var x = { - x: 1 -}; // should not crash +var x = { x: 1 }; // should not crash diff --git a/tests/baselines/reference/specializationsShouldNotAffectEachOther.js b/tests/baselines/reference/specializationsShouldNotAffectEachOther.js index d0b84d99009..3116571166f 100644 --- a/tests/baselines/reference/specializationsShouldNotAffectEachOther.js +++ b/tests/baselines/reference/specializationsShouldNotAffectEachOther.js @@ -23,13 +23,9 @@ var keyExtent2: any[] = series.data.map(function (d: string) { return d; }); //// [specializationsShouldNotAffectEachOther.js] var series; function foo() { - var seriesExtent = function (series) { - return null; - }; + var seriesExtent = function (series) { return null; }; var series2; series2.map(seriesExtent); return null; } -var keyExtent2 = series.data.map(function (d) { - return d; -}); +var keyExtent2 = series.data.map(function (d) { return d; }); diff --git a/tests/baselines/reference/specializeVarArgs1.js b/tests/baselines/reference/specializeVarArgs1.js index 3eac6daa61f..cc09df1daa6 100644 --- a/tests/baselines/reference/specializeVarArgs1.js +++ b/tests/baselines/reference/specializeVarArgs1.js @@ -23,8 +23,6 @@ a.push('Some Value'); //// [specializeVarArgs1.js] -function observableArray() { - return null; -} +function observableArray() { return null; } var a = observableArray(); a.push('Some Value'); diff --git a/tests/baselines/reference/specializedInheritedConstructors1.js b/tests/baselines/reference/specializedInheritedConstructors1.js index 4c30628af4f..36280f9a44e 100644 --- a/tests/baselines/reference/specializedInheritedConstructors1.js +++ b/tests/baselines/reference/specializedInheritedConstructors1.js @@ -41,11 +41,7 @@ var MyView = (function (_super) { } return MyView; })(View); -var m = { - model: new Model() -}; -var aView = new View({ - model: new Model() -}); +var m = { model: new Model() }; +var aView = new View({ model: new Model() }); var aView2 = new View(m); var myView = new MyView(m); // was error diff --git a/tests/baselines/reference/specializedOverloadWithRestParameters.js b/tests/baselines/reference/specializedOverloadWithRestParameters.js index 56bf07f6fdf..f091a39677c 100644 --- a/tests/baselines/reference/specializedOverloadWithRestParameters.js +++ b/tests/baselines/reference/specializedOverloadWithRestParameters.js @@ -22,8 +22,7 @@ var __extends = this.__extends || function (d, b) { var Base = (function () { function Base() { } - Base.prototype.foo = function () { - }; + Base.prototype.foo = function () { }; return Base; })(); var Derived1 = (function (_super) { @@ -31,8 +30,7 @@ var Derived1 = (function (_super) { function Derived1() { _super.apply(this, arguments); } - Derived1.prototype.bar = function () { - }; + Derived1.prototype.bar = function () { }; return Derived1; })(Base); function f(tagName) { diff --git a/tests/baselines/reference/specializedSignatureAsCallbackParameter1.js b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.js index bf6c73bdf40..1607f730e42 100644 --- a/tests/baselines/reference/specializedSignatureAsCallbackParameter1.js +++ b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.js @@ -13,9 +13,5 @@ function x3(a, cb) { cb(a); } // both are errors -x3(1, function (x) { - return 1; -}); -x3(1, function (x) { - return 1; -}); +x3(1, function (x) { return 1; }); +x3(1, function (x) { return 1; }); diff --git a/tests/baselines/reference/specializedSignatureIsNotSubtypeOfNonSpecializedSignature.js b/tests/baselines/reference/specializedSignatureIsNotSubtypeOfNonSpecializedSignature.js index eaf0605ef17..e5e06d48a8d 100644 --- a/tests/baselines/reference/specializedSignatureIsNotSubtypeOfNonSpecializedSignature.js +++ b/tests/baselines/reference/specializedSignatureIsNotSubtypeOfNonSpecializedSignature.js @@ -69,27 +69,23 @@ var a3: { //// [specializedSignatureIsNotSubtypeOfNonSpecializedSignature.js] // Specialized signatures must be a subtype of a non-specialized signature // All the below should be errors -function foo(x) { -} +function foo(x) { } var C = (function () { function C() { } - C.prototype.foo = function (x) { - }; + C.prototype.foo = function (x) { }; return C; })(); var C2 = (function () { function C2() { } - C2.prototype.foo = function (x) { - }; + C2.prototype.foo = function (x) { }; return C2; })(); var C3 = (function () { function C3() { } - C3.prototype.foo = function (x) { - }; + C3.prototype.foo = function (x) { }; return C3; })(); var a; diff --git a/tests/baselines/reference/specializedSignatureIsSubtypeOfNonSpecializedSignature.js b/tests/baselines/reference/specializedSignatureIsSubtypeOfNonSpecializedSignature.js index 882d0da9124..17a886a0784 100644 --- a/tests/baselines/reference/specializedSignatureIsSubtypeOfNonSpecializedSignature.js +++ b/tests/baselines/reference/specializedSignatureIsSubtypeOfNonSpecializedSignature.js @@ -84,27 +84,23 @@ var a3: { //// [specializedSignatureIsSubtypeOfNonSpecializedSignature.js] // Specialized signatures must be a subtype of a non-specialized signature // All the below should not be errors -function foo(x) { -} +function foo(x) { } var C = (function () { function C() { } - C.prototype.foo = function (x) { - }; + C.prototype.foo = function (x) { }; return C; })(); var C2 = (function () { function C2() { } - C2.prototype.foo = function (x) { - }; + C2.prototype.foo = function (x) { }; return C2; })(); var C3 = (function () { function C3() { } - C3.prototype.foo = function (x) { - }; + C3.prototype.foo = function (x) { }; return C3; })(); var a; diff --git a/tests/baselines/reference/staticAndMemberFunctions.js b/tests/baselines/reference/staticAndMemberFunctions.js index 0d1d9e81900..71f146b72f7 100644 --- a/tests/baselines/reference/staticAndMemberFunctions.js +++ b/tests/baselines/reference/staticAndMemberFunctions.js @@ -8,9 +8,7 @@ class T { var T = (function () { function T() { } - T.x = function () { - }; - T.prototype.y = function () { - }; + T.x = function () { }; + T.prototype.y = function () { }; return T; })(); diff --git a/tests/baselines/reference/staticAndNonStaticPropertiesSameName.js b/tests/baselines/reference/staticAndNonStaticPropertiesSameName.js index ccfbcc85602..be667ae1f3b 100644 --- a/tests/baselines/reference/staticAndNonStaticPropertiesSameName.js +++ b/tests/baselines/reference/staticAndNonStaticPropertiesSameName.js @@ -11,9 +11,7 @@ class C { var C = (function () { function C() { } - C.prototype.f = function () { - }; - C.f = function () { - }; + C.prototype.f = function () { }; + C.f = function () { }; return C; })(); diff --git a/tests/baselines/reference/staticClassProps.js b/tests/baselines/reference/staticClassProps.js index 3dc7dbb67d0..aad40e29b76 100644 --- a/tests/baselines/reference/staticClassProps.js +++ b/tests/baselines/reference/staticClassProps.js @@ -12,8 +12,7 @@ class C var C = (function () { function C() { } - C.prototype.foo = function () { - }; + C.prototype.foo = function () { }; C.z = 1; return C; })(); diff --git a/tests/baselines/reference/staticFactory1.js b/tests/baselines/reference/staticFactory1.js index af5780d96cf..529cc230d73 100644 --- a/tests/baselines/reference/staticFactory1.js +++ b/tests/baselines/reference/staticFactory1.js @@ -23,9 +23,7 @@ var __extends = this.__extends || function (d, b) { var Base = (function () { function Base() { } - Base.prototype.foo = function () { - return 1; - }; + Base.prototype.foo = function () { return 1; }; Base.create = function () { return new this(); }; @@ -36,9 +34,7 @@ var Derived = (function (_super) { function Derived() { _super.apply(this, arguments); } - Derived.prototype.foo = function () { - return 2; - }; + Derived.prototype.foo = function () { return 2; }; return Derived; })(Base); var d = Derived.create(); diff --git a/tests/baselines/reference/staticGetterAndSetter.js b/tests/baselines/reference/staticGetterAndSetter.js index 7c6ef26e739..5c61af0b7cc 100644 --- a/tests/baselines/reference/staticGetterAndSetter.js +++ b/tests/baselines/reference/staticGetterAndSetter.js @@ -10,11 +10,8 @@ var Foo = (function () { function Foo() { } Object.defineProperty(Foo, "Foo", { - get: function () { - return 0; - }, - set: function (n) { - }, + get: function () { return 0; }, + set: function (n) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/staticInheritance.js b/tests/baselines/reference/staticInheritance.js index dfe39119d32..a577bad3a86 100644 --- a/tests/baselines/reference/staticInheritance.js +++ b/tests/baselines/reference/staticInheritance.js @@ -18,8 +18,7 @@ var __extends = this.__extends || function (d, b) { __.prototype = b.prototype; d.prototype = new __(); }; -function doThing(x) { -} +function doThing(x) { } var A = (function () { function A() { this.p = doThing(A); // OK diff --git a/tests/baselines/reference/staticInstanceResolution4.js b/tests/baselines/reference/staticInstanceResolution4.js index 6e81d67dc00..c74030d047e 100644 --- a/tests/baselines/reference/staticInstanceResolution4.js +++ b/tests/baselines/reference/staticInstanceResolution4.js @@ -9,8 +9,7 @@ A.foo(); var A = (function () { function A() { } - A.prototype.foo = function () { - }; + A.prototype.foo = function () { }; return A; })(); A.foo(); diff --git a/tests/baselines/reference/staticInstanceResolution5.js b/tests/baselines/reference/staticInstanceResolution5.js index 6ca976ae46a..843b79ec6f1 100644 --- a/tests/baselines/reference/staticInstanceResolution5.js +++ b/tests/baselines/reference/staticInstanceResolution5.js @@ -19,10 +19,7 @@ function z(w3: WinJS) { } //// [staticInstanceResolution5_1.js] define(["require", "exports"], function (require, exports) { // these 3 should be errors - var x = function (w1) { - }; - var y = function (w2) { - }; - function z(w3) { - } + var x = function (w1) { }; + var y = function (w2) { }; + function z(w3) { } }); diff --git a/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.js b/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.js index df0858edc08..edd657d7da1 100644 --- a/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.js +++ b/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.js @@ -17,18 +17,12 @@ var C = (function () { function C() { } C.foo = function () { - C.foo = function () { - }; + C.foo = function () { }; }; C.bar = function (x) { - C.bar = function () { - }; // error - C.bar = function (x) { - return x; - }; // ok - C.bar = function (x) { - return 1; - }; // ok + C.bar = function () { }; // error + C.bar = function (x) { return x; }; // ok + C.bar = function (x) { return 1; }; // ok return 1; }; return C; diff --git a/tests/baselines/reference/staticMemberExportAccess.js b/tests/baselines/reference/staticMemberExportAccess.js index 5de5a76ca7a..37799356708 100644 --- a/tests/baselines/reference/staticMemberExportAccess.js +++ b/tests/baselines/reference/staticMemberExportAccess.js @@ -24,9 +24,7 @@ Sammy.bar(); var Sammy = (function () { function Sammy() { } - Sammy.prototype.foo = function () { - return "hi"; - }; + Sammy.prototype.foo = function () { return "hi"; }; Sammy.bar = function () { return -1; }; diff --git a/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.js b/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.js index 23e6fa9dd06..7b24a29b326 100644 --- a/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.js +++ b/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.js @@ -29,15 +29,13 @@ c = a; var B = (function () { function B() { } - B.prototype.name = function () { - }; + B.prototype.name = function () { }; return B; })(); var C = (function () { function C() { } - C.name = function () { - }; + C.name = function () { }; return C; })(); var a = new B(); diff --git a/tests/baselines/reference/staticMembersUsingClassTypeParameter.js b/tests/baselines/reference/staticMembersUsingClassTypeParameter.js index 1c31ef82d91..0c728cdbab6 100644 --- a/tests/baselines/reference/staticMembersUsingClassTypeParameter.js +++ b/tests/baselines/reference/staticMembersUsingClassTypeParameter.js @@ -20,21 +20,18 @@ class C3 { var C = (function () { function C() { } - C.f = function (x) { - }; + C.f = function (x) { }; return C; })(); var C2 = (function () { function C2() { } - C2.f = function (x) { - }; + C2.f = function (x) { }; return C2; })(); var C3 = (function () { function C3() { } - C3.f = function (x) { - }; + C3.f = function (x) { }; return C3; })(); diff --git a/tests/baselines/reference/staticMethodsReferencingClassTypeParameters.js b/tests/baselines/reference/staticMethodsReferencingClassTypeParameters.js index 499e16ec581..76fa7d6249e 100644 --- a/tests/baselines/reference/staticMethodsReferencingClassTypeParameters.js +++ b/tests/baselines/reference/staticMethodsReferencingClassTypeParameters.js @@ -7,8 +7,6 @@ class C { var C = (function () { function C() { } - C.s = function (p) { - return p; - }; + C.s = function (p) { return p; }; return C; })(); diff --git a/tests/baselines/reference/staticModifierAlreadySeen.js b/tests/baselines/reference/staticModifierAlreadySeen.js index b097f3924e4..d767a9b51d1 100644 --- a/tests/baselines/reference/staticModifierAlreadySeen.js +++ b/tests/baselines/reference/staticModifierAlreadySeen.js @@ -8,8 +8,7 @@ class C { var C = (function () { function C() { } - C.bar = function () { - }; + C.bar = function () { }; C.foo = 1; return C; })(); diff --git a/tests/baselines/reference/staticOffOfInstance1.js b/tests/baselines/reference/staticOffOfInstance1.js index 41b7cd895bb..58cf24d0529 100644 --- a/tests/baselines/reference/staticOffOfInstance1.js +++ b/tests/baselines/reference/staticOffOfInstance1.js @@ -13,7 +13,6 @@ var List = (function () { List.prototype.Blah = function () { this.Foo(); }; - List.Foo = function () { - }; + List.Foo = function () { }; return List; })(); diff --git a/tests/baselines/reference/staticOffOfInstance2.js b/tests/baselines/reference/staticOffOfInstance2.js index ff139859bf7..ceac77419a4 100644 --- a/tests/baselines/reference/staticOffOfInstance2.js +++ b/tests/baselines/reference/staticOffOfInstance2.js @@ -16,7 +16,6 @@ var List = (function () { this.Foo(); // no error List.Foo(); }; - List.Foo = function () { - }; + List.Foo = function () { }; return List; })(); diff --git a/tests/baselines/reference/staticPropertyAndFunctionWithSameName.js b/tests/baselines/reference/staticPropertyAndFunctionWithSameName.js index 0308805cd7b..50252c606f4 100644 --- a/tests/baselines/reference/staticPropertyAndFunctionWithSameName.js +++ b/tests/baselines/reference/staticPropertyAndFunctionWithSameName.js @@ -18,7 +18,6 @@ var C = (function () { var D = (function () { function D() { } - D.prototype.f = function () { - }; + D.prototype.f = function () { }; return D; })(); diff --git a/tests/baselines/reference/staticPropertyNotInClassType.js b/tests/baselines/reference/staticPropertyNotInClassType.js index 22ff4276deb..e9df2b2158d 100644 --- a/tests/baselines/reference/staticPropertyNotInClassType.js +++ b/tests/baselines/reference/staticPropertyNotInClassType.js @@ -47,15 +47,10 @@ var NonGeneric; this.a = a; this.b = b; } - C.prototype.fn = function () { - return this; - }; + C.prototype.fn = function () { return this; }; Object.defineProperty(C, "x", { - get: function () { - return 1; - }, - set: function (v) { - }, + get: function () { return 1; }, + set: function (v) { }, enumerable: true, configurable: true }); @@ -78,15 +73,10 @@ var Generic; this.a = a; this.b = b; } - C.prototype.fn = function () { - return this; - }; + C.prototype.fn = function () { return this; }; Object.defineProperty(C, "x", { - get: function () { - return 1; - }, - set: function (v) { - }, + get: function () { return 1; }, + set: function (v) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/staticPrototypeProperty.js b/tests/baselines/reference/staticPrototypeProperty.js index cfd81bedeec..471ec743b59 100644 --- a/tests/baselines/reference/staticPrototypeProperty.js +++ b/tests/baselines/reference/staticPrototypeProperty.js @@ -11,8 +11,7 @@ class C2 { var C = (function () { function C() { } - C.prototype = function () { - }; + C.prototype = function () { }; return C; })(); var C2 = (function () { diff --git a/tests/baselines/reference/staticVisibility.js b/tests/baselines/reference/staticVisibility.js index 0da2e3dbe2c..7dbf49a2baa 100644 --- a/tests/baselines/reference/staticVisibility.js +++ b/tests/baselines/reference/staticVisibility.js @@ -58,13 +58,9 @@ var C2 = (function () { this.barback = ""; } Object.defineProperty(C2, "Bar", { - get: function () { - return "bar"; - } // ok + get: function () { return "bar"; } // ok , - set: function (bar) { - barback = bar; - } // not ok + set: function (bar) { barback = bar; } // not ok , enumerable: true, configurable: true diff --git a/tests/baselines/reference/statics.js b/tests/baselines/reference/statics.js index 4da39198b21..c69fa0aabd7 100644 --- a/tests/baselines/reference/statics.js +++ b/tests/baselines/reference/statics.js @@ -40,9 +40,7 @@ var M; this.c1 = c1; this.c2 = c2; this.x = C.y + this.c1 + this.c2 + c3; - this.g = function (v) { - return C.f(_this.x + C.y + v + _this.c1 + _this.c2 + C.pub); - }; + this.g = function (v) { return C.f(_this.x + C.y + v + _this.c1 + _this.c2 + C.pub); }; } C.f = function (n) { return "wow: " + (n + C.y + C.pub + C.priv); diff --git a/tests/baselines/reference/staticsInAFunction.js b/tests/baselines/reference/staticsInAFunction.js index e6959b7757a..e918f4b2901 100644 --- a/tests/baselines/reference/staticsInAFunction.js +++ b/tests/baselines/reference/staticsInAFunction.js @@ -11,6 +11,5 @@ function boo() { test(); test(name, string); test(name ? : any); - { - } + { } } diff --git a/tests/baselines/reference/staticsInConstructorBodies.js b/tests/baselines/reference/staticsInConstructorBodies.js index 044f183b370..bb91b52a18a 100644 --- a/tests/baselines/reference/staticsInConstructorBodies.js +++ b/tests/baselines/reference/staticsInConstructorBodies.js @@ -10,8 +10,7 @@ class C { var C = (function () { function C() { } - C.m1 = function () { - }; // ERROR + C.m1 = function () { }; // ERROR C.p1 = 0; // ERROR return C; })(); diff --git a/tests/baselines/reference/strictMode5.js b/tests/baselines/reference/strictMode5.js index c46de926dbb..8e4021820f1 100644 --- a/tests/baselines/reference/strictMode5.js +++ b/tests/baselines/reference/strictMode5.js @@ -36,8 +36,7 @@ var A = (function () { return _this.n(); }; }; - A.prototype.n = function () { - }; + A.prototype.n = function () { }; return A; })(); function bar(x) { diff --git a/tests/baselines/reference/stringIndexerAndConstructor.js b/tests/baselines/reference/stringIndexerAndConstructor.js index 6d4cc3747c0..db3b9b8770b 100644 --- a/tests/baselines/reference/stringIndexerAndConstructor.js +++ b/tests/baselines/reference/stringIndexerAndConstructor.js @@ -17,7 +17,6 @@ interface I { var C = (function () { function C() { } - C.v = function () { - }; + C.v = function () { }; return C; })(); diff --git a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.js b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.js index ed96311f526..9d70b66887c 100644 --- a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.js +++ b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.js @@ -106,8 +106,7 @@ var C = (function () { get: function () { return ''; }, - set: function (v) { - } // ok + set: function (v) { } // ok , enumerable: true, configurable: true @@ -115,8 +114,7 @@ var C = (function () { C.prototype.foo = function () { return ''; }; - C.foo = function () { - }; // ok + C.foo = function () { }; // ok Object.defineProperty(C, "X", { get: function () { return 1; @@ -131,8 +129,7 @@ var a; var b = { a: '', b: 1, - c: function () { - }, + c: function () { }, "d": '', "e": 1, 1.0: '', @@ -143,8 +140,7 @@ var b = { get X() { return ''; }, - set X(v) { - }, + set X(v) { }, foo: function () { return ''; } diff --git a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js index b9195403b20..c9278c40446 100644 --- a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js +++ b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js @@ -50,9 +50,7 @@ var __extends = this.__extends || function (d, b) { var A = (function () { function A() { } - A.prototype.foo = function () { - return ''; - }; + A.prototype.foo = function () { return ''; }; return A; })(); var B = (function (_super) { @@ -60,9 +58,7 @@ var B = (function (_super) { function B() { _super.apply(this, arguments); } - B.prototype.bar = function () { - return ''; - }; + B.prototype.bar = function () { return ''; }; return B; })(A); var Foo = (function () { diff --git a/tests/baselines/reference/stringIndexingResults.js b/tests/baselines/reference/stringIndexingResults.js index 4e80c25d9b9..a6e00d92ec2 100644 --- a/tests/baselines/reference/stringIndexingResults.js +++ b/tests/baselines/reference/stringIndexingResults.js @@ -54,9 +54,7 @@ var a; var r7 = a['y']; var r8 = a['a']; var r9 = a[1]; -var b = { - y: '' -}; +var b = { y: '' }; var r10 = b['y']; var r11 = b['a']; var r12 = b[1]; diff --git a/tests/baselines/reference/stringLiteralObjectLiteralDeclaration1.js b/tests/baselines/reference/stringLiteralObjectLiteralDeclaration1.js index a367c3400f8..2c9e54e610b 100644 --- a/tests/baselines/reference/stringLiteralObjectLiteralDeclaration1.js +++ b/tests/baselines/reference/stringLiteralObjectLiteralDeclaration1.js @@ -7,9 +7,7 @@ module m1 { //// [stringLiteralObjectLiteralDeclaration1.js] var m1; (function (m1) { - m1.n = { - 'foo bar': 4 - }; + m1.n = { 'foo bar': 4 }; })(m1 || (m1 = {})); diff --git a/tests/baselines/reference/stringLiteralPropertyNameWithLineContinuation1.js b/tests/baselines/reference/stringLiteralPropertyNameWithLineContinuation1.js index 0c46d72e23a..99ed3fb320a 100644 --- a/tests/baselines/reference/stringLiteralPropertyNameWithLineContinuation1.js +++ b/tests/baselines/reference/stringLiteralPropertyNameWithLineContinuation1.js @@ -5,8 +5,6 @@ x.text = "bar" //// [stringLiteralPropertyNameWithLineContinuation1.js] -var x = { - 'text\ -': 'hello' -}; +var x = { 'text\ +': 'hello' }; x.text = "bar"; diff --git a/tests/baselines/reference/stringLiteralTypeIsSubtypeOfString.js b/tests/baselines/reference/stringLiteralTypeIsSubtypeOfString.js index 64609d96ecc..01b5dc814a7 100644 --- a/tests/baselines/reference/stringLiteralTypeIsSubtypeOfString.js +++ b/tests/baselines/reference/stringLiteralTypeIsSubtypeOfString.js @@ -102,36 +102,21 @@ function f16(x: any) { } //// [stringLiteralTypeIsSubtypeOfString.js] // string literal types are subtypes of string, any -function f1(x) { -} -function f2(x) { -} -function f3(x) { -} -function f4(x) { -} -function f5(x) { -} -function f6(x) { -} -function f7(x) { -} -function f8(x) { -} -function f9(x) { -} +function f1(x) { } +function f2(x) { } +function f3(x) { } +function f4(x) { } +function f5(x) { } +function f6(x) { } +function f7(x) { } +function f8(x) { } +function f9(x) { } var C = (function () { function C() { } - C.prototype.toString = function () { - return null; - }; - C.prototype.charAt = function (pos) { - return null; - }; - C.prototype.charCodeAt = function (index) { - return null; - }; + C.prototype.toString = function () { return null; }; + C.prototype.charAt = function (pos) { return null; }; + C.prototype.charCodeAt = function (index) { return null; }; C.prototype.concat = function () { var strings = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -139,71 +124,32 @@ var C = (function () { } return null; }; - C.prototype.indexOf = function (searchString, position) { - return null; - }; - C.prototype.lastIndexOf = function (searchString, position) { - return null; - }; - C.prototype.localeCompare = function (that) { - return null; - }; - C.prototype.match = function (regexp) { - return null; - }; - C.prototype.replace = function (searchValue, replaceValue) { - return null; - }; - C.prototype.search = function (regexp) { - return null; - }; - C.prototype.slice = function (start, end) { - return null; - }; - C.prototype.split = function (separator, limit) { - return null; - }; - C.prototype.substring = function (start, end) { - return null; - }; - C.prototype.toLowerCase = function () { - return null; - }; - C.prototype.toLocaleLowerCase = function () { - return null; - }; - C.prototype.toUpperCase = function () { - return null; - }; - C.prototype.toLocaleUpperCase = function () { - return null; - }; - C.prototype.trim = function () { - return null; - }; - C.prototype.substr = function (from, length) { - return null; - }; - C.prototype.valueOf = function () { - return null; - }; + C.prototype.indexOf = function (searchString, position) { return null; }; + C.prototype.lastIndexOf = function (searchString, position) { return null; }; + C.prototype.localeCompare = function (that) { return null; }; + C.prototype.match = function (regexp) { return null; }; + C.prototype.replace = function (searchValue, replaceValue) { return null; }; + C.prototype.search = function (regexp) { return null; }; + C.prototype.slice = function (start, end) { return null; }; + C.prototype.split = function (separator, limit) { return null; }; + C.prototype.substring = function (start, end) { return null; }; + C.prototype.toLowerCase = function () { return null; }; + C.prototype.toLocaleLowerCase = function () { return null; }; + C.prototype.toUpperCase = function () { return null; }; + C.prototype.toLocaleUpperCase = function () { return null; }; + C.prototype.trim = function () { return null; }; + C.prototype.substr = function (from, length) { return null; }; + C.prototype.valueOf = function () { return null; }; return C; })(); -function f10(x) { -} -function f11(x) { -} -function f12(x) { -} -function f13(x) { -} +function f10(x) { } +function f11(x) { } +function f12(x) { } +function f13(x) { } var E; (function (E) { E[E["A"] = 0] = "A"; })(E || (E = {})); -function f14(x) { -} -function f15(x) { -} -function f16(x) { -} +function f14(x) { } +function f15(x) { } +function f16(x) { } diff --git a/tests/baselines/reference/stringLiteralTypesInImplementationSignatures.js b/tests/baselines/reference/stringLiteralTypesInImplementationSignatures.js index dc2b2a73412..724c20c6309 100644 --- a/tests/baselines/reference/stringLiteralTypesInImplementationSignatures.js +++ b/tests/baselines/reference/stringLiteralTypesInImplementationSignatures.js @@ -28,25 +28,18 @@ var b = { //// [stringLiteralTypesInImplementationSignatures.js] // String literal types are only valid in overload signatures -function foo(x) { -} -var f = function foo(x) { -}; -var f2 = function (x, y) { -}; +function foo(x) { } +var f = function foo(x) { }; +var f2 = function (x, y) { }; var C = (function () { function C() { } - C.prototype.foo = function (x) { - }; + C.prototype.foo = function (x) { }; return C; })(); var a; var b = { - foo: function (x) { - }, - a: function foo(x, y) { - }, - b: function (x) { - } + foo: function (x) { }, + a: function foo(x, y) { }, + b: function (x) { } }; diff --git a/tests/baselines/reference/stringLiteralTypesInImplementationSignatures2.js b/tests/baselines/reference/stringLiteralTypesInImplementationSignatures2.js index 2ecd3330e20..5050709c213 100644 --- a/tests/baselines/reference/stringLiteralTypesInImplementationSignatures2.js +++ b/tests/baselines/reference/stringLiteralTypesInImplementationSignatures2.js @@ -31,19 +31,15 @@ var b = { //// [stringLiteralTypesInImplementationSignatures2.js] // String literal types are only valid in overload signatures -function foo(x) { -} +function foo(x) { } var C = (function () { function C() { } - C.prototype.foo = function (x) { - }; + C.prototype.foo = function (x) { }; return C; })(); var a; var b = { - foo: function (x) { - }, - foo: function (x) { - } + foo: function (x) { }, + foo: function (x) { } }; diff --git a/tests/baselines/reference/stringPropCodeGen.js b/tests/baselines/reference/stringPropCodeGen.js index 46e1a6eb920..ae8cfa3d5aa 100644 --- a/tests/baselines/reference/stringPropCodeGen.js +++ b/tests/baselines/reference/stringPropCodeGen.js @@ -15,8 +15,7 @@ a.bar.toString(); //// [stringPropCodeGen.js] var a = { - "foo": function () { - }, + "foo": function () { }, "bar": 5 }; a.foo(); diff --git a/tests/baselines/reference/stripInternal1.js b/tests/baselines/reference/stripInternal1.js index 9deadf1fc31..c5d350bcd86 100644 --- a/tests/baselines/reference/stripInternal1.js +++ b/tests/baselines/reference/stripInternal1.js @@ -10,11 +10,9 @@ class C { var C = (function () { function C() { } - C.prototype.foo = function () { - }; + C.prototype.foo = function () { }; // @internal - C.prototype.bar = function () { - }; + C.prototype.bar = function () { }; return C; })(); diff --git a/tests/baselines/reference/structural1.js b/tests/baselines/reference/structural1.js index ebafbc8f0a0..73b033a525c 100644 --- a/tests/baselines/reference/structural1.js +++ b/tests/baselines/reference/structural1.js @@ -18,8 +18,5 @@ var M; function f(i) { } M.f = f; - f({ - salt: 2, - pepper: 0 - }); + f({ salt: 2, pepper: 0 }); })(M || (M = {})); diff --git a/tests/baselines/reference/subtypesOfAny.js b/tests/baselines/reference/subtypesOfAny.js index 973db6a9a74..e73a120ed63 100644 --- a/tests/baselines/reference/subtypesOfAny.js +++ b/tests/baselines/reference/subtypesOfAny.js @@ -149,8 +149,7 @@ var E; (function (E) { E[E["A"] = 0] = "A"; })(E || (E = {})); -function f() { -} +function f() { } var f; (function (f) { f.bar = 1; diff --git a/tests/baselines/reference/subtypesOfTypeParameter.js b/tests/baselines/reference/subtypesOfTypeParameter.js index d9901e6cea4..7fe3d28278b 100644 --- a/tests/baselines/reference/subtypesOfTypeParameter.js +++ b/tests/baselines/reference/subtypesOfTypeParameter.js @@ -143,8 +143,7 @@ var E; (function (E) { E[E["A"] = 0] = "A"; })(E || (E = {})); -function f() { -} +function f() { } var f; (function (f) { f.bar = 1; @@ -175,22 +174,12 @@ function f2(x, y) { var r4 = true ? x : new Date(); var r5 = true ? /1/ : x; var r5 = true ? x : /1/; - var r6 = true ? { - foo: 1 - } : x; - var r6 = true ? x : { - foo: 1 - }; - var r7 = true ? function () { - } : x; - var r7 = true ? x : function () { - }; - var r8 = true ? function (x) { - return x; - } : x; - var r8b = true ? x : function (x) { - return x; - }; // type parameters not identical across declarations + var r6 = true ? { foo: 1 } : x; + var r6 = true ? x : { foo: 1 }; + var r7 = true ? function () { } : x; + var r7 = true ? x : function () { }; + var r8 = true ? function (x) { return x; } : x; + var r8b = true ? x : function (x) { return x; }; // type parameters not identical across declarations var i1; var r9 = true ? i1 : x; var r9 = true ? x : i1; diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.js b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.js index 07f2170aca1..e1c137f77e4 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.js +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.js @@ -199,8 +199,7 @@ var E; (function (E) { E[E["A"] = 0] = "A"; })(E || (E = {})); -function f() { -} +function f() { } var f; (function (f) { f.bar = 1; @@ -242,26 +241,16 @@ function f9(x) { var r5 = true ? x : /1/; // ok } function f10(x) { - var r6 = true ? { - foo: 1 - } : x; // ok - var r6 = true ? x : { - foo: 1 - }; // ok + var r6 = true ? { foo: 1 } : x; // ok + var r6 = true ? x : { foo: 1 }; // ok } function f11(x) { - var r7 = true ? function () { - } : x; // ok - var r7 = true ? x : function () { - }; // ok + var r7 = true ? function () { } : x; // ok + var r7 = true ? x : function () { }; // ok } function f12(x) { - var r8 = true ? function (x) { - return x; - } : x; // ok - var r8b = true ? x : function (x) { - return x; - }; // ok, type parameters not identical across declarations + var r8 = true ? function (x) { return x; } : x; // ok + var r8b = true ? x : function (x) { return x; }; // ok, type parameters not identical across declarations } function f13(x) { var i1; diff --git a/tests/baselines/reference/subtypesOfUnion.js b/tests/baselines/reference/subtypesOfUnion.js index a18ebb944b9..926efc3e921 100644 --- a/tests/baselines/reference/subtypesOfUnion.js +++ b/tests/baselines/reference/subtypesOfUnion.js @@ -68,8 +68,7 @@ var A2 = (function () { } return A2; })(); -function f() { -} +function f() { } var f; (function (f) { f.bar = 1; diff --git a/tests/baselines/reference/subtypingWithCallSignatures.js b/tests/baselines/reference/subtypingWithCallSignatures.js index 560871cce4e..73ca2c6543c 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures.js +++ b/tests/baselines/reference/subtypingWithCallSignatures.js @@ -14,16 +14,8 @@ module CallSignature { //// [subtypingWithCallSignatures.js] var CallSignature; (function (CallSignature) { - var r = foo1(function (x) { - return 1; - }); // ok because base returns void - var r2 = foo1(function (x) { - return ''; - }); // ok because base returns void - var r3 = foo2(function (x, y) { - return 1; - }); // ok because base returns void - var r4 = foo2(function (x) { - return ''; - }); // ok because base returns void + var r = foo1(function (x) { return 1; }); // ok because base returns void + var r2 = foo1(function (x) { return ''; }); // ok because base returns void + var r3 = foo2(function (x, y) { return 1; }); // ok because base returns void + var r4 = foo2(function (x) { return ''; }); // ok because base returns void })(CallSignature || (CallSignature = {})); diff --git a/tests/baselines/reference/subtypingWithCallSignatures2.js b/tests/baselines/reference/subtypingWithCallSignatures2.js index cd430902af0..e1341914739 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures2.js +++ b/tests/baselines/reference/subtypingWithCallSignatures2.js @@ -206,160 +206,51 @@ var OtherDerived = (function (_super) { } return OtherDerived; })(Base); -var r1arg1 = function (x) { - return [ - x - ]; -}; -var r1arg2 = function (x) { - return [ - 1 - ]; -}; +var r1arg1 = function (x) { return [x]; }; +var r1arg2 = function (x) { return [1]; }; var r1 = foo1(r1arg1); // any, return types are not subtype of first overload -var r1a = [ - r1arg2, - r1arg1 -]; // generic signature, subtype in both directions -var r1b = [ - r1arg1, - r1arg2 -]; // generic signature, subtype in both directions -var r2arg1 = function (x) { - return [ - '' - ]; -}; -var r2arg2 = function (x) { - return [ - '' - ]; -}; +var r1a = [r1arg2, r1arg1]; // generic signature, subtype in both directions +var r1b = [r1arg1, r1arg2]; // generic signature, subtype in both directions +var r2arg1 = function (x) { return ['']; }; +var r2arg2 = function (x) { return ['']; }; var r2 = foo2(r2arg1); -var r2a = [ - r2arg1, - r2arg2 -]; -var r2b = [ - r2arg2, - r2arg1 -]; -var r3arg1 = function (x) { - return x; -}; -var r3arg2 = function (x) { -}; +var r2a = [r2arg1, r2arg2]; +var r2b = [r2arg2, r2arg1]; +var r3arg1 = function (x) { return x; }; +var r3arg2 = function (x) { }; var r3 = foo3(r3arg1); -var r3a = [ - r3arg1, - r3arg2 -]; -var r3b = [ - r3arg2, - r3arg1 -]; -var r4arg1 = function (x, y) { - return x; -}; -var r4arg2 = function (x, y) { - return ''; -}; +var r3a = [r3arg1, r3arg2]; +var r3b = [r3arg2, r3arg1]; +var r4arg1 = function (x, y) { return x; }; +var r4arg2 = function (x, y) { return ''; }; var r4 = foo4(r4arg1); // any -var r4a = [ - r4arg1, - r4arg2 -]; -var r4b = [ - r4arg2, - r4arg1 -]; -var r5arg1 = function (x) { - return null; -}; -var r5arg2 = function (x) { - return ''; -}; +var r4a = [r4arg1, r4arg2]; +var r4b = [r4arg2, r4arg1]; +var r5arg1 = function (x) { return null; }; +var r5arg2 = function (x) { return ''; }; var r5 = foo5(r5arg1); // any -var r5a = [ - r5arg1, - r5arg2 -]; -var r5b = [ - r5arg2, - r5arg1 -]; -var r6arg1 = function (x) { - return null; -}; -var r6arg2 = function (x) { - return null; -}; +var r5a = [r5arg1, r5arg2]; +var r5b = [r5arg2, r5arg1]; +var r6arg1 = function (x) { return null; }; +var r6arg2 = function (x) { return null; }; var r6 = foo6(r6arg1); // any -var r6a = [ - r6arg1, - r6arg2 -]; -var r6b = [ - r6arg2, - r6arg1 -]; -var r7arg1 = function (x) { - return function (r) { - return null; - }; -}; -var r7arg2 = function (x) { - return function (r) { - return null; - }; -}; +var r6a = [r6arg1, r6arg2]; +var r6b = [r6arg2, r6arg1]; +var r7arg1 = function (x) { return function (r) { return null; }; }; +var r7arg2 = function (x) { return function (r) { return null; }; }; var r7 = foo7(r7arg1); // any -var r7a = [ - r7arg1, - r7arg2 -]; -var r7b = [ - r7arg2, - r7arg1 -]; -var r8arg1 = function (x, y) { - return function (r) { - return null; - }; -}; -var r8arg2 = function (x, y) { - return function (r) { - return null; - }; -}; +var r7a = [r7arg1, r7arg2]; +var r7b = [r7arg2, r7arg1]; +var r8arg1 = function (x, y) { return function (r) { return null; }; }; +var r8arg2 = function (x, y) { return function (r) { return null; }; }; var r8 = foo8(r8arg1); // any -var r8a = [ - r8arg1, - r8arg2 -]; -var r8b = [ - r8arg2, - r8arg1 -]; -var r9arg1 = function (x, y) { - return function (r) { - return null; - }; -}; -var r9arg2 = function (x, y) { - return function (r) { - return null; - }; -}; +var r8a = [r8arg1, r8arg2]; +var r8b = [r8arg2, r8arg1]; +var r9arg1 = function (x, y) { return function (r) { return null; }; }; +var r9arg2 = function (x, y) { return function (r) { return null; }; }; var r9 = foo9(r9arg1); // any -var r9a = [ - r9arg1, - r9arg2 -]; -var r9b = [ - r9arg2, - r9arg1 -]; +var r9a = [r9arg1, r9arg2]; +var r9b = [r9arg2, r9arg1]; var r10arg1 = function () { var x = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -375,89 +266,33 @@ var r10arg2 = function () { return null; }; var r10 = foo10(r10arg1); // any -var r10a = [ - r10arg1, - r10arg2 -]; -var r10b = [ - r10arg2, - r10arg1 -]; -var r11arg1 = function (x, y) { - return x; -}; -var r11arg2 = function (x, y) { - return null; -}; +var r10a = [r10arg1, r10arg2]; +var r10b = [r10arg2, r10arg1]; +var r11arg1 = function (x, y) { return x; }; +var r11arg2 = function (x, y) { return null; }; var r11 = foo11(r11arg1); // any -var r11a = [ - r11arg1, - r11arg2 -]; -var r11b = [ - r11arg2, - r11arg1 -]; -var r12arg1 = function (x, y) { - return null; -}; -var r12arg2 = function (x, y) { - return null; -}; +var r11a = [r11arg1, r11arg2]; +var r11b = [r11arg2, r11arg1]; +var r12arg1 = function (x, y) { return null; }; +var r12arg2 = function (x, y) { return null; }; var r12 = foo12(r12arg1); // any -var r12a = [ - r12arg1, - r12arg2 -]; -var r12b = [ - r12arg2, - r12arg1 -]; -var r13arg1 = function (x, y) { - return y; -}; -var r13arg2 = function (x, y) { - return null; -}; +var r12a = [r12arg1, r12arg2]; +var r12b = [r12arg2, r12arg1]; +var r13arg1 = function (x, y) { return y; }; +var r13arg2 = function (x, y) { return null; }; var r13 = foo13(r13arg1); // any -var r13a = [ - r13arg1, - r13arg2 -]; -var r13b = [ - r13arg2, - r13arg1 -]; -var r14arg1 = function (x) { - return x.a; -}; -var r14arg2 = function (x) { - return null; -}; +var r13a = [r13arg1, r13arg2]; +var r13b = [r13arg2, r13arg1]; +var r14arg1 = function (x) { return x.a; }; +var r14arg2 = function (x) { return null; }; var r14 = foo14(r14arg1); // any -var r14a = [ - r14arg1, - r14arg2 -]; -var r14b = [ - r14arg2, - r14arg1 -]; -var r15arg1 = function (x) { - return null; -}; +var r14a = [r14arg1, r14arg2]; +var r14b = [r14arg2, r14arg1]; +var r15arg1 = function (x) { return null; }; var r15 = foo15(r15arg1); // any -var r16arg1 = function (x) { - return [ - 1 - ]; -}; +var r16arg1 = function (x) { return [1]; }; var r16 = foo16(r16arg1); -var r17arg1 = function (x) { - return null; -}; +var r17arg1 = function (x) { return null; }; var r17 = foo17(r17arg1); // any -var r18arg1 = function (x) { - return null; -}; +var r18arg1 = function (x) { return null; }; var r18 = foo18(r18arg1); diff --git a/tests/baselines/reference/subtypingWithCallSignatures3.js b/tests/baselines/reference/subtypingWithCallSignatures3.js index 9dd2cb7a87e..fb7b0fef551 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures3.js +++ b/tests/baselines/reference/subtypingWithCallSignatures3.js @@ -155,67 +155,19 @@ var Errors; } return OtherDerived; })(Base); - var r1 = foo2(function (x) { - return null; - }); // any - var r1a = [ - function (x) { - return [ - '' - ]; - }, - function (x) { - return null; - } - ]; - var r1b = [ - function (x) { - return null; - }, - function (x) { - return [ - '' - ]; - } - ]; - var r2arg = function (x) { - return function (r) { - return null; - }; - }; - var r2arg2 = function (x) { - return function (r) { - return null; - }; - }; + var r1 = foo2(function (x) { return null; }); // any + var r1a = [function (x) { return ['']; }, function (x) { return null; }]; + var r1b = [function (x) { return null; }, function (x) { return ['']; }]; + var r2arg = function (x) { return function (r) { return null; }; }; + var r2arg2 = function (x) { return function (r) { return null; }; }; var r2 = foo7(r2arg); // any - var r2a = [ - r2arg2, - r2arg - ]; - var r2b = [ - r2arg, - r2arg2 - ]; - var r3arg = function (x, y) { - return function (r) { - return null; - }; - }; - var r3arg2 = function (x, y) { - return function (r) { - return null; - }; - }; + var r2a = [r2arg2, r2arg]; + var r2b = [r2arg, r2arg2]; + var r3arg = function (x, y) { return function (r) { return null; }; }; + var r3arg2 = function (x, y) { return function (r) { return null; }; }; var r3 = foo8(r3arg); // any - var r3a = [ - r3arg2, - r3arg - ]; - var r3b = [ - r3arg, - r3arg2 - ]; + var r3a = [r3arg2, r3arg]; + var r3b = [r3arg, r3arg2]; var r4arg = function () { var x = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -231,90 +183,36 @@ var Errors; return null; }; var r4 = foo10(r4arg); // any - var r4a = [ - r4arg2, - r4arg - ]; - var r4b = [ - r4arg, - r4arg2 - ]; - var r5arg = function (x, y) { - return null; - }; - var r5arg2 = function (x, y) { - return null; - }; + var r4a = [r4arg2, r4arg]; + var r4b = [r4arg, r4arg2]; + var r5arg = function (x, y) { return null; }; + var r5arg2 = function (x, y) { return null; }; var r5 = foo11(r5arg); // any - var r5a = [ - r5arg2, - r5arg - ]; - var r5b = [ - r5arg, - r5arg2 - ]; - var r6arg = function (x, y) { - return null; - }; - var r6arg2 = function (x, y) { - return null; - }; + var r5a = [r5arg2, r5arg]; + var r5b = [r5arg, r5arg2]; + var r6arg = function (x, y) { return null; }; + var r6arg2 = function (x, y) { return null; }; var r6 = foo12(r6arg); // (x: Array, y: Array) => Array - var r6a = [ - r6arg2, - r6arg - ]; - var r6b = [ - r6arg, - r6arg2 - ]; - var r7arg = function (x) { - return null; - }; - var r7arg2 = function (x) { - return 1; - }; + var r6a = [r6arg2, r6arg]; + var r6b = [r6arg, r6arg2]; + var r7arg = function (x) { return null; }; + var r7arg2 = function (x) { return 1; }; var r7 = foo15(r7arg); // any - var r7a = [ - r7arg2, - r7arg - ]; - var r7b = [ - r7arg, - r7arg2 - ]; - var r7arg3 = function (x) { - return 1; - }; + var r7a = [r7arg2, r7arg]; + var r7b = [r7arg, r7arg2]; + var r7arg3 = function (x) { return 1; }; var r7c = foo15(r7arg3); // (x: { a: string; b: number }) => number): number; - var r7d = [ - r7arg2, - r7arg3 - ]; - var r7e = [ - r7arg3, - r7arg2 - ]; - var r8arg = function (x) { - return null; - }; + var r7d = [r7arg2, r7arg3]; + var r7e = [r7arg3, r7arg2]; + var r8arg = function (x) { return null; }; var r8 = foo16(r8arg); // any - var r9arg = function (x) { - return null; - }; + var r9arg = function (x) { return null; }; var r9 = foo17(r9arg); // (x: { (a: T): T; (a: T): T; }): any[]; (x: { (a: T): T; (a: T): T; }): any[]; })(Errors || (Errors = {})); var WithGenericSignaturesInBaseType; (function (WithGenericSignaturesInBaseType) { - var r2arg2 = function (x) { - return [ - '' - ]; - }; + var r2arg2 = function (x) { return ['']; }; var r2 = foo2(r2arg2); // (x:T) => T[] since we can infer from generic signatures now - var r3arg2 = function (x) { - return null; - }; + var r3arg2 = function (x) { return null; }; var r3 = foo3(r3arg2); // any })(WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = {})); diff --git a/tests/baselines/reference/subtypingWithCallSignatures4.js b/tests/baselines/reference/subtypingWithCallSignatures4.js index abdef75ef91..cbdf92e2e60 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures4.js +++ b/tests/baselines/reference/subtypingWithCallSignatures4.js @@ -145,149 +145,52 @@ var OtherDerived = (function (_super) { } return OtherDerived; })(Base); -var r1arg = function (x) { - return null; -}; -var r1arg2 = function (x) { - return null; -}; +var r1arg = function (x) { return null; }; +var r1arg2 = function (x) { return null; }; var r1 = foo1(r1arg); -var r1a = [ - r1arg, - r1arg2 -]; -var r1b = [ - r1arg2, - r1arg -]; -var r2arg = function (x) { - return [ - '' - ]; -}; -var r2arg2 = function (x) { - return [ - '' - ]; -}; +var r1a = [r1arg, r1arg2]; +var r1b = [r1arg2, r1arg]; +var r2arg = function (x) { return ['']; }; +var r2arg2 = function (x) { return ['']; }; var r2 = foo2(r2arg); -var r2a = [ - r2arg, - r2arg2 -]; -var r2b = [ - r2arg2, - r2arg -]; -var r3arg = function (x) { - return null; -}; -var r3arg2 = function (x) { -}; +var r2a = [r2arg, r2arg2]; +var r2b = [r2arg2, r2arg]; +var r3arg = function (x) { return null; }; +var r3arg2 = function (x) { }; var r3 = foo3(r3arg); -var r3a = [ - r3arg, - r3arg2 -]; -var r3b = [ - r3arg2, - r3arg -]; -var r4arg = function (x, y) { - return ''; -}; -var r4arg2 = function (x, y) { - return ''; -}; +var r3a = [r3arg, r3arg2]; +var r3b = [r3arg2, r3arg]; +var r4arg = function (x, y) { return ''; }; +var r4arg2 = function (x, y) { return ''; }; var r4 = foo4(r4arg); -var r4a = [ - r4arg, - r4arg2 -]; -var r4b = [ - r4arg2, - r4arg -]; -var r5arg = function (x) { - return null; -}; -var r5arg2 = function (x) { - return null; -}; +var r4a = [r4arg, r4arg2]; +var r4b = [r4arg2, r4arg]; +var r5arg = function (x) { return null; }; +var r5arg2 = function (x) { return null; }; var r5 = foo5(r5arg); -var r5a = [ - r5arg, - r5arg2 -]; -var r5b = [ - r5arg2, - r5arg -]; -var r6arg = function (x) { - return null; -}; -var r6arg2 = function (x) { - return null; -}; +var r5a = [r5arg, r5arg2]; +var r5b = [r5arg2, r5arg]; +var r6arg = function (x) { return null; }; +var r6arg2 = function (x) { return null; }; var r6 = foo6(r6arg); -var r6a = [ - r6arg, - r6arg2 -]; -var r6b = [ - r6arg2, - r6arg -]; -var r11arg = function (x, y) { - return null; -}; -var r11arg2 = function (x, y) { - return null; -}; +var r6a = [r6arg, r6arg2]; +var r6b = [r6arg2, r6arg]; +var r11arg = function (x, y) { return null; }; +var r11arg2 = function (x, y) { return null; }; var r11 = foo11(r11arg); -var r11a = [ - r11arg, - r11arg2 -]; -var r11b = [ - r11arg2, - r11arg -]; -var r15arg = function (x) { - return null; -}; -var r15arg2 = function (x) { - return null; -}; +var r11a = [r11arg, r11arg2]; +var r11b = [r11arg2, r11arg]; +var r15arg = function (x) { return null; }; +var r15arg2 = function (x) { return null; }; var r15 = foo15(r15arg); -var r15a = [ - r15arg, - r15arg2 -]; -var r15b = [ - r15arg2, - r15arg -]; -var r16arg = function (x) { - return null; -}; -var r16arg2 = function (x) { - return null; -}; +var r15a = [r15arg, r15arg2]; +var r15b = [r15arg2, r15arg]; +var r16arg = function (x) { return null; }; +var r16arg2 = function (x) { return null; }; var r16 = foo16(r16arg); -var r16a = [ - r16arg, - r16arg2 -]; -var r16b = [ - r16arg2, - r16arg -]; -var r17arg = function (x) { - return null; -}; +var r16a = [r16arg, r16arg2]; +var r16b = [r16arg2, r16arg]; +var r17arg = function (x) { return null; }; var r17 = foo17(r17arg); -var r18arg = function (x) { - return null; -}; +var r18arg = function (x) { return null; }; var r18 = foo18(r18arg); diff --git a/tests/baselines/reference/subtypingWithCallSignaturesA.js b/tests/baselines/reference/subtypingWithCallSignaturesA.js index 5a679844573..a6c8da99b8c 100644 --- a/tests/baselines/reference/subtypingWithCallSignaturesA.js +++ b/tests/baselines/reference/subtypingWithCallSignaturesA.js @@ -3,6 +3,4 @@ declare function foo3(cb: (x: number) => number): typeof cb; var r5 = foo3((x: number) => ''); // error //// [subtypingWithCallSignaturesA.js] -var r5 = foo3(function (x) { - return ''; -}); // error +var r5 = foo3(function (x) { return ''; }); // error diff --git a/tests/baselines/reference/subtypingWithConstructSignatures2.js b/tests/baselines/reference/subtypingWithConstructSignatures2.js index ebedd898491..9a7ecd791c3 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures2.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures2.js @@ -209,157 +209,73 @@ var OtherDerived = (function (_super) { var r1arg1; var r1arg2; var r1 = foo1(r1arg1); // any, return types are not subtype of first overload -var r1a = [ - r1arg2, - r1arg1 -]; // generic signature, subtype in both directions -var r1b = [ - r1arg1, - r1arg2 -]; // generic signature, subtype in both directions +var r1a = [r1arg2, r1arg1]; // generic signature, subtype in both directions +var r1b = [r1arg1, r1arg2]; // generic signature, subtype in both directions var r2arg1; var r2arg2; var r2 = foo2(r2arg1); -var r2a = [ - r2arg1, - r2arg2 -]; -var r2b = [ - r2arg2, - r2arg1 -]; +var r2a = [r2arg1, r2arg2]; +var r2b = [r2arg2, r2arg1]; var r3arg1; var r3arg2; var r3 = foo3(r3arg1); -var r3a = [ - r3arg1, - r3arg2 -]; -var r3b = [ - r3arg2, - r3arg1 -]; +var r3a = [r3arg1, r3arg2]; +var r3b = [r3arg2, r3arg1]; var r4arg1; var r4arg2; var r4 = foo4(r4arg1); // any -var r4a = [ - r4arg1, - r4arg2 -]; -var r4b = [ - r4arg2, - r4arg1 -]; +var r4a = [r4arg1, r4arg2]; +var r4b = [r4arg2, r4arg1]; var r5arg1; var r5arg2; var r5 = foo5(r5arg1); // any -var r5a = [ - r5arg1, - r5arg2 -]; -var r5b = [ - r5arg2, - r5arg1 -]; +var r5a = [r5arg1, r5arg2]; +var r5b = [r5arg2, r5arg1]; var r6arg1; var r6arg2; var r6 = foo6(r6arg1); // any -var r6a = [ - r6arg1, - r6arg2 -]; -var r6b = [ - r6arg2, - r6arg1 -]; +var r6a = [r6arg1, r6arg2]; +var r6b = [r6arg2, r6arg1]; var r7arg1; var r7arg2; var r7 = foo7(r7arg1); // any -var r7a = [ - r7arg1, - r7arg2 -]; -var r7b = [ - r7arg2, - r7arg1 -]; +var r7a = [r7arg1, r7arg2]; +var r7b = [r7arg2, r7arg1]; var r8arg1; var r8arg2; var r8 = foo8(r8arg1); // any -var r8a = [ - r8arg1, - r8arg2 -]; -var r8b = [ - r8arg2, - r8arg1 -]; +var r8a = [r8arg1, r8arg2]; +var r8b = [r8arg2, r8arg1]; var r9arg1; var r9arg2; var r9 = foo9(r9arg1); // any -var r9a = [ - r9arg1, - r9arg2 -]; -var r9b = [ - r9arg2, - r9arg1 -]; +var r9a = [r9arg1, r9arg2]; +var r9b = [r9arg2, r9arg1]; var r10arg1; var r10arg2; var r10 = foo10(r10arg1); // any -var r10a = [ - r10arg1, - r10arg2 -]; -var r10b = [ - r10arg2, - r10arg1 -]; +var r10a = [r10arg1, r10arg2]; +var r10b = [r10arg2, r10arg1]; var r11arg1; var r11arg2; var r11 = foo11(r11arg1); // any -var r11a = [ - r11arg1, - r11arg2 -]; -var r11b = [ - r11arg2, - r11arg1 -]; +var r11a = [r11arg1, r11arg2]; +var r11b = [r11arg2, r11arg1]; var r12arg1; var r12arg2; var r12 = foo12(r12arg1); // any -var r12a = [ - r12arg1, - r12arg2 -]; -var r12b = [ - r12arg2, - r12arg1 -]; +var r12a = [r12arg1, r12arg2]; +var r12b = [r12arg2, r12arg1]; var r13arg1; var r13arg2; var r13 = foo13(r13arg1); // any -var r13a = [ - r13arg1, - r13arg2 -]; -var r13b = [ - r13arg2, - r13arg1 -]; +var r13a = [r13arg1, r13arg2]; +var r13b = [r13arg2, r13arg1]; var r14arg1; var r14arg2; var r14 = foo14(r14arg1); // any -var r14a = [ - r14arg1, - r14arg2 -]; -var r14b = [ - r14arg2, - r14arg1 -]; +var r14a = [r14arg1, r14arg2]; +var r14b = [r14arg2, r14arg1]; var r15arg1; var r15 = foo15(r15arg1); // any var r16arg1; diff --git a/tests/baselines/reference/subtypingWithConstructSignatures3.js b/tests/baselines/reference/subtypingWithConstructSignatures3.js index f32f26fc693..a74c14e8d4b 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures3.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures3.js @@ -160,90 +160,42 @@ var Errors; var r1arg1; var r1arg2; var r1 = foo2(r1arg1); // any - var r1a = [ - r1arg2, - r1arg1 - ]; - var r1b = [ - r1arg1, - r1arg2 - ]; + var r1a = [r1arg2, r1arg1]; + var r1b = [r1arg1, r1arg2]; var r2arg1; var r2arg2; var r2 = foo7(r2arg1); // any - var r2a = [ - r2arg2, - r2arg1 - ]; - var r2b = [ - r2arg1, - r2arg2 - ]; + var r2a = [r2arg2, r2arg1]; + var r2b = [r2arg1, r2arg2]; var r3arg1; var r3arg2; var r3 = foo8(r3arg1); // any - var r3a = [ - r3arg2, - r3arg1 - ]; - var r3b = [ - r3arg1, - r3arg2 - ]; + var r3a = [r3arg2, r3arg1]; + var r3b = [r3arg1, r3arg2]; var r4arg1; var r4arg2; var r4 = foo10(r4arg1); // any - var r4a = [ - r4arg2, - r4arg1 - ]; - var r4b = [ - r4arg1, - r4arg2 - ]; + var r4a = [r4arg2, r4arg1]; + var r4b = [r4arg1, r4arg2]; var r5arg1; var r5arg2; var r5 = foo11(r5arg1); // any - var r5a = [ - r5arg2, - r5arg1 - ]; - var r5b = [ - r5arg1, - r5arg2 - ]; + var r5a = [r5arg2, r5arg1]; + var r5b = [r5arg1, r5arg2]; var r6arg1; var r6arg2; var r6 = foo12(r6arg1); // new (x: Array, y: Array) => Array - var r6a = [ - r6arg2, - r6arg1 - ]; - var r6b = [ - r6arg1, - r6arg2 - ]; + var r6a = [r6arg2, r6arg1]; + var r6b = [r6arg1, r6arg2]; var r7arg1; var r7arg2; var r7 = foo15(r7arg1); // (x: { a: string; b: number }) => number): number; - var r7a = [ - r7arg2, - r7arg1 - ]; - var r7b = [ - r7arg1, - r7arg2 - ]; + var r7a = [r7arg2, r7arg1]; + var r7b = [r7arg1, r7arg2]; var r7arg3; var r7c = foo15(r7arg3); // any - var r7d = [ - r7arg2, - r7arg3 - ]; - var r7e = [ - r7arg3, - r7arg2 - ]; + var r7d = [r7arg2, r7arg3]; + var r7e = [r7arg3, r7arg2]; var r8arg; var r8 = foo16(r8arg); // any var r9arg; diff --git a/tests/baselines/reference/subtypingWithConstructSignatures4.js b/tests/baselines/reference/subtypingWithConstructSignatures4.js index 4e0783afa47..b3d43b03087 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures4.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures4.js @@ -148,102 +148,48 @@ var OtherDerived = (function (_super) { var r1arg; var r1arg2; var r1 = foo1(r1arg); -var r1a = [ - r1arg, - r1arg2 -]; -var r1b = [ - r1arg2, - r1arg -]; +var r1a = [r1arg, r1arg2]; +var r1b = [r1arg2, r1arg]; var r2arg; var r2arg2; var r2 = foo2(r2arg); -var r2a = [ - r2arg, - r2arg2 -]; -var r2b = [ - r2arg2, - r2arg -]; +var r2a = [r2arg, r2arg2]; +var r2b = [r2arg2, r2arg]; var r3arg; var r3arg2; var r3 = foo3(r3arg); -var r3a = [ - r3arg, - r3arg2 -]; -var r3b = [ - r3arg2, - r3arg -]; +var r3a = [r3arg, r3arg2]; +var r3b = [r3arg2, r3arg]; var r4arg; var r4arg2; var r4 = foo4(r4arg); -var r4a = [ - r4arg, - r4arg2 -]; -var r4b = [ - r4arg2, - r4arg -]; +var r4a = [r4arg, r4arg2]; +var r4b = [r4arg2, r4arg]; var r5arg; var r5arg2; var r5 = foo5(r5arg); -var r5a = [ - r5arg, - r5arg2 -]; -var r5b = [ - r5arg2, - r5arg -]; +var r5a = [r5arg, r5arg2]; +var r5b = [r5arg2, r5arg]; var r6arg; var r6arg2; var r6 = foo6(r6arg); -var r6a = [ - r6arg, - r6arg2 -]; -var r6b = [ - r6arg2, - r6arg -]; +var r6a = [r6arg, r6arg2]; +var r6b = [r6arg2, r6arg]; var r11arg; var r11arg2; var r11 = foo11(r11arg); -var r11a = [ - r11arg, - r11arg2 -]; -var r11b = [ - r11arg2, - r11arg -]; +var r11a = [r11arg, r11arg2]; +var r11b = [r11arg2, r11arg]; var r15arg; var r15arg2; var r15 = foo15(r15arg); -var r15a = [ - r15arg, - r15arg2 -]; -var r15b = [ - r15arg2, - r15arg -]; +var r15a = [r15arg, r15arg2]; +var r15b = [r15arg2, r15arg]; var r16arg; var r16arg2; var r16 = foo16(r16arg); -var r16a = [ - r16arg, - r16arg2 -]; -var r16b = [ - r16arg2, - r16arg -]; +var r16a = [r16arg, r16arg2]; +var r16b = [r16arg2, r16arg]; var r17arg; var r17 = foo17(r17arg); var r18arg; diff --git a/tests/baselines/reference/subtypingWithObjectMembersOptionality.js b/tests/baselines/reference/subtypingWithObjectMembersOptionality.js index f0005c9fe15..87a7012e91e 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersOptionality.js +++ b/tests/baselines/reference/subtypingWithObjectMembersOptionality.js @@ -77,16 +77,12 @@ module TwoLevels { // Derived member is not optional but base member is, should be ok // object literal case var a; -var b = { - Foo: null -}; +var b = { Foo: null }; var r = true ? a : b; var TwoLevels; (function (TwoLevels) { // object literal case var a; - var b = { - Foo: null - }; + var b = { Foo: null }; var r = true ? a : b; })(TwoLevels || (TwoLevels = {})); diff --git a/tests/baselines/reference/subtypingWithOptionalProperties.js b/tests/baselines/reference/subtypingWithOptionalProperties.js index 48f73e72b0e..4908a92f2e5 100644 --- a/tests/baselines/reference/subtypingWithOptionalProperties.js +++ b/tests/baselines/reference/subtypingWithOptionalProperties.js @@ -17,7 +17,5 @@ function f(a) { var b = a; return b; } -var r = f({ - s: new Object() -}); // ok +var r = f({ s: new Object() }); // ok r.s && r.s.toFixed(); // would blow up at runtime diff --git a/tests/baselines/reference/superAccess.js b/tests/baselines/reference/superAccess.js index c9ab251443f..3d9080b76e1 100644 --- a/tests/baselines/reference/superAccess.js +++ b/tests/baselines/reference/superAccess.js @@ -23,9 +23,7 @@ var __extends = this.__extends || function (d, b) { var MyBase = (function () { function MyBase() { this.S2 = "test"; - this.f = function () { - return 5; - }; + this.f = function () { return 5; }; } MyBase.S1 = 5; return MyBase; diff --git a/tests/baselines/reference/superAccess2.js b/tests/baselines/reference/superAccess2.js index 259afb1af0f..8672b5b9935 100644 --- a/tests/baselines/reference/superAccess2.js +++ b/tests/baselines/reference/superAccess2.js @@ -34,10 +34,8 @@ var __extends = this.__extends || function (d, b) { var P = (function () { function P() { } - P.prototype.x = function () { - }; - P.y = function () { - }; + P.prototype.x = function () { }; + P.y = function () { }; return P; })(); var Q = (function (_super) { @@ -47,9 +45,7 @@ var Q = (function (_super) { var _this = this; if (z === void 0) { z = _super.prototype.; } if (zz === void 0) { zz = _super.prototype.; } - if (zzz === void 0) { zzz = function () { - return _super.prototype.; - }; } + if (zzz === void 0) { zzz = function () { return _super.prototype.; }; } _super.call(this); this.z = z; this.xx = _super.prototype.; diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js index bbfd81879bb..92abed0d66d 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js @@ -26,9 +26,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.call(this, function (value) { - return String(value); - }); + _super.call(this, function (value) { return String(value); }); } return B; })(A); diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js index 11eb82025a6..7e3c61e6690 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js @@ -26,9 +26,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.call(this, function (value) { - return String(value); - }); + _super.call(this, function (value) { return String(value); }); } return B; })(A); diff --git a/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js b/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js index b6caa0880ca..b48d5bb7f58 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js @@ -26,9 +26,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.call(this, function (value) { - return String(value); - }); + _super.call(this, function (value) { return String(value); }); } return B; })(A); diff --git a/tests/baselines/reference/superCallFromClassThatHasNoBaseType1.js b/tests/baselines/reference/superCallFromClassThatHasNoBaseType1.js index 3f4c24297e1..7818aed7ff8 100644 --- a/tests/baselines/reference/superCallFromClassThatHasNoBaseType1.js +++ b/tests/baselines/reference/superCallFromClassThatHasNoBaseType1.js @@ -19,9 +19,7 @@ var A = (function () { })(); var B = (function () { function B() { - _super.call(this, function (value) { - return String(value); - }); + _super.call(this, function (value) { return String(value); }); } return B; })(); diff --git a/tests/baselines/reference/superCallFromFunction1.js b/tests/baselines/reference/superCallFromFunction1.js index ecc78aa5397..a7fcbaaeff0 100644 --- a/tests/baselines/reference/superCallFromFunction1.js +++ b/tests/baselines/reference/superCallFromFunction1.js @@ -6,7 +6,5 @@ function foo() { //// [superCallFromFunction1.js] function foo() { - _super.call(this, function (value) { - return String(value); - }); + _super.call(this, function (value) { return String(value); }); } diff --git a/tests/baselines/reference/superCallInNonStaticMethod.js b/tests/baselines/reference/superCallInNonStaticMethod.js index cf29ac3b1a4..7ef1ce1c62a 100644 --- a/tests/baselines/reference/superCallInNonStaticMethod.js +++ b/tests/baselines/reference/superCallInNonStaticMethod.js @@ -70,9 +70,7 @@ var Other = (function (_super) { var _this = this; _super.call(this); this.propertyInitializer = _super.prototype.instanceMethod.call(this); - this.functionProperty = function () { - _super.prototype.instanceMethod.call(_this); - }; + this.functionProperty = function () { _super.prototype.instanceMethod.call(_this); }; _super.prototype.instanceMethod.call(this); } // in instance method diff --git a/tests/baselines/reference/superCallOutsideConstructor.js b/tests/baselines/reference/superCallOutsideConstructor.js index 32d45b044f5..94f41cccb57 100644 --- a/tests/baselines/reference/superCallOutsideConstructor.js +++ b/tests/baselines/reference/superCallOutsideConstructor.js @@ -32,8 +32,7 @@ var __extends = this.__extends || function (d, b) { var C = (function () { function C() { } - C.prototype.foo = function () { - }; + C.prototype.foo = function () { }; return C; })(); var D = (function (_super) { diff --git a/tests/baselines/reference/superCallParameterContextualTyping1.js b/tests/baselines/reference/superCallParameterContextualTyping1.js index 0df2159c40c..b11d62d62c8 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping1.js +++ b/tests/baselines/reference/superCallParameterContextualTyping1.js @@ -29,9 +29,7 @@ var B = (function (_super) { __extends(B, _super); // Ensure 'value' is of type 'number (and not '{}') by using its 'toExponential()' method. function B() { - _super.call(this, function (value) { - return String(value.toExponential()); - }); + _super.call(this, function (value) { return String(value.toExponential()); }); } return B; })(A); diff --git a/tests/baselines/reference/superCallParameterContextualTyping2.js b/tests/baselines/reference/superCallParameterContextualTyping2.js index cfd2c452ada..61e8b94f00f 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping2.js +++ b/tests/baselines/reference/superCallParameterContextualTyping2.js @@ -28,9 +28,7 @@ var C = (function (_super) { __extends(C, _super); // Ensure 'value' is not of type 'any' by invoking it with type arguments. function C() { - _super.call(this, function (value) { - return String(value()); - }); + _super.call(this, function (value) { return String(value()); }); } return C; })(A); diff --git a/tests/baselines/reference/superCalls.js b/tests/baselines/reference/superCalls.js index e714a4db191..2928793feb6 100644 --- a/tests/baselines/reference/superCalls.js +++ b/tests/baselines/reference/superCalls.js @@ -43,8 +43,7 @@ var Base = (function () { } return Base; })(); -function v() { -} +function v() { } var Derived = (function (_super) { __extends(Derived, _super); //super call in class constructor of derived type diff --git a/tests/baselines/reference/superCallsInConstructor.errors.txt b/tests/baselines/reference/superCallsInConstructor.errors.txt index 0e7b1577bc0..eee7c06b671 100644 --- a/tests/baselines/reference/superCallsInConstructor.errors.txt +++ b/tests/baselines/reference/superCallsInConstructor.errors.txt @@ -1,7 +1,8 @@ +tests/cases/compiler/superCallsInConstructor.ts(12,9): error TS1101: 'with' statements are not allowed in strict mode. tests/cases/compiler/superCallsInConstructor.ts(12,14): error TS2410: All symbols within a 'with' block will be resolved to 'any'. -==== tests/cases/compiler/superCallsInConstructor.ts (1 errors) ==== +==== tests/cases/compiler/superCallsInConstructor.ts (2 errors) ==== class C { foo() {} bar() {} @@ -14,6 +15,8 @@ tests/cases/compiler/superCallsInConstructor.ts(12,14): error TS2410: All symbol class Derived extends Base { constructor() { with(new C()) { + ~~~~ +!!! error TS1101: 'with' statements are not allowed in strict mode. ~~~~~~~ !!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. foo(); diff --git a/tests/baselines/reference/superCallsInConstructor.js b/tests/baselines/reference/superCallsInConstructor.js index 912bfab349b..0c19e365d92 100644 --- a/tests/baselines/reference/superCallsInConstructor.js +++ b/tests/baselines/reference/superCallsInConstructor.js @@ -30,10 +30,8 @@ var __extends = this.__extends || function (d, b) { var C = (function () { function C() { } - C.prototype.foo = function () { - }; - C.prototype.bar = function () { - }; + C.prototype.foo = function () { }; + C.prototype.bar = function () { }; return C; })(); var Base = (function () { @@ -49,8 +47,7 @@ var Derived = (function (_super) { _super.call(this); bar(); } - try { - } + try { } catch (e) { _super.call(this); } diff --git a/tests/baselines/reference/superErrors.js b/tests/baselines/reference/superErrors.js index 2b1a5082617..bb17019aa4e 100644 --- a/tests/baselines/reference/superErrors.js +++ b/tests/baselines/reference/superErrors.js @@ -61,16 +61,8 @@ var __extends = this.__extends || function (d, b) { function foo() { // super in a non class context var x = _super.; - var y = function () { - return _super.; - }; - var z = function () { - return function () { - return function () { - return _super.; - }; - }; - }; + var y = function () { return _super.; }; + var z = function () { return function () { return function () { return _super.; }; }; }; } var User = (function () { function User() { @@ -92,47 +84,27 @@ var RegisteredUser = (function (_super) { } // super call in a lambda in an inner function in a constructor function inner2() { - var x = function () { - return _super.sayHello.call(this); - }; + var x = function () { return _super.sayHello.call(this); }; } // super call in a lambda in a function expression in a constructor - (function () { - return function () { - return _super.; - }; - })(); + (function () { return function () { return _super.; }; })(); } RegisteredUser.prototype.sayHello = function () { // super call in a method _super.prototype.sayHello.call(this); // super call in a lambda in an inner function in a method function inner() { - var x = function () { - return _super.sayHello.call(this); - }; + var x = function () { return _super.sayHello.call(this); }; } // super call in a lambda in a function expression in a constructor - (function () { - return function () { - return _super.; - }; - })(); + (function () { return function () { return _super.; }; })(); }; RegisteredUser.staticFunction = function () { var _this = this; // super in static functions var s = _super.; - var x = function () { - return _super.; - }; - var y = function () { - return function () { - return function () { - return _super.; - }; - }; - }; + var x = function () { return _super.; }; + var y = function () { return function () { return function () { return _super.; }; }; }; }; return RegisteredUser; })(User); diff --git a/tests/baselines/reference/superInCatchBlock1.js b/tests/baselines/reference/superInCatchBlock1.js index f94c0511277..1b9085ec266 100644 --- a/tests/baselines/reference/superInCatchBlock1.js +++ b/tests/baselines/reference/superInCatchBlock1.js @@ -23,8 +23,7 @@ var __extends = this.__extends || function (d, b) { var A = (function () { function A() { } - A.prototype.m = function () { - }; + A.prototype.m = function () { }; return A; })(); var B = (function (_super) { diff --git a/tests/baselines/reference/superInLambdas.js b/tests/baselines/reference/superInLambdas.js index f7e3c4706c4..10c489f1b40 100644 --- a/tests/baselines/reference/superInLambdas.js +++ b/tests/baselines/reference/superInLambdas.js @@ -92,18 +92,14 @@ var RegisteredUser = (function (_super) { // super call in a constructor _super.prototype.sayHello.call(this); // super call in a lambda in a constructor - var x = function () { - return _super.prototype.sayHello.call(_this); - }; + var x = function () { return _super.prototype.sayHello.call(_this); }; } RegisteredUser.prototype.sayHello = function () { var _this = this; // super call in a method _super.prototype.sayHello.call(this); // super call in a lambda in a method - var x = function () { - return _super.prototype.sayHello.call(_this); - }; + var x = function () { return _super.prototype.sayHello.call(_this); }; }; return RegisteredUser; })(User); @@ -114,24 +110,12 @@ var RegisteredUser2 = (function (_super) { _super.call(this); this.name = "Joe"; // super call in a nested lambda in a constructor - var x = function () { - return function () { - return function () { - return _super.prototype.sayHello.call(_this); - }; - }; - }; + var x = function () { return function () { return function () { return _super.prototype.sayHello.call(_this); }; }; }; } RegisteredUser2.prototype.sayHello = function () { var _this = this; // super call in a nested lambda in a method - var x = function () { - return function () { - return function () { - return _super.prototype.sayHello.call(_this); - }; - }; - }; + var x = function () { return function () { return function () { return _super.prototype.sayHello.call(_this); }; }; }; }; return RegisteredUser2; })(User); @@ -142,24 +126,12 @@ var RegisteredUser3 = (function (_super) { _super.call(this); this.name = "Sam"; // super property in a nested lambda in a constructor - var superName = function () { - return function () { - return function () { - return _super.prototype.name; - }; - }; - }; + var superName = function () { return function () { return function () { return _super.prototype.name; }; }; }; } RegisteredUser3.prototype.sayHello = function () { var _this = this; // super property in a nested lambda in a method - var superName = function () { - return function () { - return function () { - return _super.prototype.name; - }; - }; - }; + var superName = function () { return function () { return function () { return _super.prototype.name; }; }; }; }; return RegisteredUser3; })(User); @@ -170,20 +142,12 @@ var RegisteredUser4 = (function (_super) { _super.call(this); this.name = "Mark"; // super in a nested lambda in a constructor - var x = function () { - return function () { - return _super.prototype.; - }; - }; + var x = function () { return function () { return _super.prototype.; }; }; } RegisteredUser4.prototype.sayHello = function () { var _this = this; // super in a nested lambda in a method - var x = function () { - return function () { - return _super.prototype.; - }; - }; + var x = function () { return function () { return _super.prototype.; }; }; }; return RegisteredUser4; })(User); diff --git a/tests/baselines/reference/superNewCall1.js b/tests/baselines/reference/superNewCall1.js index b0ec9899a52..d9b74ac5080 100644 --- a/tests/baselines/reference/superNewCall1.js +++ b/tests/baselines/reference/superNewCall1.js @@ -28,9 +28,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - new _super.prototype(function (value) { - return String(value); - }); + new _super.prototype(function (value) { return String(value); }); } return B; })(A); diff --git a/tests/baselines/reference/superPropertyAccess.js b/tests/baselines/reference/superPropertyAccess.js index a9ee2352c76..a5419aaf36e 100644 --- a/tests/baselines/reference/superPropertyAccess.js +++ b/tests/baselines/reference/superPropertyAccess.js @@ -45,22 +45,15 @@ var __extends = this.__extends || function (d, b) { }; var MyBase = (function () { function MyBase() { - this.m2 = function () { - }; + this.m2 = function () { }; this.d1 = 42; this.d2 = 42; } - MyBase.prototype.m1 = function (a) { - return a; - }; - MyBase.prototype.p1 = function () { - }; + MyBase.prototype.m1 = function (a) { return a; }; + MyBase.prototype.p1 = function () { }; Object.defineProperty(MyBase.prototype, "value", { - get: function () { - return 0; - }, - set: function (v) { - }, + get: function () { return 0; }, + set: function (v) { }, enumerable: true, configurable: true }); @@ -79,9 +72,7 @@ var MyDerived = (function (_super) { _super.prototype.p1.call(this); // Should error, private not public instance member function var l1 = _super.prototype.d1; // Should error, instance data property not a public instance member function var l1 = _super.prototype.d2; // Should error, instance data property not a public instance member function - _super.prototype.m1 = function (a) { - return ""; - }; // Should be allowed, we will not restrict assignment + _super.prototype.m1 = function (a) { return ""; }; // Should be allowed, we will not restrict assignment _super.prototype.value = 0; // Should error, instance data property not a public instance member function var z = _super.prototype.value; // Should error, instance data property not a public instance member function }; diff --git a/tests/baselines/reference/superPropertyAccess1.js b/tests/baselines/reference/superPropertyAccess1.js index 8b1e855e0a3..a0a52526f93 100644 --- a/tests/baselines/reference/superPropertyAccess1.js +++ b/tests/baselines/reference/superPropertyAccess1.js @@ -37,8 +37,7 @@ var __extends = this.__extends || function (d, b) { var C = (function () { function C() { } - C.prototype.foo = function () { - }; + C.prototype.foo = function () { }; Object.defineProperty(C.prototype, "x", { get: function () { return 1; @@ -46,8 +45,7 @@ var C = (function () { enumerable: true, configurable: true }); - C.prototype.bar = function () { - }; + C.prototype.bar = function () { }; return C; })(); var D = (function (_super) { diff --git a/tests/baselines/reference/superPropertyAccess2.js b/tests/baselines/reference/superPropertyAccess2.js index 98beb078e2f..b906f1b0a8b 100644 --- a/tests/baselines/reference/superPropertyAccess2.js +++ b/tests/baselines/reference/superPropertyAccess2.js @@ -37,8 +37,7 @@ var __extends = this.__extends || function (d, b) { var C = (function () { function C() { } - C.foo = function () { - }; + C.foo = function () { }; Object.defineProperty(C.prototype, "x", { get: function () { return 1; @@ -46,8 +45,7 @@ var C = (function () { enumerable: true, configurable: true }); - C.bar = function () { - }; + C.bar = function () { }; return C; })(); var D = (function (_super) { diff --git a/tests/baselines/reference/superPropertyAccessNoError.js b/tests/baselines/reference/superPropertyAccessNoError.js index 086ead2e16d..e49a2c6b719 100644 --- a/tests/baselines/reference/superPropertyAccessNoError.js +++ b/tests/baselines/reference/superPropertyAccessNoError.js @@ -95,9 +95,7 @@ var SomeDerivedClass = (function (_super) { var _this = this; var x = _super.prototype.func.call(this); var x; - var y = function () { - return _super.prototype.func.call(_this); - }; + var y = function () { return _super.prototype.func.call(_this); }; }; Object.defineProperty(SomeDerivedClass.prototype, "a", { get: function () { diff --git a/tests/baselines/reference/superWithTypeArgument3.js b/tests/baselines/reference/superWithTypeArgument3.js index 8277fe0506e..ef228a3ba20 100644 --- a/tests/baselines/reference/superWithTypeArgument3.js +++ b/tests/baselines/reference/superWithTypeArgument3.js @@ -23,8 +23,7 @@ var __extends = this.__extends || function (d, b) { var C = (function () { function C() { } - C.prototype.bar = function (x) { - }; + C.prototype.bar = function (x) { }; return C; })(); var D = (function (_super) { 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 c4ced2a9dcc..2a97b6d04d7 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 @@ -52,9 +52,7 @@ var ObjectLiteral; var F = (function () { function F() { } - F.prototype.test = function () { - return ""; - }; + F.prototype.test = function () { return ""; }; return F; })(); var SuperObjectTest = (function (_super) { diff --git a/tests/baselines/reference/switchAssignmentCompat.js b/tests/baselines/reference/switchAssignmentCompat.js index 4743e5d7eb3..1e6792ee378 100644 --- a/tests/baselines/reference/switchAssignmentCompat.js +++ b/tests/baselines/reference/switchAssignmentCompat.js @@ -13,6 +13,5 @@ var Foo = (function () { return Foo; })(); switch (0) { - case Foo: - break; // Error expected + case Foo: break; // Error expected } diff --git a/tests/baselines/reference/switchBreakStatements.js b/tests/baselines/reference/switchBreakStatements.js index 810c9909233..534f025e2f5 100644 --- a/tests/baselines/reference/switchBreakStatements.js +++ b/tests/baselines/reference/switchBreakStatements.js @@ -91,8 +91,7 @@ SEVEN: switch ('') { break SEVEN; EIGHT: switch ('') { case 'a': - var fn = function () { - }; + var fn = function () { }; break EIGHT; } } diff --git a/tests/baselines/reference/switchCasesExpressionTypeMismatch.js b/tests/baselines/reference/switchCasesExpressionTypeMismatch.js index 546d03dec92..ca354779be1 100644 --- a/tests/baselines/reference/switchCasesExpressionTypeMismatch.js +++ b/tests/baselines/reference/switchCasesExpressionTypeMismatch.js @@ -25,24 +25,16 @@ var Foo = (function () { return Foo; })(); switch (0) { - case Foo: - break; // Error - case "sss": - break; // Error - case 123: - break; // No Error - case true: - break; // Error + case Foo: break; // Error + case "sss": break; // Error + case 123: break; // No Error + case true: break; // Error } var s = 0; // No error for all switch (s) { - case Foo: - break; - case "sss": - break; - case 123: - break; - case true: - break; + case Foo: break; + case "sss": break; + case 123: break; + case true: break; } diff --git a/tests/baselines/reference/switchFallThroughs.js b/tests/baselines/reference/switchFallThroughs.js index b38c6b6f0ab..53f221bd467 100644 --- a/tests/baselines/reference/switchFallThroughs.js +++ b/tests/baselines/reference/switchFallThroughs.js @@ -26,10 +26,9 @@ function R1(index) { var a = 'a'; return a; case 3: - case 4: - { - return 'b'; - } + case 4: { + return 'b'; + } case 5: default: return 'c'; diff --git a/tests/baselines/reference/switchStatements.js b/tests/baselines/reference/switchStatements.js index 699871d9dd2..6348ca62e78 100644 --- a/tests/baselines/reference/switchStatements.js +++ b/tests/baselines/reference/switchStatements.js @@ -81,21 +81,13 @@ switch (x) { case /[a-z]/: case []: case {}: - case { - id: 12 - }: - case [ - 'a' - ]: + case { id: 12 }: + case ['a']: case typeof x: case typeof M: case M.fn(1): - case function (x) { - return ''; - }: - case (function (x) { - return ''; - })(2): + case function (x) { return ''; }: + case (function (x) { return ''; })(2): default: } // basic assignable check, rest covered in tests for 'assignement compatibility' @@ -113,10 +105,7 @@ var D = (function (_super) { })(C); switch (new C()) { case new D(): - case { - id: 12, - name: '' - }: + case { id: 12, name: '' }: case new C(): } switch ('') { @@ -139,19 +128,11 @@ switch ([]) { } switch ({}) { } -switch ({ - id: 12 -}) { +switch ({ id: 12 }) { } -switch ([ - 'a' -]) { +switch (['a']) { } -switch (function (x) { - return ''; -}) { +switch (function (x) { return ''; }) { } -switch ((function (x) { - return ''; -})(1)) { +switch ((function (x) { return ''; })(1)) { } diff --git a/tests/baselines/reference/switchStatementsWithMultipleDefaults.js b/tests/baselines/reference/switchStatementsWithMultipleDefaults.js index 09a1a70a5d9..a17abe5711d 100644 --- a/tests/baselines/reference/switchStatementsWithMultipleDefaults.js +++ b/tests/baselines/reference/switchStatementsWithMultipleDefaults.js @@ -56,8 +56,7 @@ switch (x) { default: // Error, third 'default' clause default: // Error, fourth 'default' clause. // Errors on fifth-seventh - default: - return; + default: return; default: default: } diff --git a/tests/baselines/reference/symbolDeclarationEmit10.js b/tests/baselines/reference/symbolDeclarationEmit10.js index 7ace6617db5..0c46d8750e9 100644 --- a/tests/baselines/reference/symbolDeclarationEmit10.js +++ b/tests/baselines/reference/symbolDeclarationEmit10.js @@ -6,11 +6,8 @@ var obj = { //// [symbolDeclarationEmit10.js] var obj = { - get [Symbol.isConcatSpreadable]() { - return ''; - }, - set [Symbol.isConcatSpreadable](x) { - } + get [Symbol.isConcatSpreadable]() { return ''; }, + set [Symbol.isConcatSpreadable](x) { } }; diff --git a/tests/baselines/reference/symbolDeclarationEmit11.js b/tests/baselines/reference/symbolDeclarationEmit11.js index 599f7393f4b..b5983177587 100644 --- a/tests/baselines/reference/symbolDeclarationEmit11.js +++ b/tests/baselines/reference/symbolDeclarationEmit11.js @@ -8,13 +8,9 @@ class C { //// [symbolDeclarationEmit11.js] class C { - static [Symbol.toPrimitive]() { - } - static get [Symbol.isRegExp]() { - return ""; - } - static set [Symbol.isRegExp](x) { - } + static [Symbol.toPrimitive]() { } + static get [Symbol.isRegExp]() { return ""; } + static set [Symbol.isRegExp](x) { } } C[Symbol.iterator] = 0; diff --git a/tests/baselines/reference/symbolDeclarationEmit12.js b/tests/baselines/reference/symbolDeclarationEmit12.js index ab930b41580..ce7b3861b0b 100644 --- a/tests/baselines/reference/symbolDeclarationEmit12.js +++ b/tests/baselines/reference/symbolDeclarationEmit12.js @@ -16,16 +16,12 @@ module M { var M; (function (M) { class C { - [Symbol.toPrimitive](x) { - } + [Symbol.toPrimitive](x) { } [Symbol.isConcatSpreadable]() { return undefined; } - get [Symbol.isRegExp]() { - return undefined; - } - set [Symbol.isRegExp](x) { - } + get [Symbol.isRegExp]() { return undefined; } + set [Symbol.isRegExp](x) { } } M.C = C; })(M || (M = {})); diff --git a/tests/baselines/reference/symbolDeclarationEmit13.js b/tests/baselines/reference/symbolDeclarationEmit13.js index f48a918a6f2..b309cfb2f64 100644 --- a/tests/baselines/reference/symbolDeclarationEmit13.js +++ b/tests/baselines/reference/symbolDeclarationEmit13.js @@ -6,11 +6,8 @@ class C { //// [symbolDeclarationEmit13.js] class C { - get [Symbol.isRegExp]() { - return ""; - } - set [Symbol.toStringTag](x) { - } + get [Symbol.isRegExp]() { return ""; } + set [Symbol.toStringTag](x) { } } diff --git a/tests/baselines/reference/symbolDeclarationEmit14.js b/tests/baselines/reference/symbolDeclarationEmit14.js index 6197ffa2b4f..f24ce11ee77 100644 --- a/tests/baselines/reference/symbolDeclarationEmit14.js +++ b/tests/baselines/reference/symbolDeclarationEmit14.js @@ -6,12 +6,8 @@ class C { //// [symbolDeclarationEmit14.js] class C { - get [Symbol.isRegExp]() { - return ""; - } - get [Symbol.toStringTag]() { - return ""; - } + get [Symbol.isRegExp]() { return ""; } + get [Symbol.toStringTag]() { return ""; } } diff --git a/tests/baselines/reference/symbolDeclarationEmit3.js b/tests/baselines/reference/symbolDeclarationEmit3.js index 6f513b053c7..88087982013 100644 --- a/tests/baselines/reference/symbolDeclarationEmit3.js +++ b/tests/baselines/reference/symbolDeclarationEmit3.js @@ -7,8 +7,7 @@ class C { //// [symbolDeclarationEmit3.js] class C { - [Symbol.isRegExp](x) { - } + [Symbol.isRegExp](x) { } } diff --git a/tests/baselines/reference/symbolDeclarationEmit4.js b/tests/baselines/reference/symbolDeclarationEmit4.js index 14f50a03ee7..67ec3477f7d 100644 --- a/tests/baselines/reference/symbolDeclarationEmit4.js +++ b/tests/baselines/reference/symbolDeclarationEmit4.js @@ -6,11 +6,8 @@ class C { //// [symbolDeclarationEmit4.js] class C { - get [Symbol.isRegExp]() { - return ""; - } - set [Symbol.isRegExp](x) { - } + get [Symbol.isRegExp]() { return ""; } + set [Symbol.isRegExp](x) { } } diff --git a/tests/baselines/reference/symbolDeclarationEmit9.js b/tests/baselines/reference/symbolDeclarationEmit9.js index 8cdb7173144..d38171767a5 100644 --- a/tests/baselines/reference/symbolDeclarationEmit9.js +++ b/tests/baselines/reference/symbolDeclarationEmit9.js @@ -5,8 +5,7 @@ var obj = { //// [symbolDeclarationEmit9.js] var obj = { - [Symbol.isConcatSpreadable]() { - } + [Symbol.isConcatSpreadable]() { } }; diff --git a/tests/baselines/reference/symbolProperty1.js b/tests/baselines/reference/symbolProperty1.js index 1537883f4ec..0117dd3b1c2 100644 --- a/tests/baselines/reference/symbolProperty1.js +++ b/tests/baselines/reference/symbolProperty1.js @@ -12,8 +12,7 @@ var x = { var s; var x = { [s]: 0, - [s]() { - }, + [s]() { }, get [s]() { return 0; } diff --git a/tests/baselines/reference/symbolProperty18.js b/tests/baselines/reference/symbolProperty18.js index ff69588be31..1d0a57e7b50 100644 --- a/tests/baselines/reference/symbolProperty18.js +++ b/tests/baselines/reference/symbolProperty18.js @@ -12,11 +12,8 @@ i[Symbol.toPrimitive] = false; //// [symbolProperty18.js] var i = { [Symbol.iterator]: 0, - [Symbol.toStringTag]() { - return ""; - }, - set [Symbol.toPrimitive](p) { - } + [Symbol.toStringTag]() { return ""; }, + set [Symbol.toPrimitive](p) { } }; var it = i[Symbol.iterator]; var str = i[Symbol.toStringTag](); diff --git a/tests/baselines/reference/symbolProperty19.js b/tests/baselines/reference/symbolProperty19.js index d4bfd0dc7c7..5ec7968218a 100644 --- a/tests/baselines/reference/symbolProperty19.js +++ b/tests/baselines/reference/symbolProperty19.js @@ -9,14 +9,8 @@ var str = i[Symbol.toStringTag](); //// [symbolProperty19.js] var i = { - [Symbol.iterator]: { - p: null - }, - [Symbol.toStringTag]() { - return { - p: undefined - }; - } + [Symbol.iterator]: { p: null }, + [Symbol.toStringTag]() { return { p: undefined }; } }; var it = i[Symbol.iterator]; var str = i[Symbol.toStringTag](); diff --git a/tests/baselines/reference/symbolProperty2.js b/tests/baselines/reference/symbolProperty2.js index 5c0f89b0257..0158366f9d5 100644 --- a/tests/baselines/reference/symbolProperty2.js +++ b/tests/baselines/reference/symbolProperty2.js @@ -12,8 +12,7 @@ var x = { var s = Symbol(); var x = { [s]: 0, - [s]() { - }, + [s]() { }, get [s]() { return 0; } diff --git a/tests/baselines/reference/symbolProperty20.js b/tests/baselines/reference/symbolProperty20.js index cfb763dc207..dd60a87cbea 100644 --- a/tests/baselines/reference/symbolProperty20.js +++ b/tests/baselines/reference/symbolProperty20.js @@ -12,7 +12,5 @@ var i: I = { //// [symbolProperty20.js] var i = { [Symbol.iterator]: s => s, - [Symbol.toStringTag](n) { - return n; - } + [Symbol.toStringTag](n) { return n; } }; diff --git a/tests/baselines/reference/symbolProperty22.js b/tests/baselines/reference/symbolProperty22.js index 19989106e56..d4609c74d36 100644 --- a/tests/baselines/reference/symbolProperty22.js +++ b/tests/baselines/reference/symbolProperty22.js @@ -8,6 +8,4 @@ declare function foo(p1: T, p2: I): U; foo("", { [Symbol.unscopables]: s => s.length }); //// [symbolProperty22.js] -foo("", { - [Symbol.unscopables]: s => s.length -}); +foo("", { [Symbol.unscopables]: s => s.length }); diff --git a/tests/baselines/reference/symbolProperty28.js b/tests/baselines/reference/symbolProperty28.js index ed53a88f957..38d032b52fe 100644 --- a/tests/baselines/reference/symbolProperty28.js +++ b/tests/baselines/reference/symbolProperty28.js @@ -13,9 +13,7 @@ var obj = c[Symbol.toStringTag]().x; //// [symbolProperty28.js] class C1 { [Symbol.toStringTag]() { - return { - x: "" - }; + return { x: "" }; } } class C2 extends C1 { diff --git a/tests/baselines/reference/symbolProperty29.js b/tests/baselines/reference/symbolProperty29.js index 759a7754826..4e269d4a76a 100644 --- a/tests/baselines/reference/symbolProperty29.js +++ b/tests/baselines/reference/symbolProperty29.js @@ -9,8 +9,6 @@ class C1 { //// [symbolProperty29.js] class C1 { [Symbol.toStringTag]() { - return { - x: "" - }; + return { x: "" }; } } diff --git a/tests/baselines/reference/symbolProperty3.js b/tests/baselines/reference/symbolProperty3.js index 6159b10f9f3..dda9ca23d32 100644 --- a/tests/baselines/reference/symbolProperty3.js +++ b/tests/baselines/reference/symbolProperty3.js @@ -12,8 +12,7 @@ var x = { var s = Symbol; var x = { [s]: 0, - [s]() { - }, + [s]() { }, get [s]() { return 0; } diff --git a/tests/baselines/reference/symbolProperty30.js b/tests/baselines/reference/symbolProperty30.js index 263fdc1041b..de1c92b57c4 100644 --- a/tests/baselines/reference/symbolProperty30.js +++ b/tests/baselines/reference/symbolProperty30.js @@ -9,8 +9,6 @@ class C1 { //// [symbolProperty30.js] class C1 { [Symbol.toStringTag]() { - return { - x: "" - }; + return { x: "" }; } } diff --git a/tests/baselines/reference/symbolProperty31.js b/tests/baselines/reference/symbolProperty31.js index a9db50061b3..b2ba8fd6046 100644 --- a/tests/baselines/reference/symbolProperty31.js +++ b/tests/baselines/reference/symbolProperty31.js @@ -11,9 +11,7 @@ class C2 extends C1 { //// [symbolProperty31.js] class C1 { [Symbol.toStringTag]() { - return { - x: "" - }; + return { x: "" }; } } class C2 extends C1 { diff --git a/tests/baselines/reference/symbolProperty32.js b/tests/baselines/reference/symbolProperty32.js index 52db43bb9de..9fcfc54e928 100644 --- a/tests/baselines/reference/symbolProperty32.js +++ b/tests/baselines/reference/symbolProperty32.js @@ -11,9 +11,7 @@ class C2 extends C1 { //// [symbolProperty32.js] class C1 { [Symbol.toStringTag]() { - return { - x: "" - }; + return { x: "" }; } } class C2 extends C1 { diff --git a/tests/baselines/reference/symbolProperty33.js b/tests/baselines/reference/symbolProperty33.js index 8a0e3f691b5..8ae5d305afb 100644 --- a/tests/baselines/reference/symbolProperty33.js +++ b/tests/baselines/reference/symbolProperty33.js @@ -11,9 +11,7 @@ class C2 { //// [symbolProperty33.js] class C1 extends C2 { [Symbol.toStringTag]() { - return { - x: "" - }; + return { x: "" }; } } class C2 { diff --git a/tests/baselines/reference/symbolProperty34.js b/tests/baselines/reference/symbolProperty34.js index b8bcd54487f..c35d6bcf461 100644 --- a/tests/baselines/reference/symbolProperty34.js +++ b/tests/baselines/reference/symbolProperty34.js @@ -11,9 +11,7 @@ class C2 { //// [symbolProperty34.js] class C1 extends C2 { [Symbol.toStringTag]() { - return { - x: "" - }; + return { x: "" }; } } class C2 { diff --git a/tests/baselines/reference/symbolProperty4.js b/tests/baselines/reference/symbolProperty4.js index be7cdab5f85..6072d6bbf72 100644 --- a/tests/baselines/reference/symbolProperty4.js +++ b/tests/baselines/reference/symbolProperty4.js @@ -10,8 +10,7 @@ var x = { //// [symbolProperty4.js] var x = { [Symbol()]: 0, - [Symbol()]() { - }, + [Symbol()]() { }, get [Symbol()]() { return 0; } diff --git a/tests/baselines/reference/symbolProperty48.js b/tests/baselines/reference/symbolProperty48.js index 283c3d0d2c5..508dd8944ed 100644 --- a/tests/baselines/reference/symbolProperty48.js +++ b/tests/baselines/reference/symbolProperty48.js @@ -12,7 +12,6 @@ var M; (function (M) { var Symbol; class C { - [Symbol.iterator]() { - } + [Symbol.iterator]() { } } })(M || (M = {})); diff --git a/tests/baselines/reference/symbolProperty49.js b/tests/baselines/reference/symbolProperty49.js index 027b76f76d1..5ed756b0863 100644 --- a/tests/baselines/reference/symbolProperty49.js +++ b/tests/baselines/reference/symbolProperty49.js @@ -12,7 +12,6 @@ var M; (function (M) { M.Symbol; class C { - [M.Symbol.iterator]() { - } + [M.Symbol.iterator]() { } } })(M || (M = {})); diff --git a/tests/baselines/reference/symbolProperty5.js b/tests/baselines/reference/symbolProperty5.js index 9f0ff3d688f..c7c88681f8a 100644 --- a/tests/baselines/reference/symbolProperty5.js +++ b/tests/baselines/reference/symbolProperty5.js @@ -10,8 +10,7 @@ var x = { //// [symbolProperty5.js] var x = { [Symbol.iterator]: 0, - [Symbol.isRegExp]() { - }, + [Symbol.isRegExp]() { }, get [Symbol.toStringTag]() { return 0; } diff --git a/tests/baselines/reference/symbolProperty50.js b/tests/baselines/reference/symbolProperty50.js index 30c911e8fab..76a4274b778 100644 --- a/tests/baselines/reference/symbolProperty50.js +++ b/tests/baselines/reference/symbolProperty50.js @@ -11,7 +11,6 @@ module M { var M; (function (M) { class C { - [Symbol.iterator]() { - } + [Symbol.iterator]() { } } })(M || (M = {})); diff --git a/tests/baselines/reference/symbolProperty51.js b/tests/baselines/reference/symbolProperty51.js index a9a79098424..7dd45eba091 100644 --- a/tests/baselines/reference/symbolProperty51.js +++ b/tests/baselines/reference/symbolProperty51.js @@ -11,7 +11,6 @@ module M { var M; (function (M) { class C { - [Symbol.iterator]() { - } + [Symbol.iterator]() { } } })(M || (M = {})); diff --git a/tests/baselines/reference/symbolProperty6.js b/tests/baselines/reference/symbolProperty6.js index 311baf2c187..81be3e2a927 100644 --- a/tests/baselines/reference/symbolProperty6.js +++ b/tests/baselines/reference/symbolProperty6.js @@ -13,8 +13,7 @@ class C { constructor() { this[Symbol.iterator] = 0; } - [Symbol.isRegExp]() { - } + [Symbol.isRegExp]() { } get [Symbol.toStringTag]() { return 0; } diff --git a/tests/baselines/reference/symbolProperty7.js b/tests/baselines/reference/symbolProperty7.js index b833eecff32..51f3511f332 100644 --- a/tests/baselines/reference/symbolProperty7.js +++ b/tests/baselines/reference/symbolProperty7.js @@ -13,8 +13,7 @@ class C { constructor() { this[Symbol()] = 0; } - [Symbol()]() { - } + [Symbol()]() { } get [Symbol()]() { return 0; } diff --git a/tests/baselines/reference/symbolType13.js b/tests/baselines/reference/symbolType13.js index 56aef2cc8e6..afd62079bb5 100644 --- a/tests/baselines/reference/symbolType13.js +++ b/tests/baselines/reference/symbolType13.js @@ -9,9 +9,6 @@ for (var y in s) { } //// [symbolType13.js] var s = Symbol(); var x; -for (s in {}) { -} -for (x in s) { -} -for (var y in s) { -} +for (s in {}) { } +for (x in s) { } +for (var y in s) { } diff --git a/tests/baselines/reference/taggedTemplateContextualTyping1.js b/tests/baselines/reference/taggedTemplateContextualTyping1.js index 173d0f56bb7..17618b50e8b 100644 --- a/tests/baselines/reference/taggedTemplateContextualTyping1.js +++ b/tests/baselines/reference/taggedTemplateContextualTyping1.js @@ -26,28 +26,7 @@ function tempTag1(...rest) { // Otherwise, the arrow functions' parameters will be typed as 'any', // and it is an error to invoke an any-typed value with type arguments, // so this test will error. -tempTag1 `${x => { - x(undefined); - return x; -}}${10}`; -tempTag1 `${x => { - x(undefined); - return x; -}}${y => { - y(undefined); - return y; -}}${10}`; -tempTag1 `${x => { - x(undefined); - return x; -}}${(y) => { - y(undefined); - return y; -}}${undefined}`; -tempTag1 `${(x) => { - x(undefined); - return x; -}}${y => { - y(undefined); - return y; -}}${undefined}`; +tempTag1 `${x => { x(undefined); return x; }}${10}`; +tempTag1 `${x => { x(undefined); return x; }}${y => { y(undefined); return y; }}${10}`; +tempTag1 `${x => { x(undefined); return x; }}${(y) => { y(undefined); return y; }}${undefined}`; +tempTag1 `${(x) => { x(undefined); return x; }}${y => { y(undefined); return y; }}${undefined}`; diff --git a/tests/baselines/reference/taggedTemplateContextualTyping2.js b/tests/baselines/reference/taggedTemplateContextualTyping2.js index 1eed600da4c..8adea53f470 100644 --- a/tests/baselines/reference/taggedTemplateContextualTyping2.js +++ b/tests/baselines/reference/taggedTemplateContextualTyping2.js @@ -25,18 +25,6 @@ function tempTag2(...rest) { // Otherwise, the arrow functions' parameters will be typed as 'any', // and it is an error to invoke an any-typed value with type arguments, // so this test will error. -tempTag2 `${x => { - x(undefined); - return x; -}}${0}`; -tempTag2 `${x => { - x(undefined); - return x; -}}${y => { - y(null); - return y; -}}${"hello"}`; -tempTag2 `${x => { - x(undefined); - return x; -}}${undefined}${"hello"}`; +tempTag2 `${x => { x(undefined); return x; }}${0}`; +tempTag2 `${x => { x(undefined); return x; }}${y => { y(null); return y; }}${"hello"}`; +tempTag2 `${x => { x(undefined); return x; }}${undefined}${"hello"}`; diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.js b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.js index 5b128221aa6..1b6e3ab92c8 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.js +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.js @@ -95,115 +95,48 @@ var arr: any[]; //// [taggedTemplateStringsTypeArgumentInference.js] // Generic tag with one parameter -function noParams(n) { -} +function noParams(n) { } (_a = [""], _a.raw = [""], noParams(_a)); // Generic tag with parameter which does not use type parameter -function noGenericParams(n) { -} +function noGenericParams(n) { } (_b = [""], _b.raw = [""], noGenericParams(_b)); // Generic tag with multiple type parameters and only one used in parameter type annotation -function someGenerics1a(n, m) { -} +function someGenerics1a(n, m) { } (_c = ["", ""], _c.raw = ["", ""], someGenerics1a(_c, 3)); -function someGenerics1b(n, m) { -} +function someGenerics1b(n, m) { } (_d = ["", ""], _d.raw = ["", ""], someGenerics1b(_d, 3)); // Generic tag with argument of function type whose parameter is of type parameter type -function someGenerics2a(strs, n) { -} -(_e = ["", ""], _e.raw = ["", ""], someGenerics2a(_e, function (n) { - return n; -})); -function someGenerics2b(strs, n) { -} -(_f = ["", ""], _f.raw = ["", ""], someGenerics2b(_f, function (n, x) { - return n; -})); +function someGenerics2a(strs, n) { } +(_e = ["", ""], _e.raw = ["", ""], someGenerics2a(_e, function (n) { return n; })); +function someGenerics2b(strs, n) { } +(_f = ["", ""], _f.raw = ["", ""], someGenerics2b(_f, function (n, x) { return n; })); // Generic tag with argument of function type whose parameter is not of type parameter type but body/return type uses type parameter -function someGenerics3(strs, producer) { -} -(_g = ["", ""], _g.raw = ["", ""], someGenerics3(_g, function () { - return ''; -})); -(_h = ["", ""], _h.raw = ["", ""], someGenerics3(_h, function () { - return undefined; -})); -(_j = ["", ""], _j.raw = ["", ""], someGenerics3(_j, function () { - return 3; -})); +function someGenerics3(strs, producer) { } +(_g = ["", ""], _g.raw = ["", ""], someGenerics3(_g, function () { return ''; })); +(_h = ["", ""], _h.raw = ["", ""], someGenerics3(_h, function () { return undefined; })); +(_j = ["", ""], _j.raw = ["", ""], someGenerics3(_j, function () { return 3; })); // 2 parameter generic tag with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type -function someGenerics4(strs, n, f) { -} -(_k = ["", "", ""], _k.raw = ["", "", ""], someGenerics4(_k, 4, function () { - return null; -})); -(_l = ["", "", ""], _l.raw = ["", "", ""], someGenerics4(_l, '', function () { - return 3; -})); +function someGenerics4(strs, n, f) { } +(_k = ["", "", ""], _k.raw = ["", "", ""], someGenerics4(_k, 4, function () { return null; })); +(_l = ["", "", ""], _l.raw = ["", "", ""], someGenerics4(_l, '', function () { return 3; })); (_m = ["", "", ""], _m.raw = ["", "", ""], someGenerics4(_m, null, null)); // 2 parameter generic tag with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type -function someGenerics5(strs, n, f) { -} -(_o = ["", " ", ""], _o.raw = ["", " ", ""], someGenerics5(_o, 4, function () { - return null; -})); -(_p = ["", "", ""], _p.raw = ["", "", ""], someGenerics5(_p, '', function () { - return 3; -})); +function someGenerics5(strs, n, f) { } +(_o = ["", " ", ""], _o.raw = ["", " ", ""], someGenerics5(_o, 4, function () { return null; })); +(_p = ["", "", ""], _p.raw = ["", "", ""], someGenerics5(_p, '', function () { return 3; })); (_q = ["", "", ""], _q.raw = ["", "", ""], someGenerics5(_q, null, null)); // Generic tag with multiple arguments of function types that each have parameters of the same generic type -function someGenerics6(strs, a, b, c) { -} -(_r = ["", "", "", ""], _r.raw = ["", "", "", ""], someGenerics6(_r, function (n) { - return n; -}, function (n) { - return n; -}, function (n) { - return n; -})); -(_s = ["", "", "", ""], _s.raw = ["", "", "", ""], someGenerics6(_s, function (n) { - return n; -}, function (n) { - return n; -}, function (n) { - return n; -})); -(_t = ["", "", "", ""], _t.raw = ["", "", "", ""], someGenerics6(_t, function (n) { - return n; -}, function (n) { - return n; -}, function (n) { - return n; -})); +function someGenerics6(strs, a, b, c) { } +(_r = ["", "", "", ""], _r.raw = ["", "", "", ""], someGenerics6(_r, function (n) { return n; }, function (n) { return n; }, function (n) { return n; })); +(_s = ["", "", "", ""], _s.raw = ["", "", "", ""], someGenerics6(_s, function (n) { return n; }, function (n) { return n; }, function (n) { return n; })); +(_t = ["", "", "", ""], _t.raw = ["", "", "", ""], someGenerics6(_t, function (n) { return n; }, function (n) { return n; }, function (n) { return n; })); // Generic tag with multiple arguments of function types that each have parameters of different generic type -function someGenerics7(strs, a, b, c) { -} -(_u = ["", "", "", ""], _u.raw = ["", "", "", ""], someGenerics7(_u, function (n) { - return n; -}, function (n) { - return n; -}, function (n) { - return n; -})); -(_v = ["", "", "", ""], _v.raw = ["", "", "", ""], someGenerics7(_v, function (n) { - return n; -}, function (n) { - return n; -}, function (n) { - return n; -})); -(_w = ["", "", "", ""], _w.raw = ["", "", "", ""], someGenerics7(_w, function (n) { - return n; -}, function (n) { - return n; -}, function (n) { - return n; -})); +function someGenerics7(strs, a, b, c) { } +(_u = ["", "", "", ""], _u.raw = ["", "", "", ""], someGenerics7(_u, function (n) { return n; }, function (n) { return n; }, function (n) { return n; })); +(_v = ["", "", "", ""], _v.raw = ["", "", "", ""], someGenerics7(_v, function (n) { return n; }, function (n) { return n; }, function (n) { return n; })); +(_w = ["", "", "", ""], _w.raw = ["", "", "", ""], someGenerics7(_w, function (n) { return n; }, function (n) { return n; }, function (n) { return n; })); // Generic tag with argument of generic function type -function someGenerics8(strs, n) { - return n; -} +function someGenerics8(strs, n) { return n; } var x = (_x = ["", ""], _x.raw = ["", ""], someGenerics8(_x, someGenerics7)); (_y = ["", "", "", ""], _y.raw = ["", "", "", ""], x(_y, null, null, null)); // Generic tag with multiple parameters of generic type passed arguments with no best common type @@ -212,22 +145,10 @@ function someGenerics9(strs, a, b, c) { } var a9a = (_z = ["", "", "", ""], _z.raw = ["", "", "", ""], someGenerics9(_z, '', 0, [])); var a9a; -var a9e = (_0 = ["", "", "", ""], _0.raw = ["", "", "", ""], someGenerics9(_0, undefined, { - x: 6, - z: new Date() -}, { - x: 6, - y: '' -})); +var a9e = (_0 = ["", "", "", ""], _0.raw = ["", "", "", ""], someGenerics9(_0, undefined, { x: 6, z: new Date() }, { x: 6, y: '' })); var a9e; // Generic tag with multiple parameters of generic type passed arguments with a single best common type -var a9d = (_1 = ["", "", "", ""], _1.raw = ["", "", "", ""], someGenerics9(_1, { - x: 3 -}, { - x: 6 -}, { - x: 6 -})); +var a9d = (_1 = ["", "", "", ""], _1.raw = ["", "", "", ""], someGenerics9(_1, { x: 3 }, { x: 6 }, { x: 6 })); var a9d; // Generic tag with multiple parameters of generic type where one argument is of type 'any' var anyVar; diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.js b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.js index 1fdeb3e4b38..2f57882b4b7 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.js +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.js @@ -94,61 +94,48 @@ var arr: any[]; //// [taggedTemplateStringsTypeArgumentInferenceES6.js] // Generic tag with one parameter -function noParams(n) { -} +function noParams(n) { } noParams ``; // Generic tag with parameter which does not use type parameter -function noGenericParams(n) { -} +function noGenericParams(n) { } noGenericParams ``; // Generic tag with multiple type parameters and only one used in parameter type annotation -function someGenerics1a(n, m) { -} +function someGenerics1a(n, m) { } someGenerics1a `${3}`; -function someGenerics1b(n, m) { -} +function someGenerics1b(n, m) { } someGenerics1b `${3}`; // Generic tag with argument of function type whose parameter is of type parameter type -function someGenerics2a(strs, n) { -} +function someGenerics2a(strs, n) { } someGenerics2a `${(n) => n}`; -function someGenerics2b(strs, n) { -} +function someGenerics2b(strs, n) { } someGenerics2b `${(n, x) => n}`; // Generic tag with argument of function type whose parameter is not of type parameter type but body/return type uses type parameter -function someGenerics3(strs, producer) { -} +function someGenerics3(strs, producer) { } someGenerics3 `${() => ''}`; someGenerics3 `${() => undefined}`; someGenerics3 `${() => 3}`; // 2 parameter generic tag with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type -function someGenerics4(strs, n, f) { -} +function someGenerics4(strs, n, f) { } someGenerics4 `${4}${() => null}`; someGenerics4 `${''}${() => 3}`; someGenerics4 `${null}${null}`; // 2 parameter generic tag with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type -function someGenerics5(strs, n, f) { -} +function someGenerics5(strs, n, f) { } someGenerics5 `${4} ${() => null}`; someGenerics5 `${''}${() => 3}`; someGenerics5 `${null}${null}`; // Generic tag with multiple arguments of function types that each have parameters of the same generic type -function someGenerics6(strs, a, b, c) { -} +function someGenerics6(strs, a, b, c) { } someGenerics6 `${n => n}${n => n}${n => n}`; someGenerics6 `${n => n}${n => n}${n => n}`; someGenerics6 `${(n) => n}${(n) => n}${(n) => n}`; // Generic tag with multiple arguments of function types that each have parameters of different generic type -function someGenerics7(strs, a, b, c) { -} +function someGenerics7(strs, a, b, c) { } someGenerics7 `${n => n}${n => n}${n => n}`; someGenerics7 `${n => n}${n => n}${n => n}`; someGenerics7 `${(n) => n}${(n) => n}${(n) => n}`; // Generic tag with argument of generic function type -function someGenerics8(strs, n) { - return n; -} +function someGenerics8(strs, n) { return n; } var x = someGenerics8 `${someGenerics7}`; x `${null}${null}${null}`; // Generic tag with multiple parameters of generic type passed arguments with no best common type @@ -157,22 +144,10 @@ function someGenerics9(strs, a, b, c) { } var a9a = someGenerics9 `${''}${0}${[]}`; var a9a; -var a9e = someGenerics9 `${undefined}${{ - x: 6, - z: new Date() -}}${{ - x: 6, - y: '' -}}`; +var a9e = someGenerics9 `${undefined}${{ x: 6, z: new Date() }}${{ x: 6, y: '' }}`; var a9e; // Generic tag with multiple parameters of generic type passed arguments with a single best common type -var a9d = someGenerics9 `${{ - x: 3 -}}${{ - x: 6 -}}${{ - x: 6 -}}`; +var a9d = someGenerics9 `${{ x: 3 }}${{ x: 6 }}${{ x: 6 }}`; var a9d; // Generic tag with multiple parameters of generic type where one argument is of type 'any' var anyVar; diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.js b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.js index 24b0b16ea35..48c03b6d41d 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.js +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.js @@ -74,15 +74,11 @@ fn5 `${ (n) => n.substr(0) }`; //// [taggedTemplateStringsWithOverloadResolution3.js] -function fn1() { - return null; -} +function fn1() { return null; } var s = (_a = ["", ""], _a.raw = ["", ""], fn1(_a, undefined)); // No candidate overloads found (_b = ["", ""], _b.raw = ["", ""], fn1(_b, {})); // Error -function fn2() { - return undefined; -} +function fn2() { return undefined; } var d1 = (_c = ["", "", ""], _c.raw = ["", "", ""], fn2(_c, 0, undefined)); // contextually typed var d2 = (_d = ["", "", ""], _d.raw = ["", "", ""], fn2(_d, 0, undefined)); // any d1.foo(); // error @@ -91,9 +87,7 @@ d2(); // no error (typed as any) (_e = ["", "", ""], _e.raw = ["", "", ""], fn2(_e, 0, '')); // OK // Generic and non-generic overload where non-generic overload is the only candidate (_f = ["", "", ""], _f.raw = ["", "", ""], fn2(_f, '', 0)); // OK -function fn3() { - return null; -} +function fn3() { return null; } var s = (_g = ["", ""], _g.raw = ["", ""], fn3(_g, 3)); var s = (_h = ["", "", "", ""], _h.raw = ["", "", "", ""], fn3(_h, '', 3, '')); var n = (_j = ["", "", "", ""], _j.raw = ["", "", "", ""], fn3(_j, 5, 5, 5)); @@ -104,8 +98,7 @@ var s = (_l = ["", "", "", ""], _l.raw = ["", "", "", ""], fn3(_l, '', '', '')); var n = (_m = ["", "", "", ""], _m.raw = ["", "", "", ""], fn3(_m, '', '', 3)); // Generic overloads with differing arity tagging with argument count that doesn't match any overload (_o = [""], _o.raw = [""], fn3(_o)); // Error -function fn4() { -} +function fn4() { } // Generic overloads with constraints tagged with types that satisfy the constraints (_p = ["", "", ""], _p.raw = ["", "", ""], fn4(_p, '', 3)); (_q = ["", "", ""], _q.raw = ["", "", ""], fn4(_q, 3, '')); @@ -116,13 +109,7 @@ function fn4() { // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints (_u = ["", "", ""], _u.raw = ["", "", ""], fn4(_u, true, null)); (_v = ["", "", ""], _v.raw = ["", "", ""], fn4(_v, null, true)); -function fn5() { - return undefined; -} -(_w = ["", ""], _w.raw = ["", ""], fn5(_w, function (n) { - return n.toFixed(); -})); // will error; 'n' should have type 'string'. -(_x = ["", ""], _x.raw = ["", ""], fn5(_x, function (n) { - return n.substr(0); -})); +function fn5() { return undefined; } +(_w = ["", ""], _w.raw = ["", ""], fn5(_w, function (n) { return n.toFixed(); })); // will error; 'n' should have type 'string'. +(_x = ["", ""], _x.raw = ["", ""], fn5(_x, function (n) { return n.substr(0); })); var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x; diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.js b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.js index 666974de447..583770b9cd8 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.js +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.js @@ -73,15 +73,11 @@ fn5 `${ (n) => n.substr(0) }`; //// [taggedTemplateStringsWithOverloadResolution3_ES6.js] -function fn1() { - return null; -} +function fn1() { return null; } var s = fn1 `${undefined}`; // No candidate overloads found fn1 `${{}}`; // Error -function fn2() { - return undefined; -} +function fn2() { return undefined; } var d1 = fn2 `${0}${undefined}`; // contextually typed var d2 = fn2 `${0}${undefined}`; // any d1.foo(); // error @@ -90,9 +86,7 @@ d2(); // no error (typed as any) fn2 `${0}${''}`; // OK // Generic and non-generic overload where non-generic overload is the only candidate fn2 `${''}${0}`; // OK -function fn3() { - return null; -} +function fn3() { return null; } var s = fn3 `${3}`; var s = fn3 `${''}${3}${''}`; var n = fn3 `${5}${5}${5}`; @@ -103,8 +97,7 @@ var s = fn3 `${''}${''}${''}`; var n = fn3 `${''}${''}${3}`; // Generic overloads with differing arity tagging with argument count that doesn't match any overload fn3 ``; // Error -function fn4() { -} +function fn4() { } // Generic overloads with constraints tagged with types that satisfy the constraints fn4 `${''}${3}`; fn4 `${3}${''}`; @@ -115,8 +108,6 @@ fn4 `${null}${null}`; // Error // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints fn4 `${true}${null}`; fn4 `${null}${true}`; -function fn5() { - return undefined; -} +function fn5() { return undefined; } fn5 `${(n) => n.toFixed()}`; // will error; 'n' should have type 'string'. fn5 `${(n) => n.substr(0)}`; diff --git a/tests/baselines/reference/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.js b/tests/baselines/reference/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.js index 10a8f1f2a12..f7523eb9870 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.js +++ b/tests/baselines/reference/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.js @@ -13,7 +13,5 @@ function foo() { rest[_i - 0] = arguments[_i]; } } -(_a = ["", ""], _a.raw = ["", ""], foo(_a, function (x) { - x = "bad"; -})); +(_a = ["", ""], _a.raw = ["", ""], foo(_a, function (x) { x = "bad"; })); var _a; diff --git a/tests/baselines/reference/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.js b/tests/baselines/reference/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.js index bc18a600458..7691b83b3bc 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.js +++ b/tests/baselines/reference/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.js @@ -8,6 +8,4 @@ foo `${function (x: number) { x = "bad"; } }`; //// [taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.js] function foo(...rest) { } -foo `${function (x) { - x = "bad"; -}}`; +foo `${function (x) { x = "bad"; }}`; diff --git a/tests/baselines/reference/targetTypeArgs.js b/tests/baselines/reference/targetTypeArgs.js index cb227f81b40..18dff375abe 100644 --- a/tests/baselines/reference/targetTypeArgs.js +++ b/tests/baselines/reference/targetTypeArgs.js @@ -18,36 +18,10 @@ foo(function(x) { x }); function foo(callback) { callback("hello"); } -foo(function (x) { - x; -}); -[ - 1 -].forEach(function (v, i, a) { - v; -}); -[ - "hello" -].every(function (v, i, a) { - return true; -}); -[ - 1 -].every(function (v, i, a) { - return true; -}); -[ - 1 -].every(function (v, i, a) { - return true; -}); -[ - "s" -].every(function (v, i, a) { - return true; -}); -[ - "s" -].forEach(function (v, i, a) { - v; -}); +foo(function (x) { x; }); +[1].forEach(function (v, i, a) { v; }); +["hello"].every(function (v, i, a) { return true; }); +[1].every(function (v, i, a) { return true; }); +[1].every(function (v, i, a) { return true; }); +["s"].every(function (v, i, a) { return true; }); +["s"].forEach(function (v, i, a) { v; }); diff --git a/tests/baselines/reference/targetTypeBaseCalls.js b/tests/baselines/reference/targetTypeBaseCalls.js index d844354b154..c886183bacf 100644 --- a/tests/baselines/reference/targetTypeBaseCalls.js +++ b/tests/baselines/reference/targetTypeBaseCalls.js @@ -25,25 +25,18 @@ var __extends = this.__extends || function (d, b) { __.prototype = b.prototype; d.prototype = new __(); }; -function foo(x) { -} +function foo(x) { } var Foo = (function () { function Foo(x) { } return Foo; })(); -foo(function (s) { - s = 5; -}); // Error, can’t assign number to string -new Foo(function (s) { - s = 5; -}); // error, if types are applied correctly +foo(function (s) { s = 5; }); // Error, can’t assign number to string +new Foo(function (s) { s = 5; }); // error, if types are applied correctly var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.call(this, function (s) { - s = 5; - }); + _super.call(this, function (s) { s = 5; }); } return Bar; })(Foo); // error, if types are applied correctly diff --git a/tests/baselines/reference/targetTypeCalls.js b/tests/baselines/reference/targetTypeCalls.js index 302419a2693..168195216ca 100644 --- a/tests/baselines/reference/targetTypeCalls.js +++ b/tests/baselines/reference/targetTypeCalls.js @@ -6,27 +6,7 @@ var fra3: (v:any)=>string = function() { return function() { return function(v) var fra4: (v:any)=>void = function() { return function() { return function(v) {return v;};}(); }() // should work //// [targetTypeCalls.js] -var fra1 = function () { - return function (v) { - return v; - }; -}(); // should work -var fra2 = function () { - return function () { - return 0; - }; -}(); // should work -var fra3 = function () { - return function () { - return function (v) { - return v; - }; - }(); -}(); // should work -var fra4 = function () { - return function () { - return function (v) { - return v; - }; - }(); -}(); // should work +var fra1 = function () { return function (v) { return v; }; }(); // should work +var fra2 = function () { return function () { return 0; }; }(); // should work +var fra3 = function () { return function () { return function (v) { return v; }; }(); }(); // should work +var fra4 = function () { return function () { return function (v) { return v; }; }(); }(); // should work diff --git a/tests/baselines/reference/targetTypeCastTest.js b/tests/baselines/reference/targetTypeCastTest.js index c9a30c6d685..053aced7305 100644 --- a/tests/baselines/reference/targetTypeCastTest.js +++ b/tests/baselines/reference/targetTypeCastTest.js @@ -28,12 +28,8 @@ function Point(x, y) { this.x = x; this.y = y; } -var add = function (x, y) { - return x + y; -}; +var add = function (x, y) { return x + y; }; var add2 = function (x, y) { return 0; }; -function add3(x, y) { - x; -} +function add3(x, y) { x; } diff --git a/tests/baselines/reference/targetTypeObjectLiteralToAny.js b/tests/baselines/reference/targetTypeObjectLiteralToAny.js index f6228f210f8..fced520e09e 100644 --- a/tests/baselines/reference/targetTypeObjectLiteralToAny.js +++ b/tests/baselines/reference/targetTypeObjectLiteralToAny.js @@ -15,9 +15,6 @@ function suggest() { var TypeScriptKeywords; var result; TypeScriptKeywords.forEach(function (keyword) { - result.push({ - text: keyword, - type: "keyword" - }); // this should not cause a crash - push should be typed to any + result.push({ text: keyword, type: "keyword" }); // this should not cause a crash - push should be typed to any }); } diff --git a/tests/baselines/reference/targetTypeTest1.js b/tests/baselines/reference/targetTypeTest1.js index 8c9156d1e0d..8f9657ee9d0 100644 --- a/tests/baselines/reference/targetTypeTest1.js +++ b/tests/baselines/reference/targetTypeTest1.js @@ -80,9 +80,7 @@ function Point(x, y) { this.x = x; this.y = y; } -function EF1(a, b) { - return a + b; -} +function EF1(a, b) { return a + b; } var x = EF1(1, 2); // Point.origin declared as type Point Point.origin = new Point(0, 0); @@ -110,10 +108,10 @@ function C(a, b) { this.a = a; this.b = b; } -C.prototype = { - a: 0, - b: 0, - C1M1: function (c, d) { - return (this.a + c) + (this.b + d); - } -}; +C.prototype = + { a: 0, + b: 0, + C1M1: function (c, d) { + return (this.a + c) + (this.b + d); + } + }; diff --git a/tests/baselines/reference/targetTypeTest2.js b/tests/baselines/reference/targetTypeTest2.js index 2d0a7dee464..0ba82bc9cce 100644 --- a/tests/baselines/reference/targetTypeTest2.js +++ b/tests/baselines/reference/targetTypeTest2.js @@ -13,18 +13,8 @@ function func2(stuff1:string, stuff2:number, stuff3:number) { //// [targetTypeTest2.js] // Test target typing for array literals and call expressions -var a = [ - 1, - 2, - "3" -]; -function func1(stuff) { - return stuff; -} +var a = [1, 2, "3"]; +function func1(stuff) { return stuff; } function func2(stuff1, stuff2, stuff3) { - return func1([ - stuff1, - stuff2, - stuff3 - ]); + return func1([stuff1, stuff2, stuff3]); } diff --git a/tests/baselines/reference/targetTypeTest3.js b/tests/baselines/reference/targetTypeTest3.js index 199d998a11c..13972478582 100644 --- a/tests/baselines/reference/targetTypeTest3.js +++ b/tests/baselines/reference/targetTypeTest3.js @@ -13,18 +13,8 @@ function func2(stuff1:string, stuff2:number, stuff3:number) { //// [targetTypeTest3.js] // Test target typing for array literals and call expressions -var a = [ - 1, - 2, - "3" -]; // should produce an error -function func1(stuff) { - return stuff; -} +var a = [1, 2, "3"]; // should produce an error +function func1(stuff) { return stuff; } function func2(stuff1, stuff2, stuff3) { - return func1([ - stuff1, - stuff2, - stuff3 - ]); + return func1([stuff1, stuff2, stuff3]); } diff --git a/tests/baselines/reference/targetTypeVoidFunc.js b/tests/baselines/reference/targetTypeVoidFunc.js index 9913b4bd491..dba2086b0e1 100644 --- a/tests/baselines/reference/targetTypeVoidFunc.js +++ b/tests/baselines/reference/targetTypeVoidFunc.js @@ -9,9 +9,7 @@ var z = new (f1())(); //// [targetTypeVoidFunc.js] function f1() { - return function () { - return; - }; + return function () { return; }; } ; var x = f1(); diff --git a/tests/baselines/reference/targetTypingOnFunctions.js b/tests/baselines/reference/targetTypingOnFunctions.js index 5b11a34ff4d..fad75a4bf6d 100644 --- a/tests/baselines/reference/targetTypingOnFunctions.js +++ b/tests/baselines/reference/targetTypingOnFunctions.js @@ -4,9 +4,5 @@ var fu: (s: string) => string = function (s) { return s.toLowerCase() }; var zu = fu = function (s) { return s.toLowerCase() }; //// [targetTypingOnFunctions.js] -var fu = function (s) { - return s.toLowerCase(); -}; -var zu = fu = function (s) { - return s.toLowerCase(); -}; +var fu = function (s) { return s.toLowerCase(); }; +var zu = fu = function (s) { return s.toLowerCase(); }; diff --git a/tests/baselines/reference/templateStringInArray.js b/tests/baselines/reference/templateStringInArray.js index 175dc39f62c..97d0b1a636b 100644 --- a/tests/baselines/reference/templateStringInArray.js +++ b/tests/baselines/reference/templateStringInArray.js @@ -2,8 +2,4 @@ var x = [1, 2, `abc${ 123 }def`]; //// [templateStringInArray.js] -var x = [ - 1, - 2, - ("abc" + 123 + "def") -]; +var x = [1, 2, ("abc" + 123 + "def")]; diff --git a/tests/baselines/reference/templateStringInArrowFunction.js b/tests/baselines/reference/templateStringInArrowFunction.js index 984c8673cb0..4c4890633e1 100644 --- a/tests/baselines/reference/templateStringInArrowFunction.js +++ b/tests/baselines/reference/templateStringInArrowFunction.js @@ -2,6 +2,4 @@ var x = x => `abc${ x }def`; //// [templateStringInArrowFunction.js] -var x = function (x) { - return ("abc" + x + "def"); -}; +var x = function (x) { return ("abc" + x + "def"); }; diff --git a/tests/baselines/reference/templateStringInEqualityChecks.js b/tests/baselines/reference/templateStringInEqualityChecks.js index 54f5fa610c2..f7573f8efd5 100644 --- a/tests/baselines/reference/templateStringInEqualityChecks.js +++ b/tests/baselines/reference/templateStringInEqualityChecks.js @@ -5,4 +5,7 @@ var x = `abc${0}abc` === `abc` || "abc0abc" !== `abc${0}abc`; //// [templateStringInEqualityChecks.js] -var x = "abc" + 0 + "abc" === "abc" || "abc" !== "abc" + 0 + "abc" && "abc" + 0 + "abc" == "abc0abc" && "abc0abc" !== "abc" + 0 + "abc"; +var x = "abc" + 0 + "abc" === "abc" || + "abc" !== "abc" + 0 + "abc" && + "abc" + 0 + "abc" == "abc0abc" && + "abc0abc" !== "abc" + 0 + "abc"; diff --git a/tests/baselines/reference/templateStringInEqualityChecksES6.js b/tests/baselines/reference/templateStringInEqualityChecksES6.js index 317db1ab366..9bb001d9dc7 100644 --- a/tests/baselines/reference/templateStringInEqualityChecksES6.js +++ b/tests/baselines/reference/templateStringInEqualityChecksES6.js @@ -5,4 +5,7 @@ var x = `abc${0}abc` === `abc` || "abc0abc" !== `abc${0}abc`; //// [templateStringInEqualityChecksES6.js] -var x = `abc${0}abc` === `abc` || `abc` !== `abc${0}abc` && `abc${0}abc` == "abc0abc" && "abc0abc" !== `abc${0}abc`; +var x = `abc${0}abc` === `abc` || + `abc` !== `abc${0}abc` && + `abc${0}abc` == "abc0abc" && + "abc0abc" !== `abc${0}abc`; diff --git a/tests/baselines/reference/templateStringInInOperator.js b/tests/baselines/reference/templateStringInInOperator.js index 6384c1096c6..c496e335dd4 100644 --- a/tests/baselines/reference/templateStringInInOperator.js +++ b/tests/baselines/reference/templateStringInInOperator.js @@ -2,7 +2,4 @@ var x = `${ "hi" }` in { hi: 10, hello: 20}; //// [templateStringInInOperator.js] -var x = "" + "hi" in { - hi: 10, - hello: 20 -}; +var x = "" + "hi" in { hi: 10, hello: 20 }; diff --git a/tests/baselines/reference/templateStringInInOperatorES6.js b/tests/baselines/reference/templateStringInInOperatorES6.js index 75d79fad062..bd4daef3b6d 100644 --- a/tests/baselines/reference/templateStringInInOperatorES6.js +++ b/tests/baselines/reference/templateStringInInOperatorES6.js @@ -2,7 +2,4 @@ var x = `${ "hi" }` in { hi: 10, hello: 20}; //// [templateStringInInOperatorES6.js] -var x = `${"hi"}` in { - hi: 10, - hello: 20 -}; +var x = `${"hi"}` in { hi: 10, hello: 20 }; diff --git a/tests/baselines/reference/templateStringInObjectLiteral.js b/tests/baselines/reference/templateStringInObjectLiteral.js index 5a096b0adfa..2e4de70f57c 100644 --- a/tests/baselines/reference/templateStringInObjectLiteral.js +++ b/tests/baselines/reference/templateStringInObjectLiteral.js @@ -6,7 +6,6 @@ var x = { //// [templateStringInObjectLiteral.js] var x = (_a = ["b"], _a.raw = ["b"], ({ - a: "abc" + 123 + "def" -})(_a)); + a: "abc" + 123 + "def" })(_a)); 321; var _a; diff --git a/tests/baselines/reference/templateStringInObjectLiteralES6.js b/tests/baselines/reference/templateStringInObjectLiteralES6.js index 22144e75247..7de012185a9 100644 --- a/tests/baselines/reference/templateStringInObjectLiteralES6.js +++ b/tests/baselines/reference/templateStringInObjectLiteralES6.js @@ -6,6 +6,5 @@ var x = { //// [templateStringInObjectLiteralES6.js] var x = { - a: `abc${123}def`, -} `b`; + a: `abc${123}def`, } `b`; 321; diff --git a/tests/baselines/reference/templateStringWithEmbeddedArray.js b/tests/baselines/reference/templateStringWithEmbeddedArray.js index 946bae01dfb..1fb6512db47 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedArray.js +++ b/tests/baselines/reference/templateStringWithEmbeddedArray.js @@ -2,8 +2,4 @@ var x = `abc${ [1,2,3] }def`; //// [templateStringWithEmbeddedArray.js] -var x = "abc" + [ - 1, - 2, - 3 -] + "def"; +var x = "abc" + [1, 2, 3] + "def"; diff --git a/tests/baselines/reference/templateStringWithEmbeddedArrayES6.js b/tests/baselines/reference/templateStringWithEmbeddedArrayES6.js index 96b311cf02b..804ef7a4e78 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedArrayES6.js +++ b/tests/baselines/reference/templateStringWithEmbeddedArrayES6.js @@ -2,8 +2,4 @@ var x = `abc${ [1,2,3] }def`; //// [templateStringWithEmbeddedArrayES6.js] -var x = `abc${[ - 1, - 2, - 3 -]}def`; +var x = `abc${[1, 2, 3]}def`; diff --git a/tests/baselines/reference/templateStringWithEmbeddedArrowFunction.js b/tests/baselines/reference/templateStringWithEmbeddedArrowFunction.js index 22b9387047f..eb2579b0cc3 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedArrowFunction.js +++ b/tests/baselines/reference/templateStringWithEmbeddedArrowFunction.js @@ -2,6 +2,4 @@ var x = `abc${ x => x }def`; //// [templateStringWithEmbeddedArrowFunction.js] -var x = "abc" + function (x) { - return x; -} + "def"; +var x = "abc" + function (x) { return x; } + "def"; diff --git a/tests/baselines/reference/templateStringWithEmbeddedFunctionExpression.js b/tests/baselines/reference/templateStringWithEmbeddedFunctionExpression.js index 3447ff87ac3..88a8349d1a4 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedFunctionExpression.js +++ b/tests/baselines/reference/templateStringWithEmbeddedFunctionExpression.js @@ -2,6 +2,4 @@ var x = `abc${ function y() { return y; } }def`; //// [templateStringWithEmbeddedFunctionExpression.js] -var x = "abc" + function y() { - return y; -} + "def"; +var x = "abc" + function y() { return y; } + "def"; diff --git a/tests/baselines/reference/templateStringWithEmbeddedFunctionExpressionES6.js b/tests/baselines/reference/templateStringWithEmbeddedFunctionExpressionES6.js index 46e37c0ac18..f0e2f749cfd 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedFunctionExpressionES6.js +++ b/tests/baselines/reference/templateStringWithEmbeddedFunctionExpressionES6.js @@ -2,6 +2,4 @@ var x = `abc${ function y() { return y; } }def`; //// [templateStringWithEmbeddedFunctionExpressionES6.js] -var x = `abc${function y() { - return y; -}}def`; +var x = `abc${function y() { return y; }}def`; diff --git a/tests/baselines/reference/templateStringWithEmbeddedInOperator.js b/tests/baselines/reference/templateStringWithEmbeddedInOperator.js index 27c83d6ca81..091843ea52e 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedInOperator.js +++ b/tests/baselines/reference/templateStringWithEmbeddedInOperator.js @@ -2,7 +2,4 @@ var x = `abc${ "hi" in { hi: 10, hello: 20} }def`; //// [templateStringWithEmbeddedInOperator.js] -var x = "abc" + ("hi" in { - hi: 10, - hello: 20 -}) + "def"; +var x = "abc" + ("hi" in { hi: 10, hello: 20 }) + "def"; diff --git a/tests/baselines/reference/templateStringWithEmbeddedInOperatorES6.js b/tests/baselines/reference/templateStringWithEmbeddedInOperatorES6.js index 76a66436311..f6510c2fab9 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedInOperatorES6.js +++ b/tests/baselines/reference/templateStringWithEmbeddedInOperatorES6.js @@ -2,7 +2,4 @@ var x = `abc${ "hi" in { hi: 10, hello: 20} }def`; //// [templateStringWithEmbeddedInOperatorES6.js] -var x = `abc${"hi" in { - hi: 10, - hello: 20 -}}def`; +var x = `abc${"hi" in { hi: 10, hello: 20 }}def`; diff --git a/tests/baselines/reference/templateStringWithEmbeddedObjectLiteral.js b/tests/baselines/reference/templateStringWithEmbeddedObjectLiteral.js index 99d801f1c8a..40ecf486245 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedObjectLiteral.js +++ b/tests/baselines/reference/templateStringWithEmbeddedObjectLiteral.js @@ -2,7 +2,4 @@ var x = `abc${ { x: 10, y: 20 } }def`; //// [templateStringWithEmbeddedObjectLiteral.js] -var x = "abc" + { - x: 10, - y: 20 -} + "def"; +var x = "abc" + { x: 10, y: 20 } + "def"; diff --git a/tests/baselines/reference/templateStringWithEmbeddedObjectLiteralES6.js b/tests/baselines/reference/templateStringWithEmbeddedObjectLiteralES6.js index bf197d86319..dbc3837e133 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedObjectLiteralES6.js +++ b/tests/baselines/reference/templateStringWithEmbeddedObjectLiteralES6.js @@ -2,7 +2,4 @@ var x = `abc${ { x: 10, y: 20 } }def`; //// [templateStringWithEmbeddedObjectLiteralES6.js] -var x = `abc${{ - x: 10, - y: 20 -}}def`; +var x = `abc${{ x: 10, y: 20 }}def`; diff --git a/tests/baselines/reference/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.js b/tests/baselines/reference/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.js index ef113312060..72d0fd8c8db 100644 --- a/tests/baselines/reference/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.js +++ b/tests/baselines/reference/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.js @@ -4,6 +4,4 @@ `${function (x: number) { x = "bad"; } }`; //// [templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.js] -"" + function (x) { - x = "bad"; -}; +"" + function (x) { x = "bad"; }; diff --git a/tests/baselines/reference/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.js b/tests/baselines/reference/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.js index 9ce47348dc1..18fae66c78a 100644 --- a/tests/baselines/reference/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.js +++ b/tests/baselines/reference/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.js @@ -3,6 +3,4 @@ `${function (x: number) { x = "bad"; } }`; //// [templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.js] -`${function (x) { - x = "bad"; -}}`; +`${function (x) { x = "bad"; }}`; diff --git a/tests/baselines/reference/ternaryExpressionSourceMap.js b/tests/baselines/reference/ternaryExpressionSourceMap.js index 24813de9734..4b43726b281 100644 --- a/tests/baselines/reference/ternaryExpressionSourceMap.js +++ b/tests/baselines/reference/ternaryExpressionSourceMap.js @@ -5,9 +5,5 @@ var foo = x ? () => 0 : () => 0; //// [ternaryExpressionSourceMap.js] var x = 1; -var foo = x ? function () { - return 0; -} : function () { - return 0; -}; +var foo = x ? function () { return 0; } : function () { return 0; }; //# sourceMappingURL=ternaryExpressionSourceMap.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ternaryExpressionSourceMap.js.map b/tests/baselines/reference/ternaryExpressionSourceMap.js.map index af4eaa03ab7..f7ddfe9024c 100644 --- a/tests/baselines/reference/ternaryExpressionSourceMap.js.map +++ b/tests/baselines/reference/ternaryExpressionSourceMap.js.map @@ -1,2 +1,2 @@ //// [ternaryExpressionSourceMap.js.map] -{"version":3,"file":"ternaryExpressionSourceMap.js","sourceRoot":"","sources":["ternaryExpressionSourceMap.ts"],"names":[],"mappings":"AACA,IAAI,CAAC,GAAG,CAAC,CAAC;AACV,IAAI,GAAG,GAAG,CAAC,GAAG;WAAM,CAAC;AAAD,CAAC,GAAG;WAAM,CAAC;AAAD,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"ternaryExpressionSourceMap.js","sourceRoot":"","sources":["ternaryExpressionSourceMap.ts"],"names":[],"mappings":"AACA,IAAI,CAAC,GAAG,CAAC,CAAC;AACV,IAAI,GAAG,GAAG,CAAC,GAAG,cAAM,OAAA,CAAC,EAAD,CAAC,GAAG,cAAM,OAAA,CAAC,EAAD,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/ternaryExpressionSourceMap.sourcemap.txt b/tests/baselines/reference/ternaryExpressionSourceMap.sourcemap.txt index b1046e0b429..51807286b63 100644 --- a/tests/baselines/reference/ternaryExpressionSourceMap.sourcemap.txt +++ b/tests/baselines/reference/ternaryExpressionSourceMap.sourcemap.txt @@ -15,7 +15,7 @@ sourceFile:ternaryExpressionSourceMap.ts 4 > ^^^ 5 > ^ 6 > ^ -7 > ^^^^^^^^^^^^^^^^^^-> +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 >var @@ -30,13 +30,25 @@ sourceFile:ternaryExpressionSourceMap.ts 5 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) 6 >Emitted(1, 11) Source(2, 11) + SourceIndex(0) --- ->>>var foo = x ? function () { +>>>var foo = x ? function () { return 0; } : function () { return 0; }; 1-> 2 >^^^^ 3 > ^^^ 4 > ^^^ 5 > ^ 6 > ^^^ +7 > ^^^^^^^^^^^^^^ +8 > ^^^^^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^^^^^^^^^^^^^^ +14> ^^^^^^^ +15> ^ +16> ^^ +17> ^ +18> ^ 1-> > 2 >var @@ -44,52 +56,35 @@ sourceFile:ternaryExpressionSourceMap.ts 4 > = 5 > x 6 > ? +7 > () => +8 > +9 > 0 +10> +11> 0 +12> : +13> () => +14> +15> 0 +16> +17> 0 +18> ; 1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) 2 >Emitted(2, 5) Source(3, 5) + SourceIndex(0) 3 >Emitted(2, 8) Source(3, 8) + SourceIndex(0) 4 >Emitted(2, 11) Source(3, 11) + SourceIndex(0) 5 >Emitted(2, 12) Source(3, 12) + SourceIndex(0) 6 >Emitted(2, 15) Source(3, 15) + SourceIndex(0) ---- ->>> return 0; -1 >^^^^^^^^^^^ -2 > ^ -3 > ^^^^^^-> -1 >() => -2 > 0 -1 >Emitted(3, 12) Source(3, 21) + SourceIndex(0) -2 >Emitted(3, 13) Source(3, 22) + SourceIndex(0) ---- ->>>} : function () { -1-> -2 >^ -3 > ^^^ -4 > ^^^^^^^^^^-> -1-> -2 >0 -3 > : -1->Emitted(4, 1) Source(3, 21) + SourceIndex(0) -2 >Emitted(4, 2) Source(3, 22) + SourceIndex(0) -3 >Emitted(4, 5) Source(3, 25) + SourceIndex(0) ---- ->>> return 0; -1->^^^^^^^^^^^ -2 > ^ -1->() => -2 > 0 -1->Emitted(5, 12) Source(3, 31) + SourceIndex(0) -2 >Emitted(5, 13) Source(3, 32) + SourceIndex(0) ---- ->>>}; -1 > -2 >^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >0 -3 > ; -1 >Emitted(6, 1) Source(3, 31) + SourceIndex(0) -2 >Emitted(6, 2) Source(3, 32) + SourceIndex(0) -3 >Emitted(6, 3) Source(3, 33) + SourceIndex(0) +7 >Emitted(2, 29) Source(3, 21) + SourceIndex(0) +8 >Emitted(2, 36) Source(3, 21) + SourceIndex(0) +9 >Emitted(2, 37) Source(3, 22) + SourceIndex(0) +10>Emitted(2, 39) Source(3, 21) + SourceIndex(0) +11>Emitted(2, 40) Source(3, 22) + SourceIndex(0) +12>Emitted(2, 43) Source(3, 25) + SourceIndex(0) +13>Emitted(2, 57) Source(3, 31) + SourceIndex(0) +14>Emitted(2, 64) Source(3, 31) + SourceIndex(0) +15>Emitted(2, 65) Source(3, 32) + SourceIndex(0) +16>Emitted(2, 67) Source(3, 31) + SourceIndex(0) +17>Emitted(2, 68) Source(3, 32) + SourceIndex(0) +18>Emitted(2, 69) Source(3, 33) + SourceIndex(0) --- >>>//# sourceMappingURL=ternaryExpressionSourceMap.js.map \ No newline at end of file diff --git a/tests/baselines/reference/thisBinding.js b/tests/baselines/reference/thisBinding.js index 0c0547a4b91..79a27b19fd8 100644 --- a/tests/baselines/reference/thisBinding.js +++ b/tests/baselines/reference/thisBinding.js @@ -27,10 +27,7 @@ var M; var C = (function () { function C() { this.x = 0; - ({ - z: 10, - f: this.f - }).f(({})); + ({ z: 10, f: this.f }).f(({})); } C.prototype.f = function (x) { x.e; // e not found diff --git a/tests/baselines/reference/thisBinding2.js b/tests/baselines/reference/thisBinding2.js index ced47c0bc7b..76b99797e16 100644 --- a/tests/baselines/reference/thisBinding2.js +++ b/tests/baselines/reference/thisBinding2.js @@ -40,8 +40,6 @@ var messenger = { message: "Hello World", start: function () { var _this = this; - return setTimeout(function () { - var x = _this.message; - }, 3000); + return setTimeout(function () { var x = _this.message; }, 3000); } }; diff --git a/tests/baselines/reference/thisExpressionInCallExpressionWithTypeArguments.js b/tests/baselines/reference/thisExpressionInCallExpressionWithTypeArguments.js index 348684fe606..78b06d30dd2 100644 --- a/tests/baselines/reference/thisExpressionInCallExpressionWithTypeArguments.js +++ b/tests/baselines/reference/thisExpressionInCallExpressionWithTypeArguments.js @@ -10,13 +10,7 @@ var C = (function () { } C.prototype.foo = function () { var _this = this; - [ - 1, - 2, - 3 - ].map(function (x) { - return _this; - }); + [1, 2, 3].map(function (x) { return _this; }); }; return C; })(); diff --git a/tests/baselines/reference/thisExpressionInIndexExpression.js b/tests/baselines/reference/thisExpressionInIndexExpression.js index 45094ece936..1e6661386c4 100644 --- a/tests/baselines/reference/thisExpressionInIndexExpression.js +++ b/tests/baselines/reference/thisExpressionInIndexExpression.js @@ -6,7 +6,5 @@ function f() { //// [thisExpressionInIndexExpression.js] function f() { var _this = this; - return function (r) { - return r[_this]; - }; + return function (r) { return r[_this]; }; } diff --git a/tests/baselines/reference/thisExpressionOfGenericObject.js b/tests/baselines/reference/thisExpressionOfGenericObject.js index 5daa4959c6d..e790050069e 100644 --- a/tests/baselines/reference/thisExpressionOfGenericObject.js +++ b/tests/baselines/reference/thisExpressionOfGenericObject.js @@ -11,9 +11,7 @@ class MyClass1 { var MyClass1 = (function () { function MyClass1() { var _this = this; - (function () { - return _this; - }); + (function () { return _this; }); } return MyClass1; })(); diff --git a/tests/baselines/reference/thisInAccessors.js b/tests/baselines/reference/thisInAccessors.js index 3d3206e11f5..ab521649292 100644 --- a/tests/baselines/reference/thisInAccessors.js +++ b/tests/baselines/reference/thisInAccessors.js @@ -38,9 +38,7 @@ var GetterOnly = (function () { Object.defineProperty(GetterOnly.prototype, "Value", { get: function () { var _this = this; - var fn = function () { - return _this; - }; + var fn = function () { return _this; }; return ''; }, set: function (val) { @@ -60,9 +58,7 @@ var SetterOnly = (function () { }, set: function (val) { var _this = this; - var fn = function () { - return _this; - }; + var fn = function () { return _this; }; }, enumerable: true, configurable: true @@ -76,16 +72,12 @@ var GetterAndSetter = (function () { Object.defineProperty(GetterAndSetter.prototype, "Value", { get: function () { var _this = this; - var fn = function () { - return _this; - }; + var fn = function () { return _this; }; return ''; }, set: function (val) { var _this = this; - var fn = function () { - return _this; - }; + var fn = function () { return _this; }; }, enumerable: true, configurable: true diff --git a/tests/baselines/reference/thisInArrowFunctionInStaticInitializer1.js b/tests/baselines/reference/thisInArrowFunctionInStaticInitializer1.js index fdfcc5d9522..03e6ddb64d9 100644 --- a/tests/baselines/reference/thisInArrowFunctionInStaticInitializer1.js +++ b/tests/baselines/reference/thisInArrowFunctionInStaticInitializer1.js @@ -9,8 +9,7 @@ class Vector { } //// [thisInArrowFunctionInStaticInitializer1.js] -function log(a) { -} +function log(a) { } var Vector = (function () { function Vector() { var _this = this; diff --git a/tests/baselines/reference/thisInInnerFunctions.js b/tests/baselines/reference/thisInInnerFunctions.js index 09ee60fdb9b..d9ba3adfdf3 100644 --- a/tests/baselines/reference/thisInInnerFunctions.js +++ b/tests/baselines/reference/thisInInnerFunctions.js @@ -26,9 +26,7 @@ var Foo = (function () { function inner() { var _this = this; this.y = "hi"; // 'this' should be not type to 'Foo' either - var f = function () { - return _this.y; - }; // 'this' should be not type to 'Foo' either + var f = function () { return _this.y; }; // 'this' should be not type to 'Foo' either } }; return Foo; @@ -36,9 +34,7 @@ var Foo = (function () { function test() { var _this = this; var x = function () { - (function () { - return _this; - })(); + (function () { return _this; })(); _this; }; } diff --git a/tests/baselines/reference/thisInInvalidContexts.errors.txt b/tests/baselines/reference/thisInInvalidContexts.errors.txt index c9ec44b8cd6..481c4747c99 100644 --- a/tests/baselines/reference/thisInInvalidContexts.errors.txt +++ b/tests/baselines/reference/thisInInvalidContexts.errors.txt @@ -1,13 +1,12 @@ 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(38,25): error TS1133: Type reference expected. -tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(38,30): error TS1005: ';' expected. +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. -==== tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts (7 errors) ==== +==== tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts (6 errors) ==== //'this' in static member initializer class ErrClass1 { static t = this; // Error @@ -53,9 +52,7 @@ tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(45,9): class ErrClass3 extends this { ~~~~ -!!! error TS1133: Type reference expected. - ~ -!!! error TS1005: ';' expected. +!!! error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. } diff --git a/tests/baselines/reference/thisInInvalidContexts.js b/tests/baselines/reference/thisInInvalidContexts.js index 16c40a96e91..5720156de0b 100644 --- a/tests/baselines/reference/thisInInvalidContexts.js +++ b/tests/baselines/reference/thisInInvalidContexts.js @@ -92,17 +92,15 @@ var M; //'this' as type parameter constraint // function fn() { } // Error //'this' as a type argument -function genericFunc(x) { -} +function genericFunc(x) { } genericFunc < this > (undefined); // Should be an error -var ErrClass3 = (function () { +var ErrClass3 = (function (_super) { + __extends(ErrClass3, _super); function ErrClass3() { + _super.apply(this, arguments); } return ErrClass3; -})(); -this; -{ -} +})(this); //'this' as a computed enum value var SomeEnum; (function (SomeEnum) { diff --git a/tests/baselines/reference/thisInInvalidContextsExternalModule.errors.txt b/tests/baselines/reference/thisInInvalidContextsExternalModule.errors.txt index 0453d3ed315..a8bf99de27b 100644 --- a/tests/baselines/reference/thisInInvalidContextsExternalModule.errors.txt +++ b/tests/baselines/reference/thisInInvalidContextsExternalModule.errors.txt @@ -1,14 +1,13 @@ 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(38,25): error TS1133: Type reference expected. -tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(38,30): error TS1005: ';' expected. +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 (8 errors) ==== +==== tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts (7 errors) ==== //'this' in static member initializer class ErrClass1 { static t = this; // Error @@ -54,9 +53,7 @@ tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalMod class ErrClass3 extends this { ~~~~ -!!! error TS1133: Type reference expected. - ~ -!!! error TS1005: ';' expected. +!!! error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. } diff --git a/tests/baselines/reference/thisInInvalidContextsExternalModule.js b/tests/baselines/reference/thisInInvalidContextsExternalModule.js index 2e8e6d10c6c..eee8bcc8487 100644 --- a/tests/baselines/reference/thisInInvalidContextsExternalModule.js +++ b/tests/baselines/reference/thisInInvalidContextsExternalModule.js @@ -92,17 +92,15 @@ var M; //'this' as type parameter constraint // function fn() { } // Error //'this' as a type argument -function genericFunc(x) { -} +function genericFunc(x) { } genericFunc < this > (undefined); // Should be an error -var ErrClass3 = (function () { +var ErrClass3 = (function (_super) { + __extends(ErrClass3, _super); function ErrClass3() { + _super.apply(this, arguments); } return ErrClass3; -})(); -this; -{ -} +})(this); //'this' as a computed enum value var SomeEnum; (function (SomeEnum) { diff --git a/tests/baselines/reference/thisInLambda.js b/tests/baselines/reference/thisInLambda.js index 40a12d93351..94c86bd5a80 100644 --- a/tests/baselines/reference/thisInLambda.js +++ b/tests/baselines/reference/thisInLambda.js @@ -26,14 +26,11 @@ var Foo = (function () { Foo.prototype.bar = function () { var _this = this; this.x; // 'this' is type 'Foo' - var f = function () { - return _this.x; - }; // 'this' should be type 'Foo' as well + var f = function () { return _this.x; }; // 'this' should be type 'Foo' as well }; return Foo; })(); -function myFn(a) { -} +function myFn(a) { } var myCls = (function () { function myCls() { var _this = this; diff --git a/tests/baselines/reference/thisInObjectLiterals.js b/tests/baselines/reference/thisInObjectLiterals.js index a2a6453e1aa..79e834be154 100644 --- a/tests/baselines/reference/thisInObjectLiterals.js +++ b/tests/baselines/reference/thisInObjectLiterals.js @@ -24,10 +24,7 @@ var MyClass = (function () { } MyClass.prototype.fn = function () { //type of 'this' in an object literal is the containing scope's this - var t = { - x: this, - y: this.t - }; + var t = { x: this, y: this.t }; var t; }; return MyClass; diff --git a/tests/baselines/reference/thisInOuterClassBody.js b/tests/baselines/reference/thisInOuterClassBody.js index ecbe6fc5417..0dff441bb1e 100644 --- a/tests/baselines/reference/thisInOuterClassBody.js +++ b/tests/baselines/reference/thisInOuterClassBody.js @@ -28,9 +28,7 @@ var Foo = (function () { Foo.prototype.bar = function () { var _this = this; this.x; // 'this' is type 'Foo' - var f = function () { - return _this.x; - }; // 'this' should be type 'Foo' as well + var f = function () { return _this.x; }; // 'this' should be type 'Foo' as well var p = this.y; return this; }; diff --git a/tests/baselines/reference/thisInPropertyBoundDeclarations.js b/tests/baselines/reference/thisInPropertyBoundDeclarations.js index cba8fd2a8c2..e5004eed431 100644 --- a/tests/baselines/reference/thisInPropertyBoundDeclarations.js +++ b/tests/baselines/reference/thisInPropertyBoundDeclarations.js @@ -92,9 +92,7 @@ var A = (function () { function inner() { this; } - (function () { - return _this; - }); + (function () { return _this; }); }; this.prop3 = function () { function inner() { @@ -102,15 +100,11 @@ var A = (function () { } }; this.prop4 = { - a: function () { - return this; - } + a: function () { return this; } }; this.prop5 = function () { return { - a: function () { - return this; - } + a: function () { return this; } }; }; } @@ -120,36 +114,19 @@ var B = (function () { function B() { var _this = this; this.prop1 = this; - this.prop2 = function () { - return _this; - }; - this.prop3 = function () { - return function () { - return function () { - return function () { - return _this; - }; - }; - }; - }; - this.prop4 = ' ' + function () { - } + ' ' + (function () { - return function () { - return function () { - return _this; - }; - }; - }); + this.prop2 = function () { return _this; }; + this.prop3 = function () { return function () { return function () { return function () { return _this; }; }; }; }; + this.prop4 = ' ' + + function () { + } + + ' ' + + (function () { return function () { return function () { return _this; }; }; }); this.prop5 = { - a: function () { - return _this; - } + a: function () { return _this; } }; this.prop6 = function () { return { - a: function () { - return _this; - } + a: function () { return _this; } }; }; } diff --git a/tests/baselines/reference/thisReferencedInFunctionInsideArrowFunction1.js b/tests/baselines/reference/thisReferencedInFunctionInsideArrowFunction1.js index 78467e8a22e..99341af9f86 100644 --- a/tests/baselines/reference/thisReferencedInFunctionInsideArrowFunction1.js +++ b/tests/baselines/reference/thisReferencedInFunctionInsideArrowFunction1.js @@ -8,12 +8,9 @@ function test() } //// [thisReferencedInFunctionInsideArrowFunction1.js] -var foo = function (dummy) { -}; +var foo = function (dummy) { }; function test() { foo(function () { - return function () { - return this; - }; + return function () { return this; }; }); } diff --git a/tests/baselines/reference/throwInEnclosingStatements.js b/tests/baselines/reference/throwInEnclosingStatements.js index b52926e651e..0b072434f33 100644 --- a/tests/baselines/reference/throwInEnclosingStatements.js +++ b/tests/baselines/reference/throwInEnclosingStatements.js @@ -50,9 +50,7 @@ var aa = { function fn(x) { throw x; } -(function (x) { - throw x; -}); +(function (x) { throw x; }); var y; switch (y) { case 'a': diff --git a/tests/baselines/reference/throwStatements.js b/tests/baselines/reference/throwStatements.js index 4ab370db0b6..83663d08cc4 100644 --- a/tests/baselines/reference/throwStatements.js +++ b/tests/baselines/reference/throwStatements.js @@ -97,9 +97,7 @@ var D = (function () { } return D; })(); -function F(x) { - return 42; -} +function F(x) { return 42; } var M; (function (M) { var A = (function () { @@ -108,9 +106,7 @@ var M; return A; })(); M.A = A; - function F2(x) { - return x.toString(); - } + function F2(x) { return x.toString(); } M.F2 = F2; })(M || (M = {})); var aNumber = 9.9; @@ -131,16 +127,12 @@ var aClass = new C(); throw aClass; var aGenericClass = new D(); throw aGenericClass; -var anObjectLiteral = { - id: 12 -}; +var anObjectLiteral = { id: 12 }; throw anObjectLiteral; var aFunction = F; throw aFunction; throw aFunction(''); -var aLambda = function (x) { - return 2; -}; +var aLambda = function (x) { return 2; }; throw aLambda; throw aLambda(1); var aModule = M; @@ -159,23 +151,11 @@ throw false; throw null; throw undefined; throw 'a string'; -throw function () { - return 'a string'; -}; -throw function (x) { - return 42; -}; -throw { - x: 12, - y: 13 -}; +throw function () { return 'a string'; }; +throw function (x) { return 42; }; +throw { x: 12, y: 13 }; throw []; -throw [ - 'a', - [ - 'b' - ] -]; +throw ['a', ['b']]; throw /[a-z]/; throw new Date(); throw new C(); diff --git a/tests/baselines/reference/tooFewArgumentsInGenericFunctionTypedArgument.js b/tests/baselines/reference/tooFewArgumentsInGenericFunctionTypedArgument.js index 8aa23c82469..4b00c5fd0f2 100644 --- a/tests/baselines/reference/tooFewArgumentsInGenericFunctionTypedArgument.js +++ b/tests/baselines/reference/tooFewArgumentsInGenericFunctionTypedArgument.js @@ -19,10 +19,6 @@ var r1b = _.map(c2, rf1); //// [tooFewArgumentsInGenericFunctionTypedArgument.js] var c2; var _; -var r1a = _.map(c2, function (x) { - return x.toFixed(); -}); -var rf1 = function (x) { - return x.toFixed(); -}; +var r1a = _.map(c2, function (x) { return x.toFixed(); }); +var rf1 = function (x) { return x.toFixed(); }; var r1b = _.map(c2, rf1); diff --git a/tests/baselines/reference/tooManyTypeParameters1.js b/tests/baselines/reference/tooManyTypeParameters1.js index 3ac7dfacda3..892731cbd43 100644 --- a/tests/baselines/reference/tooManyTypeParameters1.js +++ b/tests/baselines/reference/tooManyTypeParameters1.js @@ -12,11 +12,9 @@ interface I {} var i: I; //// [tooManyTypeParameters1.js] -function f() { -} +function f() { } f(); -var x = function () { -}; +var x = function () { }; x(); var C = (function () { function C() { diff --git a/tests/baselines/reference/topLevelExports.js b/tests/baselines/reference/topLevelExports.js index 0f539310b15..91e28b6a976 100644 --- a/tests/baselines/reference/topLevelExports.js +++ b/tests/baselines/reference/topLevelExports.js @@ -8,8 +8,6 @@ void log(foo).toString(); //// [topLevelExports.js] define(["require", "exports"], function (require, exports) { exports.foo = 3; - function log(n) { - return n; - } + function log(n) { return n; } void log(exports.foo).toString(); }); diff --git a/tests/baselines/reference/topLevelLambda.js b/tests/baselines/reference/topLevelLambda.js index 756a42b4340..3c4f1a3bc84 100644 --- a/tests/baselines/reference/topLevelLambda.js +++ b/tests/baselines/reference/topLevelLambda.js @@ -8,7 +8,5 @@ module M { var M; (function (M) { var _this = this; - var f = function () { - _this.window; - }; + var f = function () { _this.window; }; })(M || (M = {})); diff --git a/tests/baselines/reference/topLevelLambda2.js b/tests/baselines/reference/topLevelLambda2.js index e5cb1fcac5a..10059e42efd 100644 --- a/tests/baselines/reference/topLevelLambda2.js +++ b/tests/baselines/reference/topLevelLambda2.js @@ -5,8 +5,5 @@ foo(()=>this.window); //// [topLevelLambda2.js] var _this = this; -function foo(x) { -} -foo(function () { - return _this.window; -}); +function foo(x) { } +foo(function () { return _this.window; }); diff --git a/tests/baselines/reference/topLevelLambda3.js b/tests/baselines/reference/topLevelLambda3.js index 1505e38956a..0314b356b0f 100644 --- a/tests/baselines/reference/topLevelLambda3.js +++ b/tests/baselines/reference/topLevelLambda3.js @@ -3,6 +3,4 @@ var f = () => {this.window;} //// [topLevelLambda3.js] var _this = this; -var f = function () { - _this.window; -}; +var f = function () { _this.window; }; diff --git a/tests/baselines/reference/topLevelLambda4.js b/tests/baselines/reference/topLevelLambda4.js index 47b238cd87f..863a0e9a103 100644 --- a/tests/baselines/reference/topLevelLambda4.js +++ b/tests/baselines/reference/topLevelLambda4.js @@ -4,7 +4,5 @@ export var x = () => this.window; //// [topLevelLambda4.js] define(["require", "exports"], function (require, exports) { var _this = this; - exports.x = function () { - return _this.window; - }; + exports.x = function () { return _this.window; }; }); diff --git a/tests/baselines/reference/trailingCommaInHeterogenousArrayLiteral1.js b/tests/baselines/reference/trailingCommaInHeterogenousArrayLiteral1.js index 0fdc7577088..7dd59ee840e 100644 --- a/tests/baselines/reference/trailingCommaInHeterogenousArrayLiteral1.js +++ b/tests/baselines/reference/trailingCommaInHeterogenousArrayLiteral1.js @@ -13,22 +13,11 @@ class arrTest { var arrTest = (function () { function arrTest() { } - arrTest.prototype.test = function (arg1) { - }; + arrTest.prototype.test = function (arg1) { }; arrTest.prototype.callTest = function () { // these two should give the same error - this.test([ - 1, - 2, - "hi", - 5, - ]); - this.test([ - 1, - 2, - "hi", - 5 - ]); + this.test([1, 2, "hi", 5,]); + this.test([1, 2, "hi", 5]); }; return arrTest; })(); diff --git a/tests/baselines/reference/trailingCommasES3.js b/tests/baselines/reference/trailingCommasES3.js index b8b8c8ad1f0..554390a83ea 100644 --- a/tests/baselines/reference/trailingCommasES3.js +++ b/tests/baselines/reference/trailingCommasES3.js @@ -13,35 +13,13 @@ var a5 = [1, , ]; var a6 = [, , ]; //// [trailingCommasES3.js] -var o1 = { - a: 1, - b: 2 -}; -var o2 = { - a: 1, - b: 2 -}; -var o3 = { - a: 1 -}; +var o1 = { a: 1, b: 2 }; +var o2 = { a: 1, b: 2 }; +var o3 = { a: 1 }; var o4 = {}; -var a1 = [ - 1, - 2 -]; -var a2 = [ - 1, - 2, -]; -var a3 = [ - 1, -]; +var a1 = [1, 2]; +var a2 = [1, 2,]; +var a3 = [1,]; var a4 = []; -var a5 = [ - 1, - , -]; -var a6 = [ - , - , -]; +var a5 = [1, ,]; +var a6 = [, ,]; diff --git a/tests/baselines/reference/trailingCommasES5.js b/tests/baselines/reference/trailingCommasES5.js index 8cd17e7519f..e54e911189a 100644 --- a/tests/baselines/reference/trailingCommasES5.js +++ b/tests/baselines/reference/trailingCommasES5.js @@ -13,35 +13,13 @@ var a5 = [1, , ]; var a6 = [, , ]; //// [trailingCommasES5.js] -var o1 = { - a: 1, - b: 2 -}; -var o2 = { - a: 1, - b: 2, -}; -var o3 = { - a: 1, -}; +var o1 = { a: 1, b: 2 }; +var o2 = { a: 1, b: 2, }; +var o3 = { a: 1, }; var o4 = {}; -var a1 = [ - 1, - 2 -]; -var a2 = [ - 1, - 2, -]; -var a3 = [ - 1, -]; +var a1 = [1, 2]; +var a2 = [1, 2,]; +var a3 = [1,]; var a4 = []; -var a5 = [ - 1, - , -]; -var a6 = [ - , - , -]; +var a5 = [1, ,]; +var a6 = [, ,]; diff --git a/tests/baselines/reference/tryCatchFinally.js b/tests/baselines/reference/tryCatchFinally.js index aeda61faca4..b93f248c031 100644 --- a/tests/baselines/reference/tryCatchFinally.js +++ b/tests/baselines/reference/tryCatchFinally.js @@ -6,17 +6,10 @@ try {} catch(e) {} try {} finally {} //// [tryCatchFinally.js] -try { -} -catch (e) { -} -finally { -} -try { -} -catch (e) { -} -try { -} -finally { -} +try { } +catch (e) { } +finally { } +try { } +catch (e) { } +try { } +finally { } diff --git a/tests/baselines/reference/tryStatements.js b/tests/baselines/reference/tryStatements.js index 01d55308d19..723014c1b52 100644 --- a/tests/baselines/reference/tryStatements.js +++ b/tests/baselines/reference/tryStatements.js @@ -18,14 +18,9 @@ function fn() { catch (x) { var x; } - try { - } - finally { - } - try { - } - catch (z) { - } - finally { - } + try { } + finally { } + try { } + catch (z) { } + finally { } } diff --git a/tests/baselines/reference/tupleTypes.js b/tests/baselines/reference/tupleTypes.js index ba0aaa9d8b4..451aeb5eb09 100644 --- a/tests/baselines/reference/tupleTypes.js +++ b/tests/baselines/reference/tupleTypes.js @@ -67,40 +67,15 @@ var t1; var t2 = t[2]; // number|string var t2; t = []; // Error -t = [ - 1 -]; // Error -t = [ - 1, - "hello" -]; // Ok -t = [ - "hello", - 1 -]; // Error -t = [ - 1, - "hello", - 2 -]; // Ok -var tf = [ - "hello", - function (x) { - return x.length; - } -]; -var ff1 = ff("hello", [ - "foo", - function (x) { - return x.length; - } -]); +t = [1]; // Error +t = [1, "hello"]; // Ok +t = ["hello", 1]; // Error +t = [1, "hello", 2]; // Ok +var tf = ["hello", function (x) { return x.length; }]; +var ff1 = ff("hello", ["foo", function (x) { return x.length; }]); var ff1; function tuple2(item0, item1) { - return [ - item0, - item1 - ]; + return [item0, item1]; } var tt = tuple2(1, "string"); var tt0 = tt[0]; @@ -110,14 +85,8 @@ var tt1; var tt2 = tt[2]; var tt2; tt = tuple2(1, undefined); -tt = [ - 1, - undefined -]; -tt = [ - undefined, - undefined -]; +tt = [1, undefined]; +tt = [undefined, undefined]; tt = []; // Error var a; var a1; diff --git a/tests/baselines/reference/twoAccessorsWithSameName.js b/tests/baselines/reference/twoAccessorsWithSameName.js index 7ae4d3bd1f9..1e447ea1205 100644 --- a/tests/baselines/reference/twoAccessorsWithSameName.js +++ b/tests/baselines/reference/twoAccessorsWithSameName.js @@ -39,9 +39,7 @@ var C = (function () { function C() { } Object.defineProperty(C.prototype, "x", { - get: function () { - return 1; - }, + get: function () { return 1; }, enumerable: true, configurable: true }); @@ -51,8 +49,7 @@ var D = (function () { function D() { } Object.defineProperty(D.prototype, "x", { - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); @@ -65,8 +62,7 @@ var E = (function () { get: function () { return 1; }, - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); @@ -85,6 +81,5 @@ var y = { get x() { return 1; }, - set x(v) { - } + set x(v) { } }; diff --git a/tests/baselines/reference/twoAccessorsWithSameName2.js b/tests/baselines/reference/twoAccessorsWithSameName2.js index 437fe16cea5..847f83e6a70 100644 --- a/tests/baselines/reference/twoAccessorsWithSameName2.js +++ b/tests/baselines/reference/twoAccessorsWithSameName2.js @@ -21,9 +21,7 @@ var C = (function () { function C() { } Object.defineProperty(C, "x", { - get: function () { - return 1; - }, + get: function () { return 1; }, enumerable: true, configurable: true }); @@ -33,8 +31,7 @@ var D = (function () { function D() { } Object.defineProperty(D, "x", { - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); @@ -47,8 +44,7 @@ var E = (function () { get: function () { return 1; }, - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/typeAliases.js b/tests/baselines/reference/typeAliases.js index 062a7410927..c31a52bff45 100644 --- a/tests/baselines/reference/typeAliases.js +++ b/tests/baselines/reference/typeAliases.js @@ -122,8 +122,5 @@ var E; f15(E.x).toLowerCase(); var x; f16(x); -var y = [ - "1", - false -]; +var y = ["1", false]; y[0].toLowerCase(); diff --git a/tests/baselines/reference/typeAnnotationBestCommonTypeInArrayLiteral.js b/tests/baselines/reference/typeAnnotationBestCommonTypeInArrayLiteral.js index be252fe345b..cf5ddb23ccd 100644 --- a/tests/baselines/reference/typeAnnotationBestCommonTypeInArrayLiteral.js +++ b/tests/baselines/reference/typeAnnotationBestCommonTypeInArrayLiteral.js @@ -29,8 +29,7 @@ var menuData = [ "type": "image", "link": "", "icon": "modules/menu/logo.svg" - }, - { + }, { "id": "productName", "type": "default", "link": "", diff --git a/tests/baselines/reference/typeArgInference.js b/tests/baselines/reference/typeArgInference.js index 624c357cbc4..7ac36fa2580 100644 --- a/tests/baselines/reference/typeArgInference.js +++ b/tests/baselines/reference/typeArgInference.js @@ -16,32 +16,13 @@ var t4: { c: number; d: string }; //// [typeArgInference.js] -var o = { - a: 3, - b: "test" -}; +var o = { a: 3, b: "test" }; var x; -var t1 = x.f([ - o -], [ - o -]); +var t1 = x.f([o], [o]); var t1; -var t2 = x.f([ - o -], [ - o -]); +var t2 = x.f([o], [o]); var t2; -var t3 = x.g([ - o -], [ - o -]); +var t3 = x.g([o], [o]); var t3; -var t4 = x.g([ - o -], [ - o -]); +var t4 = x.g([o], [o]); var t4; diff --git a/tests/baselines/reference/typeArgInference2.js b/tests/baselines/reference/typeArgInference2.js index 1af776c1197..193345cdeb3 100644 --- a/tests/baselines/reference/typeArgInference2.js +++ b/tests/baselines/reference/typeArgInference2.js @@ -15,20 +15,7 @@ var z6 = foo({ name: "abc", a: 5 }, { name: "def", b: 5 }); // error //// [typeArgInference2.js] var z1 = foo(null); // any var z2 = foo(); // Item -var z3 = foo({ - name: null -}); // { name: any } -var z4 = foo({ - name: "abc" -}); // { name: string } -var z5 = foo({ - name: "abc", - a: 5 -}); // { name: string; a: number } -var z6 = foo({ - name: "abc", - a: 5 -}, { - name: "def", - b: 5 -}); // error +var z3 = foo({ name: null }); // { name: any } +var z4 = foo({ name: "abc" }); // { name: string } +var z5 = foo({ name: "abc", a: 5 }); // { name: string; a: number } +var z6 = foo({ name: "abc", a: 5 }, { name: "def", b: 5 }); // error diff --git a/tests/baselines/reference/typeArgInferenceWithNull.js b/tests/baselines/reference/typeArgInferenceWithNull.js index 78b0dd238fe..ed7a50780aa 100644 --- a/tests/baselines/reference/typeArgInferenceWithNull.js +++ b/tests/baselines/reference/typeArgInferenceWithNull.js @@ -13,19 +13,9 @@ fn6({ x: null }, y => { }, { x: "" }); // y has type { x: any }, but ideally wou //// [typeArgInferenceWithNull.js] // All legal -function fn4(n) { -} +function fn4(n) { } fn4(null); -function fn5(n) { -} -fn5({ - x: null -}); -function fn6(n, fun, n2) { -} -fn6({ - x: null -}, function (y) { -}, { - x: "" -}); // y has type { x: any }, but ideally would have type { x: string } +function fn5(n) { } +fn5({ x: null }); +function fn6(n, fun, n2) { } +fn6({ x: null }, function (y) { }, { x: "" }); // y has type { x: any }, but ideally would have type { x: string } diff --git a/tests/baselines/reference/typeArgumentConstraintResolution1.js b/tests/baselines/reference/typeArgumentConstraintResolution1.js index b7476ad2abd..fd661dd812c 100644 --- a/tests/baselines/reference/typeArgumentConstraintResolution1.js +++ b/tests/baselines/reference/typeArgumentConstraintResolution1.js @@ -13,10 +13,7 @@ foo2(""); // Type Date does not satisfy the constraint 'Number' for type p //// [typeArgumentConstraintResolution1.js] -function foo1(test) { -} +function foo1(test) { } foo1(""); // should error -function foo2(test) { - return null; -} +function foo2(test) { return null; } foo2(""); // Type Date does not satisfy the constraint 'Number' for type parameter 'T extends Number' diff --git a/tests/baselines/reference/typeArgumentInference.js b/tests/baselines/reference/typeArgumentInference.js index 6de9a5951b4..1d10562ac7c 100644 --- a/tests/baselines/reference/typeArgumentInference.js +++ b/tests/baselines/reference/typeArgumentInference.js @@ -102,129 +102,55 @@ var arr: any[]; //// [typeArgumentInference.js] // Generic call with no parameters -function noParams() { -} +function noParams() { } noParams(); noParams(); noParams(); // Generic call with parameters but none use type parameter type -function noGenericParams(n) { -} +function noGenericParams(n) { } noGenericParams(''); noGenericParams(''); noGenericParams(''); // Generic call with multiple type parameters and only one used in parameter type annotation -function someGenerics1(n, m) { -} +function someGenerics1(n, m) { } someGenerics1(3, 4); someGenerics1(3, 4); // Generic call with argument of function type whose parameter is of type parameter type -function someGenerics2a(n) { -} -someGenerics2a(function (n) { - return n; -}); -someGenerics2a(function (n) { - return n; -}); -someGenerics2a(function (n) { - return n.substr(0); -}); -function someGenerics2b(n) { -} -someGenerics2b(function (n, x) { - return n; -}); -someGenerics2b(function (n, t) { - return n; -}); -someGenerics2b(function (n, t) { - return n.substr(t * t); -}); +function someGenerics2a(n) { } +someGenerics2a(function (n) { return n; }); +someGenerics2a(function (n) { return n; }); +someGenerics2a(function (n) { return n.substr(0); }); +function someGenerics2b(n) { } +someGenerics2b(function (n, x) { return n; }); +someGenerics2b(function (n, t) { return n; }); +someGenerics2b(function (n, t) { return n.substr(t * t); }); // Generic call with argument of function type whose parameter is not of type parameter type but body/return type uses type parameter -function someGenerics3(producer) { -} -someGenerics3(function () { - return ''; -}); -someGenerics3(function () { - return undefined; -}); -someGenerics3(function () { - return 3; -}); +function someGenerics3(producer) { } +someGenerics3(function () { return ''; }); +someGenerics3(function () { return undefined; }); +someGenerics3(function () { return 3; }); // 2 parameter generic call with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type -function someGenerics4(n, f) { -} -someGenerics4(4, function () { - return null; -}); -someGenerics4('', function () { - return 3; -}); +function someGenerics4(n, f) { } +someGenerics4(4, function () { return null; }); +someGenerics4('', function () { return 3; }); someGenerics4(null, null); // 2 parameter generic call with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type -function someGenerics5(n, f) { -} -someGenerics5(4, function () { - return null; -}); -someGenerics5('', function () { - return 3; -}); +function someGenerics5(n, f) { } +someGenerics5(4, function () { return null; }); +someGenerics5('', function () { return 3; }); someGenerics5(null, null); // Generic call with multiple arguments of function types that each have parameters of the same generic type -function someGenerics6(a, b, c) { -} -someGenerics6(function (n) { - return n; -}, function (n) { - return n; -}, function (n) { - return n; -}); -someGenerics6(function (n) { - return n; -}, function (n) { - return n; -}, function (n) { - return n; -}); -someGenerics6(function (n) { - return n; -}, function (n) { - return n; -}, function (n) { - return n; -}); +function someGenerics6(a, b, c) { } +someGenerics6(function (n) { return n; }, function (n) { return n; }, function (n) { return n; }); +someGenerics6(function (n) { return n; }, function (n) { return n; }, function (n) { return n; }); +someGenerics6(function (n) { return n; }, function (n) { return n; }, function (n) { return n; }); // Generic call with multiple arguments of function types that each have parameters of different generic type -function someGenerics7(a, b, c) { -} -someGenerics7(function (n) { - return n; -}, function (n) { - return n; -}, function (n) { - return n; -}); -someGenerics7(function (n) { - return n; -}, function (n) { - return n; -}, function (n) { - return n; -}); -someGenerics7(function (n) { - return n; -}, function (n) { - return n; -}, function (n) { - return n; -}); +function someGenerics7(a, b, c) { } +someGenerics7(function (n) { return n; }, function (n) { return n; }, function (n) { return n; }); +someGenerics7(function (n) { return n; }, function (n) { return n; }, function (n) { return n; }); +someGenerics7(function (n) { return n; }, function (n) { return n; }, function (n) { return n; }); // Generic call with argument of generic function type -function someGenerics8(n) { - return n; -} +function someGenerics8(n) { return n; } var x = someGenerics8(someGenerics7); x(null, null, null); // Generic call with multiple parameters of generic type passed arguments with no best common type @@ -233,36 +159,14 @@ function someGenerics9(a, b, c) { } var a9a = someGenerics9('', 0, []); var a9a; -var a9b = someGenerics9({ - a: 0 -}, { - b: '' -}, null); +var a9b = someGenerics9({ a: 0 }, { b: '' }, null); var a9b; -var a9e = someGenerics9(undefined, { - x: 6, - z: new Date() -}, { - x: 6, - y: '' -}); +var a9e = someGenerics9(undefined, { x: 6, z: new Date() }, { x: 6, y: '' }); var a9e; -var a9f = someGenerics9(undefined, { - x: 6, - z: new Date() -}, { - x: 6, - y: '' -}); +var a9f = someGenerics9(undefined, { x: 6, z: new Date() }, { x: 6, y: '' }); var a9f; // Generic call with multiple parameters of generic type passed arguments with a single best common type -var a9d = someGenerics9({ - x: 3 -}, { - x: 6 -}, { - x: 6 -}); +var a9d = someGenerics9({ x: 3 }, { x: 6 }, { x: 6 }); var a9d; // Generic call with multiple parameters of generic type where one argument is of type 'any' var anyVar; diff --git a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.js b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.js index a2346cc28a7..148ec81c441 100644 --- a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.js +++ b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.js @@ -152,144 +152,50 @@ new someGenerics1(3, 4); new someGenerics1(3, 4); // Error new someGenerics1(3, 4); var someGenerics2a; -new someGenerics2a(function (n) { - return n; -}); -new someGenerics2a(function (n) { - return n; -}); -new someGenerics2a(function (n) { - return n.substr(0); -}); +new someGenerics2a(function (n) { return n; }); +new someGenerics2a(function (n) { return n; }); +new someGenerics2a(function (n) { return n.substr(0); }); var someGenerics2b; -new someGenerics2b(function (n, x) { - return n; -}); -new someGenerics2b(function (n, t) { - return n; -}); -new someGenerics2b(function (n, t) { - return n.substr(t * t); -}); +new someGenerics2b(function (n, x) { return n; }); +new someGenerics2b(function (n, t) { return n; }); +new someGenerics2b(function (n, t) { return n.substr(t * t); }); var someGenerics3; -new someGenerics3(function () { - return ''; -}); -new someGenerics3(function () { - return undefined; -}); -new someGenerics3(function () { - return 3; -}); +new someGenerics3(function () { return ''; }); +new someGenerics3(function () { return undefined; }); +new someGenerics3(function () { return 3; }); var someGenerics4; -new someGenerics4(4, function () { - return null; -}); -new someGenerics4('', function () { - return 3; -}); -new someGenerics4('', function (x) { - return ''; -}); // Error +new someGenerics4(4, function () { return null; }); +new someGenerics4('', function () { return 3; }); +new someGenerics4('', function (x) { return ''; }); // Error new someGenerics4(null, null); var someGenerics5; -new someGenerics5(4, function () { - return null; -}); -new someGenerics5('', function () { - return 3; -}); -new someGenerics5('', function (x) { - return ''; -}); // Error +new someGenerics5(4, function () { return null; }); +new someGenerics5('', function () { return 3; }); +new someGenerics5('', function (x) { return ''; }); // Error new someGenerics5(null, null); var someGenerics6; -new someGenerics6(function (n) { - return n; -}, function (n) { - return n; -}, function (n) { - return n; -}); -new someGenerics6(function (n) { - return n; -}, function (n) { - return n; -}, function (n) { - return n; -}); -new someGenerics6(function (n) { - return n; -}, function (n) { - return n; -}, function (n) { - return n; -}); // Error -new someGenerics6(function (n) { - return n; -}, function (n) { - return n; -}, function (n) { - return n; -}); +new someGenerics6(function (n) { return n; }, function (n) { return n; }, function (n) { return n; }); +new someGenerics6(function (n) { return n; }, function (n) { return n; }, function (n) { return n; }); +new someGenerics6(function (n) { return n; }, function (n) { return n; }, function (n) { return n; }); // Error +new someGenerics6(function (n) { return n; }, function (n) { return n; }, function (n) { return n; }); var someGenerics7; -new someGenerics7(function (n) { - return n; -}, function (n) { - return n; -}, function (n) { - return n; -}); -new someGenerics7(function (n) { - return n; -}, function (n) { - return n; -}, function (n) { - return n; -}); -new someGenerics7(function (n) { - return n; -}, function (n) { - return n; -}, function (n) { - return n; -}); +new someGenerics7(function (n) { return n; }, function (n) { return n; }, function (n) { return n; }); +new someGenerics7(function (n) { return n; }, function (n) { return n; }, function (n) { return n; }); +new someGenerics7(function (n) { return n; }, function (n) { return n; }, function (n) { return n; }); var someGenerics8; var x = new someGenerics8(someGenerics7); new x(null, null, null); var someGenerics9; var a9a = new someGenerics9('', 0, []); var a9a; -var a9b = new someGenerics9({ - a: 0 -}, { - b: '' -}, null); +var a9b = new someGenerics9({ a: 0 }, { b: '' }, null); var a9b; -var a9e = new someGenerics9(undefined, { - x: 6, - z: window -}, { - x: 6, - y: '' -}); +var a9e = new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); var a9e; -var a9f = new someGenerics9(undefined, { - x: 6, - z: window -}, { - x: 6, - y: '' -}); +var a9f = new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); var a9f; // Generic call with multiple parameters of generic type passed arguments with a single best common type -var a9d = new someGenerics9({ - x: 3 -}, { - x: 6 -}, { - x: 6 -}); +var a9d = new someGenerics9({ x: 3 }, { x: 6 }, { x: 6 }); var a9d; // Generic call with multiple parameters of generic type where one argument is of type 'any' var anyVar; diff --git a/tests/baselines/reference/typeArgumentInferenceErrors.js b/tests/baselines/reference/typeArgumentInferenceErrors.js index 97dfce01a1d..7ec612d2c7c 100644 --- a/tests/baselines/reference/typeArgumentInferenceErrors.js +++ b/tests/baselines/reference/typeArgumentInferenceErrors.js @@ -18,28 +18,14 @@ someGenerics6((n: number) => n, (n: string) => n, (n: number) => n); // //// [typeArgumentInferenceErrors.js] // Generic call with multiple type parameters and only one used in parameter type annotation -function someGenerics1(n, m) { -} +function someGenerics1(n, m) { } someGenerics1(3, 4); // Error // 2 parameter generic call with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type -function someGenerics4(n, f) { -} -someGenerics4('', function (x) { - return ''; -}); // Error +function someGenerics4(n, f) { } +someGenerics4('', function (x) { return ''; }); // Error // 2 parameter generic call with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type -function someGenerics5(n, f) { -} -someGenerics5('', function (x) { - return ''; -}); // Error +function someGenerics5(n, f) { } +someGenerics5('', function (x) { return ''; }); // Error // Generic call with multiple arguments of function types that each have parameters of the same generic type -function someGenerics6(a, b, c) { -} -someGenerics6(function (n) { - return n; -}, function (n) { - return n; -}, function (n) { - return n; -}); // Error +function someGenerics6(a, b, c) { } +someGenerics6(function (n) { return n; }, function (n) { return n; }, function (n) { return n; }); // Error diff --git a/tests/baselines/reference/typeArgumentInferenceOrdering.js b/tests/baselines/reference/typeArgumentInferenceOrdering.js index 53917844f66..96978bfd489 100644 --- a/tests/baselines/reference/typeArgumentInferenceOrdering.js +++ b/tests/baselines/reference/typeArgumentInferenceOrdering.js @@ -16,9 +16,7 @@ interface Goo { //// [typeArgumentInferenceOrdering.js] -function foo(f) { - return null; -} +function foo(f) { return null; } var x = foo(new C()).x; // was Error that property x does not exist on type {} var C = (function () { function C() { diff --git a/tests/baselines/reference/typeArgumentInferenceTransitiveConstraints.js b/tests/baselines/reference/typeArgumentInferenceTransitiveConstraints.js index 5a470de46da..003ae4af535 100644 --- a/tests/baselines/reference/typeArgumentInferenceTransitiveConstraints.js +++ b/tests/baselines/reference/typeArgumentInferenceTransitiveConstraints.js @@ -10,11 +10,7 @@ var d: Date[]; // Should be OK (d should be Date[]) //// [typeArgumentInferenceTransitiveConstraints.js] function fn(a, b, c) { - return [ - a, - b, - c - ]; + return [a, b, c]; } var d = fn(new Date(), new Date(), new Date()); var d; // Should be OK (d should be Date[]) diff --git a/tests/baselines/reference/typeArgumentInferenceWithConstraintAsCommonRoot.js b/tests/baselines/reference/typeArgumentInferenceWithConstraintAsCommonRoot.js index 50d7767b5db..941c9330a5f 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithConstraintAsCommonRoot.js +++ b/tests/baselines/reference/typeArgumentInferenceWithConstraintAsCommonRoot.js @@ -8,9 +8,7 @@ var e: Elephant; f(g, e); // valid because both Giraffe and Elephant satisfy the constraint. T is Animal //// [typeArgumentInferenceWithConstraintAsCommonRoot.js] -function f(x, y) { - return undefined; -} +function f(x, y) { return undefined; } var g; var e; f(g, e); // valid because both Giraffe and Elephant satisfy the constraint. T is Animal diff --git a/tests/baselines/reference/typeArgumentInferenceWithConstraints.js b/tests/baselines/reference/typeArgumentInferenceWithConstraints.js index ce0d3cb82e3..b8c051f0c37 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithConstraints.js +++ b/tests/baselines/reference/typeArgumentInferenceWithConstraints.js @@ -107,144 +107,60 @@ var arr: any[]; //// [typeArgumentInferenceWithConstraints.js] // Generic call with no parameters -function noParams() { -} +function noParams() { } noParams(); noParams(); noParams(); // Generic call with parameters but none use type parameter type -function noGenericParams(n) { -} +function noGenericParams(n) { } noGenericParams(''); // Valid noGenericParams(''); noGenericParams(''); // Error // Generic call with multiple type parameters and only one used in parameter type annotation -function someGenerics1(n, m) { -} +function someGenerics1(n, m) { } someGenerics1(3, 4); // Valid someGenerics1(3, 4); // Error someGenerics1(3, 4); // Error someGenerics1(3, 4); // Generic call with argument of function type whose parameter is of type parameter type -function someGenerics2a(n) { -} -someGenerics2a(function (n) { - return n; -}); -someGenerics2a(function (n) { - return n; -}); -someGenerics2a(function (n) { - return n.substr(0); -}); -function someGenerics2b(n) { -} -someGenerics2b(function (n, x) { - return n; -}); -someGenerics2b(function (n, t) { - return n; -}); -someGenerics2b(function (n, t) { - return n.substr(t * t); -}); +function someGenerics2a(n) { } +someGenerics2a(function (n) { return n; }); +someGenerics2a(function (n) { return n; }); +someGenerics2a(function (n) { return n.substr(0); }); +function someGenerics2b(n) { } +someGenerics2b(function (n, x) { return n; }); +someGenerics2b(function (n, t) { return n; }); +someGenerics2b(function (n, t) { return n.substr(t * t); }); // Generic call with argument of function type whose parameter is not of type parameter type but body/return type uses type parameter -function someGenerics3(producer) { -} -someGenerics3(function () { - return ''; -}); // Error -someGenerics3(function () { - return undefined; -}); -someGenerics3(function () { - return 3; -}); // Error +function someGenerics3(producer) { } +someGenerics3(function () { return ''; }); // Error +someGenerics3(function () { return undefined; }); +someGenerics3(function () { return 3; }); // Error // 2 parameter generic call with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type -function someGenerics4(n, f) { -} -someGenerics4(4, function () { - return null; -}); // Valid -someGenerics4('', function () { - return 3; -}); -someGenerics4('', function (x) { - return ''; -}); // Error +function someGenerics4(n, f) { } +someGenerics4(4, function () { return null; }); // Valid +someGenerics4('', function () { return 3; }); +someGenerics4('', function (x) { return ''; }); // Error someGenerics4(null, null); // 2 parameter generic call with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type -function someGenerics5(n, f) { -} -someGenerics5(4, function () { - return null; -}); // Valid -someGenerics5('', function () { - return 3; -}); -someGenerics5('', function (x) { - return ''; -}); // Error +function someGenerics5(n, f) { } +someGenerics5(4, function () { return null; }); // Valid +someGenerics5('', function () { return 3; }); +someGenerics5('', function (x) { return ''; }); // Error someGenerics5(null, null); // Error // Generic call with multiple arguments of function types that each have parameters of the same generic type -function someGenerics6(a, b, c) { -} -someGenerics6(function (n) { - return n; -}, function (n) { - return n; -}, function (n) { - return n; -}); // Valid -someGenerics6(function (n) { - return n; -}, function (n) { - return n; -}, function (n) { - return n; -}); -someGenerics6(function (n) { - return n; -}, function (n) { - return n; -}, function (n) { - return n; -}); // Error -someGenerics6(function (n) { - return n; -}, function (n) { - return n; -}, function (n) { - return n; -}); +function someGenerics6(a, b, c) { } +someGenerics6(function (n) { return n; }, function (n) { return n; }, function (n) { return n; }); // Valid +someGenerics6(function (n) { return n; }, function (n) { return n; }, function (n) { return n; }); +someGenerics6(function (n) { return n; }, function (n) { return n; }, function (n) { return n; }); // Error +someGenerics6(function (n) { return n; }, function (n) { return n; }, function (n) { return n; }); // Generic call with multiple arguments of function types that each have parameters of different generic type -function someGenerics7(a, b, c) { -} -someGenerics7(function (n) { - return n; -}, function (n) { - return n; -}, function (n) { - return n; -}); // Valid, types of n are respectively -someGenerics7(function (n) { - return n; -}, function (n) { - return n; -}, function (n) { - return n; -}); -someGenerics7(function (n) { - return n; -}, function (n) { - return n; -}, function (n) { - return n; -}); +function someGenerics7(a, b, c) { } +someGenerics7(function (n) { return n; }, function (n) { return n; }, function (n) { return n; }); // Valid, types of n are respectively +someGenerics7(function (n) { return n; }, function (n) { return n; }, function (n) { return n; }); +someGenerics7(function (n) { return n; }, function (n) { return n; }, function (n) { return n; }); // Generic call with argument of generic function type -function someGenerics8(n) { - return n; -} +function someGenerics8(n) { return n; } var x = someGenerics8(someGenerics7); // Error x(null, null, null); // Error // Generic call with multiple parameters of generic type passed arguments with no best common type @@ -253,36 +169,14 @@ function someGenerics9(a, b, c) { } var a9a = someGenerics9('', 0, []); var a9a; -var a9b = someGenerics9({ - a: 0 -}, { - b: '' -}, null); +var a9b = someGenerics9({ a: 0 }, { b: '' }, null); var a9b; -var a9e = someGenerics9(undefined, { - x: 6, - z: window -}, { - x: 6, - y: '' -}); +var a9e = someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); var a9e; -var a9f = someGenerics9(undefined, { - x: 6, - z: window -}, { - x: 6, - y: '' -}); +var a9f = someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); var a9f; // Generic call with multiple parameters of generic type passed arguments with a single best common type -var a9d = someGenerics9({ - x: 3 -}, { - x: 6 -}, { - x: 6 -}); +var a9d = someGenerics9({ x: 3 }, { x: 6 }, { x: 6 }); var a9d; // Generic call with multiple parameters of generic type where one argument is of type 'any' var anyVar; diff --git a/tests/baselines/reference/typeArgumentInferenceWithObjectLiteral.js b/tests/baselines/reference/typeArgumentInferenceWithObjectLiteral.js index 95220d4fdcf..4d040cfe13f 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithObjectLiteral.js +++ b/tests/baselines/reference/typeArgumentInferenceWithObjectLiteral.js @@ -37,25 +37,16 @@ var v3 = f1({ w: x => x, r: () => E1.X }, E2.X); // Error //// [typeArgumentInferenceWithObjectLiteral.js] -function foo(x) { -} +function foo(x) { } var s; // Calls below should infer string for T and then assign that type to the value parameter foo({ - read: function () { - return s; - }, - write: function (value) { - return s = value; - } + read: function () { return s; }, + write: function (value) { return s = value; } }); foo({ - write: function (value) { - return s = value; - }, - read: function () { - return s; - } + write: function (value) { return s = value; }, + read: function () { return s; } }); var E1; (function (E1) { @@ -66,44 +57,9 @@ var E2; E2[E2["X"] = 0] = "X"; })(E2 || (E2 = {})); var v1; -var v1 = f1({ - w: function (x) { - return x; - }, - r: function () { - return 0; - } -}, 0); -var v1 = f1({ - w: function (x) { - return x; - }, - r: function () { - return 0; - } -}, E1.X); -var v1 = f1({ - w: function (x) { - return x; - }, - r: function () { - return E1.X; - } -}, 0); +var v1 = f1({ w: function (x) { return x; }, r: function () { return 0; } }, 0); +var v1 = f1({ w: function (x) { return x; }, r: function () { return 0; } }, E1.X); +var v1 = f1({ w: function (x) { return x; }, r: function () { return E1.X; } }, 0); var v2; -var v2 = f1({ - w: function (x) { - return x; - }, - r: function () { - return E1.X; - } -}, E1.X); -var v3 = f1({ - w: function (x) { - return x; - }, - r: function () { - return E1.X; - } -}, E2.X); // Error +var v2 = f1({ w: function (x) { return x; }, r: function () { return E1.X; } }, E1.X); +var v3 = f1({ w: function (x) { return x; }, r: function () { return E1.X; } }, E2.X); // Error diff --git a/tests/baselines/reference/typeAssertionToGenericFunctionType.js b/tests/baselines/reference/typeAssertionToGenericFunctionType.js index 4f7d30dfbdd..15e5cf82f26 100644 --- a/tests/baselines/reference/typeAssertionToGenericFunctionType.js +++ b/tests/baselines/reference/typeAssertionToGenericFunctionType.js @@ -8,12 +8,8 @@ x.b(); // error //// [typeAssertionToGenericFunctionType.js] var x = { - a: (function (x) { - return 1; - }), - b: function (x) { - x; - } + a: (function (x) { return 1; }), + b: function (x) { x; } }; x.a(1); // bug was that this caused 'Could not find symbol T' on return type T in the type assertion on x.a's definition x.b(); // error diff --git a/tests/baselines/reference/typeAssertions.js b/tests/baselines/reference/typeAssertions.js index c964ae94958..01acf58227b 100644 --- a/tests/baselines/reference/typeAssertions.js +++ b/tests/baselines/reference/typeAssertions.js @@ -50,10 +50,8 @@ var __extends = this.__extends || function (d, b) { d.prototype = new __(); }; // Function call whose argument is a 1 arg generic function call with explicit type arguments -function fn1(t) { -} -function fn2(t) { -} +function fn1(t) { } +function fn2(t) { } fn1(fn2(4)); // Error var a; var s; diff --git a/tests/baselines/reference/typeCheckTypeArgument.js b/tests/baselines/reference/typeCheckTypeArgument.js index 720ee92a966..bec33393f92 100644 --- a/tests/baselines/reference/typeCheckTypeArgument.js +++ b/tests/baselines/reference/typeCheckTypeArgument.js @@ -23,14 +23,11 @@ var Foo = (function () { } return Foo; })(); -function bar() { -} +function bar() { } var Foo2 = (function () { function Foo2() { } - Foo2.prototype.method = function () { - }; + Foo2.prototype.method = function () { }; return Foo2; })(); -(function (a) { -}); +(function (a) { }); diff --git a/tests/baselines/reference/typeCheckingInsideFunctionExpressionInArray.js b/tests/baselines/reference/typeCheckingInsideFunctionExpressionInArray.js index 3ea78c7a3d8..9dad9fb671f 100644 --- a/tests/baselines/reference/typeCheckingInsideFunctionExpressionInArray.js +++ b/tests/baselines/reference/typeCheckingInsideFunctionExpressionInArray.js @@ -8,15 +8,9 @@ var functions = [function () { //// [typeCheckingInsideFunctionExpressionInArray.js] -var functions = [ - function () { +var functions = [function () { var k = 10; k = new Object(); - [ - 1, - 2, - 3 - ].NonexistantMethod(); + [1, 2, 3].NonexistantMethod(); derp(); - } -]; + }]; diff --git a/tests/baselines/reference/typeGuardsDefeat.js b/tests/baselines/reference/typeGuardsDefeat.js index bb70c2db825..9670c260b57 100644 --- a/tests/baselines/reference/typeGuardsDefeat.js +++ b/tests/baselines/reference/typeGuardsDefeat.js @@ -69,9 +69,7 @@ function foo3(x) { return x.length; // string } else { - var f = function () { - return x * x; - }; + var f = function () { return x * x; }; } x = "hello"; f(); diff --git a/tests/baselines/reference/typeGuardsInConditionalExpression.js b/tests/baselines/reference/typeGuardsInConditionalExpression.js index ebe84879d2b..118ebbc02c0 100644 --- a/tests/baselines/reference/typeGuardsInConditionalExpression.js +++ b/tests/baselines/reference/typeGuardsInConditionalExpression.js @@ -105,73 +105,92 @@ function foo12(x: number | string | boolean) { // the type of a variable or parameter is narrowed by any type guard in the condition when false, // provided the false expression contains no assignments to the variable or parameter. function foo(x) { - return typeof x === "string" ? x.length // string - : x++; // number + return typeof x === "string" + ? x.length // string + : x++; // number } function foo2(x) { // x is assigned in the if true branch, the type is not narrowed - return typeof x === "string" ? (x = 10 && x) // string | number - : x; // string | number + return typeof x === "string" + ? (x = 10 && x) // string | number + : x; // string | number } function foo3(x) { // x is assigned in the if false branch, the type is not narrowed // even though assigned using same type as narrowed expression - return typeof x === "string" ? (x = "Hello" && x) // string | number - : x; // string | number + return typeof x === "string" + ? (x = "Hello" && x) // string | number + : x; // string | number } function foo4(x) { // false branch updates the variable - so here it is not number // even though assigned using same type as narrowed expression - return typeof x === "string" ? x // string | number - : (x = 10 && x); // string | number + return typeof x === "string" + ? x // string | number + : (x = 10 && x); // string | number } function foo5(x) { // false branch updates the variable - so here it is not number - return typeof x === "string" ? x // string | number - : (x = "hello" && x); // string | number + return typeof x === "string" + ? x // string | number + : (x = "hello" && x); // string | number } function foo6(x) { // Modify in both branches - return typeof x === "string" ? (x = 10 && x) // string | number - : (x = "hello" && x); // string | number + return typeof x === "string" + ? (x = 10 && x) // string | number + : (x = "hello" && x); // string | number } function foo7(x) { - return typeof x === "string" ? x === "hello" // string - : typeof x === "boolean" ? x // boolean - : x == 10; // number + return typeof x === "string" + ? x === "hello" // string + : typeof x === "boolean" + ? x // boolean + : x == 10; // number } function foo8(x) { var b; - return typeof x === "string" ? x === "hello" : ((b = x) && (typeof x === "boolean" ? x // boolean - : x == 10)); // number + return typeof x === "string" + ? x === "hello" + : ((b = x) && + (typeof x === "boolean" + ? x // boolean + : x == 10)); // number } function foo9(x) { var y = 10; // usage of x or assignment to separate variable shouldn't cause narrowing of type to stop - return typeof x === "string" ? ((y = x.length) && x === "hello") // string - : x === 10; // number + return typeof x === "string" + ? ((y = x.length) && x === "hello") // string + : x === 10; // number } function foo10(x) { // Mixing typeguards var b; - return typeof x === "string" ? x // string - : ((b = x) // x is number | boolean - && typeof x === "number" && x.toString()); // x is number + return typeof x === "string" + ? x // string + : ((b = x) // x is number | boolean + && typeof x === "number" + && x.toString()); // x is number } function foo11(x) { // Mixing typeguards // Assigning value to x deep inside another guard stops narrowing of type too var b; - return typeof x === "string" ? x // number | boolean | string - changed in the false branch - : ((b = x) // x is number | boolean | string - because the assignment changed it - && typeof x === "number" && (x = 10) // assignment to x - && x); // x is number | boolean | string + return typeof x === "string" + ? x // number | boolean | string - changed in the false branch + : ((b = x) // x is number | boolean | string - because the assignment changed it + && typeof x === "number" + && (x = 10) // assignment to x + && x); // x is number | boolean | string } function foo12(x) { // Mixing typeguards // Assigning value to x in outer guard shouldn't stop narrowing in the inner expression var b; - return typeof x === "string" ? (x = 10 && x.toString().length) // number | boolean | string - changed here - : ((b = x) // x is number | boolean | string - changed in true branch - && typeof x === "number" && x); // x is number + return typeof x === "string" + ? (x = 10 && x.toString().length) // number | boolean | string - changed here + : ((b = x) // x is number | boolean | string - changed in true branch + && typeof x === "number" + && x); // x is number } diff --git a/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.js b/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.js index 239eeb4bfe7..7cf19dac0ad 100644 --- a/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.js +++ b/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.js @@ -82,32 +82,44 @@ module m1 { //// [typeGuardsInFunctionAndModuleBlock.js] // typeguards are scoped in function/module block function foo(x) { - return typeof x === "string" ? x : function f() { - var b = x; // number | boolean - return typeof x === "boolean" ? x.toString() // boolean - : x.toString(); // number - }(); + return typeof x === "string" + ? x + : function f() { + var b = x; // number | boolean + return typeof x === "boolean" + ? x.toString() // boolean + : x.toString(); // number + }(); } function foo2(x) { - return typeof x === "string" ? x : function f(a) { - var b = x; // new scope - number | boolean - return typeof x === "boolean" ? x.toString() // boolean - : x.toString(); // number - }(x); // x here is narrowed to number | boolean + return typeof x === "string" + ? x + : function f(a) { + var b = x; // new scope - number | boolean + return typeof x === "boolean" + ? x.toString() // boolean + : x.toString(); // number + }(x); // x here is narrowed to number | boolean } function foo3(x) { - return typeof x === "string" ? x : (function () { - var b = x; // new scope - number | boolean - return typeof x === "boolean" ? x.toString() // boolean - : x.toString(); // number - })(); + return typeof x === "string" + ? x + : (function () { + var b = x; // new scope - number | boolean + return typeof x === "boolean" + ? x.toString() // boolean + : x.toString(); // number + })(); } function foo4(x) { - return typeof x === "string" ? x : (function (a) { - var b = x; // new scope - number | boolean - return typeof x === "boolean" ? x.toString() // boolean - : x.toString(); // number - })(x); // x here is narrowed to number | boolean + return typeof x === "string" + ? x + : (function (a) { + var b = x; // new scope - number | boolean + return typeof x === "boolean" + ? x.toString() // boolean + : x.toString(); // number + })(x); // x here is narrowed to number | boolean } // Type guards affect nested function expressions, but not nested function declarations function foo5(x) { @@ -129,8 +141,9 @@ var m; y = x; // string; } else { - y = typeof x === "boolean" ? x.toString() // boolean - : x.toString(); // number + y = typeof x === "boolean" + ? x.toString() // boolean + : x.toString(); // number } })(m2 || (m2 = {})); })(m || (m = {})); @@ -147,8 +160,9 @@ var m1; y = x; // string; } else { - y = typeof x === "boolean" ? x.toString() // boolean - : x.toString(); // number + y = typeof x === "boolean" + ? x.toString() // boolean + : x.toString(); // number } })(m3 = m2.m3 || (m2.m3 = {})); })(m2 || (m2 = {})); diff --git a/tests/baselines/reference/typeGuardsInIfStatement.js b/tests/baselines/reference/typeGuardsInIfStatement.js index c228c038579..820d205bc65 100644 --- a/tests/baselines/reference/typeGuardsInIfStatement.js +++ b/tests/baselines/reference/typeGuardsInIfStatement.js @@ -258,8 +258,9 @@ function foo10(x) { else { var y; var b = x; // number | boolean - return typeof x === "number" ? x === 10 // number - : x; // x should be boolean + return typeof x === "number" + ? x === 10 // number + : x; // x should be boolean } } function foo11(x) { @@ -271,13 +272,15 @@ function foo11(x) { else { var y; var b = x; // number | boolean | string - because below we are changing value of x in if statement - return typeof x === "number" ? ( - // change value of x - x = 10 && x.toString() // number | boolean | string - ) : ( - // do not change value - y = x && x.toString() // number | boolean | string - ); + return typeof x === "number" + ? ( + // change value of x + x = 10 && x.toString() // number | boolean | string + ) + : ( + // do not change value + y = x && x.toString() // number | boolean | string + ); } } function foo12(x) { @@ -289,7 +292,8 @@ function foo12(x) { else { x = 10; var b = x; // number | boolean | string - return typeof x === "number" ? x.toString() // number - : x.toString(); // boolean | string + return typeof x === "number" + ? x.toString() // number + : x.toString(); // boolean | string } } diff --git a/tests/baselines/reference/typeGuardsInRightOperandOfAndAndOperator.js b/tests/baselines/reference/typeGuardsInRightOperandOfAndAndOperator.js index ffba829c37d..e3f1a8c72c2 100644 --- a/tests/baselines/reference/typeGuardsInRightOperandOfAndAndOperator.js +++ b/tests/baselines/reference/typeGuardsInRightOperandOfAndAndOperator.js @@ -72,36 +72,40 @@ function foo3(x) { } function foo4(x) { return typeof x !== "string" // string | number | boolean - && typeof x !== "number" // number | boolean - && x; // boolean + && typeof x !== "number" // number | boolean + && x; // boolean } function foo5(x) { // usage of x or assignment to separate variable shouldn't cause narrowing of type to stop var b; return typeof x !== "string" // string | number | boolean - && ((b = x) && (typeof x !== "number" // number | boolean - && x)); // boolean + && ((b = x) && (typeof x !== "number" // number | boolean + && x)); // boolean } function foo6(x) { // Mixing typeguard narrowing in if statement with conditional expression typeguard return typeof x !== "string" // string | number | boolean - && (typeof x !== "number" // number | boolean - ? x // boolean - : x === 10); // number + && (typeof x !== "number" // number | boolean + ? x // boolean + : x === 10); // number } function foo7(x) { var y; var z; // Mixing typeguard narrowing // Assigning value to x deep inside another guard stops narrowing of type too - return typeof x !== "string" && ((z = x) // string | number | boolean - x changed deeper in conditional expression - && (typeof x === "number" ? (x = 10 && x.toString()) // number | boolean | string - : (y = x && x.toString()))); // number | boolean | string + return typeof x !== "string" + && ((z = x) // string | number | boolean - x changed deeper in conditional expression + && (typeof x === "number" + ? (x = 10 && x.toString()) // number | boolean | string + : (y = x && x.toString()))); // number | boolean | string } function foo8(x) { // Mixing typeguard // Assigning value to x in outer guard shouldn't stop narrowing in the inner expression - return typeof x !== "string" && (x = 10) // change x - number| string - && (typeof x === "number" ? x // number - : x.length); // string + return typeof x !== "string" + && (x = 10) // change x - number| string + && (typeof x === "number" + ? x // number + : x.length); // string } diff --git a/tests/baselines/reference/typeGuardsInRightOperandOfOrOrOperator.js b/tests/baselines/reference/typeGuardsInRightOperandOfOrOrOperator.js index 5f5880a4947..188d226da13 100644 --- a/tests/baselines/reference/typeGuardsInRightOperandOfOrOrOperator.js +++ b/tests/baselines/reference/typeGuardsInRightOperandOfOrOrOperator.js @@ -72,36 +72,40 @@ function foo3(x) { } function foo4(x) { return typeof x === "string" // string | number | boolean - || typeof x === "number" // number | boolean - || x; // boolean + || typeof x === "number" // number | boolean + || x; // boolean } function foo5(x) { // usage of x or assignment to separate variable shouldn't cause narrowing of type to stop var b; return typeof x === "string" // string | number | boolean - || ((b = x) || (typeof x === "number" // number | boolean - || x)); // boolean + || ((b = x) || (typeof x === "number" // number | boolean + || x)); // boolean } function foo6(x) { // Mixing typeguard return typeof x === "string" // string | number | boolean - || (typeof x !== "number" // number | boolean - ? x // boolean - : x === 10); // number + || (typeof x !== "number" // number | boolean + ? x // boolean + : x === 10); // number } function foo7(x) { var y; var z; // Mixing typeguard narrowing // Assigning value to x deep inside another guard stops narrowing of type too - return typeof x === "string" || ((z = x) // string | number | boolean - x changed deeper in conditional expression - || (typeof x === "number" ? (x = 10 && x.toString()) // number | boolean | string - : (y = x && x.toString()))); // number | boolean | string + return typeof x === "string" + || ((z = x) // string | number | boolean - x changed deeper in conditional expression + || (typeof x === "number" + ? (x = 10 && x.toString()) // number | boolean | string + : (y = x && x.toString()))); // number | boolean | string } function foo8(x) { // Mixing typeguard // Assigning value to x in outer guard shouldn't stop narrowing in the inner expression - return typeof x === "string" || (x = 10) // change x - number| string - || (typeof x === "number" ? x // number - : x.length); // string + return typeof x === "string" + || (x = 10) // change x - number| string + || (typeof x === "number" + ? x // number + : x.length); // string } diff --git a/tests/baselines/reference/typeGuardsWithAny.js b/tests/baselines/reference/typeGuardsWithAny.js index 08aed91edd8..be3d64b806f 100644 --- a/tests/baselines/reference/typeGuardsWithAny.js +++ b/tests/baselines/reference/typeGuardsWithAny.js @@ -38,9 +38,7 @@ else { //// [typeGuardsWithAny.js] -var x = { - p: 0 -}; +var x = { p: 0 }; if (x instanceof Object) { x.p; // No error, type any unaffected by instanceof type guard } diff --git a/tests/baselines/reference/typeIdentityConsidersBrands.js b/tests/baselines/reference/typeIdentityConsidersBrands.js index 002364a2e03..2398033c2c6 100644 --- a/tests/baselines/reference/typeIdentityConsidersBrands.js +++ b/tests/baselines/reference/typeIdentityConsidersBrands.js @@ -53,15 +53,13 @@ var Y_1 = (function () { } return Y_1; })(); -function foo(arg) { -} +function foo(arg) { } var a = new Y(); var b = new X(); a = b; // ok foo(a); // ok var a2 = new Y_1(); var b2 = new X_1(); -function foo2(arg) { -} +function foo2(arg) { } a2 = b2; // should error foo2(a2); // should error diff --git a/tests/baselines/reference/typeInfer1.js b/tests/baselines/reference/typeInfer1.js index bab1ebf930c..f9613298838 100644 --- a/tests/baselines/reference/typeInfer1.js +++ b/tests/baselines/reference/typeInfer1.js @@ -15,13 +15,9 @@ var yyyyyyyy: ITextWriter2 = { //// [typeInfer1.js] var x = { - Write: function (s) { - }, - WriteLine: function (s) { - } + Write: function (s) { }, + WriteLine: function (s) { } }; var yyyyyyyy = { - Moo: function () { - return "cow"; - } + Moo: function () { return "cow"; } }; diff --git a/tests/baselines/reference/typeInferenceConflictingCandidates.js b/tests/baselines/reference/typeInferenceConflictingCandidates.js index ea7834a0769..2033c3b6b22 100644 --- a/tests/baselines/reference/typeInferenceConflictingCandidates.js +++ b/tests/baselines/reference/typeInferenceConflictingCandidates.js @@ -4,6 +4,4 @@ declare function g(a: T, b: T, c: (t: T) => T): T; g("", 3, a => a); //// [typeInferenceConflictingCandidates.js] -g("", 3, function (a) { - return a; -}); +g("", 3, function (a) { return a; }); diff --git a/tests/baselines/reference/typeInferenceFixEarly.js b/tests/baselines/reference/typeInferenceFixEarly.js index 820f381e7ad..58b8824c8b1 100644 --- a/tests/baselines/reference/typeInferenceFixEarly.js +++ b/tests/baselines/reference/typeInferenceFixEarly.js @@ -4,6 +4,4 @@ declare function f(p: (t: T) => T): T; f(n => 3); //// [typeInferenceFixEarly.js] -f(function (n) { - return 3; -}); +f(function (n) { return 3; }); diff --git a/tests/baselines/reference/typeInferenceWithTupleType.js b/tests/baselines/reference/typeInferenceWithTupleType.js index bc504b30b35..10a18274c73 100644 --- a/tests/baselines/reference/typeInferenceWithTupleType.js +++ b/tests/baselines/reference/typeInferenceWithTupleType.js @@ -27,39 +27,22 @@ var zipResultEleEle = zipResult[0][0]; // string //// [typeInferenceWithTupleType.js] function combine(x, y) { - return [ - x, - y - ]; + return [x, y]; } var combineResult = combine("string", 10); var combineEle1 = combineResult[0]; // string var combineEle2 = combineResult[1]; // number function zip(array1, array2) { if (array1.length != array2.length) { - return [ - [ - undefined, - undefined - ] - ]; + return [[undefined, undefined]]; } var length = array1.length; var zipResult; for (var i = 0; i < length; ++i) { - zipResult.push([ - array1[i], - array2[i] - ]); + zipResult.push([array1[i], array2[i]]); } return zipResult; } -var zipResult = zip([ - "foo", - "bar" -], [ - 5, - 6 -]); +var zipResult = zip(["foo", "bar"], [5, 6]); var zipResultEle = zipResult[0]; // [string, number] var zipResultEleEle = zipResult[0][0]; // string diff --git a/tests/baselines/reference/typeInferenceWithTypeAnnotation.js b/tests/baselines/reference/typeInferenceWithTypeAnnotation.js index 164be34cd29..119773f6e31 100644 --- a/tests/baselines/reference/typeInferenceWithTypeAnnotation.js +++ b/tests/baselines/reference/typeInferenceWithTypeAnnotation.js @@ -4,6 +4,4 @@ declare function f(p: (t: T) => T): T; f((n: number) => n); //// [typeInferenceWithTypeAnnotation.js] -f(function (n) { - return n; -}); +f(function (n) { return n; }); diff --git a/tests/baselines/reference/typeLiteralCallback.js b/tests/baselines/reference/typeLiteralCallback.js index 8f940581916..82c8b37e454 100644 --- a/tests/baselines/reference/typeLiteralCallback.js +++ b/tests/baselines/reference/typeLiteralCallback.js @@ -17,9 +17,5 @@ test.fail2(arg => foo.reject(arg)); // Should be OK. Was: Error: Supplied para //// [typeLiteralCallback.js] var foo; var test; -test.fail(function (arg) { - return foo.reject(arg); -}); -test.fail2(function (arg) { - return foo.reject(arg); -}); // Should be OK. Was: Error: Supplied parameters do not match any signature of call target +test.fail(function (arg) { return foo.reject(arg); }); +test.fail2(function (arg) { return foo.reject(arg); }); // Should be OK. Was: Error: Supplied parameters do not match any signature of call target diff --git a/tests/baselines/reference/typeMatch2.js b/tests/baselines/reference/typeMatch2.js index c59bfad8b13..1fd624e4e5b 100644 --- a/tests/baselines/reference/typeMatch2.js +++ b/tests/baselines/reference/typeMatch2.js @@ -52,23 +52,11 @@ var __extends = this.__extends || function (d, b) { d.prototype = new __(); }; function f1() { - var a = { - x: 1, - y: 2 - }; + var a = { x: 1, y: 2 }; a = {}; // error - a = { - x: 1 - }; // error - a = { - x: 1, - y: 2, - z: 3 - }; - a = { - x: 1, - z: 3 - }; // error + a = { x: 1 }; // error + a = { x: 1, y: 2, z: 3 }; + a = { x: 1, z: 3 }; // error } var Animal = (function () { function Animal() { @@ -85,26 +73,12 @@ var Giraffe = (function (_super) { function f2() { var a = new Animal(); var g = new Giraffe(); - var aa = [ - a, - a, - a - ]; - var gg = [ - g, - g, - g - ]; + var aa = [a, a, a]; + var gg = [g, g, g]; aa = gg; gg = aa; // error - var xa = { - f1: 5, - f2: aa - }; - var xb = { - f1: 5, - f2: gg - }; + var xa = { f1: 5, f2: aa }; + var xb = { f1: 5, f2: gg }; xa = xb; // Should be ok xb = xa; // Not ok } @@ -113,36 +87,14 @@ function f4() { var i = 5; i = null; i = undefined; - var a = { - x: 1, - y: 1 - }; - a = { - x: 1, - y: null - }; - a = { - x: 1, - y: undefined - }; - a = { - x: 1, - y: _any - }; - a = { - x: 1, - y: _any, - z: 1 - }; - a = { - x: 1 - }; // error - var mf = function m(n) { - return false; - }; - var zf = function z(n) { - return true; - }; + var a = { x: 1, y: 1 }; + a = { x: 1, y: null }; + a = { x: 1, y: undefined }; + a = { x: 1, y: _any }; + a = { x: 1, y: _any, z: 1 }; + a = { x: 1 }; // error + var mf = function m(n) { return false; }; + var zf = function z(n) { return true; }; mf = zf; mf(_any); zf(_any); diff --git a/tests/baselines/reference/typeOfOnTypeArg.js b/tests/baselines/reference/typeOfOnTypeArg.js index ff304c05697..199233065b4 100644 --- a/tests/baselines/reference/typeOfOnTypeArg.js +++ b/tests/baselines/reference/typeOfOnTypeArg.js @@ -9,9 +9,7 @@ fill(32); //// [typeOfOnTypeArg.js] -var A = { - '': 3 -}; +var A = { '': 3 }; function fill(f) { } fill(32); diff --git a/tests/baselines/reference/typeOfThisInInstanceMember.js b/tests/baselines/reference/typeOfThisInInstanceMember.js index 7d88d98cf74..5e4b4f2970d 100644 --- a/tests/baselines/reference/typeOfThisInInstanceMember.js +++ b/tests/baselines/reference/typeOfThisInInstanceMember.js @@ -59,11 +59,7 @@ var r = c.x; var ra = c.x.x.x; var r2 = c.y; var r3 = c.foo(); -var rs = [ - r, - r2, - r3 -]; +var rs = [r, r2, r3]; rs.forEach(function (x) { x.foo; x.x; diff --git a/tests/baselines/reference/typeOfThisInInstanceMember2.js b/tests/baselines/reference/typeOfThisInInstanceMember2.js index e094e232ec1..b2b81ce3a23 100644 --- a/tests/baselines/reference/typeOfThisInInstanceMember2.js +++ b/tests/baselines/reference/typeOfThisInInstanceMember2.js @@ -64,11 +64,7 @@ var ra = c.x.x.x; var r2 = c.y; var r3 = c.foo(); var r4 = c.z; -var rs = [ - r, - r2, - r3 -]; +var rs = [r, r2, r3]; rs.forEach(function (x) { x.foo; x.x; diff --git a/tests/baselines/reference/typeParameterAsElementType.js b/tests/baselines/reference/typeParameterAsElementType.js index ce4364e7407..a934f3d0330 100644 --- a/tests/baselines/reference/typeParameterAsElementType.js +++ b/tests/baselines/reference/typeParameterAsElementType.js @@ -7,8 +7,5 @@ function fee() { //// [typeParameterAsElementType.js] function fee() { var t; - var arr = [ - t, - "" - ]; + var arr = [t, ""]; } diff --git a/tests/baselines/reference/typeParameterAsTypeParameterConstraint.js b/tests/baselines/reference/typeParameterAsTypeParameterConstraint.js index f432358a1ca..9266f520867 100644 --- a/tests/baselines/reference/typeParameterAsTypeParameterConstraint.js +++ b/tests/baselines/reference/typeParameterAsTypeParameterConstraint.js @@ -29,32 +29,16 @@ foo2(1, ['']); //// [typeParameterAsTypeParameterConstraint.js] // using a type parameter as a constraint for a type parameter is valid // no errors expected except illegal constraints -function foo(x, y) { - return y; -} +function foo(x, y) { return y; } var r = foo(1, 2); var r = foo({}, 1); var a; var b; var r2 = foo(a, b); -var r3 = foo({ - x: 1 -}, { - x: 2, - y: 3 -}); -function foo2(x, y) { - return y; -} +var r3 = foo({ x: 1 }, { x: 2, y: 3 }); +function foo2(x, y) { return y; } foo2(1, ''); -foo2({}, { - length: 2 -}); -foo2(1, { - width: 3, - length: 2 -}); +foo2({}, { length: 2 }); +foo2(1, { width: 3, length: 2 }); foo2(1, []); -foo2(1, [ - '' -]); +foo2(1, ['']); diff --git a/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.js b/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.js index a3f4d8d5259..e8066b9ebfa 100644 --- a/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.js +++ b/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.js @@ -21,22 +21,12 @@ foo2([], ['']); //// [typeParameterAsTypeParameterConstraint2.js] // using a type parameter as a constraint for a type parameter is invalid // these should be errors unless otherwise noted -function foo(x, y) { - return y; -} // this is now an error +function foo(x, y) { return y; } // this is now an error foo(1, ''); foo(1, {}); var n; var r3 = foo(1, n); -function foo2(x, y) { - return y; -} // this is now an error -foo2(1, { - length: '' -}); -foo2(1, { - length: {} -}); -foo2([], [ - '' -]); +function foo2(x, y) { return y; } // this is now an error +foo2(1, { length: '' }); +foo2(1, { length: {} }); +foo2([], ['']); diff --git a/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively.js b/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively.js index 669139058ed..bc50363036d 100644 --- a/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively.js +++ b/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively.js @@ -30,39 +30,15 @@ foo(b, b, { foo: 1, bar: '', hm: '' }); var a; var b; var c; -function foo(x, y, z) { - return z; -} +function foo(x, y, z) { return z; } //function foo(x: T, y: U, z: V): V { return z; } foo(1, 2, 3); -foo({ - x: 1 -}, { - x: 1, - y: '' -}, { - x: 2, - y: '', - z: true -}); +foo({ x: 1 }, { x: 1, y: '' }, { x: 2, y: '', z: true }); foo(a, b, c); -foo(a, b, { - foo: 1, - bar: '', - hm: true -}); -foo(function (x, y) { -}, function (x) { -}, function () { -}); -function foo2(x, y, z) { - return z; -} +foo(a, b, { foo: 1, bar: '', hm: true }); +foo(function (x, y) { }, function (x) { }, function () { }); +function foo2(x, y, z) { return z; } //function foo2(x: T, y: U, z: V): V { return z; } foo(a, a, a); foo(a, b, c); -foo(b, b, { - foo: 1, - bar: '', - hm: '' -}); +foo(b, b, { foo: 1, bar: '', hm: '' }); diff --git a/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively2.js b/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively2.js index 32bad4dc3c3..6541cfaa231 100644 --- a/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively2.js +++ b/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively2.js @@ -29,34 +29,14 @@ foo(c, c, a); var a; var b; var c; -function foo(x, y, z) { - return z; -} +function foo(x, y, z) { return z; } //function foo(x: T, y: U, z: V): V { return z; } foo(1, 2, ''); -foo({ - x: 1 -}, { - x: 1, - y: '' -}, { - x: 2, - y: 2, - z: true -}); +foo({ x: 1 }, { x: 1, y: '' }, { x: 2, y: 2, z: true }); foo(a, b, a); -foo(a, { - foo: 1, - bar: '', - hm: true -}, b); -foo(function (x, y) { -}, function (x, y) { -}, function () { -}); -function foo2(x, y, z) { - return z; -} +foo(a, { foo: 1, bar: '', hm: true }, b); +foo(function (x, y) { }, function (x, y) { }, function () { }); +function foo2(x, y, z) { return z; } //function foo2(x: T, y: U, z: V): V { return z; } foo(b, a, c); foo(c, c, a); diff --git a/tests/baselines/reference/typeParameterCompatibilityAccrossDeclarations.js b/tests/baselines/reference/typeParameterCompatibilityAccrossDeclarations.js index 04fb7b1dc25..7e923941386 100644 --- a/tests/baselines/reference/typeParameterCompatibilityAccrossDeclarations.js +++ b/tests/baselines/reference/typeParameterCompatibilityAccrossDeclarations.js @@ -25,14 +25,10 @@ i2 = a2; // no error //// [typeParameterCompatibilityAccrossDeclarations.js] define(["require", "exports"], function (require, exports) { var a = { - x: function (y) { - return null; - } + x: function (y) { return null; } }; var a2 = { - x: function (y) { - return null; - } + x: function (y) { return null; } }; var i; var i2; diff --git a/tests/baselines/reference/typeParameterConstraints1.js b/tests/baselines/reference/typeParameterConstraints1.js index 49d347f576b..6ffefbcf8f1 100644 --- a/tests/baselines/reference/typeParameterConstraints1.js +++ b/tests/baselines/reference/typeParameterConstraints1.js @@ -14,29 +14,16 @@ function foo12(test: T) { } function foo13(test: T) { } //// [typeParameterConstraints1.js] -function foo1(test) { -} -function foo2(test) { -} -function foo3(test) { -} -function foo4(test) { -} // valid -function foo5(test) { -} // valid -function foo6(test) { -} -function foo7(test) { -} // valid -function foo8(test) { -} -function foo9(test) { -} -function foo10(test) { -} -function foo11(test) { -} -function foo12(test) { -} -function foo13(test) { -} +function foo1(test) { } +function foo2(test) { } +function foo3(test) { } +function foo4(test) { } // valid +function foo5(test) { } // valid +function foo6(test) { } +function foo7(test) { } // valid +function foo8(test) { } +function foo9(test) { } +function foo10(test) { } +function foo11(test) { } +function foo12(test) { } +function foo13(test) { } diff --git a/tests/baselines/reference/typeParameterDirectlyConstrainedToItself.js b/tests/baselines/reference/typeParameterDirectlyConstrainedToItself.js index 85f86f7de76..a14e010515b 100644 --- a/tests/baselines/reference/typeParameterDirectlyConstrainedToItself.js +++ b/tests/baselines/reference/typeParameterDirectlyConstrainedToItself.js @@ -30,12 +30,8 @@ var C2 = (function () { } return C2; })(); -function f() { -} -function f2() { -} +function f() { } +function f2() { } var a; -var b = function () { -}; -var b2 = function () { -}; +var b = function () { }; +var b2 = function () { }; diff --git a/tests/baselines/reference/typeParameterFixingWithConstraints.js b/tests/baselines/reference/typeParameterFixingWithConstraints.js index 49b2c48fbe2..7eeee2b387f 100644 --- a/tests/baselines/reference/typeParameterFixingWithConstraints.js +++ b/tests/baselines/reference/typeParameterFixingWithConstraints.js @@ -12,10 +12,4 @@ foo.foo({ bar: null }, bar => null, bar => null); //// [typeParameterFixingWithConstraints.js] var foo; -foo.foo({ - bar: null -}, function (bar) { - return null; -}, function (bar) { - return null; -}); +foo.foo({ bar: null }, function (bar) { return null; }, function (bar) { return null; }); diff --git a/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments.js b/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments.js index 170bd711b61..0ac79625e1a 100644 --- a/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments.js +++ b/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments.js @@ -10,19 +10,8 @@ var d2 = f(b, x => x.a, null); // type [B, A] var d3 = f(b, x => x.b, null); // type [B, any] //// [typeParameterFixingWithContextSensitiveArguments.js] -function f(y, f, x) { - return [ - y, - f(x) - ]; -} +function f(y, f, x) { return [y, f(x)]; } var a, b; -var d = f(b, function (x) { - return x.a; -}, a); // type [A, A] -var d2 = f(b, function (x) { - return x.a; -}, null); // type [B, A] -var d3 = f(b, function (x) { - return x.b; -}, null); // type [B, any] +var d = f(b, function (x) { return x.a; }, a); // type [A, A] +var d2 = f(b, function (x) { return x.a; }, null); // type [B, A] +var d3 = f(b, function (x) { return x.b; }, null); // type [B, any] diff --git a/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments2.js b/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments2.js index 1b97f04953e..25b22fde8bc 100644 --- a/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments2.js +++ b/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments2.js @@ -8,15 +8,6 @@ var a: A, b: B; var d = f(a, b, x => x, x => x); // A => A not assignable to A => B //// [typeParameterFixingWithContextSensitiveArguments2.js] -function f(y, y1, p, p1) { - return [ - y, - p1(y) - ]; -} +function f(y, y1, p, p1) { return [y, p1(y)]; } var a, b; -var d = f(a, b, function (x) { - return x; -}, function (x) { - return x; -}); // A => A not assignable to A => B +var d = f(a, b, function (x) { return x; }, function (x) { return x; }); // A => A not assignable to A => B diff --git a/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments3.js b/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments3.js index 4b5370cfc1c..665ee9d1317 100644 --- a/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments3.js +++ b/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments3.js @@ -8,15 +8,6 @@ var a: A, b: B; var d = f(a, b, u2 => u2.b, t2 => t2); //// [typeParameterFixingWithContextSensitiveArguments3.js] -function f(t1, u1, pf1, pf2) { - return [ - t1, - pf2(t1) - ]; -} +function f(t1, u1, pf1, pf2) { return [t1, pf2(t1)]; } var a, b; -var d = f(a, b, function (u2) { - return u2.b; -}, function (t2) { - return t2; -}); +var d = f(a, b, function (u2) { return u2.b; }, function (t2) { return t2; }); diff --git a/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments4.js b/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments4.js index 7efab1f62c5..65adc2f288b 100644 --- a/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments4.js +++ b/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments4.js @@ -8,15 +8,6 @@ var a: A, b: B; var d = f(a, b, x => x, x => x); // Type [A, B] //// [typeParameterFixingWithContextSensitiveArguments4.js] -function f(y, y1, p, p1) { - return [ - y, - p1(y) - ]; -} +function f(y, y1, p, p1) { return [y, p1(y)]; } var a, b; -var d = f(a, b, function (x) { - return x; -}, function (x) { - return x; -}); // Type [A, B] +var d = f(a, b, function (x) { return x; }, function (x) { return x; }); // Type [A, B] diff --git a/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments5.js b/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments5.js index 7ab2502e02c..391a98d75a5 100644 --- a/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments5.js +++ b/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments5.js @@ -8,15 +8,6 @@ var a: A, b: B; var d = f(a, b, u2 => u2.b, t2 => t2); //// [typeParameterFixingWithContextSensitiveArguments5.js] -function f(t1, u1, pf1, pf2) { - return [ - t1, - pf2(t1) - ]; -} +function f(t1, u1, pf1, pf2) { return [t1, pf2(t1)]; } var a, b; -var d = f(a, b, function (u2) { - return u2.b; -}, function (t2) { - return t2; -}); +var d = f(a, b, function (u2) { return u2.b; }, function (t2) { return t2; }); diff --git a/tests/baselines/reference/typeParameterIndirectlyConstrainedToItself.js b/tests/baselines/reference/typeParameterIndirectlyConstrainedToItself.js index fc0e10d41c9..3cdb735adfb 100644 --- a/tests/baselines/reference/typeParameterIndirectlyConstrainedToItself.js +++ b/tests/baselines/reference/typeParameterIndirectlyConstrainedToItself.js @@ -29,15 +29,11 @@ var C2 = (function () { } return C2; })(); -function f() { -} -function f2() { -} +function f() { } +function f2() { } var a; -var b = function () { -}; -var b2 = function () { -}; +var b = function () { }; +var b2 = function () { }; var D = (function () { function D() { } diff --git a/tests/baselines/reference/typeParameterOrderReversal.js b/tests/baselines/reference/typeParameterOrderReversal.js index 8c9185ba57c..40df6db0034 100644 --- a/tests/baselines/reference/typeParameterOrderReversal.js +++ b/tests/baselines/reference/typeParameterOrderReversal.js @@ -15,10 +15,8 @@ tFirst(z); //// [typeParameterOrderReversal.js] // Only difference here is order of type parameters -function uFirst(x) { -} -function tFirst(x) { -} +function uFirst(x) { } +function tFirst(x) { } var z = null; // Both of these should be allowed uFirst(z); diff --git a/tests/baselines/reference/typeParameterUsedAsConstraint.js b/tests/baselines/reference/typeParameterUsedAsConstraint.js index 4649a53f8fc..b1c55343aa0 100644 --- a/tests/baselines/reference/typeParameterUsedAsConstraint.js +++ b/tests/baselines/reference/typeParameterUsedAsConstraint.js @@ -66,30 +66,18 @@ var C6 = (function () { } return C6; })(); -function f() { -} -function f2() { -} -function f3() { -} -function f4() { -} -function f5() { -} -function f6() { -} -var e = function () { -}; -var e2 = function () { -}; -var e3 = function () { -}; -var e4 = function () { -}; -var e5 = function () { -}; -var e6 = function () { -}; +function f() { } +function f2() { } +function f3() { } +function f4() { } +function f5() { } +function f6() { } +var e = function () { }; +var e2 = function () { }; +var e3 = function () { }; +var e4 = function () { }; +var e5 = function () { }; +var e6 = function () { }; var a; var a2; var a3; diff --git a/tests/baselines/reference/typeParametersAreIdenticalToThemselves.js b/tests/baselines/reference/typeParametersAreIdenticalToThemselves.js index a2f8aa2f9b7..c6c624f7e2b 100644 --- a/tests/baselines/reference/typeParametersAreIdenticalToThemselves.js +++ b/tests/baselines/reference/typeParametersAreIdenticalToThemselves.js @@ -78,37 +78,26 @@ interface I2 { //// [typeParametersAreIdenticalToThemselves.js] // type parameters from the same declaration are identical to themself -function foo1(x) { -} -function foo2(x) { -} +function foo1(x) { } +function foo2(x) { } function foo3(x, y) { - function inner(x) { - } - function inner2(x) { - } + function inner(x) { } + function inner2(x) { } } var C = (function () { function C() { } - C.prototype.foo1 = function (x) { - }; - C.prototype.foo2 = function (a, x) { - }; - C.prototype.foo3 = function (x) { - }; - C.prototype.foo4 = function (x) { - }; + C.prototype.foo1 = function (x) { }; + C.prototype.foo2 = function (a, x) { }; + C.prototype.foo3 = function (x) { }; + C.prototype.foo4 = function (x) { }; return C; })(); var C2 = (function () { function C2() { } - C2.prototype.foo1 = function (x) { - }; - C2.prototype.foo2 = function (a, x) { - }; - C2.prototype.foo3 = function (x) { - }; + C2.prototype.foo1 = function (x) { }; + C2.prototype.foo2 = function (a, x) { }; + C2.prototype.foo3 = function (x) { }; return C2; })(); diff --git a/tests/baselines/reference/typeParametersInStaticAccessors.js b/tests/baselines/reference/typeParametersInStaticAccessors.js index 411a4eac69d..c621de910bc 100644 --- a/tests/baselines/reference/typeParametersInStaticAccessors.js +++ b/tests/baselines/reference/typeParametersInStaticAccessors.js @@ -9,15 +9,12 @@ var foo = (function () { function foo() { } Object.defineProperty(foo, "Foo", { - get: function () { - return null; - }, + get: function () { return null; }, enumerable: true, configurable: true }); Object.defineProperty(foo, "Bar", { - set: function (v) { - }, + set: function (v) { }, enumerable: true, configurable: true }); diff --git a/tests/baselines/reference/typeQueryOnClass.js b/tests/baselines/reference/typeQueryOnClass.js index a3ae0bd02c1..1c8b2424a7e 100644 --- a/tests/baselines/reference/typeQueryOnClass.js +++ b/tests/baselines/reference/typeQueryOnClass.js @@ -62,14 +62,10 @@ var C = (function () { var _this = this; this.x = x; this.ia = 1; - this.ib = function () { - return _this.ia; - }; + this.ib = function () { return _this.ia; }; } - C.foo = function (x) { - }; - C.bar = function (x) { - }; + C.foo = function (x) { }; + C.bar = function (x) { }; Object.defineProperty(C, "sc", { get: function () { return 1; @@ -86,9 +82,7 @@ var C = (function () { enumerable: true, configurable: true }); - C.prototype.baz = function (x) { - return ''; - }; + C.prototype.baz = function (x) { return ''; }; Object.defineProperty(C.prototype, "ic", { get: function () { return 1; @@ -106,9 +100,7 @@ var C = (function () { configurable: true }); C.sa = 1; - C.sb = function () { - return 1; - }; + C.sb = function () { return 1; }; return C; })(); var c; @@ -119,8 +111,7 @@ var D = (function () { function D(y) { this.y = y; } - D.prototype.foo = function () { - }; + D.prototype.foo = function () { }; return D; })(); var d; diff --git a/tests/baselines/reference/typeResolution.js b/tests/baselines/reference/typeResolution.js index 74102f5a0fd..55a6beeceba 100644 --- a/tests/baselines/reference/typeResolution.js +++ b/tests/baselines/reference/typeResolution.js @@ -224,24 +224,21 @@ define(["require", "exports"], function (require, exports) { var ClassA = (function () { function ClassA() { } - ClassA.prototype.AisIn1_2_2 = function () { - }; + ClassA.prototype.AisIn1_2_2 = function () { }; return ClassA; })(); SubSubModule2.ClassA = ClassA; var ClassB = (function () { function ClassB() { } - ClassB.prototype.BisIn1_2_2 = function () { - }; + ClassB.prototype.BisIn1_2_2 = function () { }; return ClassB; })(); SubSubModule2.ClassB = ClassB; var ClassC = (function () { function ClassC() { } - ClassC.prototype.CisIn1_2_2 = function () { - }; + ClassC.prototype.CisIn1_2_2 = function () { }; return ClassC; })(); SubSubModule2.ClassC = ClassC; @@ -250,8 +247,7 @@ define(["require", "exports"], function (require, exports) { var ClassA = (function () { function ClassA() { } - ClassA.prototype.AisIn1 = function () { - }; + ClassA.prototype.AisIn1 = function () { }; return ClassA; })(); var NotExportedModule; @@ -271,8 +267,7 @@ define(["require", "exports"], function (require, exports) { var ClassA = (function () { function ClassA() { } - ClassA.prototype.AisIn2_3 = function () { - }; + ClassA.prototype.AisIn2_3 = function () { }; return ClassA; })(); SubModule3.ClassA = ClassA; diff --git a/tests/baselines/reference/typeResolution.js.map b/tests/baselines/reference/typeResolution.js.map index b4aa7040531..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;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;oBAAsBE,CAACA;oBAACF,aAACA;gBAADA,CAACA,AAA/CD,IAA+CA;gBAAlCA,oBAAMA,SAA4BA,CAAAA;gBAC/CA;oBAAAI;oBAA8CC,CAACA;oBAAlBD,2BAAUA,GAAjBA;oBAAsBE,CAACA;oBAACF,aAACA;gBAADA,CAACA,AAA/CJ,IAA+CA;gBAAlCA,oBAAMA,SAA4BA,CAAAA;gBAC/CA;oBAAAO;oBAA8CC,CAACA;oBAAlBD,2BAAUA,GAAjBA;oBAAsBE,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;YAAkBE,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;gBAAoBE,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 54b2c44eae6..a7d8bd170f1 100644 --- a/tests/baselines/reference/typeResolution.sourcemap.txt +++ b/tests/baselines/reference/typeResolution.sourcemap.txt @@ -2176,39 +2176,36 @@ sourceFile:typeResolution.ts >>> } 1->^^^^^^^^^^^^^^^^^^^^ 2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1->export class ClassA { public AisIn1_2_2() { } 2 > } 1->Emitted(113, 21) Source(79, 59) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassA.constructor) 2 >Emitted(113, 22) Source(79, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassA.constructor) --- ->>> ClassA.prototype.AisIn1_2_2 = function () { +>>> ClassA.prototype.AisIn1_2_2 = function () { }; 1->^^^^^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^^^ +4 > ^^^^^^^^^^^^^^ +5 > ^ 1-> 2 > AisIn1_2_2 3 > +4 > public AisIn1_2_2() { +5 > } 1->Emitted(114, 21) Source(79, 42) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassA) 2 >Emitted(114, 48) Source(79, 52) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassA) 3 >Emitted(114, 51) Source(79, 35) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassA) ---- ->>> }; -1 >^^^^^^^^^^^^^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^-> -1 >public AisIn1_2_2() { -2 > } -1 >Emitted(115, 21) Source(79, 57) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassA.AisIn1_2_2) -2 >Emitted(115, 22) Source(79, 58) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassA.AisIn1_2_2) +4 >Emitted(114, 65) Source(79, 57) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassA.AisIn1_2_2) +5 >Emitted(114, 66) Source(79, 58) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassA.AisIn1_2_2) --- >>> return ClassA; -1->^^^^^^^^^^^^^^^^^^^^ +1 >^^^^^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^ -1-> +1 > 2 > } -1->Emitted(116, 21) Source(79, 59) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassA) -2 >Emitted(116, 34) Source(79, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassA) +1 >Emitted(115, 21) Source(79, 59) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassA) +2 >Emitted(115, 34) Source(79, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassA) --- >>> })(); 1 >^^^^^^^^^^^^^^^^ @@ -2220,10 +2217,10 @@ sourceFile:typeResolution.ts 2 > } 3 > 4 > export class ClassA { public AisIn1_2_2() { } } -1 >Emitted(117, 17) Source(79, 59) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassA) -2 >Emitted(117, 18) Source(79, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassA) -3 >Emitted(117, 18) Source(79, 13) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) -4 >Emitted(117, 22) Source(79, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) +1 >Emitted(116, 17) Source(79, 59) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassA) +2 >Emitted(116, 18) Source(79, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassA) +3 >Emitted(116, 18) Source(79, 13) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) +4 >Emitted(116, 22) Source(79, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) --- >>> SubSubModule2.ClassA = ClassA; 1->^^^^^^^^^^^^^^^^ @@ -2234,60 +2231,57 @@ sourceFile:typeResolution.ts 2 > ClassA 3 > { public AisIn1_2_2() { } } 4 > -1->Emitted(118, 17) Source(79, 26) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) -2 >Emitted(118, 37) Source(79, 32) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) -3 >Emitted(118, 46) Source(79, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) -4 >Emitted(118, 47) Source(79, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) +1->Emitted(117, 17) Source(79, 26) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) +2 >Emitted(117, 37) Source(79, 32) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) +3 >Emitted(117, 46) Source(79, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) +4 >Emitted(117, 47) Source(79, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) --- >>> var ClassB = (function () { 1 >^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(119, 17) Source(80, 13) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) +1 >Emitted(118, 17) Source(80, 13) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) --- >>> function ClassB() { 1->^^^^^^^^^^^^^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(120, 21) Source(80, 13) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassB) +1->Emitted(119, 21) Source(80, 13) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassB) --- >>> } 1->^^^^^^^^^^^^^^^^^^^^ 2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1->export class ClassB { public BisIn1_2_2() { } 2 > } -1->Emitted(121, 21) Source(80, 59) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassB.constructor) -2 >Emitted(121, 22) Source(80, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassB.constructor) +1->Emitted(120, 21) Source(80, 59) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassB.constructor) +2 >Emitted(120, 22) Source(80, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassB.constructor) --- ->>> ClassB.prototype.BisIn1_2_2 = function () { +>>> ClassB.prototype.BisIn1_2_2 = function () { }; 1->^^^^^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^^^ +4 > ^^^^^^^^^^^^^^ +5 > ^ 1-> 2 > BisIn1_2_2 3 > -1->Emitted(122, 21) Source(80, 42) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassB) -2 >Emitted(122, 48) Source(80, 52) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassB) -3 >Emitted(122, 51) Source(80, 35) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassB) ---- ->>> }; -1 >^^^^^^^^^^^^^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^-> -1 >public BisIn1_2_2() { -2 > } -1 >Emitted(123, 21) Source(80, 57) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassB.BisIn1_2_2) -2 >Emitted(123, 22) Source(80, 58) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassB.BisIn1_2_2) +4 > public BisIn1_2_2() { +5 > } +1->Emitted(121, 21) Source(80, 42) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassB) +2 >Emitted(121, 48) Source(80, 52) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassB) +3 >Emitted(121, 51) Source(80, 35) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassB) +4 >Emitted(121, 65) Source(80, 57) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassB.BisIn1_2_2) +5 >Emitted(121, 66) Source(80, 58) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassB.BisIn1_2_2) --- >>> return ClassB; -1->^^^^^^^^^^^^^^^^^^^^ +1 >^^^^^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^ -1-> +1 > 2 > } -1->Emitted(124, 21) Source(80, 59) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassB) -2 >Emitted(124, 34) Source(80, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassB) +1 >Emitted(122, 21) Source(80, 59) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassB) +2 >Emitted(122, 34) Source(80, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassB) --- >>> })(); 1 >^^^^^^^^^^^^^^^^ @@ -2299,10 +2293,10 @@ sourceFile:typeResolution.ts 2 > } 3 > 4 > export class ClassB { public BisIn1_2_2() { } } -1 >Emitted(125, 17) Source(80, 59) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassB) -2 >Emitted(125, 18) Source(80, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassB) -3 >Emitted(125, 18) Source(80, 13) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) -4 >Emitted(125, 22) Source(80, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) +1 >Emitted(123, 17) Source(80, 59) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassB) +2 >Emitted(123, 18) Source(80, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassB) +3 >Emitted(123, 18) Source(80, 13) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) +4 >Emitted(123, 22) Source(80, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) --- >>> SubSubModule2.ClassB = ClassB; 1->^^^^^^^^^^^^^^^^ @@ -2313,60 +2307,57 @@ sourceFile:typeResolution.ts 2 > ClassB 3 > { public BisIn1_2_2() { } } 4 > -1->Emitted(126, 17) Source(80, 26) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) -2 >Emitted(126, 37) Source(80, 32) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) -3 >Emitted(126, 46) Source(80, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) -4 >Emitted(126, 47) Source(80, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) +1->Emitted(124, 17) Source(80, 26) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) +2 >Emitted(124, 37) Source(80, 32) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) +3 >Emitted(124, 46) Source(80, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) +4 >Emitted(124, 47) Source(80, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) --- >>> var ClassC = (function () { 1 >^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(127, 17) Source(81, 13) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) +1 >Emitted(125, 17) Source(81, 13) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) --- >>> function ClassC() { 1->^^^^^^^^^^^^^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(128, 21) Source(81, 13) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassC) +1->Emitted(126, 21) Source(81, 13) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassC) --- >>> } 1->^^^^^^^^^^^^^^^^^^^^ 2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1->export class ClassC { public CisIn1_2_2() { } 2 > } -1->Emitted(129, 21) Source(81, 59) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassC.constructor) -2 >Emitted(129, 22) Source(81, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassC.constructor) +1->Emitted(127, 21) Source(81, 59) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassC.constructor) +2 >Emitted(127, 22) Source(81, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassC.constructor) --- ->>> ClassC.prototype.CisIn1_2_2 = function () { +>>> ClassC.prototype.CisIn1_2_2 = function () { }; 1->^^^^^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^^^ +4 > ^^^^^^^^^^^^^^ +5 > ^ 1-> 2 > CisIn1_2_2 3 > -1->Emitted(130, 21) Source(81, 42) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassC) -2 >Emitted(130, 48) Source(81, 52) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassC) -3 >Emitted(130, 51) Source(81, 35) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassC) ---- ->>> }; -1 >^^^^^^^^^^^^^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^-> -1 >public CisIn1_2_2() { -2 > } -1 >Emitted(131, 21) Source(81, 57) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassC.CisIn1_2_2) -2 >Emitted(131, 22) Source(81, 58) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassC.CisIn1_2_2) +4 > public CisIn1_2_2() { +5 > } +1->Emitted(128, 21) Source(81, 42) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassC) +2 >Emitted(128, 48) Source(81, 52) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassC) +3 >Emitted(128, 51) Source(81, 35) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassC) +4 >Emitted(128, 65) Source(81, 57) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassC.CisIn1_2_2) +5 >Emitted(128, 66) Source(81, 58) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassC.CisIn1_2_2) --- >>> return ClassC; -1->^^^^^^^^^^^^^^^^^^^^ +1 >^^^^^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^ -1-> +1 > 2 > } -1->Emitted(132, 21) Source(81, 59) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassC) -2 >Emitted(132, 34) Source(81, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassC) +1 >Emitted(129, 21) Source(81, 59) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassC) +2 >Emitted(129, 34) Source(81, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassC) --- >>> })(); 1 >^^^^^^^^^^^^^^^^ @@ -2378,10 +2369,10 @@ sourceFile:typeResolution.ts 2 > } 3 > 4 > export class ClassC { public CisIn1_2_2() { } } -1 >Emitted(133, 17) Source(81, 59) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassC) -2 >Emitted(133, 18) Source(81, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassC) -3 >Emitted(133, 18) Source(81, 13) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) -4 >Emitted(133, 22) Source(81, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) +1 >Emitted(130, 17) Source(81, 59) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassC) +2 >Emitted(130, 18) Source(81, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassC) +3 >Emitted(130, 18) Source(81, 13) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) +4 >Emitted(130, 22) Source(81, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) --- >>> SubSubModule2.ClassC = ClassC; 1->^^^^^^^^^^^^^^^^ @@ -2393,10 +2384,10 @@ sourceFile:typeResolution.ts 2 > ClassC 3 > { public CisIn1_2_2() { } } 4 > -1->Emitted(134, 17) Source(81, 26) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) -2 >Emitted(134, 37) Source(81, 32) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) -3 >Emitted(134, 46) Source(81, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) -4 >Emitted(134, 47) Source(81, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) +1->Emitted(131, 17) Source(81, 26) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) +2 >Emitted(131, 37) Source(81, 32) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) +3 >Emitted(131, 46) Source(81, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) +4 >Emitted(131, 47) Source(81, 60) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) --- >>> })(SubSubModule2 = SubModule2.SubSubModule2 || (SubModule2.SubSubModule2 = {})); 1->^^^^^^^^^^^^^^^^ @@ -2429,16 +2420,16 @@ sourceFile:typeResolution.ts > export interface InterfaceY { YisIn1_2_2(); } > interface NonExportedInterfaceQ { } > } -1->Emitted(135, 17) Source(83, 48) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) -2 >Emitted(135, 13) Source(84, 9) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) -3 >Emitted(135, 14) Source(84, 10) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) -4 >Emitted(135, 16) Source(77, 23) + SourceIndex(0) name (TopLevelModule1.SubModule2) -5 >Emitted(135, 29) Source(77, 36) + SourceIndex(0) name (TopLevelModule1.SubModule2) -6 >Emitted(135, 32) Source(77, 23) + SourceIndex(0) name (TopLevelModule1.SubModule2) -7 >Emitted(135, 56) Source(77, 36) + SourceIndex(0) name (TopLevelModule1.SubModule2) -8 >Emitted(135, 61) Source(77, 23) + SourceIndex(0) name (TopLevelModule1.SubModule2) -9 >Emitted(135, 85) Source(77, 36) + SourceIndex(0) name (TopLevelModule1.SubModule2) -10>Emitted(135, 93) Source(84, 10) + SourceIndex(0) name (TopLevelModule1.SubModule2) +1->Emitted(132, 17) Source(83, 48) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) +2 >Emitted(132, 13) Source(84, 9) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) +3 >Emitted(132, 14) Source(84, 10) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) +4 >Emitted(132, 16) Source(77, 23) + SourceIndex(0) name (TopLevelModule1.SubModule2) +5 >Emitted(132, 29) Source(77, 36) + SourceIndex(0) name (TopLevelModule1.SubModule2) +6 >Emitted(132, 32) Source(77, 23) + SourceIndex(0) name (TopLevelModule1.SubModule2) +7 >Emitted(132, 56) Source(77, 36) + SourceIndex(0) name (TopLevelModule1.SubModule2) +8 >Emitted(132, 61) Source(77, 23) + SourceIndex(0) name (TopLevelModule1.SubModule2) +9 >Emitted(132, 85) Source(77, 36) + SourceIndex(0) name (TopLevelModule1.SubModule2) +10>Emitted(132, 93) Source(84, 10) + SourceIndex(0) name (TopLevelModule1.SubModule2) --- >>> })(SubModule2 = TopLevelModule1.SubModule2 || (TopLevelModule1.SubModule2 = {})); 1 >^^^^^^^^^^^^ @@ -2475,16 +2466,16 @@ sourceFile:typeResolution.ts > > export interface InterfaceY { YisIn1_2(); } > } -1 >Emitted(136, 13) Source(86, 52) + SourceIndex(0) name (TopLevelModule1.SubModule2) -2 >Emitted(136, 9) Source(87, 5) + SourceIndex(0) name (TopLevelModule1.SubModule2) -3 >Emitted(136, 10) Source(87, 6) + SourceIndex(0) name (TopLevelModule1.SubModule2) -4 >Emitted(136, 12) Source(76, 19) + SourceIndex(0) name (TopLevelModule1) -5 >Emitted(136, 22) Source(76, 29) + SourceIndex(0) name (TopLevelModule1) -6 >Emitted(136, 25) Source(76, 19) + SourceIndex(0) name (TopLevelModule1) -7 >Emitted(136, 51) Source(76, 29) + SourceIndex(0) name (TopLevelModule1) -8 >Emitted(136, 56) Source(76, 19) + SourceIndex(0) name (TopLevelModule1) -9 >Emitted(136, 82) Source(76, 29) + SourceIndex(0) name (TopLevelModule1) -10>Emitted(136, 90) Source(87, 6) + SourceIndex(0) name (TopLevelModule1) +1 >Emitted(133, 13) Source(86, 52) + SourceIndex(0) name (TopLevelModule1.SubModule2) +2 >Emitted(133, 9) Source(87, 5) + SourceIndex(0) name (TopLevelModule1.SubModule2) +3 >Emitted(133, 10) Source(87, 6) + SourceIndex(0) name (TopLevelModule1.SubModule2) +4 >Emitted(133, 12) Source(76, 19) + SourceIndex(0) name (TopLevelModule1) +5 >Emitted(133, 22) Source(76, 29) + SourceIndex(0) name (TopLevelModule1) +6 >Emitted(133, 25) Source(76, 19) + SourceIndex(0) name (TopLevelModule1) +7 >Emitted(133, 51) Source(76, 29) + SourceIndex(0) name (TopLevelModule1) +8 >Emitted(133, 56) Source(76, 19) + SourceIndex(0) name (TopLevelModule1) +9 >Emitted(133, 82) Source(76, 29) + SourceIndex(0) name (TopLevelModule1) +10>Emitted(133, 90) Source(87, 6) + SourceIndex(0) name (TopLevelModule1) --- >>> var ClassA = (function () { 1 >^^^^^^^^ @@ -2492,53 +2483,50 @@ sourceFile:typeResolution.ts 1 > > > -1 >Emitted(137, 9) Source(89, 5) + SourceIndex(0) name (TopLevelModule1) +1 >Emitted(134, 9) Source(89, 5) + SourceIndex(0) name (TopLevelModule1) --- >>> function ClassA() { 1->^^^^^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(138, 13) Source(89, 5) + SourceIndex(0) name (TopLevelModule1.ClassA) +1->Emitted(135, 13) Source(89, 5) + SourceIndex(0) name (TopLevelModule1.ClassA) --- >>> } 1->^^^^^^^^^^^^ 2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1->class ClassA { > public AisIn1() { } > 2 > } -1->Emitted(139, 13) Source(91, 5) + SourceIndex(0) name (TopLevelModule1.ClassA.constructor) -2 >Emitted(139, 14) Source(91, 6) + SourceIndex(0) name (TopLevelModule1.ClassA.constructor) +1->Emitted(136, 13) Source(91, 5) + SourceIndex(0) name (TopLevelModule1.ClassA.constructor) +2 >Emitted(136, 14) Source(91, 6) + SourceIndex(0) name (TopLevelModule1.ClassA.constructor) --- ->>> ClassA.prototype.AisIn1 = function () { +>>> ClassA.prototype.AisIn1 = function () { }; 1->^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^^^ +4 > ^^^^^^^^^^^^^^ +5 > ^ 1-> 2 > AisIn1 3 > -1->Emitted(140, 13) Source(90, 16) + SourceIndex(0) name (TopLevelModule1.ClassA) -2 >Emitted(140, 36) Source(90, 22) + SourceIndex(0) name (TopLevelModule1.ClassA) -3 >Emitted(140, 39) Source(90, 9) + SourceIndex(0) name (TopLevelModule1.ClassA) ---- ->>> }; -1 >^^^^^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^-> -1 >public AisIn1() { -2 > } -1 >Emitted(141, 13) Source(90, 27) + SourceIndex(0) name (TopLevelModule1.ClassA.AisIn1) -2 >Emitted(141, 14) Source(90, 28) + SourceIndex(0) name (TopLevelModule1.ClassA.AisIn1) +4 > public AisIn1() { +5 > } +1->Emitted(137, 13) Source(90, 16) + SourceIndex(0) name (TopLevelModule1.ClassA) +2 >Emitted(137, 36) Source(90, 22) + SourceIndex(0) name (TopLevelModule1.ClassA) +3 >Emitted(137, 39) Source(90, 9) + SourceIndex(0) name (TopLevelModule1.ClassA) +4 >Emitted(137, 53) Source(90, 27) + SourceIndex(0) name (TopLevelModule1.ClassA.AisIn1) +5 >Emitted(137, 54) Source(90, 28) + SourceIndex(0) name (TopLevelModule1.ClassA.AisIn1) --- >>> return ClassA; -1->^^^^^^^^^^^^ +1 >^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^ -1-> +1 > > 2 > } -1->Emitted(142, 13) Source(91, 5) + SourceIndex(0) name (TopLevelModule1.ClassA) -2 >Emitted(142, 26) Source(91, 6) + SourceIndex(0) name (TopLevelModule1.ClassA) +1 >Emitted(138, 13) Source(91, 5) + SourceIndex(0) name (TopLevelModule1.ClassA) +2 >Emitted(138, 26) Source(91, 6) + SourceIndex(0) name (TopLevelModule1.ClassA) --- >>> })(); 1 >^^^^^^^^ @@ -2552,10 +2540,10 @@ sourceFile:typeResolution.ts 4 > class ClassA { > public AisIn1() { } > } -1 >Emitted(143, 9) Source(91, 5) + SourceIndex(0) name (TopLevelModule1.ClassA) -2 >Emitted(143, 10) Source(91, 6) + SourceIndex(0) name (TopLevelModule1.ClassA) -3 >Emitted(143, 10) Source(89, 5) + SourceIndex(0) name (TopLevelModule1) -4 >Emitted(143, 14) Source(91, 6) + SourceIndex(0) name (TopLevelModule1) +1 >Emitted(139, 9) Source(91, 5) + SourceIndex(0) name (TopLevelModule1.ClassA) +2 >Emitted(139, 10) Source(91, 6) + SourceIndex(0) name (TopLevelModule1.ClassA) +3 >Emitted(139, 10) Source(89, 5) + SourceIndex(0) name (TopLevelModule1) +4 >Emitted(139, 14) Source(91, 6) + SourceIndex(0) name (TopLevelModule1) --- >>> var NotExportedModule; 1->^^^^^^^^ @@ -2575,10 +2563,10 @@ sourceFile:typeResolution.ts 4 > { > export class ClassA { } > } -1->Emitted(144, 9) Source(97, 5) + SourceIndex(0) name (TopLevelModule1) -2 >Emitted(144, 13) Source(97, 12) + SourceIndex(0) name (TopLevelModule1) -3 >Emitted(144, 30) Source(97, 29) + SourceIndex(0) name (TopLevelModule1) -4 >Emitted(144, 31) Source(99, 6) + SourceIndex(0) name (TopLevelModule1) +1->Emitted(140, 9) Source(97, 5) + SourceIndex(0) name (TopLevelModule1) +2 >Emitted(140, 13) Source(97, 12) + SourceIndex(0) name (TopLevelModule1) +3 >Emitted(140, 30) Source(97, 29) + SourceIndex(0) name (TopLevelModule1) +4 >Emitted(140, 31) Source(99, 6) + SourceIndex(0) name (TopLevelModule1) --- >>> (function (NotExportedModule) { 1->^^^^^^^^ @@ -2592,24 +2580,24 @@ sourceFile:typeResolution.ts 3 > NotExportedModule 4 > 5 > { -1->Emitted(145, 9) Source(97, 5) + SourceIndex(0) name (TopLevelModule1) -2 >Emitted(145, 20) Source(97, 12) + SourceIndex(0) name (TopLevelModule1) -3 >Emitted(145, 37) Source(97, 29) + SourceIndex(0) name (TopLevelModule1) -4 >Emitted(145, 39) Source(97, 30) + SourceIndex(0) name (TopLevelModule1) -5 >Emitted(145, 40) Source(97, 31) + SourceIndex(0) name (TopLevelModule1) +1->Emitted(141, 9) Source(97, 5) + SourceIndex(0) name (TopLevelModule1) +2 >Emitted(141, 20) Source(97, 12) + SourceIndex(0) name (TopLevelModule1) +3 >Emitted(141, 37) Source(97, 29) + SourceIndex(0) name (TopLevelModule1) +4 >Emitted(141, 39) Source(97, 30) + SourceIndex(0) name (TopLevelModule1) +5 >Emitted(141, 40) Source(97, 31) + SourceIndex(0) name (TopLevelModule1) --- >>> var ClassA = (function () { 1->^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(146, 13) Source(98, 9) + SourceIndex(0) name (TopLevelModule1.NotExportedModule) +1->Emitted(142, 13) Source(98, 9) + SourceIndex(0) name (TopLevelModule1.NotExportedModule) --- >>> function ClassA() { 1->^^^^^^^^^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(147, 17) Source(98, 9) + SourceIndex(0) name (TopLevelModule1.NotExportedModule.ClassA) +1->Emitted(143, 17) Source(98, 9) + SourceIndex(0) name (TopLevelModule1.NotExportedModule.ClassA) --- >>> } 1->^^^^^^^^^^^^^^^^ @@ -2617,16 +2605,16 @@ sourceFile:typeResolution.ts 3 > ^^^^^^^^^^^^^^-> 1->export class ClassA { 2 > } -1->Emitted(148, 17) Source(98, 31) + SourceIndex(0) name (TopLevelModule1.NotExportedModule.ClassA.constructor) -2 >Emitted(148, 18) Source(98, 32) + SourceIndex(0) name (TopLevelModule1.NotExportedModule.ClassA.constructor) +1->Emitted(144, 17) Source(98, 31) + SourceIndex(0) name (TopLevelModule1.NotExportedModule.ClassA.constructor) +2 >Emitted(144, 18) Source(98, 32) + SourceIndex(0) name (TopLevelModule1.NotExportedModule.ClassA.constructor) --- >>> return ClassA; 1->^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^ 1-> 2 > } -1->Emitted(149, 17) Source(98, 31) + SourceIndex(0) name (TopLevelModule1.NotExportedModule.ClassA) -2 >Emitted(149, 30) Source(98, 32) + SourceIndex(0) name (TopLevelModule1.NotExportedModule.ClassA) +1->Emitted(145, 17) Source(98, 31) + SourceIndex(0) name (TopLevelModule1.NotExportedModule.ClassA) +2 >Emitted(145, 30) Source(98, 32) + SourceIndex(0) name (TopLevelModule1.NotExportedModule.ClassA) --- >>> })(); 1 >^^^^^^^^^^^^ @@ -2638,10 +2626,10 @@ sourceFile:typeResolution.ts 2 > } 3 > 4 > export class ClassA { } -1 >Emitted(150, 13) Source(98, 31) + SourceIndex(0) name (TopLevelModule1.NotExportedModule.ClassA) -2 >Emitted(150, 14) Source(98, 32) + SourceIndex(0) name (TopLevelModule1.NotExportedModule.ClassA) -3 >Emitted(150, 14) Source(98, 9) + SourceIndex(0) name (TopLevelModule1.NotExportedModule) -4 >Emitted(150, 18) Source(98, 32) + SourceIndex(0) name (TopLevelModule1.NotExportedModule) +1 >Emitted(146, 13) Source(98, 31) + SourceIndex(0) name (TopLevelModule1.NotExportedModule.ClassA) +2 >Emitted(146, 14) Source(98, 32) + SourceIndex(0) name (TopLevelModule1.NotExportedModule.ClassA) +3 >Emitted(146, 14) Source(98, 9) + SourceIndex(0) name (TopLevelModule1.NotExportedModule) +4 >Emitted(146, 18) Source(98, 32) + SourceIndex(0) name (TopLevelModule1.NotExportedModule) --- >>> NotExportedModule.ClassA = ClassA; 1->^^^^^^^^^^^^ @@ -2653,10 +2641,10 @@ sourceFile:typeResolution.ts 2 > ClassA 3 > { } 4 > -1->Emitted(151, 13) Source(98, 22) + SourceIndex(0) name (TopLevelModule1.NotExportedModule) -2 >Emitted(151, 37) Source(98, 28) + SourceIndex(0) name (TopLevelModule1.NotExportedModule) -3 >Emitted(151, 46) Source(98, 32) + SourceIndex(0) name (TopLevelModule1.NotExportedModule) -4 >Emitted(151, 47) Source(98, 32) + SourceIndex(0) name (TopLevelModule1.NotExportedModule) +1->Emitted(147, 13) Source(98, 22) + SourceIndex(0) name (TopLevelModule1.NotExportedModule) +2 >Emitted(147, 37) Source(98, 28) + SourceIndex(0) name (TopLevelModule1.NotExportedModule) +3 >Emitted(147, 46) Source(98, 32) + SourceIndex(0) name (TopLevelModule1.NotExportedModule) +4 >Emitted(147, 47) Source(98, 32) + SourceIndex(0) name (TopLevelModule1.NotExportedModule) --- >>> })(NotExportedModule || (NotExportedModule = {})); 1->^^^^^^^^ @@ -2677,13 +2665,13 @@ sourceFile:typeResolution.ts 7 > { > export class ClassA { } > } -1->Emitted(152, 9) Source(99, 5) + SourceIndex(0) name (TopLevelModule1.NotExportedModule) -2 >Emitted(152, 10) Source(99, 6) + SourceIndex(0) name (TopLevelModule1.NotExportedModule) -3 >Emitted(152, 12) Source(97, 12) + SourceIndex(0) name (TopLevelModule1) -4 >Emitted(152, 29) Source(97, 29) + SourceIndex(0) name (TopLevelModule1) -5 >Emitted(152, 34) Source(97, 12) + SourceIndex(0) name (TopLevelModule1) -6 >Emitted(152, 51) Source(97, 29) + SourceIndex(0) name (TopLevelModule1) -7 >Emitted(152, 59) Source(99, 6) + SourceIndex(0) name (TopLevelModule1) +1->Emitted(148, 9) Source(99, 5) + SourceIndex(0) name (TopLevelModule1.NotExportedModule) +2 >Emitted(148, 10) Source(99, 6) + SourceIndex(0) name (TopLevelModule1.NotExportedModule) +3 >Emitted(148, 12) Source(97, 12) + SourceIndex(0) name (TopLevelModule1) +4 >Emitted(148, 29) Source(97, 29) + SourceIndex(0) name (TopLevelModule1) +5 >Emitted(148, 34) Source(97, 12) + SourceIndex(0) name (TopLevelModule1) +6 >Emitted(148, 51) Source(97, 29) + SourceIndex(0) name (TopLevelModule1) +7 >Emitted(148, 59) Source(99, 6) + SourceIndex(0) name (TopLevelModule1) --- >>> })(TopLevelModule1 = exports.TopLevelModule1 || (exports.TopLevelModule1 = {})); 1->^^^^ @@ -2804,15 +2792,15 @@ sourceFile:typeResolution.ts > export class ClassA { } > } > } -1->Emitted(153, 5) Source(100, 1) + SourceIndex(0) name (TopLevelModule1) -2 >Emitted(153, 6) Source(100, 2) + SourceIndex(0) name (TopLevelModule1) -3 >Emitted(153, 8) Source(1, 15) + SourceIndex(0) -4 >Emitted(153, 23) Source(1, 30) + SourceIndex(0) -5 >Emitted(153, 26) Source(1, 15) + SourceIndex(0) -6 >Emitted(153, 49) Source(1, 30) + SourceIndex(0) -7 >Emitted(153, 54) Source(1, 15) + SourceIndex(0) -8 >Emitted(153, 77) Source(1, 30) + SourceIndex(0) -9 >Emitted(153, 85) Source(100, 2) + SourceIndex(0) +1->Emitted(149, 5) Source(100, 1) + SourceIndex(0) name (TopLevelModule1) +2 >Emitted(149, 6) Source(100, 2) + SourceIndex(0) name (TopLevelModule1) +3 >Emitted(149, 8) Source(1, 15) + SourceIndex(0) +4 >Emitted(149, 23) Source(1, 30) + SourceIndex(0) +5 >Emitted(149, 26) Source(1, 15) + SourceIndex(0) +6 >Emitted(149, 49) Source(1, 30) + SourceIndex(0) +7 >Emitted(149, 54) Source(1, 15) + SourceIndex(0) +8 >Emitted(149, 77) Source(1, 30) + SourceIndex(0) +9 >Emitted(149, 85) Source(100, 2) + SourceIndex(0) --- >>> var TopLevelModule2; 1 >^^^^ @@ -2832,10 +2820,10 @@ sourceFile:typeResolution.ts > } > } > } -1 >Emitted(154, 5) Source(102, 1) + SourceIndex(0) -2 >Emitted(154, 9) Source(102, 8) + SourceIndex(0) -3 >Emitted(154, 24) Source(102, 23) + SourceIndex(0) -4 >Emitted(154, 25) Source(108, 2) + SourceIndex(0) +1 >Emitted(150, 5) Source(102, 1) + SourceIndex(0) +2 >Emitted(150, 9) Source(102, 8) + SourceIndex(0) +3 >Emitted(150, 24) Source(102, 23) + SourceIndex(0) +4 >Emitted(150, 25) Source(108, 2) + SourceIndex(0) --- >>> (function (TopLevelModule2) { 1->^^^^ @@ -2848,11 +2836,11 @@ sourceFile:typeResolution.ts 3 > TopLevelModule2 4 > 5 > { -1->Emitted(155, 5) Source(102, 1) + SourceIndex(0) -2 >Emitted(155, 16) Source(102, 8) + SourceIndex(0) -3 >Emitted(155, 31) Source(102, 23) + SourceIndex(0) -4 >Emitted(155, 33) Source(102, 24) + SourceIndex(0) -5 >Emitted(155, 34) Source(102, 25) + SourceIndex(0) +1->Emitted(151, 5) Source(102, 1) + SourceIndex(0) +2 >Emitted(151, 16) Source(102, 8) + SourceIndex(0) +3 >Emitted(151, 31) Source(102, 23) + SourceIndex(0) +4 >Emitted(151, 33) Source(102, 24) + SourceIndex(0) +5 >Emitted(151, 34) Source(102, 25) + SourceIndex(0) --- >>> var SubModule3; 1 >^^^^^^^^ @@ -2869,10 +2857,10 @@ sourceFile:typeResolution.ts > public AisIn2_3() { } > } > } -1 >Emitted(156, 9) Source(103, 5) + SourceIndex(0) name (TopLevelModule2) -2 >Emitted(156, 13) Source(103, 19) + SourceIndex(0) name (TopLevelModule2) -3 >Emitted(156, 23) Source(103, 29) + SourceIndex(0) name (TopLevelModule2) -4 >Emitted(156, 24) Source(107, 6) + SourceIndex(0) name (TopLevelModule2) +1 >Emitted(152, 9) Source(103, 5) + SourceIndex(0) name (TopLevelModule2) +2 >Emitted(152, 13) Source(103, 19) + SourceIndex(0) name (TopLevelModule2) +3 >Emitted(152, 23) Source(103, 29) + SourceIndex(0) name (TopLevelModule2) +4 >Emitted(152, 24) Source(107, 6) + SourceIndex(0) name (TopLevelModule2) --- >>> (function (SubModule3) { 1->^^^^^^^^ @@ -2886,64 +2874,61 @@ sourceFile:typeResolution.ts 3 > SubModule3 4 > 5 > { -1->Emitted(157, 9) Source(103, 5) + SourceIndex(0) name (TopLevelModule2) -2 >Emitted(157, 20) Source(103, 19) + SourceIndex(0) name (TopLevelModule2) -3 >Emitted(157, 30) Source(103, 29) + SourceIndex(0) name (TopLevelModule2) -4 >Emitted(157, 32) Source(103, 30) + SourceIndex(0) name (TopLevelModule2) -5 >Emitted(157, 33) Source(103, 31) + SourceIndex(0) name (TopLevelModule2) +1->Emitted(153, 9) Source(103, 5) + SourceIndex(0) name (TopLevelModule2) +2 >Emitted(153, 20) Source(103, 19) + SourceIndex(0) name (TopLevelModule2) +3 >Emitted(153, 30) Source(103, 29) + SourceIndex(0) name (TopLevelModule2) +4 >Emitted(153, 32) Source(103, 30) + SourceIndex(0) name (TopLevelModule2) +5 >Emitted(153, 33) Source(103, 31) + SourceIndex(0) name (TopLevelModule2) --- >>> var ClassA = (function () { 1->^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(158, 13) Source(104, 9) + SourceIndex(0) name (TopLevelModule2.SubModule3) +1->Emitted(154, 13) Source(104, 9) + SourceIndex(0) name (TopLevelModule2.SubModule3) --- >>> function ClassA() { 1->^^^^^^^^^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(159, 17) Source(104, 9) + SourceIndex(0) name (TopLevelModule2.SubModule3.ClassA) +1->Emitted(155, 17) Source(104, 9) + SourceIndex(0) name (TopLevelModule2.SubModule3.ClassA) --- >>> } 1->^^^^^^^^^^^^^^^^ 2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1->export class ClassA { > public AisIn2_3() { } > 2 > } -1->Emitted(160, 17) Source(106, 9) + SourceIndex(0) name (TopLevelModule2.SubModule3.ClassA.constructor) -2 >Emitted(160, 18) Source(106, 10) + SourceIndex(0) name (TopLevelModule2.SubModule3.ClassA.constructor) +1->Emitted(156, 17) Source(106, 9) + SourceIndex(0) name (TopLevelModule2.SubModule3.ClassA.constructor) +2 >Emitted(156, 18) Source(106, 10) + SourceIndex(0) name (TopLevelModule2.SubModule3.ClassA.constructor) --- ->>> ClassA.prototype.AisIn2_3 = function () { +>>> ClassA.prototype.AisIn2_3 = function () { }; 1->^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^^^ +4 > ^^^^^^^^^^^^^^ +5 > ^ 1-> 2 > AisIn2_3 3 > -1->Emitted(161, 17) Source(105, 20) + SourceIndex(0) name (TopLevelModule2.SubModule3.ClassA) -2 >Emitted(161, 42) Source(105, 28) + SourceIndex(0) name (TopLevelModule2.SubModule3.ClassA) -3 >Emitted(161, 45) Source(105, 13) + SourceIndex(0) name (TopLevelModule2.SubModule3.ClassA) ---- ->>> }; -1 >^^^^^^^^^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^-> -1 >public AisIn2_3() { -2 > } -1 >Emitted(162, 17) Source(105, 33) + SourceIndex(0) name (TopLevelModule2.SubModule3.ClassA.AisIn2_3) -2 >Emitted(162, 18) Source(105, 34) + SourceIndex(0) name (TopLevelModule2.SubModule3.ClassA.AisIn2_3) +4 > public AisIn2_3() { +5 > } +1->Emitted(157, 17) Source(105, 20) + SourceIndex(0) name (TopLevelModule2.SubModule3.ClassA) +2 >Emitted(157, 42) Source(105, 28) + SourceIndex(0) name (TopLevelModule2.SubModule3.ClassA) +3 >Emitted(157, 45) Source(105, 13) + SourceIndex(0) name (TopLevelModule2.SubModule3.ClassA) +4 >Emitted(157, 59) Source(105, 33) + SourceIndex(0) name (TopLevelModule2.SubModule3.ClassA.AisIn2_3) +5 >Emitted(157, 60) Source(105, 34) + SourceIndex(0) name (TopLevelModule2.SubModule3.ClassA.AisIn2_3) --- >>> return ClassA; -1->^^^^^^^^^^^^^^^^ +1 >^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^ -1-> +1 > > 2 > } -1->Emitted(163, 17) Source(106, 9) + SourceIndex(0) name (TopLevelModule2.SubModule3.ClassA) -2 >Emitted(163, 30) Source(106, 10) + SourceIndex(0) name (TopLevelModule2.SubModule3.ClassA) +1 >Emitted(158, 17) Source(106, 9) + SourceIndex(0) name (TopLevelModule2.SubModule3.ClassA) +2 >Emitted(158, 30) Source(106, 10) + SourceIndex(0) name (TopLevelModule2.SubModule3.ClassA) --- >>> })(); 1 >^^^^^^^^^^^^ @@ -2957,10 +2942,10 @@ sourceFile:typeResolution.ts 4 > export class ClassA { > public AisIn2_3() { } > } -1 >Emitted(164, 13) Source(106, 9) + SourceIndex(0) name (TopLevelModule2.SubModule3.ClassA) -2 >Emitted(164, 14) Source(106, 10) + SourceIndex(0) name (TopLevelModule2.SubModule3.ClassA) -3 >Emitted(164, 14) Source(104, 9) + SourceIndex(0) name (TopLevelModule2.SubModule3) -4 >Emitted(164, 18) Source(106, 10) + SourceIndex(0) name (TopLevelModule2.SubModule3) +1 >Emitted(159, 13) Source(106, 9) + SourceIndex(0) name (TopLevelModule2.SubModule3.ClassA) +2 >Emitted(159, 14) Source(106, 10) + SourceIndex(0) name (TopLevelModule2.SubModule3.ClassA) +3 >Emitted(159, 14) Source(104, 9) + SourceIndex(0) name (TopLevelModule2.SubModule3) +4 >Emitted(159, 18) Source(106, 10) + SourceIndex(0) name (TopLevelModule2.SubModule3) --- >>> SubModule3.ClassA = ClassA; 1->^^^^^^^^^^^^ @@ -2974,10 +2959,10 @@ sourceFile:typeResolution.ts > public AisIn2_3() { } > } 4 > -1->Emitted(165, 13) Source(104, 22) + SourceIndex(0) name (TopLevelModule2.SubModule3) -2 >Emitted(165, 30) Source(104, 28) + SourceIndex(0) name (TopLevelModule2.SubModule3) -3 >Emitted(165, 39) Source(106, 10) + SourceIndex(0) name (TopLevelModule2.SubModule3) -4 >Emitted(165, 40) Source(106, 10) + SourceIndex(0) name (TopLevelModule2.SubModule3) +1->Emitted(160, 13) Source(104, 22) + SourceIndex(0) name (TopLevelModule2.SubModule3) +2 >Emitted(160, 30) Source(104, 28) + SourceIndex(0) name (TopLevelModule2.SubModule3) +3 >Emitted(160, 39) Source(106, 10) + SourceIndex(0) name (TopLevelModule2.SubModule3) +4 >Emitted(160, 40) Source(106, 10) + SourceIndex(0) name (TopLevelModule2.SubModule3) --- >>> })(SubModule3 = TopLevelModule2.SubModule3 || (TopLevelModule2.SubModule3 = {})); 1->^^^^^^^^ @@ -3003,15 +2988,15 @@ sourceFile:typeResolution.ts > public AisIn2_3() { } > } > } -1->Emitted(166, 9) Source(107, 5) + SourceIndex(0) name (TopLevelModule2.SubModule3) -2 >Emitted(166, 10) Source(107, 6) + SourceIndex(0) name (TopLevelModule2.SubModule3) -3 >Emitted(166, 12) Source(103, 19) + SourceIndex(0) name (TopLevelModule2) -4 >Emitted(166, 22) Source(103, 29) + SourceIndex(0) name (TopLevelModule2) -5 >Emitted(166, 25) Source(103, 19) + SourceIndex(0) name (TopLevelModule2) -6 >Emitted(166, 51) Source(103, 29) + SourceIndex(0) name (TopLevelModule2) -7 >Emitted(166, 56) Source(103, 19) + SourceIndex(0) name (TopLevelModule2) -8 >Emitted(166, 82) Source(103, 29) + SourceIndex(0) name (TopLevelModule2) -9 >Emitted(166, 90) Source(107, 6) + SourceIndex(0) name (TopLevelModule2) +1->Emitted(161, 9) Source(107, 5) + SourceIndex(0) name (TopLevelModule2.SubModule3) +2 >Emitted(161, 10) Source(107, 6) + SourceIndex(0) name (TopLevelModule2.SubModule3) +3 >Emitted(161, 12) Source(103, 19) + SourceIndex(0) name (TopLevelModule2) +4 >Emitted(161, 22) Source(103, 29) + SourceIndex(0) name (TopLevelModule2) +5 >Emitted(161, 25) Source(103, 19) + SourceIndex(0) name (TopLevelModule2) +6 >Emitted(161, 51) Source(103, 29) + SourceIndex(0) name (TopLevelModule2) +7 >Emitted(161, 56) Source(103, 19) + SourceIndex(0) name (TopLevelModule2) +8 >Emitted(161, 82) Source(103, 29) + SourceIndex(0) name (TopLevelModule2) +9 >Emitted(161, 90) Source(107, 6) + SourceIndex(0) name (TopLevelModule2) --- >>> })(TopLevelModule2 || (TopLevelModule2 = {})); 1 >^^^^ @@ -3035,13 +3020,13 @@ sourceFile:typeResolution.ts > } > } > } -1 >Emitted(167, 5) Source(108, 1) + SourceIndex(0) name (TopLevelModule2) -2 >Emitted(167, 6) Source(108, 2) + SourceIndex(0) name (TopLevelModule2) -3 >Emitted(167, 8) Source(102, 8) + SourceIndex(0) -4 >Emitted(167, 23) Source(102, 23) + SourceIndex(0) -5 >Emitted(167, 28) Source(102, 8) + SourceIndex(0) -6 >Emitted(167, 43) Source(102, 23) + SourceIndex(0) -7 >Emitted(167, 51) Source(108, 2) + SourceIndex(0) +1 >Emitted(162, 5) Source(108, 1) + SourceIndex(0) name (TopLevelModule2) +2 >Emitted(162, 6) Source(108, 2) + SourceIndex(0) name (TopLevelModule2) +3 >Emitted(162, 8) Source(102, 8) + SourceIndex(0) +4 >Emitted(162, 23) Source(102, 23) + SourceIndex(0) +5 >Emitted(162, 28) Source(102, 8) + SourceIndex(0) +6 >Emitted(162, 43) Source(102, 23) + SourceIndex(0) +7 >Emitted(162, 51) Source(108, 2) + SourceIndex(0) --- >>>}); >>>//# sourceMappingURL=typeResolution.js.map \ No newline at end of file diff --git a/tests/baselines/reference/typeVal.js b/tests/baselines/reference/typeVal.js index 7c1d506fbdc..264b40c5f16 100644 --- a/tests/baselines/reference/typeVal.js +++ b/tests/baselines/reference/typeVal.js @@ -9,7 +9,5 @@ I.I=4; //// [typeVal.js] -var I = { - I: 3 -}; +var I = { I: 3 }; I.I = 4; diff --git a/tests/baselines/reference/typedGenericPrototypeMember.js b/tests/baselines/reference/typedGenericPrototypeMember.js index 866bf500ded..e5ba2e0e75f 100644 --- a/tests/baselines/reference/typedGenericPrototypeMember.js +++ b/tests/baselines/reference/typedGenericPrototypeMember.js @@ -10,8 +10,7 @@ List.prototype.add("abc"); // Valid because T is instantiated to any var List = (function () { function List() { } - List.prototype.add = function (item) { - }; + List.prototype.add = function (item) { }; return List; })(); List.prototype.add("abc"); // Valid because T is instantiated to any diff --git a/tests/baselines/reference/typeofANonExportedType.js b/tests/baselines/reference/typeofANonExportedType.js index 7ce08d5f93a..bb41ddfab7a 100644 --- a/tests/baselines/reference/typeofANonExportedType.js +++ b/tests/baselines/reference/typeofANonExportedType.js @@ -54,9 +54,7 @@ export var r13: typeof foo; //// [typeofANonExportedType.js] var x = 1; exports.r1; -var y = { - foo: '' -}; +var y = { foo: '' }; exports.r2; var C = (function () { function C() { @@ -93,8 +91,7 @@ var E; exports.r10; exports.r11; exports.r12; -function foo() { -} +function foo() { } var foo; (function (foo) { foo.y = 1; diff --git a/tests/baselines/reference/typeofAnExportedType.js b/tests/baselines/reference/typeofAnExportedType.js index 20a0fe754e2..af6c405a3cf 100644 --- a/tests/baselines/reference/typeofAnExportedType.js +++ b/tests/baselines/reference/typeofAnExportedType.js @@ -54,9 +54,7 @@ export var r13: typeof foo; //// [typeofAnExportedType.js] exports.x = 1; exports.r1; -exports.y = { - foo: '' -}; +exports.y = { foo: '' }; exports.r2; var C = (function () { function C() { @@ -95,8 +93,7 @@ var E = exports.E; exports.r10; exports.r11; exports.r12; -function foo() { -} +function foo() { } exports.foo = foo; var foo; (function (foo) { diff --git a/tests/baselines/reference/typeofClass2.js b/tests/baselines/reference/typeofClass2.js index cbad0068372..1cef22bf2eb 100644 --- a/tests/baselines/reference/typeofClass2.js +++ b/tests/baselines/reference/typeofClass2.js @@ -31,10 +31,8 @@ var __extends = this.__extends || function (d, b) { var C = (function () { function C(x) { } - C.foo = function (x) { - }; - C.bar = function (x) { - }; + C.foo = function (x) { }; + C.bar = function (x) { }; return C; })(); var D = (function (_super) { @@ -42,10 +40,8 @@ var D = (function (_super) { function D() { _super.apply(this, arguments); } - D.baz = function (x) { - }; - D.prototype.foo = function () { - }; + D.baz = function (x) { }; + D.prototype.foo = function () { }; return D; })(C); var d; diff --git a/tests/baselines/reference/typeofInterface.js b/tests/baselines/reference/typeofInterface.js index 49e194db7fe..1f0bf72eebe 100644 --- a/tests/baselines/reference/typeofInterface.js +++ b/tests/baselines/reference/typeofInterface.js @@ -12,6 +12,4 @@ var j: typeof k.foo = { a: "hello" }; //// [typeofInterface.js] var I; var k; -var j = { - a: "hello" -}; +var j = { a: "hello" }; diff --git a/tests/baselines/reference/typeofOperatorWithAnyOtherType.js b/tests/baselines/reference/typeofOperatorWithAnyOtherType.js index 422d49ae11e..a497519f249 100644 --- a/tests/baselines/reference/typeofOperatorWithAnyOtherType.js +++ b/tests/baselines/reference/typeofOperatorWithAnyOtherType.js @@ -78,16 +78,9 @@ z: typeof obj1.x; // typeof operator on any type var ANY; var ANY1; -var ANY2 = [ - "", - "" -]; +var ANY2 = ["", ""]; var obj; -var obj1 = { - x: "a", - y: function () { - } -}; +var obj1 = { x: "a", y: function () { } }; function foo() { var a; return a; diff --git a/tests/baselines/reference/typeofOperatorWithBooleanType.js b/tests/baselines/reference/typeofOperatorWithBooleanType.js index 884371f9440..82af3eac26f 100644 --- a/tests/baselines/reference/typeofOperatorWithBooleanType.js +++ b/tests/baselines/reference/typeofOperatorWithBooleanType.js @@ -53,15 +53,11 @@ z: typeof M.n; //// [typeofOperatorWithBooleanType.js] // typeof operator on boolean type var BOOLEAN; -function foo() { - return true; -} +function foo() { return true; } var A = (function () { function A() { } - A.foo = function () { - return false; - }; + A.foo = function () { return false; }; return A; })(); var M; @@ -73,10 +69,7 @@ var objA = new A(); var ResultIsString1 = typeof BOOLEAN; // boolean type literal var ResultIsString2 = typeof true; -var ResultIsString3 = typeof { - x: true, - y: false -}; +var ResultIsString3 = typeof { x: true, y: false }; // boolean type expressions var ResultIsString4 = typeof objA.a; var ResultIsString5 = typeof M.n; @@ -97,10 +90,7 @@ var x; var r; z: typeof BOOLEAN; r: typeof foo; -var y = { - a: true, - b: false -}; +var y = { a: true, b: false }; z: typeof y.a; z: typeof objA.a; z: typeof A.foo; diff --git a/tests/baselines/reference/typeofOperatorWithNumberType.js b/tests/baselines/reference/typeofOperatorWithNumberType.js index 51e657e4019..14b45ab518f 100644 --- a/tests/baselines/reference/typeofOperatorWithNumberType.js +++ b/tests/baselines/reference/typeofOperatorWithNumberType.js @@ -60,19 +60,12 @@ z: typeof M.n; //// [typeofOperatorWithNumberType.js] // typeof operator on number type var NUMBER; -var NUMBER1 = [ - 1, - 2 -]; -function foo() { - return 1; -} +var NUMBER1 = [1, 2]; +function foo() { return 1; } var A = (function () { function A() { } - A.foo = function () { - return 1; - }; + A.foo = function () { return 1; }; return A; })(); var M; @@ -85,16 +78,8 @@ var ResultIsString1 = typeof NUMBER; var ResultIsString2 = typeof NUMBER1; // number type literal var ResultIsString3 = typeof 1; -var ResultIsString4 = typeof { - x: 1, - y: 2 -}; -var ResultIsString5 = typeof { - x: 1, - y: function (n) { - return n; - } -}; +var ResultIsString4 = typeof { x: 1, y: 2 }; +var ResultIsString5 = typeof { x: 1, y: function (n) { return n; } }; // number type expressions var ResultIsString6 = typeof objA.a; var ResultIsString7 = typeof M.n; @@ -119,10 +104,7 @@ var x; z: typeof NUMBER; x: typeof NUMBER1; r: typeof foo; -var y = { - a: 1, - b: 2 -}; +var y = { a: 1, b: 2 }; z: typeof y.a; z: typeof objA.a; z: typeof A.foo; diff --git a/tests/baselines/reference/typeofOperatorWithStringType.js b/tests/baselines/reference/typeofOperatorWithStringType.js index d5272844520..381205ff8c1 100644 --- a/tests/baselines/reference/typeofOperatorWithStringType.js +++ b/tests/baselines/reference/typeofOperatorWithStringType.js @@ -60,19 +60,12 @@ z: typeof M.n; //// [typeofOperatorWithStringType.js] // typeof operator on string type var STRING; -var STRING1 = [ - "", - "abc" -]; -function foo() { - return "abc"; -} +var STRING1 = ["", "abc"]; +function foo() { return "abc"; } var A = (function () { function A() { } - A.foo = function () { - return ""; - }; + A.foo = function () { return ""; }; return A; })(); var M; @@ -85,16 +78,8 @@ var ResultIsString1 = typeof STRING; var ResultIsString2 = typeof STRING1; // string type literal var ResultIsString3 = typeof ""; -var ResultIsString4 = typeof { - x: "", - y: "" -}; -var ResultIsString5 = typeof { - x: "", - y: function (s) { - return s; - } -}; +var ResultIsString4 = typeof { x: "", y: "" }; +var ResultIsString5 = typeof { x: "", y: function (s) { return s; } }; // string type expressions var ResultIsString6 = typeof objA.a; var ResultIsString7 = typeof M.n; @@ -119,10 +104,7 @@ var r; z: typeof STRING; x: typeof STRING1; r: typeof foo; -var y = { - a: "", - b: "" -}; +var y = { a: "", b: "" }; z: typeof y.a; z: typeof objA.a; z: typeof A.foo; diff --git a/tests/baselines/reference/typesWithDuplicateTypeParameters.js b/tests/baselines/reference/typesWithDuplicateTypeParameters.js index f81f59d5307..cc80d4d57b4 100644 --- a/tests/baselines/reference/typesWithDuplicateTypeParameters.js +++ b/tests/baselines/reference/typesWithDuplicateTypeParameters.js @@ -19,7 +19,5 @@ var C2 = (function () { } return C2; })(); -function f() { -} -function f2() { -} +function f() { } +function f2() { } diff --git a/tests/baselines/reference/typesWithOptionalProperty.js b/tests/baselines/reference/typesWithOptionalProperty.js index 2056fab37e3..7c791cd599f 100644 --- a/tests/baselines/reference/typesWithOptionalProperty.js +++ b/tests/baselines/reference/typesWithOptionalProperty.js @@ -33,20 +33,9 @@ a = i; //// [typesWithOptionalProperty.js] // basic uses of optional properties without errors var a; -var b = { - foo: '' -}; -var c = { - foo: '', - bar: 3 -}; -var d = { - foo: '', - bar: 3, - baz: function () { - return ''; - } -}; +var b = { foo: '' }; +var c = { foo: '', bar: 3 }; +var d = { foo: '', bar: 3, baz: function () { return ''; } }; var i; i = b; i = c; diff --git a/tests/baselines/reference/uncaughtCompilerError1.js b/tests/baselines/reference/uncaughtCompilerError1.js index 39369c8e899..a09f8c949d5 100644 --- a/tests/baselines/reference/uncaughtCompilerError1.js +++ b/tests/baselines/reference/uncaughtCompilerError1.js @@ -18,16 +18,10 @@ function f() { function f() { if (lineTokens[index].trim() === '=' && index > 0 && token.type === '' && tokens[index - 1].type === 'attribute.name.html') { if (index === (tokens.length - 1)) { - return { - appendText: '\"\"', - advanceCount: 1 - }; + return { appendText: '\"\"', advanceCount: 1 }; } else if (tokens[index + 1].type !== 'attribute.value.html' && tokens[index + 1].type !== '') { - return { - appendText: '\"\"', - advanceCount: 1 - }; + return { appendText: '\"\"', advanceCount: 1 }; } return null; } diff --git a/tests/baselines/reference/undeclaredMethod.js b/tests/baselines/reference/undeclaredMethod.js index b2795938632..2cef06cc593 100644 --- a/tests/baselines/reference/undeclaredMethod.js +++ b/tests/baselines/reference/undeclaredMethod.js @@ -19,8 +19,7 @@ var M; var C = (function () { function C() { } - C.prototype.salt = function () { - }; + C.prototype.salt = function () { }; return C; })(); M.C = C; diff --git a/tests/baselines/reference/undeclaredModuleError.js b/tests/baselines/reference/undeclaredModuleError.js index e7e9b70ee7b..0764840cadf 100644 --- a/tests/baselines/reference/undeclaredModuleError.js +++ b/tests/baselines/reference/undeclaredModuleError.js @@ -17,8 +17,7 @@ function instrumentFile(covFileDir: string, covFileName: string, originalFilePat //// [undeclaredModuleError.js] define(["require", "exports", 'fs'], function (require, exports, fs) { - function readdir(path, accept, callback) { - } + function readdir(path, accept, callback) { } function join() { var paths = []; for (var _i = 0; _i < arguments.length; _i++) { diff --git a/tests/baselines/reference/undefinedArgumentInference.js b/tests/baselines/reference/undefinedArgumentInference.js index ad74e9ebeb4..2e7501f23f0 100644 --- a/tests/baselines/reference/undefinedArgumentInference.js +++ b/tests/baselines/reference/undefinedArgumentInference.js @@ -12,7 +12,4 @@ var z1 = foo1({ x: undefined, y: undefined }); function foo1(f1) { return undefined; } -var z1 = foo1({ - x: undefined, - y: undefined -}); +var z1 = foo1({ x: undefined, y: undefined }); diff --git a/tests/baselines/reference/undefinedIsSubtypeOfEverything.js b/tests/baselines/reference/undefinedIsSubtypeOfEverything.js index df87e7b0ad6..b1ef3e19edd 100644 --- a/tests/baselines/reference/undefinedIsSubtypeOfEverything.js +++ b/tests/baselines/reference/undefinedIsSubtypeOfEverything.js @@ -250,8 +250,7 @@ var D11 = (function (_super) { } return D11; })(Base); -function f() { -} +function f() { } var f; (function (f) { f.bar = 1; diff --git a/tests/baselines/reference/undefinedSymbolReferencedInArrayLiteral1.js b/tests/baselines/reference/undefinedSymbolReferencedInArrayLiteral1.js index 61f248e56e7..f314f9ad111 100644 --- a/tests/baselines/reference/undefinedSymbolReferencedInArrayLiteral1.js +++ b/tests/baselines/reference/undefinedSymbolReferencedInArrayLiteral1.js @@ -9,18 +9,8 @@ var functions = [function() { //// [undefinedSymbolReferencedInArrayLiteral1.js] -var tokens = [ - { - startIndex: deltaOffset - } -]; -var functions = [ - function () { - [ - 1, - 2, - 3 - ].NonexistantMethod(); +var tokens = [{ startIndex: deltaOffset }]; +var functions = [function () { + [1, 2, 3].NonexistantMethod(); anotherNonExistingMethod(); - } -]; + }]; diff --git a/tests/baselines/reference/underscoreTest1.js b/tests/baselines/reference/underscoreTest1.js index bc6bf9b615a..ddd5201b858 100644 --- a/tests/baselines/reference/underscoreTest1.js +++ b/tests/baselines/reference/underscoreTest1.js @@ -904,428 +904,73 @@ _.template("Using 'with': <%= data.answer %>", { answer: 'no' }, { variable: 'da //// [underscoreTest1_underscore.js] //// [underscoreTest1_underscoreTests.js] /// -_.each([ - 1, - 2, - 3 -], function (num) { - return alert(num.toString()); -}); -_.each({ - one: 1, - two: 2, - three: 3 -}, function (value, key) { - return alert(value.toString()); -}); -_.map([ - 1, - 2, - 3 -], function (num) { - return num * 3; -}); -_.map({ - one: 1, - two: 2, - three: 3 -}, function (value, key) { - return value * 3; -}); -var sum = _.reduce([ - 1, - 2, - 3 -], function (memo, num) { - return memo + num; -}, 0); -var list = [ - [ - 0, - 1 - ], - [ - 2, - 3 - ], - [ - 4, - 5 - ] -]; -var flat = _.reduceRight(list, function (a, b) { - return a.concat(b); -}, []); -var even = _.find([ - 1, - 2, - 3, - 4, - 5, - 6 -], function (num) { - return num % 2 == 0; -}); -var evens = _.filter([ - 1, - 2, - 3, - 4, - 5, - 6 -], function (num) { - return num % 2 == 0; -}); -var listOfPlays = [ - { - title: "Cymbeline", - author: "Shakespeare", - year: 1611 - }, - { - title: "The Tempest", - author: "Shakespeare", - year: 1611 - }, - { - title: "Other", - author: "Not Shakespeare", - year: 2012 - } -]; -_.where(listOfPlays, { - author: "Shakespeare", - year: 1611 -}); -var odds = _.reject([ - 1, - 2, - 3, - 4, - 5, - 6 -], function (num) { - return num % 2 == 0; -}); -_.all([ - true, - 1, - null, - 'yes' -], _.identity); -_.any([ - null, - 0, - 'yes', - false -]); -_.contains([ - 1, - 2, - 3 -], 3); -_.invoke([ - [ - 5, - 1, - 7 - ], - [ - 3, - 2, - 1 - ] -], 'sort'); -var stooges = [ - { - name: 'moe', - age: 40 - }, - { - name: 'larry', - age: 50 - }, - { - name: 'curly', - age: 60 - } -]; +_.each([1, 2, 3], function (num) { return alert(num.toString()); }); +_.each({ one: 1, two: 2, three: 3 }, function (value, key) { return alert(value.toString()); }); +_.map([1, 2, 3], function (num) { return num * 3; }); +_.map({ one: 1, two: 2, three: 3 }, function (value, key) { return value * 3; }); +var sum = _.reduce([1, 2, 3], function (memo, num) { return memo + num; }, 0); +var list = [[0, 1], [2, 3], [4, 5]]; +var flat = _.reduceRight(list, function (a, b) { return a.concat(b); }, []); +var even = _.find([1, 2, 3, 4, 5, 6], function (num) { return num % 2 == 0; }); +var evens = _.filter([1, 2, 3, 4, 5, 6], function (num) { return num % 2 == 0; }); +var listOfPlays = [{ title: "Cymbeline", author: "Shakespeare", year: 1611 }, { title: "The Tempest", author: "Shakespeare", year: 1611 }, { title: "Other", author: "Not Shakespeare", year: 2012 }]; +_.where(listOfPlays, { author: "Shakespeare", year: 1611 }); +var odds = _.reject([1, 2, 3, 4, 5, 6], function (num) { return num % 2 == 0; }); +_.all([true, 1, null, 'yes'], _.identity); +_.any([null, 0, 'yes', false]); +_.contains([1, 2, 3], 3); +_.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); +var stooges = [{ name: 'moe', age: 40 }, { name: 'larry', age: 50 }, { name: 'curly', age: 60 }]; _.pluck(stooges, 'name'); -_.max(stooges, function (stooge) { - return stooge.age; -}); -var numbers = [ - 10, - 5, - 100, - 2, - 1000 -]; +_.max(stooges, function (stooge) { return stooge.age; }); +var numbers = [10, 5, 100, 2, 1000]; _.min(numbers); -_.sortBy([ - 1, - 2, - 3, - 4, - 5, - 6 -], function (num) { - return Math.sin(num); -}); +_.sortBy([1, 2, 3, 4, 5, 6], function (num) { return Math.sin(num); }); // not sure how this is typechecking at all.. Math.floor(e) is number not string..? -_([ - 1.3, - 2.1, - 2.4 -]).groupBy(function (e, i, list) { - return Math.floor(e); -}); -_.groupBy([ - 1.3, - 2.1, - 2.4 -], function (num) { - return Math.floor(num); -}); -_.groupBy([ - 'one', - 'two', - 'three' -], 'length'); -_.countBy([ - 1, - 2, - 3, - 4, - 5 -], function (num) { - return num % 2 == 0 ? 'even' : 'odd'; -}); -_.shuffle([ - 1, - 2, - 3, - 4, - 5, - 6 -]); +_([1.3, 2.1, 2.4]).groupBy(function (e, i, list) { return Math.floor(e); }); +_.groupBy([1.3, 2.1, 2.4], function (num) { return Math.floor(num); }); +_.groupBy(['one', 'two', 'three'], 'length'); +_.countBy([1, 2, 3, 4, 5], function (num) { return num % 2 == 0 ? 'even' : 'odd'; }); +_.shuffle([1, 2, 3, 4, 5, 6]); // (function(){ return _.toArray(arguments).slice(1); })(1, 2, 3, 4); -_.size({ - one: 1, - two: 2, - three: 3 -}); +_.size({ one: 1, two: 2, three: 3 }); /////////////////////////////////////////////////////////////////////////////////////// -_.first([ - 5, - 4, - 3, - 2, - 1 -]); -_.initial([ - 5, - 4, - 3, - 2, - 1 -]); -_.last([ - 5, - 4, - 3, - 2, - 1 -]); -_.rest([ - 5, - 4, - 3, - 2, - 1 -]); -_.compact([ - 0, - 1, - false, - 2, - '', - 3 -]); -_.flatten([ - 1, - 2, - 3, - 4 -]); -_.flatten([ - 1, - [ - 2 - ] -]); +_.first([5, 4, 3, 2, 1]); +_.initial([5, 4, 3, 2, 1]); +_.last([5, 4, 3, 2, 1]); +_.rest([5, 4, 3, 2, 1]); +_.compact([0, 1, false, 2, '', 3]); +_.flatten([1, 2, 3, 4]); +_.flatten([1, [2]]); // typescript doesn't like the elements being different -_.flatten([ - 1, - [ - 2 - ], - [ - 3, - [ - [ - 4 - ] - ] - ] -]); -_.flatten([ - 1, - [ - 2 - ], - [ - 3, - [ - [ - 4 - ] - ] - ] -], true); -_.without([ - 1, - 2, - 1, - 0, - 3, - 1, - 4 -], 0, 1); -_.union([ - 1, - 2, - 3 -], [ - 101, - 2, - 1, - 10 -], [ - 2, - 1 -]); -_.intersection([ - 1, - 2, - 3 -], [ - 101, - 2, - 1, - 10 -], [ - 2, - 1 -]); -_.difference([ - 1, - 2, - 3, - 4, - 5 -], [ - 5, - 2, - 10 -]); -_.uniq([ - 1, - 2, - 1, - 3, - 1, - 4 -]); -_.zip([ - 'moe', - 'larry', - 'curly' -], [ - 30, - 40, - 50 -], [ - true, - false, - false -]); -_.object([ - 'moe', - 'larry', - 'curly' -], [ - 30, - 40, - 50 -]); -_.object([ - [ - 'moe', - 30 - ], - [ - 'larry', - 40 - ], - [ - 'curly', - 50 - ] -]); -_.indexOf([ - 1, - 2, - 3 -], 2); -_.lastIndexOf([ - 1, - 2, - 3, - 1, - 2, - 3 -], 2); -_.sortedIndex([ - 10, - 20, - 30, - 40, - 50 -], 35); +_.flatten([1, [2], [3, [[4]]]]); +_.flatten([1, [2], [3, [[4]]]], true); +_.without([1, 2, 1, 0, 3, 1, 4], 0, 1); +_.union([1, 2, 3], [101, 2, 1, 10], [2, 1]); +_.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]); +_.difference([1, 2, 3, 4, 5], [5, 2, 10]); +_.uniq([1, 2, 1, 3, 1, 4]); +_.zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]); +_.object(['moe', 'larry', 'curly'], [30, 40, 50]); +_.object([['moe', 30], ['larry', 40], ['curly', 50]]); +_.indexOf([1, 2, 3], 2); +_.lastIndexOf([1, 2, 3, 1, 2, 3], 2); +_.sortedIndex([10, 20, 30, 40, 50], 35); _.range(10); _.range(1, 11); _.range(0, 30, 5); _.range(0, 30, 5); _.range(0); /////////////////////////////////////////////////////////////////////////////////////// -var func = function (greeting) { - return greeting + ': ' + this.name; -}; +var func = function (greeting) { return greeting + ': ' + this.name; }; // need a second var otherwise typescript thinks func signature is the above func type, // instead of the newly returned _bind => func type. -var func2 = _.bind(func, { - name: 'moe' -}, 'hi'); +var func2 = _.bind(func, { name: 'moe' }, 'hi'); func2(); var buttonView = { label: 'underscore', - onClick: function () { - alert('clicked: ' + this.label); - }, - onHover: function () { - alert('hovering: ' + this.label); - } + onClick: function () { alert('clicked: ' + this.label); }, + onHover: function () { alert('hovering: ' + this.label); } }; _.bindAll(buttonView); $('#underscore_button').bind('click', buttonView.onClick); @@ -1339,153 +984,59 @@ var log = _.bind(function (message) { } }, Date); _.delay(log, 1000, 'logged later'); -_.defer(function () { - alert('deferred'); -}); -var updatePosition = function () { - return alert('updating position...'); -}; +_.defer(function () { alert('deferred'); }); +var updatePosition = function () { return alert('updating position...'); }; var throttled = _.throttle(updatePosition, 100); $(null).scroll(throttled); -var calculateLayout = function () { - return alert('calculating layout...'); -}; +var calculateLayout = function () { return alert('calculating layout...'); }; var lazyLayout = _.debounce(calculateLayout, 300); $(null).resize(lazyLayout); -var createApplication = function () { - return alert('creating application...'); -}; +var createApplication = function () { return alert('creating application...'); }; var initialize = _.once(createApplication); initialize(); initialize(); var notes; -var render = function () { - return alert("rendering..."); -}; +var render = function () { return alert("rendering..."); }; var renderNotes = _.after(notes.length, render); -_.each(notes, function (note) { - return note.asyncSave({ - success: renderNotes - }); -}); -var hello = function (name) { - return "hello: " + name; -}; -hello = _.wrap(hello, function (func, arg) { - return "before, " + func(arg) + ", after"; -}); +_.each(notes, function (note) { return note.asyncSave({ success: renderNotes }); }); +var hello = function (name) { return "hello: " + name; }; +hello = _.wrap(hello, function (func, arg) { return "before, " + func(arg) + ", after"; }); hello("moe"); -var greet = function (name) { - return "hi: " + name; -}; -var exclaim = function (statement) { - return statement + "!"; -}; +var greet = function (name) { return "hi: " + name; }; +var exclaim = function (statement) { return statement + "!"; }; var welcome = _.compose(exclaim, greet); welcome('moe'); /////////////////////////////////////////////////////////////////////////////////////// -_.keys({ - one: 1, - two: 2, - three: 3 -}); -_.values({ - one: 1, - two: 2, - three: 3 -}); -_.pairs({ - one: 1, - two: 2, - three: 3 -}); -_.invert({ - Moe: "Moses", - Larry: "Louis", - Curly: "Jerome" -}); +_.keys({ one: 1, two: 2, three: 3 }); +_.values({ one: 1, two: 2, three: 3 }); +_.pairs({ one: 1, two: 2, three: 3 }); +_.invert({ Moe: "Moses", Larry: "Louis", Curly: "Jerome" }); _.functions(_); -_.extend({ - name: 'moe' -}, { - age: 50 -}); -_.pick({ - name: 'moe', - age: 50, - userid: 'moe1' -}, 'name', 'age'); -_.omit({ - name: 'moe', - age: 50, - userid: 'moe1' -}, 'userid'); -var iceCream = { - flavor: "chocolate" -}; -_.defaults(iceCream, { - flavor: "vanilla", - sprinkles: "lots" -}); -_.clone({ - name: 'moe' -}); -_.chain([ - 1, - 2, - 3, - 200 -]).filter(function (num) { - return num % 2 == 0; -}).tap(alert).map(function (num) { - return num * num; -}).value(); -_.has({ - a: 1, - b: 2, - c: 3 -}, "b"); -var moe = { - name: 'moe', - luckyNumbers: [ - 13, - 27, - 34 - ] -}; -var clone = { - name: 'moe', - luckyNumbers: [ - 13, - 27, - 34 - ] -}; +_.extend({ name: 'moe' }, { age: 50 }); +_.pick({ name: 'moe', age: 50, userid: 'moe1' }, 'name', 'age'); +_.omit({ name: 'moe', age: 50, userid: 'moe1' }, 'userid'); +var iceCream = { flavor: "chocolate" }; +_.defaults(iceCream, { flavor: "vanilla", sprinkles: "lots" }); +_.clone({ name: 'moe' }); +_.chain([1, 2, 3, 200]) + .filter(function (num) { return num % 2 == 0; }) + .tap(alert) + .map(function (num) { return num * num; }) + .value(); +_.has({ a: 1, b: 2, c: 3 }, "b"); +var moe = { name: 'moe', luckyNumbers: [13, 27, 34] }; +var clone = { name: 'moe', luckyNumbers: [13, 27, 34] }; moe == clone; _.isEqual(moe, clone); -_.isEmpty([ - 1, - 2, - 3 -]); +_.isEmpty([1, 2, 3]); _.isEmpty({}); _.isElement($('body')[0]); -(function () { - return _.isArray(arguments); -})(); -_.isArray([ - 1, - 2, - 3 -]); +(function () { return _.isArray(arguments); })(); +_.isArray([1, 2, 3]); _.isObject({}); _.isObject(1); // (() => { return _.isArguments(arguments); })(1, 2, 3); -_.isArguments([ - 1, - 2, - 3 -]); +_.isArguments([1, 2, 3]); _.isFunction(alert); _.isString("moe"); _.isNumber(8.4 * 5); @@ -1502,14 +1053,10 @@ _.isNull(undefined); _.isUndefined(null.missingVariable); /////////////////////////////////////////////////////////////////////////////////////// var underscore = _.noConflict(); -var moe2 = { - name: 'moe' -}; +var moe2 = { name: 'moe' }; moe2 === _.identity(moe); var genie; -_.times(3, function (n) { - genie.grantWishNumber(n); -}); +_.times(3, function (n) { genie.grantWishNumber(n); }); _.random(0, 100); _.mixin({ capitalize: function (string) { @@ -1519,43 +1066,20 @@ _.mixin({ _("fabio").capitalize(); _.uniqueId('contact_'); _.escape('Curly, Larry & Moe'); -var object = { - cheese: 'crumpets', - stuff: function () { - return 'nonsense'; - } -}; +var object = { cheese: 'crumpets', stuff: function () { return 'nonsense'; } }; _.result(object, 'cheese'); _.result(object, 'stuff'); var compiled = _.template("hello: <%= name %>"); -compiled({ - name: 'moe' -}); +compiled({ name: 'moe' }); var list2 = "<% _.each(people, function(name) { %>
  • <%= name %>
  • <% }); %>"; -_.template(list2, { - people: [ - 'moe', - 'curly', - 'larry' - ] -}); +_.template(list2, { people: ['moe', 'curly', 'larry'] }); var template = _.template("<%- value %>"); -template({ - value: '